summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--COPYING339
-rw-r--r--DNSDIST-MIB.txt743
-rw-r--r--Makefile.am543
-rw-r--r--Makefile.in2500
-rw-r--r--README29
-rw-r--r--README.md29
-rw-r--r--aclocal.m41804
-rw-r--r--ascii.hh41
-rw-r--r--base64.hh26
-rw-r--r--bpf-filter.cc757
-rw-r--r--bpf-filter.ebpf.src503
-rw-r--r--bpf-filter.hh124
-rw-r--r--bpf-filter.main.ebpf136
-rw-r--r--bpf-filter.qname.ebpf4095
-rwxr-xr-xbuilder-support/gen-version77
-rw-r--r--cachecleaner.hh262
-rw-r--r--capabilities.cc75
-rw-r--r--capabilities.hh26
-rw-r--r--cdb.cc227
-rw-r--r--cdb.hh70
-rw-r--r--circular_buffer.hh38
-rwxr-xr-xcompile348
-rwxr-xr-xconfig.guess1476
-rw-r--r--config.h.in324
-rwxr-xr-xconfig.sub1801
-rwxr-xr-xconfigure27370
-rw-r--r--configure.ac242
-rw-r--r--connection-management.hh66
-rw-r--r--credentials.cc477
-rw-r--r--credentials.hh103
-rw-r--r--delaypipe.cc188
-rw-r--r--delaypipe.hh85
-rwxr-xr-xdepcomp791
-rw-r--r--devpollmplexer.cc216
-rw-r--r--dns.cc103
-rw-r--r--dns.hh245
-rw-r--r--dnscrypt.cc868
-rw-r--r--dnscrypt.hh302
-rw-r--r--dnsdist-backend.cc291
-rw-r--r--dnsdist-cache.cc490
-rw-r--r--dnsdist-cache.hh145
-rw-r--r--dnsdist-carbon.cc280
-rw-r--r--dnsdist-console.cc936
-rw-r--r--dnsdist-console.hh56
-rw-r--r--dnsdist-dnscrypt.cc49
-rw-r--r--dnsdist-dynblocks.cc756
-rw-r--r--dnsdist-dynblocks.hh437
-rw-r--r--dnsdist-dynbpf.cc85
-rw-r--r--dnsdist-dynbpf.hh75
-rw-r--r--dnsdist-ecs.cc1070
-rw-r--r--dnsdist-ecs.hh50
-rw-r--r--dnsdist-healthchecks.cc545
-rw-r--r--dnsdist-healthchecks.hh33
-rw-r--r--dnsdist-idstate.cc75
-rw-r--r--dnsdist-idstate.hh272
-rw-r--r--dnsdist-kvs.cc285
-rw-r--r--dnsdist-kvs.hh221
-rw-r--r--dnsdist-lbpolicies.cc357
-rw-r--r--dnsdist-lbpolicies.hh114
-rw-r--r--dnsdist-lua-actions.cc2454
-rw-r--r--dnsdist-lua-bindings-dnscrypt.cc155
-rw-r--r--dnsdist-lua-bindings-dnsquestion.cc305
-rw-r--r--dnsdist-lua-bindings-kvs.cc115
-rw-r--r--dnsdist-lua-bindings-packetcache.cc220
-rw-r--r--dnsdist-lua-bindings-protobuf.cc168
-rw-r--r--dnsdist-lua-bindings.cc624
-rw-r--r--dnsdist-lua-ffi-interface.h125
-rw-r--r--dnsdist-lua-ffi-interface.inc127
-rw-r--r--dnsdist-lua-ffi.cc583
-rw-r--r--dnsdist-lua-ffi.hh110
-rw-r--r--dnsdist-lua-inspection-ffi.cc106
-rw-r--r--dnsdist-lua-inspection-ffi.hh45
-rw-r--r--dnsdist-lua-inspection.cc857
-rw-r--r--dnsdist-lua-rules.cc621
-rw-r--r--dnsdist-lua-vars.cc126
-rw-r--r--dnsdist-lua-web.cc79
-rw-r--r--dnsdist-lua.cc2860
-rw-r--r--dnsdist-lua.hh109
-rw-r--r--dnsdist-nghttp2.cc1206
-rw-r--r--dnsdist-nghttp2.hh75
-rw-r--r--dnsdist-prometheus.hh72
-rw-r--r--dnsdist-protobuf.cc186
-rw-r--r--dnsdist-protobuf.hh93
-rw-r--r--dnsdist-protocols.cc80
-rw-r--r--dnsdist-protocols.hh53
-rw-r--r--dnsdist-proxy-protocol.cc111
-rw-r--r--dnsdist-proxy-protocol.hh38
-rw-r--r--dnsdist-rings.cc160
-rw-r--r--dnsdist-rings.hh229
-rw-r--r--dnsdist-rules.cc26
-rw-r--r--dnsdist-rules.hh1312
-rw-r--r--dnsdist-secpoll.cc246
-rw-r--r--dnsdist-secpoll.hh27
-rw-r--r--dnsdist-session-cache.cc90
-rw-r--r--dnsdist-session-cache.hh80
-rw-r--r--dnsdist-snmp.cc614
-rw-r--r--dnsdist-snmp.hh37
-rw-r--r--dnsdist-svc.cc133
-rw-r--r--dnsdist-svc.hh66
-rw-r--r--dnsdist-systemd.cc35
-rw-r--r--dnsdist-systemd.hh24
-rw-r--r--dnsdist-tcp-downstream.cc778
-rw-r--r--dnsdist-tcp-downstream.hh590
-rw-r--r--dnsdist-tcp-upstream.hh177
-rw-r--r--dnsdist-tcp.cc1382
-rw-r--r--dnsdist-tcp.hh282
-rw-r--r--dnsdist-web.cc1577
-rw-r--r--dnsdist-web.hh17
-rw-r--r--dnsdist-xpf.cc60
-rw-r--r--dnsdist-xpf.hh27
-rw-r--r--dnsdist.1143
-rw-r--r--dnsdist.cc2752
-rw-r--r--dnsdist.hh1086
-rw-r--r--dnsdist.service.in53
-rw-r--r--dnsdistconf.lua113
-rw-r--r--dnslabeltext.cc964
-rw-r--r--dnslabeltext.rl315
-rw-r--r--dnsmessage.proto183
-rw-r--r--dnsname.cc493
-rw-r--r--dnsname.hh533
-rw-r--r--dnsparser.cc1002
-rw-r--r--dnsparser.hh569
-rw-r--r--dnstap.cc92
-rw-r--r--dnstap.hh45
-rw-r--r--dnstap.proto330
-rw-r--r--dnswriter.cc521
-rw-r--r--dnswriter.hh183
-rw-r--r--doh.cc1707
-rw-r--r--doh.hh265
-rw-r--r--dolog.hh173
-rw-r--r--ednscookies.cc174
-rw-r--r--ednscookies.hh72
-rw-r--r--ednsoptions.cc163
-rw-r--r--ednsoptions.hh56
-rw-r--r--ednssubnet.cc108
-rw-r--r--ednssubnet.hh35
-rw-r--r--epollmplexer.cc240
-rw-r--r--ext/ipcrypt/LICENSE14
-rw-r--r--ext/ipcrypt/Makefile.am8
-rw-r--r--ext/ipcrypt/Makefile.in722
-rw-r--r--ext/ipcrypt/ipcrypt.c87
-rw-r--r--ext/ipcrypt/ipcrypt.h24
-rw-r--r--ext/json11/json11.cpp784
-rw-r--r--ext/json11/json11.hpp232
-rw-r--r--ext/libbpf/libbpf.h210
-rw-r--r--ext/lmdb-safe/lmdb-safe.cc364
-rw-r--r--ext/lmdb-safe/lmdb-safe.hh610
-rw-r--r--ext/luawrapper/include/LuaContext.hpp3002
-rw-r--r--ext/protozero/include/protozero/basic_pbf_builder.hpp266
-rw-r--r--ext/protozero/include/protozero/basic_pbf_writer.hpp1054
-rw-r--r--ext/protozero/include/protozero/buffer_fixed.hpp222
-rw-r--r--ext/protozero/include/protozero/buffer_string.hpp76
-rw-r--r--ext/protozero/include/protozero/buffer_tmpl.hpp113
-rw-r--r--ext/protozero/include/protozero/buffer_vector.hpp76
-rw-r--r--ext/protozero/include/protozero/byteswap.hpp99
-rw-r--r--ext/protozero/include/protozero/config.hpp48
-rw-r--r--ext/protozero/include/protozero/data_view.hpp236
-rw-r--r--ext/protozero/include/protozero/exception.hpp101
-rw-r--r--ext/protozero/include/protozero/iterators.hpp481
-rw-r--r--ext/protozero/include/protozero/pbf_builder.hpp32
-rw-r--r--ext/protozero/include/protozero/pbf_message.hpp184
-rw-r--r--ext/protozero/include/protozero/pbf_reader.hpp977
-rw-r--r--ext/protozero/include/protozero/pbf_writer.hpp76
-rw-r--r--ext/protozero/include/protozero/types.hpp66
-rw-r--r--ext/protozero/include/protozero/varint.hpp245
-rw-r--r--ext/protozero/include/protozero/version.hpp34
-rw-r--r--ext/yahttp/LICENSE21
-rw-r--r--ext/yahttp/Makefile.am3
-rw-r--r--ext/yahttp/Makefile.in740
-rw-r--r--ext/yahttp/README.md69
-rw-r--r--ext/yahttp/yahttp/Makefile.am13
-rw-r--r--ext/yahttp/yahttp/Makefile.in748
-rw-r--r--ext/yahttp/yahttp/cookie.hpp144
-rw-r--r--ext/yahttp/yahttp/exception.hpp24
-rw-r--r--ext/yahttp/yahttp/reqresp.cpp331
-rw-r--r--ext/yahttp/yahttp/reqresp.hpp351
-rw-r--r--ext/yahttp/yahttp/router.cpp160
-rw-r--r--ext/yahttp/yahttp/router.hpp72
-rw-r--r--ext/yahttp/yahttp/url.hpp200
-rw-r--r--ext/yahttp/yahttp/utility.hpp462
-rw-r--r--ext/yahttp/yahttp/yahttp-config.h1
-rw-r--r--ext/yahttp/yahttp/yahttp.hpp37
-rw-r--r--fstrm_logger.cc202
-rw-r--r--fstrm_logger.hh69
-rw-r--r--gettime.cc52
-rw-r--r--gettime.hh24
-rw-r--r--html/detail.css104
-rw-r--r--html/graph.css177
-rw-r--r--html/index.html106
-rw-r--r--html/js/d3.min.js5
-rw-r--r--html/js/jquery.min.js5
-rw-r--r--html/js/moment.min.js7
-rw-r--r--html/js/rickshaw.min.js3
-rw-r--r--html/legend.css73
-rw-r--r--html/lines.css21
-rw-r--r--html/local.js275
-rw-r--r--html/powerdns-logo-220px.pngbin0 -> 6084 bytes
-rw-r--r--htmlfiles.h24743
-rwxr-xr-xincfiles26
-rwxr-xr-xinstall-sh518
-rw-r--r--ipcipher.cc99
-rw-r--r--ipcipher.hh9
-rw-r--r--iputils.cc545
-rw-r--r--iputils.hh1657
-rw-r--r--kqueuemplexer.cc242
-rw-r--r--libssl.cc855
-rw-r--r--libssl.hh138
-rw-r--r--lock.hh452
-rw-r--r--ltmain.sh11153
-rw-r--r--lua_hpp.mk6
-rw-r--r--m4/ac_pthread_set_name.m471
-rw-r--r--m4/ax_arg_default_enable_disable.m421
-rw-r--r--m4/ax_check_sign.m456
-rw-r--r--m4/ax_compile_check_sizeof.m4115
-rw-r--r--m4/ax_cxx_compile_stdcxx.m4951
-rw-r--r--m4/ax_cxx_compile_stdcxx_17.m435
-rw-r--r--m4/ax_python_module.m456
-rw-r--r--m4/boost.m41834
-rw-r--r--m4/dnsdist_enable_dnscrypt.m418
-rw-r--r--m4/dnsdist_enable_doh.m415
-rw-r--r--m4/libtool.m48369
-rw-r--r--m4/ltoptions.m4437
-rw-r--r--m4/ltsugar.m4124
-rw-r--r--m4/ltversion.m423
-rw-r--r--m4/lt~obsolete.m499
-rw-r--r--m4/pdns_check_cdb.m421
-rw-r--r--m4/pdns_check_clock_gettime.m46
-rw-r--r--m4/pdns_check_dnstap.m431
-rw-r--r--m4/pdns_check_libcrypto.m4129
-rw-r--r--m4/pdns_check_libedit.m43
-rw-r--r--m4/pdns_check_libh2o_evloop.m421
-rw-r--r--m4/pdns_check_lmdb.m449
-rw-r--r--m4/pdns_check_lua_hpp.m410
-rw-r--r--m4/pdns_check_network_libs.m47
-rw-r--r--m4/pdns_check_os.m463
-rw-r--r--m4/pdns_check_pthread_np.m46
-rw-r--r--m4/pdns_check_python_venv.m49
-rw-r--r--m4/pdns_check_ragel.m48
-rw-r--r--m4/pdns_check_secure_memset.m43
-rw-r--r--m4/pdns_check_time_t.m47
-rw-r--r--m4/pdns_d_fortify_source.m428
-rw-r--r--m4/pdns_enable_sanitizers.m4167
-rw-r--r--m4/pdns_enable_tls.m414
-rw-r--r--m4/pdns_enable_unit_tests.m418
-rw-r--r--m4/pdns_param_ssp_buffer_size.m426
-rw-r--r--m4/pdns_pie.m455
-rw-r--r--m4/pdns_relro.m437
-rw-r--r--m4/pdns_stack_protector.m426
-rw-r--r--m4/pdns_with_ebpf.m438
-rw-r--r--m4/pdns_with_gnutls.m434
-rw-r--r--m4/pdns_with_libcap.m425
-rw-r--r--m4/pdns_with_libsodium.m430
-rw-r--r--m4/pdns_with_libssl.m433
-rw-r--r--m4/pdns_with_lua.m462
-rw-r--r--m4/pdns_with_net_snmp.m435
-rw-r--r--m4/pdns_with_nghttp2.m432
-rw-r--r--m4/pdns_with_re2.m422
-rw-r--r--m4/pdns_with_service_user.m417
-rw-r--r--m4/systemd.m4223
-rw-r--r--m4/warnings.m479
-rw-r--r--misc.cc1752
-rw-r--r--misc.hh692
-rwxr-xr-xmissing215
-rw-r--r--mplexer.hh314
-rw-r--r--namespaces.hh60
-rw-r--r--noinitvector.hh67
-rw-r--r--packetcache.hh233
-rw-r--r--pdnsexception.hh42
-rw-r--r--pollmplexer.cc199
-rw-r--r--portsmplexer.cc241
-rw-r--r--protozero.cc159
-rw-r--r--protozero.hh272
-rw-r--r--proxy-protocol.cc263
-rw-r--r--proxy-protocol.hh51
-rw-r--r--qtype.cc183
-rw-r--r--qtype.hh181
-rw-r--r--remote_logger.cc237
-rw-r--r--remote_logger.hh120
-rw-r--r--sholder.hh145
-rw-r--r--snmp-agent.cc206
-rw-r--r--snmp-agent.hh64
-rw-r--r--sodcrypto.cc354
-rw-r--r--sodcrypto.hh78
-rw-r--r--src_js/SOURCES4
-rw-r--r--src_js/d3.js9553
-rw-r--r--src_js/jquery.js11027
-rw-r--r--src_js/moment.js3606
-rw-r--r--src_js/rickshaw.js4068
-rw-r--r--sstuff.hh390
-rw-r--r--stat_t.hh79
-rw-r--r--statnode.cc127
-rw-r--r--statnode.hh74
-rw-r--r--svc-records.cc186
-rw-r--r--svc-records.hh108
-rw-r--r--tcpiohandler-mplexer.hh209
-rw-r--r--tcpiohandler.cc1775
-rw-r--r--tcpiohandler.hh573
-rw-r--r--test-base64_cc.cc77
-rw-r--r--test-connectionmanagement_hh.cc93
-rw-r--r--test-credentials_cc.cc117
-rw-r--r--test-delaypipe_hh.cc80
-rw-r--r--test-dnscrypt_cc.cc298
-rw-r--r--test-dnsdist-connections-cache.cc234
-rw-r--r--test-dnsdist_cc.cc2083
-rw-r--r--test-dnsdistdynblocks_hh.cc1482
-rw-r--r--test-dnsdistkvs_cc.cc443
-rw-r--r--test-dnsdistlbpolicies_cc.cc847
-rw-r--r--test-dnsdistnghttp2_cc.cc1986
-rw-r--r--test-dnsdistpacketcache_cc.cc725
-rw-r--r--test-dnsdistrings_cc.cc290
-rw-r--r--test-dnsdistrules_cc.cc149
-rw-r--r--test-dnsdistsvc_cc.cc96
-rw-r--r--test-dnsdisttcp_cc.cc4068
-rw-r--r--test-dnsparser_cc.cc486
-rwxr-xr-xtest-driver148
-rw-r--r--test-iputils_hh.cc855
-rw-r--r--test-luawrapper.cc33
-rw-r--r--test-mplexer.cc401
-rw-r--r--test-proxy_protocol_cc.cc227
-rw-r--r--testrunner.cc31
-rw-r--r--threadname.cc69
-rw-r--r--threadname.hh25
-rw-r--r--uuid-utils.cc52
-rw-r--r--uuid-utils.hh29
-rw-r--r--xpf.cc118
-rw-r--r--xpf.hh29
326 files changed, 208574 insertions, 0 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..ecbc059
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. \ No newline at end of file
diff --git a/DNSDIST-MIB.txt b/DNSDIST-MIB.txt
new file mode 100644
index 0000000..d6f5a92
--- /dev/null
+++ b/DNSDIST-MIB.txt
@@ -0,0 +1,743 @@
+-- -*- snmpv2 -*-
+-- ----------------------------------------------------------------------
+-- MIB file for dnsdist
+-- ----------------------------------------------------------------------
+
+DNSDIST-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ OBJECT-TYPE, MODULE-IDENTITY, enterprises,
+ Counter64, Unsigned32, NOTIFICATION-TYPE
+ FROM SNMPv2-SMI
+ CounterBasedGauge64
+ FROM HCNUM-TC
+ Float64TC
+ FROM FLOAT-TC-MIB
+ OBJECT-GROUP, MODULE-COMPLIANCE, NOTIFICATION-GROUP
+ FROM SNMPv2-CONF
+ InetAddressType
+ FROM INET-ADDRESS-MIB
+ TEXTUAL-CONVENTION, DisplayString
+ FROM SNMPv2-TC;
+
+dnsdist MODULE-IDENTITY
+ LAST-UPDATED "201611080000Z"
+ ORGANIZATION "PowerDNS BV"
+ CONTACT-INFO "support@powerdns.com"
+ DESCRIPTION
+ "This MIB module describes information gathered through dnsdist."
+
+ REVISION "201611080000Z"
+ DESCRIPTION "Initial revision."
+
+ ::= { powerdns 3 }
+
+powerdns OBJECT IDENTIFIER ::= { enterprises 43315 }
+
+stats OBJECT IDENTIFIER ::= { dnsdist 1 }
+
+queries OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries received"
+ ::= { stats 1 }
+
+responses OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of responses received"
+ ::= { stats 2 }
+
+servfailResponses OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of servfail responses received"
+ ::= { stats 3 }
+
+aclDrops OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries dropped because of the ACL"
+ ::= { stats 4 }
+
+-- stats 5 was a BlockFilter Counter, removed in 1.2.0
+
+ruleDrop OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries dropped because of a rule"
+ ::= { stats 6 }
+
+ruleNXDomain OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of NXDomain responses returned because of a rule"
+ ::= { stats 7 }
+
+ruleRefused OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of Refused responses returned because of a rule"
+ ::= { stats 8 }
+
+selfAnswered OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of self-answered responses"
+ ::= { stats 9 }
+
+downstreamTimeouts OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of downstream timeouts"
+ ::= { stats 10 }
+
+downstreamSendErrors OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of downstream send errors"
+ ::= { stats 11 }
+
+truncFailures OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of errors while truncating a response"
+ ::= { stats 12 }
+
+noPolicy OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries dropped because no server was available"
+ ::= { stats 13 }
+
+latency01 OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries answered in less than 1 ms"
+ ::= { stats 14 }
+
+latency110 OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries answered in 1-10 ms"
+ ::= { stats 15 }
+
+latency1050 OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries answered in 10-50 ms"
+ ::= { stats 16 }
+
+latency50100 OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries answered in 50-100 ms"
+ ::= { stats 17 }
+
+latency1001000 OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries answered in 100-1000 ms"
+ ::= { stats 18 }
+
+latencySlow OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries answered in more than 1s"
+ ::= { stats 19 }
+
+latencyAVG100 OBJECT-TYPE
+ SYNTAX Float64TC
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Average latency over the last 100 queries"
+ ::= { stats 20 }
+
+latencyAVG1000 OBJECT-TYPE
+ SYNTAX Float64TC
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Average latency over the last 1000 queries"
+ ::= { stats 21 }
+
+latencyAVG10000 OBJECT-TYPE
+ SYNTAX Float64TC
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Average latency over the last 10000 queries"
+ ::= { stats 22 }
+
+latencyAVG1000000 OBJECT-TYPE
+ SYNTAX Float64TC
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Average latency over the last 1000000 queries"
+ ::= { stats 23 }
+
+uptime OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Uptime of the dnsdist process, in seconds"
+ ::= { stats 24 }
+
+realMemoryUsage OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Memory usage"
+ ::= { stats 25 }
+
+nonCompliantQueries OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries dropped as non-compliant"
+ ::= { stats 26 }
+
+nonCompliantResponses OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of responses dropped as non-compliant"
+ ::= { stats 27 }
+
+rdQueries OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries with the RD flag set"
+ ::= { stats 28 }
+
+emptyQueries OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of empty queries received"
+ ::= { stats 29 }
+
+cacheHits OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of cache hits"
+ ::= { stats 30 }
+
+cacheMisses OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of cache misses"
+ ::= { stats 31 }
+
+cpuUserMSec OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "CPU Usage (user)"
+ ::= { stats 32 }
+
+cpuSysMSec OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "CPU Usage (sys)"
+ ::= { stats 33 }
+
+fdUsage OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of file descriptors"
+ ::= { stats 34 }
+
+dynBlocked OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries dropped because of a dynamic block"
+ ::= { stats 35 }
+
+dynBlockNMGSize OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Dynamic blocks (NMG) size"
+ ::= { stats 36 }
+
+ruleServFail OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of ServFail responses returned because of a rule"
+ ::= { stats 37 }
+
+securityStatus OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Security status of this software. 0=unknown, 1=OK, 2=upgrade recommended, 3=upgrade mandatory"
+ ::= { stats 38 }
+
+specialMemoryUsage OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Memory usage (more precise but expensive to retrieve)"
+ ::= { stats 39 }
+
+ruleTruncated OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of Truncated responses returned because of a rule"
+ ::= { stats 40 }
+
+backendStatTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF BackendStatEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Statistics for backends"
+ ::= { dnsdist 2 }
+
+backendStatEntry OBJECT-TYPE
+ SYNTAX BackendStatEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Statistics for one backend"
+ INDEX { backendId }
+ ::= { backendStatTable 1 }
+
+BackendStatEntry ::= SEQUENCE {
+ backendId Unsigned32,
+ backendName DisplayString,
+ backendLatency CounterBasedGauge64,
+ backendWeight CounterBasedGauge64,
+ backendOutstanding CounterBasedGauge64,
+ backendQPSLimit CounterBasedGauge64,
+ backendReused Counter64,
+ backendState DisplayString,
+ backendAddress OCTET STRING,
+ backendPools DisplayString,
+ backendQPS CounterBasedGauge64,
+ backendQueries Counter64,
+ backendOrder CounterBasedGauge64
+}
+
+backendId OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Backend ID"
+ ::= { backendStatEntry 1 }
+
+backendName OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend name"
+ ::= { backendStatEntry 2 }
+
+backendLatency OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend latency"
+ ::= { backendStatEntry 3 }
+
+backendWeight OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend weight"
+ ::= { backendStatEntry 4 }
+
+backendOutstanding OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend outstanding queries"
+ ::= { backendStatEntry 5 }
+
+backendQPSLimit OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend QPS limit"
+ ::= { backendStatEntry 6 }
+
+backendReused OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend reused slots"
+ ::= { backendStatEntry 7 }
+
+backendState OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend state"
+ ::= { backendStatEntry 8 }
+
+backendAddress OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE (2..24))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend address"
+ ::= { backendStatEntry 9 }
+
+backendPools OBJECT-TYPE
+ SYNTAX DisplayString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "List of pools this backend belongs to"
+ ::= { backendStatEntry 10 }
+
+backendQPS OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend QPS"
+ ::= { backendStatEntry 11 }
+
+backendQueries OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of queries sent to this backend"
+ ::= { backendStatEntry 12 }
+
+backendOrder OBJECT-TYPE
+ SYNTAX CounterBasedGauge64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Backend order"
+ ::= { backendStatEntry 13 }
+
+---
+--- Textual Conventions
+---
+
+SocketProtocolType ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "A value that represents a type of socket protocol."
+ SYNTAX INTEGER {
+ unknown(0),
+ udp(1),
+ tcp(2)
+ }
+
+DNSQueryType ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "A value that represents a type of DNS query (question or response)."
+ SYNTAX INTEGER {
+ unknown(0),
+ question(1),
+ response(2)
+ }
+
+---
+--- Traps / Notifications
+---
+
+trap OBJECT IDENTIFIER ::= { dnsdist 10 }
+traps OBJECT IDENTIFIER ::= { trap 0 } --- reverse-mappable
+trapObjects OBJECT IDENTIFIER ::= { dnsdist 11 }
+
+socketFamily OBJECT-TYPE
+ SYNTAX InetAddressType
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Socket family type"
+ ::= { trapObjects 1 }
+
+socketProtocol OBJECT-TYPE
+ SYNTAX SocketProtocolType
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Socket protocol type"
+ ::= { trapObjects 2 }
+
+fromAddress OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE (2..24))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Requestor address"
+ ::= { trapObjects 3 }
+
+toAddress OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE (2..24))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Responder address"
+ ::= { trapObjects 4 }
+
+queryType OBJECT-TYPE
+ SYNTAX DNSQueryType
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Query / Response"
+ ::= { trapObjects 5 }
+
+querySize OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Size in bytes"
+ ::= { trapObjects 6 }
+
+queryID OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "DNS query ID"
+ ::= { trapObjects 7 }
+
+qName OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE (0..255))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "DNS qname"
+ ::= { trapObjects 8 }
+
+qClass OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "DNS query class"
+ ::= { trapObjects 9 }
+
+qType OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "DNS query type"
+ ::= { trapObjects 10 }
+
+trapReason OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Reason for this trap"
+ ::= { trapObjects 11 }
+
+--- { trapObjects 5000 } up to and including { trapObjects 5999 } are reserved for local, product-specific extensions to the dnsdist MIB
+
+backendStatusChangeTrap NOTIFICATION-TYPE
+ OBJECTS {
+ backendName,
+ backendAddress,
+ backendState
+ }
+ STATUS current
+ DESCRIPTION "Backend status changed"
+ ::= { traps 1 }
+
+actionTrap NOTIFICATION-TYPE
+ OBJECTS {
+ socketFamily,
+ socketProtocol,
+ fromAddress,
+ toAddress,
+ queryType,
+ querySize,
+ queryID,
+ qName,
+ qClass,
+ qType,
+ trapReason
+ }
+ STATUS current
+ DESCRIPTION "Trap sent by SNMPTrapAction"
+ ::= { traps 2 }
+
+customTrap NOTIFICATION-TYPE
+ OBJECTS {
+ trapReason
+ }
+ STATUS current
+ DESCRIPTION "Trap sent by sendCustomTrap"
+ ::= { traps 3 }
+
+--- { traps 5000 } up to and including { traps 5999 } are reserved for local, product-specific extensions to the dnsdist MIB
+
+---
+--- Conformance
+---
+
+dnsdistConformance OBJECT IDENTIFIER ::= { dnsdist 100 }
+
+dnsdistCompliances MODULE-COMPLIANCE
+ STATUS current
+ DESCRIPTION "dnsdist compliance statement"
+ MODULE
+ MANDATORY-GROUPS {
+ dnsdistGroup,
+ dnsdistTrapsGroup
+ }
+ ::= { dnsdistConformance 1 }
+
+dnsdistGroup OBJECT-GROUP
+ OBJECTS {
+ queries,
+ responses,
+ servfailResponses,
+ aclDrops,
+ ruleDrop,
+ ruleNXDomain,
+ ruleRefused,
+ ruleServFail,
+ ruleTruncated,
+ selfAnswered,
+ downstreamTimeouts,
+ downstreamSendErrors,
+ truncFailures,
+ noPolicy,
+ latency01,
+ latency110,
+ latency1050,
+ latency50100,
+ latency1001000,
+ latencySlow,
+ latencyAVG100,
+ latencyAVG1000,
+ latencyAVG10000,
+ latencyAVG1000000,
+ uptime,
+ realMemoryUsage,
+ specialMemoryUsage,
+ nonCompliantQueries,
+ nonCompliantResponses,
+ rdQueries,
+ emptyQueries,
+ cacheHits,
+ cacheMisses,
+ cpuUserMSec,
+ cpuSysMSec,
+ fdUsage,
+ dynBlocked,
+ dynBlockNMGSize,
+ securityStatus,
+ backendName,
+ backendLatency,
+ backendWeight,
+ backendOutstanding,
+ backendQPSLimit,
+ backendReused,
+ backendState,
+ backendAddress,
+ backendPools,
+ backendQPS,
+ backendQueries,
+ backendOrder,
+ socketFamily,
+ socketProtocol,
+ fromAddress,
+ toAddress,
+ queryType,
+ querySize,
+ queryID,
+ qName,
+ qClass,
+ qType,
+ trapReason
+ }
+ STATUS current
+ DESCRIPTION "Objects conformance group for dnsdist"
+ ::= { dnsdistConformance 2 }
+
+dnsdistTrapsGroup NOTIFICATION-GROUP
+ NOTIFICATIONS {
+ actionTrap,
+ customTrap,
+ backendStatusChangeTrap
+ }
+ STATUS current
+ DESCRIPTION "Traps conformance group for dnsdist"
+ ::= { dnsdistConformance 3 }
+
+END
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..f1a6140
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,543 @@
+AM_CPPFLAGS += $(SYSTEMD_CFLAGS) \
+ $(LUA_CFLAGS) \
+ $(LIBEDIT_CFLAGS) \
+ $(LIBSODIUM_CFLAGS) \
+ $(FSTRM_CFLAGS) \
+ $(YAHTTP_CFLAGS) \
+ $(NET_SNMP_CFLAGS) \
+ $(NGHTTP2_CFLAGS) \
+ $(LIBCAP_CFLAGS) \
+ -I$(top_srcdir)/ext/protozero/include \
+ -DSYSCONFDIR=\"${sysconfdir}\" \
+ -DBOOST_CONTAINER_USE_STD_EXCEPTIONS
+
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS=ext/ipcrypt \
+ ext/yahttp
+
+CLEANFILES = \
+ htmlfiles.h.tmp \
+ htmlfiles.h \
+ dnsdist-lua-ffi-interface.inc
+
+dnslabeltext.cc: dnslabeltext.rl
+ $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
+
+BUILT_SOURCES=htmlfiles.h \
+ dnsdist-lua-ffi-interface.inc \
+ dnslabeltext.cc
+
+htmlfiles.h: $(srcdir)/html/* $(srcdir)/incfiles
+ $(AM_V_GEN)$(srcdir)/incfiles $(srcdir) > $@.tmp
+ @mv $@.tmp $@
+
+dnsdist-lua-ffi-interface.inc: dnsdist-lua-ffi-interface.h
+ $(AM_V_GEN)echo 'R"FFIContent(' > $@
+ @cat $< >> $@
+ @echo ')FFIContent"' >> $@
+SRC_JS_FILES := $(wildcard src_js/*.js)
+MIN_JS_FILES := $(patsubst src_js/%.js,html/js/%.min.js,$(SRC_JS_FILES))
+
+html/js/%.min.js: src_js/%.js
+ uglifyjs $< > $@
+
+min_js: $(MIN_JS_FILES)
+
+if HAVE_RE2
+# Some versions of pkg_config add -std=c11++, override that
+AM_CPPFLAGS += $(RE2_CFLAGS)
+AM_CPPFLAGS += -std=c++17
+endif
+
+if HAVE_DNS_OVER_TLS
+if HAVE_LIBSSL
+AM_CPPFLAGS += $(LIBSSL_CFLAGS)
+endif
+
+if HAVE_GNUTLS
+AM_CPPFLAGS += $(GNUTLS_CFLAGS)
+endif
+endif
+
+if HAVE_LIBCRYPTO
+AM_CPPFLAGS += $(LIBCRYPTO_INCLUDES)
+endif
+
+if HAVE_CDB
+AM_CPPFLAGS += $(CDB_CFLAGS)
+endif
+
+if HAVE_LMDB
+AM_CPPFLAGS += $(LMDB_CFLAGS)
+endif
+
+if HAVE_DNS_OVER_HTTPS
+if HAVE_LIBSSL
+AM_CPPFLAGS += $(LIBSSL_CFLAGS)
+endif
+
+if HAVE_LIBH2OEVLOOP
+AM_CPPFLAGS += $(LIBH2OEVLOOP_CFLAGS)
+endif
+endif
+
+EXTRA_DIST=COPYING \
+ dnslabeltext.rl \
+ dnsdistconf.lua \
+ dnsmessage.proto \
+ dnstap.proto \
+ README.md \
+ delaypipe.cc delaypipe.hh \
+ html \
+ incfiles \
+ src_js \
+ dnsdist.service.in \
+ lua_hpp.mk \
+ bpf-filter.main.ebpf \
+ bpf-filter.qname.ebpf \
+ bpf-filter.ebpf.src \
+ DNSDIST-MIB.txt \
+ devpollmplexer.cc \
+ epollmplexer.cc \
+ kqueuemplexer.cc \
+ portsmplexer.cc \
+ cdb.cc cdb.hh \
+ ext/lmdb-safe/lmdb-safe.cc ext/lmdb-safe/lmdb-safe.hh \
+ ext/protozero/include/* \
+ builder-support/gen-version
+
+bin_PROGRAMS = dnsdist
+
+if UNIT_TESTS
+noinst_PROGRAMS = testrunner
+TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)'
+TESTS=testrunner
+else
+check-local:
+ @echo "Unit tests are not enabled"
+ @echo "Run ./configure --enable-unit-tests"
+endif
+
+dnsdist-web.$(OBJEXT): htmlfiles.h
+dnsdist-lua-ffi.$(OBJEXT): dnsdist-lua-ffi-interface.inc
+
+dnsdist_SOURCES = \
+ ascii.hh \
+ base64.hh \
+ bpf-filter.cc bpf-filter.hh \
+ cachecleaner.hh \
+ capabilities.cc capabilities.hh \
+ circular_buffer.hh \
+ connection-management.hh \
+ credentials.cc credentials.hh \
+ dns.cc dns.hh \
+ dnscrypt.cc dnscrypt.hh \
+ dnsdist-backend.cc \
+ dnsdist-cache.cc dnsdist-cache.hh \
+ dnsdist-carbon.cc \
+ dnsdist-console.cc dnsdist-console.hh \
+ dnsdist-dnscrypt.cc \
+ dnsdist-dynblocks.cc dnsdist-dynblocks.hh \
+ dnsdist-dynbpf.cc dnsdist-dynbpf.hh \
+ dnsdist-ecs.cc dnsdist-ecs.hh \
+ dnsdist-healthchecks.cc dnsdist-healthchecks.hh \
+ dnsdist-idstate.cc dnsdist-idstate.hh \
+ dnsdist-kvs.hh dnsdist-kvs.cc \
+ dnsdist-lbpolicies.cc dnsdist-lbpolicies.hh \
+ dnsdist-lua-actions.cc \
+ dnsdist-lua-bindings-dnscrypt.cc \
+ dnsdist-lua-bindings-dnsquestion.cc \
+ dnsdist-lua-bindings-kvs.cc \
+ dnsdist-lua-bindings-packetcache.cc \
+ dnsdist-lua-bindings-protobuf.cc \
+ dnsdist-lua-bindings.cc \
+ dnsdist-lua-ffi-interface.h dnsdist-lua-ffi-interface.inc \
+ dnsdist-lua-ffi.cc dnsdist-lua-ffi.hh \
+ dnsdist-lua-inspection-ffi.cc dnsdist-lua-inspection-ffi.hh \
+ dnsdist-lua-inspection.cc \
+ dnsdist-lua-rules.cc \
+ dnsdist-lua-vars.cc \
+ dnsdist-lua-web.cc \
+ dnsdist-lua.cc dnsdist-lua.hh \
+ dnsdist-nghttp2.cc dnsdist-nghttp2.hh \
+ dnsdist-prometheus.hh \
+ dnsdist-protobuf.cc dnsdist-protobuf.hh \
+ dnsdist-protocols.cc dnsdist-protocols.hh \
+ dnsdist-proxy-protocol.cc dnsdist-proxy-protocol.hh \
+ dnsdist-rings.cc dnsdist-rings.hh \
+ dnsdist-rules.cc dnsdist-rules.hh \
+ dnsdist-secpoll.cc dnsdist-secpoll.hh \
+ dnsdist-session-cache.cc dnsdist-session-cache.hh \
+ dnsdist-snmp.cc dnsdist-snmp.hh \
+ dnsdist-svc.cc dnsdist-svc.hh \
+ dnsdist-systemd.cc dnsdist-systemd.hh \
+ dnsdist-tcp-downstream.cc dnsdist-tcp-downstream.hh \
+ dnsdist-tcp-upstream.hh \
+ dnsdist-tcp.cc dnsdist-tcp.hh \
+ dnsdist-web.cc dnsdist-web.hh \
+ dnsdist-xpf.cc dnsdist-xpf.hh \
+ dnsdist.cc dnsdist.hh \
+ dnslabeltext.cc \
+ dnsname.cc dnsname.hh \
+ dnsparser.hh dnsparser.cc \
+ dnstap.cc dnstap.hh \
+ dnswriter.cc dnswriter.hh \
+ doh.hh doh.cc \
+ dolog.hh \
+ ednscookies.cc ednscookies.hh \
+ ednsoptions.cc ednsoptions.hh \
+ ednssubnet.cc ednssubnet.hh \
+ ext/json11/json11.cpp \
+ ext/json11/json11.hpp \
+ ext/libbpf/libbpf.h \
+ ext/luawrapper/include/LuaContext.hpp \
+ fstrm_logger.cc fstrm_logger.hh \
+ gettime.cc gettime.hh \
+ htmlfiles.h \
+ iputils.cc iputils.hh \
+ libssl.cc libssl.hh \
+ lock.hh \
+ misc.cc misc.hh \
+ mplexer.hh \
+ namespaces.hh \
+ noinitvector.hh \
+ packetcache.hh \
+ pdnsexception.hh \
+ pollmplexer.cc \
+ protozero.cc protozero.hh \
+ proxy-protocol.cc proxy-protocol.hh \
+ qtype.cc qtype.hh \
+ remote_logger.cc remote_logger.hh \
+ sholder.hh \
+ snmp-agent.cc snmp-agent.hh \
+ sodcrypto.cc sodcrypto.hh \
+ sstuff.hh \
+ stat_t.hh \
+ statnode.cc statnode.hh \
+ svc-records.cc svc-records.hh \
+ tcpiohandler-mplexer.hh \
+ tcpiohandler.cc tcpiohandler.hh \
+ threadname.hh threadname.cc \
+ uuid-utils.hh uuid-utils.cc \
+ xpf.cc xpf.hh
+
+testrunner_SOURCES = \
+ base64.hh \
+ bpf-filter.cc bpf-filter.hh \
+ cachecleaner.hh \
+ circular_buffer.hh \
+ connection-management.hh \
+ credentials.cc credentials.hh \
+ dns.cc dns.hh \
+ dnscrypt.cc dnscrypt.hh \
+ dnsdist-backend.cc \
+ dnsdist-cache.cc dnsdist-cache.hh \
+ dnsdist-dynblocks.cc dnsdist-dynblocks.hh \
+ dnsdist-dynbpf.cc dnsdist-dynbpf.hh \
+ dnsdist-ecs.cc dnsdist-ecs.hh \
+ dnsdist-idstate.cc dnsdist-idstate.hh \
+ dnsdist-kvs.cc dnsdist-kvs.hh \
+ dnsdist-lbpolicies.cc dnsdist-lbpolicies.hh \
+ dnsdist-lua-bindings-dnsquestion.cc \
+ dnsdist-lua-bindings-kvs.cc \
+ dnsdist-lua-bindings.cc \
+ dnsdist-lua-ffi-interface.h dnsdist-lua-ffi-interface.inc \
+ dnsdist-lua-ffi.cc dnsdist-lua-ffi.hh \
+ dnsdist-lua-vars.cc \
+ dnsdist-nghttp2.cc dnsdist-nghttp2.hh \
+ dnsdist-protocols.cc dnsdist-protocols.hh \
+ dnsdist-proxy-protocol.cc dnsdist-proxy-protocol.hh \
+ dnsdist-rings.cc dnsdist-rings.hh \
+ dnsdist-rules.cc dnsdist-rules.hh \
+ dnsdist-session-cache.cc dnsdist-session-cache.hh \
+ dnsdist-svc.cc dnsdist-svc.hh \
+ dnsdist-tcp-downstream.cc \
+ dnsdist-tcp.cc dnsdist-tcp.hh \
+ dnsdist-xpf.cc dnsdist-xpf.hh \
+ dnsdist.hh \
+ dnslabeltext.cc \
+ dnsname.cc dnsname.hh \
+ dnsparser.hh dnsparser.cc \
+ dnswriter.cc dnswriter.hh \
+ dolog.hh \
+ ednscookies.cc ednscookies.hh \
+ ednsoptions.cc ednsoptions.hh \
+ ednssubnet.cc ednssubnet.hh \
+ ext/luawrapper/include/LuaContext.hpp \
+ gettime.cc gettime.hh \
+ iputils.cc iputils.hh \
+ misc.cc misc.hh \
+ namespaces.hh \
+ noinitvector.hh \
+ pdnsexception.hh \
+ pollmplexer.cc \
+ proxy-protocol.cc proxy-protocol.hh \
+ qtype.cc qtype.hh \
+ sholder.hh \
+ sodcrypto.cc \
+ sstuff.hh \
+ stat_t.hh \
+ statnode.cc statnode.hh \
+ svc-records.cc svc-records.hh \
+ test-base64_cc.cc \
+ test-connectionmanagement_hh.cc \
+ test-credentials_cc.cc \
+ test-delaypipe_hh.cc \
+ test-dnscrypt_cc.cc \
+ test-dnsdist-connections-cache.cc \
+ test-dnsdist_cc.cc \
+ test-dnsdistdynblocks_hh.cc \
+ test-dnsdistkvs_cc.cc \
+ test-dnsdistlbpolicies_cc.cc \
+ test-dnsdistnghttp2_cc.cc \
+ test-dnsdistpacketcache_cc.cc \
+ test-dnsdistrings_cc.cc \
+ test-dnsdistrules_cc.cc \
+ test-dnsdistsvc_cc.cc \
+ test-dnsdisttcp_cc.cc \
+ test-dnsparser_cc.cc \
+ test-iputils_hh.cc \
+ test-luawrapper.cc \
+ test-mplexer.cc \
+ test-proxy_protocol_cc.cc \
+ testrunner.cc \
+ threadname.hh threadname.cc \
+ uuid-utils.hh uuid-utils.cc \
+ xpf.cc xpf.hh
+
+dnsdist_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ $(PROGRAM_LDFLAGS) \
+ -pthread
+
+dnsdist_LDADD = \
+ $(LUA_LIBS) \
+ $(LIBEDIT_LIBS) \
+ $(RT_LIBS) \
+ $(YAHTTP_LIBS) \
+ $(LIBSODIUM_LIBS) \
+ $(FSTRM_LIBS) \
+ $(SYSTEMD_LIBS) \
+ $(NET_SNMP_LIBS) \
+ $(LIBCAP_LIBS) \
+ $(IPCRYPT_LIBS)
+
+testrunner_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ $(PROGRAM_LDFLAGS) \
+ $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \
+ -pthread
+
+testrunner_LDADD = \
+ $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) \
+ $(FSTRM_LIBS) \
+ $(LIBSODIUM_LIBS) \
+ $(LUA_LIBS) \
+ $(RT_LIBS) \
+ $(LIBCAP_LIBS)
+
+if HAVE_CDB
+dnsdist_LDADD += $(CDB_LDFLAGS) $(CDB_LIBS)
+testrunner_LDADD += $(CDB_LDFLAGS) $(CDB_LIBS)
+dnsdist_SOURCES += cdb.cc cdb.hh
+testrunner_SOURCES += cdb.cc cdb.hh
+endif
+
+if HAVE_RE2
+dnsdist_LDADD += $(RE2_LIBS)
+endif
+
+if HAVE_LIBSSL
+dnsdist_LDADD += $(LIBSSL_LIBS)
+endif
+
+if HAVE_LIBCRYPTO
+dnsdist_LDADD += $(LIBCRYPTO_LDFLAGS) $(LIBCRYPTO_LIBS)
+testrunner_LDADD += $(LIBCRYPTO_LDFLAGS) $(LIBCRYPTO_LIBS)
+dnsdist_SOURCES += ipcipher.cc ipcipher.hh
+endif
+
+if HAVE_LMDB
+dnsdist_LDADD += $(LMDB_LDFLAGS) $(LMDB_LIBS)
+testrunner_LDADD += $(LMDB_LDFLAGS) $(LMDB_LIBS)
+dnsdist_SOURCES += ext/lmdb-safe/lmdb-safe.cc ext/lmdb-safe/lmdb-safe.hh
+testrunner_SOURCES += ext/lmdb-safe/lmdb-safe.cc ext/lmdb-safe/lmdb-safe.hh
+endif
+
+if HAVE_DNS_OVER_TLS
+if HAVE_GNUTLS
+dnsdist_LDADD += -lgnutls
+endif
+endif
+
+if HAVE_DNS_OVER_HTTPS
+
+if HAVE_LIBH2OEVLOOP
+dnsdist_LDADD += $(LIBH2OEVLOOP_LIBS)
+endif
+
+endif
+
+if HAVE_NGHTTP2
+dnsdist_LDADD += $(NGHTTP2_LDFLAGS) $(NGHTTP2_LIBS)
+testrunner_LDADD += $(NGHTTP2_LDFLAGS) $(NGHTTP2_LIBS)
+endif
+
+if !HAVE_LUA_HPP
+BUILT_SOURCES += lua.hpp
+nodist_dnsdist_SOURCES = lua.hpp
+endif
+
+CLEANFILES += lua.hpp
+
+if HAVE_FREEBSD
+dnsdist_SOURCES += kqueuemplexer.cc
+testrunner_SOURCES += kqueuemplexer.cc
+endif
+
+if HAVE_OPENBSD
+dnsdist_SOURCES += kqueuemplexer.cc
+testrunner_SOURCES += kqueuemplexer.cc
+endif
+
+if HAVE_LINUX
+dnsdist_SOURCES += epollmplexer.cc
+testrunner_SOURCES += epollmplexer.cc
+endif
+
+if HAVE_SOLARIS
+dnsdist_SOURCES += \
+ devpollmplexer.cc \
+ portsmplexer.cc
+testrunner_SOURCES += \
+ devpollmplexer.cc \
+ portsmplexer.cc
+endif
+
+MANPAGES=dnsdist.1
+
+dist_man_MANS=$(MANPAGES)
+
+if HAVE_VENV
+if !HAVE_MANPAGES
+$(MANPAGES): %: docs/manpages/%.rst .venv
+ $(AM_V_GEN).venv/bin/python -msphinx -b man docs . $<
+endif # if !HAVE_MANPAGES
+
+.venv: docs/requirements.txt
+ $(PYTHON) -m venv .venv
+ .venv/bin/pip install -U pip setuptools setuptools-git wheel
+ .venv/bin/pip install -r $<
+
+latex/dnsdist.pdf: docs/** .venv
+ .venv/bin/python -msphinx -M latexpdf docs .
+
+dnsdist.pdf: latex/dnsdist.pdf
+ mv $< $@
+
+html-docs.tar.bz2: html-docs
+ tar cjf $@ $<
+
+html-docs: docs/** .venv
+ .venv/bin/python -msphinx -b html docs html-docs
+
+all-docs: html-docs html-docs.tar.bz2 dnsdist.pdf
+
+upload-docs: all-docs
+ rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/dnsdist.org
+ rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/dnsdist.org
+ rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./dnsdist.pdf web1.powerdns.com:/srv/www/dnsdist.org
+
+else # if HAVE_VENV
+$(MANPAGES):
+ @echo "You need Python 3 and the 'venv' module to generate the manpages"
+ exit 1
+
+html-docs: %: docs/manpages/%.rst .venv
+ @echo "You need Python 3 and the 'venv' module to generate the HTML docs"
+ exit 1
+
+dnsdist.pdf:
+ @echo "You need Python 3 and the 'venv' module to generate the PDF"
+ exit 1
+endif
+
+if HAVE_SYSTEMD
+dnsdist.service: dnsdist.service.in
+ $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' -e 's![@]service_user[@]!$(service_user)!' -e 's![@]service_group[@]!$(service_group)!' < $< > $@
+if !HAVE_SYSTEMD_LOCK_PERSONALITY
+ $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@
+endif
+if !HAVE_SYSTEMD_PRIVATE_DEVICES
+ $(AM_V_GEN)perl -ni -e 'print unless /^PrivateDevices/' $@
+endif
+if !HAVE_SYSTEMD_PRIVATE_TMP
+ $(AM_V_GEN)perl -ni -e 'print unless /^PrivateTmp/' $@
+endif
+if !HAVE_SYSTEMD_PRIVATE_USERS
+ $(AM_V_GEN)perl -ni -e 'print unless /^PrivateUsers/' $@
+endif
+if !HAVE_SYSTEMD_PROTECT_CLOCK
+ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectClock/' $@
+endif
+if !HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS
+ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectControlGroups/' $@
+endif
+if !HAVE_SYSTEMD_PROTECT_HOME
+ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHome/' $@
+endif
+if !HAVE_SYSTEMD_PROTECT_HOSTNAME
+ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHostname/' $@
+endif
+if !HAVE_SYSTEMD_PROTECT_KERNEL_LOGS
+ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelLogs/' $@
+endif
+if !HAVE_SYSTEMD_PROTECT_KERNEL_MODULES
+ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelModules/' $@
+endif
+if !HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES
+ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelTunables/' $@
+endif
+if !HAVE_SYSTEMD_PROTECT_SYSTEM
+ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectSystem/' $@
+endif
+if !HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES
+ $(AM_V_GEN)perl -ni -e 'print unless /^RestrictAddressFamilies/' $@
+endif
+if !HAVE_SYSTEMD_RESTRICT_NAMESPACES
+ $(AM_V_GEN)perl -ni -e 'print unless /^RestrictNamespaces/' $@
+endif
+if !HAVE_SYSTEMD_RESTRICT_REALTIME
+ $(AM_V_GEN)perl -ni -e 'print unless /^RestrictRealtime/' $@
+endif
+if !HAVE_SYSTEMD_RESTRICT_SUIDSGID
+ $(AM_V_GEN)perl -ni -e 'print unless /^RestrictSUIDSGID/' $@
+endif
+if !HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES
+ $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallArchitectures/' $@
+endif
+if !HAVE_SYSTEMD_SYSTEM_CALL_FILTER
+ $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallFilter/' $@
+endif
+
+dnsdist@.service: dnsdist.service
+ $(AM_V_GEN)sed -e 's!/dnsdist !&--config $(sysconfdir)/dnsdist-%i.conf !' \
+ -e 's!RuntimeDirectory=.*!&-%i!' \
+ -e 's!SyslogIdentifier=.*!&-%i!' \
+ < $< >$@
+
+systemdsystemunitdir = $(SYSTEMD_DIR)
+
+systemdsystemunit_DATA = \
+ dnsdist.service \
+ dnsdist@.service
+
+CLEANFILES += \
+ dnsdist.service \
+ dnsdist@.service
+endif
+
+if !HAVE_LUA_HPP
+include lua_hpp.mk
+endif
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..f14b5a3
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,2500 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+
+# Some versions of pkg_config add -std=c11++, override that
+@HAVE_RE2_TRUE@am__append_1 = $(RE2_CFLAGS) -std=c++17
+@HAVE_DNS_OVER_TLS_TRUE@@HAVE_LIBSSL_TRUE@am__append_2 = $(LIBSSL_CFLAGS)
+@HAVE_DNS_OVER_TLS_TRUE@@HAVE_GNUTLS_TRUE@am__append_3 = $(GNUTLS_CFLAGS)
+@HAVE_LIBCRYPTO_TRUE@am__append_4 = $(LIBCRYPTO_INCLUDES)
+@HAVE_CDB_TRUE@am__append_5 = $(CDB_CFLAGS)
+@HAVE_LMDB_TRUE@am__append_6 = $(LMDB_CFLAGS)
+@HAVE_DNS_OVER_HTTPS_TRUE@@HAVE_LIBSSL_TRUE@am__append_7 = $(LIBSSL_CFLAGS)
+@HAVE_DNS_OVER_HTTPS_TRUE@@HAVE_LIBH2OEVLOOP_TRUE@am__append_8 = $(LIBH2OEVLOOP_CFLAGS)
+bin_PROGRAMS = dnsdist$(EXEEXT)
+@UNIT_TESTS_TRUE@noinst_PROGRAMS = testrunner$(EXEEXT)
+@UNIT_TESTS_TRUE@TESTS = testrunner$(EXEEXT)
+@HAVE_CDB_TRUE@am__append_9 = $(CDB_LDFLAGS) $(CDB_LIBS)
+@HAVE_CDB_TRUE@am__append_10 = $(CDB_LDFLAGS) $(CDB_LIBS)
+@HAVE_CDB_TRUE@am__append_11 = cdb.cc cdb.hh
+@HAVE_CDB_TRUE@am__append_12 = cdb.cc cdb.hh
+@HAVE_RE2_TRUE@am__append_13 = $(RE2_LIBS)
+@HAVE_LIBSSL_TRUE@am__append_14 = $(LIBSSL_LIBS)
+@HAVE_LIBCRYPTO_TRUE@am__append_15 = $(LIBCRYPTO_LDFLAGS) $(LIBCRYPTO_LIBS)
+@HAVE_LIBCRYPTO_TRUE@am__append_16 = $(LIBCRYPTO_LDFLAGS) $(LIBCRYPTO_LIBS)
+@HAVE_LIBCRYPTO_TRUE@am__append_17 = ipcipher.cc ipcipher.hh
+@HAVE_LMDB_TRUE@am__append_18 = $(LMDB_LDFLAGS) $(LMDB_LIBS)
+@HAVE_LMDB_TRUE@am__append_19 = $(LMDB_LDFLAGS) $(LMDB_LIBS)
+@HAVE_LMDB_TRUE@am__append_20 = ext/lmdb-safe/lmdb-safe.cc ext/lmdb-safe/lmdb-safe.hh
+@HAVE_LMDB_TRUE@am__append_21 = ext/lmdb-safe/lmdb-safe.cc ext/lmdb-safe/lmdb-safe.hh
+@HAVE_DNS_OVER_TLS_TRUE@@HAVE_GNUTLS_TRUE@am__append_22 = -lgnutls
+@HAVE_DNS_OVER_HTTPS_TRUE@@HAVE_LIBH2OEVLOOP_TRUE@am__append_23 = $(LIBH2OEVLOOP_LIBS)
+@HAVE_NGHTTP2_TRUE@am__append_24 = $(NGHTTP2_LDFLAGS) $(NGHTTP2_LIBS)
+@HAVE_NGHTTP2_TRUE@am__append_25 = $(NGHTTP2_LDFLAGS) $(NGHTTP2_LIBS)
+@HAVE_LUA_HPP_FALSE@am__append_26 = lua.hpp
+@HAVE_FREEBSD_TRUE@am__append_27 = kqueuemplexer.cc
+@HAVE_FREEBSD_TRUE@am__append_28 = kqueuemplexer.cc
+@HAVE_OPENBSD_TRUE@am__append_29 = kqueuemplexer.cc
+@HAVE_OPENBSD_TRUE@am__append_30 = kqueuemplexer.cc
+@HAVE_LINUX_TRUE@am__append_31 = epollmplexer.cc
+@HAVE_LINUX_TRUE@am__append_32 = epollmplexer.cc
+@HAVE_SOLARIS_TRUE@am__append_33 = \
+@HAVE_SOLARIS_TRUE@ devpollmplexer.cc \
+@HAVE_SOLARIS_TRUE@ portsmplexer.cc
+
+@HAVE_SOLARIS_TRUE@am__append_34 = \
+@HAVE_SOLARIS_TRUE@ devpollmplexer.cc \
+@HAVE_SOLARIS_TRUE@ portsmplexer.cc
+
+@HAVE_SYSTEMD_TRUE@am__append_35 = \
+@HAVE_SYSTEMD_TRUE@ dnsdist.service \
+@HAVE_SYSTEMD_TRUE@ dnsdist@.service
+
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_pthread_set_name.m4 \
+ $(top_srcdir)/m4/ax_arg_default_enable_disable.m4 \
+ $(top_srcdir)/m4/ax_check_sign.m4 \
+ $(top_srcdir)/m4/ax_compile_check_sizeof.m4 \
+ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
+ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \
+ $(top_srcdir)/m4/ax_python_module.m4 $(top_srcdir)/m4/boost.m4 \
+ $(top_srcdir)/m4/dnsdist_enable_dnscrypt.m4 \
+ $(top_srcdir)/m4/dnsdist_enable_doh.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/pdns_check_cdb.m4 \
+ $(top_srcdir)/m4/pdns_check_clock_gettime.m4 \
+ $(top_srcdir)/m4/pdns_check_dnstap.m4 \
+ $(top_srcdir)/m4/pdns_check_libcrypto.m4 \
+ $(top_srcdir)/m4/pdns_check_libedit.m4 \
+ $(top_srcdir)/m4/pdns_check_libh2o_evloop.m4 \
+ $(top_srcdir)/m4/pdns_check_lmdb.m4 \
+ $(top_srcdir)/m4/pdns_check_lua_hpp.m4 \
+ $(top_srcdir)/m4/pdns_check_network_libs.m4 \
+ $(top_srcdir)/m4/pdns_check_os.m4 \
+ $(top_srcdir)/m4/pdns_check_pthread_np.m4 \
+ $(top_srcdir)/m4/pdns_check_python_venv.m4 \
+ $(top_srcdir)/m4/pdns_check_ragel.m4 \
+ $(top_srcdir)/m4/pdns_check_secure_memset.m4 \
+ $(top_srcdir)/m4/pdns_check_time_t.m4 \
+ $(top_srcdir)/m4/pdns_d_fortify_source.m4 \
+ $(top_srcdir)/m4/pdns_enable_sanitizers.m4 \
+ $(top_srcdir)/m4/pdns_enable_tls.m4 \
+ $(top_srcdir)/m4/pdns_enable_unit_tests.m4 \
+ $(top_srcdir)/m4/pdns_param_ssp_buffer_size.m4 \
+ $(top_srcdir)/m4/pdns_pie.m4 $(top_srcdir)/m4/pdns_relro.m4 \
+ $(top_srcdir)/m4/pdns_stack_protector.m4 \
+ $(top_srcdir)/m4/pdns_with_ebpf.m4 \
+ $(top_srcdir)/m4/pdns_with_gnutls.m4 \
+ $(top_srcdir)/m4/pdns_with_libcap.m4 \
+ $(top_srcdir)/m4/pdns_with_libsodium.m4 \
+ $(top_srcdir)/m4/pdns_with_libssl.m4 \
+ $(top_srcdir)/m4/pdns_with_lua.m4 \
+ $(top_srcdir)/m4/pdns_with_net_snmp.m4 \
+ $(top_srcdir)/m4/pdns_with_nghttp2.m4 \
+ $(top_srcdir)/m4/pdns_with_re2.m4 \
+ $(top_srcdir)/m4/pdns_with_service_user.m4 \
+ $(top_srcdir)/m4/systemd.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+ $(am__configure_deps) $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
+ "$(DESTDIR)$(systemdsystemunitdir)"
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+am__dnsdist_SOURCES_DIST = ascii.hh base64.hh bpf-filter.cc \
+ bpf-filter.hh cachecleaner.hh capabilities.cc capabilities.hh \
+ circular_buffer.hh connection-management.hh credentials.cc \
+ credentials.hh dns.cc dns.hh dnscrypt.cc dnscrypt.hh \
+ dnsdist-backend.cc dnsdist-cache.cc dnsdist-cache.hh \
+ dnsdist-carbon.cc dnsdist-console.cc dnsdist-console.hh \
+ dnsdist-dnscrypt.cc dnsdist-dynblocks.cc dnsdist-dynblocks.hh \
+ dnsdist-dynbpf.cc dnsdist-dynbpf.hh dnsdist-ecs.cc \
+ dnsdist-ecs.hh dnsdist-healthchecks.cc dnsdist-healthchecks.hh \
+ dnsdist-idstate.cc dnsdist-idstate.hh dnsdist-kvs.hh \
+ dnsdist-kvs.cc dnsdist-lbpolicies.cc dnsdist-lbpolicies.hh \
+ dnsdist-lua-actions.cc dnsdist-lua-bindings-dnscrypt.cc \
+ dnsdist-lua-bindings-dnsquestion.cc \
+ dnsdist-lua-bindings-kvs.cc \
+ dnsdist-lua-bindings-packetcache.cc \
+ dnsdist-lua-bindings-protobuf.cc dnsdist-lua-bindings.cc \
+ dnsdist-lua-ffi-interface.h dnsdist-lua-ffi-interface.inc \
+ dnsdist-lua-ffi.cc dnsdist-lua-ffi.hh \
+ dnsdist-lua-inspection-ffi.cc dnsdist-lua-inspection-ffi.hh \
+ dnsdist-lua-inspection.cc dnsdist-lua-rules.cc \
+ dnsdist-lua-vars.cc dnsdist-lua-web.cc dnsdist-lua.cc \
+ dnsdist-lua.hh dnsdist-nghttp2.cc dnsdist-nghttp2.hh \
+ dnsdist-prometheus.hh dnsdist-protobuf.cc dnsdist-protobuf.hh \
+ dnsdist-protocols.cc dnsdist-protocols.hh \
+ dnsdist-proxy-protocol.cc dnsdist-proxy-protocol.hh \
+ dnsdist-rings.cc dnsdist-rings.hh dnsdist-rules.cc \
+ dnsdist-rules.hh dnsdist-secpoll.cc dnsdist-secpoll.hh \
+ dnsdist-session-cache.cc dnsdist-session-cache.hh \
+ dnsdist-snmp.cc dnsdist-snmp.hh dnsdist-svc.cc dnsdist-svc.hh \
+ dnsdist-systemd.cc dnsdist-systemd.hh \
+ dnsdist-tcp-downstream.cc dnsdist-tcp-downstream.hh \
+ dnsdist-tcp-upstream.hh dnsdist-tcp.cc dnsdist-tcp.hh \
+ dnsdist-web.cc dnsdist-web.hh dnsdist-xpf.cc dnsdist-xpf.hh \
+ dnsdist.cc dnsdist.hh dnslabeltext.cc dnsname.cc dnsname.hh \
+ dnsparser.hh dnsparser.cc dnstap.cc dnstap.hh dnswriter.cc \
+ dnswriter.hh doh.hh doh.cc dolog.hh ednscookies.cc \
+ ednscookies.hh ednsoptions.cc ednsoptions.hh ednssubnet.cc \
+ ednssubnet.hh ext/json11/json11.cpp ext/json11/json11.hpp \
+ ext/libbpf/libbpf.h ext/luawrapper/include/LuaContext.hpp \
+ fstrm_logger.cc fstrm_logger.hh gettime.cc gettime.hh \
+ htmlfiles.h iputils.cc iputils.hh libssl.cc libssl.hh lock.hh \
+ misc.cc misc.hh mplexer.hh namespaces.hh noinitvector.hh \
+ packetcache.hh pdnsexception.hh pollmplexer.cc protozero.cc \
+ protozero.hh proxy-protocol.cc proxy-protocol.hh qtype.cc \
+ qtype.hh remote_logger.cc remote_logger.hh sholder.hh \
+ snmp-agent.cc snmp-agent.hh sodcrypto.cc sodcrypto.hh \
+ sstuff.hh stat_t.hh statnode.cc statnode.hh svc-records.cc \
+ svc-records.hh tcpiohandler-mplexer.hh tcpiohandler.cc \
+ tcpiohandler.hh threadname.hh threadname.cc uuid-utils.hh \
+ uuid-utils.cc xpf.cc xpf.hh cdb.cc cdb.hh ipcipher.cc \
+ ipcipher.hh ext/lmdb-safe/lmdb-safe.cc \
+ ext/lmdb-safe/lmdb-safe.hh kqueuemplexer.cc epollmplexer.cc \
+ devpollmplexer.cc portsmplexer.cc
+am__dirstamp = $(am__leading_dot)dirstamp
+@HAVE_CDB_TRUE@am__objects_1 = cdb.$(OBJEXT)
+@HAVE_LIBCRYPTO_TRUE@am__objects_2 = ipcipher.$(OBJEXT)
+@HAVE_LMDB_TRUE@am__objects_3 = ext/lmdb-safe/lmdb-safe.$(OBJEXT)
+@HAVE_FREEBSD_TRUE@am__objects_4 = kqueuemplexer.$(OBJEXT)
+@HAVE_OPENBSD_TRUE@am__objects_5 = kqueuemplexer.$(OBJEXT)
+@HAVE_LINUX_TRUE@am__objects_6 = epollmplexer.$(OBJEXT)
+@HAVE_SOLARIS_TRUE@am__objects_7 = devpollmplexer.$(OBJEXT) \
+@HAVE_SOLARIS_TRUE@ portsmplexer.$(OBJEXT)
+am_dnsdist_OBJECTS = bpf-filter.$(OBJEXT) capabilities.$(OBJEXT) \
+ credentials.$(OBJEXT) dns.$(OBJEXT) dnscrypt.$(OBJEXT) \
+ dnsdist-backend.$(OBJEXT) dnsdist-cache.$(OBJEXT) \
+ dnsdist-carbon.$(OBJEXT) dnsdist-console.$(OBJEXT) \
+ dnsdist-dnscrypt.$(OBJEXT) dnsdist-dynblocks.$(OBJEXT) \
+ dnsdist-dynbpf.$(OBJEXT) dnsdist-ecs.$(OBJEXT) \
+ dnsdist-healthchecks.$(OBJEXT) dnsdist-idstate.$(OBJEXT) \
+ dnsdist-kvs.$(OBJEXT) dnsdist-lbpolicies.$(OBJEXT) \
+ dnsdist-lua-actions.$(OBJEXT) \
+ dnsdist-lua-bindings-dnscrypt.$(OBJEXT) \
+ dnsdist-lua-bindings-dnsquestion.$(OBJEXT) \
+ dnsdist-lua-bindings-kvs.$(OBJEXT) \
+ dnsdist-lua-bindings-packetcache.$(OBJEXT) \
+ dnsdist-lua-bindings-protobuf.$(OBJEXT) \
+ dnsdist-lua-bindings.$(OBJEXT) dnsdist-lua-ffi.$(OBJEXT) \
+ dnsdist-lua-inspection-ffi.$(OBJEXT) \
+ dnsdist-lua-inspection.$(OBJEXT) dnsdist-lua-rules.$(OBJEXT) \
+ dnsdist-lua-vars.$(OBJEXT) dnsdist-lua-web.$(OBJEXT) \
+ dnsdist-lua.$(OBJEXT) dnsdist-nghttp2.$(OBJEXT) \
+ dnsdist-protobuf.$(OBJEXT) dnsdist-protocols.$(OBJEXT) \
+ dnsdist-proxy-protocol.$(OBJEXT) dnsdist-rings.$(OBJEXT) \
+ dnsdist-rules.$(OBJEXT) dnsdist-secpoll.$(OBJEXT) \
+ dnsdist-session-cache.$(OBJEXT) dnsdist-snmp.$(OBJEXT) \
+ dnsdist-svc.$(OBJEXT) dnsdist-systemd.$(OBJEXT) \
+ dnsdist-tcp-downstream.$(OBJEXT) dnsdist-tcp.$(OBJEXT) \
+ dnsdist-web.$(OBJEXT) dnsdist-xpf.$(OBJEXT) dnsdist.$(OBJEXT) \
+ dnslabeltext.$(OBJEXT) dnsname.$(OBJEXT) dnsparser.$(OBJEXT) \
+ dnstap.$(OBJEXT) dnswriter.$(OBJEXT) doh.$(OBJEXT) \
+ ednscookies.$(OBJEXT) ednsoptions.$(OBJEXT) \
+ ednssubnet.$(OBJEXT) ext/json11/json11.$(OBJEXT) \
+ fstrm_logger.$(OBJEXT) gettime.$(OBJEXT) iputils.$(OBJEXT) \
+ libssl.$(OBJEXT) misc.$(OBJEXT) pollmplexer.$(OBJEXT) \
+ protozero.$(OBJEXT) proxy-protocol.$(OBJEXT) qtype.$(OBJEXT) \
+ remote_logger.$(OBJEXT) snmp-agent.$(OBJEXT) \
+ sodcrypto.$(OBJEXT) statnode.$(OBJEXT) svc-records.$(OBJEXT) \
+ tcpiohandler.$(OBJEXT) threadname.$(OBJEXT) \
+ uuid-utils.$(OBJEXT) xpf.$(OBJEXT) $(am__objects_1) \
+ $(am__objects_2) $(am__objects_3) $(am__objects_4) \
+ $(am__objects_5) $(am__objects_6) $(am__objects_7)
+nodist_dnsdist_OBJECTS =
+dnsdist_OBJECTS = $(am_dnsdist_OBJECTS) $(nodist_dnsdist_OBJECTS)
+am__DEPENDENCIES_1 =
+@HAVE_CDB_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
+@HAVE_RE2_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1)
+@HAVE_LIBSSL_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1)
+@HAVE_LIBCRYPTO_TRUE@am__DEPENDENCIES_5 = $(am__DEPENDENCIES_1) \
+@HAVE_LIBCRYPTO_TRUE@ $(am__DEPENDENCIES_1)
+@HAVE_LMDB_TRUE@am__DEPENDENCIES_6 = $(am__DEPENDENCIES_1)
+@HAVE_DNS_OVER_HTTPS_TRUE@@HAVE_LIBH2OEVLOOP_TRUE@am__DEPENDENCIES_7 = $(am__DEPENDENCIES_1)
+@HAVE_NGHTTP2_TRUE@am__DEPENDENCIES_8 = $(am__DEPENDENCIES_1)
+dnsdist_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \
+ $(am__DEPENDENCIES_4) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_6) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_7) $(am__DEPENDENCIES_8)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+dnsdist_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(dnsdist_LDFLAGS) $(LDFLAGS) -o $@
+am__testrunner_SOURCES_DIST = base64.hh bpf-filter.cc bpf-filter.hh \
+ cachecleaner.hh circular_buffer.hh connection-management.hh \
+ credentials.cc credentials.hh dns.cc dns.hh dnscrypt.cc \
+ dnscrypt.hh dnsdist-backend.cc dnsdist-cache.cc \
+ dnsdist-cache.hh dnsdist-dynblocks.cc dnsdist-dynblocks.hh \
+ dnsdist-dynbpf.cc dnsdist-dynbpf.hh dnsdist-ecs.cc \
+ dnsdist-ecs.hh dnsdist-idstate.cc dnsdist-idstate.hh \
+ dnsdist-kvs.cc dnsdist-kvs.hh dnsdist-lbpolicies.cc \
+ dnsdist-lbpolicies.hh dnsdist-lua-bindings-dnsquestion.cc \
+ dnsdist-lua-bindings-kvs.cc dnsdist-lua-bindings.cc \
+ dnsdist-lua-ffi-interface.h dnsdist-lua-ffi-interface.inc \
+ dnsdist-lua-ffi.cc dnsdist-lua-ffi.hh dnsdist-lua-vars.cc \
+ dnsdist-nghttp2.cc dnsdist-nghttp2.hh dnsdist-protocols.cc \
+ dnsdist-protocols.hh dnsdist-proxy-protocol.cc \
+ dnsdist-proxy-protocol.hh dnsdist-rings.cc dnsdist-rings.hh \
+ dnsdist-rules.cc dnsdist-rules.hh dnsdist-session-cache.cc \
+ dnsdist-session-cache.hh dnsdist-svc.cc dnsdist-svc.hh \
+ dnsdist-tcp-downstream.cc dnsdist-tcp.cc dnsdist-tcp.hh \
+ dnsdist-xpf.cc dnsdist-xpf.hh dnsdist.hh dnslabeltext.cc \
+ dnsname.cc dnsname.hh dnsparser.hh dnsparser.cc dnswriter.cc \
+ dnswriter.hh dolog.hh ednscookies.cc ednscookies.hh \
+ ednsoptions.cc ednsoptions.hh ednssubnet.cc ednssubnet.hh \
+ ext/luawrapper/include/LuaContext.hpp gettime.cc gettime.hh \
+ iputils.cc iputils.hh misc.cc misc.hh namespaces.hh \
+ noinitvector.hh pdnsexception.hh pollmplexer.cc \
+ proxy-protocol.cc proxy-protocol.hh qtype.cc qtype.hh \
+ sholder.hh sodcrypto.cc sstuff.hh stat_t.hh statnode.cc \
+ statnode.hh svc-records.cc svc-records.hh test-base64_cc.cc \
+ test-connectionmanagement_hh.cc test-credentials_cc.cc \
+ test-delaypipe_hh.cc test-dnscrypt_cc.cc \
+ test-dnsdist-connections-cache.cc test-dnsdist_cc.cc \
+ test-dnsdistdynblocks_hh.cc test-dnsdistkvs_cc.cc \
+ test-dnsdistlbpolicies_cc.cc test-dnsdistnghttp2_cc.cc \
+ test-dnsdistpacketcache_cc.cc test-dnsdistrings_cc.cc \
+ test-dnsdistrules_cc.cc test-dnsdistsvc_cc.cc \
+ test-dnsdisttcp_cc.cc test-dnsparser_cc.cc test-iputils_hh.cc \
+ test-luawrapper.cc test-mplexer.cc test-proxy_protocol_cc.cc \
+ testrunner.cc threadname.hh threadname.cc uuid-utils.hh \
+ uuid-utils.cc xpf.cc xpf.hh cdb.cc cdb.hh \
+ ext/lmdb-safe/lmdb-safe.cc ext/lmdb-safe/lmdb-safe.hh \
+ kqueuemplexer.cc epollmplexer.cc devpollmplexer.cc \
+ portsmplexer.cc
+am_testrunner_OBJECTS = bpf-filter.$(OBJEXT) credentials.$(OBJEXT) \
+ dns.$(OBJEXT) dnscrypt.$(OBJEXT) dnsdist-backend.$(OBJEXT) \
+ dnsdist-cache.$(OBJEXT) dnsdist-dynblocks.$(OBJEXT) \
+ dnsdist-dynbpf.$(OBJEXT) dnsdist-ecs.$(OBJEXT) \
+ dnsdist-idstate.$(OBJEXT) dnsdist-kvs.$(OBJEXT) \
+ dnsdist-lbpolicies.$(OBJEXT) \
+ dnsdist-lua-bindings-dnsquestion.$(OBJEXT) \
+ dnsdist-lua-bindings-kvs.$(OBJEXT) \
+ dnsdist-lua-bindings.$(OBJEXT) dnsdist-lua-ffi.$(OBJEXT) \
+ dnsdist-lua-vars.$(OBJEXT) dnsdist-nghttp2.$(OBJEXT) \
+ dnsdist-protocols.$(OBJEXT) dnsdist-proxy-protocol.$(OBJEXT) \
+ dnsdist-rings.$(OBJEXT) dnsdist-rules.$(OBJEXT) \
+ dnsdist-session-cache.$(OBJEXT) dnsdist-svc.$(OBJEXT) \
+ dnsdist-tcp-downstream.$(OBJEXT) dnsdist-tcp.$(OBJEXT) \
+ dnsdist-xpf.$(OBJEXT) dnslabeltext.$(OBJEXT) dnsname.$(OBJEXT) \
+ dnsparser.$(OBJEXT) dnswriter.$(OBJEXT) ednscookies.$(OBJEXT) \
+ ednsoptions.$(OBJEXT) ednssubnet.$(OBJEXT) gettime.$(OBJEXT) \
+ iputils.$(OBJEXT) misc.$(OBJEXT) pollmplexer.$(OBJEXT) \
+ proxy-protocol.$(OBJEXT) qtype.$(OBJEXT) sodcrypto.$(OBJEXT) \
+ statnode.$(OBJEXT) svc-records.$(OBJEXT) \
+ test-base64_cc.$(OBJEXT) \
+ test-connectionmanagement_hh.$(OBJEXT) \
+ test-credentials_cc.$(OBJEXT) test-delaypipe_hh.$(OBJEXT) \
+ test-dnscrypt_cc.$(OBJEXT) \
+ test-dnsdist-connections-cache.$(OBJEXT) \
+ test-dnsdist_cc.$(OBJEXT) test-dnsdistdynblocks_hh.$(OBJEXT) \
+ test-dnsdistkvs_cc.$(OBJEXT) \
+ test-dnsdistlbpolicies_cc.$(OBJEXT) \
+ test-dnsdistnghttp2_cc.$(OBJEXT) \
+ test-dnsdistpacketcache_cc.$(OBJEXT) \
+ test-dnsdistrings_cc.$(OBJEXT) test-dnsdistrules_cc.$(OBJEXT) \
+ test-dnsdistsvc_cc.$(OBJEXT) test-dnsdisttcp_cc.$(OBJEXT) \
+ test-dnsparser_cc.$(OBJEXT) test-iputils_hh.$(OBJEXT) \
+ test-luawrapper.$(OBJEXT) test-mplexer.$(OBJEXT) \
+ test-proxy_protocol_cc.$(OBJEXT) testrunner.$(OBJEXT) \
+ threadname.$(OBJEXT) uuid-utils.$(OBJEXT) xpf.$(OBJEXT) \
+ $(am__objects_1) $(am__objects_3) $(am__objects_4) \
+ $(am__objects_5) $(am__objects_6) $(am__objects_7)
+testrunner_OBJECTS = $(am_testrunner_OBJECTS)
+testrunner_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_5) \
+ $(am__DEPENDENCIES_6) $(am__DEPENDENCIES_8)
+testrunner_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(testrunner_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/bpf-filter.Po \
+ ./$(DEPDIR)/capabilities.Po ./$(DEPDIR)/cdb.Po \
+ ./$(DEPDIR)/credentials.Po ./$(DEPDIR)/devpollmplexer.Po \
+ ./$(DEPDIR)/dns.Po ./$(DEPDIR)/dnscrypt.Po \
+ ./$(DEPDIR)/dnsdist-backend.Po ./$(DEPDIR)/dnsdist-cache.Po \
+ ./$(DEPDIR)/dnsdist-carbon.Po ./$(DEPDIR)/dnsdist-console.Po \
+ ./$(DEPDIR)/dnsdist-dnscrypt.Po \
+ ./$(DEPDIR)/dnsdist-dynblocks.Po ./$(DEPDIR)/dnsdist-dynbpf.Po \
+ ./$(DEPDIR)/dnsdist-ecs.Po ./$(DEPDIR)/dnsdist-healthchecks.Po \
+ ./$(DEPDIR)/dnsdist-idstate.Po ./$(DEPDIR)/dnsdist-kvs.Po \
+ ./$(DEPDIR)/dnsdist-lbpolicies.Po \
+ ./$(DEPDIR)/dnsdist-lua-actions.Po \
+ ./$(DEPDIR)/dnsdist-lua-bindings-dnscrypt.Po \
+ ./$(DEPDIR)/dnsdist-lua-bindings-dnsquestion.Po \
+ ./$(DEPDIR)/dnsdist-lua-bindings-kvs.Po \
+ ./$(DEPDIR)/dnsdist-lua-bindings-packetcache.Po \
+ ./$(DEPDIR)/dnsdist-lua-bindings-protobuf.Po \
+ ./$(DEPDIR)/dnsdist-lua-bindings.Po \
+ ./$(DEPDIR)/dnsdist-lua-ffi.Po \
+ ./$(DEPDIR)/dnsdist-lua-inspection-ffi.Po \
+ ./$(DEPDIR)/dnsdist-lua-inspection.Po \
+ ./$(DEPDIR)/dnsdist-lua-rules.Po \
+ ./$(DEPDIR)/dnsdist-lua-vars.Po ./$(DEPDIR)/dnsdist-lua-web.Po \
+ ./$(DEPDIR)/dnsdist-lua.Po ./$(DEPDIR)/dnsdist-nghttp2.Po \
+ ./$(DEPDIR)/dnsdist-protobuf.Po \
+ ./$(DEPDIR)/dnsdist-protocols.Po \
+ ./$(DEPDIR)/dnsdist-proxy-protocol.Po \
+ ./$(DEPDIR)/dnsdist-rings.Po ./$(DEPDIR)/dnsdist-rules.Po \
+ ./$(DEPDIR)/dnsdist-secpoll.Po \
+ ./$(DEPDIR)/dnsdist-session-cache.Po \
+ ./$(DEPDIR)/dnsdist-snmp.Po ./$(DEPDIR)/dnsdist-svc.Po \
+ ./$(DEPDIR)/dnsdist-systemd.Po \
+ ./$(DEPDIR)/dnsdist-tcp-downstream.Po \
+ ./$(DEPDIR)/dnsdist-tcp.Po ./$(DEPDIR)/dnsdist-web.Po \
+ ./$(DEPDIR)/dnsdist-xpf.Po ./$(DEPDIR)/dnsdist.Po \
+ ./$(DEPDIR)/dnslabeltext.Po ./$(DEPDIR)/dnsname.Po \
+ ./$(DEPDIR)/dnsparser.Po ./$(DEPDIR)/dnstap.Po \
+ ./$(DEPDIR)/dnswriter.Po ./$(DEPDIR)/doh.Po \
+ ./$(DEPDIR)/ednscookies.Po ./$(DEPDIR)/ednsoptions.Po \
+ ./$(DEPDIR)/ednssubnet.Po ./$(DEPDIR)/epollmplexer.Po \
+ ./$(DEPDIR)/fstrm_logger.Po ./$(DEPDIR)/gettime.Po \
+ ./$(DEPDIR)/ipcipher.Po ./$(DEPDIR)/iputils.Po \
+ ./$(DEPDIR)/kqueuemplexer.Po ./$(DEPDIR)/libssl.Po \
+ ./$(DEPDIR)/misc.Po ./$(DEPDIR)/pollmplexer.Po \
+ ./$(DEPDIR)/portsmplexer.Po ./$(DEPDIR)/protozero.Po \
+ ./$(DEPDIR)/proxy-protocol.Po ./$(DEPDIR)/qtype.Po \
+ ./$(DEPDIR)/remote_logger.Po ./$(DEPDIR)/snmp-agent.Po \
+ ./$(DEPDIR)/sodcrypto.Po ./$(DEPDIR)/statnode.Po \
+ ./$(DEPDIR)/svc-records.Po ./$(DEPDIR)/tcpiohandler.Po \
+ ./$(DEPDIR)/test-base64_cc.Po \
+ ./$(DEPDIR)/test-connectionmanagement_hh.Po \
+ ./$(DEPDIR)/test-credentials_cc.Po \
+ ./$(DEPDIR)/test-delaypipe_hh.Po \
+ ./$(DEPDIR)/test-dnscrypt_cc.Po \
+ ./$(DEPDIR)/test-dnsdist-connections-cache.Po \
+ ./$(DEPDIR)/test-dnsdist_cc.Po \
+ ./$(DEPDIR)/test-dnsdistdynblocks_hh.Po \
+ ./$(DEPDIR)/test-dnsdistkvs_cc.Po \
+ ./$(DEPDIR)/test-dnsdistlbpolicies_cc.Po \
+ ./$(DEPDIR)/test-dnsdistnghttp2_cc.Po \
+ ./$(DEPDIR)/test-dnsdistpacketcache_cc.Po \
+ ./$(DEPDIR)/test-dnsdistrings_cc.Po \
+ ./$(DEPDIR)/test-dnsdistrules_cc.Po \
+ ./$(DEPDIR)/test-dnsdistsvc_cc.Po \
+ ./$(DEPDIR)/test-dnsdisttcp_cc.Po \
+ ./$(DEPDIR)/test-dnsparser_cc.Po \
+ ./$(DEPDIR)/test-iputils_hh.Po ./$(DEPDIR)/test-luawrapper.Po \
+ ./$(DEPDIR)/test-mplexer.Po \
+ ./$(DEPDIR)/test-proxy_protocol_cc.Po \
+ ./$(DEPDIR)/testrunner.Po ./$(DEPDIR)/threadname.Po \
+ ./$(DEPDIR)/uuid-utils.Po ./$(DEPDIR)/xpf.Po \
+ ext/json11/$(DEPDIR)/json11.Po \
+ ext/lmdb-safe/$(DEPDIR)/lmdb-safe.Po
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(dnsdist_SOURCES) $(nodist_dnsdist_SOURCES) \
+ $(testrunner_SOURCES)
+DIST_SOURCES = $(am__dnsdist_SOURCES_DIST) \
+ $(am__testrunner_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+man1dir = $(mandir)/man1
+NROFF = nroff
+MANS = $(dist_man_MANS)
+DATA = $(systemdsystemunit_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ cscope check recheck distdir distdir-am dist dist-all \
+ distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+CSCOPE = cscope
+am__tty_colors_dummy = \
+ mgn= red= grn= lgn= blu= brg= std=; \
+ am__color_tests=no
+am__tty_colors = { \
+ $(am__tty_colors_dummy); \
+ if test "X$(AM_COLOR_TESTS)" = Xno; then \
+ am__color_tests=no; \
+ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+ am__color_tests=yes; \
+ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+ am__color_tests=yes; \
+ fi; \
+ if test $$am__color_tests = yes; then \
+ red=''; \
+ grn=''; \
+ lgn=''; \
+ blu=''; \
+ mgn=''; \
+ brg=''; \
+ std=''; \
+ fi; \
+}
+am__recheck_rx = ^[ ]*:recheck:[ ]*
+am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
+am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+ recheck = 1; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ { \
+ if ((getline line2 < ($$0 ".log")) < 0) \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+ { \
+ recheck = 0; \
+ break; \
+ } \
+ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+ { \
+ break; \
+ } \
+ }; \
+ if (recheck) \
+ print $$0; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+ print "fatal: making $@: " msg | "cat >&2"; \
+ exit 1; \
+} \
+function rst_section(header) \
+{ \
+ print header; \
+ len = length(header); \
+ for (i = 1; i <= len; i = i + 1) \
+ printf "="; \
+ printf "\n\n"; \
+} \
+{ \
+ copy_in_global_log = 1; \
+ global_test_result = "RUN"; \
+ while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".trs"); \
+ if (line ~ /$(am__global_test_result_rx)/) \
+ { \
+ sub("$(am__global_test_result_rx)", "", line); \
+ sub("[ ]*$$", "", line); \
+ global_test_result = line; \
+ } \
+ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+ copy_in_global_log = 0; \
+ }; \
+ if (copy_in_global_log) \
+ { \
+ rst_section(global_test_result ": " $$0); \
+ while ((rc = (getline line < ($$0 ".log"))) != 0) \
+ { \
+ if (rc < 0) \
+ fatal("failed to read from " $$0 ".log"); \
+ print line; \
+ }; \
+ printf "\n"; \
+ }; \
+ close ($$0 ".trs"); \
+ close ($$0 ".log"); \
+}'
+# Restructured Text title.
+am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+# Solaris 10 'make', and several other traditional 'make' implementations,
+# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
+# by disabling -e (using the XSI extension "set +e") if it's set.
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+# Default flags passed to test drivers.
+am__common_driver_flags = \
+ --color-tests "$$am__color_tests" \
+ --enable-hard-errors "$$am__enable_hard_errors" \
+ --expect-failure "$$am__expect_failure"
+# To be inserted before the command running the test. Creates the
+# directory for the log if needed. Stores in $dir the directory
+# containing $f, in $tst the test, in $log the log. Executes the
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
+# will run the test scripts (or their associated LOG_COMPILER, if
+# thy have one).
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+ *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+ || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+ am__enable_hard_errors=no; \
+else \
+ am__enable_hard_errors=yes; \
+fi; \
+case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
+ am__expect_failure=yes;; \
+ *) \
+ am__expect_failure=no;; \
+esac; \
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+# A shell command to get the names of the tests scripts with any registered
+# extension removed (i.e., equivalently, the names of the test logs, with
+# the '.log' extension removed). The result is saved in the shell variable
+# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
+# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
+# since that might cause problem with VPATH rewrites for suffix-less tests.
+# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
+am__set_TESTS_bases = \
+ bases='$(TEST_LOGS)'; \
+ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+ bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS = @EXEEXT@ .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+am__set_b = \
+ case '$@' in \
+ */*) \
+ case '$*' in \
+ */*) b='$*';; \
+ *) b=`echo '$@' | sed 's/\.log$$//'`; \
+ esac;; \
+ *) \
+ b='$*';; \
+ esac
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
+ $(TEST_LOG_FLAGS)
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in $(srcdir)/lua_hpp.mk COPYING README \
+ compile config.guess config.sub depcomp install-sh ltmain.sh \
+ missing test-driver
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+GZIP_ENV = --best
+DIST_ARCHIVES = $(distdir).tar.bz2
+DIST_TARGETS = dist-bzip2
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CPPFLAGS = @AM_CPPFLAGS@ $(SYSTEMD_CFLAGS) $(LUA_CFLAGS) \
+ $(LIBEDIT_CFLAGS) $(LIBSODIUM_CFLAGS) $(FSTRM_CFLAGS) \
+ $(YAHTTP_CFLAGS) $(NET_SNMP_CFLAGS) $(NGHTTP2_CFLAGS) \
+ $(LIBCAP_CFLAGS) -I$(top_srcdir)/ext/protozero/include \
+ -DSYSCONFDIR=\"${sysconfdir}\" \
+ -DBOOST_CONTAINER_USE_STD_EXCEPTIONS $(am__append_1) \
+ $(am__append_2) $(am__append_3) $(am__append_4) \
+ $(am__append_5) $(am__append_6) $(am__append_7) \
+ $(am__append_8)
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
+BOOST_LDPATH = @BOOST_LDPATH@
+BOOST_ROOT = @BOOST_ROOT@
+BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS = @BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS@
+BOOST_UNIT_TEST_FRAMEWORK_LDPATH = @BOOST_UNIT_TEST_FRAMEWORK_LDPATH@
+BOOST_UNIT_TEST_FRAMEWORK_LIBS = @BOOST_UNIT_TEST_FRAMEWORK_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDB_CFLAGS = @CDB_CFLAGS@
+CDB_LIBS = @CDB_LIBS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+DYNLINKFLAGS = @DYNLINKFLAGS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FSTRM_CFLAGS = @FSTRM_CFLAGS@
+FSTRM_LIBS = @FSTRM_LIBS@
+GNUTLS_CFLAGS = @GNUTLS_CFLAGS@
+GNUTLS_LIBS = @GNUTLS_LIBS@
+GREP = @GREP@
+HAVE_CXX17 = @HAVE_CXX17@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPCRYPT_CFLAGS = @IPCRYPT_CFLAGS@
+IPCRYPT_LIBS = @IPCRYPT_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAP_CFLAGS = @LIBCAP_CFLAGS@
+LIBCAP_LIBS = @LIBCAP_LIBS@
+LIBCRYPTO_INCLUDES = @LIBCRYPTO_INCLUDES@
+LIBCRYPTO_LDFLAGS = @LIBCRYPTO_LDFLAGS@
+LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@
+LIBEDIT_CFLAGS = @LIBEDIT_CFLAGS@
+LIBEDIT_LIBS = @LIBEDIT_LIBS@
+LIBH2OEVLOOP_CFLAGS = @LIBH2OEVLOOP_CFLAGS@
+LIBH2OEVLOOP_LIBS = @LIBH2OEVLOOP_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSODIUM_CFLAGS = @LIBSODIUM_CFLAGS@
+LIBSODIUM_LIBS = @LIBSODIUM_LIBS@
+LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
+LIBSSL_LIBS = @LIBSSL_LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LMDB_CFLAGS = @LMDB_CFLAGS@
+LMDB_LIBS = @LMDB_LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LUA_CFLAGS = @LUA_CFLAGS@
+LUA_LIBS = @LUA_LIBS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NET_SNMP_CFLAGS = @NET_SNMP_CFLAGS@
+NET_SNMP_LIBS = @NET_SNMP_LIBS@
+NGHTTP2_CFLAGS = @NGHTTP2_CFLAGS@
+NGHTTP2_LIBS = @NGHTTP2_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGEVERSION = @PACKAGEVERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PIE_CFLAGS = @PIE_CFLAGS@
+PIE_LDFLAGS = @PIE_LDFLAGS@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PROGRAM_LDFLAGS = @PROGRAM_LDFLAGS@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RAGEL = @RAGEL@
+RANLIB = @RANLIB@
+RE2_CFLAGS = @RE2_CFLAGS@
+RE2_LIBS = @RE2_LIBS@
+RELRO_LDFLAGS = @RELRO_LDFLAGS@
+RT_LIBS = @RT_LIBS@
+SANITIZER_FLAGS = @SANITIZER_FLAGS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEMCTL = @SYSTEMCTL@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_DIR = @SYSTEMD_DIR@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+SYSTEMD_MODULES_LOAD = @SYSTEMD_MODULES_LOAD@
+THREADFLAGS = @THREADFLAGS@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+YAHTTP_CFLAGS = @YAHTTP_CFLAGS@
+YAHTTP_LIBS = @YAHTTP_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+service_group = @service_group@
+service_user = @service_user@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemd = @systemd@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = ext/ipcrypt \
+ ext/yahttp
+
+CLEANFILES = htmlfiles.h.tmp htmlfiles.h dnsdist-lua-ffi-interface.inc \
+ lua.hpp $(am__append_35)
+BUILT_SOURCES = htmlfiles.h dnsdist-lua-ffi-interface.inc \
+ dnslabeltext.cc $(am__append_26)
+SRC_JS_FILES := $(wildcard src_js/*.js)
+MIN_JS_FILES := $(patsubst src_js/%.js,html/js/%.min.js,$(SRC_JS_FILES))
+EXTRA_DIST = COPYING \
+ dnslabeltext.rl \
+ dnsdistconf.lua \
+ dnsmessage.proto \
+ dnstap.proto \
+ README.md \
+ delaypipe.cc delaypipe.hh \
+ html \
+ incfiles \
+ src_js \
+ dnsdist.service.in \
+ lua_hpp.mk \
+ bpf-filter.main.ebpf \
+ bpf-filter.qname.ebpf \
+ bpf-filter.ebpf.src \
+ DNSDIST-MIB.txt \
+ devpollmplexer.cc \
+ epollmplexer.cc \
+ kqueuemplexer.cc \
+ portsmplexer.cc \
+ cdb.cc cdb.hh \
+ ext/lmdb-safe/lmdb-safe.cc ext/lmdb-safe/lmdb-safe.hh \
+ ext/protozero/include/* \
+ builder-support/gen-version
+
+@UNIT_TESTS_TRUE@TESTS_ENVIRONMENT = env BOOST_TEST_LOG_LEVEL=message SRCDIR='$(srcdir)'
+dnsdist_SOURCES = ascii.hh base64.hh bpf-filter.cc bpf-filter.hh \
+ cachecleaner.hh capabilities.cc capabilities.hh \
+ circular_buffer.hh connection-management.hh credentials.cc \
+ credentials.hh dns.cc dns.hh dnscrypt.cc dnscrypt.hh \
+ dnsdist-backend.cc dnsdist-cache.cc dnsdist-cache.hh \
+ dnsdist-carbon.cc dnsdist-console.cc dnsdist-console.hh \
+ dnsdist-dnscrypt.cc dnsdist-dynblocks.cc dnsdist-dynblocks.hh \
+ dnsdist-dynbpf.cc dnsdist-dynbpf.hh dnsdist-ecs.cc \
+ dnsdist-ecs.hh dnsdist-healthchecks.cc dnsdist-healthchecks.hh \
+ dnsdist-idstate.cc dnsdist-idstate.hh dnsdist-kvs.hh \
+ dnsdist-kvs.cc dnsdist-lbpolicies.cc dnsdist-lbpolicies.hh \
+ dnsdist-lua-actions.cc dnsdist-lua-bindings-dnscrypt.cc \
+ dnsdist-lua-bindings-dnsquestion.cc \
+ dnsdist-lua-bindings-kvs.cc \
+ dnsdist-lua-bindings-packetcache.cc \
+ dnsdist-lua-bindings-protobuf.cc dnsdist-lua-bindings.cc \
+ dnsdist-lua-ffi-interface.h dnsdist-lua-ffi-interface.inc \
+ dnsdist-lua-ffi.cc dnsdist-lua-ffi.hh \
+ dnsdist-lua-inspection-ffi.cc dnsdist-lua-inspection-ffi.hh \
+ dnsdist-lua-inspection.cc dnsdist-lua-rules.cc \
+ dnsdist-lua-vars.cc dnsdist-lua-web.cc dnsdist-lua.cc \
+ dnsdist-lua.hh dnsdist-nghttp2.cc dnsdist-nghttp2.hh \
+ dnsdist-prometheus.hh dnsdist-protobuf.cc dnsdist-protobuf.hh \
+ dnsdist-protocols.cc dnsdist-protocols.hh \
+ dnsdist-proxy-protocol.cc dnsdist-proxy-protocol.hh \
+ dnsdist-rings.cc dnsdist-rings.hh dnsdist-rules.cc \
+ dnsdist-rules.hh dnsdist-secpoll.cc dnsdist-secpoll.hh \
+ dnsdist-session-cache.cc dnsdist-session-cache.hh \
+ dnsdist-snmp.cc dnsdist-snmp.hh dnsdist-svc.cc dnsdist-svc.hh \
+ dnsdist-systemd.cc dnsdist-systemd.hh \
+ dnsdist-tcp-downstream.cc dnsdist-tcp-downstream.hh \
+ dnsdist-tcp-upstream.hh dnsdist-tcp.cc dnsdist-tcp.hh \
+ dnsdist-web.cc dnsdist-web.hh dnsdist-xpf.cc dnsdist-xpf.hh \
+ dnsdist.cc dnsdist.hh dnslabeltext.cc dnsname.cc dnsname.hh \
+ dnsparser.hh dnsparser.cc dnstap.cc dnstap.hh dnswriter.cc \
+ dnswriter.hh doh.hh doh.cc dolog.hh ednscookies.cc \
+ ednscookies.hh ednsoptions.cc ednsoptions.hh ednssubnet.cc \
+ ednssubnet.hh ext/json11/json11.cpp ext/json11/json11.hpp \
+ ext/libbpf/libbpf.h ext/luawrapper/include/LuaContext.hpp \
+ fstrm_logger.cc fstrm_logger.hh gettime.cc gettime.hh \
+ htmlfiles.h iputils.cc iputils.hh libssl.cc libssl.hh lock.hh \
+ misc.cc misc.hh mplexer.hh namespaces.hh noinitvector.hh \
+ packetcache.hh pdnsexception.hh pollmplexer.cc protozero.cc \
+ protozero.hh proxy-protocol.cc proxy-protocol.hh qtype.cc \
+ qtype.hh remote_logger.cc remote_logger.hh sholder.hh \
+ snmp-agent.cc snmp-agent.hh sodcrypto.cc sodcrypto.hh \
+ sstuff.hh stat_t.hh statnode.cc statnode.hh svc-records.cc \
+ svc-records.hh tcpiohandler-mplexer.hh tcpiohandler.cc \
+ tcpiohandler.hh threadname.hh threadname.cc uuid-utils.hh \
+ uuid-utils.cc xpf.cc xpf.hh $(am__append_11) $(am__append_17) \
+ $(am__append_20) $(am__append_27) $(am__append_29) \
+ $(am__append_31) $(am__append_33)
+testrunner_SOURCES = base64.hh bpf-filter.cc bpf-filter.hh \
+ cachecleaner.hh circular_buffer.hh connection-management.hh \
+ credentials.cc credentials.hh dns.cc dns.hh dnscrypt.cc \
+ dnscrypt.hh dnsdist-backend.cc dnsdist-cache.cc \
+ dnsdist-cache.hh dnsdist-dynblocks.cc dnsdist-dynblocks.hh \
+ dnsdist-dynbpf.cc dnsdist-dynbpf.hh dnsdist-ecs.cc \
+ dnsdist-ecs.hh dnsdist-idstate.cc dnsdist-idstate.hh \
+ dnsdist-kvs.cc dnsdist-kvs.hh dnsdist-lbpolicies.cc \
+ dnsdist-lbpolicies.hh dnsdist-lua-bindings-dnsquestion.cc \
+ dnsdist-lua-bindings-kvs.cc dnsdist-lua-bindings.cc \
+ dnsdist-lua-ffi-interface.h dnsdist-lua-ffi-interface.inc \
+ dnsdist-lua-ffi.cc dnsdist-lua-ffi.hh dnsdist-lua-vars.cc \
+ dnsdist-nghttp2.cc dnsdist-nghttp2.hh dnsdist-protocols.cc \
+ dnsdist-protocols.hh dnsdist-proxy-protocol.cc \
+ dnsdist-proxy-protocol.hh dnsdist-rings.cc dnsdist-rings.hh \
+ dnsdist-rules.cc dnsdist-rules.hh dnsdist-session-cache.cc \
+ dnsdist-session-cache.hh dnsdist-svc.cc dnsdist-svc.hh \
+ dnsdist-tcp-downstream.cc dnsdist-tcp.cc dnsdist-tcp.hh \
+ dnsdist-xpf.cc dnsdist-xpf.hh dnsdist.hh dnslabeltext.cc \
+ dnsname.cc dnsname.hh dnsparser.hh dnsparser.cc dnswriter.cc \
+ dnswriter.hh dolog.hh ednscookies.cc ednscookies.hh \
+ ednsoptions.cc ednsoptions.hh ednssubnet.cc ednssubnet.hh \
+ ext/luawrapper/include/LuaContext.hpp gettime.cc gettime.hh \
+ iputils.cc iputils.hh misc.cc misc.hh namespaces.hh \
+ noinitvector.hh pdnsexception.hh pollmplexer.cc \
+ proxy-protocol.cc proxy-protocol.hh qtype.cc qtype.hh \
+ sholder.hh sodcrypto.cc sstuff.hh stat_t.hh statnode.cc \
+ statnode.hh svc-records.cc svc-records.hh test-base64_cc.cc \
+ test-connectionmanagement_hh.cc test-credentials_cc.cc \
+ test-delaypipe_hh.cc test-dnscrypt_cc.cc \
+ test-dnsdist-connections-cache.cc test-dnsdist_cc.cc \
+ test-dnsdistdynblocks_hh.cc test-dnsdistkvs_cc.cc \
+ test-dnsdistlbpolicies_cc.cc test-dnsdistnghttp2_cc.cc \
+ test-dnsdistpacketcache_cc.cc test-dnsdistrings_cc.cc \
+ test-dnsdistrules_cc.cc test-dnsdistsvc_cc.cc \
+ test-dnsdisttcp_cc.cc test-dnsparser_cc.cc test-iputils_hh.cc \
+ test-luawrapper.cc test-mplexer.cc test-proxy_protocol_cc.cc \
+ testrunner.cc threadname.hh threadname.cc uuid-utils.hh \
+ uuid-utils.cc xpf.cc xpf.hh $(am__append_12) $(am__append_21) \
+ $(am__append_28) $(am__append_30) $(am__append_32) \
+ $(am__append_34)
+dnsdist_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ $(PROGRAM_LDFLAGS) \
+ -pthread
+
+dnsdist_LDADD = $(LUA_LIBS) $(LIBEDIT_LIBS) $(RT_LIBS) $(YAHTTP_LIBS) \
+ $(LIBSODIUM_LIBS) $(FSTRM_LIBS) $(SYSTEMD_LIBS) \
+ $(NET_SNMP_LIBS) $(LIBCAP_LIBS) $(IPCRYPT_LIBS) \
+ $(am__append_9) $(am__append_13) $(am__append_14) \
+ $(am__append_15) $(am__append_18) $(am__append_22) \
+ $(am__append_23) $(am__append_24)
+testrunner_LDFLAGS = \
+ $(AM_LDFLAGS) \
+ $(PROGRAM_LDFLAGS) \
+ $(BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS) \
+ -pthread
+
+testrunner_LDADD = $(BOOST_UNIT_TEST_FRAMEWORK_LIBS) $(FSTRM_LIBS) \
+ $(LIBSODIUM_LIBS) $(LUA_LIBS) $(RT_LIBS) $(LIBCAP_LIBS) \
+ $(am__append_10) $(am__append_16) $(am__append_19) \
+ $(am__append_25)
+@HAVE_LUA_HPP_FALSE@nodist_dnsdist_SOURCES = lua.hpp
+MANPAGES = dnsdist.1
+dist_man_MANS = $(MANPAGES)
+@HAVE_SYSTEMD_TRUE@systemdsystemunitdir = $(SYSTEMD_DIR)
+@HAVE_SYSTEMD_TRUE@systemdsystemunit_DATA = \
+@HAVE_SYSTEMD_TRUE@ dnsdist.service \
+@HAVE_SYSTEMD_TRUE@ dnsdist@.service
+
+all: $(BUILT_SOURCES) config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cc .cpp .lo .log .o .obj .test .test$(EXEEXT) .trs
+am--refresh: Makefile
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/lua_hpp.mk $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
+ esac;
+$(srcdir)/lua_hpp.mk $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p \
+ || test -f $$p1 \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+ext/json11/$(am__dirstamp):
+ @$(MKDIR_P) ext/json11
+ @: > ext/json11/$(am__dirstamp)
+ext/json11/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ext/json11/$(DEPDIR)
+ @: > ext/json11/$(DEPDIR)/$(am__dirstamp)
+ext/json11/json11.$(OBJEXT): ext/json11/$(am__dirstamp) \
+ ext/json11/$(DEPDIR)/$(am__dirstamp)
+ext/lmdb-safe/$(am__dirstamp):
+ @$(MKDIR_P) ext/lmdb-safe
+ @: > ext/lmdb-safe/$(am__dirstamp)
+ext/lmdb-safe/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) ext/lmdb-safe/$(DEPDIR)
+ @: > ext/lmdb-safe/$(DEPDIR)/$(am__dirstamp)
+ext/lmdb-safe/lmdb-safe.$(OBJEXT): ext/lmdb-safe/$(am__dirstamp) \
+ ext/lmdb-safe/$(DEPDIR)/$(am__dirstamp)
+
+dnsdist$(EXEEXT): $(dnsdist_OBJECTS) $(dnsdist_DEPENDENCIES) $(EXTRA_dnsdist_DEPENDENCIES)
+ @rm -f dnsdist$(EXEEXT)
+ $(AM_V_CXXLD)$(dnsdist_LINK) $(dnsdist_OBJECTS) $(dnsdist_LDADD) $(LIBS)
+
+testrunner$(EXEEXT): $(testrunner_OBJECTS) $(testrunner_DEPENDENCIES) $(EXTRA_testrunner_DEPENDENCIES)
+ @rm -f testrunner$(EXEEXT)
+ $(AM_V_CXXLD)$(testrunner_LINK) $(testrunner_OBJECTS) $(testrunner_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+ -rm -f ext/json11/*.$(OBJEXT)
+ -rm -f ext/lmdb-safe/*.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-filter.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capabilities.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cdb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/credentials.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devpollmplexer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dns.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnscrypt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-backend.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-cache.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-carbon.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-console.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-dnscrypt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-dynblocks.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-dynbpf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-ecs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-healthchecks.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-idstate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-kvs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lbpolicies.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-actions.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-bindings-dnscrypt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-bindings-dnsquestion.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-bindings-kvs.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-bindings-packetcache.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-bindings-protobuf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-bindings.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-ffi.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-inspection-ffi.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-inspection.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-rules.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-vars.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua-web.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-lua.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-nghttp2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-protobuf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-protocols.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-proxy-protocol.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-rings.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-rules.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-secpoll.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-session-cache.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-snmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-svc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-systemd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-tcp-downstream.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-tcp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-web.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist-xpf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsdist.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnslabeltext.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnsparser.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnstap.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dnswriter.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ednscookies.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ednsoptions.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ednssubnet.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epollmplexer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstrm_logger.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettime.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipcipher.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iputils.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kqueuemplexer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libssl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pollmplexer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/portsmplexer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protozero.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proxy-protocol.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qtype.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remote_logger.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snmp-agent.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sodcrypto.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statnode.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svc-records.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tcpiohandler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-base64_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-connectionmanagement_hh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-credentials_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-delaypipe_hh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnscrypt_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdist-connections-cache.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdist_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdistdynblocks_hh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdistkvs_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdistlbpolicies_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdistnghttp2_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdistpacketcache_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdistrings_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdistrules_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdistsvc_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsdisttcp_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dnsparser_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iputils_hh.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-luawrapper.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mplexer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-proxy_protocol_cc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrunner.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uuid-utils.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@ext/json11/$(DEPDIR)/json11.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@ext/lmdb-safe/$(DEPDIR)/lmdb-safe.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.cc.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cc.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cc.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool config.lt
+install-man1: $(dist_man_MANS)
+ @$(NORMAL_INSTALL)
+ @list1=''; \
+ list2='$(dist_man_MANS)'; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
+ } | while read p; do \
+ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; echo "$$p"; \
+ done | \
+ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+ sed 'N;N;s,\n, ,g' | { \
+ list=; while read file base inst; do \
+ if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+ fi; \
+ done; \
+ for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+ while read files; do \
+ test -z "$$files" || { \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+ done; }
+
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list=''; test -n "$(man1dir)" || exit 0; \
+ files=`{ for i in $$list; do echo "$$i"; done; \
+ l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+ sed -n '/\.1[a-z]*$$/p'; \
+ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+install-systemdsystemunitDATA: $(systemdsystemunit_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(systemdsystemunitdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdsystemunitdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \
+ done
+
+uninstall-systemdsystemunitDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir)
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
+
+# Recover from deleted '.trs' file; this should ensure that
+# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
+# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
+# to avoid problems with "make -n".
+.log.trs:
+ rm -f $< $@
+ $(MAKE) $(AM_MAKEFLAGS) $<
+
+# Leading 'am--fnord' is there to ensure the list of targets does not
+# expand to empty, as could happen e.g. with make check TESTS=''.
+am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
+am--force-recheck:
+ @:
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+ @$(am__set_TESTS_bases); \
+ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+ redo_bases=`for i in $$bases; do \
+ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+ done`; \
+ if test -n "$$redo_bases"; then \
+ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
+ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
+ if $(am__make_dryrun); then :; else \
+ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
+ fi; \
+ fi; \
+ if test -n "$$am__remaking_logs"; then \
+ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
+ "recursion detected" >&2; \
+ elif test -n "$$redo_logs"; then \
+ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
+ fi; \
+ if $(am__make_dryrun); then :; else \
+ st=0; \
+ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+ for i in $$redo_bases; do \
+ test -f $$i.trs && test -r $$i.trs \
+ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+ test -f $$i.log && test -r $$i.log \
+ || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+ done; \
+ test $$st -eq 0 || exit 1; \
+ fi
+ @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+ ws='[ ]'; \
+ results=`for b in $$bases; do echo $$b.trs; done`; \
+ test -n "$$results" || results=/dev/null; \
+ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
+ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
+ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
+ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
+ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+ if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+ success=true; \
+ else \
+ success=false; \
+ fi; \
+ br='==================='; br=$$br$$br$$br$$br; \
+ result_count () \
+ { \
+ if test x"$$1" = x"--maybe-color"; then \
+ maybe_colorize=yes; \
+ elif test x"$$1" = x"--no-color"; then \
+ maybe_colorize=no; \
+ else \
+ echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ fi; \
+ shift; \
+ desc=$$1 count=$$2; \
+ if test $$maybe_colorize = yes && test $$count -gt 0; then \
+ color_start=$$3 color_end=$$std; \
+ else \
+ color_start= color_end=; \
+ fi; \
+ echo "$${color_start}# $$desc $$count$${color_end}"; \
+ }; \
+ create_testsuite_report () \
+ { \
+ result_count $$1 "TOTAL:" $$all "$$brg"; \
+ result_count $$1 "PASS: " $$pass "$$grn"; \
+ result_count $$1 "SKIP: " $$skip "$$blu"; \
+ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+ result_count $$1 "FAIL: " $$fail "$$red"; \
+ result_count $$1 "XPASS:" $$xpass "$$red"; \
+ result_count $$1 "ERROR:" $$error "$$mgn"; \
+ }; \
+ { \
+ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
+ $(am__rst_title); \
+ create_testsuite_report --no-color; \
+ echo; \
+ echo ".. contents:: :depth: 2"; \
+ echo; \
+ for b in $$bases; do echo $$b; done \
+ | $(am__create_global_log); \
+ } >$(TEST_SUITE_LOG).tmp || exit 1; \
+ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
+ if $$success; then \
+ col="$$grn"; \
+ else \
+ col="$$red"; \
+ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
+ fi; \
+ echo "$${col}$$br$${std}"; \
+ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}$$br$${std}"; \
+ create_testsuite_report --maybe-color; \
+ echo "$$col$$br$$std"; \
+ if $$success; then :; else \
+ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
+ if test -n "$(PACKAGE_BUGREPORT)"; then \
+ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
+ fi; \
+ echo "$$col$$br$$std"; \
+ fi; \
+ $$success || exit 1
+
+check-TESTS:
+ @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
+ @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+ exit $$?;
+recheck: all
+ @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+ @set +e; $(am__set_TESTS_bases); \
+ bases=`for i in $$bases; do echo $$i; done \
+ | $(am__list_recheck_tests)` || exit 1; \
+ log_list=`for i in $$bases; do echo $$i.log; done`; \
+ log_list=`echo $$log_list`; \
+ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
+ am__force_recheck=am--force-recheck \
+ TEST_LOGS="$$log_list"; \
+ exit $$?
+testrunner.log: testrunner$(EXEEXT)
+ @p='testrunner$(EXEEXT)'; \
+ b='testrunner'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+.test.log:
+ @p='$<'; \
+ $(am__set_b); \
+ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
+@am__EXEEXT_TRUE@.test$(EXEEXT).log:
+@am__EXEEXT_TRUE@ @p='$<'; \
+@am__EXEEXT_TRUE@ $(am__set_b); \
+@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
+@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
+@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
+@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ $(am__remove_distdir)
+ test -d "$(distdir)" || mkdir "$(distdir)"
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -test -n "$(am__skip_mode_fix)" \
+ || find "$(distdir)" -type d ! -perm -755 \
+ -exec chmod u+rwx,go+rx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
+ $(am__post_remove_distdir)
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
+
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
+
+dist-xz: distdir
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__post_remove_distdir)
+
+dist-shar: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+ shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
+ $(am__post_remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__post_remove_distdir)
+
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+ *.tar.xz*) \
+ xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+ chmod a-w $(distdir)
+ test -d $(distdir)/_build || exit 0; \
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && am__cwd=`pwd` \
+ && $(am__cd) $(distdir)/_build/sub \
+ && ../../configure \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ --srcdir=../.. --prefix="$$dc_install_base" \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+ && cd "$$am__cwd" \
+ || exit 1
+ $(am__post_remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+@UNIT_TESTS_TRUE@check-local:
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local
+check: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) check-recursive
+all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) config.h
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(systemdsystemunitdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+ -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
+ -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
+ -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f ext/json11/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ext/json11/$(am__dirstamp)
+ -rm -f ext/lmdb-safe/$(DEPDIR)/$(am__dirstamp)
+ -rm -f ext/lmdb-safe/$(am__dirstamp)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
+ clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f ./$(DEPDIR)/bpf-filter.Po
+ -rm -f ./$(DEPDIR)/capabilities.Po
+ -rm -f ./$(DEPDIR)/cdb.Po
+ -rm -f ./$(DEPDIR)/credentials.Po
+ -rm -f ./$(DEPDIR)/devpollmplexer.Po
+ -rm -f ./$(DEPDIR)/dns.Po
+ -rm -f ./$(DEPDIR)/dnscrypt.Po
+ -rm -f ./$(DEPDIR)/dnsdist-backend.Po
+ -rm -f ./$(DEPDIR)/dnsdist-cache.Po
+ -rm -f ./$(DEPDIR)/dnsdist-carbon.Po
+ -rm -f ./$(DEPDIR)/dnsdist-console.Po
+ -rm -f ./$(DEPDIR)/dnsdist-dnscrypt.Po
+ -rm -f ./$(DEPDIR)/dnsdist-dynblocks.Po
+ -rm -f ./$(DEPDIR)/dnsdist-dynbpf.Po
+ -rm -f ./$(DEPDIR)/dnsdist-ecs.Po
+ -rm -f ./$(DEPDIR)/dnsdist-healthchecks.Po
+ -rm -f ./$(DEPDIR)/dnsdist-idstate.Po
+ -rm -f ./$(DEPDIR)/dnsdist-kvs.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lbpolicies.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-actions.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-dnscrypt.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-dnsquestion.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-kvs.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-packetcache.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-protobuf.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-ffi.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-inspection-ffi.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-inspection.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-rules.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-vars.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-web.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua.Po
+ -rm -f ./$(DEPDIR)/dnsdist-nghttp2.Po
+ -rm -f ./$(DEPDIR)/dnsdist-protobuf.Po
+ -rm -f ./$(DEPDIR)/dnsdist-protocols.Po
+ -rm -f ./$(DEPDIR)/dnsdist-proxy-protocol.Po
+ -rm -f ./$(DEPDIR)/dnsdist-rings.Po
+ -rm -f ./$(DEPDIR)/dnsdist-rules.Po
+ -rm -f ./$(DEPDIR)/dnsdist-secpoll.Po
+ -rm -f ./$(DEPDIR)/dnsdist-session-cache.Po
+ -rm -f ./$(DEPDIR)/dnsdist-snmp.Po
+ -rm -f ./$(DEPDIR)/dnsdist-svc.Po
+ -rm -f ./$(DEPDIR)/dnsdist-systemd.Po
+ -rm -f ./$(DEPDIR)/dnsdist-tcp-downstream.Po
+ -rm -f ./$(DEPDIR)/dnsdist-tcp.Po
+ -rm -f ./$(DEPDIR)/dnsdist-web.Po
+ -rm -f ./$(DEPDIR)/dnsdist-xpf.Po
+ -rm -f ./$(DEPDIR)/dnsdist.Po
+ -rm -f ./$(DEPDIR)/dnslabeltext.Po
+ -rm -f ./$(DEPDIR)/dnsname.Po
+ -rm -f ./$(DEPDIR)/dnsparser.Po
+ -rm -f ./$(DEPDIR)/dnstap.Po
+ -rm -f ./$(DEPDIR)/dnswriter.Po
+ -rm -f ./$(DEPDIR)/doh.Po
+ -rm -f ./$(DEPDIR)/ednscookies.Po
+ -rm -f ./$(DEPDIR)/ednsoptions.Po
+ -rm -f ./$(DEPDIR)/ednssubnet.Po
+ -rm -f ./$(DEPDIR)/epollmplexer.Po
+ -rm -f ./$(DEPDIR)/fstrm_logger.Po
+ -rm -f ./$(DEPDIR)/gettime.Po
+ -rm -f ./$(DEPDIR)/ipcipher.Po
+ -rm -f ./$(DEPDIR)/iputils.Po
+ -rm -f ./$(DEPDIR)/kqueuemplexer.Po
+ -rm -f ./$(DEPDIR)/libssl.Po
+ -rm -f ./$(DEPDIR)/misc.Po
+ -rm -f ./$(DEPDIR)/pollmplexer.Po
+ -rm -f ./$(DEPDIR)/portsmplexer.Po
+ -rm -f ./$(DEPDIR)/protozero.Po
+ -rm -f ./$(DEPDIR)/proxy-protocol.Po
+ -rm -f ./$(DEPDIR)/qtype.Po
+ -rm -f ./$(DEPDIR)/remote_logger.Po
+ -rm -f ./$(DEPDIR)/snmp-agent.Po
+ -rm -f ./$(DEPDIR)/sodcrypto.Po
+ -rm -f ./$(DEPDIR)/statnode.Po
+ -rm -f ./$(DEPDIR)/svc-records.Po
+ -rm -f ./$(DEPDIR)/tcpiohandler.Po
+ -rm -f ./$(DEPDIR)/test-base64_cc.Po
+ -rm -f ./$(DEPDIR)/test-connectionmanagement_hh.Po
+ -rm -f ./$(DEPDIR)/test-credentials_cc.Po
+ -rm -f ./$(DEPDIR)/test-delaypipe_hh.Po
+ -rm -f ./$(DEPDIR)/test-dnscrypt_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdist-connections-cache.Po
+ -rm -f ./$(DEPDIR)/test-dnsdist_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistdynblocks_hh.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistkvs_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistlbpolicies_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistnghttp2_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistpacketcache_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistrings_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistrules_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistsvc_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdisttcp_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsparser_cc.Po
+ -rm -f ./$(DEPDIR)/test-iputils_hh.Po
+ -rm -f ./$(DEPDIR)/test-luawrapper.Po
+ -rm -f ./$(DEPDIR)/test-mplexer.Po
+ -rm -f ./$(DEPDIR)/test-proxy_protocol_cc.Po
+ -rm -f ./$(DEPDIR)/testrunner.Po
+ -rm -f ./$(DEPDIR)/threadname.Po
+ -rm -f ./$(DEPDIR)/uuid-utils.Po
+ -rm -f ./$(DEPDIR)/xpf.Po
+ -rm -f ext/json11/$(DEPDIR)/json11.Po
+ -rm -f ext/lmdb-safe/$(DEPDIR)/lmdb-safe.Po
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-man install-systemdsystemunitDATA
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f ./$(DEPDIR)/bpf-filter.Po
+ -rm -f ./$(DEPDIR)/capabilities.Po
+ -rm -f ./$(DEPDIR)/cdb.Po
+ -rm -f ./$(DEPDIR)/credentials.Po
+ -rm -f ./$(DEPDIR)/devpollmplexer.Po
+ -rm -f ./$(DEPDIR)/dns.Po
+ -rm -f ./$(DEPDIR)/dnscrypt.Po
+ -rm -f ./$(DEPDIR)/dnsdist-backend.Po
+ -rm -f ./$(DEPDIR)/dnsdist-cache.Po
+ -rm -f ./$(DEPDIR)/dnsdist-carbon.Po
+ -rm -f ./$(DEPDIR)/dnsdist-console.Po
+ -rm -f ./$(DEPDIR)/dnsdist-dnscrypt.Po
+ -rm -f ./$(DEPDIR)/dnsdist-dynblocks.Po
+ -rm -f ./$(DEPDIR)/dnsdist-dynbpf.Po
+ -rm -f ./$(DEPDIR)/dnsdist-ecs.Po
+ -rm -f ./$(DEPDIR)/dnsdist-healthchecks.Po
+ -rm -f ./$(DEPDIR)/dnsdist-idstate.Po
+ -rm -f ./$(DEPDIR)/dnsdist-kvs.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lbpolicies.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-actions.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-dnscrypt.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-dnsquestion.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-kvs.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-packetcache.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings-protobuf.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-bindings.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-ffi.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-inspection-ffi.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-inspection.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-rules.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-vars.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua-web.Po
+ -rm -f ./$(DEPDIR)/dnsdist-lua.Po
+ -rm -f ./$(DEPDIR)/dnsdist-nghttp2.Po
+ -rm -f ./$(DEPDIR)/dnsdist-protobuf.Po
+ -rm -f ./$(DEPDIR)/dnsdist-protocols.Po
+ -rm -f ./$(DEPDIR)/dnsdist-proxy-protocol.Po
+ -rm -f ./$(DEPDIR)/dnsdist-rings.Po
+ -rm -f ./$(DEPDIR)/dnsdist-rules.Po
+ -rm -f ./$(DEPDIR)/dnsdist-secpoll.Po
+ -rm -f ./$(DEPDIR)/dnsdist-session-cache.Po
+ -rm -f ./$(DEPDIR)/dnsdist-snmp.Po
+ -rm -f ./$(DEPDIR)/dnsdist-svc.Po
+ -rm -f ./$(DEPDIR)/dnsdist-systemd.Po
+ -rm -f ./$(DEPDIR)/dnsdist-tcp-downstream.Po
+ -rm -f ./$(DEPDIR)/dnsdist-tcp.Po
+ -rm -f ./$(DEPDIR)/dnsdist-web.Po
+ -rm -f ./$(DEPDIR)/dnsdist-xpf.Po
+ -rm -f ./$(DEPDIR)/dnsdist.Po
+ -rm -f ./$(DEPDIR)/dnslabeltext.Po
+ -rm -f ./$(DEPDIR)/dnsname.Po
+ -rm -f ./$(DEPDIR)/dnsparser.Po
+ -rm -f ./$(DEPDIR)/dnstap.Po
+ -rm -f ./$(DEPDIR)/dnswriter.Po
+ -rm -f ./$(DEPDIR)/doh.Po
+ -rm -f ./$(DEPDIR)/ednscookies.Po
+ -rm -f ./$(DEPDIR)/ednsoptions.Po
+ -rm -f ./$(DEPDIR)/ednssubnet.Po
+ -rm -f ./$(DEPDIR)/epollmplexer.Po
+ -rm -f ./$(DEPDIR)/fstrm_logger.Po
+ -rm -f ./$(DEPDIR)/gettime.Po
+ -rm -f ./$(DEPDIR)/ipcipher.Po
+ -rm -f ./$(DEPDIR)/iputils.Po
+ -rm -f ./$(DEPDIR)/kqueuemplexer.Po
+ -rm -f ./$(DEPDIR)/libssl.Po
+ -rm -f ./$(DEPDIR)/misc.Po
+ -rm -f ./$(DEPDIR)/pollmplexer.Po
+ -rm -f ./$(DEPDIR)/portsmplexer.Po
+ -rm -f ./$(DEPDIR)/protozero.Po
+ -rm -f ./$(DEPDIR)/proxy-protocol.Po
+ -rm -f ./$(DEPDIR)/qtype.Po
+ -rm -f ./$(DEPDIR)/remote_logger.Po
+ -rm -f ./$(DEPDIR)/snmp-agent.Po
+ -rm -f ./$(DEPDIR)/sodcrypto.Po
+ -rm -f ./$(DEPDIR)/statnode.Po
+ -rm -f ./$(DEPDIR)/svc-records.Po
+ -rm -f ./$(DEPDIR)/tcpiohandler.Po
+ -rm -f ./$(DEPDIR)/test-base64_cc.Po
+ -rm -f ./$(DEPDIR)/test-connectionmanagement_hh.Po
+ -rm -f ./$(DEPDIR)/test-credentials_cc.Po
+ -rm -f ./$(DEPDIR)/test-delaypipe_hh.Po
+ -rm -f ./$(DEPDIR)/test-dnscrypt_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdist-connections-cache.Po
+ -rm -f ./$(DEPDIR)/test-dnsdist_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistdynblocks_hh.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistkvs_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistlbpolicies_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistnghttp2_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistpacketcache_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistrings_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistrules_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdistsvc_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsdisttcp_cc.Po
+ -rm -f ./$(DEPDIR)/test-dnsparser_cc.Po
+ -rm -f ./$(DEPDIR)/test-iputils_hh.Po
+ -rm -f ./$(DEPDIR)/test-luawrapper.Po
+ -rm -f ./$(DEPDIR)/test-mplexer.Po
+ -rm -f ./$(DEPDIR)/test-proxy_protocol_cc.Po
+ -rm -f ./$(DEPDIR)/testrunner.Po
+ -rm -f ./$(DEPDIR)/threadname.Po
+ -rm -f ./$(DEPDIR)/uuid-utils.Po
+ -rm -f ./$(DEPDIR)/xpf.Po
+ -rm -f ext/json11/$(DEPDIR)/json11.Po
+ -rm -f ext/lmdb-safe/$(DEPDIR)/lmdb-safe.Po
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-man \
+ uninstall-systemdsystemunitDATA
+
+uninstall-man: uninstall-man1
+
+.MAKE: $(am__recursive_targets) all check check-am install install-am \
+ install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+ am--depfiles am--refresh check check-TESTS check-am \
+ check-local clean clean-binPROGRAMS clean-cscope clean-generic \
+ clean-libtool clean-noinstPROGRAMS cscope cscopelist-am ctags \
+ ctags-am dist dist-all dist-bzip2 dist-gzip dist-lzip \
+ dist-shar dist-tarZ dist-xz dist-zip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-man1 install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ install-systemdsystemunitDATA installcheck installcheck-am \
+ installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ recheck tags tags-am uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-man uninstall-man1 \
+ uninstall-systemdsystemunitDATA
+
+.PRECIOUS: Makefile
+
+
+dnslabeltext.cc: dnslabeltext.rl
+ $(AM_V_GEN)$(RAGEL) $< -o dnslabeltext.cc
+
+htmlfiles.h: $(srcdir)/html/* $(srcdir)/incfiles
+ $(AM_V_GEN)$(srcdir)/incfiles $(srcdir) > $@.tmp
+ @mv $@.tmp $@
+
+dnsdist-lua-ffi-interface.inc: dnsdist-lua-ffi-interface.h
+ $(AM_V_GEN)echo 'R"FFIContent(' > $@
+ @cat $< >> $@
+ @echo ')FFIContent"' >> $@
+
+html/js/%.min.js: src_js/%.js
+ uglifyjs $< > $@
+
+min_js: $(MIN_JS_FILES)
+@UNIT_TESTS_FALSE@check-local:
+@UNIT_TESTS_FALSE@ @echo "Unit tests are not enabled"
+@UNIT_TESTS_FALSE@ @echo "Run ./configure --enable-unit-tests"
+
+dnsdist-web.$(OBJEXT): htmlfiles.h
+dnsdist-lua-ffi.$(OBJEXT): dnsdist-lua-ffi-interface.inc
+
+@HAVE_MANPAGES_FALSE@@HAVE_VENV_TRUE@$(MANPAGES): %: docs/manpages/%.rst .venv
+@HAVE_MANPAGES_FALSE@@HAVE_VENV_TRUE@ $(AM_V_GEN).venv/bin/python -msphinx -b man docs . $<
+
+@HAVE_VENV_TRUE@.venv: docs/requirements.txt
+@HAVE_VENV_TRUE@ $(PYTHON) -m venv .venv
+@HAVE_VENV_TRUE@ .venv/bin/pip install -U pip setuptools setuptools-git wheel
+@HAVE_VENV_TRUE@ .venv/bin/pip install -r $<
+
+@HAVE_VENV_TRUE@latex/dnsdist.pdf: docs/** .venv
+@HAVE_VENV_TRUE@ .venv/bin/python -msphinx -M latexpdf docs .
+
+@HAVE_VENV_TRUE@dnsdist.pdf: latex/dnsdist.pdf
+@HAVE_VENV_TRUE@ mv $< $@
+
+@HAVE_VENV_TRUE@html-docs.tar.bz2: html-docs
+@HAVE_VENV_TRUE@ tar cjf $@ $<
+
+@HAVE_VENV_TRUE@html-docs: docs/** .venv
+@HAVE_VENV_TRUE@ .venv/bin/python -msphinx -b html docs html-docs
+
+@HAVE_VENV_TRUE@all-docs: html-docs html-docs.tar.bz2 dnsdist.pdf
+
+@HAVE_VENV_TRUE@upload-docs: all-docs
+@HAVE_VENV_TRUE@ rsync -crv --delete --no-p --chmod=g=rwX --exclude '*~' ./html-docs/ web1.powerdns.com:/srv/www/dnsdist.org
+@HAVE_VENV_TRUE@ rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./html-docs.tar.bz2 web1.powerdns.com:/srv/www/dnsdist.org
+@HAVE_VENV_TRUE@ rsync -crv --no-p --chmod=g=rwX --exclude '*~' ./dnsdist.pdf web1.powerdns.com:/srv/www/dnsdist.org
+
+@HAVE_VENV_FALSE@$(MANPAGES):
+@HAVE_VENV_FALSE@ @echo "You need Python 3 and the 'venv' module to generate the manpages"
+@HAVE_VENV_FALSE@ exit 1
+
+@HAVE_VENV_FALSE@html-docs: %: docs/manpages/%.rst .venv
+@HAVE_VENV_FALSE@ @echo "You need Python 3 and the 'venv' module to generate the HTML docs"
+@HAVE_VENV_FALSE@ exit 1
+
+@HAVE_VENV_FALSE@dnsdist.pdf:
+@HAVE_VENV_FALSE@ @echo "You need Python 3 and the 'venv' module to generate the PDF"
+@HAVE_VENV_FALSE@ exit 1
+
+@HAVE_SYSTEMD_TRUE@dnsdist.service: dnsdist.service.in
+@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)sed -e 's![@]bindir[@]!$(bindir)!' -e 's![@]service_user[@]!$(service_user)!' -e 's![@]service_group[@]!$(service_group)!' < $< > $@
+@HAVE_SYSTEMD_LOCK_PERSONALITY_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^LockPersonality/' $@
+@HAVE_SYSTEMD_PRIVATE_DEVICES_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^PrivateDevices/' $@
+@HAVE_SYSTEMD_PRIVATE_TMP_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^PrivateTmp/' $@
+@HAVE_SYSTEMD_PRIVATE_USERS_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^PrivateUsers/' $@
+@HAVE_SYSTEMD_PROTECT_CLOCK_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectClock/' $@
+@HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectControlGroups/' $@
+@HAVE_SYSTEMD_PROTECT_HOME_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHome/' $@
+@HAVE_SYSTEMD_PROTECT_HOSTNAME_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectHostname/' $@
+@HAVE_SYSTEMD_PROTECT_KERNEL_LOGS_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelLogs/' $@
+@HAVE_SYSTEMD_PROTECT_KERNEL_MODULES_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelModules/' $@
+@HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectKernelTunables/' $@
+@HAVE_SYSTEMD_PROTECT_SYSTEM_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^ProtectSystem/' $@
+@HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^RestrictAddressFamilies/' $@
+@HAVE_SYSTEMD_RESTRICT_NAMESPACES_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^RestrictNamespaces/' $@
+@HAVE_SYSTEMD_RESTRICT_REALTIME_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^RestrictRealtime/' $@
+@HAVE_SYSTEMD_RESTRICT_SUIDSGID_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^RestrictSUIDSGID/' $@
+@HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallArchitectures/' $@
+@HAVE_SYSTEMD_SYSTEM_CALL_FILTER_FALSE@@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)perl -ni -e 'print unless /^SystemCallFilter/' $@
+
+@HAVE_SYSTEMD_TRUE@dnsdist@.service: dnsdist.service
+@HAVE_SYSTEMD_TRUE@ $(AM_V_GEN)sed -e 's!/dnsdist !&--config $(sysconfdir)/dnsdist-%i.conf !' \
+@HAVE_SYSTEMD_TRUE@ -e 's!RuntimeDirectory=.*!&-%i!' \
+@HAVE_SYSTEMD_TRUE@ -e 's!SyslogIdentifier=.*!&-%i!' \
+@HAVE_SYSTEMD_TRUE@ < $< >$@
+@HAVE_LUA_HPP_FALSE@lua.hpp:
+@HAVE_LUA_HPP_FALSE@ $(AM_V_GEN)echo 'extern "C" {' > $@
+@HAVE_LUA_HPP_FALSE@ @echo '#include "lua.h"' >> $@
+@HAVE_LUA_HPP_FALSE@ @echo '#include "lualib.h"' >> $@
+@HAVE_LUA_HPP_FALSE@ @echo '#include "lauxlib.h"' >> $@
+@HAVE_LUA_HPP_FALSE@ @echo '}' >> $@
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/README b/README
new file mode 100644
index 0000000..f8e67cb
--- /dev/null
+++ b/README
@@ -0,0 +1,29 @@
+# dnsdist
+`dnsdist` is a highly DNS-, DoS- and abuse-aware loadbalancer. Its goal in
+life is to route traffic to the best server, delivering top performance
+to legitimate users while shunting or blocking abusive traffic.
+
+`dnsdist` is dynamic, in the sense that its configuration can be changed at
+runtime, and that its statistics can be queried from a console-like
+interface.
+
+All `dnsdist` features are documented at [dnsdist.org](https://dnsdist.org).
+
+## Compiling from git
+
+Make sure to `autoreconf -vi` before running `configure`.
+
+## macOS Notes
+
+Install dependencies from Homebrew:
+
+```sh
+brew install autoconf automake boost libedit libsodium libtool lua pkg-config protobuf
+```
+
+Let configure know where to find libedit, and openssl or libressl:
+
+```sh
+./configure 'PKG_CONFIG_PATH=/usr/local/opt/libedit/lib/pkgconfig:/usr/local/opt/libressl/lib/pkgconfig'
+make
+```
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f8e67cb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,29 @@
+# dnsdist
+`dnsdist` is a highly DNS-, DoS- and abuse-aware loadbalancer. Its goal in
+life is to route traffic to the best server, delivering top performance
+to legitimate users while shunting or blocking abusive traffic.
+
+`dnsdist` is dynamic, in the sense that its configuration can be changed at
+runtime, and that its statistics can be queried from a console-like
+interface.
+
+All `dnsdist` features are documented at [dnsdist.org](https://dnsdist.org).
+
+## Compiling from git
+
+Make sure to `autoreconf -vi` before running `configure`.
+
+## macOS Notes
+
+Install dependencies from Homebrew:
+
+```sh
+brew install autoconf automake boost libedit libsodium libtool lua pkg-config protobuf
+```
+
+Let configure know where to find libedit, and openssl or libressl:
+
+```sh
+./configure 'PKG_CONFIG_PATH=/usr/local/opt/libedit/lib/pkgconfig:/usr/local/opt/libressl/lib/pkgconfig'
+make
+```
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..db0031f
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1804 @@
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
+
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 11 (pkg-config-0.29.1)
+
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
+AC_DEFUN([PKG_PROG_PKG_CONFIG],
+[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
+m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
+m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
+AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
+AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=m4_default([$1], [0.9.0])
+ AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ PKG_CONFIG=""
+ fi
+fi[]dnl
+])dnl PKG_PROG_PKG_CONFIG
+
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
+AC_DEFUN([PKG_CHECK_EXISTS],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+if test -n "$PKG_CONFIG" && \
+ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
+ m4_default([$2], [:])
+m4_ifvaln([$3], [else
+ $3])dnl
+fi])
+
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
+m4_define([_PKG_CONFIG],
+[if test -n "$$1"; then
+ pkg_cv_[]$1="$$1"
+ elif test -n "$PKG_CONFIG"; then
+ PKG_CHECK_EXISTS([$3],
+ [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes ],
+ [pkg_failed=yes])
+ else
+ pkg_failed=untried
+fi[]dnl
+])dnl _PKG_CONFIG
+
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
+AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi[]dnl
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
+
+
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
+AC_DEFUN([PKG_CHECK_MODULES],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
+AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
+
+pkg_failed=no
+AC_MSG_CHECKING([for $1])
+
+_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
+_PKG_CONFIG([$1][_LIBS], [libs], [$2])
+
+m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
+and $1[]_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
+
+ m4_default([$4], [AC_MSG_ERROR(
+[Package requirements ($2) were not met:
+
+$$1_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+_PKG_TEXT
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
+ ])
+else
+ $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
+ $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
+ AC_MSG_RESULT([yes])
+ $3
+fi[]dnl
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
+AC_DEFUN([PKG_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([pkgconfigdir],
+ [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
+ [with_pkgconfigdir=]pkg_default)
+AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_INSTALLDIR
+
+
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
+AC_DEFUN([PKG_NOARCH_INSTALLDIR],
+[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
+m4_pushdef([pkg_description],
+ [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
+AC_ARG_WITH([noarch-pkgconfigdir],
+ [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
+ [with_noarch_pkgconfigdir=]pkg_default)
+AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
+m4_popdef([pkg_default])
+m4_popdef([pkg_description])
+])dnl PKG_NOARCH_INSTALLDIR
+
+
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
+AC_DEFUN([PKG_CHECK_VAR],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
+
+_PKG_CONFIG([$1], [variable="][$3]["], [$2])
+AS_VAR_COPY([$1], [pkg_cv_][$1])
+
+AS_VAR_IF([$1], [""], [$5], [$4])dnl
+])dnl PKG_CHECK_VAR
+
+dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
+dnl [DESCRIPTION], [DEFAULT])
+dnl ------------------------------------------
+dnl
+dnl Prepare a "--with-" configure option using the lowercase
+dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
+dnl PKG_CHECK_MODULES in a single macro.
+AC_DEFUN([PKG_WITH_MODULES],
+[
+m4_pushdef([with_arg], m4_tolower([$1]))
+
+m4_pushdef([description],
+ [m4_default([$5], [build with ]with_arg[ support])])
+
+m4_pushdef([def_arg], [m4_default([$6], [auto])])
+m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
+m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
+
+m4_case(def_arg,
+ [yes],[m4_pushdef([with_without], [--without-]with_arg)],
+ [m4_pushdef([with_without],[--with-]with_arg)])
+
+AC_ARG_WITH(with_arg,
+ AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
+ [AS_TR_SH([with_]with_arg)=def_arg])
+
+AS_CASE([$AS_TR_SH([with_]with_arg)],
+ [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
+ [auto],[PKG_CHECK_MODULES([$1],[$2],
+ [m4_n([def_action_if_found]) $3],
+ [m4_n([def_action_if_not_found]) $4])])
+
+m4_popdef([with_arg])
+m4_popdef([description])
+m4_popdef([def_arg])
+
+])dnl PKG_WITH_MODULES
+
+dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl [DESCRIPTION], [DEFAULT])
+dnl -----------------------------------------------
+dnl
+dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
+dnl check._[VARIABLE-PREFIX] is exported as make variable.
+AC_DEFUN([PKG_HAVE_WITH_MODULES],
+[
+PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
+
+AM_CONDITIONAL([HAVE_][$1],
+ [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
+])dnl PKG_HAVE_WITH_MODULES
+
+dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
+dnl [DESCRIPTION], [DEFAULT])
+dnl ------------------------------------------------------
+dnl
+dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
+dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
+dnl and preprocessor variable.
+AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
+[
+PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
+
+AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
+ [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
+])dnl PKG_HAVE_DEFINE_WITH_MODULES
+
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.16'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.16.1], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.16.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is '.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_COND_IF -*- Autoconf -*-
+
+# Copyright (C) 2008-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_COND_IF
+# _AM_COND_ELSE
+# _AM_COND_ENDIF
+# --------------
+# These macros are only used for tracing.
+m4_define([_AM_COND_IF])
+m4_define([_AM_COND_ELSE])
+m4_define([_AM_COND_ENDIF])
+
+# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
+# ---------------------------------------
+# If the shell condition COND is true, execute IF-TRUE, otherwise execute
+# IF-FALSE. Allow automake to learn about conditional instantiating macros
+# (the AC_CONFIG_FOOS).
+AC_DEFUN([AM_COND_IF],
+[m4_ifndef([_AM_COND_VALUE_$1],
+ [m4_fatal([$0: no such condition "$1"])])dnl
+_AM_COND_IF([$1])dnl
+if test -z "$$1_TRUE"; then :
+ m4_n([$2])[]dnl
+m4_ifval([$3],
+[_AM_COND_ELSE([$1])dnl
+else
+ $3
+])dnl
+_AM_COND_ENDIF([$1])dnl
+fi[]dnl
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ am__universal=false
+ m4_case([$1], [CC],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac],
+ [CXX],
+ [case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac])
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ AS_CASE([$CONFIG_FILES],
+ [*\'*], [eval set x "$CONFIG_FILES"],
+ [*], [set x $CONFIG_FILES])
+ shift
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
+ do
+ # Strip MF so we end up with the name of the file.
+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
+ am_filepart=`AS_BASENAME(["$am_mf"])`
+ AM_RUN_LOG([cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles]) || am_rc=$?
+ done
+ if test $am_rc -ne 0; then
+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).])
+ fi
+ AS_UNSET([am_dirpart])
+ AS_UNSET([am_filepart])
+ AS_UNSET([am_mf])
+ AS_UNSET([am_rc])
+ rm -f conftest-deps.mk
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.65])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
+])
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+ [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
+am__doit:
+ @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+ ['0:this is the am__doit target'],
+ [AS_CASE([$s],
+ [BSD], [am__include='.include' am__quote='"'],
+ [am__include='include' am__quote=''])])
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# ---------------------------------------------------------------------------
+# Adds support for distributing Python modules and packages. To
+# install modules, copy them to $(pythondir), using the python_PYTHON
+# automake variable. To install a package with the same name as the
+# automake package, install to $(pkgpythondir), or use the
+# pkgpython_PYTHON automake variable.
+#
+# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
+# locations to install python extension modules (shared libraries).
+# Another macro is required to find the appropriate flags to compile
+# extension modules.
+#
+# If your package is configured with a different prefix to python,
+# users will have to add the install directory to the PYTHONPATH
+# environment variable, or create a .pth file (see the python
+# documentation for details).
+#
+# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
+# cause an error if the version of python installed on the system
+# doesn't meet the requirement. MINIMUM-VERSION should consist of
+# numbers and dots only.
+AC_DEFUN([AM_PATH_PYTHON],
+ [
+ dnl Find a Python interpreter. Python versions prior to 2.0 are not
+ dnl supported. (2.0 was released on October 16, 2000).
+ m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
+[python python2 python3 dnl
+ python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 dnl
+ python3.2 python3.1 python3.0 dnl
+ python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 dnl
+ python2.0])
+
+ AC_ARG_VAR([PYTHON], [the Python interpreter])
+
+ m4_if([$1],[],[
+ dnl No version check is needed.
+ # Find any Python interpreter.
+ if test -z "$PYTHON"; then
+ AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
+ fi
+ am_display_PYTHON=python
+ ], [
+ dnl A version check is needed.
+ if test -n "$PYTHON"; then
+ # If the user set $PYTHON, use it and don't search something else.
+ AC_MSG_CHECKING([whether $PYTHON version is >= $1])
+ AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])
+ AC_MSG_ERROR([Python interpreter is too old])])
+ am_display_PYTHON=$PYTHON
+ else
+ # Otherwise, try each interpreter until we find one that satisfies
+ # VERSION.
+ AC_CACHE_CHECK([for a Python interpreter with version >= $1],
+ [am_cv_pathless_PYTHON],[
+ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
+ test "$am_cv_pathless_PYTHON" = none && break
+ AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
+ done])
+ # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
+ if test "$am_cv_pathless_PYTHON" = none; then
+ PYTHON=:
+ else
+ AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
+ fi
+ am_display_PYTHON=$am_cv_pathless_PYTHON
+ fi
+ ])
+
+ if test "$PYTHON" = :; then
+ dnl Run any user-specified action, or abort.
+ m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
+ else
+
+ dnl Query Python for its version number. Getting [:3] seems to be
+ dnl the best way to do this; it's what "site.py" does in the standard
+ dnl library.
+
+ AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
+ [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
+ AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
+
+ dnl Use the values of $prefix and $exec_prefix for the corresponding
+ dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
+ dnl distinct variables so they can be overridden if need be. However,
+ dnl general consensus is that you shouldn't need this ability.
+
+ AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
+ AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
+
+ dnl At times (like when building shared libraries) you may want
+ dnl to know which OS platform Python thinks this is.
+
+ AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
+ [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`])
+ AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
+
+ # Just factor out some code duplication.
+ am_python_setup_sysconfig="\
+import sys
+# Prefer sysconfig over distutils.sysconfig, for better compatibility
+# with python 3.x. See automake bug#10227.
+try:
+ import sysconfig
+except ImportError:
+ can_use_sysconfig = 0
+else:
+ can_use_sysconfig = 1
+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
+# <https://github.com/pypa/virtualenv/issues/118>
+try:
+ from platform import python_implementation
+ if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7':
+ can_use_sysconfig = 0
+except ImportError:
+ pass"
+
+ dnl Set up 4 directories:
+
+ dnl pythondir -- where to install python scripts. This is the
+ dnl site-packages directory, not the python standard library
+ dnl directory like in previous automake betas. This behavior
+ dnl is more consistent with lispdir.m4 for example.
+ dnl Query distutils for this directory.
+ AC_CACHE_CHECK([for $am_display_PYTHON script directory],
+ [am_cv_python_pythondir],
+ [if test "x$prefix" = xNONE
+ then
+ am_py_prefix=$ac_default_prefix
+ else
+ am_py_prefix=$prefix
+ fi
+ am_cv_python_pythondir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
+ case $am_cv_python_pythondir in
+ $am_py_prefix*)
+ am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
+ am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
+ ;;
+ *)
+ case $am_py_prefix in
+ /usr|/System*) ;;
+ *)
+ am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
+ ;;
+ esac
+ ;;
+ esac
+ ])
+ AC_SUBST([pythondir], [$am_cv_python_pythondir])
+
+ dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
+ dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
+ dnl more consistent with the rest of automake.
+
+ AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
+
+ dnl pyexecdir -- directory for installing python extension modules
+ dnl (shared libraries)
+ dnl Query distutils for this directory.
+ AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
+ [am_cv_python_pyexecdir],
+ [if test "x$exec_prefix" = xNONE
+ then
+ am_py_exec_prefix=$am_py_prefix
+ else
+ am_py_exec_prefix=$exec_prefix
+ fi
+ am_cv_python_pyexecdir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
+ case $am_cv_python_pyexecdir in
+ $am_py_exec_prefix*)
+ am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
+ am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
+ ;;
+ *)
+ case $am_py_exec_prefix in
+ /usr|/System*) ;;
+ *)
+ am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
+ ;;
+ esac
+ ;;
+ esac
+ ])
+ AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
+
+ dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
+
+ AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
+
+ dnl Run any user-specified action.
+ $2
+ fi
+
+])
+
+
+# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# ---------------------------------------------------------------------------
+# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
+# Run ACTION-IF-FALSE otherwise.
+# This test uses sys.hexversion instead of the string equivalent (first
+# word of sys.version), in order to cope with versions such as 2.2c1.
+# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
+AC_DEFUN([AM_PYTHON_CHECK_VERSION],
+ [prog="import sys
+# split strings by '.' and convert to numeric. Append some zeros
+# because we need at least 4 digits for the hex conversion.
+# map returns an iterator in Python 3.0 and a list in 2.x
+minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
+minverhex = 0
+# xrange is not present in Python 3.0 and range returns an iterator
+for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]]
+sys.exit(sys.hexversion < minverhex)"
+ AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[[\\\"\#\$\&\'\`$am_lf]]*)
+ AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+ *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
+
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor 'install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in "make install-strip", and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+#
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/ac_pthread_set_name.m4])
+m4_include([m4/ax_arg_default_enable_disable.m4])
+m4_include([m4/ax_check_sign.m4])
+m4_include([m4/ax_compile_check_sizeof.m4])
+m4_include([m4/ax_cxx_compile_stdcxx.m4])
+m4_include([m4/ax_cxx_compile_stdcxx_17.m4])
+m4_include([m4/ax_python_module.m4])
+m4_include([m4/boost.m4])
+m4_include([m4/dnsdist_enable_dnscrypt.m4])
+m4_include([m4/dnsdist_enable_doh.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([m4/pdns_check_cdb.m4])
+m4_include([m4/pdns_check_clock_gettime.m4])
+m4_include([m4/pdns_check_dnstap.m4])
+m4_include([m4/pdns_check_libcrypto.m4])
+m4_include([m4/pdns_check_libedit.m4])
+m4_include([m4/pdns_check_libh2o_evloop.m4])
+m4_include([m4/pdns_check_lmdb.m4])
+m4_include([m4/pdns_check_lua_hpp.m4])
+m4_include([m4/pdns_check_network_libs.m4])
+m4_include([m4/pdns_check_os.m4])
+m4_include([m4/pdns_check_pthread_np.m4])
+m4_include([m4/pdns_check_python_venv.m4])
+m4_include([m4/pdns_check_ragel.m4])
+m4_include([m4/pdns_check_secure_memset.m4])
+m4_include([m4/pdns_check_time_t.m4])
+m4_include([m4/pdns_d_fortify_source.m4])
+m4_include([m4/pdns_enable_sanitizers.m4])
+m4_include([m4/pdns_enable_tls.m4])
+m4_include([m4/pdns_enable_unit_tests.m4])
+m4_include([m4/pdns_param_ssp_buffer_size.m4])
+m4_include([m4/pdns_pie.m4])
+m4_include([m4/pdns_relro.m4])
+m4_include([m4/pdns_stack_protector.m4])
+m4_include([m4/pdns_with_ebpf.m4])
+m4_include([m4/pdns_with_gnutls.m4])
+m4_include([m4/pdns_with_libcap.m4])
+m4_include([m4/pdns_with_libsodium.m4])
+m4_include([m4/pdns_with_libssl.m4])
+m4_include([m4/pdns_with_lua.m4])
+m4_include([m4/pdns_with_net_snmp.m4])
+m4_include([m4/pdns_with_nghttp2.m4])
+m4_include([m4/pdns_with_re2.m4])
+m4_include([m4/pdns_with_service_user.m4])
+m4_include([m4/systemd.m4])
+m4_include([m4/warnings.m4])
diff --git a/ascii.hh b/ascii.hh
new file mode 100644
index 0000000..09f42de
--- /dev/null
+++ b/ascii.hh
@@ -0,0 +1,41 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+inline bool dns_isspace(char c)
+{
+ return c==' ' || c=='\t' || c=='\r' || c=='\n';
+}
+
+inline unsigned char dns_toupper(unsigned char c)
+{
+ if(c>='a' && c<='z')
+ c+='A'-'a';
+ return c;
+}
+
+inline unsigned char dns_tolower(unsigned char c)
+{
+ if(c>='A' && c<='Z')
+ c+='a'-'A';
+ return c;
+}
diff --git a/base64.hh b/base64.hh
new file mode 100644
index 0000000..a84181d
--- /dev/null
+++ b/base64.hh
@@ -0,0 +1,26 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <string>
+
+template<typename Container> int B64Decode(const std::string& src, Container& dst);
+std::string Base64Encode (const std::string& src);
diff --git a/bpf-filter.cc b/bpf-filter.cc
new file mode 100644
index 0000000..877f5f8
--- /dev/null
+++ b/bpf-filter.cc
@@ -0,0 +1,757 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "bpf-filter.hh"
+
+#ifdef HAVE_EBPF
+
+#include <sys/syscall.h>
+#include <linux/bpf.h>
+
+#include "ext/libbpf/libbpf.h"
+
+#include "misc.hh"
+
+static __u64 ptr_to_u64(void *ptr)
+{
+ return (__u64) (unsigned long) ptr;
+}
+
+/* these can be static as they are not declared in libbpf.h: */
+static int bpf_pin_map(int fd, const std::string& path)
+{
+ union bpf_attr attr;
+ memset(&attr, 0, sizeof(attr));
+ attr.bpf_fd = fd;
+ attr.pathname = ptr_to_u64(const_cast<char*>(path.c_str()));
+ return syscall(SYS_bpf, BPF_OBJ_PIN, &attr, sizeof(attr));
+}
+
+static int bpf_load_pinned_map(const std::string& path)
+{
+ union bpf_attr attr;
+ memset(&attr, 0, sizeof(attr));
+ attr.pathname = ptr_to_u64(const_cast<char*>(path.c_str()));
+ return syscall(SYS_bpf, BPF_OBJ_GET, &attr, sizeof(attr));
+}
+
+static void bpf_check_map_sizes(int fd, uint32_t expectedKeySize, uint32_t expectedValueSize)
+{
+ struct bpf_map_info info;
+ uint32_t info_len = sizeof(info);
+ memset(&info, 0, sizeof(info));
+
+ union bpf_attr attr;
+ memset(&attr, 0, sizeof(attr));
+ attr.info.bpf_fd = fd;
+ attr.info.info_len = info_len;
+ attr.info.info = ptr_to_u64(&info);
+
+ int err = syscall(SYS_bpf, BPF_OBJ_GET_INFO_BY_FD, &attr, sizeof(attr));
+ if (err != 0) {
+ throw std::runtime_error("Error checking the size of eBPF map: " + stringerror());
+ }
+ if (info_len != sizeof(info)) {
+ throw std::runtime_error("Error checking the size of eBPF map: invalid info size returned");
+ }
+ if (info.key_size != expectedKeySize) {
+ throw std::runtime_error("Error checking the size of eBPF map: key size mismatch (" + std::to_string(info.key_size) + " VS " + std::to_string(expectedKeySize) + ")");
+ }
+ if (info.value_size != expectedValueSize) {
+ throw std::runtime_error("Error checking the size of eBPF map: value size mismatch (" + std::to_string(info.value_size) + " VS " + std::to_string(expectedValueSize) + ")");
+ }
+}
+
+int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
+ int max_entries)
+{
+ union bpf_attr attr;
+ memset(&attr, 0, sizeof(attr));
+ attr.map_type = map_type;
+ attr.key_size = key_size;
+ attr.value_size = value_size;
+ attr.max_entries = max_entries;
+ return syscall(SYS_bpf, BPF_MAP_CREATE, &attr, sizeof(attr));
+}
+
+int bpf_update_elem(int fd, void *key, void *value, unsigned long long flags)
+{
+ union bpf_attr attr;
+ memset(&attr, 0, sizeof(attr));
+ attr.map_fd = fd;
+ attr.key = ptr_to_u64(key);
+ attr.value = ptr_to_u64(value);
+ attr.flags = flags;
+ return syscall(SYS_bpf, BPF_MAP_UPDATE_ELEM, &attr, sizeof(attr));
+}
+
+int bpf_lookup_elem(int fd, void *key, void *value)
+{
+ union bpf_attr attr;
+ memset(&attr, 0, sizeof(attr));
+ attr.map_fd = fd;
+ attr.key = ptr_to_u64(key);
+ attr.value = ptr_to_u64(value);
+ return syscall(SYS_bpf, BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));
+}
+
+int bpf_delete_elem(int fd, void *key)
+{
+ union bpf_attr attr;
+ memset(&attr, 0, sizeof(attr));
+ attr.map_fd = fd;
+ attr.key = ptr_to_u64(key);
+ return syscall(SYS_bpf, BPF_MAP_DELETE_ELEM, &attr, sizeof(attr));
+}
+
+int bpf_get_next_key(int fd, void *key, void *next_key)
+{
+ union bpf_attr attr;
+ memset(&attr, 0, sizeof(attr));
+ attr.map_fd = fd;
+ attr.key = ptr_to_u64(key);
+ attr.next_key = ptr_to_u64(next_key);
+ return syscall(SYS_bpf, BPF_MAP_GET_NEXT_KEY, &attr, sizeof(attr));
+}
+
+int bpf_prog_load(enum bpf_prog_type prog_type,
+ const struct bpf_insn *insns, int prog_len,
+ const char *license, int kern_version)
+{
+ char log_buf[65535];
+ union bpf_attr attr;
+ memset(&attr, 0, sizeof(attr));
+ attr.prog_type = prog_type;
+ attr.insns = ptr_to_u64((void *) insns);
+ attr.insn_cnt = prog_len / sizeof(struct bpf_insn);
+ attr.license = ptr_to_u64((void *) license);
+ attr.log_buf = ptr_to_u64(log_buf);
+ attr.log_size = sizeof(log_buf);
+ attr.log_level = 1;
+ /* assign one field outside of struct init to make sure any
+ * padding is zero initialized
+ */
+ attr.kern_version = kern_version;
+
+ long res = syscall(SYS_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
+ if (res == -1) {
+ if (errno == ENOSPC) {
+ /* not enough space in the log buffer */
+ attr.log_level = 0;
+ attr.log_size = 0;
+ attr.log_buf = ptr_to_u64(nullptr);
+ res = syscall(SYS_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
+ if (res != -1) {
+ return res;
+ }
+ }
+ throw std::runtime_error("Error loading BPF program: (" + stringerror() + "):\n" + std::string(log_buf));
+ }
+ return res;
+}
+
+struct KeyV6
+{
+ uint8_t src[16];
+};
+
+struct QNameKey
+{
+ uint8_t qname[255];
+};
+
+struct QNameAndQTypeKey
+{
+ uint8_t qname[255];
+ uint16_t qtype;
+};
+
+struct QNameValue
+{
+ uint64_t counter{0};
+ uint16_t qtype{0};
+};
+
+struct CounterAndActionValue
+{
+ uint64_t counter{0};
+ BPFFilter::MatchAction action{BPFFilter::MatchAction::Pass};
+};
+
+BPFFilter::Map::Map(const BPFFilter::MapConfiguration& config, BPFFilter::MapFormat format): d_config(config)
+{
+ if (d_config.d_type == BPFFilter::MapType::Filters) {
+ /* special case, this is a map of eBPF programs */
+ d_fd = FDWrapper(bpf_create_map(BPF_MAP_TYPE_PROG_ARRAY, sizeof(uint32_t), sizeof(uint32_t), d_config.d_maxItems));
+ if (d_fd.getHandle() == -1) {
+ throw std::runtime_error("Error creating a BPF program map of size " + std::to_string(d_config.d_maxItems) + ": " + stringerror());
+ }
+ }
+ else {
+ int keySize = 0;
+ int valueSize = 0;
+ if (format == MapFormat::Legacy) {
+ switch (d_config.d_type) {
+ case MapType::IPv4:
+ keySize = sizeof(uint32_t);
+ valueSize = sizeof(uint64_t);
+ break;
+ case MapType::IPv6:
+ keySize = sizeof(KeyV6);
+ valueSize = sizeof(uint64_t);
+ break;
+ case MapType::QNames:
+ keySize = sizeof(QNameKey);
+ valueSize = sizeof(QNameValue);
+ break;
+ default:
+ throw std::runtime_error("Unsupported eBPF map type: " + std::to_string(static_cast<uint8_t>(d_config.d_type)));
+ }
+ }
+ else {
+ switch (d_config.d_type) {
+ case MapType::IPv4:
+ keySize = sizeof(uint32_t);
+ valueSize = sizeof(CounterAndActionValue);
+ break;
+ case MapType::IPv6:
+ keySize = sizeof(KeyV6);
+ valueSize = sizeof(CounterAndActionValue);
+ break;
+ case MapType::QNames:
+ keySize = sizeof(QNameAndQTypeKey);
+ valueSize = sizeof(CounterAndActionValue);
+ break;
+ default:
+ throw std::runtime_error("Unsupported eBPF map type: " + std::to_string(static_cast<uint8_t>(d_config.d_type)));
+ }
+ }
+
+ if (!d_config.d_pinnedPath.empty()) {
+ /* try to load */
+ d_fd = FDWrapper(bpf_load_pinned_map(d_config.d_pinnedPath));
+ if (d_fd.getHandle() != -1) {
+ /* sanity checks: key and value size */
+ bpf_check_map_sizes(d_fd.getHandle(), keySize, valueSize);
+
+ if (d_config.d_type == MapType::IPv4) {
+ uint32_t key = 0;
+ while (bpf_get_next_key(d_fd.getHandle(), &key, &key) == 0) {
+ ++d_count;
+ }
+ }
+ else if (d_config.d_type == MapType::IPv6) {
+ KeyV6 key;
+ memset(&key, 0, sizeof(key));
+ while (bpf_get_next_key(d_fd.getHandle(), &key, &key) == 0) {
+ ++d_count;
+ }
+ }
+ else if (d_config.d_type == MapType::QNames) {
+ if (format == MapFormat::Legacy) {
+ QNameKey key;
+ memset(&key, 0, sizeof(key));
+ while (bpf_get_next_key(d_fd.getHandle(), &key, &key) == 0) {
+ ++d_count;
+ }
+ }
+ else {
+ QNameAndQTypeKey key;
+ memset(&key, 0, sizeof(key));
+ while (bpf_get_next_key(d_fd.getHandle(), &key, &key) == 0) {
+ ++d_count;
+ }
+ }
+ }
+ }
+ }
+
+ if (d_fd.getHandle() == -1) {
+ d_fd = FDWrapper(bpf_create_map(BPF_MAP_TYPE_HASH, keySize, valueSize, static_cast<int>(d_config.d_maxItems)));
+ if (d_fd.getHandle() == -1) {
+ throw std::runtime_error("Error creating a BPF map of size " + std::to_string(d_config.d_maxItems) + ": " + stringerror());
+ }
+
+ if (!d_config.d_pinnedPath.empty()) {
+ if (bpf_pin_map(d_fd.getHandle(), d_config.d_pinnedPath) != 0) {
+ throw std::runtime_error("Unable to pin map to path '" + d_config.d_pinnedPath + "': " + stringerror());
+ }
+ }
+ }
+ }
+}
+
+static FDWrapper loadProgram(const struct bpf_insn* filter, size_t filterSize)
+{
+ auto fd = FDWrapper(bpf_prog_load(BPF_PROG_TYPE_SOCKET_FILTER,
+ filter,
+ filterSize,
+ "GPL",
+ 0));
+ if (fd.getHandle() == -1) {
+ throw std::runtime_error("error loading BPF filter: " + stringerror());
+ }
+ return fd;
+}
+
+
+BPFFilter::BPFFilter(const BPFFilter::MapConfiguration& v4, const BPFFilter::MapConfiguration& v6, const BPFFilter::MapConfiguration& qnames, BPFFilter::MapFormat format, bool external): d_mapFormat(format), d_external(external)
+{
+ if (d_mapFormat != BPFFilter::MapFormat::Legacy && !d_external) {
+ throw std::runtime_error("Unsupported eBPF map format, the current internal implemenation only supports the legacy format");
+ }
+
+ auto maps = d_maps.lock();
+
+ maps->d_v4 = BPFFilter::Map(v4, d_mapFormat);
+ maps->d_v6 = BPFFilter::Map(v6, d_mapFormat);
+ maps->d_qnames = BPFFilter::Map(qnames, d_mapFormat);
+ if (!external) {
+ BPFFilter::MapConfiguration filters;
+ filters.d_maxItems = 1;
+ filters.d_type = BPFFilter::MapType::Filters;
+ maps->d_filters = BPFFilter::Map(filters, d_mapFormat);
+
+ const struct bpf_insn main_filter[] = {
+#include "bpf-filter.main.ebpf"
+ };
+
+ const struct bpf_insn qname_filter[] = {
+#include "bpf-filter.qname.ebpf"
+ };
+
+ try {
+ d_mainfilter = loadProgram(main_filter,
+ sizeof(main_filter));
+ }
+ catch (const std::exception& e) {
+ throw std::runtime_error("Error load the main eBPF filter: " + std::string(e.what()));
+ }
+
+ try {
+ d_qnamefilter = loadProgram(qname_filter,
+ sizeof(qname_filter));
+ }
+ catch (const std::exception& e) {
+ throw std::runtime_error("Error load the qname eBPF filter: " + std::string(e.what()));
+ }
+
+ uint32_t key = 0;
+ int qnamefd = d_qnamefilter.getHandle();
+ int res = bpf_update_elem(maps->d_filters.d_fd.getHandle(), &key, &qnamefd, BPF_ANY);
+ if (res != 0) {
+ throw std::runtime_error("Error updating BPF filters map: " + stringerror());
+ }
+ }
+}
+
+void BPFFilter::addSocket(int sock)
+{
+ int fd = d_mainfilter.getHandle();
+ int res = setsockopt(sock, SOL_SOCKET, SO_ATTACH_BPF, &fd, sizeof(fd));
+
+ if (res != 0) {
+ throw std::runtime_error("Error attaching BPF filter to this socket: " + stringerror());
+ }
+}
+
+void BPFFilter::removeSocket(int sock)
+{
+ int fd = d_mainfilter.getHandle();
+ int res = setsockopt(sock, SOL_SOCKET, SO_DETACH_BPF, &fd, sizeof(fd));
+
+ if (res != 0) {
+ throw std::runtime_error("Error detaching BPF filter from this socket: " + stringerror());
+ }
+}
+
+void BPFFilter::block(const ComboAddress& addr, BPFFilter::MatchAction action)
+{
+ CounterAndActionValue value;
+ value.counter = 0;
+ value.action = action;
+
+ int res = 0;
+ if (addr.isIPv4()) {
+ uint32_t key = htonl(addr.sin4.sin_addr.s_addr);
+ auto maps = d_maps.lock();
+ auto& map = maps->d_v4;
+ if (map.d_count >= map.d_config.d_maxItems) {
+ throw std::runtime_error("Table full when trying to block " + addr.toString());
+ }
+
+ res = bpf_lookup_elem(map.d_fd.getHandle(), &key, &value);
+ if (res != -1) {
+ throw std::runtime_error("Trying to block an already blocked address: " + addr.toString());
+ }
+
+ res = bpf_update_elem(map.d_fd.getHandle(), &key, &value, BPF_NOEXIST);
+ if (res == 0) {
+ ++map.d_count;
+ }
+ }
+ else if (addr.isIPv6()) {
+ uint8_t key[16];
+ static_assert(sizeof(addr.sin6.sin6_addr.s6_addr) == sizeof(key), "POSIX mandates s6_addr to be an array of 16 uint8_t");
+ for (size_t idx = 0; idx < sizeof(key); idx++) {
+ key[idx] = addr.sin6.sin6_addr.s6_addr[idx];
+ }
+
+ auto maps = d_maps.lock();
+ auto& map = maps->d_v6;
+ if (map.d_count >= map.d_config.d_maxItems) {
+ throw std::runtime_error("Table full when trying to block " + addr.toString());
+ }
+
+ res = bpf_lookup_elem(map.d_fd.getHandle(), &key, &value);
+ if (res != -1) {
+ throw std::runtime_error("Trying to block an already blocked address: " + addr.toString());
+ }
+
+ res = bpf_update_elem(map.d_fd.getHandle(), key, &value, BPF_NOEXIST);
+ if (res == 0) {
+ map.d_count++;
+ }
+ }
+
+ if (res != 0) {
+ throw std::runtime_error("Error adding blocked address " + addr.toString() + ": " + stringerror());
+ }
+}
+
+void BPFFilter::unblock(const ComboAddress& addr)
+{
+ int res = 0;
+ if (addr.isIPv4()) {
+ uint32_t key = htonl(addr.sin4.sin_addr.s_addr);
+ auto maps = d_maps.lock();
+ auto& map = maps->d_v4;
+ res = bpf_delete_elem(map.d_fd.getHandle(), &key);
+ if (res == 0) {
+ --map.d_count;
+ }
+ }
+ else if (addr.isIPv6()) {
+ uint8_t key[16];
+ static_assert(sizeof(addr.sin6.sin6_addr.s6_addr) == sizeof(key), "POSIX mandates s6_addr to be an array of 16 uint8_t");
+ for (size_t idx = 0; idx < sizeof(key); idx++) {
+ key[idx] = addr.sin6.sin6_addr.s6_addr[idx];
+ }
+
+ auto maps = d_maps.lock();
+ auto& map = maps->d_v6;
+ res = bpf_delete_elem(map.d_fd.getHandle(), key);
+ if (res == 0) {
+ --map.d_count;
+ }
+ }
+
+ if (res != 0) {
+ throw std::runtime_error("Error removing blocked address " + addr.toString() + ": " + stringerror());
+ }
+}
+
+void BPFFilter::block(const DNSName& qname, BPFFilter::MatchAction action, uint16_t qtype)
+{
+ CounterAndActionValue cadvalue;
+ QNameValue qvalue;
+ void* value = nullptr;
+
+ if (d_external) {
+ cadvalue.counter = 0;
+ cadvalue.action = action;
+ value = &cadvalue;
+ }
+ else {
+ qvalue.counter = 0;
+ qvalue.qtype = qtype;
+ value = &qvalue;
+ }
+
+ QNameAndQTypeKey key;
+ memset(&key, 0, sizeof(key));
+
+ std::string keyStr = qname.toDNSStringLC();
+ if (keyStr.size() > sizeof(key.qname)) {
+ throw std::runtime_error("Invalid QName to block " + qname.toLogString());
+ }
+ memcpy(key.qname, keyStr.c_str(), keyStr.size());
+ key.qtype = qtype;
+
+ {
+ auto maps = d_maps.lock();
+ auto& map = maps->d_qnames;
+ if (map.d_count >= map.d_config.d_maxItems) {
+ throw std::runtime_error("Table full when trying to block " + qname.toLogString());
+ }
+
+ int res = bpf_lookup_elem(map.d_fd.getHandle(), &key, value);
+ if (res != -1) {
+ throw std::runtime_error("Trying to block an already blocked qname: " + qname.toLogString());
+ }
+ res = bpf_update_elem(map.d_fd.getHandle(), &key, value, BPF_NOEXIST);
+ if (res == 0) {
+ ++map.d_count;
+ }
+
+ if (res != 0) {
+ throw std::runtime_error("Error adding blocked qname " + qname.toLogString() + ": " + stringerror());
+ }
+ }
+}
+
+void BPFFilter::unblock(const DNSName& qname, uint16_t qtype)
+{
+ QNameAndQTypeKey key;
+ memset(&key, 0, sizeof(key));
+ std::string keyStr = qname.toDNSStringLC();
+
+ if (keyStr.size() > sizeof(key.qname)) {
+ throw std::runtime_error("Invalid QName to block " + qname.toLogString());
+ }
+ memcpy(key.qname, keyStr.c_str(), keyStr.size());
+ key.qtype = qtype;
+
+ {
+ auto maps = d_maps.lock();
+ auto& map = maps->d_qnames;
+ int res = bpf_delete_elem(map.d_fd.getHandle(), &key);
+ if (res == 0) {
+ --map.d_count;
+ }
+ else {
+ throw std::runtime_error("Error removing qname address " + qname.toLogString() + ": " + stringerror());
+ }
+ }
+}
+
+std::vector<std::pair<ComboAddress, uint64_t> > BPFFilter::getAddrStats()
+{
+ std::vector<std::pair<ComboAddress, uint64_t> > result;
+ {
+ auto maps = d_maps.lock();
+ result.reserve(maps->d_v4.d_count + maps->d_v6.d_count);
+ }
+
+ sockaddr_in v4Addr;
+ memset(&v4Addr, 0, sizeof(v4Addr));
+ v4Addr.sin_family = AF_INET;
+
+ uint32_t v4Key = 0;
+ uint32_t nextV4Key;
+ CounterAndActionValue value;
+
+ uint8_t v6Key[16];
+ uint8_t nextV6Key[16];
+ sockaddr_in6 v6Addr;
+ memset(&v6Addr, 0, sizeof(v6Addr));
+ v6Addr.sin6_family = AF_INET6;
+
+ static_assert(sizeof(v6Addr.sin6_addr.s6_addr) == sizeof(v6Key), "POSIX mandates s6_addr to be an array of 16 uint8_t");
+ memset(&v6Key, 0, sizeof(v6Key));
+
+ auto maps = d_maps.lock();
+
+ {
+ auto& map = maps->d_v4;
+ int res = bpf_get_next_key(map.d_fd.getHandle(), &v4Key, &nextV4Key);
+
+ while (res == 0) {
+ v4Key = nextV4Key;
+ if (bpf_lookup_elem(map.d_fd.getHandle(), &v4Key, &value) == 0) {
+ v4Addr.sin_addr.s_addr = ntohl(v4Key);
+ result.emplace_back(ComboAddress(&v4Addr), value.counter);
+ }
+
+ res = bpf_get_next_key(map.d_fd.getHandle(), &v4Key, &nextV4Key);
+ }
+ }
+
+ {
+ auto& map = maps->d_v6;
+ int res = bpf_get_next_key(map.d_fd.getHandle(), &v6Key, &nextV6Key);
+
+ while (res == 0) {
+ if (bpf_lookup_elem(map.d_fd.getHandle(), &nextV6Key, &value) == 0) {
+ memcpy(&v6Addr.sin6_addr.s6_addr, &nextV6Key, sizeof(nextV6Key));
+
+ result.emplace_back(ComboAddress(&v6Addr), value.counter);
+ }
+
+ res = bpf_get_next_key(map.d_fd.getHandle(), &nextV6Key, &nextV6Key);
+ }
+ }
+
+ return result;
+}
+
+std::vector<std::tuple<DNSName, uint16_t, uint64_t> > BPFFilter::getQNameStats()
+{
+ std::vector<std::tuple<DNSName, uint16_t, uint64_t> > result;
+
+ if (d_mapFormat == MapFormat::Legacy) {
+ QNameKey key = { { 0 } };
+ QNameKey nextKey = { { 0 } };
+ QNameValue value;
+
+ auto maps = d_maps.lock();
+ auto& map = maps->d_qnames;
+ result.reserve(map.d_count);
+ int res = bpf_get_next_key(map.d_fd.getHandle(), &key, &nextKey);
+
+ while (res == 0) {
+ if (bpf_lookup_elem(map.d_fd.getHandle(), &nextKey, &value) == 0) {
+ nextKey.qname[sizeof(nextKey.qname) - 1 ] = '\0';
+ result.push_back(std::make_tuple(DNSName(reinterpret_cast<const char*>(nextKey.qname), sizeof(nextKey.qname), 0, false), value.qtype, value.counter));
+ }
+
+ res = bpf_get_next_key(map.d_fd.getHandle(), &nextKey, &nextKey);
+ }
+ }
+ else {
+ QNameAndQTypeKey key;
+ QNameAndQTypeKey nextKey;
+ memset(&key, 0, sizeof(key));
+ memset(&nextKey, 0, sizeof(nextKey));
+ CounterAndActionValue value;
+
+ auto maps = d_maps.lock();
+ auto& map = maps->d_qnames;
+ result.reserve(map.d_count);
+ int res = bpf_get_next_key(map.d_fd.getHandle(), &key, &nextKey);
+
+ while (res == 0) {
+ if (bpf_lookup_elem(map.d_fd.getHandle(), &nextKey, &value) == 0) {
+ nextKey.qname[sizeof(nextKey.qname) - 1 ] = '\0';
+ result.push_back(std::make_tuple(DNSName(reinterpret_cast<const char*>(nextKey.qname), sizeof(nextKey.qname), 0, false), key.qtype, value.counter));
+ }
+
+ res = bpf_get_next_key(map.d_fd.getHandle(), &nextKey, &nextKey);
+ }
+ }
+
+ return result;
+}
+
+uint64_t BPFFilter::getHits(const ComboAddress& requestor)
+{
+ CounterAndActionValue counter;
+
+ if (requestor.isIPv4()) {
+ uint32_t key = htonl(requestor.sin4.sin_addr.s_addr);
+
+ auto maps = d_maps.lock();
+ auto& map = maps->d_v4;
+ int res = bpf_lookup_elem(map.d_fd.getHandle(), &key, &counter);
+ if (res == 0) {
+ return counter.counter;
+ }
+ }
+ else if (requestor.isIPv6()) {
+ uint8_t key[16];
+ static_assert(sizeof(requestor.sin6.sin6_addr.s6_addr) == sizeof(key), "POSIX mandates s6_addr to be an array of 16 uint8_t");
+ for (size_t idx = 0; idx < sizeof(key); idx++) {
+ key[idx] = requestor.sin6.sin6_addr.s6_addr[idx];
+ }
+
+ auto maps = d_maps.lock();
+ auto& map = maps->d_v6;
+ int res = bpf_lookup_elem(map.d_fd.getHandle(), &key, &counter);
+ if (res == 0) {
+ return counter.counter;
+ }
+ }
+
+ return 0;
+}
+
+#else
+
+BPFFilter::BPFFilter(const BPFFilter::MapConfiguration&, const BPFFilter::MapConfiguration&, const BPFFilter::MapConfiguration&, BPFFilter::MapFormat, bool)
+{
+}
+
+void BPFFilter::addSocket(int)
+{
+ throw std::runtime_error("eBPF support not enabled");
+}
+
+void BPFFilter::removeSocket(int)
+{
+ throw std::runtime_error("eBPF support not enabled");
+}
+
+void BPFFilter::block(const ComboAddress&, BPFFilter::MatchAction)
+{
+ throw std::runtime_error("eBPF support not enabled");
+}
+
+void BPFFilter::unblock(const ComboAddress&)
+{
+ throw std::runtime_error("eBPF support not enabled");
+}
+
+void BPFFilter::block(const DNSName&, BPFFilter::MatchAction, uint16_t)
+{
+ throw std::runtime_error("eBPF support not enabled");
+}
+
+void BPFFilter::unblock(const DNSName&, uint16_t)
+{
+ throw std::runtime_error("eBPF support not enabled");
+}
+
+std::vector<std::pair<ComboAddress, uint64_t> > BPFFilter::getAddrStats()
+{
+ std::vector<std::pair<ComboAddress, uint64_t> > result;
+ return result;
+}
+
+std::vector<std::tuple<DNSName, uint16_t, uint64_t> > BPFFilter::getQNameStats()
+{
+ std::vector<std::tuple<DNSName, uint16_t, uint64_t> > result;
+ return result;
+}
+
+uint64_t BPFFilter::getHits(const ComboAddress&)
+{
+ return 0;
+}
+#endif /* HAVE_EBPF */
+
+bool BPFFilter::supportsMatchAction(MatchAction action) const
+{
+#ifdef HAVE_EBPF
+ if (action == BPFFilter::MatchAction::Drop) {
+ return true;
+ }
+ return d_mapFormat == BPFFilter::MapFormat::WithActions;
+#endif /* HAVE_EBPF */
+ return false;
+}
+
+bool BPFFilter::isExternal() const
+{
+#ifdef HAVE_EBPF
+ return d_external;
+#endif /* HAVE_EBPF */
+ return false;
+}
diff --git a/bpf-filter.ebpf.src b/bpf-filter.ebpf.src
new file mode 100644
index 0000000..9f58669
--- /dev/null
+++ b/bpf-filter.ebpf.src
@@ -0,0 +1,503 @@
+
+#include <net/sock.h>
+#include <linux/types.h>
+#include <uapi/linux/tcp.h>
+#include <uapi/linux/udp.h>
+#include <uapi/linux/ip.h>
+#include <uapi/linux/ipv6.h>
+#include <bcc/proto.h>
+
+struct dnsheader {
+ unsigned id :16; /* query identification number */
+#if BYTE_ORDER == BIG_ENDIAN
+ /* fields in third byte */
+ unsigned qr: 1; /* response flag */
+ unsigned opcode: 4; /* purpose of message */
+ unsigned aa: 1; /* authoritative answer */
+ unsigned tc: 1; /* truncated message */
+ unsigned rd: 1; /* recursion desired */
+ /* fields in fourth byte */
+ unsigned ra: 1; /* recursion available */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned rcode :4; /* response code */
+#elif BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+ /* fields in third byte */
+ unsigned rd :1; /* recursion desired */
+ unsigned tc :1; /* truncated message */
+ unsigned aa :1; /* authoritative answer */
+ unsigned opcode :4; /* purpose of message */
+ unsigned qr :1; /* response flag */
+ /* fields in fourth byte */
+ unsigned rcode :4; /* response code */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ra :1; /* recursion available */
+#endif
+ /* remaining bytes */
+ unsigned qdcount :16; /* number of question entries */
+ unsigned ancount :16; /* number of answer entries */
+ unsigned nscount :16; /* number of authority entries */
+ unsigned arcount :16; /* number of resource entries */
+};
+
+struct QNameKey
+{
+ uint8_t qname[255];
+};
+
+struct KeyV6
+{
+ uint8_t src[16];
+};
+
+struct QNameValue
+{
+ u64 counter;
+ u16 qtype;
+};
+
+BPF_TABLE("hash", u32, u64, v4filter, 1024);
+BPF_TABLE("hash", struct KeyV6, u64, v6filter, 1024);
+BPF_TABLE("hash", struct QNameKey, struct QNameValue, qnamefilter, 1024);
+BPF_TABLE("prog", int, int, progsarray, 1);
+
+int bpf_qname_filter(struct __sk_buff *skb)
+{
+ uint32_t qname_off = skb->cb[0];
+ ssize_t labellen = skb->cb[3];
+ size_t idx = 2;
+ struct QNameKey qkey = { 0 };
+ u32 val = skb->cb[1];
+ if (val) {
+ qkey.qname[0] = val;
+ }
+ val = skb->cb[2];
+ if (val) {
+ qkey.qname[1] = val;
+ }
+ uint8_t temp;
+
+#define FILL_ONE_KEY \
+ temp = load_byte(skb, qname_off + idx); \
+ labellen--; \
+ if (labellen < 0) { \
+ labellen = temp; \
+ if (labellen == 0) { \
+ goto end; \
+ } \
+ } else if (temp >= 'A' && temp <= 'Z') { \
+ temp += ('a' - 'A'); \
+ } \
+ qkey.qname[idx] = temp; \
+ idx++;
+
+ /* 2 - 52 */
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ /* 52 - 102 */
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_K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ILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ /* 202 - 252 */
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ /* 252 - 254 */
+ FILL_ONE_KEY
+ FILL_ONE_KEY
+
+ /* the only value that makes sense for
+ qkey.qname[255] is 0, and it's already
+ there */
+ end:
+
+ {
+ idx++;
+ u16 qtype = load_half(skb, (qname_off + idx));
+
+ struct QNameValue* qvalue = qnamefilter.lookup(&qkey);
+ if (qvalue &&
+ (qvalue->qtype == 255 || qtype == qvalue->qtype)) {
+ __sync_fetch_and_add(&qvalue->counter, 1);
+ return 0;
+ }
+ }
+
+ return 2147483647;
+}
+
+int bpf_dns_filter(struct __sk_buff *skb) {
+ u8 ip_proto;
+ int proto_off;
+ /* nh_off will contain a negative offset, used in BPF to get access to
+ the MAC/network layers, as positive values are used to get access to
+ the transport layer */
+ int nh_off = BPF_LL_OFF + ETH_HLEN;
+
+ if (skb->protocol == ntohs(0x0800)) {
+ u32 key;
+ int off = nh_off + offsetof(struct iphdr, saddr);
+ key = load_word(skb, off);
+
+ u64* counter = v4filter.lookup(&key);
+ if (counter) {
+ __sync_fetch_and_add(counter, 1);
+ return 0;
+ }
+
+ ip_proto = load_byte(skb, nh_off + offsetof(struct iphdr, protocol));
+ proto_off = nh_off + sizeof(struct iphdr);
+ }
+ else if (skb->protocol == ntohs(0x86DD)) {
+ struct KeyV6 key;
+ int off = nh_off + offsetof(struct ipv6hdr, saddr);
+ key.src[0] = load_byte(skb, off++);
+ key.src[1] = load_byte(skb, off++);
+ key.src[2] = load_byte(skb, off++);
+ key.src[3] = load_byte(skb, off++);
+ key.src[4] = load_byte(skb, off++);
+ key.src[5] = load_byte(skb, off++);
+ key.src[6] = load_byte(skb, off++);
+ key.src[7] = load_byte(skb, off++);
+ key.src[8] = load_byte(skb, off++);
+ key.src[9] = load_byte(skb, off++);
+ key.src[10] = load_byte(skb, off++);
+ key.src[11] = load_byte(skb, off++);
+ key.src[12] = load_byte(skb, off++);
+ key.src[13] = load_byte(skb, off++);
+ key.src[14] = load_byte(skb, off++);
+ key.src[15] = load_byte(skb, off++);
+
+ u64* counter = v6filter.lookup(&key);
+ if (counter) {
+ __sync_fetch_and_add(counter, 1);
+ return 0;
+ }
+
+ ip_proto = load_byte(skb, nh_off + offsetof(struct ipv6hdr, nexthdr));
+ proto_off = nh_off + sizeof(struct ipv6hdr);
+ }
+ else {
+ /* neither IPv4 not IPv6, well */
+ return 2147483647;
+ }
+
+ /* allow TCP */
+ if (ip_proto == IPPROTO_TCP) {
+ return 2147483647;
+ }
+
+ struct QNameKey qkey = { 0 };
+ /* switch to positive offsets here, as we have seen some issues
+ when accessing the content of the transport layer with negative offsets
+ https://github.com/PowerDNS/pdns/issues/9626 */
+ int dns_off = sizeof(struct udphdr);
+ int qname_off = dns_off + sizeof(struct dnsheader);
+ skb->cb[0] = (uint32_t) qname_off;
+ u16 qtype;
+
+ uint8_t temp = load_byte(skb, qname_off);
+ if (temp > 63) {
+ return 0;
+ }
+
+ if (temp == 0) {
+ /* root, nothing else to see */
+ qtype = load_half(skb, (qname_off + 1));
+
+ struct QNameValue* qvalue = qnamefilter.lookup(&qkey);
+ if (qvalue &&
+ (qvalue->qtype == 255 || qtype == qvalue->qtype)) {
+ __sync_fetch_and_add(&qvalue->counter, 1);
+ return 0;
+ }
+ return 2147483647;
+ }
+
+ ssize_t labellen = temp;
+ skb->cb[1] = temp;
+ qkey.qname[0] = temp;
+
+ temp = load_byte(skb, qname_off + 1);
+ labellen--;
+ if (temp >= 'A' && temp <= 'Z') {
+ temp += ('a' - 'A');
+ }
+ skb->cb[2] = temp;
+ skb->cb[3] = labellen;
+ progsarray.call(skb, 0);
+
+ return 2147483647;
+}
diff --git a/bpf-filter.hh b/bpf-filter.hh
new file mode 100644
index 0000000..a8e2f5c
--- /dev/null
+++ b/bpf-filter.hh
@@ -0,0 +1,124 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "config.h"
+
+#include "iputils.hh"
+#include "lock.hh"
+
+class BPFFilter
+{
+public:
+ enum class MapType : uint8_t {
+ IPv4,
+ IPv6,
+ QNames,
+ Filters
+ };
+
+ enum class MapFormat : uint8_t {
+ Legacy = 0,
+ WithActions = 1
+ };
+
+ enum class MatchAction : uint8_t {
+ Pass = 0,
+ Drop = 1,
+ Truncate = 2
+ };
+
+ struct MapConfiguration
+ {
+ std::string d_pinnedPath;
+ uint32_t d_maxItems{0};
+ MapType d_type;
+ };
+
+
+ BPFFilter(const BPFFilter::MapConfiguration& v4, const BPFFilter::MapConfiguration& v6, const BPFFilter::MapConfiguration& qnames, BPFFilter::MapFormat format, bool external);
+ BPFFilter(const BPFFilter&) = delete;
+ BPFFilter(BPFFilter&&) = delete;
+ BPFFilter& operator=(const BPFFilter&) = delete;
+ BPFFilter& operator=(BPFFilter&&) = delete;
+
+ void addSocket(int sock);
+ void removeSocket(int sock);
+ void block(const ComboAddress& addr, MatchAction action);
+ void block(const DNSName& qname, MatchAction action, uint16_t qtype=255);
+ void unblock(const ComboAddress& addr);
+ void unblock(const DNSName& qname, uint16_t qtype=255);
+
+ std::vector<std::pair<ComboAddress, uint64_t> > getAddrStats();
+ std::vector<std::tuple<DNSName, uint16_t, uint64_t> > getQNameStats();
+
+ uint64_t getHits(const ComboAddress& requestor);
+
+ bool supportsMatchAction(MatchAction action) const;
+ bool isExternal() const;
+
+private:
+#ifdef HAVE_EBPF
+ struct Map
+ {
+ Map()
+ {
+ }
+ Map(const MapConfiguration&, MapFormat);
+ MapConfiguration d_config;
+ uint32_t d_count{0};
+ FDWrapper d_fd;
+ };
+
+ struct Maps
+ {
+ Map d_v4;
+ Map d_v6;
+ Map d_qnames;
+ /* The qname filter program held in d_qnamefilter is
+ stored in an eBPF map, so we can call it from the
+ main filter. This is the only entry in that map. */
+ Map d_filters;
+ };
+
+ LockGuarded<Maps> d_maps;
+
+ /* main eBPF program */
+ FDWrapper d_mainfilter;
+ /* qname filtering program */
+ FDWrapper d_qnamefilter;
+
+ /* whether the maps are in the 'old' format, which we need
+ to keep to prevent going over the 4k instructions per eBPF
+ program limit in kernels < 5.2, as well as the complexity limit:
+ - 32k in Linux 3.18
+ - 64k in Linux 4.7
+ - 96k in Linux 4.12
+ - 128k in Linux 4.14,
+ - 1M in Linux 5.2 */
+ MapFormat d_mapFormat;
+
+ /* whether the filter is internal, using our own eBPF programs,
+ or external where we only update the maps but the filtering is
+ done by an external program. */
+ bool d_external;
+#endif /* HAVE_EBPF */
+};
diff --git a/bpf-filter.main.ebpf b/bpf-filter.main.ebpf
new file mode 100644
index 0000000..4b42a2e
--- /dev/null
+++ b/bpf-filter.main.ebpf
@@ -0,0 +1,136 @@
+/* generated from the bpf_dns_filter() function in bpf-filter.ebpf.src */
+BPF_MOV64_REG(BPF_REG_6,BPF_REG_1),
+BPF_MOV64_IMM(BPF_REG_7,2147483647),
+BPF_LDX_MEM(BPF_W,BPF_REG_1,BPF_REG_6,16),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_1,ntohs(0x86dd),11),
+BPF_JMP_IMM(BPF_JNE,BPF_REG_1,ntohs(0x0800),109),
+BPF_LD_ABS(BPF_W,-2097126),
+BPF_STX_MEM(BPF_W,BPF_REG_10,BPF_REG_0,-256),
+BPF_LD_MAP_FD(BPF_REG_1,maps->d_v4.d_fd.getHandle()),
+BPF_MOV64_REG(BPF_REG_2,BPF_REG_10),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_2,-256),
+BPF_RAW_INSN(BPF_JMP|BPF_CALL,0,0,0,BPF_FUNC_map_lookup_elem),
+BPF_JMP_IMM(BPF_JNE,BPF_REG_0,0,98),
+BPF_LD_ABS(BPF_B,-2097129),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,39),
+BPF_LD_ABS(BPF_B,-2097130),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-256),
+BPF_LD_ABS(BPF_B,-2097129),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-255),
+BPF_LD_ABS(BPF_B,-2097128),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-254),
+BPF_LD_ABS(BPF_B,-2097127),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-253),
+BPF_LD_ABS(BPF_B,-2097126),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-252),
+BPF_LD_ABS(BPF_B,-2097125),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-251),
+BPF_LD_ABS(BPF_B,-2097124),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-250),
+BPF_LD_ABS(BPF_B,-2097123),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-249),
+BPF_LD_ABS(BPF_B,-2097122),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-248),
+BPF_LD_ABS(BPF_B,-2097121),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-247),
+BPF_LD_ABS(BPF_B,-2097120),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-246),
+BPF_LD_ABS(BPF_B,-2097119),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-245),
+BPF_LD_ABS(BPF_B,-2097118),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-244),
+BPF_LD_ABS(BPF_B,-2097117),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-243),
+BPF_LD_ABS(BPF_B,-2097116),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-242),
+BPF_LD_ABS(BPF_B,-2097115),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-241),
+BPF_LD_MAP_FD(BPF_REG_1,maps->d_v6.d_fd.getHandle()),
+BPF_MOV64_REG(BPF_REG_2,BPF_REG_10),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_2,-256),
+BPF_RAW_INSN(BPF_JMP|BPF_CALL,0,0,0,BPF_FUNC_map_lookup_elem),
+BPF_JMP_IMM(BPF_JNE,BPF_REG_0,0,58),
+BPF_LD_ABS(BPF_B,-2097132),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_0,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_0,6,58),
+BPF_MOV64_IMM(BPF_REG_1,0),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_1,-2),
+BPF_STX_MEM(BPF_H,BPF_REG_10,BPF_REG_1,-4),
+BPF_STX_MEM(BPF_W,BPF_REG_10,BPF_REG_1,-8),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-16),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-24),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-32),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-40),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-48),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-56),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-64),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-72),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-80),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-88),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-96),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-104),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-112),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-120),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-128),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-136),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-144),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-152),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-160),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-168),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-176),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-184),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-192),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-200),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-208),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-216),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-224),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-232),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-240),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-248),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-256),
+BPF_MOV64_IMM(BPF_REG_1,20),
+BPF_STX_MEM(BPF_W,BPF_REG_6,BPF_REG_1,48),
+BPF_LD_ABS(BPF_B,20),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_MOV64_IMM(BPF_REG_7,0),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_8,63,17),
+BPF_JMP_IMM(BPF_JNE,BPF_REG_8,0,18),
+BPF_LD_ABS(BPF_H,21),
+BPF_MOV64_REG(BPF_REG_6,BPF_REG_0),
+BPF_LD_MAP_FD(BPF_REG_1,maps->d_qnames.d_fd.getHandle()),
+BPF_MOV64_REG(BPF_REG_2,BPF_REG_10),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_2,-256),
+BPF_RAW_INSN(BPF_JMP|BPF_CALL,0,0,0,BPF_FUNC_map_lookup_elem),
+BPF_MOV64_IMM(BPF_REG_7,2147483647),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_0,0,7),
+BPF_LDX_MEM(BPF_H,BPF_REG_1,BPF_REG_0,8),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_1,255,2),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_6,65535),
+BPF_JMP_REG(BPF_JNE,BPF_REG_1,BPF_REG_6,3),
+BPF_MOV64_IMM(BPF_REG_1,1),
+BPF_RAW_INSN(BPF_STX|BPF_XADD|BPF_DW,BPF_REG_0,BPF_REG_1,0,0),
+BPF_MOV64_IMM(BPF_REG_7,0),
+BPF_MOV64_REG(BPF_REG_0,BPF_REG_7),
+BPF_EXIT_INSN(),
+BPF_STX_MEM(BPF_W,BPF_REG_6,BPF_REG_8,52),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_8,-256),
+BPF_LD_ABS(BPF_B,21),
+BPF_MOV64_REG(BPF_REG_2,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_2,-65),
+BPF_ALU64_IMM(BPF_LSH,BPF_REG_2,32),
+BPF_ALU64_IMM(BPF_RSH,BPF_REG_2,32),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,32),
+BPF_MOV64_IMM(BPF_REG_3,26),
+BPF_JMP_REG(BPF_JGT,BPF_REG_3,BPF_REG_2,1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_STX_MEM(BPF_W,BPF_REG_6,BPF_REG_8,60),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_STX_MEM(BPF_W,BPF_REG_6,BPF_REG_1,56),
+BPF_LD_MAP_FD(BPF_REG_2,maps->d_filters.d_fd.getHandle()),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_6),
+BPF_MOV64_IMM(BPF_REG_3,0),
+BPF_RAW_INSN(BPF_JMP|BPF_CALL,0,0,0,BPF_FUNC_tail_call),
+BPF_MOV64_IMM(BPF_REG_7,2147483647),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,-25),
diff --git a/bpf-filter.qname.ebpf b/bpf-filter.qname.ebpf
new file mode 100644
index 0000000..c7d6094
--- /dev/null
+++ b/bpf-filter.qname.ebpf
@@ -0,0 +1,4095 @@
+/* generated from the bpf_qname_filter() function in bpf-filter.ebpf.src */
+BPF_MOV64_REG(BPF_REG_6,BPF_REG_1),
+BPF_LDX_MEM(BPF_W,BPF_REG_8,BPF_REG_6,60),
+BPF_LDX_MEM(BPF_W,BPF_REG_7,BPF_REG_6,48),
+BPF_MOV64_IMM(BPF_REG_1,0),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_1,-2),
+BPF_STX_MEM(BPF_H,BPF_REG_10,BPF_REG_1,-4),
+BPF_STX_MEM(BPF_W,BPF_REG_10,BPF_REG_1,-8),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-16),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-24),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-32),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-40),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-48),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-56),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-64),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-72),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-80),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-88),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-96),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-104),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-112),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-120),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-128),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-136),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-144),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-152),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-160),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-168),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-176),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-184),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-192),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-200),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-208),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-216),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-224),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-232),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-240),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-248),
+BPF_STX_MEM(BPF_DW,BPF_REG_10,BPF_REG_1,-256),
+BPF_LDX_MEM(BPF_W,BPF_REG_1,BPF_REG_6,52),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_1,0,1),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_1,-256),
+BPF_LDX_MEM(BPF_W,BPF_REG_1,BPF_REG_6,56),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_1,0,1),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_1,-255),
+BPF_MOV64_REG(BPF_REG_2,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_2,2),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_2,0,0),
+BPF_JMP_IMM(BPF_JNE,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,3),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,4024),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-254),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,3),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,4),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,4008),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-253),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,4),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,5),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3992),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-252),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,5),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,6),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3976),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-251),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,6),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,7),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3960),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-250),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,7),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,8),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3944),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-249),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,8),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,9),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3928),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-248),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,9),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,10),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3912),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-247),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,10),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,11),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3896),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-246),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,11),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,12),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3880),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-245),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,12),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,13),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3864),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-244),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,13),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,14),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3848),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-243),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,14),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,15),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3832),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-242),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,15),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,16),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3816),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-241),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,16),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,17),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3800),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-240),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,17),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,18),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3784),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-239),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,18),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,19),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3768),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-238),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,19),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,20),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3752),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-237),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,20),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,21),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3736),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-236),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,21),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,22),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3720),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-235),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,22),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,23),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3704),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-234),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,23),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,24),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3688),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-233),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,24),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,25),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3672),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-232),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,25),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,26),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3656),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-231),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,26),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,27),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3640),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-230),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,27),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,28),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3624),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-229),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,28),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,29),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3608),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-228),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,29),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,30),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3592),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-227),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,30),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,31),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3576),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-226),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,31),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,32),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3560),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-225),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,32),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,33),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3544),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-224),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,33),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,34),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3528),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-223),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,34),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,35),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3512),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-222),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,35),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,36),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3496),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-221),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,36),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,37),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3480),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-220),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,37),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,38),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3464),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-219),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,38),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,39),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3448),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-218),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,39),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,40),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3432),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-217),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,40),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,41),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3416),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-216),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,41),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,42),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3400),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-215),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,42),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,43),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3384),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-214),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,43),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,44),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3368),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-213),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,44),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,45),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3352),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-212),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,45),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,46),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3336),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-211),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,46),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,47),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3320),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-210),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,47),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,48),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3304),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-209),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,48),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,49),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3288),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-208),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,49),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,50),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3272),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-207),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,50),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,51),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3256),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-206),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,51),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,52),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3240),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-205),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,52),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,53),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3224),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-204),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,53),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,54),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3208),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-203),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,54),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,55),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3192),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-202),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,55),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,56),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3176),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-201),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,56),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,57),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3160),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-200),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,57),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,58),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3144),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-199),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,58),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,59),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3128),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-198),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,59),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,60),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3112),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-197),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,60),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,61),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3096),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-196),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,61),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,62),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3080),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-195),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,62),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,63),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3064),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-194),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,63),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,64),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3048),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-193),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,64),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,65),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3032),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-192),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,65),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,66),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3016),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-191),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,66),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,67),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,3000),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-190),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,67),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,68),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2984),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-189),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,68),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,69),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2968),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-188),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,69),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,70),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2952),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-187),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,70),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,71),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2936),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-186),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,71),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,72),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2920),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-185),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,72),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,73),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2904),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-184),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,73),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,74),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2888),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-183),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,74),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,75),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2872),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-182),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,75),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,76),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2856),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-181),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,76),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,77),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2840),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-180),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,77),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,78),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2824),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-179),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,78),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,79),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2808),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-178),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,79),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,80),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2792),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-177),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,80),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,81),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2776),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-176),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,81),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,82),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2760),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-175),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,82),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,83),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2744),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-174),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,83),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,84),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2728),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-173),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,84),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,85),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2712),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-172),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,85),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,86),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2696),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-171),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,86),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,87),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2680),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-170),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,87),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,88),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2664),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-169),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,88),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,89),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2648),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-168),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,89),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,90),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2632),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-167),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,90),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,91),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2616),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-166),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,91),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,92),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2600),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-165),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,92),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,93),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2584),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-164),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,93),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,94),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2568),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-163),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,94),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,95),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2552),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-162),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,95),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,96),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2536),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-161),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,96),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,97),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2520),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-160),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,97),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,98),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2504),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-159),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,98),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,99),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2488),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-158),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,99),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,100),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2472),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-157),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,100),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,101),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2456),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-156),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,101),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,102),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2440),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-155),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,102),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,103),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2424),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-154),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,103),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,104),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2408),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-153),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,104),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,105),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2392),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-152),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,105),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,106),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2376),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-151),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,106),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,107),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2360),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-150),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,107),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,108),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2344),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-149),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,108),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,109),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2328),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-148),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,109),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,110),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2312),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-147),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,110),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,111),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2296),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-146),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,111),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,112),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2280),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-145),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,112),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,113),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2264),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-144),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,113),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,114),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2248),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-143),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,114),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,115),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2232),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-142),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,115),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,116),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2216),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-141),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,116),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,117),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2200),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-140),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,117),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,118),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2184),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-139),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,118),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,119),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2168),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-138),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,119),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,120),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2152),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-137),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,120),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,121),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2136),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-136),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,121),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,122),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2120),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-135),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,122),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,123),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2104),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-134),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,123),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,124),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2088),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-133),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,124),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,125),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2072),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-132),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,125),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,126),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2056),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-131),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,126),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,127),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2040),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-130),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,127),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,128),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2024),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-129),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,128),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,129),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,2008),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-128),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,129),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,130),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1992),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-127),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,130),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,131),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1976),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-126),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,131),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,132),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1960),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-125),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,132),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,133),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1944),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-124),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,133),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,134),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1928),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-123),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,134),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,135),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1912),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-122),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,135),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,136),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1896),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-121),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,136),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,137),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1880),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-120),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,137),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,138),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1864),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-119),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,138),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,139),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1848),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-118),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,139),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,140),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1832),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-117),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,140),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,141),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1816),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-116),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,141),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,142),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1800),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-115),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,142),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,143),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1784),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-114),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,143),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,144),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1768),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-113),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,144),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,145),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1752),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-112),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,145),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,146),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1736),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-111),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,146),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,147),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1720),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-110),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,147),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,148),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1704),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-109),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,148),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,149),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1688),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-108),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,149),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,150),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1672),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-107),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,150),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,151),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1656),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-106),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,151),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,152),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1640),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-105),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,152),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,153),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1624),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-104),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,153),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,154),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1608),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-103),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,154),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,155),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1592),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-102),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,155),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,156),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1576),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-101),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,156),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,157),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1560),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-100),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,157),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,158),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1544),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-99),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,158),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,159),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1528),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-98),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,159),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,160),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1512),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-97),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,160),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,161),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1496),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-96),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,161),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,162),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1480),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-95),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,162),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,163),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1464),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-94),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,163),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,164),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1448),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-93),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,164),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,165),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1432),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-92),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,165),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,166),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1416),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-91),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,166),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,167),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1400),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-90),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,167),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,168),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1384),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-89),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,168),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,169),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1368),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-88),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,169),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,170),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1352),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-87),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,170),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,171),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1336),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-86),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,171),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,172),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1320),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-85),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,172),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,173),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1304),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-84),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,173),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,174),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1288),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-83),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,174),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,175),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1272),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-82),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,175),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,176),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1256),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-81),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,176),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,177),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1240),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-80),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,177),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,178),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1224),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-79),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,178),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,179),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1208),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-78),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,179),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,180),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1192),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-77),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,180),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,181),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1176),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-76),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,181),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,182),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1160),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-75),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,182),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,183),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1144),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-74),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,183),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,184),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1128),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-73),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,184),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,185),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1112),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-72),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,185),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,186),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1096),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-71),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,186),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,187),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1080),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-70),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,187),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,188),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1064),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-69),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,188),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,189),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1048),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-68),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,189),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,190),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1032),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-67),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,190),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,191),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1016),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-66),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,191),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,192),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,1000),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-65),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,192),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,193),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,984),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-64),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,193),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,194),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,968),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-63),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,194),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,195),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,952),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-62),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,195),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,196),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,936),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-61),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,196),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,197),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,920),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-60),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,197),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,198),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,904),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-59),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,198),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,199),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,888),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-58),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,199),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,200),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,872),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-57),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,200),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,201),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,856),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-56),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,201),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,202),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,840),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-55),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,202),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,203),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,824),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-54),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,203),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,204),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,808),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-53),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,204),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,205),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,792),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-52),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,205),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,206),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,776),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-51),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,206),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,207),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,760),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-50),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,207),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,208),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,744),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-49),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,208),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,209),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,728),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-48),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,209),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,210),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,712),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-47),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,210),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,211),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,696),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-46),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,211),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,212),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,680),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-45),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,212),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,213),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,664),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-44),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,213),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,214),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,648),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-43),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,214),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,215),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,632),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-42),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,215),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,216),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,616),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-41),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,216),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,217),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,600),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-40),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,217),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,218),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,584),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-39),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,218),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,219),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,568),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-38),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,219),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,220),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,552),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-37),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,220),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,221),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,536),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-36),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,221),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,222),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,520),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-35),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,222),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,223),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,504),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-34),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,223),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,224),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,488),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-33),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,224),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,225),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,472),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-32),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,225),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,226),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,456),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-31),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,226),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,227),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,440),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-30),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,227),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,228),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,424),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-29),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,228),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,229),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,408),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-28),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,229),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,230),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,392),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-27),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,230),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,231),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,376),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-26),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,231),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,232),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,360),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-25),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,232),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,233),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,344),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-24),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,233),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,234),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,328),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-23),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,234),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,235),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,312),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-22),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,235),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,236),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,296),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-21),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,236),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,237),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,280),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-20),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,237),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,238),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,264),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-19),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,238),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,239),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,248),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-18),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,239),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,240),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,232),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-17),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,240),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,241),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,216),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-16),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,241),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,242),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,200),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-15),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,242),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,243),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,184),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-14),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,243),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,244),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,168),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-13),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,244),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,245),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,152),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-12),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,245),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,246),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,136),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-11),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,246),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,247),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,120),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-10),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,247),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,248),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,104),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-9),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,248),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,249),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,88),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-8),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,249),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,250),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,72),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-7),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,250),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,251),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,56),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-6),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,251),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,252),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,40),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-5),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,252),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,253),
+BPF_MOV64_REG(BPF_REG_8,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_8,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_8,0,24),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,6),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_8,-1),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-4),
+BPF_MOV64_REG(BPF_REG_9,BPF_REG_7),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_9,253),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_B,BPF_REG_0,BPF_REG_9,0,0),
+BPF_JMP_IMM(BPF_JSGT,BPF_REG_8,0,5),
+BPF_MOV64_IMM(BPF_REG_9,254),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_1,0,8),
+BPF_JMP_IMM(BPF_JA,BPF_REG_0,0,5),
+BPF_MOV64_REG(BPF_REG_1,BPF_REG_0),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_1,-65),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_1,255),
+BPF_JMP_IMM(BPF_JGT,BPF_REG_1,25,1),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_0,32),
+BPF_STX_MEM(BPF_B,BPF_REG_10,BPF_REG_0,-3),
+BPF_MOV64_IMM(BPF_REG_9,255),
+BPF_ALU64_REG(BPF_ADD,BPF_REG_9,BPF_REG_7),
+BPF_RAW_INSN(BPF_LD|BPF_IND|BPF_H,BPF_REG_0,BPF_REG_9,0,0),
+BPF_MOV64_REG(BPF_REG_6,BPF_REG_0),
+BPF_LD_MAP_FD(BPF_REG_1,maps->d_qnames.d_fd.getHandle()),
+BPF_MOV64_REG(BPF_REG_2,BPF_REG_10),
+BPF_ALU64_IMM(BPF_ADD,BPF_REG_2,-256),
+BPF_RAW_INSN(BPF_JMP|BPF_CALL,0,0,0,BPF_FUNC_map_lookup_elem),
+BPF_MOV64_IMM(BPF_REG_1,2147483647),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_0,0,7),
+BPF_LDX_MEM(BPF_H,BPF_REG_2,BPF_REG_0,8),
+BPF_JMP_IMM(BPF_JEQ,BPF_REG_2,255,2),
+BPF_ALU64_IMM(BPF_AND,BPF_REG_6,65535),
+BPF_JMP_REG(BPF_JNE,BPF_REG_6,BPF_REG_2,3),
+BPF_MOV64_IMM(BPF_REG_1,1),
+BPF_RAW_INSN(BPF_STX|BPF_XADD|BPF_DW,BPF_REG_0,BPF_REG_1,0,0),
+BPF_MOV64_IMM(BPF_REG_1,0),
+BPF_MOV64_REG(BPF_REG_0,BPF_REG_1),
+BPF_EXIT_INSN(),
diff --git a/builder-support/gen-version b/builder-support/gen-version
new file mode 100755
index 0000000..c2a56b4
--- /dev/null
+++ b/builder-support/gen-version
@@ -0,0 +1,77 @@
+#!/bin/sh
+if [ ! -z "${BUILDER_VERSION}" ]; then
+ printf ${BUILDER_VERSION}
+ exit 0
+fi
+
+VERSION="unknown"
+
+DIRTY=""
+git status | grep -q clean || DIRTY='.dirty'
+
+# Special environment variable to signal that we are building a release, as this
+# has consequenses for the version number.
+if [ "${IS_RELEASE}" = "YES" ]; then
+ TAG="$(git describe --tags --exact-match 2> /dev/null | cut -d- -f 2-)"
+ if [ -n "${TAG}" ]; then
+ # We're on a tag
+ echo "${TAG}${DIRTY}" > .version
+ printf "${TAG}${DIRTY}"
+ exit 0
+ fi
+ echo 'This is not a tag, either tag this commit or do not set $IS_RELEASE' >&2
+ exit 1
+fi
+
+#
+# Generate the version number based on the branch
+#
+if [ ! -z "$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" ]; then
+ if [ -n "${BUILDER_MODULES}" ]; then
+ match=${BUILDER_MODULES}
+ [ $match = "authoritative" ] && match='auth'
+ [ $match = "recursor" ] && match='rec'
+ GIT_VERSION="$(git describe --match=${match}-* --tags | cut -d- -f2-)"
+ if [ $(echo ${GIT_VERSION} | awk -F"-" '{print NF-1}') = '3' ]; then
+ # A prerelease happened before
+ LAST_TAG="$(echo ${GIT_VERSION} | cut -d- -f1-2)"
+ COMMITS_SINCE_TAG="$(echo ${GIT_VERSION} | cut -d- -f3)"
+ GIT_HASH="$(echo ${GIT_VERSION} | cut -d- -f4)"
+ elif [ $(echo ${GIT_VERSION} | awk -F"-" '{print NF-1}') = '1' ]; then
+ # Exactly on a pre-release
+ LAST_TAG="$(echo ${GIT_VERSION} | cut -d- -f1-2)"
+ else
+ LAST_TAG="$(echo ${GIT_VERSION} | cut -d- -f1)"
+ COMMITS_SINCE_TAG="$(echo ${GIT_VERSION} | cut -d- -f2)"
+ GIT_HASH="$(echo ${GIT_VERSION} | cut -d- -f3)"
+ fi
+ fi
+
+ if [ -z "${GIT_VERSION}" ]; then
+ # BUILDER_SUPPORT has more than one product listed, fall back to the 0.0.0 logic
+
+ # We used 0.0.XXXXgHASH for master in the previous incarnation of our build pipeline.
+ # This now becomes 0.0.XXXX.0.gHASH, as 0.0.0.XXXX.gHASH (which is more correct)
+ # would break upgrades for those running master
+ # This _should_ be ok for forever is we stick to X.Y.Z for version numbers
+ LAST_TAG=0.0
+ COMMITS_SINCE_TAG="$(git rev-list --count 12c868770afc20b6cc0da439d881105151d557dd..HEAD 2> /dev/null).0"
+ [ "${COMMITS_SINCE_TAG}" = ".0" ] && COMMITS_SINCE_TAG=0.0
+ GIT_HASH="g$(git rev-parse HEAD | cut -c1-10 2> /dev/null)"
+ fi
+
+ BRANCH=".$(git rev-parse --abbrev-ref HEAD | perl -p -e 's/[^[:alnum:]]//g;')"
+
+ TAG="$(git describe --tags --exact-match 2> /dev/null | cut -d- -f 2-)"
+ if [ -n "${TAG}" ]; then # We're exactly on a tag
+ COMMITS_SINCE_TAG="0"
+ GIT_HASH="g$(git show --no-patch --format=format:%h HEAD 2>/dev/null)"
+ if [ -z "$GIT_HASH" ]; then
+ GIT_HASH="g$(git show --format=format:%h HEAD | head -n1)"
+ fi
+ fi
+
+ VERSION="${LAST_TAG}.${COMMITS_SINCE_TAG}${BRANCH}.${GIT_HASH}${DIRTY}"
+fi
+
+printf $VERSION
diff --git a/cachecleaner.hh b/cachecleaner.hh
new file mode 100644
index 0000000..f3af11a
--- /dev/null
+++ b/cachecleaner.hh
@@ -0,0 +1,262 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <boost/multi_index_container.hpp>
+
+#include "dnsname.hh"
+#include "lock.hh"
+
+// this function can clean any cache that has a getTTD() method on its entries, a preRemoval() method and a 'sequence' index as its second index
+// the ritual is that the oldest entries are in *front* of the sequence collection, so on a hit, move an item to the end
+// on a miss, move it to the beginning
+template <typename S, typename C, typename T> void pruneCollection(C& container, T& collection, size_t maxCached, size_t scanFraction = 1000)
+{
+ const time_t now = time(0);
+ size_t toTrim = 0;
+ const size_t cacheSize = collection.size();
+
+ if (cacheSize > maxCached) {
+ toTrim = cacheSize - maxCached;
+ }
+
+ auto& sidx = collection.template get<S>();
+
+ // two modes - if toTrim is 0, just look through 1/scanFraction of all records
+ // and nuke everything that is expired
+ // otherwise, scan first 5*toTrim records, and stop once we've nuked enough
+ const size_t lookAt = toTrim ? 5 * toTrim : cacheSize / scanFraction;
+ size_t tried = 0, erased = 0;
+
+ for (auto iter = sidx.begin(); iter != sidx.end() && tried < lookAt ; ++tried) {
+ if (iter->getTTD() < now) {
+ iter = sidx.erase(iter);
+ erased++;
+ }
+ else {
+ ++iter;
+ }
+
+ if (toTrim && erased >= toTrim) {
+ break;
+ }
+ }
+
+ if (erased >= toTrim) { // done
+ return;
+ }
+
+ toTrim -= erased;
+
+ // just lob it off from the beginning
+ auto iter = sidx.begin();
+ for (size_t i = 0; i < toTrim && iter != sidx.end(); i++) {
+ iter = sidx.erase(iter);
+ }
+}
+
+// note: this expects iterator from first index
+template <typename S, typename T> void moveCacheItemToFrontOrBack(T& collection, typename T::iterator& iter, bool front)
+{
+ typedef typename T::template index<S>::type sequence_t;
+ sequence_t& sidx=collection.template get<S>();
+ typename sequence_t::iterator si=collection.template project<S>(iter);
+ if(front)
+ sidx.relocate(sidx.begin(), si); // at the beginning of the delete queue
+ else
+ sidx.relocate(sidx.end(), si); // back
+}
+
+template <typename S, typename T> void moveCacheItemToFront(T& collection, typename T::iterator& iter)
+{
+ moveCacheItemToFrontOrBack<S>(collection, iter, true);
+}
+
+template <typename S, typename T> void moveCacheItemToBack(T& collection, typename T::iterator& iter)
+{
+ moveCacheItemToFrontOrBack<S>(collection, iter, false);
+}
+
+template <typename S, typename T> uint64_t pruneLockedCollectionsVector(std::vector<T>& maps)
+{
+ uint64_t totErased = 0;
+ time_t now = time(nullptr);
+
+ for(auto& mc : maps) {
+ auto map = mc.d_map.write_lock();
+
+ uint64_t lookAt = (map->size() + 9) / 10; // Look at 10% of this shard
+ uint64_t erased = 0;
+
+ auto& sidx = boost::multi_index::get<S>(*map);
+ for(auto i = sidx.begin(); i != sidx.end() && lookAt > 0; lookAt--) {
+ if(i->ttd < now) {
+ i = sidx.erase(i);
+ erased++;
+ } else {
+ ++i;
+ }
+ }
+ totErased += erased;
+ }
+
+ return totErased;
+}
+
+template <typename S, typename C, typename T> uint64_t pruneMutexCollectionsVector(C& container, std::vector<T>& maps, uint64_t maxCached, uint64_t cacheSize)
+{
+ time_t now = time(nullptr);
+ uint64_t totErased = 0;
+ uint64_t toTrim = 0;
+ uint64_t lookAt = 0;
+
+ // two modes - if toTrim is 0, just look through 10% of the cache and nuke everything that is expired
+ // otherwise, scan first 5*toTrim records, and stop once we've nuked enough
+ if (cacheSize > maxCached) {
+ toTrim = cacheSize - maxCached;
+ lookAt = 5 * toTrim;
+ } else {
+ lookAt = cacheSize / 10;
+ }
+
+ uint64_t maps_size = maps.size();
+ if (maps_size == 0) {
+ return 0;
+ }
+
+ for (auto& content : maps) {
+ auto mc = content.lock();
+ mc->invalidate();
+ auto& sidx = boost::multi_index::get<S>(mc->d_map);
+ uint64_t erased = 0, lookedAt = 0;
+ for (auto i = sidx.begin(); i != sidx.end(); lookedAt++) {
+ if (i->getTTD() < now) {
+ container.preRemoval(*mc, *i);
+ i = sidx.erase(i);
+ erased++;
+ --content.d_entriesCount;
+ } else {
+ ++i;
+ }
+
+ if (toTrim && erased >= toTrim / maps_size)
+ break;
+
+ if (lookedAt > lookAt / maps_size)
+ break;
+ }
+ totErased += erased;
+ if (toTrim && totErased >= toTrim)
+ break;
+ }
+
+ if (totErased >= toTrim) { // done
+ return totErased;
+ }
+
+ toTrim -= totErased;
+
+ while (true) {
+ size_t pershard = toTrim / maps_size + 1;
+ for (auto& content : maps) {
+ auto mc = content.lock();
+ mc->invalidate();
+ auto& sidx = boost::multi_index::get<S>(mc->d_map);
+ size_t removed = 0;
+ for (auto i = sidx.begin(); i != sidx.end() && removed < pershard; removed++) {
+ container.preRemoval(*mc, *i);
+ i = sidx.erase(i);
+ --content.d_entriesCount;
+ totErased++;
+ toTrim--;
+ if (toTrim == 0) {
+ return totErased;
+ }
+ }
+ }
+ }
+ // Not reached
+ return totErased;
+}
+
+template <typename T> uint64_t purgeLockedCollectionsVector(std::vector<T>& maps)
+{
+ uint64_t delcount=0;
+
+ for(auto& mc : maps) {
+ auto map = mc.d_map.write_lock();
+ delcount += map->size();
+ map->clear();
+ }
+
+ return delcount;
+}
+
+template <typename N, typename T> uint64_t purgeLockedCollectionsVector(std::vector<T>& maps, const std::string& match)
+{
+ uint64_t delcount=0;
+ std::string prefix(match);
+ prefix.resize(prefix.size()-1);
+ DNSName dprefix(prefix);
+ for(auto& mc : maps) {
+ auto map = mc.d_map.write_lock();
+ auto& idx = boost::multi_index::get<N>(*map);
+ auto iter = idx.lower_bound(dprefix);
+ auto start = iter;
+
+ for(; iter != idx.end(); ++iter) {
+ if(!iter->qname.isPartOf(dprefix)) {
+ break;
+ }
+ delcount++;
+ }
+ idx.erase(start, iter);
+ }
+
+ return delcount;
+}
+
+template <typename N, typename T> uint64_t purgeExactLockedCollection(T& mc, const DNSName& qname)
+{
+ uint64_t delcount=0;
+ auto map = mc.d_map.write_lock();
+ auto& idx = boost::multi_index::get<N>(*map);
+ auto range = idx.equal_range(qname);
+ if(range.first != range.second) {
+ delcount += distance(range.first, range.second);
+ idx.erase(range.first, range.second);
+ }
+
+ return delcount;
+}
+
+template<typename S, typename Index>
+bool lruReplacingInsert(Index& i, const typename Index::value_type& x)
+{
+ auto inserted = i.insert(x);
+ if (!inserted.second) {
+ moveCacheItemToBack<S>(i, inserted.first);
+ i.replace(inserted.first, x);
+ return false;
+ }
+ return true;
+}
diff --git a/capabilities.cc b/capabilities.cc
new file mode 100644
index 0000000..534d665
--- /dev/null
+++ b/capabilities.cc
@@ -0,0 +1,75 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include <cstring>
+#include <stdexcept>
+
+#ifdef HAVE_LIBCAP
+#include <sys/capability.h>
+#endif
+
+#include "capabilities.hh"
+#include "misc.hh"
+
+void dropCapabilities(std::set<std::string> capabilitiesToKeep)
+{
+#ifdef HAVE_LIBCAP
+ cap_t caps = cap_get_proc();
+ if (caps != nullptr) {
+ cap_clear(caps);
+
+ if (!capabilitiesToKeep.empty()) {
+ std::vector<cap_value_t> toKeep;
+ toKeep.reserve(capabilitiesToKeep.size());
+
+ for (const auto& capToKeep : capabilitiesToKeep) {
+ cap_value_t value;
+ int res = cap_from_name(capToKeep.c_str(), &value);
+ if (res != 0) {
+ cap_free(caps);
+ throw std::runtime_error("Unable to convert capability name '" + capToKeep + "': " + stringerror());
+ }
+ toKeep.push_back(value);
+ }
+
+ if (cap_set_flag(caps, CAP_EFFECTIVE, toKeep.size(), toKeep.data(), CAP_SET) != 0) {
+ cap_free(caps);
+ throw std::runtime_error("Unable to set effective flag capabilities: " + stringerror());
+ }
+
+ if (cap_set_flag(caps, CAP_PERMITTED, toKeep.size(), toKeep.data(), CAP_SET) != 0) {
+ cap_free(caps);
+ throw std::runtime_error("Unable to set permitted flag capabilities: " + stringerror());
+ }
+ }
+
+ if (cap_set_proc(caps) != 0) {
+ cap_free(caps);
+ throw std::runtime_error("Unable to drop capabilities: " + stringerror());
+ }
+
+ cap_free(caps);
+ }
+#endif /* HAVE_LIBCAP */
+}
diff --git a/capabilities.hh b/capabilities.hh
new file mode 100644
index 0000000..4d0b0de
--- /dev/null
+++ b/capabilities.hh
@@ -0,0 +1,26 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <set>
+
+void dropCapabilities(std::set<std::string> capabilitiesToKeep = {});
diff --git a/cdb.cc b/cdb.cc
new file mode 100644
index 0000000..55ade93
--- /dev/null
+++ b/cdb.cc
@@ -0,0 +1,227 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "cdb.hh"
+
+CDB::CDB(const string &cdbfile)
+{
+ d_fd = open(cdbfile.c_str(), O_RDONLY);
+ if (d_fd < 0)
+ {
+ throw std::runtime_error("Failed to open cdb database file '"+cdbfile+"': " + stringerror());
+ }
+
+ memset(&d_cdbf,0,sizeof(struct cdb_find));
+ int cdbinit = cdb_init(&d_cdb, d_fd);
+ if (cdbinit < 0)
+ {
+ close(d_fd);
+ d_fd = -1;
+ throw std::runtime_error("Failed to initialize cdb structure for database '+cdbfile+': '" + std::to_string(cdbinit) + "'");
+ }
+}
+
+CDB::~CDB() {
+ cdb_free(&d_cdb);
+ close(d_fd);
+}
+
+int CDB::searchKey(const string &key) {
+ d_searchType = SearchKey;
+
+ // A 'bug' in tinycdb (the lib used for reading the CDB files) means we have to copy the key because the cdb_find struct
+ // keeps a pointer to it.
+ d_key = key;
+ return cdb_findinit(&d_cdbf, &d_cdb, d_key.c_str(), d_key.size());
+}
+
+bool CDB::searchSuffix(const string &key) {
+ d_searchType = SearchSuffix;
+
+ //See CDB::searchKey()
+ d_key = key;
+
+ // We are ok with a search on things, but we do want to know if a record with that key exists.........
+ bool hasDomain = (cdb_find(&d_cdb, d_key.c_str(), d_key.size()) == 1);
+ if (hasDomain) {
+ cdb_seqinit(&d_seqPtr, &d_cdb);
+ }
+
+ return hasDomain;
+}
+
+void CDB::searchAll() {
+ d_searchType = SearchAll;
+ cdb_seqinit(&d_seqPtr, &d_cdb);
+}
+
+bool CDB::moveToNext() {
+ int hasNext = 0;
+ if (d_searchType == SearchKey) {
+ hasNext = cdb_findnext(&d_cdbf);
+ } else {
+ hasNext = cdb_seqnext(&d_seqPtr, &d_cdb);
+ }
+ return (hasNext > 0);
+}
+
+bool CDB::readNext(pair<string, string> &value) {
+ while (moveToNext()) {
+ unsigned int pos;
+ unsigned int len;
+
+ pos = cdb_keypos(&d_cdb);
+ len = cdb_keylen(&d_cdb);
+
+ std::string key;
+ key.resize(len);
+ int ret = cdb_read(&d_cdb, &key[0], len, pos);
+ if (ret < 0) {
+ throw std::runtime_error("Error while reading key for key '" + key + "' from CDB database: " + std::to_string(ret));
+ }
+
+ if (d_searchType == SearchSuffix) {
+ char *p = strstr(const_cast<char*>(key.c_str()), d_key.c_str());
+ if (p == nullptr) {
+ continue;
+ }
+ }
+
+ pos = cdb_datapos(&d_cdb);
+ len = cdb_datalen(&d_cdb);
+ std::string val;
+ val.resize(len);
+ ret = cdb_read(&d_cdb, &val[0], len, pos);
+ if (ret < 0) {
+ throw std::runtime_error("Error while reading value for key '" + key + "' from CDB database: " + std::to_string(ret));
+ }
+
+ value = {std::move(key), std::move(val)};
+ return true;
+ }
+
+ // We're done searching, so we can clean up d_key
+ if (d_searchType != SearchAll) {
+ d_key.clear();
+ }
+
+ return false;
+}
+
+vector<string> CDB::findall(string &key)
+{
+ vector<string> ret;
+ struct cdb_find cdbf;
+
+ int res = cdb_findinit(&cdbf, &d_cdb, key.c_str(), key.size());
+ if (res < 0) {
+ throw std::runtime_error("Error looking up key '" + key + "' from CDB database: " + std::to_string(res));
+ }
+
+ int x=0;
+ while(cdb_findnext(&cdbf) > 0) {
+ x++;
+ unsigned int vpos = cdb_datapos(&d_cdb);
+ unsigned int vlen = cdb_datalen(&d_cdb);
+ std::string val;
+ val.resize(vlen);
+ res = cdb_read(&d_cdb, &val[0], vlen, vpos);
+ if (res < 0) {
+ throw std::runtime_error("Error while reading value for key '" + key + "' from CDB database: " + std::to_string(res));
+ }
+ ret.push_back(std::move(val));
+ }
+
+ return ret;
+}
+
+bool CDB::keyExists(const string& key)
+{
+ int ret = cdb_find(&d_cdb, key.c_str(), key.size());
+ if (ret < 0) {
+ throw std::runtime_error("Error while looking up key '" + key + "' from CDB database: " + std::to_string(ret));
+ }
+ if (ret == 0) {
+ /* no such key */
+ return false;
+ }
+
+ return true;
+}
+
+bool CDB::findOne(const string& key, string& value)
+{
+ if (!keyExists(key)) {
+ return false;
+ }
+
+ unsigned int vpos = cdb_datapos(&d_cdb);
+ unsigned int vlen = cdb_datalen(&d_cdb);
+ value.resize(vlen);
+ int ret = cdb_read(&d_cdb, &value[0], vlen, vpos);
+ if (ret < 0) {
+ throw std::runtime_error("Error while reading value for key '" + key + "' from CDB database: " + std::to_string(ret));
+ }
+
+ return true;
+}
+
+CDBWriter::CDBWriter(int fd): d_fd(fd)
+{
+ cdb_make_start(&d_cdbm, d_fd);
+}
+
+CDBWriter::~CDBWriter()
+{
+ close();
+}
+
+void CDBWriter::close()
+{
+ if (d_fd >= 0) {
+ cdb_make_finish(&d_cdbm);
+ ::close(d_fd);
+ d_fd = -1;
+ }
+}
+
+bool CDBWriter::addEntry(const std::string& key, const std::string& value)
+{
+ if (d_fd < 0) {
+ throw std::runtime_error("Can't add an entry to a closed CDB database");
+ }
+
+ int ret = cdb_make_add(&d_cdbm, key.c_str(), key.size(), value.c_str(), value.size());
+ if (ret != 0) {
+ throw std::runtime_error("Error adding key '" + key + "' to CDB database: " + std::to_string(ret));
+ }
+
+ return true;
+}
diff --git a/cdb.hh b/cdb.hh
new file mode 100644
index 0000000..c606958
--- /dev/null
+++ b/cdb.hh
@@ -0,0 +1,70 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <cdb.h>
+
+#include "misc.hh"
+
+// This class is responsible for the reading of a CDB file.
+// The constructor opens the CDB file, the destructor closes it, so make sure you call that.
+class CDB
+{
+public:
+ CDB(const string &cdbfile);
+ ~CDB();
+
+ /* Return negative value on error or non-negative value on success.
+ Values can be retrieved via readNext() */
+ int searchKey(const string &key);
+ bool searchSuffix(const string &key);
+ void searchAll();
+ bool readNext(pair<string, string> &value);
+ vector<string> findall(string &key);
+ bool keyExists(const string& key);
+ bool findOne(const string& key, string& value);
+
+private:
+ bool moveToNext();
+
+ int d_fd{-1};
+ struct cdb d_cdb;
+ struct cdb_find d_cdbf;
+ std::string d_key;
+ unsigned d_seqPtr{0};
+ enum SearchType { SearchSuffix, SearchKey, SearchAll } d_searchType{SearchKey};
+};
+
+class CDBWriter
+{
+public:
+ /* we own the fd after this call, don't ever touch it */
+ CDBWriter(int fd);
+ ~CDBWriter();
+
+ bool addEntry(const std::string& key, const std::string& value);
+ /* finalize the database and close the fd, the only thing you can do now is to call the destructor */
+ void close();
+
+private:
+ struct cdb_make d_cdbm;
+ int d_fd{-1};
+};
diff --git a/circular_buffer.hh b/circular_buffer.hh
new file mode 100644
index 0000000..eb1dbb9
--- /dev/null
+++ b/circular_buffer.hh
@@ -0,0 +1,38 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+// Disable the non-threadsafe debug code in boost::circular_buffer before 1.62
+#define BOOST_CB_DISABLE_DEBUG 1
+
+// Make sure it is also disabled when >= 1.62
+#ifndef BOOST_CB_ENABLE_DEBUG
+#define BOOST_CB_ENABLE_DEBUG 0
+#endif
+
+#if BOOST_CB_ENABLE_DEBUG
+// https://github.com/boostorg/circular_buffer/pull/9
+// https://svn.boost.org/trac10/ticket/6277
+#error Building with BOOST_CB_ENABLE_DEBUG prevents accessing a boost::circular_buffer from more than one thread at once
+#endif /* BOOST_CB_ENABLE_DEBUG */
+
+#include <boost/circular_buffer.hpp>
diff --git a/compile b/compile
new file mode 100755
index 0000000..99e5052
--- /dev/null
+++ b/compile
@@ -0,0 +1,348 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, 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 <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" "" $nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+ file=$1
+ case $file in
+ / | /[!/]*) # absolute file, and not a UNC file
+ if test -z "$file_conv"; then
+ # lazily determine how to convert abs files
+ case `uname -s` in
+ MINGW*)
+ file_conv=mingw
+ ;;
+ CYGWIN*)
+ file_conv=cygwin
+ ;;
+ *)
+ file_conv=wine
+ ;;
+ esac
+ fi
+ case $file_conv/,$2, in
+ *,$file_conv,*)
+ ;;
+ mingw/*)
+ file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+ ;;
+ cygwin/*)
+ file=`cygpath -m "$file" || echo "$file"`
+ ;;
+ wine/*)
+ file=`winepath -w "$file" || echo "$file"`
+ ;;
+ esac
+ ;;
+ esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+ func_file_conv "$1"
+ if test -z "$lib_path"; then
+ lib_path=$file
+ else
+ lib_path="$lib_path;$file"
+ fi
+ linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+ lib=$1
+ found=no
+ save_IFS=$IFS
+ IFS=';'
+ for dir in $lib_path $LIB
+ do
+ IFS=$save_IFS
+ if $shared && test -f "$dir/$lib.dll.lib"; then
+ found=yes
+ lib=$dir/$lib.dll.lib
+ break
+ fi
+ if test -f "$dir/$lib.lib"; then
+ found=yes
+ lib=$dir/$lib.lib
+ break
+ fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
+ done
+ IFS=$save_IFS
+
+ if test "$found" != yes; then
+ lib=$lib.lib
+ fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+ # Assume a capable shell
+ lib_path=
+ shared=:
+ linker_opts=
+ for arg
+ do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ eat=1
+ case $2 in
+ *.o | *.[oO][bB][jJ])
+ func_file_conv "$2"
+ set x "$@" -Fo"$file"
+ shift
+ ;;
+ *)
+ func_file_conv "$2"
+ set x "$@" -Fe"$file"
+ shift
+ ;;
+ esac
+ ;;
+ -I)
+ eat=1
+ func_file_conv "$2" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -I*)
+ func_file_conv "${1#-I}" mingw
+ set x "$@" -I"$file"
+ shift
+ ;;
+ -l)
+ eat=1
+ func_cl_dashl "$2"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -l*)
+ func_cl_dashl "${1#-l}"
+ set x "$@" "$lib"
+ shift
+ ;;
+ -L)
+ eat=1
+ func_cl_dashL "$2"
+ ;;
+ -L*)
+ func_cl_dashL "${1#-L}"
+ ;;
+ -static)
+ shared=false
+ ;;
+ -Wl,*)
+ arg=${1#-Wl,}
+ save_ifs="$IFS"; IFS=','
+ for flag in $arg; do
+ IFS="$save_ifs"
+ linker_opts="$linker_opts $flag"
+ done
+ IFS="$save_ifs"
+ ;;
+ -Xlinker)
+ eat=1
+ linker_opts="$linker_opts $2"
+ ;;
+ -*)
+ set x "$@" "$1"
+ shift
+ ;;
+ *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+ func_file_conv "$1"
+ set x "$@" -Tp"$file"
+ shift
+ ;;
+ *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+ func_file_conv "$1" mingw
+ set x "$@" "$file"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+ done
+ if test -n "$linker_opts"; then
+ linker_opts="-link$linker_opts"
+ fi
+ exec "$@" $linker_opts
+ exit 1
+}
+
+eat=
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
+ func_cl_wrapper "$@" # Doesn't return...
+ ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as 'compile cc -o foo foo.c'.
+ # So we strip '-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no '-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # '.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..256083a
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1476 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright 1992-2018 Free Software Foundation, Inc.
+
+timestamp='2018-03-08'
+
+# This file 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 <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+#
+# You can get the latest version of this script from:
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+#
+# Please send patches to <config-patches@gnu.org>.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Options:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2018 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > "$dummy.c" ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+case "$UNAME_SYSTEM" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval "$set_cc_for_build"
+ cat <<-EOF > "$dummy.c"
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+ # If ldd exists, use it to detect musl libc.
+ if command -v ldd >/dev/null && \
+ ldd --version 2>&1 | grep -q ^musl
+ then
+ LIBC=musl
+ fi
+ ;;
+esac
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ "/sbin/$sysctl" 2>/dev/null || \
+ "/usr/sbin/$sysctl" 2>/dev/null || \
+ echo unknown)`
+ case "$UNAME_MACHINE_ARCH" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ earmv*)
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine="${arch}${endian}"-unknown
+ ;;
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently (or will in the future) and ABI.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ os=netbsdelf
+ ;;
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval "$set_cc_for_build"
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ELF__
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # Determine ABI tags.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "$UNAME_VERSION" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "$machine-${os}${release}${abi}"
+ exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+ exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+ exit ;;
+ *:MidnightBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
+ exit ;;
+ *:SolidBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:MirBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:Sortix:*:*)
+ echo "$UNAME_MACHINE"-unknown-sortix
+ exit ;;
+ *:Redox:*:*)
+ echo "$UNAME_MACHINE"-unknown-redox
+ exit ;;
+ mips:OSF1:*.*)
+ echo mips-dec-osf1
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE=alpha ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE=alpha ;;
+ "EV5 (21164)")
+ UNAME_MACHINE=alphaev5 ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE=alphaev56 ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE=alphapca56 ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE=alphapca57 ;;
+ "EV6 (21264)")
+ UNAME_MACHINE=alphaev6 ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE=alphaev67 ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE=alphaev68 ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE=alphaev69 ;;
+ "EV7 (21364)")
+ UNAME_MACHINE=alphaev7 ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE=alphaev79 ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ exitcode=$?
+ trap '' 0
+ exit $exitcode ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo "$UNAME_MACHINE"-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo "$UNAME_MACHINE"-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix"$UNAME_RELEASE"
+ exit ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ s390x:SunOS:*:*)
+ echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+ exit ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
+ exit ;;
+ i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+ echo i386-pc-auroraux"$UNAME_RELEASE"
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ eval "$set_cc_for_build"
+ SUN_ARCH=i386
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ SUN_ARCH=x86_64
+ fi
+ fi
+ echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos"$UNAME_RELEASE"
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos"$UNAME_RELEASE"
+ ;;
+ sun4)
+ echo sparc-sun-sunos"$UNAME_RELEASE"
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos"$UNAME_RELEASE"
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint"$UNAME_RELEASE"
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint"$UNAME_RELEASE"
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint"$UNAME_RELEASE"
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint"$UNAME_RELEASE"
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten"$UNAME_RELEASE"
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten"$UNAME_RELEASE"
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix"$UNAME_RELEASE"
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix"$UNAME_RELEASE"
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix"$UNAME_RELEASE"
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos"$UNAME_RELEASE"
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
+ then
+ if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+ [ "$TARGET_BINARY_INTERFACE"x = x ]
+ then
+ echo m88k-dg-dgux"$UNAME_RELEASE"
+ else
+ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
+ fi
+ else
+ echo i586-dg-dgux"$UNAME_RELEASE"
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
+ fi
+ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[4567])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/lslpp ] ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+ else
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
+ fi
+ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ case "$UNAME_MACHINE" in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "$sc_cpu_version" in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "$sc_kernel_bits" in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "$HP_ARCH" = "" ]; then
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ "$HP_ARCH" = hppa2.0w ]
+ then
+ eval "$set_cc_for_build"
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep -q __LP64__
+ then
+ HP_ARCH=hppa2.0w
+ else
+ HP_ARCH=hppa64
+ fi
+ fi
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux"$HPUX_REV"
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo "$UNAME_MACHINE"-unknown-osf1mk
+ else
+ echo "$UNAME_MACHINE"-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ *:BSD/OS:*:*)
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ *:FreeBSD:*:*)
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ case "$UNAME_PROCESSOR" in
+ amd64)
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
+ esac
+ echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
+ exit ;;
+ i*:CYGWIN*:*)
+ echo "$UNAME_MACHINE"-pc-cygwin
+ exit ;;
+ *:MINGW64*:*)
+ echo "$UNAME_MACHINE"-pc-mingw64
+ exit ;;
+ *:MINGW*:*)
+ echo "$UNAME_MACHINE"-pc-mingw32
+ exit ;;
+ *:MSYS*:*)
+ echo "$UNAME_MACHINE"-pc-msys
+ exit ;;
+ i*:PW*:*)
+ echo "$UNAME_MACHINE"-pc-pw32
+ exit ;;
+ *:Interix*:*)
+ case "$UNAME_MACHINE" in
+ x86)
+ echo i586-pc-interix"$UNAME_RELEASE"
+ exit ;;
+ authenticamd | genuineintel | EM64T)
+ echo x86_64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix"$UNAME_RELEASE"
+ exit ;;
+ esac ;;
+ i*:UWIN*:*)
+ echo "$UNAME_MACHINE"-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
+ exit ;;
+ i*86:Minix:*:*)
+ echo "$UNAME_MACHINE"-pc-minix
+ exit ;;
+ aarch64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ aarch64_be:Linux:*:*)
+ UNAME_MACHINE=aarch64_be
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep -q ld.so.1
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ arm*:Linux:*:*)
+ eval "$set_cc_for_build"
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ else
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
+ else
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
+ fi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ cris:Linux:*:*)
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ crisv32:Linux:*:*)
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ e2k:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ frv:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ hexagon:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ i*86:Linux:*:*)
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+ exit ;;
+ ia64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ k1om:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ m32r*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ m68*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ mips:Linux:*:* | mips64:Linux:*:*)
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
+ #undef CPU
+ #undef ${UNAME_MACHINE}
+ #undef ${UNAME_MACHINE}el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=${UNAME_MACHINE}el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=${UNAME_MACHINE}
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+ test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
+ ;;
+ mips64el:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ openrisc*:Linux:*:*)
+ echo or1k-unknown-linux-"$LIBC"
+ exit ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ padre:Linux:*:*)
+ echo sparc-unknown-linux-"$LIBC"
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-"$LIBC"
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+ *) echo hppa-unknown-linux-"$LIBC" ;;
+ esac
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-"$LIBC"
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-"$LIBC"
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-"$LIBC"
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-"$LIBC"
+ exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
+ exit ;;
+ sh64*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ sh*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ tile*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ vax:Linux:*:*)
+ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
+ exit ;;
+ x86_64:Linux:*:*)
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo "$UNAME_MACHINE"-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo "$UNAME_MACHINE"-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo "$UNAME_MACHINE"-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo "$UNAME_MACHINE"-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+ echo i386-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ i*86:*DOS:*:*)
+ echo "$UNAME_MACHINE"-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:*)
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
+ else
+ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
+ else
+ echo "$UNAME_MACHINE"-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i586.
+ # Note: whatever this is, it MUST be the same as what config.sub
+ # prints for the "djgpp" host, or else GDB configure will decide that
+ # this is a cross-build.
+ echo i586-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+ OS_REL='.3'
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv"$UNAME_RELEASE"
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo "$UNAME_MACHINE"-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo "$UNAME_MACHINE"-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux"$UNAME_RELEASE"
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv"$UNAME_RELEASE"
+ else
+ echo mips-unknown-sysv"$UNAME_RELEASE"
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
+ echo i586-pc-haiku
+ exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
+ exit ;;
+ *:Rhapsody:*:*)
+ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ eval "$set_cc_for_build"
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
+ fi
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # Avoid executing cc on OS X 10.9, as it ships with a stub
+ # that puts up a graphical alert prompting to install
+ # developer tools. Any system running Mac OS X 10.7 or
+ # later (Darwin 11 and later) is required to have a 64-bit
+ # processor. This is not true of the ARM version of Darwin
+ # that Apple uses in portable devices.
+ UNAME_PROCESSOR=x86_64
+ fi
+ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = x86; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NEO-*:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSE-*:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ echo nsv-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
+ echo nsx-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = 386; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo "$UNAME_MACHINE"-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux"$UNAME_RELEASE"
+ exit ;;
+ *:DragonFly:*:*)
+ echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "$UNAME_MACHINE" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
+ exit ;;
+ i*86:rdos:*:*)
+ echo "$UNAME_MACHINE"-pc-rdos
+ exit ;;
+ i*86:AROS:*:*)
+ echo "$UNAME_MACHINE"-pc-aros
+ exit ;;
+ x86_64:VMkernel:*:*)
+ echo "$UNAME_MACHINE"-unknown-esx
+ exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
+esac
+
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+ ;;
+esac
+
+cat >&2 <<EOF
+
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
+
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+and
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..cd18434
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,324 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* This is dnsdist */
+#undef DNSDIST
+
+/* Define to 1 if you have the `accept4' function. */
+#undef HAVE_ACCEPT4
+
+/* Defined if the requested minimum BOOST version is satisfied */
+#undef HAVE_BOOST
+
+/* Define to 1 if you have <boost/test/unit_test.hpp> */
+#undef HAVE_BOOST_TEST_UNIT_TEST_HPP
+
+/* Defined if the Boost unit_test_framework library is available */
+#undef HAVE_BOOST_UNIT_TEST_FRAMEWORK
+
+/* Define to 1 if you have CDB */
+#undef HAVE_CDB
+
+/* Define to 1 if you have the <cdb.h> header file. */
+#undef HAVE_CDB_H
+
+/* Define to 1 if you have clock_gettime */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the `crypto_box_curve25519xchacha20poly1305_easy'
+ function. */
+#undef HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY
+
+/* Define to 1 if you have the `crypto_box_easy_afternm' function. */
+#undef HAVE_CRYPTO_BOX_EASY_AFTERNM
+
+/* Define to 1 if you have the `CRYPTO_memcmp' function. */
+#undef HAVE_CRYPTO_MEMCMP
+
+/* Define to 1 if you have the `crypto_shorthash' function. */
+#undef HAVE_CRYPTO_SHORTHASH
+
+/* define if the compiler supports basic C++17 syntax */
+#undef HAVE_CXX17
+
+/* Define to 1 if you have the declaration of
+ `h2o_socket_get_ssl_server_name', and to 0 if you don't. */
+#undef HAVE_DECL_H2O_SOCKET_GET_SSL_SERVER_NAME
+
+/* Define to 1 if you have the declaration of `snmp_select_info2', and to 0 if
+ you don't. */
+#undef HAVE_DECL_SNMP_SELECT_INFO2
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you enable dnscrypt support */
+#undef HAVE_DNSCRYPT
+
+/* Define to 1 if you enable DNS over HTTPS support */
+#undef HAVE_DNS_OVER_HTTPS
+
+/* Define to 1 if you enable DNS over TLS support */
+#undef HAVE_DNS_OVER_TLS
+
+/* Define if using eBPF. */
+#undef HAVE_EBPF
+
+/* Define to 1 if you have the `EVP_MD_CTX_free' function. */
+#undef HAVE_EVP_MD_CTX_FREE
+
+/* Define to 1 if you have the `EVP_MD_CTX_new' function. */
+#undef HAVE_EVP_MD_CTX_NEW
+
+/* Define to 1 if you have EVP_PKEY_CTX_set1_scrypt_salt */
+#undef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+
+/* Define to 1 if you have the `explicit_bzero' function. */
+#undef HAVE_EXPLICIT_BZERO
+
+/* Define to 1 if you have the `explicit_memset' function. */
+#undef HAVE_EXPLICIT_MEMSET
+
+/* Define if ASAN fiber annotation interface is available. */
+#undef HAVE_FIBER_SANITIZER
+
+/* Define to 1 if you have libfstrm */
+#undef HAVE_FSTRM
+
+/* Define to 1 if you have the `fstrm_tcp_writer_init' function. */
+#undef HAVE_FSTRM_TCP_WRITER_INIT
+
+/* Define to 1 if you have the `gmtime_r' function. */
+#undef HAVE_GMTIME_R
+
+/* Define to 1 if you have GnuTLS */
+#undef HAVE_GNUTLS
+
+/* Define to 1 if you have the `gnutls_alpn_set_protocols' function. */
+#undef HAVE_GNUTLS_ALPN_SET_PROTOCOLS
+
+/* Define to 1 if you have the `gnutls_memset' function. */
+#undef HAVE_GNUTLS_MEMSET
+
+/* Define to 1 if you have the `gnutls_session_get_verify_cert_status'
+ function. */
+#undef HAVE_GNUTLS_SESSION_GET_VERIFY_CERT_STATUS
+
+/* Define to 1 if you have the `gnutls_session_set_verify_cert' function. */
+#undef HAVE_GNUTLS_SESSION_SET_VERIFY_CERT
+
+/* define to 1 if h2o_socket_get_ssl_server_name is available. */
+#undef HAVE_H2O_SOCKET_GET_SSL_SERVER_NAME
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have libcap */
+#undef HAVE_LIBCAP
+
+/* Define to 1 if you have OpenSSL libcrypto */
+#undef HAVE_LIBCRYPTO
+
+/* Define to 1 if you have libh2o-evloop */
+#undef HAVE_LIBH2OEVLOOP
+
+/* Define to 1 if you have libsodium */
+#undef HAVE_LIBSODIUM
+
+/* Define to 1 if you have OpenSSL libssl */
+#undef HAVE_LIBSSL
+
+/* Define to 1 if you have the <linux/bpf.h> header file. */
+#undef HAVE_LINUX_BPF_H
+
+/* Define to 1 if you have LMDB */
+#undef HAVE_LMDB
+
+/* Define to 1 if you have the <lmdb.h> header file. */
+#undef HAVE_LMDB_H
+
+/* Define to 1 if you have the `localtime_r' function. */
+#undef HAVE_LOCALTIME_R
+
+/* Define to 1 if you have lua */
+#undef HAVE_LUA
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if using Net SNMP. */
+#undef HAVE_NET_SNMP
+
+/* Define to 1 if you have nghttp2 */
+#undef HAVE_NGHTTP2
+
+/* Define to 1 if you have the `OCSP_basic_sign' function. */
+#undef HAVE_OCSP_BASIC_SIGN
+
+/* Define to 1 if you have the `OPENSSL_init_crypto' function. */
+#undef HAVE_OPENSSL_INIT_CRYPTO
+
+/* Define to 1 if you have pthread_getattr_np */
+#undef HAVE_PTHREAD_GETATTR_NP
+
+/* Define to 1 if you have pthread_get_stackaddr_np */
+#undef HAVE_PTHREAD_GET_STACKADDR_NP
+
+/* Define to 1 if you have pthread_get_stacksize_np */
+#undef HAVE_PTHREAD_GET_STACKSIZE_NP
+
+/* Define to 1 if you have the <pthread_np.h> header file. */
+#undef HAVE_PTHREAD_NP_H
+
+/* Define to 1 if you have pthread_setaffinity_np */
+#undef HAVE_PTHREAD_SETAFFINITY_NP
+
+/* 1-arg pthread_setname_np */
+#undef HAVE_PTHREAD_SETNAME_NP_1
+
+/* 2-arg pthread_setname_np */
+#undef HAVE_PTHREAD_SETNAME_NP_2
+
+/* 3-arg pthread_setname_np */
+#undef HAVE_PTHREAD_SETNAME_NP_3
+
+/* 2-arg pthread_set_name_np */
+#undef HAVE_PTHREAD_SET_NAME_NP_2
+
+/* 2-arg void pthread_set_name_np */
+#undef HAVE_PTHREAD_SET_NAME_NP_2_VOID
+
+/* Define to 1 if you have the `randombytes_stir' function. */
+#undef HAVE_RANDOMBYTES_STIR
+
+/* Define to 1 if you have the `RAND_bytes' function. */
+#undef HAVE_RAND_BYTES
+
+/* Define to 1 if you have the `RAND_pseudo_bytes' function. */
+#undef HAVE_RAND_PSEUDO_BYTES
+
+/* Define if using RE2. */
+#undef HAVE_RE2
+
+/* Define to 1 if you have the `recvmmsg' function. */
+#undef HAVE_RECVMMSG
+
+/* Define to 1 if you have the `RSA_get0_key' function. */
+#undef HAVE_RSA_GET0_KEY
+
+/* Define to 1 if you have the <sanitizer/common_interface_defs.h> header
+ file. */
+#undef HAVE_SANITIZER_COMMON_INTERFACE_DEFS_H
+
+/* Define to 1 if __sanitizer_finish_switch_fiber takes only a pointer */
+#undef HAVE_SANITIZER_FINISH_SWITCH_FIBER_SINGLE_PTR
+
+/* Define to 1 if __sanitizer_finish_switch_fiber takes three pointers */
+#undef HAVE_SANITIZER_FINISH_SWITCH_FIBER_THREE_PTRS
+
+/* Define to 1 if you have the `sendmmsg' function. */
+#undef HAVE_SENDMMSG
+
+/* define to 1 if snmp_select_info2 is available. */
+#undef HAVE_SNMP_SELECT_INFO2
+
+/* Define to 1 if you have the `sodium_memcmp' function. */
+#undef HAVE_SODIUM_MEMCMP
+
+/* Define to 1 if you have the `SSL_CTX_get0_privatekey' function. */
+#undef HAVE_SSL_CTX_GET0_PRIVATEKEY
+
+/* Define to 1 if you have the `SSL_CTX_set_alpn_protos' function. */
+#undef HAVE_SSL_CTX_SET_ALPN_PROTOS
+
+/* Define to 1 if you have the `SSL_CTX_set_alpn_select_cb' function. */
+#undef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
+
+/* Define to 1 if you have the `SSL_CTX_set_ciphersuites' function. */
+#undef HAVE_SSL_CTX_SET_CIPHERSUITES
+
+/* Define to 1 if you have the `SSL_CTX_set_keylog_callback' function. */
+#undef HAVE_SSL_CTX_SET_KEYLOG_CALLBACK
+
+/* Define to 1 if you have the `SSL_CTX_set_min_proto_version' function. */
+#undef HAVE_SSL_CTX_SET_MIN_PROTO_VERSION
+
+/* Define to 1 if you have the `SSL_CTX_set_next_proto_select_cb' function. */
+#undef HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
+
+/* Define to 1 if you have the `SSL_CTX_set_num_tickets' function. */
+#undef HAVE_SSL_CTX_SET_NUM_TICKETS
+
+/* Define to 1 if you have the `SSL_get0_alpn_selected' function. */
+#undef HAVE_SSL_GET0_ALPN_SELECTED
+
+/* Define to 1 if you have the `SSL_get0_next_proto_negotiated' function. */
+#undef HAVE_SSL_GET0_NEXT_PROTO_NEGOTIATED
+
+/* Define to 1 if you have the `SSL_set_hostflags' function. */
+#undef HAVE_SSL_SET_HOSTFLAGS
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Systemd available and enabled */
+#undef HAVE_SYSTEMD
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#undef LT_OBJDIR
+
+/* If your OS is so broken that it needs an additional prototype */
+#undef NEED_INET_NTOP_PROTO
+
+/* If POSIX typedefs need to be defined */
+#undef NEED_POSIX_TYPEDEF
+
+/* Name of package */
+#undef PACKAGE
+
+/* Set to the package version used for secpoll */
+#undef PACKAGEVERSION
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The number of bytes in type time_t */
+#undef SIZEOF_TIME_T
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..9ccf09a
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1801 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright 1992-2018 Free Software Foundation, Inc.
+
+timestamp='2018-03-08'
+
+# This file 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 <https://www.gnu.org/licenses/>.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+
+
+# Please send patches to <config-patches@gnu.org>.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
+
+Canonicalize a configuration name.
+
+Options:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2018 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo "$1"
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+ kopensolaris*-gnu* | cloudabi*-eabi* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ android-linux)
+ os=-linux-android
+ basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ ;;
+ *)
+ basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
+ if [ "$basic_machine" != "$1" ]
+ then os=`echo "$1" | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray | -microblaze*)
+ os=
+ basic_machine=$1
+ ;;
+ -bluegene*)
+ os=-cnk
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*178)
+ os=-lynxos178
+ ;;
+ -lynx*5)
+ os=-lynxos5
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | ba \
+ | be32 | be64 \
+ | bfin \
+ | c4x | c8051 | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | epiphany \
+ | fido | fr30 | frv | ft32 \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nios | nios2 | nios2eb | nios2el \
+ | ns16k | ns32k \
+ | open8 | or1k | or1knd | or32 \
+ | pdp10 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pru \
+ | pyramid \
+ | riscv32 | riscv64 \
+ | rl78 | rx \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu \
+ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+ | ubicom32 \
+ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | visium \
+ | wasm32 \
+ | x86 | xc16x | xstormy16 | xtensa \
+ | z8k | z80)
+ basic_machine=$basic_machine-unknown
+ ;;
+ c54x)
+ basic_machine=tic54x-unknown
+ ;;
+ c55x)
+ basic_machine=tic55x-unknown
+ ;;
+ c6x)
+ basic_machine=tic6x-unknown
+ ;;
+ leon|leon[3-9])
+ basic_machine=sparc-$basic_machine
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ strongarm | thumb | xscale)
+ basic_machine=arm-unknown
+ ;;
+ xgate)
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ xscaleeb)
+ basic_machine=armeb-unknown
+ ;;
+
+ xscaleel)
+ basic_machine=armel-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | aarch64-* | aarch64_be-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | ba-* \
+ | be32-* | be64-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | e2k-* | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | hexagon-* \
+ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | k1om-* \
+ | le32-* | le64-* \
+ | lm32-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64octeon-* | mips64octeonel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64r5900-* | mips64r5900el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa32r6-* | mipsisa32r6el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64r6-* | mipsisa64r6el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nds32-* | nds32le-* | nds32be-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | open8-* \
+ | or1k*-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pru-* \
+ | pyramid-* \
+ | riscv32-* | riscv64-* \
+ | rl78-* | romp-* | rs6000-* | rx-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
+ | tahoe-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tile*-* \
+ | tron-* \
+ | ubicom32-* \
+ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+ | vax-* \
+ | visium-* \
+ | wasm32-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-* | z80-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-pc
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ os=-aros
+ ;;
+ asmjs)
+ basic_machine=asmjs-unknown
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ bluegene*)
+ basic_machine=powerpc-ibm
+ os=-cnk
+ ;;
+ c54x-*)
+ basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ c55x-*)
+ basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ c6x-*)
+ basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ os=-cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16 | cr16-*)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ os=-dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2*)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ e500v[12])
+ basic_machine=powerpc-unknown
+ os=$os"spe"
+ ;;
+ e500v[12]-*)
+ basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=$os"spe"
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+ i*86v32)
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ leon-*|leon[3-9]-*)
+ basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ microblaze*)
+ basic_machine=microblaze-xilinx
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
+ ;;
+ msys)
+ basic_machine=i686-pc
+ os=-msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ os=-nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next)
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ neo-tandem)
+ basic_machine=neo-tandem
+ ;;
+ nse-tandem)
+ basic_machine=nse-tandem
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ nsv-tandem)
+ basic_machine=nsv-tandem
+ ;;
+ nsx-tandem)
+ basic_machine=nsx-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc | ppcbe) basic_machine=powerpc-unknown
+ ;;
+ ppc-* | ppcbe-*)
+ basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ strongarm-* | thumb-*)
+ basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tile*)
+ basic_machine=$basic_machine-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ x64)
+ basic_machine=x86_64-pc
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ xscale-* | xscalee[bl]-*)
+ basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases that might get confused
+ # with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -auroraux)
+ os=-auroraux
+ ;;
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # es1800 is here to avoid being matched by es* (a different OS)
+ -es1800*)
+ os=-ose
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+ | -sym* | -kopensolaris* | -plan9* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* | -aros* | -cloudabi* | -sortix* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
+ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
+ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
+ | -midnightbsd*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -xray | -os68k* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo "$os" | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2)
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -dicos*)
+ os=-dicos
+ ;;
+ -pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
+ # configurations are quite functional.
+ case $basic_machine in
+ arm*)
+ os=-eabi
+ ;;
+ *)
+ os=-elf
+ ;;
+ esac
+ ;;
+ -nacl*)
+ ;;
+ -ios)
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ c8051-*)
+ os=-elf
+ ;;
+ hexagon-*)
+ os=-elf
+ ;;
+ tic54x-*)
+ os=-coff
+ ;;
+ tic55x-*)
+ os=-coff
+ ;;
+ tic6x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ pru-*)
+ os=-elf
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next)
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -cnk*|-aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo "$basic_machine$os"
+exit
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure b/configure
new file mode 100755
index 0000000..9c311fb
--- /dev/null
+++ b/configure
@@ -0,0 +1,27370 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for dnsdist 1.7.3.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
+if test "x$CONFIG_SHELL" = x; then
+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+"
+ as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+ exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+ test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+ if (eval "$as_required") 2>/dev/null; then :
+ as_have_required=yes
+else
+ as_have_required=no
+fi
+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ as_found=:
+ case $as_dir in #(
+ /*)
+ for as_base in sh bash ksh sh5; do
+ # Try only shells that exist, to save several forks.
+ as_shell=$as_dir/$as_base
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ CONFIG_SHELL=$as_shell as_have_required=yes
+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+ break 2
+fi
+fi
+ done;;
+ esac
+ as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+ CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+ if test "x$CONFIG_SHELL" != x; then :
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
+fi
+
+ if test x$as_have_required = xno; then :
+ $as_echo "$0: This script requires a shell more modern than all"
+ $as_echo "$0: the shells that I found on your system."
+ if test x${ZSH_VERSION+set} = xset ; then
+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+ $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+ else
+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+ fi
+ exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+ as_lineno_1=$LINENO as_lineno_1a=$LINENO
+ as_lineno_2=$LINENO as_lineno_2a=$LINENO
+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
+ sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
+ N
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ t loop
+ s/-\n.*//
+ ' >$as_me.lineno &&
+ chmod +x "$as_me.lineno" ||
+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
+ # Exit status is that of the last command.
+ exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='dnsdist'
+PACKAGE_TARNAME='dnsdist'
+PACKAGE_VERSION='1.7.3'
+PACKAGE_STRING='dnsdist 1.7.3'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_func_list=
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+PACKAGEVERSION
+AM_CPPFLAGS
+PROGRAM_LDFLAGS
+HAVE_MANPAGES_FALSE
+HAVE_MANPAGES_TRUE
+HAVE_VENV_FALSE
+HAVE_VENV_TRUE
+pkgpyexecdir
+pyexecdir
+pkgpythondir
+pythondir
+PYTHON_PLATFORM
+PYTHON_EXEC_PREFIX
+PYTHON_PREFIX
+PYTHON_VERSION
+PYTHON
+WARN_CFLAGS
+SANITIZER_FLAGS
+RELRO_LDFLAGS
+PIE_LDFLAGS
+PIE_CFLAGS
+HAVE_CXX17
+LMDB_LIBS
+LMDB_CFLAGS
+CDB_LIBS
+CDB_CFLAGS
+HAVE_NGHTTP2_FALSE
+HAVE_NGHTTP2_TRUE
+NGHTTP2_LIBS
+NGHTTP2_CFLAGS
+HAVE_LIBH2OEVLOOP_FALSE
+HAVE_LIBH2OEVLOOP_TRUE
+LIBH2OEVLOOP_LIBS
+LIBH2OEVLOOP_CFLAGS
+GNUTLS_LIBS
+GNUTLS_CFLAGS
+LIBSSL_LIBS
+LIBSSL_CFLAGS
+HAVE_DNS_OVER_HTTPS_FALSE
+HAVE_DNS_OVER_HTTPS_TRUE
+HAVE_DNS_OVER_TLS_FALSE
+HAVE_DNS_OVER_TLS_TRUE
+HAVE_LIBCRYPTO_FALSE
+HAVE_LIBCRYPTO_TRUE
+LIBCRYPTO_LDFLAGS
+LIBCRYPTO_LIBS
+LIBCRYPTO_INCLUDES
+HAVE_CDB_FALSE
+HAVE_CDB_TRUE
+HAVE_LMDB_FALSE
+HAVE_LMDB_TRUE
+HAVE_LIBSSL_FALSE
+HAVE_LIBSSL_TRUE
+HAVE_GNUTLS_FALSE
+HAVE_GNUTLS_TRUE
+HAVE_LUA_HPP_FALSE
+HAVE_LUA_HPP_TRUE
+LUA_FALSE
+LUA_TRUE
+LUA_LIBS
+LUA_CFLAGS
+IPCRYPT_LIBS
+IPCRYPT_CFLAGS
+YAHTTP_LIBS
+YAHTTP_CFLAGS
+service_group
+service_user
+HAVE_SYSTEMD_FALSE
+HAVE_SYSTEMD_TRUE
+HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV_FALSE
+HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV_TRUE
+HAVE_SYSTEMD_SYSTEM_CALL_FILTER_FALSE
+HAVE_SYSTEMD_SYSTEM_CALL_FILTER_TRUE
+HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES_FALSE
+HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES_TRUE
+HAVE_SYSTEMD_RESTRICT_SUIDSGID_FALSE
+HAVE_SYSTEMD_RESTRICT_SUIDSGID_TRUE
+HAVE_SYSTEMD_RESTRICT_REALTIME_FALSE
+HAVE_SYSTEMD_RESTRICT_REALTIME_TRUE
+HAVE_SYSTEMD_RESTRICT_NAMESPACES_FALSE
+HAVE_SYSTEMD_RESTRICT_NAMESPACES_TRUE
+HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES_FALSE
+HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES_TRUE
+HAVE_SYSTEMD_REMOVE_IPC_FALSE
+HAVE_SYSTEMD_REMOVE_IPC_TRUE
+HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT_FALSE
+HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT_TRUE
+HAVE_SYSTEMD_PROTECT_SYSTEM_FALSE
+HAVE_SYSTEMD_PROTECT_SYSTEM_TRUE
+HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES_FALSE
+HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES_TRUE
+HAVE_SYSTEMD_PROTECT_KERNEL_MODULES_FALSE
+HAVE_SYSTEMD_PROTECT_KERNEL_MODULES_TRUE
+HAVE_SYSTEMD_PROTECT_KERNEL_LOGS_FALSE
+HAVE_SYSTEMD_PROTECT_KERNEL_LOGS_TRUE
+HAVE_SYSTEMD_PROTECT_HOSTNAME_FALSE
+HAVE_SYSTEMD_PROTECT_HOSTNAME_TRUE
+HAVE_SYSTEMD_PROTECT_HOME_FALSE
+HAVE_SYSTEMD_PROTECT_HOME_TRUE
+HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS_FALSE
+HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS_TRUE
+HAVE_SYSTEMD_PROTECT_CLOCK_FALSE
+HAVE_SYSTEMD_PROTECT_CLOCK_TRUE
+HAVE_SYSTEMD_PRIVATE_USERS_FALSE
+HAVE_SYSTEMD_PRIVATE_USERS_TRUE
+HAVE_SYSTEMD_PRIVATE_TMP_FALSE
+HAVE_SYSTEMD_PRIVATE_TMP_TRUE
+HAVE_SYSTEMD_PRIVATE_MOUNTS_FALSE
+HAVE_SYSTEMD_PRIVATE_MOUNTS_TRUE
+HAVE_SYSTEMD_PRIVATE_DEVICES_FALSE
+HAVE_SYSTEMD_PRIVATE_DEVICES_TRUE
+HAVE_SYSTEMD_PERCENT_T_FALSE
+HAVE_SYSTEMD_PERCENT_T_TRUE
+HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE_FALSE
+HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE_TRUE
+HAVE_SYSTEMD_LOCK_PERSONALITY_FALSE
+HAVE_SYSTEMD_LOCK_PERSONALITY_TRUE
+HAVE_SYSTEMD_DYNAMIC_USER_FALSE
+HAVE_SYSTEMD_DYNAMIC_USER_TRUE
+SYSTEMCTL
+SYSTEMD_LIBS
+SYSTEMD_CFLAGS
+SYSTEMD_MODULES_LOAD
+SYSTEMD_DIR
+systemd
+HAVE_LIBCAP_FALSE
+HAVE_LIBCAP_TRUE
+LIBCAP_LIBS
+LIBCAP_CFLAGS
+HAVE_NET_SNMP_FALSE
+HAVE_NET_SNMP_TRUE
+NET_SNMP_LIBS
+NET_SNMP_CFLAGS
+HAVE_EBPF_FALSE
+HAVE_EBPF_TRUE
+DNSCRYPT_FALSE
+DNSCRYPT_TRUE
+HAVE_RE2_FALSE
+HAVE_RE2_TRUE
+RE2_LIBS
+RE2_CFLAGS
+BOOST_UNIT_TEST_FRAMEWORK_LIBS
+BOOST_LDPATH
+BOOST_UNIT_TEST_FRAMEWORK_LDPATH
+BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS
+UNIT_TESTS_FALSE
+UNIT_TESTS_TRUE
+BOOST_CPPFLAGS
+DISTCHECK_CONFIGURE_FLAGS
+BOOST_ROOT
+DYNLINKFLAGS
+THREADFLAGS
+HAVE_SOLARIS_FALSE
+HAVE_SOLARIS_TRUE
+HAVE_DARWIN_FALSE
+HAVE_DARWIN_TRUE
+HAVE_LINUX_FALSE
+HAVE_LINUX_TRUE
+HAVE_OPENBSD_FALSE
+HAVE_OPENBSD_TRUE
+HAVE_FREEBSD_FALSE
+HAVE_FREEBSD_TRUE
+RT_LIBS
+LIBEDIT_LIBS
+LIBEDIT_CFLAGS
+RAGEL
+FSTRM_FALSE
+FSTRM_TRUE
+FSTRM_LIBS
+FSTRM_CFLAGS
+LIBSODIUM_FALSE
+LIBSODIUM_TRUE
+LIBSODIUM_LIBS
+LIBSODIUM_CFLAGS
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
+PKG_CONFIG
+CXXCPP
+CPP
+LT_SYS_LIBRARY_PATH
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+LIBTOOL
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+runstatedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL
+am__quote'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_silent_rules
+enable_dependency_tracking
+enable_static
+enable_shared
+with_pic
+enable_fast_install
+with_aix_soname
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+with_libsodium
+enable_dnstap
+with_boost
+enable_unit_tests
+enable_static_boost
+with_re2
+enable_dnscrypt
+with_ebpf
+with_net_snmp
+with_libcap
+enable_systemd
+with_systemd
+with_service_user
+with_service_group
+with_lua
+with_libcrypto
+enable_dns_over_tls
+enable_dns_over_https
+with_libssl
+with_gnutls
+with_nghttp2
+with_lmdb
+enable_hardening
+enable_asan
+enable_msan
+enable_tsan
+enable_lsan
+enable_ubsan
+'
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CXX
+CXXFLAGS
+CCC
+LT_SYS_LIBRARY_PATH
+CPP
+CXXCPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR
+LIBSODIUM_CFLAGS
+LIBSODIUM_LIBS
+FSTRM_CFLAGS
+FSTRM_LIBS
+LIBEDIT_CFLAGS
+LIBEDIT_LIBS
+BOOST_ROOT
+RE2_CFLAGS
+RE2_LIBS
+LIBCAP_CFLAGS
+LIBCAP_LIBS
+SYSTEMD_CFLAGS
+SYSTEMD_LIBS
+LUA_CFLAGS
+LUA_LIBS
+LIBSSL_CFLAGS
+LIBSSL_LIBS
+GNUTLS_CFLAGS
+GNUTLS_LIBS
+LIBH2OEVLOOP_CFLAGS
+LIBH2OEVLOOP_LIBS
+NGHTTP2_CFLAGS
+NGHTTP2_LIBS
+CDB_CFLAGS
+CDB_LIBS
+LMDB_CFLAGS
+LMDB_LIBS
+PYTHON
+PACKAGEVERSION'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval $ac_prev=\$ac_option
+ ac_prev=
+ continue
+ fi
+
+ case $ac_option in
+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *=) ac_optarg= ;;
+ *) ac_optarg=yes ;;
+ esac
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ datadir=$ac_optarg ;;
+
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
+
+ -enable-* | --enable-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid feature name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"enable_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval enable_$ac_useropt=\$ac_optarg ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst | --locals)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=\$ac_optarg ;;
+
+ -without-* | --without-*)
+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+ as_fn_error $? "invalid package name: $ac_useropt"
+ ac_useropt_orig=$ac_useropt
+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+ case $ac_user_opts in
+ *"
+"with_$ac_useropt"
+"*) ;;
+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+ ac_unrecognized_sep=', ';;
+ esac
+ eval with_$ac_useropt=no ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ case $ac_envvar in #(
+ '' | [0-9]* | *[!_$as_cr_alnum]* )
+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+ esac
+ eval $ac_envvar=\$ac_optarg
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+ case $enable_option_checking in
+ no) ;;
+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+ esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir runstatedir
+do
+ eval ac_val=\$$ac_var
+ # Remove trailing slashes.
+ case $ac_val in
+ */ )
+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+ eval $ac_var=\$ac_val;;
+ esac
+ # Be sure to have absolute directory names.
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ esac
+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_myself" : 'X\(//\)[^/]' \| \
+ X"$as_myself" : 'X\(//\)$' \| \
+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r "$srcdir/$ac_unique_file"; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures dnsdist 1.7.3 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking ...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/dnsdist]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of dnsdist 1.7.3:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-option-checking ignore unrecognized --enable/--with options
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --enable-static[=PKGS] build static libraries [default=no]
+ --enable-shared[=PKGS] build shared libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-dnstap enable dnstap support [default=auto]
+ --enable-unit-tests enable unit test building [default=no]
+ --enable-static-boost Prefer the static boost libraries over the shared
+ ones [no]
+ --enable-dnscrypt enable DNSCrypt support (requires libsodium)
+ [default=no]
+ --enable-systemd Enable systemd support (default is DISABLED, but
+ will be enabled when libraries are found)
+ --enable-dns-over-tls enable DNS over TLS support (requires GnuTLS or
+ OpenSSL) [default=no]
+ --enable-dns-over-https enable incoming DNS over HTTPS (DoH) support
+ (requires libh2o) [default=no]
+ --disable-hardening disable compiler security checks [default=no]
+ --enable-asan enable AddressSanitizer [default=no]
+ --enable-msan enable MemorySanitizer [default=no]
+ --enable-tsan enable ThreadSanitizer [default=no]
+ --enable-lsan enable LeakSanitizer [default=no]
+ --enable-ubsan enable Undefined Behaviour Sanitizer [default=no]
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-aix-soname=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX, [default=aix].
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
+ compiler's sysroot if not specified).
+ --with-libsodium use libsodium [default=auto]
+ --with-boost=DIR prefix of Boost 1.42 [guess]
+ --with-re2 with libre2 [default=no]
+ --with-ebpf enable eBPF support [default=auto]
+ --with-net-snmp enable net snmp support [default=auto]
+ --with-libcap use libcap [default=auto]
+ --with-systemd set directory for systemd service files
+ --with-systemd-modules-load set directory for systemd modules load files
+ --with-service-user User to use by service when running the service
+ [default=dnsdist]. Only the setuid setting and User
+ in the systemd unit file are affected, the user is
+ not created.
+ --with-service-group Group to use by service when running the service
+ [default=dnsdist]. Only the setgid setting and Group
+ in the systemd unit file are affected, the group is
+ not created.
+ --with-lua select Lua implementation [default=auto]
+
+ --with-libcrypto=DIR root of the OpenSSL directory
+ --with-libssl use OpenSSL libssl [default=auto]
+ --with-gnutls use GnuTLS [default=auto]
+ --with-nghttp2 use nghttp2 [default=auto]
+ --with-lmdb lmdb library to use [default=auto]
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ LT_SYS_LIBRARY_PATH
+ User-defined run-time library search path.
+ CPP C preprocessor
+ CXXCPP C++ preprocessor
+ PKG_CONFIG path to pkg-config utility
+ PKG_CONFIG_PATH
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
+ LIBSODIUM_CFLAGS
+ C compiler flags for LIBSODIUM, overriding pkg-config
+ LIBSODIUM_LIBS
+ linker flags for LIBSODIUM, overriding pkg-config
+ FSTRM_CFLAGS
+ C compiler flags for FSTRM, overriding pkg-config
+ FSTRM_LIBS linker flags for FSTRM, overriding pkg-config
+ LIBEDIT_CFLAGS
+ C compiler flags for LIBEDIT, overriding pkg-config
+ LIBEDIT_LIBS
+ linker flags for LIBEDIT, overriding pkg-config
+ BOOST_ROOT Location of Boost installation
+ RE2_CFLAGS C compiler flags for RE2, overriding pkg-config
+ RE2_LIBS linker flags for RE2, overriding pkg-config
+ LIBCAP_CFLAGS
+ C compiler flags for LIBCAP, overriding pkg-config
+ LIBCAP_LIBS linker flags for LIBCAP, overriding pkg-config
+ SYSTEMD_CFLAGS
+ C compiler flags for SYSTEMD, overriding pkg-config
+ SYSTEMD_LIBS
+ linker flags for SYSTEMD, overriding pkg-config
+ LUA_CFLAGS C compiler flags for LUA, overriding pkg-config
+ LUA_LIBS linker flags for LUA, overriding pkg-config
+ LIBSSL_CFLAGS
+ C compiler flags for LIBSSL, overriding pkg-config
+ LIBSSL_LIBS linker flags for LIBSSL, overriding pkg-config
+ GNUTLS_CFLAGS
+ C compiler flags for GNUTLS, overriding pkg-config
+ GNUTLS_LIBS linker flags for GNUTLS, overriding pkg-config
+ LIBH2OEVLOOP_CFLAGS
+ C compiler flags for LIBH2OEVLOOP, overriding pkg-config
+ LIBH2OEVLOOP_LIBS
+ linker flags for LIBH2OEVLOOP, overriding pkg-config
+ NGHTTP2_CFLAGS
+ C compiler flags for NGHTTP2, overriding pkg-config
+ NGHTTP2_LIBS
+ linker flags for NGHTTP2, overriding pkg-config
+ CDB_CFLAGS C compiler flags for CDB, overriding pkg-config
+ CDB_LIBS linker flags for CDB, overriding pkg-config
+ LMDB_CFLAGS C compiler flags for LMDB, overriding pkg-config
+ LMDB_LIBS linker flags for LMDB, overriding pkg-config
+ PYTHON the Python interpreter
+ PACKAGEVERSION
+ The version used in secpoll queries
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d "$ac_dir" ||
+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+ continue
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
+ else
+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
+ done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+ cat <<\_ACEOF
+dnsdist configure 1.7.3
+generated by GNU Autoconf 2.69
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext
+ if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=$ac_status
+fi
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } > conftest.i && {
+ test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }; then :
+ ac_retval=0
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
+# ac_fn_cxx_check_func LINENO FUNC VAR
+# ------------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_cxx_check_func ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $2 (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_func
+
+# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES
+# ---------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_cxx_check_header_compile ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_header_compile
+
+# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES
+# ---------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_cxx_check_header_mongrel ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ if eval \${$3+:} false; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+ # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_header_compiler=yes
+else
+ ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <$2>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ ac_header_preproc=yes
+else
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #((
+ yes:no: )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+ no:yes:* )
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+ ;;
+esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_header_mongrel
+
+# ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES
+# -----------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_cxx_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_cxx_check_decl
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by dnsdist $as_me 1.7.3, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ $as_echo "PATH: $as_dir"
+ done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *\'*)
+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+ 2)
+ as_fn_append ac_configure_args1 " '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ as_fn_append ac_configure_args " '$ac_arg'"
+ ;;
+ esac
+ done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+ (set) 2>&1 |
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ sed -n \
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
+ *)
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+)
+ echo
+
+ $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ $as_echo "$ac_var='\''$ac_val'\''"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+ echo
+ cat confdefs.h
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ $as_echo "$as_me: caught signal $ac_signal"
+ $as_echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+ # We do not want a PATH search for config.site.
+ case $CONFIG_SITE in #((
+ -*) ac_site_file1=./$CONFIG_SITE;;
+ */*) ac_site_file1=$CONFIG_SITE;;
+ *) ac_site_file1=./$CONFIG_SITE;;
+ esac
+elif test "x$prefix" != xNONE; then
+ ac_site_file1=$prefix/share/config.site
+ ac_site_file2=$prefix/etc/config.site
+else
+ ac_site_file1=$ac_default_prefix/share/config.site
+ ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+ test "x$ac_site_file" = xNONE && continue
+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file" \
+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special files
+ # actually), so we avoid doing that. DJGPP emulates it as a regular file.
+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
+ esac
+ fi
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+as_fn_append ac_func_list " localtime_r"
+as_fn_append ac_func_list " gmtime_r"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ # differences in whitespace do not lead to failure.
+ ac_old_val_w=`echo x $ac_old_val`
+ ac_new_val_w=`echo x $ac_new_val`
+ if test "$ac_old_val_w" != "$ac_new_val_w"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ ac_cache_corrupted=:
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+ eval $ac_var=\$ac_old_val
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+am__api_version='1.16'
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f "$ac_dir/install.sh"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f "$ac_dir/shtool"; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+ ./ | .// | /[cC]/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ rm -rf conftest.one conftest.two conftest.dir
+ echo one > conftest.one
+ echo two > conftest.two
+ mkdir conftest.dir
+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+ test -s conftest.one && test -s conftest.two &&
+ test -s conftest.dir/conftest.one &&
+ test -s conftest.dir/conftest.two
+ then
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+
+ done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ INSTALL=$ac_install_sh
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name. Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+ *[\\\"\#\$\&\'\`$am_lf]*)
+ as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+ *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+ *)
+ MISSING="\${SHELL} $am_aux_dir/missing" ;;
+ esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
+else
+ am_missing_run=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+ case $am_aux_dir in
+ *\ * | *\ *)
+ install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+ *)
+ install_sh="\${SHELL} $am_aux_dir/install-sh"
+ esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+ if ${ac_cv_path_mkdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+ done
+IFS=$as_save_IFS
+
+fi
+
+ test -d ./--version && rmdir ./--version
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
+ else
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ MKDIR_P="$ac_install_sh -d"
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ SET_MAKE=
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+ fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='dnsdist'
+ VERSION='1.7.3'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target (and possibly the TAP driver). The
+# system "awk" is bad on some platforms.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar plaintar pax cpio none'
+
+# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5
+$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; }
+ if test $am_uid -le $am_max_uid; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ _am_tools=none
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5
+$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; }
+ if test $am_gid -le $am_max_gid; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ _am_tools=none
+ fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5
+$as_echo_n "checking how to create a ustar tar archive... " >&6; }
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_ustar-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ { echo "$as_me:$LINENO: $_am_tar --version" >&5
+ ($_am_tar --version) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && break
+ done
+ am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=ustar -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x ustar -w "$$tardir"'
+ am__tar_='pax -L -x ustar -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H ustar -L'
+ am__tar_='find "$tardir" -print | cpio -o -H ustar -L'
+ am__untar='cpio -i -H ustar -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_ustar}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5
+ (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ { echo "$as_me:$LINENO: $am__untar <conftest.tar" >&5
+ ($am__untar <conftest.tar) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ { echo "$as_me:$LINENO: cat conftest.dir/file" >&5
+ (cat conftest.dir/file) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
+ rm -rf conftest.dir
+
+ if ${am_cv_prog_tar_ustar+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_prog_tar_ustar=$_am_tool
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5
+$as_echo "$am_cv_prog_tar_ustar" >&6; }
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
+
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=0;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
+
+ac_config_headers="$ac_config_headers config.h"
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link_default") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
+ break;;
+ * )
+ break;;
+ esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+ ac_file=''
+fi
+if test -z "$ac_file"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+ { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if { ac_try='./conftest$ac_cv_exeext'
+ { { case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compile") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then :
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
+am__doit:
+ @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ case $?:`cat confinc.out 2>/dev/null` in #(
+ '0:this is the am__doit target') :
+ case $s in #(
+ BSD) :
+ am__include='.include' am__quote='"' ;; #(
+ *) :
+ am__include='include' am__quote='' ;;
+esac ;; #(
+ *) :
+ ;;
+esac
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+ if test -n "$CCC"; then
+ CXX=$CCC
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CXX" && break
+done
+
+ if test "x$ac_ct_CXX" = x; then
+ CXX="g++"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CXX=$ac_ct_CXX
+ fi
+fi
+
+ fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GXX=yes
+else
+ GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+ ac_cxx_werror_flag=yes
+ ac_cv_prog_cxx_g=no
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+else
+ CXXFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+ CXXFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ am__universal=false
+ case " $depcc " in #(
+ *\ -arch\ *\ -arch\ *) am__universal=true ;;
+ esac
+
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
+ am__obj=sub/conftest.${OBJEXT-o}
+ am__minus_obj="-o $am__obj"
+ case $depmode in
+ gcc)
+ # This depmode causes a compiler race in universal mode.
+ test "$am__universal" = false || continue
+ ;;
+ nosideeffect)
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
+ # not run yet. These depmodes are late enough in the game, and
+ # so weak that their functioning should not be impacted.
+ am__obj=conftest.${OBJEXT-o}
+ am__minus_obj=
+ ;;
+ none) break ;;
+ esac
+ if depmode=$depmode \
+ source=sub/conftest.c object=$am__obj \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5
+$as_echo_n "checking size of time_t... " >&6; }
+if ${ac_cv_sizeof_time_t+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ac_size in 4 8 1 2 16 ; do # List sizes in rough order of prevalence.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <sys/types.h>
+
+
+int
+main ()
+{
+switch (0) case 0: case (sizeof (time_t) == $ac_size):;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_cv_sizeof_time_t=$ac_size
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ if test x$ac_cv_sizeof_time_t != x ; then break; fi
+done
+
+fi
+
+if test x$ac_cv_sizeof_time_t = x ; then
+ as_fn_error $? "cannot determine a size for time_t" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5
+$as_echo "$ac_cv_sizeof_time_t" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
+_ACEOF
+
+
+if test $ac_size -lt 8; then :
+ as_fn_error $? "size of time_t is $ac_size, which is not large enough to fix the y2k38 bug" "$LINENO" 5
+fi
+
+ typename=`echo time_t | sed "s/[^a-zA-Z0-9_]/_/g"`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time_t is signed" >&5
+$as_echo_n "checking whether time_t is signed... " >&6; }
+if eval \${ax_cv_decl_${typename}_signed+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/types.h>
+
+int
+main ()
+{
+ int foo [ 1 - 2 * !(((time_t) -1) < 0) ]
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval "ax_cv_decl_${typename}_signed=\"yes\""
+else
+ eval "ax_cv_decl_${typename}_signed=\"no\""
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+eval ac_res=\$ax_cv_decl_${typename}_signed
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ symbolname=`echo time_t | sed "s/[^a-zA-Z0-9_]/_/g" | tr "a-z" "A-Z"`
+ if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then
+ :
+ elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then
+ as_fn_error $? "time_t is unsigned, PowerDNS code relies on it being signed" "$LINENO" 5
+ fi
+
+
+
+
+$as_echo "#define DNSDIST 1" >>confdefs.h
+
+
+
+case `pwd` in
+ *\ * | *\ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.6'
+macro_revision='2.4.6'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO ""
+}
+
+case $ECHO in
+ printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+ print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+ *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for ac_i in 1 2 3 4 5 6 7; do
+ ac_script="$ac_script$as_nl$ac_script"
+ done
+ echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+ { ac_script=; unset ac_script;}
+ if test -z "$SED"; then
+ ac_path_SED_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+ # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo '' >> "conftest.nl"
+ "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_SED_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_SED="$ac_path_SED"
+ ac_path_SED_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_SED_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_SED"; then
+ as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+ fi
+else
+ ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+ rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ if test -z "$EGREP"; then
+ ac_path_EGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_EGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_EGREP"; then
+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_EGREP=$EGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+ then ac_cv_path_FGREP="$GREP -F"
+ else
+ if test -z "$FGREP"; then
+ ac_path_FGREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in fgrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_FGREP" || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+ # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'FGREP' >> "conftest.nl"
+ "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_FGREP="$ac_path_FGREP"
+ ac_path_FGREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_FGREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_FGREP"; then
+ as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_FGREP=$FGREP
+fi
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test yes = "$GCC"; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return, which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD=$ac_prog
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test yes = "$with_gnu_ld"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD=$ac_dir/$ac_prog
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test no != "$with_gnu_ld" && break
+ ;;
+ *)
+ test yes != "$with_gnu_ld" && break
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+else
+ lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi
+fi
+
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM=$NM
+else
+ lt_nm_to_check=${ac_tool_prefix}nm
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/$lt_tmp_nm
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+ case $build_os in
+ mingw*) lt_bad_file=conftest.nm/nofile ;;
+ *) lt_bad_file=/dev/null ;;
+ esac
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ *$lt_bad_file* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break 2
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break 2
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+ done
+ : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in dumpbin "link -dump"
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DUMPBIN"; then
+ ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$DUMPBIN" && break
+ done
+fi
+if test -z "$DUMPBIN"; then
+ ac_ct_DUMPBIN=$DUMPBIN
+ for ac_prog in dumpbin "link -dump"
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DUMPBIN"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_DUMPBIN" && break
+done
+
+ if test "x$ac_ct_DUMPBIN" = x; then
+ DUMPBIN=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DUMPBIN=$ac_ct_DUMPBIN
+ fi
+fi
+
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols -headers"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
+ fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&5
+ (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+ cat conftest.out >&5
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ i=0
+ teststring=ABCD
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test 17 != "$i" # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+
+fi
+
+if test -n "$lt_cv_sys_max_cmd_len"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test yes != "$GCC"; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OBJDUMP" = x; then
+ OBJDUMP="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OBJDUMP=$ac_ct_OBJDUMP
+ fi
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[3-9]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$AR" && break
+ done
+fi
+if test -z "$AR"; then
+ ac_ct_AR=$AR
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_AR" && break
+done
+
+ if test "x$ac_ct_AR" = x; then
+ AR="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ AR=$ac_ct_AR
+ fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test 0 -eq "$ac_status"; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test 0 -ne "$ac_status"; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test no = "$lt_cv_ar_at_file"; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_RANLIB" = x; then
+ RANLIB=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ RANLIB=$ac_ct_RANLIB
+ fi
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ bitrig* | openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*)
+ if test ia64 = "$host_cpu"; then
+ symcode='[ABCDEGRST]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function,
+ # D for any global variable and I for any imported variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK '"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+ (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS=conftstm.$ac_objext
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test yes = "$pipe_works"; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+$as_echo_n "checking for a working dd... " >&6; }
+if ${ac_cv_path_lt_DD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+if test -z "$lt_DD"; then
+ ac_path_lt_DD_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in dd; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_lt_DD" || continue
+if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi
+ $ac_path_lt_DD_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_lt_DD"; then
+ :
+ fi
+else
+ ac_cv_path_lt_DD=$lt_DD
+fi
+
+rm -f conftest.i conftest2.i conftest.out
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+$as_echo "$ac_cv_path_lt_DD" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+$as_echo_n "checking how to truncate binary pipes... " >&6; }
+if ${lt_cv_truncate_bin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+$as_echo "$lt_cv_truncate_bin" >&6; }
+
+
+
+
+
+
+
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+ enableval=$enable_libtool_lock;
+fi
+
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE=32
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE=64
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ emul=elf
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
+ ;;
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -belf"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_cc_needs_belf=yes
+else
+ lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+ if test yes != "$lt_cv_cc_needs_belf"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS=$SAVE_CFLAGS
+ fi
+ ;;
+*-*solaris*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*|x86_64-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD=${LD-ld}_sol2
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks=$enable_libtool_lock
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test yes != "$lt_cv_path_mainfest_tool"; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DSYMUTIL" = x; then
+ DSYMUTIL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DSYMUTIL=$ac_ct_DSYMUTIL
+ fi
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_NMEDIT" = x; then
+ NMEDIT=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ NMEDIT=$ac_ct_NMEDIT
+ fi
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$LIPO"; then
+ ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+ ac_ct_LIPO=$LIPO
+ # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_LIPO"; then
+ ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_LIPO="lipo"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_LIPO" = x; then
+ LIPO=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ LIPO=$ac_ct_LIPO
+ fi
+else
+ LIPO="$ac_cv_prog_LIPO"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL"; then
+ ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+ ac_ct_OTOOL=$OTOOL
+ # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL"; then
+ ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL="otool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL" = x; then
+ OTOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL=$ac_ct_OTOOL
+ fi
+else
+ OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$OTOOL64"; then
+ ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+ ac_ct_OTOOL64=$OTOOL64
+ # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_OTOOL64"; then
+ ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OTOOL64="otool64"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_OTOOL64" = x; then
+ OTOOL64=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ OTOOL64=$ac_ct_OTOOL64
+ fi
+else
+ OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "$LT_MULTI_MODULE"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&5
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_ld_exported_symbols_list=yes
+else
+ lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+ echo "$AR cru libconftest.a conftest.o" >&5
+ $AR cru libconftest.a conftest.o 2>&5
+ echo "$RANLIB libconftest.a" >&5
+ $RANLIB libconftest.a 2>&5
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&5
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&5
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ 10.[012][,.]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test yes = "$lt_cv_apple_cc_single_mod"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test yes = "$lt_cv_ld_exported_symbols_list"; then
+ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+ fi
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x$2 in
+ x)
+ ;;
+ *:)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+ ;;
+ x:*)
+ eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+ ;;
+ *)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_header_stdc=yes
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then :
+ :
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+ ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+func_stripname_cnf ()
+{
+ case $2 in
+ .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;;
+ *) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;;
+ esac
+} # func_stripname_cnf
+
+
+
+
+
+# Set options
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ enable_static=no
+fi
+
+
+
+
+
+
+
+
+
+
+ enable_dlopen=no
+
+
+ enable_win32_dll=no
+
+
+ # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+ withval=$with_pic; lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ pic_mode=default
+fi
+
+
+
+
+
+
+
+
+ # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+ shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+ withval=$with_aix_soname; case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname
+else
+ if ${lt_cv_with_aix_soname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_with_aix_soname=aix
+fi
+
+ with_aix_soname=$lt_cv_with_aix_soname
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+ if test aix != "$with_aix_soname"; then
+ # For the AIX way of multilib, we name the shared archive member
+ # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+ # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+ # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+ # the AIX toolchain works better with OBJECT_MODE set (default 32).
+ if test 64 = "${OBJECT_MODE-32}"; then
+ shared_archive_member_spec=shr_64
+ else
+ shared_archive_member_spec=shr
+ fi
+ fi
+ ;;
+*)
+ with_aix_soname=aix
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/${ac_tool_prefix}file"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
+ ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/file"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
+ ;;
+esac
+fi
+
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC=$CC
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test yes = "$GCC"; then
+ case $cc_basename in
+ nvcc*)
+ lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+ *)
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+
+
+
+
+
+ lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+ if test yes = "$GCC"; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ lt_prog_compiler_wl='-Xlinker '
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='$wl-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64, which still supported -KPIC.
+ ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='--shared'
+ lt_prog_compiler_static='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-qpic'
+ lt_prog_compiler_static='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works"; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test no = "$hard_links"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ runpath_var=
+ allow_undefined_flag=
+ always_export_symbols=no
+ archive_cmds=
+ archive_expsym_cmds=
+ compiler_needs_object=no
+ enable_shared_with_static_runtimes=no
+ export_dynamic_flag_spec=
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ hardcode_automatic=no
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_separator=
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ inherit_rpath=no
+ link_all_deplibs=unknown
+ module_cmds=
+ module_expsym_cmds=
+ old_archive_from_new_cmds=
+ old_archive_from_expsyms_cmds=
+ thread_safe_flag_spec=
+ whole_archive_flag_spec=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ' (' and ')$', so one must not match beginning or
+ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+ # as well as any symbol that contains 'd'.
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test yes != "$GCC"; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd* | bitrig*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test yes = "$with_gnu_ld"; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+ *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test yes = "$lt_use_gnu_ld_interface"; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='$wl'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ export_dynamic_flag_spec='$wl--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[3-9]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test ia64 != "$host_cpu"; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ export_dynamic_flag_spec='$wl--export-all-symbols'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ haiku*)
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ link_all_deplibs=yes
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ shrext_cmds=.dll
+ archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test linux-dietlibc = "$host_os"; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test no = "$tmp_diet"
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ whole_archive_flag_spec=
+ tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
+ xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+ if test yes = "$supports_anon_versioning"; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ tcc*)
+ export_dynamic_flag_spec='-rdynamic'
+ ;;
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test no = "$ld_shlibs"; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test ia64 = "$host_cpu"; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ file_list_spec='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # traditional, no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ ;;
+ esac
+
+ if test yes = "$GCC"; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`$CC -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
+ fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
+ else
+ shared_flag='$wl-bM:SRE'
+ fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
+ fi
+ fi
+
+ export_dynamic_flag_spec='$wl-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=/usr/lib:/lib
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=/usr/lib:/lib
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
+
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' $wl-bernotok'
+ allow_undefined_flag=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ fi
+ archive_cmds_need_lc=yes
+ archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds=''
+ ;;
+ m68k)
+ archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ if test yes = "$lt_cv_ld_force_load"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+ else
+ whole_archive_flag_spec=''
+ fi
+ link_all_deplibs=yes
+ allow_undefined_flag=$_lt_dar_allow_undefined
+ case $cc_basename in
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test yes = "$_lt_dar_can_shared"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+
+ else
+ ld_shlibs=no
+ fi
+
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test yes = "$GCC"; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='$wl-E'
+ ;;
+
+ hpux10*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='$wl-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler__b=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -b"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler__b=yes
+ fi
+ else
+ lt_cv_prog_compiler__b=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test yes = "$lt_cv_prog_compiler__b"; then
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+ ;;
+ esac
+ fi
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ hardcode_direct_absolute=yes
+ export_dynamic_flag_spec='$wl-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+ fi
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator=:
+ inherit_rpath=yes
+ link_all_deplibs=yes
+ ;;
+
+ linux*)
+ case $cc_basename in
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ ld_shlibs=yes
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd* | bitrig*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ hardcode_direct_absolute=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
+ else
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ shrext_cmds=.dll
+ archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ osf3*)
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ archive_cmds_need_lc='no'
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z defs'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='$wl'
+ archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'. GCC discards it without '$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test yes = "$GCC"; then
+ whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test sequent = "$host_vendor"; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag='$wl-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We CANNOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='$wl-z,text'
+ allow_undefined_flag='$wl-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='$wl-R,$libdir'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='$wl-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+
+ if test sni = "$host_vendor"; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ export_dynamic_flag_spec='$wl-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test no = "$ld_shlibs" && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test yes,yes = "$GCC,$enable_shared"; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc=no
+ else
+ lt_cv_archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+ archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test yes = "$GCC"; then
+ case $host_os in
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary...
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+ elif test -n "$lt_multi_os_dir"; then
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+ lt_foo = "";
+ lt_count = 0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo = "/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 supports IA64
+ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line '#! .'. This would cause the generated library to
+ # depend on '.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # Using Import Files as archive members, it is possible to support
+ # filename-based versioning of shared library archives on AIX. While
+ # this would work for both with and without runtime linking, it will
+ # prevent static linking of such archives. So we do filename-based
+ # shared library versioning with .so extension only, which is used
+ # when both runtime linking and shared linking is enabled.
+ # Unfortunately, runtime linking may impact performance, so we do
+ # not want this to be the default eventually. Also, we use the
+ # versioned .so libs for executables only if there is the -brtl
+ # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # To allow for filename-based versioning support, we need to create
+ # libNAME.so.V as an archive file, containing:
+ # *) an Import File, referring to the versioned filename of the
+ # archive as well as the shared archive member, telling the
+ # bitwidth (32 or 64) of that shared object, and providing the
+ # list of exported symbols of that shared object, eventually
+ # decorated with the 'weak' keyword
+ # *) the shared object with the F_LOADONLY flag set, to really avoid
+ # it being seen by the linker.
+ # At run time we better use the real file rather than another symlink,
+ # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+ case $with_aix_soname,$aix_use_runtimelinking in
+ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ aix,yes) # traditional libtool
+ dynamic_linker='AIX unversionable lib.so'
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ aix,no) # traditional AIX only
+ dynamic_linker='AIX lib.a(lib.so.V)'
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ svr4,*) # full svr4 only
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,yes) # both, prefer svr4
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # unpreferred sharedlib libNAME.a needs extra handling
+ postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+ postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,no) # both, prefer aix
+ dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+ postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+ postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+ ;;
+ esac
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='$libname$shared_ext'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec=$LIB
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[23].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ if test 32 = "$HPUX_IA64_MODE"; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+ fi
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Ideally, we could use ldconfig to report *all* directores which are
+ # searched for libraries, however this is still not possible. Aside from not
+ # being certain /sbin/ldconfig is available, command
+ # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+ # even though it is searched at run-time. Try to do the best guess by
+ # appending ld.so.conf contents (and includes) to the search path.
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd* | bitrig*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec=/usr/lib
+ need_lib_prefix=no
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
+ else
+ need_version=yes
+ fi
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+os2*)
+ libname_spec='$name'
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+ # OS/2 can only load a DLL with a base name of 8 characters or less.
+ soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+ v=$($ECHO $release$versuffix | tr -d .-);
+ n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+ $ECHO $n$v`$shared_ext'
+ library_names_spec='${libname}_dll.$libext'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test yes = "$with_gnu_ld"; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=sco
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test yes = "$with_gnu_ld"; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+ test -n "$runpath_var" ||
+ test yes = "$hardcode_automatic"; then
+
+ # We can hardcode non-existent directories.
+ if test no != "$hardcode_direct" &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+ test no != "$hardcode_minus_L"; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test relink = "$hardcode_action" ||
+ test yes = "$inherit_rpath"; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+ if test yes != "$enable_dlopen"; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen=load_add_on
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen=LoadLibrary
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+
+ lt_cv_dlopen=dyld
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
+ *)
+ ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+ lt_cv_dlopen=shl_load
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_shl_load=yes
+else
+ ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+ lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
+else
+ ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dl_dlopen=yes
+else
+ ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_svld_dlopen=yes
+else
+ ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_dld_dld_link=yes
+else
+ ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+ lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test no = "$lt_cv_dlopen"; then
+ enable_dlopen=no
+ else
+ enable_dlopen=yes
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS=$LDFLAGS
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS=$LIBS
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test yes = "$cross_compiling"; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisibility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+ if test yes = "$lt_cv_dlopen_self"; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test yes = "$cross_compiling"; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisibility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}
+_LT_EOF
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+ fi
+
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP"; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ ;;
+ esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+ # Report what library types will actually be built
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+ test no = "$can_build_shared" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[4-9]*)
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
+ fi
+ ;;
+ esac
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+ # Make sure either enable_shared or enable_static is yes.
+ test yes = "$enable_shared" || enable_static=yes
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+CC=$lt_save_CC
+
+ if test -n "$CXX" && ( test no != "$CXX" &&
+ ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+ (test g++ != "$CXX"))); then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+ if ${ac_cv_prog_CXXCPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+else
+ _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_caught_CXX_error"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+ # save warnings/boilerplate of simple test code
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ compiler_CXX=$CC
+ func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
+
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test yes = "$GXX"; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+ else
+ lt_prog_compiler_no_builtin_flag_CXX=
+ fi
+
+ if test yes = "$GXX"; then
+ # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test yes = "$GCC"; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return, which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD=$ac_prog
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test yes = "$with_gnu_ld"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD=$ac_dir/$ac_prog
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test no != "$with_gnu_ld" && break
+ ;;
+ *)
+ test yes != "$with_gnu_ld" && break
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+else
+ lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi
+fi
+
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test yes = "$with_gnu_ld"; then
+ archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+ export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='$wl'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ ld_shlibs_CXX=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix[4-9]*)
+ if test ia64 = "$host_cpu"; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ file_list_spec_CXX='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ hardcode_direct_CXX=no
+ hardcode_direct_absolute_CXX=no
+ ;;
+ esac
+
+ if test yes = "$GXX"; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`$CC -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ esac
+ shared_flag='-shared'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag=$shared_flag' $wl-G'
+ fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
+ else
+ shared_flag='$wl-bM:SRE'
+ fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
+ fi
+ fi
+
+ export_dynamic_flag_spec_CXX='$wl-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ always_export_symbols_CXX=yes
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ # The "-G" linker flag allows undefined symbols.
+ no_undefined_flag_CXX='-bernotok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=/usr/lib:/lib
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath__CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test -z "$lt_cv_aix_libpath__CXX"; then
+ lt_cv_aix_libpath__CXX=/usr/lib:/lib
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+ hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' $wl-bernotok'
+ allow_undefined_flag_CXX=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX='$convenience'
+ fi
+ archive_cmds_need_lc_CXX=yes
+ archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared
+ # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+ archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_CXX=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX=' '
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=yes
+ file_list_spec_CXX='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+ enable_shared_with_static_runtimes_CXX=yes
+ # Don't use ranlib
+ old_postinstall_cmds_CXX='chmod 644 $oldlib'
+ postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ export_dynamic_flag_spec_CXX='$wl--export-all-symbols'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+
+
+ archive_cmds_need_lc_CXX=no
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ if test yes = "$lt_cv_ld_force_load"; then
+ whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
+ else
+ whole_archive_flag_spec_CXX=''
+ fi
+ link_all_deplibs_CXX=yes
+ allow_undefined_flag_CXX=$_lt_dar_allow_undefined
+ case $cc_basename in
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test yes = "$_lt_dar_can_shared"; then
+ output_verbose_link_cmd=func_echo_all
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ if test yes != "$lt_cv_apple_cc_single_mod"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+ archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+ fi
+
+ else
+ ld_shlibs_CXX=no
+ fi
+
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_minus_L_CXX=yes
+ allow_undefined_flag_CXX=unsupported
+ shrext_cmds=.dll
+ archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ enable_shared_with_static_runtimes_CXX=yes
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+
+ haiku*)
+ archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ link_all_deplibs_CXX=yes
+ ;;
+
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='$wl-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ export_dynamic_flag_spec_CXX='$wl-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_direct_absolute_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[3-9]*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator_CXX=:
+ inherit_rpath_CXX=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+ whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+ prelink_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ old_archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ archive_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir'
+ export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+ whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+ export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+ archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ compiler_needs_object_CXX=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ ld_shlibs_CXX=yes
+ ;;
+
+ openbsd* | bitrig*)
+ if test -f /usr/libexec/ld.so; then
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ hardcode_direct_absolute_CXX=yes
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='$wl-E'
+ whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
+ archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+ ;;
+ *)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+ $RM $lib.exp'
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ ;;
+ esac
+
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
+ case $host in
+ osf3*)
+ archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ ;;
+ esac
+
+ hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ archive_cmds_need_lc_CXX=yes
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ no_undefined_flag_CXX=' $wl-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require '-G' NOT '-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_CXX='$wl-z,text'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We CANNOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_CXX='$wl-z,text'
+ allow_undefined_flag_CXX='$wl-z,nodefs'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='$wl-R,$libdir'
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ export_dynamic_flag_spec_CXX='$wl-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+ '"$old_archive_cmds_CXX"
+ reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+ '"$reload_cmds_CXX"
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+ test no = "$ld_shlibs_CXX" && can_build_shared=no
+
+ GCC_CXX=$GXX
+ LD_CXX=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $prev$p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test x-L = "$p" ||
+ test x-R = "$p"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test no = "$pre_test_object_deps_done"; then
+ case $prev in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX=$prev$p
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX=$prev$p
+ else
+ postdeps_CXX="${postdeps_CXX} $prev$p"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test no = "$pre_test_object_deps_done"; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX=$p
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX=$p
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ predep_objects_CXX=
+ postdep_objects_CXX=
+ postdeps_CXX=
+ ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test yes = "$GXX"; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static_CXX='$wl-static'
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ lt_prog_compiler_static_CXX=
+ ;;
+ interix[3-9]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[4-9]*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+ if test ia64 != "$host_cpu"; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64, which still supported -KPIC.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-qpic'
+ lt_prog_compiler_static_CXX='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ lt_prog_compiler_pic_CXX='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_static_works_CXX=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_cv_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then
+ # do not overwrite the value of need_locks provided by the user
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+ if test no = "$hard_links"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ case $host_os in
+ aix[4-9]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX=$ltdll_cmds
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ ;;
+ esac
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test no = "$ld_shlibs_CXX" && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test yes,yes = "$GCC,$enable_shared"; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ $RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ pic_flag=$lt_prog_compiler_pic_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ then
+ lt_cv_archive_cmds_need_lc_CXX=no
+ else
+ lt_cv_archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+ archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+
+aix[4-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 supports IA64
+ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line '#! .'. This would cause the generated library to
+ # depend on '.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # Using Import Files as archive members, it is possible to support
+ # filename-based versioning of shared library archives on AIX. While
+ # this would work for both with and without runtime linking, it will
+ # prevent static linking of such archives. So we do filename-based
+ # shared library versioning with .so extension only, which is used
+ # when both runtime linking and shared linking is enabled.
+ # Unfortunately, runtime linking may impact performance, so we do
+ # not want this to be the default eventually. Also, we use the
+ # versioned .so libs for executables only if there is the -brtl
+ # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # To allow for filename-based versioning support, we need to create
+ # libNAME.so.V as an archive file, containing:
+ # *) an Import File, referring to the versioned filename of the
+ # archive as well as the shared archive member, telling the
+ # bitwidth (32 or 64) of that shared object, and providing the
+ # list of exported symbols of that shared object, eventually
+ # decorated with the 'weak' keyword
+ # *) the shared object with the F_LOADONLY flag set, to really avoid
+ # it being seen by the linker.
+ # At run time we better use the real file rather than another symlink,
+ # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+ case $with_aix_soname,$aix_use_runtimelinking in
+ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ aix,yes) # traditional libtool
+ dynamic_linker='AIX unversionable lib.so'
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ aix,no) # traditional AIX only
+ dynamic_linker='AIX lib.a(lib.so.V)'
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ svr4,*) # full svr4 only
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,yes) # both, prefer svr4
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # unpreferred sharedlib libNAME.a needs extra handling
+ postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+ postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,no) # both, prefer aix
+ dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+ postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+ postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+ ;;
+ esac
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='$libname$shared_ext'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec=$LIB
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[23].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ if test 32 = "$HPUX_IA64_MODE"; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+ fi
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[3-9]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+ lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+
+fi
+
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Ideally, we could use ldconfig to report *all* directores which are
+ # searched for libraries, however this is still not possible. Aside from not
+ # being certain /sbin/ldconfig is available, command
+ # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+ # even though it is searched at run-time. Try to do the best guess by
+ # appending ld.so.conf contents (and includes) to the search path.
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd* | bitrig*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec=/usr/lib
+ need_lib_prefix=no
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
+ else
+ need_version=yes
+ fi
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+os2*)
+ libname_spec='$name'
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+ # OS/2 can only load a DLL with a base name of 8 characters or less.
+ soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+ v=$($ECHO $release$versuffix | tr -d .-);
+ n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+ $ECHO $n$v`$shared_ext'
+ library_names_spec='${libname}_dll.$libext'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test yes = "$with_gnu_ld"; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=sco
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test yes = "$with_gnu_ld"; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+ test -n "$runpath_var_CXX" ||
+ test yes = "$hardcode_automatic_CXX"; then
+
+ # We can hardcode non-existent directories.
+ if test no != "$hardcode_direct_CXX" &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" &&
+ test no != "$hardcode_minus_L_CXX"; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test relink = "$hardcode_action_CXX" ||
+ test yes = "$inherit_rpath_CXX"; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test yes != "$_lt_caught_CXX_error"
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+CFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter $CFLAGS"
+CXXFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls $CXXFLAGS"
+
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we will be linking in libsodium" >&5
+$as_echo_n "checking whether we will be linking in libsodium... " >&6; }
+
+# Check whether --with-libsodium was given.
+if test "${with_libsodium+set}" = set; then :
+ withval=$with_libsodium; with_libsodium=$withval
+else
+ with_libsodium=auto
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_libsodium" >&5
+$as_echo "$with_libsodium" >&6; }
+
+ if test "x$with_libsodium" != "xno"; then :
+
+ if test "x$with_libsodium" = "xyes" -o "x$with_libsodium" = "xauto"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSODIUM" >&5
+$as_echo_n "checking for LIBSODIUM... " >&6; }
+
+if test -n "$LIBSODIUM_CFLAGS"; then
+ pkg_cv_LIBSODIUM_CFLAGS="$LIBSODIUM_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsodium\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsodium") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSODIUM_CFLAGS=`$PKG_CONFIG --cflags "libsodium" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBSODIUM_LIBS"; then
+ pkg_cv_LIBSODIUM_LIBS="$LIBSODIUM_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libsodium\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libsodium") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSODIUM_LIBS=`$PKG_CONFIG --libs "libsodium" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBSODIUM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libsodium" 2>&1`
+ else
+ LIBSODIUM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libsodium" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBSODIUM_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LIBSODIUM_CFLAGS=$pkg_cv_LIBSODIUM_CFLAGS
+ LIBSODIUM_LIBS=$pkg_cv_LIBSODIUM_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LIBSODIUM 1" >>confdefs.h
+
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$LIBSODIUM_CFLAGS $CFLAGS"
+ LIBS="$LIBSODIUM_LIBS $LIBS"
+ for ac_func in crypto_box_easy_afternm crypto_box_curve25519xchacha20poly1305_easy randombytes_stir sodium_memcmp crypto_shorthash
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+
+fi
+
+fi
+
+fi
+ if test "x$LIBSODIUM_LIBS" != "x"; then
+ LIBSODIUM_TRUE=
+ LIBSODIUM_FALSE='#'
+else
+ LIBSODIUM_TRUE='#'
+ LIBSODIUM_FALSE=
+fi
+
+ if test "x$with_libsodium" = "xyes"; then :
+
+ if test x"$LIBSODIUM_LIBS" = "x"; then :
+
+ as_fn_error $? "libsodium requested but libraries were not found" "$LINENO" 5
+
+fi
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we will have dnstap" >&5
+$as_echo_n "checking whether we will have dnstap... " >&6; }
+ # Check whether --enable-dnstap was given.
+if test "${enable_dnstap+set}" = set; then :
+ enableval=$enable_dnstap; enable_dnstap=$enableval
+else
+ enable_dnstap=auto
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dnstap" >&5
+$as_echo "$enable_dnstap" >&6; }
+
+ if test "x$enable_dnstap" != "xno"; then :
+
+ if test "x$enable_dnstap" = "xyes" -o "x$enable_dnstap" = "xauto"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FSTRM" >&5
+$as_echo_n "checking for FSTRM... " >&6; }
+
+if test -n "$FSTRM_CFLAGS"; then
+ pkg_cv_FSTRM_CFLAGS="$FSTRM_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfstrm\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libfstrm") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_FSTRM_CFLAGS=`$PKG_CONFIG --cflags "libfstrm" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$FSTRM_LIBS"; then
+ pkg_cv_FSTRM_LIBS="$FSTRM_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libfstrm\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libfstrm") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_FSTRM_LIBS=`$PKG_CONFIG --libs "libfstrm" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ FSTRM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libfstrm" 2>&1`
+ else
+ FSTRM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libfstrm" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$FSTRM_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ FSTRM_CFLAGS=$pkg_cv_FSTRM_CFLAGS
+ FSTRM_LIBS=$pkg_cv_FSTRM_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_FSTRM 1" >>confdefs.h
+
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$FSTRM_CFLAGS $CFLAGS"
+ LIBS="$FSTRM_LIBS $LIBS"
+ for ac_func in fstrm_tcp_writer_init
+do :
+ ac_fn_cxx_check_func "$LINENO" "fstrm_tcp_writer_init" "ac_cv_func_fstrm_tcp_writer_init"
+if test "x$ac_cv_func_fstrm_tcp_writer_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_FSTRM_TCP_WRITER_INIT 1
+_ACEOF
+
+fi
+done
+
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+
+fi
+
+fi
+
+fi
+
+ if test "x$FSTRM_LIBS" != "x"; then
+ FSTRM_TRUE=
+ FSTRM_FALSE='#'
+else
+ FSTRM_TRUE='#'
+ FSTRM_FALSE=
+fi
+
+ if test "x$enable_dnstap" = "xyes"; then :
+
+ if test x"$FSTRM_LIBS" = "x"; then :
+
+ as_fn_error $? "dnstap requested but libfstrm was not found" "$LINENO" 5
+
+fi
+
+fi
+
+
+ # Extract the first word of "ragel", so it can be a program name with args.
+set dummy ragel; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RAGEL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$RAGEL"; then
+ ac_cv_prog_RAGEL="$RAGEL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RAGEL="ragel"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+RAGEL=$ac_cv_prog_RAGEL
+if test -n "$RAGEL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RAGEL" >&5
+$as_echo "$RAGEL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "x$RAGEL" = "x"; then
+ if test ! -f "${srcdir}/dnslabeltext.cc"; then
+ as_fn_error $? "ragel is missing and you don't have ${srcdir}/dnslabeltext.cc. Install ragel or download sources from www.dnsdist.org" "$LINENO" 5
+ fi
+ fi
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBEDIT" >&5
+$as_echo_n "checking for LIBEDIT... " >&6; }
+
+if test -n "$LIBEDIT_CFLAGS"; then
+ pkg_cv_LIBEDIT_CFLAGS="$LIBEDIT_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libedit") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBEDIT_CFLAGS=`$PKG_CONFIG --cflags "libedit" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBEDIT_LIBS"; then
+ pkg_cv_LIBEDIT_LIBS="$LIBEDIT_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libedit\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libedit") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBEDIT_LIBS=`$PKG_CONFIG --libs "libedit" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBEDIT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libedit" 2>&1`
+ else
+ LIBEDIT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libedit" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBEDIT_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements (libedit) were not met:
+
+$LIBEDIT_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables LIBEDIT_CFLAGS
+and LIBEDIT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables LIBEDIT_CFLAGS
+and LIBEDIT_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ LIBEDIT_CFLAGS=$pkg_cv_LIBEDIT_CFLAGS
+ LIBEDIT_LIBS=$pkg_cv_LIBEDIT_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+ OLD_LIBS="$LIBS"; LIBS=""
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+$as_echo_n "checking for library containing clock_gettime... " >&6; }
+if ${ac_cv_search_clock_gettime+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clock_gettime ();
+int
+main ()
+{
+return clock_gettime ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' rt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_clock_gettime+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_clock_gettime+:} false; then :
+
+else
+ ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+$as_echo "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
+
+fi
+
+ RT_LIBS=$LIBS
+
+ LIBS="$OLD_LIBS"
+
+
+
+ THREADFLAGS=""
+
+ case "$host_os" in
+ solaris2.1*)
+ LIBS="-lposix4 -lpthread $LIBS"
+ CXXFLAGS="-D_REENTRANT $CXXFLAGS"
+ have_solaris="yes"
+ ;;
+ solaris2.8 | solaris2.9 )
+
+$as_echo "#define NEED_POSIX_TYPEDEF /**/" >>confdefs.h
+
+
+$as_echo "#define NEED_INET_NTOP_PROTO /**/" >>confdefs.h
+
+ LIBS="-lposix4 -lpthread $LIBS"
+ CXXFLAGS="-D_REENTRANT $CXXFLAGS"
+ have_solaris="yes"
+ ;;
+ linux*)
+ THREADFLAGS="-pthread"
+ have_linux="yes"
+ ;;
+ darwin*)
+ CXXFLAGS="-D__APPLE_USE_RFC_3542 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS"
+ have_darwin="yes"
+ ;;
+ freebsd*)
+ THREADFLAGS="-pthread"
+ have_freebsd="yes"
+ ;;
+ openbsd*)
+ THREADFLAGS="-pthread"
+ have_openbsd="yes"
+ ;;
+ *)
+ LDFLAGS="-pthread $LDFLAGS"
+ CXXFLAGS="-pthread $CXXFLAGS"
+ ;;
+ esac
+
+ if test "x$have_freebsd" = "xyes"; then
+ HAVE_FREEBSD_TRUE=
+ HAVE_FREEBSD_FALSE='#'
+else
+ HAVE_FREEBSD_TRUE='#'
+ HAVE_FREEBSD_FALSE=
+fi
+
+ if test "x$have_openbsd" = "xyes"; then
+ HAVE_OPENBSD_TRUE=
+ HAVE_OPENBSD_FALSE='#'
+else
+ HAVE_OPENBSD_TRUE='#'
+ HAVE_OPENBSD_FALSE=
+fi
+
+ if test "x$have_linux" = "xyes"; then
+ HAVE_LINUX_TRUE=
+ HAVE_LINUX_FALSE='#'
+else
+ HAVE_LINUX_TRUE='#'
+ HAVE_LINUX_FALSE=
+fi
+
+ if test "x$have_darwin" = "xyes"; then
+ HAVE_DARWIN_TRUE=
+ HAVE_DARWIN_FALSE='#'
+else
+ HAVE_DARWIN_TRUE='#'
+ HAVE_DARWIN_FALSE=
+fi
+
+ if test "x$have_solaris" = "xyes"; then
+ HAVE_SOLARIS_TRUE=
+ HAVE_SOLARIS_FALSE='#'
+else
+ HAVE_SOLARIS_TRUE='#'
+ HAVE_SOLARIS_FALSE=
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -latomic is needed for __atomic builtins" >&5
+$as_echo_n "checking whether -latomic is needed for __atomic builtins... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdint.h>
+int
+main ()
+{
+uint64_t val = 0; __atomic_add_fetch(&val, 1, __ATOMIC_RELAXED);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+ LIBS="$LIBS -latomic"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdint.h>
+int
+main ()
+{
+uint64_t val = 0; __atomic_add_fetch(&val, 1, __ATOMIC_RELAXED);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "libatomic needed, but linking with -latomic failed, cannot continue
+See \`config.log' for more details" "$LINENO" 5; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+
+ DYNLINKFLAGS=-export-dynamic
+
+
+
+ stored_LIBS="$LIBS"
+ LIBS="-lpthread"
+ # pthread setname (4 non-portable variants...)
+ for ac_header in pthread_np.h
+do :
+ ac_fn_cxx_check_header_compile "$LINENO" "pthread_np.h" "ac_cv_header_pthread_np_h" "#include <pthread.h>
+"
+if test "x$ac_cv_header_pthread_np_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_NP_H 1
+_ACEOF
+
+fi
+
+done
+
+
+ # 2-arg setname (e.g. Linux/glibc, QNX, IBM)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 2-arg pthread_setname_np" >&5
+$as_echo_n "checking for 2-arg pthread_setname_np... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <pthread.h>
+ #if HAVE_PTHREAD_NP_H
+ # include <pthread_np.h>
+ #endif
+
+int
+main ()
+{
+
+ pthread_setname_np(pthread_self(), "foo")
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+
+$as_echo "#define HAVE_PTHREAD_SETNAME_NP_2 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ # 2-arg set_name (e.g. FreeBSD, OpenBSD)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 2-arg pthread_set_name_np" >&5
+$as_echo_n "checking for 2-arg pthread_set_name_np... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <pthread.h>
+ #if HAVE_PTHREAD_NP_H
+ # include <pthread_np.h>
+ #endif
+
+int
+main ()
+{
+
+ return pthread_set_name_np(pthread_self(), "foo");
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+
+$as_echo "#define HAVE_PTHREAD_SET_NAME_NP_2 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ # 2-arg void set_name (e.g. FreeBSD, OpenBSD)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 2-arg void pthread_set_name_np" >&5
+$as_echo_n "checking for 2-arg void pthread_set_name_np... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <pthread.h>
+ #if HAVE_PTHREAD_NP_H
+ # include <pthread_np.h>
+ #endif
+
+int
+main ()
+{
+
+ pthread_set_name_np(pthread_self(), "foo");
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+
+$as_echo "#define HAVE_PTHREAD_SET_NAME_NP_2_VOID 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ # 1-arg setname (e.g. Darwin)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 1-arg pthread_setname_np" >&5
+$as_echo_n "checking for 1-arg pthread_setname_np... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <pthread.h>
+ #if HAVE_PTHREAD_NP_H
+ # include <pthread_np.h>
+ #endif
+
+int
+main ()
+{
+
+ return pthread_setname_np("foo");
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+
+$as_echo "#define HAVE_PTHREAD_SETNAME_NP_1 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ # 3-arg setname (e.g. NetBSD)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 3-arg pthread_setname_np" >&5
+$as_echo_n "checking for 3-arg pthread_setname_np... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <pthread.h>
+ #if HAVE_PTHREAD_NP_H
+ # include <pthread_np.h>
+ #endif
+
+int
+main ()
+{
+
+ return pthread_setname_np(pthread_self(), "foo", NULL);
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+
+$as_echo "#define HAVE_PTHREAD_SETNAME_NP_3 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS=$stored_LIBS
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_aton" >&5
+$as_echo_n "checking for library containing inet_aton... " >&6; }
+if ${ac_cv_search_inet_aton+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inet_aton ();
+int
+main ()
+{
+return inet_aton ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' resolv; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_inet_aton=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_inet_aton+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_inet_aton+:} false; then :
+
+else
+ ac_cv_search_inet_aton=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_aton" >&5
+$as_echo "$ac_cv_search_inet_aton" >&6; }
+ac_res=$ac_cv_search_inet_aton
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
+$as_echo_n "checking for library containing gethostbyname... " >&6; }
+if ${ac_cv_search_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_gethostbyname=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_gethostbyname+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_gethostbyname+:} false; then :
+
+else
+ ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
+$as_echo "$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5
+$as_echo_n "checking for library containing socket... " >&6; }
+if ${ac_cv_search_socket+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char socket ();
+int
+main ()
+{
+return socket ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_socket=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_socket+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_socket+:} false; then :
+
+else
+ ac_cv_search_socket=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5
+$as_echo "$ac_cv_search_socket" >&6; }
+ac_res=$ac_cv_search_socket
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5
+$as_echo_n "checking for library containing gethostent... " >&6; }
+if ${ac_cv_search_gethostent+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostent ();
+int
+main ()
+{
+return gethostent ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_gethostent=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_gethostent+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_gethostent+:} false; then :
+
+else
+ ac_cv_search_gethostent=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostent" >&5
+$as_echo "$ac_cv_search_gethostent" >&6; }
+ac_res=$ac_cv_search_gethostent
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+ for ac_func in recvmmsg sendmmsg accept4
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_setaffinity_np" >&5
+$as_echo_n "checking for library containing pthread_setaffinity_np... " >&6; }
+if ${ac_cv_search_pthread_setaffinity_np+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_setaffinity_np ();
+int
+main ()
+{
+return pthread_setaffinity_np ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_pthread_setaffinity_np=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_setaffinity_np+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pthread_setaffinity_np+:} false; then :
+
+else
+ ac_cv_search_pthread_setaffinity_np=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_setaffinity_np" >&5
+$as_echo "$ac_cv_search_pthread_setaffinity_np" >&6; }
+ac_res=$ac_cv_search_pthread_setaffinity_np
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_PTHREAD_SETAFFINITY_NP 1" >>confdefs.h
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_getattr_np" >&5
+$as_echo_n "checking for library containing pthread_getattr_np... " >&6; }
+if ${ac_cv_search_pthread_getattr_np+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_getattr_np ();
+int
+main ()
+{
+return pthread_getattr_np ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_pthread_getattr_np=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_getattr_np+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pthread_getattr_np+:} false; then :
+
+else
+ ac_cv_search_pthread_getattr_np=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_getattr_np" >&5
+$as_echo "$ac_cv_search_pthread_getattr_np" >&6; }
+ac_res=$ac_cv_search_pthread_getattr_np
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_PTHREAD_GETATTR_NP 1" >>confdefs.h
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_get_stackaddr_np" >&5
+$as_echo_n "checking for library containing pthread_get_stackaddr_np... " >&6; }
+if ${ac_cv_search_pthread_get_stackaddr_np+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_get_stackaddr_np ();
+int
+main ()
+{
+return pthread_get_stackaddr_np ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_pthread_get_stackaddr_np=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_get_stackaddr_np+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pthread_get_stackaddr_np+:} false; then :
+
+else
+ ac_cv_search_pthread_get_stackaddr_np=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_get_stackaddr_np" >&5
+$as_echo "$ac_cv_search_pthread_get_stackaddr_np" >&6; }
+ac_res=$ac_cv_search_pthread_get_stackaddr_np
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_PTHREAD_GET_STACKADDR_NP 1" >>confdefs.h
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_get_stacksize_np" >&5
+$as_echo_n "checking for library containing pthread_get_stacksize_np... " >&6; }
+if ${ac_cv_search_pthread_get_stacksize_np+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_get_stacksize_np ();
+int
+main ()
+{
+return pthread_get_stacksize_np ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' pthread; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_pthread_get_stacksize_np=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_pthread_get_stacksize_np+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_pthread_get_stacksize_np+:} false; then :
+
+else
+ ac_cv_search_pthread_get_stacksize_np=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_get_stacksize_np" >&5
+$as_echo "$ac_cv_search_pthread_get_stacksize_np" >&6; }
+ac_res=$ac_cv_search_pthread_get_stacksize_np
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_PTHREAD_GET_STACKSIZE_NP 1" >>confdefs.h
+
+fi
+
+
+
+ for ac_func in explicit_bzero explicit_memset
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+echo "$as_me: this is boost.m4 serial 36" >&5
+boost_save_IFS=$IFS
+boost_version_req=1.42
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$1" '*' 100000 + "$2" '*' 100 + "$3"`
+boost_version_req_string=$1.$2.$3
+
+# Check whether --with-boost was given.
+if test "${with_boost+set}" = set; then :
+ withval=$with_boost;
+fi
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT" >&5
+$as_echo "$as_me: Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT" >&6;}
+ with_boost=$BOOST_ROOT
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost" >&5
+$as_echo "$as_me: Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost" >&6;}
+ fi
+fi
+DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"
+boost_save_CPPFLAGS=$CPPFLAGS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost headers version >= $boost_version_req_string" >&5
+$as_echo_n "checking for Boost headers version >= $boost_version_req_string... " >&6; }
+if ${boost_cv_inc_path+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ boost_cv_inc_path=no
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ if ac_fn_cxx_try_compile "$LINENO"; then :
+ boost_cv_inc_path=yes
+else
+ boost_cv_version=no
+fi
+rm -f core conftest.err conftest.$ac_objext
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_inc_path" >&5
+$as_echo "$boost_cv_inc_path" >&6; }
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ as_fn_error $? "$boost_errmsg" "$LINENO" 5
+
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ BOOST_CPPFLAGS="-I$boost_cv_inc_path"
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+
+$as_echo "#define HAVE_BOOST 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Boost's header version" >&5
+$as_echo_n "checking for Boost's header version... " >&6; }
+if ${boost_cv_lib_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ grep -v '#' |
+ grep -v '^[[:space:]]*$' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}" >conftest.i 2>&1; then :
+ boost_cv_lib_version=`cat conftest.i`
+fi
+rm -rf conftest*
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_version" >&5
+$as_echo "$boost_cv_lib_version" >&6; }
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[!0-9]*)
+ as_fn_error $? "invalid value: boost_major_version='$boost_major_version'" "$LINENO" 5
+ ;;
+ esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the toolset name used by Boost for $CXX" >&5
+$as_echo_n "checking for the toolset name used by Boost for $CXX... " >&6; }
+if ${boost_cv_lib_tag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ "defined __clang__ && __clang_major__ == 12 && __clang_minor__ == 0 @ clang120" \
+ "defined __clang__ && __clang_major__ == 11 && __clang_minor__ == 1 @ clang111" \
+ "defined __clang__ && __clang_major__ == 11 && __clang_minor__ == 0 @ clang110" \
+ "defined __clang__ && __clang_major__ == 10 && __clang_minor__ == 0 @ clang100" \
+ "defined __clang__ && __clang_major__ == 9 && __clang_minor__ == 0 @ clang90" \
+ "defined __clang__ && __clang_major__ == 8 && __clang_minor__ == 0 @ clang80" \
+ "defined __clang__ && __clang_major__ == 7 && __clang_minor__ == 0 @ clang70" \
+ "defined __clang__ && __clang_major__ == 6 && __clang_minor__ == 0 @ clang60" \
+ "defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 @ clang50" \
+ "defined __clang__ && __clang_major__ == 4 && __clang_minor__ == 0 @ clang40" \
+ "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 9 @ clang39" \
+ "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 8 @ clang38" \
+ "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 7 @ clang37" \
+ "defined __GNUC__ && __GNUC__ == 11 && __GNUC_MINOR__ == 1 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw111" \
+ "defined __GNUC__ && __GNUC__ == 11 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc111" \
+ "defined __GNUC__ && __GNUC__ == 10 && __GNUC_MINOR__ == 3 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw103" \
+ "defined __GNUC__ && __GNUC__ == 10 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc103" \
+ "defined __GNUC__ && __GNUC__ == 10 && __GNUC_MINOR__ == 2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw102" \
+ "defined __GNUC__ && __GNUC__ == 10 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc102" \
+ "defined __GNUC__ && __GNUC__ == 10 && __GNUC_MINOR__ == 1 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw101" \
+ "defined __GNUC__ && __GNUC__ == 10 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc101" \
+ "defined __GNUC__ && __GNUC__ == 9 && __GNUC_MINOR__ == 3 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw93" \
+ "defined __GNUC__ && __GNUC__ == 9 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc93" \
+ "defined __GNUC__ && __GNUC__ == 9 && __GNUC_MINOR__ == 2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw92" \
+ "defined __GNUC__ && __GNUC__ == 9 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc92" \
+ "defined __GNUC__ && __GNUC__ == 9 && __GNUC_MINOR__ == 1 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw91" \
+ "defined __GNUC__ && __GNUC__ == 9 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc91" \
+ "defined __GNUC__ && __GNUC__ == 9 && __GNUC_MINOR__ == 0 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw90" \
+ "defined __GNUC__ && __GNUC__ == 9 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc90" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 5 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw85" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 5 && !defined __ICC @ gcc85" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 4 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw84" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc84" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 3 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw83" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc83" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw82" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc82" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 1 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw81" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc81" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 0 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw80" \
+ "defined __GNUC__ && __GNUC__ == 8 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc80" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 4 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw74" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc74" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 3 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw73" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc73" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw72" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc72" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 1 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw71" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc71" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 0 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw70" \
+ "defined __GNUC__ && __GNUC__ == 7 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc70" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 5 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw65" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 5 && !defined __ICC @ gcc65" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 4 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw64" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc64" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 3 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw63" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc63" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw62" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc62" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 1 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw61" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc61" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 0 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw60" \
+ "defined __GNUC__ && __GNUC__ == 6 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc60" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 5 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw55" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 5 && !defined __ICC @ gcc55" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 4 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw54" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc54" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 3 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw53" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc53" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw52" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc52" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 1 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw51" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc51" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 0 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw50" \
+ "defined __GNUC__ && __GNUC__ == 5 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc50" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 10 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw410" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 10 && !defined __ICC @ gcc410" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw49" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 9 && !defined __ICC @ gcc49" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 8 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw48" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 8 && !defined __ICC @ gcc48" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 7 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw47" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 7 && !defined __ICC @ gcc47" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw46" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 6 && !defined __ICC @ gcc46" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 5 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw45" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 5 && !defined __ICC @ gcc45" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw44" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc44" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw43" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc43" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw42" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc42" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw41" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc41" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw40" \
+ "defined __GNUC__ && __GNUC__ == 4 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc40" \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 4 && !defined __ICC @ gcc34" \
+ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 3 && !defined __ICC @ gcc33" \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 2 && !defined __ICC @ gcc32" \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 1 && !defined __ICC @ gcc31" \
+ "defined __GNUC__ && __GNUC__ == 3 && __GNUC_MINOR__ == 0 && !defined __ICC @ gcc30" \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined ) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ "defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ == 95 && !defined __ICC @ gcc295" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([^@]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[^@]* @ \(.*\)'`
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ boost_cv_lib_tag=$boost_tag; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not figure out which toolset name to use for $CXX" >&5
+$as_echo "$as_me: WARNING: could not figure out which toolset name to use for $CXX" >&2;}
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_tag" >&5
+$as_echo "$boost_cv_lib_tag" >&6; }
+# Check whether --enable-static-boost was given.
+if test "${enable_static_boost+set}" = set; then :
+ enableval=$enable_static_boost; enable_static_boost=yes
+else
+ enable_static_boost=no
+fi
+
+# Check whether we do better use `mt' even though we weren't ask to.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ boost_guess_use_mt=:
+else
+ boost_guess_use_mt=false
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable unit test building" >&5
+$as_echo_n "checking whether to enable unit test building... " >&6; }
+ # Check whether --enable-unit-tests was given.
+if test "${enable_unit_tests+set}" = set; then :
+ enableval=$enable_unit_tests; enable_unit_tests=$enableval
+else
+ enable_unit_tests=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_unit_tests" >&5
+$as_echo "$enable_unit_tests" >&6; }
+ if test "x$enable_unit_tests" != "xno"; then
+ UNIT_TESTS_TRUE=
+ UNIT_TESTS_FALSE='#'
+else
+ UNIT_TESTS_TRUE='#'
+ UNIT_TESTS_FALSE=
+fi
+
+
+ if test "x$enable_unit_tests" != "xno"; then :
+
+ if test x"$boost_cv_inc_path" = xno; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Boost not available, not searching for the Boost unit_test_framework library" >&5
+$as_echo "$as_me: Boost not available, not searching for the Boost unit_test_framework library" >&6;}
+else
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test x"" = "xno"; then :
+ not_found_header='true'
+fi
+if test x"$boost_cv_inc_path" = xno; then
+ $not_found_header
+else
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+ac_fn_cxx_check_header_mongrel "$LINENO" "boost/test/unit_test.hpp" "ac_cv_header_boost_test_unit_test_hpp" "$ac_includes_default"
+if test "x$ac_cv_header_boost_test_unit_test_hpp" = xyes; then :
+
+$as_echo "#define HAVE_BOOST_TEST_UNIT_TEST_HPP 1" >>confdefs.h
+
+else
+ $not_found_header
+fi
+
+
+CPPFLAGS=$boost_save_CPPFLAGS
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+fi
+
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Boost unit_test_framework library" >&5
+$as_echo_n "checking for the Boost unit_test_framework library... " >&6; }
+if ${boost_cv_lib_unit_test_framework+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ boost_cv_lib_unit_test_framework=no
+ case "mt" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "Xmt" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=mt;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[sgpn]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ as_fn_error $? "the libext variable is empty, did you invoke Libtool?" "$LINENO" 5
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <boost/test/unit_test.hpp>
+using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }
+int
+main ()
+{
+BOOST_CHECK(2 == 2);
+ ;
+ return 0;
+}
+_ACEOF
+ if ac_fn_cxx_try_compile "$LINENO"; then :
+ ac_objext=do_not_rm_me_plz
+else
+ if test x"" != x"no"; then :
+
+ as_fn_error $? "cannot compile a test that uses Boost unit_test_framework" "$LINENO" 5
+
+fi
+
+fi
+rm -f core conftest.err conftest.$ac_objext
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in unit_test_framework; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_full_suffix in \
+ $boost_last_suffix \
+ x$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ x$boost_tag_$boost_rtopt_$boost_ver_ \
+ x$boost_tag_$boost_mt_$boost_ver_ \
+ x$boost_tag_$boost_ver_
+ do
+ boost_real_suffix=`echo "$boost_full_suffix" | sed 's/^x//'`
+ boost_lib="boost_$boost_lib_$boost_real_suffix"
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ boost_cv_lib_unit_test_framework_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$boost_cv_lib_unit_test_framework_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ boost_cv_lib_unit_test_framework_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$boost_cv_lib_unit_test_framework_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+ rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+ }; then :
+ boost_cv_lib_unit_test_framework=yes
+else
+ if $boost_use_source; then
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+ boost_cv_lib_unit_test_framework=no
+fi
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$boost_cv_lib_unit_test_framework" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ if ${boost_cv_rpath_link_ldflag+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$boost_cv_lib_unit_test_framework_LIBS $boost_save_LIBS"
+ rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ $as_echo "$as_me:${as_lineno-$LINENO}: re-using the existing conftest.$ac_objext" >&5
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_cxx_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+ }; then :
+ boost_rpath_link_ldflag_found=yes
+ break
+else
+ if $boost_use_source; then
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ fi
+ boost_rpath_link_ldflag_found=no
+fi
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext
+ done
+ ;;
+ esac
+ if test "x$boost_rpath_link_ldflag_found" != "xyes"; then :
+ as_fn_error $? "Unable to determine whether to use -R or -rpath" "$LINENO" 5
+fi
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+
+fi
+
+ test x"$boost_ldpath" != x &&
+ boost_cv_lib_unit_test_framework_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ boost_cv_lib_unit_test_framework_LDPATH="$boost_ldpath"
+ boost_last_suffix="$boost_full_suffix"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $boost_cv_lib_unit_test_framework" >&5
+$as_echo "$boost_cv_lib_unit_test_framework" >&6; }
+case $boost_cv_lib_unit_test_framework in #(
+ (yes) $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+$as_echo "#define HAVE_BOOST_UNIT_TEST_FRAMEWORK 1" >>confdefs.h
+ BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS=$boost_cv_lib_unit_test_framework_LDFLAGS
+ BOOST_UNIT_TEST_FRAMEWORK_LDPATH=$boost_cv_lib_unit_test_framework_LDPATH
+ BOOST_LDPATH=$boost_cv_lib_unit_test_framework_LDPATH
+ BOOST_UNIT_TEST_FRAMEWORK_LIBS=$boost_cv_lib_unit_test_framework_LIBS
+ ;;
+ (no) $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ if test x"" != "xno"; then :
+
+ as_fn_error $? "cannot find flags to link with the Boost unit_test_framework library (libboost-unit_test_framework)" "$LINENO" 5
+
+fi
+ ;;
+esac
+CPPFLAGS=$boost_save_CPPFLAGS
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+fi
+
+
+
+ if test "$boost_cv_lib_unit_test_framework" = "no"; then :
+
+ as_fn_error $? "Boost Unit Test library not found" "$LINENO" 5
+
+fi
+
+fi
+
+
+ HAVE_RE2=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should compile in libre2 for dnsdist" >&5
+$as_echo_n "checking if we should compile in libre2 for dnsdist... " >&6; }
+
+# Check whether --with-re2 was given.
+if test "${with_re2+set}" = set; then :
+ withval=$with_re2; with_re2=$withval
+else
+ with_re2=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_re2" >&5
+$as_echo "$with_re2" >&6; }
+ if test "x$with_re2" = "xyes"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RE2" >&5
+$as_echo_n "checking for RE2... " >&6; }
+
+if test -n "$RE2_CFLAGS"; then
+ pkg_cv_RE2_CFLAGS="$RE2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"re2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "re2") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_RE2_CFLAGS=`$PKG_CONFIG --cflags "re2" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$RE2_LIBS"; then
+ pkg_cv_RE2_LIBS="$RE2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"re2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "re2") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_RE2_LIBS=`$PKG_CONFIG --libs "re2" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ RE2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "re2" 2>&1`
+ else
+ RE2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "re2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$RE2_PKG_ERRORS" >&5
+
+
+ ac_fn_cxx_check_header_mongrel "$LINENO" "re2/re2.h" "ac_cv_header_re2_re2_h" "$ac_includes_default"
+if test "x$ac_cv_header_re2_re2_h" = xyes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lre2" >&5
+$as_echo_n "checking for main in -lre2... " >&6; }
+if ${ac_cv_lib_re2_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lre2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_lib_re2_main=yes
+else
+ ac_cv_lib_re2_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_re2_main" >&5
+$as_echo "$ac_cv_lib_re2_main" >&6; }
+if test "x$ac_cv_lib_re2_main" = xyes; then :
+
+ HAVE_RE2=1
+ RE2_LIBS="-lre2"
+else
+ :
+fi
+
+
+fi
+
+
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ ac_fn_cxx_check_header_mongrel "$LINENO" "re2/re2.h" "ac_cv_header_re2_re2_h" "$ac_includes_default"
+if test "x$ac_cv_header_re2_re2_h" = xyes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lre2" >&5
+$as_echo_n "checking for main in -lre2... " >&6; }
+if ${ac_cv_lib_re2_main+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lre2 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+return main ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_lib_re2_main=yes
+else
+ ac_cv_lib_re2_main=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_re2_main" >&5
+$as_echo "$ac_cv_lib_re2_main" >&6; }
+if test "x$ac_cv_lib_re2_main" = xyes; then :
+
+ HAVE_RE2=1
+ RE2_LIBS="-lre2"
+else
+ :
+fi
+
+
+fi
+
+
+
+else
+ RE2_CFLAGS=$pkg_cv_RE2_CFLAGS
+ RE2_LIBS=$pkg_cv_RE2_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ HAVE_RE2=1
+fi
+ if test "$HAVE_RE2" -ne 1; then :
+ as_fn_error $? "Could not find libre2" "$LINENO" 5
+fi
+
+fi
+ if test "$HAVE_RE2" -eq 1; then
+ HAVE_RE2_TRUE=
+ HAVE_RE2_FALSE='#'
+else
+ HAVE_RE2_TRUE='#'
+ HAVE_RE2_FALSE=
+fi
+
+ if test "$HAVE_RE2" -eq 1; then :
+
+$as_echo "#define HAVE_RE2 1" >>confdefs.h
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable DNSCrypt support" >&5
+$as_echo_n "checking whether to enable DNSCrypt support... " >&6; }
+ # Check whether --enable-dnscrypt was given.
+if test "${enable_dnscrypt+set}" = set; then :
+ enableval=$enable_dnscrypt; enable_dnscrypt=$enableval
+else
+ enable_dnscrypt=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dnscrypt" >&5
+$as_echo "$enable_dnscrypt" >&6; }
+ if test "x$enable_dnscrypt" != "xno"; then
+ DNSCRYPT_TRUE=
+ DNSCRYPT_FALSE='#'
+else
+ DNSCRYPT_TRUE='#'
+ DNSCRYPT_FALSE=
+fi
+
+
+ if test -z "$DNSCRYPT_TRUE"; then :
+
+ if test -z "$LIBSODIUM_TRUE"; then :
+
+
+$as_echo "#define HAVE_DNSCRYPT 1" >>confdefs.h
+
+
+else
+
+ as_fn_error $? "dnscrypt support requested but libsodium is not available" "$LINENO" 5
+
+fi
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we have eBPF support" >&5
+$as_echo_n "checking if we have eBPF support... " >&6; }
+
+# Check whether --with-ebpf was given.
+if test "${with_ebpf+set}" = set; then :
+ withval=$with_ebpf; with_ebpf=$withval
+else
+ with_ebpf=auto
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_ebpf" >&5
+$as_echo "$with_ebpf" >&6; }
+
+ if test "x$with_ebpf" != "xno"; then :
+
+ if test "x$with_ebpf" = "xyes" -o "x$with_ebpf" = "xauto"; then :
+
+ for ac_header in linux/bpf.h
+do :
+ ac_fn_cxx_check_header_mongrel "$LINENO" "linux/bpf.h" "ac_cv_header_linux_bpf_h" "$ac_includes_default"
+if test "x$ac_cv_header_linux_bpf_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LINUX_BPF_H 1
+_ACEOF
+ bpf_headers=yes
+else
+ bpf_headers=no
+fi
+
+done
+
+
+fi
+
+fi
+ if test "x$with_ebpf" = "xyes"; then :
+
+ if test x"$bpf_headers" = "no"; then :
+
+ as_fn_error $? "EBPF support requested but required eBPF headers were not found" "$LINENO" 5
+
+fi
+
+fi
+ if test x"$bpf_headers" = "xyes" ; then
+ HAVE_EBPF_TRUE=
+ HAVE_EBPF_FALSE='#'
+else
+ HAVE_EBPF_TRUE='#'
+ HAVE_EBPF_FALSE=
+fi
+
+ if test x"$bpf_headers" = "xyes" ; then :
+ ac_fn_cxx_check_decl "$LINENO" "BPF_FUNC_tail_call" "ac_cv_have_decl_BPF_FUNC_tail_call" "#include <linux/bpf.h>
+
+
+"
+if test "x$ac_cv_have_decl_BPF_FUNC_tail_call" = xyes; then :
+ ac_fn_cxx_check_decl "$LINENO" "SO_ATTACH_BPF" "ac_cv_have_decl_SO_ATTACH_BPF" "#include <sys/socket.h>
+
+
+"
+if test "x$ac_cv_have_decl_SO_ATTACH_BPF" = xyes; then :
+
+$as_echo "#define HAVE_EBPF 1" >>confdefs.h
+
+else
+ if test "x$with_ebpf" = "xyes"; then :
+
+ as_fn_error $? "EBPF support requested but SO_ATTACH_BPF not found" "$LINENO" 5
+
+fi
+fi
+
+else
+ if test "x$with_ebpf" = "xyes"; then :
+
+ as_fn_error $? "EBPF support requested but BPF_FUNC_tail_call not found in the eBPF headers" "$LINENO" 5
+
+fi
+fi
+
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to link in Net SNMP" >&5
+$as_echo_n "checking if we need to link in Net SNMP... " >&6; }
+
+# Check whether --with-net-snmp was given.
+if test "${with_net_snmp+set}" = set; then :
+ withval=$with_net_snmp; with_net_snmp=$withval
+else
+ with_net_snmp=auto
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_net_snmp" >&5
+$as_echo "$with_net_snmp" >&6; }
+
+ if test "x$with_net_snmp" != "xno"; then :
+
+ if test "x$with_net_snmp" = "xyes" -o "x$with_net_snmp" = "xauto"; then :
+
+ # Extract the first word of "net-snmp-config", so it can be a program name with args.
+set dummy net-snmp-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NET_SNMP_CFLAGS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NET_SNMP_CFLAGS"; then
+ ac_cv_prog_NET_SNMP_CFLAGS="$NET_SNMP_CFLAGS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NET_SNMP_CFLAGS="`net-snmp-config --cflags`"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NET_SNMP_CFLAGS=$ac_cv_prog_NET_SNMP_CFLAGS
+if test -n "$NET_SNMP_CFLAGS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NET_SNMP_CFLAGS" >&5
+$as_echo "$NET_SNMP_CFLAGS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ # Extract the first word of "net-snmp-config", so it can be a program name with args.
+set dummy net-snmp-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NET_SNMP_LIBS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$NET_SNMP_LIBS"; then
+ ac_cv_prog_NET_SNMP_LIBS="$NET_SNMP_LIBS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NET_SNMP_LIBS="`net-snmp-config --netsnmp-agent-libs`"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+NET_SNMP_LIBS=$ac_cv_prog_NET_SNMP_LIBS
+if test -n "$NET_SNMP_LIBS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NET_SNMP_LIBS" >&5
+$as_echo "$NET_SNMP_LIBS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ ac_fn_cxx_check_decl "$LINENO" "snmp_select_info2" "ac_cv_have_decl_snmp_select_info2" "$ac_includes_default
+ #include <net-snmp/net-snmp-config.h>
+ #include <net-snmp/definitions.h>
+ #include <net-snmp/types.h>
+ #include <net-snmp/utilities.h>
+ #include <net-snmp/config_api.h>
+ #include <net-snmp/session_api.h>
+
+"
+if test "x$ac_cv_have_decl_snmp_select_info2" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SNMP_SELECT_INFO2 $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+
+
+$as_echo "#define HAVE_SNMP_SELECT_INFO2 1" >>confdefs.h
+
+
+else
+ :
+fi
+
+
+fi
+
+fi
+ if test "x$with_net_snmp" = "xyes"; then :
+
+ if test x"$NET_SNMP_LIBS" = "x"; then :
+
+ as_fn_error $? "Net SNMP requested but libraries were not found" "$LINENO" 5
+
+fi
+
+fi
+ if test x"$NET_SNMP_LIBS" != "x"; then
+ HAVE_NET_SNMP_TRUE=
+ HAVE_NET_SNMP_FALSE='#'
+else
+ HAVE_NET_SNMP_TRUE='#'
+ HAVE_NET_SNMP_FALSE=
+fi
+
+ if test x"$NET_SNMP_LIBS" != "x"; then :
+
+$as_echo "#define HAVE_NET_SNMP 1" >>confdefs.h
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we will be linking in libcap" >&5
+$as_echo_n "checking whether we will be linking in libcap... " >&6; }
+ HAVE_LIBCAPS=0
+
+# Check whether --with-libcap was given.
+if test "${with_libcap+set}" = set; then :
+ withval=$with_libcap; with_libcap=$withval
+else
+ with_libcap=auto
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_libcap" >&5
+$as_echo "$with_libcap" >&6; }
+
+ if test "x$with_libcap" != "xno"; then :
+
+ if test "x$with_libcap" = "xyes" -o "x$with_libcap" = "xauto"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBCAP" >&5
+$as_echo_n "checking for LIBCAP... " >&6; }
+
+if test -n "$LIBCAP_CFLAGS"; then
+ pkg_cv_LIBCAP_CFLAGS="$LIBCAP_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcap \""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libcap ") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBCAP_CFLAGS=`$PKG_CONFIG --cflags "libcap " 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBCAP_LIBS"; then
+ pkg_cv_LIBCAP_LIBS="$LIBCAP_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcap \""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libcap ") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBCAP_LIBS=`$PKG_CONFIG --libs "libcap " 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBCAP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcap " 2>&1`
+ else
+ LIBCAP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcap " 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBCAP_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LIBCAP_CFLAGS=$pkg_cv_LIBCAP_CFLAGS
+ LIBCAP_LIBS=$pkg_cv_LIBCAP_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ HAVE_LIBCAP=1
+
+$as_echo "#define HAVE_LIBCAP 1" >>confdefs.h
+
+
+fi
+
+fi
+
+fi
+ if test "x$LIBCAP_LIBS" != "x"; then
+ HAVE_LIBCAP_TRUE=
+ HAVE_LIBCAP_FALSE='#'
+else
+ HAVE_LIBCAP_TRUE='#'
+ HAVE_LIBCAP_FALSE=
+fi
+
+ if test "x$with_libcap" = "xyes"; then :
+
+ if test x"$LIBCAP_LIBS" = "x"; then :
+
+ as_fn_error $? "libcap requested but libraries were not found" "$LINENO" 5
+
+fi
+
+fi
+
+
+
+
+
+# Check whether --enable-systemd was given.
+if test "${enable_systemd+set}" = set; then :
+ enableval=$enable_systemd;
+fi
+
+
+if test "x$enable_systemd" = "xno"; then :
+
+ ax_cv_systemd="n"
+
+elif test "x$enable_systemd" = "xyes"; then :
+
+ ax_cv_systemd="y"
+
+elif test -z $ax_cv_systemd; then :
+
+ ax_cv_systemd="n"
+
+fi
+systemd=$ax_cv_systemd
+
+
+
+
+# Check whether --with-systemd was given.
+if test "${with_systemd+set}" = set; then :
+ withval=$with_systemd; SYSTEMD_DIR="$withval"
+else
+ SYSTEMD_DIR=""
+fi
+
+
+
+
+# Check whether --with-systemd was given.
+if test "${with_systemd+set}" = set; then :
+ withval=$with_systemd; SYSTEMD_MODULES_LOAD="$withval"
+else
+ SYSTEMD_MODULES_LOAD=""
+fi
+
+
+
+
+
+ ac_fn_cxx_check_header_mongrel "$LINENO" "systemd/sd-daemon.h" "ac_cv_header_systemd_sd_daemon_h" "$ac_includes_default"
+if test "x$ac_cv_header_systemd_sd_daemon_h" = xyes; then :
+
+ for libname in systemd-daemon systemd; do
+ as_ac_Lib=`$as_echo "ac_cv_lib_$libname''_sd_listen_fds" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sd_listen_fds in -l$libname" >&5
+$as_echo_n "checking for sd_listen_fds in -l$libname... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$libname $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char sd_listen_fds ();
+int
+main ()
+{
+return sd_listen_fds ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ eval "$as_ac_Lib=yes"
+else
+ eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+
+ libsystemd_daemon="lib$libname"
+ systemd=y
+ libsystemd=y
+
+fi
+
+ done
+
+fi
+
+
+
+
+ if test "x$enable_systemd" != "xno"; then :
+
+ if test "x$systemd" = "xy" ; then :
+
+
+$as_echo "#define HAVE_SYSTEMD 1" >>confdefs.h
+
+ systemd=y
+
+
+ if test "x$libsystemd" = x; then :
+
+ as_fn_error $? "Unable to find a suitable libsystemd library" "$LINENO" 5
+
+fi
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SYSTEMD" >&5
+$as_echo_n "checking for SYSTEMD... " >&6; }
+
+if test -n "$SYSTEMD_CFLAGS"; then
+ pkg_cv_SYSTEMD_CFLAGS="$SYSTEMD_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$libsystemd_daemon\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$libsystemd_daemon") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_CFLAGS=`$PKG_CONFIG --cflags "$libsystemd_daemon" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$SYSTEMD_LIBS"; then
+ pkg_cv_SYSTEMD_LIBS="$SYSTEMD_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$libsystemd_daemon\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$libsystemd_daemon") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_SYSTEMD_LIBS=`$PKG_CONFIG --libs "$libsystemd_daemon" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$libsystemd_daemon" 2>&1`
+ else
+ SYSTEMD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$libsystemd_daemon" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$SYSTEMD_PKG_ERRORS" >&5
+
+ as_fn_error $? "Package requirements ($libsystemd_daemon) were not met:
+
+$SYSTEMD_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables SYSTEMD_CFLAGS
+and SYSTEMD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details." "$LINENO" 5
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables SYSTEMD_CFLAGS
+and SYSTEMD_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details" "$LINENO" 5; }
+else
+ SYSTEMD_CFLAGS=$pkg_cv_SYSTEMD_CFLAGS
+ SYSTEMD_LIBS=$pkg_cv_SYSTEMD_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+fi
+
+
+
+ if test "x$SYSTEMD_DIR" = x; then :
+
+ SYSTEMD_DIR="\$(prefix)/lib/systemd/system/"
+
+fi
+
+ if test "x$SYSTEMD_DIR" = x; then :
+
+ as_fn_error $? "SYSTEMD_DIR is unset" "$LINENO" 5
+
+fi
+
+ if test "x$SYSTEMD_MODULES_LOAD" = x; then :
+
+ SYSTEMD_MODULES_LOAD="\$(prefix)/lib/modules-load.d/"
+
+fi
+
+ if test "x$SYSTEMD_MODULES_LOAD" = x; then :
+
+ as_fn_error $? "SYSTEMD_MODULES_LOAD is unset" "$LINENO" 5
+
+fi
+
+
+else
+ systemd=n
+fi
+
+else
+ systemd=n
+fi
+
+
+
+ if test x"$systemd" = "xy"; then :
+
+ # Extract the first word of "systemctl", so it can be a program name with args.
+set dummy systemctl; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_SYSTEMCTL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $SYSTEMCTL in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_SYSTEMCTL="$SYSTEMCTL" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_SYSTEMCTL="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_SYSTEMCTL" && ac_cv_path_SYSTEMCTL="no"
+ ;;
+esac
+fi
+SYSTEMCTL=$ac_cv_path_SYSTEMCTL
+if test -n "$SYSTEMCTL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSTEMCTL" >&5
+$as_echo "$SYSTEMCTL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ if test "$SYSTEMCTL" = "no"; then :
+ as_fn_error $? "systemctl not found" "$LINENO" 5
+else
+
+ _systemd_version=`${SYSTEMCTL} --version|head -1 |cut -d" " -f 2`
+ if test $_systemd_version -ge 183; then
+ systemd_private_tmp=y
+ fi
+ if test $_systemd_version -ge 209; then
+ systemd_system_call_architectures=y
+ systemd_private_devices=y
+ fi
+ if test $_systemd_version -ge 211; then
+ systemd_restrict_address_families=y
+ fi
+ if test $_systemd_version -ge 214; then
+ systemd_protect_system=y
+ systemd_protect_home=y
+ fi
+ if test $_systemd_version -ge 231; then
+ systemd_restrict_realtime=y
+ systemd_memory_deny_write_execute=y
+ fi
+ if test $_systemd_version -ge 232; then
+ systemd_protect_control_groups=y
+ systemd_protect_kernel_modules=y
+ systemd_protect_kernel_tunables=y
+ systemd_remove_ipc=y
+ systemd_dynamic_user=y
+ systemd_private_users=y
+ systemd_protect_system_strict=y
+ fi
+ if test $_systemd_version -ge 233; then
+ systemd_restrict_namespaces=y
+ fi
+ if test $_systemd_version -ge 235; then
+ systemd_lock_personality=y
+ # while SystemCallFilter is technically available starting with 187,
+ # we use the pre-defined call filter sets that have been introduced later.
+ # Initial support for these landed in 231
+ # @filesystem @reboot @swap in 233
+ # @aio, @sync, @chown, @setuid, @memlock, @signal and @timer in 235
+ systemd_system_call_filter=y
+ fi
+ if test $_systemd_version -ge 236; then
+ systemd_percent_t=y
+ fi
+ if test $_systemd_version -ge 239; then
+ systemd_private_mounts=y
+ fi
+ if test $_systemd_version -ge 240; then
+ systemd_with_runtime_dir_env=y
+ fi
+ if test $_systemd_version -ge 242; then
+ systemd_protect_hostname=y
+ systemd_restrict_suidsgid=y
+ fi
+ if test $_systemd_version -ge 244; then
+ systemd_protect_kernel_logs=y
+ fi
+ if test $_systemd_version -ge 245; then
+ systemd_protect_clock=y
+ fi
+
+fi
+
+fi
+ if test x"$systemd_dynamic_user" = "xy" ; then
+ HAVE_SYSTEMD_DYNAMIC_USER_TRUE=
+ HAVE_SYSTEMD_DYNAMIC_USER_FALSE='#'
+else
+ HAVE_SYSTEMD_DYNAMIC_USER_TRUE='#'
+ HAVE_SYSTEMD_DYNAMIC_USER_FALSE=
+fi
+
+ if test x"$systemd_lock_personality" = "xy" ; then
+ HAVE_SYSTEMD_LOCK_PERSONALITY_TRUE=
+ HAVE_SYSTEMD_LOCK_PERSONALITY_FALSE='#'
+else
+ HAVE_SYSTEMD_LOCK_PERSONALITY_TRUE='#'
+ HAVE_SYSTEMD_LOCK_PERSONALITY_FALSE=
+fi
+
+ if test x"$systemd_memory_deny_write_execute" = "xy" ; then
+ HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE_TRUE=
+ HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE_FALSE='#'
+else
+ HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE_TRUE='#'
+ HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE_FALSE=
+fi
+
+ if test x"$systemd_percent_t" = "xy" ; then
+ HAVE_SYSTEMD_PERCENT_T_TRUE=
+ HAVE_SYSTEMD_PERCENT_T_FALSE='#'
+else
+ HAVE_SYSTEMD_PERCENT_T_TRUE='#'
+ HAVE_SYSTEMD_PERCENT_T_FALSE=
+fi
+
+ if test x"$systemd_private_devices" = "xy" ; then
+ HAVE_SYSTEMD_PRIVATE_DEVICES_TRUE=
+ HAVE_SYSTEMD_PRIVATE_DEVICES_FALSE='#'
+else
+ HAVE_SYSTEMD_PRIVATE_DEVICES_TRUE='#'
+ HAVE_SYSTEMD_PRIVATE_DEVICES_FALSE=
+fi
+
+ if test x"$systemd_private_mounts" = "xy" ; then
+ HAVE_SYSTEMD_PRIVATE_MOUNTS_TRUE=
+ HAVE_SYSTEMD_PRIVATE_MOUNTS_FALSE='#'
+else
+ HAVE_SYSTEMD_PRIVATE_MOUNTS_TRUE='#'
+ HAVE_SYSTEMD_PRIVATE_MOUNTS_FALSE=
+fi
+
+ if test x"$systemd_private_tmp" = "xy" ; then
+ HAVE_SYSTEMD_PRIVATE_TMP_TRUE=
+ HAVE_SYSTEMD_PRIVATE_TMP_FALSE='#'
+else
+ HAVE_SYSTEMD_PRIVATE_TMP_TRUE='#'
+ HAVE_SYSTEMD_PRIVATE_TMP_FALSE=
+fi
+
+ if test x"$systemd_private_users" = "xy" ; then
+ HAVE_SYSTEMD_PRIVATE_USERS_TRUE=
+ HAVE_SYSTEMD_PRIVATE_USERS_FALSE='#'
+else
+ HAVE_SYSTEMD_PRIVATE_USERS_TRUE='#'
+ HAVE_SYSTEMD_PRIVATE_USERS_FALSE=
+fi
+
+ if test x"$systemd_protect_clock" = "xy" ; then
+ HAVE_SYSTEMD_PROTECT_CLOCK_TRUE=
+ HAVE_SYSTEMD_PROTECT_CLOCK_FALSE='#'
+else
+ HAVE_SYSTEMD_PROTECT_CLOCK_TRUE='#'
+ HAVE_SYSTEMD_PROTECT_CLOCK_FALSE=
+fi
+
+ if test x"$systemd_protect_control_groups" = "xy" ; then
+ HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS_TRUE=
+ HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS_FALSE='#'
+else
+ HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS_TRUE='#'
+ HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS_FALSE=
+fi
+
+ if test x"$systemd_protect_home" = "xy" ; then
+ HAVE_SYSTEMD_PROTECT_HOME_TRUE=
+ HAVE_SYSTEMD_PROTECT_HOME_FALSE='#'
+else
+ HAVE_SYSTEMD_PROTECT_HOME_TRUE='#'
+ HAVE_SYSTEMD_PROTECT_HOME_FALSE=
+fi
+
+ if test x"$systemd_protect_hostname" = "xy" ; then
+ HAVE_SYSTEMD_PROTECT_HOSTNAME_TRUE=
+ HAVE_SYSTEMD_PROTECT_HOSTNAME_FALSE='#'
+else
+ HAVE_SYSTEMD_PROTECT_HOSTNAME_TRUE='#'
+ HAVE_SYSTEMD_PROTECT_HOSTNAME_FALSE=
+fi
+
+ if test x"$systemd_protect_kernel_logs" = "xy" ; then
+ HAVE_SYSTEMD_PROTECT_KERNEL_LOGS_TRUE=
+ HAVE_SYSTEMD_PROTECT_KERNEL_LOGS_FALSE='#'
+else
+ HAVE_SYSTEMD_PROTECT_KERNEL_LOGS_TRUE='#'
+ HAVE_SYSTEMD_PROTECT_KERNEL_LOGS_FALSE=
+fi
+
+ if test x"$systemd_protect_kernel_modules" = "xy" ; then
+ HAVE_SYSTEMD_PROTECT_KERNEL_MODULES_TRUE=
+ HAVE_SYSTEMD_PROTECT_KERNEL_MODULES_FALSE='#'
+else
+ HAVE_SYSTEMD_PROTECT_KERNEL_MODULES_TRUE='#'
+ HAVE_SYSTEMD_PROTECT_KERNEL_MODULES_FALSE=
+fi
+
+ if test x"$systemd_protect_kernel_tunables" = "xy" ; then
+ HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES_TRUE=
+ HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES_FALSE='#'
+else
+ HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES_TRUE='#'
+ HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES_FALSE=
+fi
+
+ if test x"$systemd_protect_system" = "xy" ; then
+ HAVE_SYSTEMD_PROTECT_SYSTEM_TRUE=
+ HAVE_SYSTEMD_PROTECT_SYSTEM_FALSE='#'
+else
+ HAVE_SYSTEMD_PROTECT_SYSTEM_TRUE='#'
+ HAVE_SYSTEMD_PROTECT_SYSTEM_FALSE=
+fi
+
+ if test x"$systemd_protect_system_strict" = "xy" ; then
+ HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT_TRUE=
+ HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT_FALSE='#'
+else
+ HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT_TRUE='#'
+ HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT_FALSE=
+fi
+
+ if test x"$systemd_remove_ipc" = "xy" ; then
+ HAVE_SYSTEMD_REMOVE_IPC_TRUE=
+ HAVE_SYSTEMD_REMOVE_IPC_FALSE='#'
+else
+ HAVE_SYSTEMD_REMOVE_IPC_TRUE='#'
+ HAVE_SYSTEMD_REMOVE_IPC_FALSE=
+fi
+
+ if test x"$systemd_restrict_address_families" = "xy" ; then
+ HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES_TRUE=
+ HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES_FALSE='#'
+else
+ HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES_TRUE='#'
+ HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES_FALSE=
+fi
+
+ if test x"$systemd_restrict_namespaces" = "xy" ; then
+ HAVE_SYSTEMD_RESTRICT_NAMESPACES_TRUE=
+ HAVE_SYSTEMD_RESTRICT_NAMESPACES_FALSE='#'
+else
+ HAVE_SYSTEMD_RESTRICT_NAMESPACES_TRUE='#'
+ HAVE_SYSTEMD_RESTRICT_NAMESPACES_FALSE=
+fi
+
+ if test x"$systemd_restrict_realtime" = "xy" ; then
+ HAVE_SYSTEMD_RESTRICT_REALTIME_TRUE=
+ HAVE_SYSTEMD_RESTRICT_REALTIME_FALSE='#'
+else
+ HAVE_SYSTEMD_RESTRICT_REALTIME_TRUE='#'
+ HAVE_SYSTEMD_RESTRICT_REALTIME_FALSE=
+fi
+
+ if test x"$systemd_restrict_suidsgid" = "xy" ; then
+ HAVE_SYSTEMD_RESTRICT_SUIDSGID_TRUE=
+ HAVE_SYSTEMD_RESTRICT_SUIDSGID_FALSE='#'
+else
+ HAVE_SYSTEMD_RESTRICT_SUIDSGID_TRUE='#'
+ HAVE_SYSTEMD_RESTRICT_SUIDSGID_FALSE=
+fi
+
+ if test x"$systemd_system_call_architectures" = "xy" ; then
+ HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES_TRUE=
+ HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES_FALSE='#'
+else
+ HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES_TRUE='#'
+ HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES_FALSE=
+fi
+
+ if test x"$systemd_system_call_filter" = "xy" ; then
+ HAVE_SYSTEMD_SYSTEM_CALL_FILTER_TRUE=
+ HAVE_SYSTEMD_SYSTEM_CALL_FILTER_FALSE='#'
+else
+ HAVE_SYSTEMD_SYSTEM_CALL_FILTER_TRUE='#'
+ HAVE_SYSTEMD_SYSTEM_CALL_FILTER_FALSE=
+fi
+
+ if test x"$systemd_with_runtime_dir_env" = "xy" ; then
+ HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV_TRUE=
+ HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV_FALSE='#'
+else
+ HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV_TRUE='#'
+ HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV_FALSE=
+fi
+
+
+ if test x"$systemd" = "xy" ; then
+ HAVE_SYSTEMD_TRUE=
+ HAVE_SYSTEMD_FALSE='#'
+else
+ HAVE_SYSTEMD_TRUE='#'
+ HAVE_SYSTEMD_FALSE=
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking What user and group will be used by service" >&5
+$as_echo_n "checking What user and group will be used by service... " >&6; }
+
+# Check whether --with-service-user was given.
+if test "${with_service_user+set}" = set; then :
+ withval=$with_service_user; service_user=$withval
+
+else
+ service_user=dnsdist
+
+
+fi
+
+
+
+# Check whether --with-service-group was given.
+if test "${with_service_group+set}" = set; then :
+ withval=$with_service_group; service_group=$withval
+
+else
+ service_group=dnsdist
+
+
+fi
+
+
+ if test -z "$service_user"; then :
+ as_fn_error $? "No service user has been defined!" "$LINENO" 5
+else
+ :
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $service_user" >&5
+$as_echo "$service_user" >&6; }
+
+
+
+
+
+ for ac_func in $ac_func_list
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+YAHTTP_CFLAGS='-I$(top_srcdir)/ext/yahttp'
+
+YAHTTP_LIBS='$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'
+
+IPCRYPT_CFLAGS='-I$(top_srcdir)/ext/ipcrypt'
+
+IPCRYPT_LIBS='$(top_builddir)/ext/ipcrypt/libipcrypt.la'
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$GREP"; then
+ ac_path_GREP_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ $as_echo_n 0123456789 >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ $as_echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ as_fn_arith $ac_count + 1 && ac_count=$as_val
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+ $ac_path_GREP_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_GREP"; then
+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+ fi
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking which Lua implementation to use" >&5
+$as_echo_n "checking which Lua implementation to use... " >&6; }
+
+# Check whether --with-lua was given.
+if test "${with_lua+set}" = set; then :
+ withval=$with_lua;
+ with_lua=$withval
+
+else
+
+ with_lua=auto
+
+fi
+
+
+ if test "x$with_lua" = "xyes"; then :
+
+ with_lua=auto
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lua" >&5
+$as_echo "$with_lua" >&6; }
+
+ if test "x$with_lua" = "xno" -a "mandatory" = "mandatory"; then :
+
+ as_fn_error $? "--without-lua specified, but Lua is not optional" "$LINENO" 5
+
+fi
+
+ LUAPC=""
+ luajit_min_version='2.0.2'
+ lua_min_version='5.1'
+
+ if test "x$with_lua" != "xno"; then :
+
+ if test "x$with_lua" != "xauto"; then :
+
+ with_lua_version=${lua_min_version}
+ if echo "x$with_lua" | ${GREP} 'jit' >/dev/null 2>&1; then :
+ with_lua_version=${luajit_min_version}
+fi
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$with_lua >= \$with_lua_version\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$with_lua >= $with_lua_version") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "$with_lua >= $with_lua_version" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$with_lua >= \$with_lua_version\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "$with_lua >= $with_lua_version") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "$with_lua >= $with_lua_version" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$with_lua >= $with_lua_version" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$with_lua >= $with_lua_version" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+
+ as_fn_error $? "Selected Lua ($with_lua) not found" "$LINENO" 5
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+ as_fn_error $? "Selected Lua ($with_lua) not found" "$LINENO" 5
+
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ LUAPC=$with_lua
+
+fi
+
+else
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"luajit >= \${luajit_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "luajit >= ${luajit_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "luajit >= ${luajit_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"luajit >= \${luajit_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "luajit >= ${luajit_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "luajit >= ${luajit_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "luajit >= ${luajit_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "luajit >= ${luajit_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ LUAPC=luajit
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+
+fi
+ if test -z "$LUAPC"; then :
+
+ found_lua=n
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.3 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua5.3 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua5.3 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.3 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua5.3 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua5.3 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua5.3 >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua5.3 >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua5.3
+
+fi
+
+fi
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.3 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua-5.3 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua-5.3 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.3 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua-5.3 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua-5.3 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua-5.3 >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua-5.3 >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua-5.3
+
+fi
+
+fi
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua53 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua53 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua53 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua53 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua53 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua53 >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua53 >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua53
+
+fi
+
+fi
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.2 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua5.2 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua5.2 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.2 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua5.2 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua5.2 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua5.2 >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua5.2 >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua5.2
+
+fi
+
+fi
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.2 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua-5.2 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua-5.2 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.2 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua-5.2 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua-5.2 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua-5.2 >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua-5.2 >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua-5.2
+
+fi
+
+fi
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua52 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua52 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua52 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua52 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua52 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua52 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua52 >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua52 >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua52
+
+fi
+
+fi
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua5.1 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua5.1 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua5.1 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua5.1 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua5.1 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua5.1 >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua5.1 >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua5.1
+
+fi
+
+fi
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua-5.1 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua-5.1 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua-5.1 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua-5.1 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua-5.1 >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua-5.1 >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua-5.1
+
+fi
+
+fi
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua51 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua51 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua51 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua51 >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua51 >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua51 >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua51 >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua51 >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua51
+
+fi
+
+fi
+
+ if test "$found_lua" != "y"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5
+$as_echo_n "checking for LUA... " >&6; }
+
+if test -n "$LUA_CFLAGS"; then
+ pkg_cv_LUA_CFLAGS="$LUA_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LUA_LIBS"; then
+ pkg_cv_LUA_LIBS="$LUA_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua >= \${lua_min_version}\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lua >= ${lua_min_version}") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua >= ${lua_min_version}" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lua >= ${lua_min_version}" 2>&1`
+ else
+ LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lua >= ${lua_min_version}" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LUA_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LUA_CFLAGS=$pkg_cv_LUA_CFLAGS
+ LUA_LIBS=$pkg_cv_LUA_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LUA 1" >>confdefs.h
+
+ found_lua=y
+ LUAPC=lua
+
+fi
+
+fi
+
+
+fi
+
+fi
+
+fi
+
+ if test -z "$LUAPC" -a "mandatory" = "mandatory"; then :
+
+ as_fn_error $? "No Lua not found, but is mandatory" "$LINENO" 5
+
+fi
+
+ if test -n "x$LUAPC"; then
+ LUA_TRUE=
+ LUA_FALSE='#'
+else
+ LUA_TRUE='#'
+ LUA_FALSE=
+fi
+
+
+if test "x$LUAPC" = "xluajit"; then :
+
+ # export all symbols to be able to use the Lua FFI interface
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Adding -rdynamic to export all symbols for the Lua FFI interface" >&5
+$as_echo "$as_me: Adding -rdynamic to export all symbols for the Lua FFI interface" >&6;}
+ LDFLAGS="$LDFLAGS -rdynamic"
+
+fi
+
+
+ if test "x$LUAPC" != "x" ; then :
+
+ OLD_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
+ ac_fn_cxx_check_header_mongrel "$LINENO" "lua.hpp" "ac_cv_header_lua_hpp" "$ac_includes_default"
+if test "x$ac_cv_header_lua_hpp" = xyes; then :
+ have_lua_hpp=y
+fi
+
+
+ CPPFLAGS="$OLD_CPPFLAGS"
+
+fi
+ if test x"$have_lua_hpp" = "xy" ; then
+ HAVE_LUA_HPP_TRUE=
+ HAVE_LUA_HPP_FALSE='#'
+else
+ HAVE_LUA_HPP_TRUE='#'
+ HAVE_LUA_HPP_FALSE=
+fi
+
+
+
+ if false; then
+ HAVE_GNUTLS_TRUE=
+ HAVE_GNUTLS_FALSE='#'
+else
+ HAVE_GNUTLS_TRUE='#'
+ HAVE_GNUTLS_FALSE=
+fi
+
+ if false; then
+ HAVE_LIBSSL_TRUE=
+ HAVE_LIBSSL_FALSE='#'
+else
+ HAVE_LIBSSL_TRUE='#'
+ HAVE_LIBSSL_FALSE=
+fi
+
+ if false; then
+ HAVE_LMDB_TRUE=
+ HAVE_LMDB_FALSE='#'
+else
+ HAVE_LMDB_TRUE='#'
+ HAVE_LMDB_FALSE=
+fi
+
+ if false; then
+ HAVE_CDB_TRUE=
+ HAVE_CDB_FALSE='#'
+else
+ HAVE_CDB_TRUE='#'
+ HAVE_CDB_FALSE=
+fi
+
+
+
+ found=false
+
+# Check whether --with-libcrypto was given.
+if test "${with_libcrypto+set}" = set; then :
+ withval=$with_libcrypto;
+ case "$withval" in
+ "" | y | ye | yes | n | no)
+ as_fn_error $? "Invalid --with-libcrypto value" "$LINENO" 5
+ ;;
+ *) ssldirs="$withval"
+ ;;
+ esac
+
+else
+
+ # if pkg-config is installed and openssl has installed a .pc file,
+ # then use that information and don't search ssldirs
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$PKG_CONFIG"; then
+ ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_PKG_CONFIG="${ac_tool_prefix}pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_PKG_CONFIG"; then
+ ac_ct_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_PKG_CONFIG+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_PKG_CONFIG"; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="$ac_ct_PKG_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_PKG_CONFIG="pkg-config"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_PKG_CONFIG=$ac_cv_prog_ac_ct_PKG_CONFIG
+if test -n "$ac_ct_PKG_CONFIG"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_PKG_CONFIG" >&5
+$as_echo "$ac_ct_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_ct_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_prog_PKG_CONFIG"
+fi
+
+ if test x"$PKG_CONFIG" != x""; then
+ LIBCRYPTO_LDFLAGS=`$PKG_CONFIG libcrypto --libs-only-L 2>/dev/null`
+ if test $? = 0; then
+ LIBCRYPTO_LIBS=`$PKG_CONFIG libcrypto --libs-only-l 2>/dev/null`
+ LIBCRYPTO_INCLUDES=`$PKG_CONFIG libcrypto --cflags-only-I 2>/dev/null`
+ ssldir=`$PKG_CONFIG libcrypto --variable=prefix 2>/dev/null`
+ found=true
+ fi
+ fi
+
+ # no such luck; use some default ssldirs
+ if ! $found; then
+ ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
+ fi
+
+
+fi
+
+
+
+ # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
+ # an 'openssl' subdirectory
+
+ if ! $found; then
+ LIBCRYPTO_INCLUDES=
+ for ssldir in $ssldirs; do
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl/crypto.h in $ssldir" >&5
+$as_echo_n "checking for openssl/crypto.h in $ssldir... " >&6; }
+ if test -f "$ssldir/include/openssl/crypto.h"; then
+ LIBCRYPTO_INCLUDES="-I$ssldir/include"
+ LIBCRYPTO_LDFLAGS="-L$ssldir/lib"
+ LIBCRYPTO_LIBS="-lcrypto"
+ found=true
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ break
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ fi
+ done
+
+ # if the file wasn't found, well, go ahead and try the link anyway -- maybe
+ # it will just work!
+ fi
+
+ if $found; then
+
+$as_echo "#define HAVE_LIBCRYPTO 1" >>confdefs.h
+
+ fi
+
+ # try the preprocessor and linker with our new flags,
+ # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling and linking against OpenSSL's libcrypto works" >&5
+$as_echo_n "checking whether compiling and linking against OpenSSL's libcrypto works... " >&6; }
+ echo "Trying link with LIBCRYPTO_LDFLAGS=$LIBCRYPTO_LDFLAGS;" \
+ "LIBCRYPTO_LIBS=$LIBCRYPTO_LIBS; LIBCRYPTO_INCLUDES=$LIBCRYPTO_INCLUDES" >&5
+
+ save_LIBS="$LIBS"
+ save_LDFLAGS="$LDFLAGS"
+ save_CPPFLAGS="$CPPFLAGS"
+ LDFLAGS="$LDFLAGS $LIBCRYPTO_LDFLAGS"
+ LIBS="$LIBCRYPTO_LIBS $LIBS"
+ CPPFLAGS="$LIBCRYPTO_INCLUDES $CPPFLAGS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <openssl/crypto.h>
+int
+main ()
+{
+ERR_load_CRYPTO_strings()
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ for ac_func in RAND_bytes RAND_pseudo_bytes CRYPTO_memcmp OPENSSL_init_crypto EVP_MD_CTX_new EVP_MD_CTX_free RSA_get0_key
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ ac_fn_cxx_check_decl "$LINENO" "EVP_PKEY_CTX_set1_scrypt_salt" "ac_cv_have_decl_EVP_PKEY_CTX_set1_scrypt_salt" "#include <openssl/kdf.h>
+"
+if test "x$ac_cv_have_decl_EVP_PKEY_CTX_set1_scrypt_salt" = xyes; then :
+
+$as_echo "#define HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT 1" >>confdefs.h
+
+fi
+
+
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+
+
+
+
+ if test "x$LIBCRYPTO_LIBS" != "x"; then
+ HAVE_LIBCRYPTO_TRUE=
+ HAVE_LIBCRYPTO_FALSE='#'
+else
+ HAVE_LIBCRYPTO_TRUE='#'
+ HAVE_LIBCRYPTO_FALSE=
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable DNS over TLS support" >&5
+$as_echo_n "checking whether to enable DNS over TLS support... " >&6; }
+ # Check whether --enable-dns-over-tls was given.
+if test "${enable_dns_over_tls+set}" = set; then :
+ enableval=$enable_dns_over_tls; enable_dns_over_tls=$enableval
+else
+ enable_dns_over_tls=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dns_over_tls" >&5
+$as_echo "$enable_dns_over_tls" >&6; }
+ if test "x$enable_dns_over_tls" != "xno"; then
+ HAVE_DNS_OVER_TLS_TRUE=
+ HAVE_DNS_OVER_TLS_FALSE='#'
+else
+ HAVE_DNS_OVER_TLS_TRUE='#'
+ HAVE_DNS_OVER_TLS_FALSE=
+fi
+
+
+ if test -z "$HAVE_DNS_OVER_TLS_TRUE"; then :
+
+
+$as_echo "#define HAVE_DNS_OVER_TLS 1" >>confdefs.h
+
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable incoming DNS over HTTPS (DoH) support" >&5
+$as_echo_n "checking whether to enable incoming DNS over HTTPS (DoH) support... " >&6; }
+ # Check whether --enable-dns-over-https was given.
+if test "${enable_dns_over_https+set}" = set; then :
+ enableval=$enable_dns_over_https; enable_dns_over_https=$enableval
+else
+ enable_dns_over_https=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dns_over_https" >&5
+$as_echo "$enable_dns_over_https" >&6; }
+ if test "x$enable_dns_over_https" != "xno"; then
+ HAVE_DNS_OVER_HTTPS_TRUE=
+ HAVE_DNS_OVER_HTTPS_FALSE='#'
+else
+ HAVE_DNS_OVER_HTTPS_TRUE='#'
+ HAVE_DNS_OVER_HTTPS_FALSE=
+fi
+
+
+ if test -z "$HAVE_DNS_OVER_HTTPS_TRUE"; then :
+
+
+$as_echo "#define HAVE_DNS_OVER_HTTPS 1" >>confdefs.h
+
+
+fi
+
+
+if test "x$enable_dns_over_tls" != "xno" -o "x$enable_dns_over_https" != "xno"; then :
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we will be linking in OpenSSL libssl" >&5
+$as_echo_n "checking whether we will be linking in OpenSSL libssl... " >&6; }
+ HAVE_LIBSSL=0
+
+# Check whether --with-libssl was given.
+if test "${with_libssl+set}" = set; then :
+ withval=$with_libssl; with_libssl=$withval
+else
+ with_libssl=auto
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_libssl" >&5
+$as_echo "$with_libssl" >&6; }
+
+ if test "x$with_libssl" != "xno"; then :
+
+ if test "x$with_libssl" = "xyes" -o "x$with_libssl" = "xauto"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSSL" >&5
+$as_echo_n "checking for LIBSSL... " >&6; }
+
+if test -n "$LIBSSL_CFLAGS"; then
+ pkg_cv_LIBSSL_CFLAGS="$LIBSSL_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libssl\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libssl") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSSL_CFLAGS=`$PKG_CONFIG --cflags "libssl" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBSSL_LIBS"; then
+ pkg_cv_LIBSSL_LIBS="$LIBSSL_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libssl\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libssl") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBSSL_LIBS=`$PKG_CONFIG --libs "libssl" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBSSL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libssl" 2>&1`
+ else
+ LIBSSL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libssl" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBSSL_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LIBSSL_CFLAGS=$pkg_cv_LIBSSL_CFLAGS
+ LIBSSL_LIBS=$pkg_cv_LIBSSL_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ HAVE_LIBSSL=1
+
+$as_echo "#define HAVE_LIBSSL 1" >>confdefs.h
+
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$LIBSSL_CFLAGS $CFLAGS"
+ LIBS="$LIBSSL_LIBS -lcrypto $LIBS"
+ for ac_func in SSL_CTX_set_ciphersuites OCSP_basic_sign SSL_CTX_set_num_tickets SSL_CTX_set_keylog_callback SSL_CTX_get0_privatekey SSL_CTX_set_min_proto_version SSL_set_hostflags SSL_CTX_set_alpn_protos SSL_CTX_set_next_proto_select_cb SSL_get0_alpn_selected SSL_get0_next_proto_negotiated SSL_CTX_set_alpn_select_cb
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+
+
+fi
+
+fi
+
+fi
+ if test "x$LIBSSL_LIBS" != "x"; then
+ HAVE_LIBSSL_TRUE=
+ HAVE_LIBSSL_FALSE='#'
+else
+ HAVE_LIBSSL_TRUE='#'
+ HAVE_LIBSSL_FALSE=
+fi
+
+ if test "x$with_libssl" = "xyes"; then :
+
+ if test x"$LIBSSL_LIBS" = "x"; then :
+
+ as_fn_error $? "OpenSSL libssl requested but libraries were not found" "$LINENO" 5
+
+fi
+
+fi
+
+
+fi
+
+if test "x$enable_dns_over_tls" != "xno"; then :
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we will be linking in GnuTLS" >&5
+$as_echo_n "checking whether we will be linking in GnuTLS... " >&6; }
+ HAVE_GNUTLS=0
+
+# Check whether --with-gnutls was given.
+if test "${with_gnutls+set}" = set; then :
+ withval=$with_gnutls; with_gnutls=$withval
+else
+ with_gnutls=auto
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gnutls" >&5
+$as_echo "$with_gnutls" >&6; }
+
+ if test "x$with_gnutls" != "xno"; then :
+
+ if test "x$with_gnutls" = "xyes" -o "x$with_gnutls" = "xauto"; then :
+
+ # we require gnutls_certificate_set_x509_key_file, added in 3.1.11
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNUTLS" >&5
+$as_echo_n "checking for GNUTLS... " >&6; }
+
+if test -n "$GNUTLS_CFLAGS"; then
+ pkg_cv_GNUTLS_CFLAGS="$GNUTLS_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 3.1.11\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "gnutls >= 3.1.11") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_GNUTLS_CFLAGS=`$PKG_CONFIG --cflags "gnutls >= 3.1.11" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$GNUTLS_LIBS"; then
+ pkg_cv_GNUTLS_LIBS="$GNUTLS_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gnutls >= 3.1.11\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "gnutls >= 3.1.11") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_GNUTLS_LIBS=`$PKG_CONFIG --libs "gnutls >= 3.1.11" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ GNUTLS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gnutls >= 3.1.11" 2>&1`
+ else
+ GNUTLS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gnutls >= 3.1.11" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$GNUTLS_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ GNUTLS_CFLAGS=$pkg_cv_GNUTLS_CFLAGS
+ GNUTLS_LIBS=$pkg_cv_GNUTLS_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ HAVE_GNUTLS=1
+
+$as_echo "#define HAVE_GNUTLS 1" >>confdefs.h
+
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$GNUTLS_CFLAGS $CFLAGS"
+ LIBS="$GNUTLS_LIBS $LIBS"
+ for ac_func in gnutls_memset gnutls_session_set_verify_cert gnutls_session_get_verify_cert_status gnutls_alpn_set_protocols
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+
+
+fi
+
+fi
+
+fi
+ if test "x$GNUTLS_LIBS" != "x"; then
+ HAVE_GNUTLS_TRUE=
+ HAVE_GNUTLS_FALSE='#'
+else
+ HAVE_GNUTLS_TRUE='#'
+ HAVE_GNUTLS_FALSE=
+fi
+
+ if test "x$with_gnutls" = "xyes"; then :
+
+ if test x"$GNUTLS_LIBS" = "x"; then :
+
+ as_fn_error $? "GnuTLS requested but libraries were not found" "$LINENO" 5
+
+fi
+
+fi
+
+
+ if test "x$HAVE_GNUTLS" != "x1" -a "x$HAVE_LIBSSL" != "x1"; then :
+
+ as_fn_error $? "DNS over TLS support requested but neither GnuTLS nor OpenSSL are available" "$LINENO" 5
+
+fi
+
+fi
+
+
+ HAVE_LIBH2OEVLOOP=0
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBH2OEVLOOP" >&5
+$as_echo_n "checking for LIBH2OEVLOOP... " >&6; }
+
+if test -n "$LIBH2OEVLOOP_CFLAGS"; then
+ pkg_cv_LIBH2OEVLOOP_CFLAGS="$LIBH2OEVLOOP_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libh2o-evloop\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libh2o-evloop") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBH2OEVLOOP_CFLAGS=`$PKG_CONFIG --cflags "libh2o-evloop" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LIBH2OEVLOOP_LIBS"; then
+ pkg_cv_LIBH2OEVLOOP_LIBS="$LIBH2OEVLOOP_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libh2o-evloop\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libh2o-evloop") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LIBH2OEVLOOP_LIBS=`$PKG_CONFIG --libs "libh2o-evloop" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LIBH2OEVLOOP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libh2o-evloop" 2>&1`
+ else
+ LIBH2OEVLOOP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libh2o-evloop" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LIBH2OEVLOOP_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ LIBH2OEVLOOP_CFLAGS=$pkg_cv_LIBH2OEVLOOP_CFLAGS
+ LIBH2OEVLOOP_LIBS=$pkg_cv_LIBH2OEVLOOP_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ HAVE_LIBH2OEVLOOP=1
+
+$as_echo "#define HAVE_LIBH2OEVLOOP 1" >>confdefs.h
+
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$LIBH2OEVLOOP_CFLAGS $CFLAGS"
+ LIBS="$LIBH2OEVLOOP_LIBS $LIBS"
+ ac_fn_cxx_check_decl "$LINENO" "h2o_socket_get_ssl_server_name" "ac_cv_have_decl_h2o_socket_get_ssl_server_name" "$ac_includes_default
+ #include <h2o/socket.h>
+
+"
+if test "x$ac_cv_have_decl_h2o_socket_get_ssl_server_name" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_H2O_SOCKET_GET_SSL_SERVER_NAME $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+
+
+$as_echo "#define HAVE_H2O_SOCKET_GET_SSL_SERVER_NAME 1" >>confdefs.h
+
+
+else
+ :
+fi
+
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+
+fi
+ if test "x$LIBH2OEVLOOP_LIBS" != "x"; then
+ HAVE_LIBH2OEVLOOP_TRUE=
+ HAVE_LIBH2OEVLOOP_FALSE='#'
+else
+ HAVE_LIBH2OEVLOOP_TRUE='#'
+ HAVE_LIBH2OEVLOOP_FALSE=
+fi
+
+
+if test "x$enable_dns_over_https" != "xno"; then :
+
+ if test "x$HAVE_LIBH2OEVLOOP" != "x1"; then :
+
+ as_fn_error $? "DNS over HTTPS support requested but libh2o-evloop was not found" "$LINENO" 5
+
+fi
+
+ if test "x$HAVE_LIBSSL" != "x1"; then :
+
+ as_fn_error $? "DNS over HTTPS support requested but OpenSSL was not found" "$LINENO" 5
+
+fi
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we will be linking in nghttp2" >&5
+$as_echo_n "checking whether we will be linking in nghttp2... " >&6; }
+ HAVE_NGHTTP2=0
+
+# Check whether --with-nghttp2 was given.
+if test "${with_nghttp2+set}" = set; then :
+ withval=$with_nghttp2; with_nghttp2=$withval
+else
+ with_nghttp2=auto
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_nghttp2" >&5
+$as_echo "$with_nghttp2" >&6; }
+
+ if test "x$with_nghttp2" != "xno"; then :
+
+ if test "x$with_nghttp2" = "xyes" -o "x$with_nghttp2" = "xauto"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NGHTTP2" >&5
+$as_echo_n "checking for NGHTTP2... " >&6; }
+
+if test -n "$NGHTTP2_CFLAGS"; then
+ pkg_cv_NGHTTP2_CFLAGS="$NGHTTP2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnghttp2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libnghttp2") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_NGHTTP2_CFLAGS=`$PKG_CONFIG --cflags "libnghttp2" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$NGHTTP2_LIBS"; then
+ pkg_cv_NGHTTP2_LIBS="$NGHTTP2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnghttp2\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libnghttp2") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_NGHTTP2_LIBS=`$PKG_CONFIG --libs "libnghttp2" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ NGHTTP2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnghttp2" 2>&1`
+ else
+ NGHTTP2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnghttp2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$NGHTTP2_PKG_ERRORS" >&5
+
+ :
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+else
+ NGHTTP2_CFLAGS=$pkg_cv_NGHTTP2_CFLAGS
+ NGHTTP2_LIBS=$pkg_cv_NGHTTP2_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+ HAVE_NGHTTP2=1
+
+$as_echo "#define HAVE_NGHTTP2 1" >>confdefs.h
+
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$NGHTTP2_CFLAGS $CFLAGS"
+ LIBS="$NGHTTP2_LIBS $LIBS"
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+
+
+fi
+
+fi
+
+fi
+ if test "x$NGHTTP2_LIBS" != "x"; then
+ HAVE_NGHTTP2_TRUE=
+ HAVE_NGHTTP2_FALSE='#'
+else
+ HAVE_NGHTTP2_TRUE='#'
+ HAVE_NGHTTP2_FALSE=
+fi
+
+ if test "x$with_nghttp2" = "xyes"; then :
+
+ if test x"$NGHTTP2_LIBS" = "x"; then :
+
+ as_fn_error $? "nghttp2 requested but libraries were not found" "$LINENO" 5
+
+fi
+
+fi
+
+
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CDB" >&5
+$as_echo_n "checking for CDB... " >&6; }
+
+if test -n "$CDB_CFLAGS"; then
+ pkg_cv_CDB_CFLAGS="$CDB_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdb\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libcdb") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_CDB_CFLAGS=`$PKG_CONFIG --cflags "libcdb" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$CDB_LIBS"; then
+ pkg_cv_CDB_LIBS="$CDB_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcdb\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "libcdb") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_CDB_LIBS=`$PKG_CONFIG --libs "libcdb" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ CDB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcdb" 2>&1`
+ else
+ CDB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcdb" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$CDB_PKG_ERRORS" >&5
+
+ for ac_header in cdb.h
+do :
+ ac_fn_cxx_check_header_mongrel "$LINENO" "cdb.h" "ac_cv_header_cdb_h" "$ac_includes_default"
+if test "x$ac_cv_header_cdb_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_CDB_H 1
+_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cdb_find in -lcdb" >&5
+$as_echo_n "checking for cdb_find in -lcdb... " >&6; }
+if ${ac_cv_lib_cdb_cdb_find+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcdb $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cdb_find ();
+int
+main ()
+{
+return cdb_find ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_lib_cdb_cdb_find=yes
+else
+ ac_cv_lib_cdb_cdb_find=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdb_cdb_find" >&5
+$as_echo "$ac_cv_lib_cdb_cdb_find" >&6; }
+if test "x$ac_cv_lib_cdb_cdb_find" = xyes; then :
+
+ CDB_LIBS="-lcdb"
+
+$as_echo "#define HAVE_CDB 1" >>confdefs.h
+
+ HAVE_CDB=1
+
+else
+ :
+
+fi
+
+else
+ :
+
+fi
+
+done
+
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ for ac_header in cdb.h
+do :
+ ac_fn_cxx_check_header_mongrel "$LINENO" "cdb.h" "ac_cv_header_cdb_h" "$ac_includes_default"
+if test "x$ac_cv_header_cdb_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_CDB_H 1
+_ACEOF
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cdb_find in -lcdb" >&5
+$as_echo_n "checking for cdb_find in -lcdb... " >&6; }
+if ${ac_cv_lib_cdb_cdb_find+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcdb $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cdb_find ();
+int
+main ()
+{
+return cdb_find ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_lib_cdb_cdb_find=yes
+else
+ ac_cv_lib_cdb_cdb_find=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cdb_cdb_find" >&5
+$as_echo "$ac_cv_lib_cdb_cdb_find" >&6; }
+if test "x$ac_cv_lib_cdb_cdb_find" = xyes; then :
+
+ CDB_LIBS="-lcdb"
+
+$as_echo "#define HAVE_CDB 1" >>confdefs.h
+
+ HAVE_CDB=1
+
+else
+ :
+
+fi
+
+else
+ :
+
+fi
+
+done
+
+
+else
+ CDB_CFLAGS=$pkg_cv_CDB_CFLAGS
+ CDB_LIBS=$pkg_cv_CDB_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_CDB 1" >>confdefs.h
+
+ HAVE_CDB=1
+
+fi
+
+
+ if test "x$CDB_LIBS" != "x"; then
+ HAVE_CDB_TRUE=
+ HAVE_CDB_FALSE='#'
+else
+ HAVE_CDB_TRUE='#'
+ HAVE_CDB_FALSE=
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the lmdb library and headers" >&5
+$as_echo_n "checking where to find the lmdb library and headers... " >&6; }
+
+# Check whether --with-lmdb was given.
+if test "${with_lmdb+set}" = set; then :
+ withval=$with_lmdb;
+ with_lmdb=$withval
+
+else
+
+ with_lmdb=auto
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lmdb" >&5
+$as_echo "$with_lmdb" >&6; }
+
+ if test "$with_lmdb" != "no"; then :
+
+ if test "x$with_lmdb" = "xyes" -o "x$with_lmdb" = "xauto"; then :
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LMDB" >&5
+$as_echo_n "checking for LMDB... " >&6; }
+
+if test -n "$LMDB_CFLAGS"; then
+ pkg_cv_LMDB_CFLAGS="$LMDB_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lmdb\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lmdb") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LMDB_CFLAGS=`$PKG_CONFIG --cflags "lmdb" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+if test -n "$LMDB_LIBS"; then
+ pkg_cv_LMDB_LIBS="$LMDB_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+ if test -n "$PKG_CONFIG" && \
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lmdb\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "lmdb") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ pkg_cv_LMDB_LIBS=`$PKG_CONFIG --libs "lmdb" 2>/dev/null`
+ test "x$?" != "x0" && pkg_failed=yes
+else
+ pkg_failed=yes
+fi
+ else
+ pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+ _pkg_short_errors_supported=yes
+else
+ _pkg_short_errors_supported=no
+fi
+ if test $_pkg_short_errors_supported = yes; then
+ LMDB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "lmdb" 2>&1`
+ else
+ LMDB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "lmdb" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
+ echo "$LMDB_PKG_ERRORS" >&5
+
+ :
+
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ :
+
+else
+ LMDB_CFLAGS=$pkg_cv_LMDB_CFLAGS
+ LMDB_LIBS=$pkg_cv_LMDB_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+
+$as_echo "#define HAVE_LMDB 1" >>confdefs.h
+
+ HAVE_LMDB=1
+
+fi
+
+else
+
+ save_CPPFLAGS=$CPPFLAGS
+ save_LIBS=$LIBS
+ if test -d "$with_lmdb/include"; then :
+
+ LMDB_CFLAGS="-I$with_lmdb/include"
+ LMDB_LIBS="-L$with_lmdb/lib"
+
+else
+
+ LMDB_CFLAGS="-I$with_lmdb"
+ LMDB_LIBS="-L$with_lmdb"
+
+fi
+ CPPFLAGS="$LMDB_CFLAGS"
+ LIBS="$LMDB_LIBS"
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mdb_env_open" >&5
+$as_echo_n "checking for library containing mdb_env_open... " >&6; }
+if ${ac_cv_search_mdb_env_open+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mdb_env_open ();
+int
+main ()
+{
+return mdb_env_open ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' lmdb; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ ac_cv_search_mdb_env_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_mdb_env_open+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_mdb_env_open+:} false; then :
+
+else
+ ac_cv_search_mdb_env_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mdb_env_open" >&5
+$as_echo "$ac_cv_search_mdb_env_open" >&6; }
+ac_res=$ac_cv_search_mdb_env_open
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+ for ac_header in lmdb.h
+do :
+ ac_fn_cxx_check_header_mongrel "$LINENO" "lmdb.h" "ac_cv_header_lmdb_h" "$ac_includes_default"
+if test "x$ac_cv_header_lmdb_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LMDB_H 1
+_ACEOF
+
+ LMDB_LIBS="$LMDB_LIBS $ac_cv_search_mdb_env_open"
+
+$as_echo "#define HAVE_LMDB 1" >>confdefs.h
+
+ HAVE_LMDB=1
+
+else
+
+ as_fn_error $? "lmdb headers not found in $with_lmdb" "$LINENO" 5
+
+fi
+
+done
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
+
+
+
+fi
+
+
+fi
+
+fi
+ if test "x$LMDB_LIBS" != "x"; then
+ HAVE_LMDB_TRUE=
+ HAVE_LMDB_FALSE='#'
+else
+ HAVE_LMDB_TRUE='#'
+ HAVE_LMDB_FALSE=
+fi
+
+
+
+ ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=true
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ ac_success=no
+
+
+
+ if test x$ac_success = xno; then
+ for alternative in ${ax_cxx_compile_alternatives}; do
+ for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
+ cachevar=`$as_echo "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5
+$as_echo_n "checking whether $CXX supports C++17 features with $switch... " >&6; }
+if eval \${$cachevar+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_CXX="$CXX"
+ CXX="$CXX $switch"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+
+// If the compiler admits that it is not ready for C++11, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201103L
+
+#error "This is not a C++11 compiler"
+
+#else
+
+namespace cxx11
+{
+
+ namespace test_static_assert
+ {
+
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ }
+
+ namespace test_final_override
+ {
+
+ struct Base
+ {
+ virtual ~Base() {}
+ virtual void f() {}
+ };
+
+ struct Derived : public Base
+ {
+ virtual ~Derived() override {}
+ virtual void f() override {}
+ };
+
+ }
+
+ namespace test_double_right_angle_brackets
+ {
+
+ template < typename T >
+ struct check {};
+
+ typedef check<void> single_type;
+ typedef check<check<void>> double_type;
+ typedef check<check<check<void>>> triple_type;
+ typedef check<check<check<check<void>>>> quadruple_type;
+
+ }
+
+ namespace test_decltype
+ {
+
+ int
+ f()
+ {
+ int a = 1;
+ decltype(a) b = 2;
+ return a + b;
+ }
+
+ }
+
+ namespace test_type_deduction
+ {
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static const bool value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static const bool value = true;
+ };
+
+ template < typename T1, typename T2 >
+ auto
+ add(T1 a1, T2 a2) -> decltype(a1 + a2)
+ {
+ return a1 + a2;
+ }
+
+ int
+ test(const int c, volatile int v)
+ {
+ static_assert(is_same<int, decltype(0)>::value == true, "");
+ static_assert(is_same<int, decltype(c)>::value == false, "");
+ static_assert(is_same<int, decltype(v)>::value == false, "");
+ auto ac = c;
+ auto av = v;
+ auto sumi = ac + av + 'x';
+ auto sumf = ac + av + 1.0;
+ static_assert(is_same<int, decltype(ac)>::value == true, "");
+ static_assert(is_same<int, decltype(av)>::value == true, "");
+ static_assert(is_same<int, decltype(sumi)>::value == true, "");
+ static_assert(is_same<int, decltype(sumf)>::value == false, "");
+ static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
+ return (sumf > 0.0) ? sumi : add(c, v);
+ }
+
+ }
+
+ namespace test_noexcept
+ {
+
+ int f() { return 0; }
+ int g() noexcept { return 0; }
+
+ static_assert(noexcept(f()) == false, "");
+ static_assert(noexcept(g()) == true, "");
+
+ }
+
+ namespace test_constexpr
+ {
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
+ {
+ return *s ? strlen_c_r(s + 1, acc + 1) : acc;
+ }
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c(const CharT *const s) noexcept
+ {
+ return strlen_c_r(s, 0UL);
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("1") == 1UL, "");
+ static_assert(strlen_c("example") == 7UL, "");
+ static_assert(strlen_c("another\0example") == 7UL, "");
+
+ }
+
+ namespace test_rvalue_references
+ {
+
+ template < int N >
+ struct answer
+ {
+ static constexpr int value = N;
+ };
+
+ answer<1> f(int&) { return answer<1>(); }
+ answer<2> f(const int&) { return answer<2>(); }
+ answer<3> f(int&&) { return answer<3>(); }
+
+ void
+ test()
+ {
+ int i = 0;
+ const int c = 0;
+ static_assert(decltype(f(i))::value == 1, "");
+ static_assert(decltype(f(c))::value == 2, "");
+ static_assert(decltype(f(0))::value == 3, "");
+ }
+
+ }
+
+ namespace test_uniform_initialization
+ {
+
+ struct test
+ {
+ static const int zero {};
+ static const int one {1};
+ };
+
+ static_assert(test::zero == 0, "");
+ static_assert(test::one == 1, "");
+
+ }
+
+ namespace test_lambdas
+ {
+
+ void
+ test1()
+ {
+ auto lambda1 = [](){};
+ auto lambda2 = lambda1;
+ lambda1();
+ lambda2();
+ }
+
+ int
+ test2()
+ {
+ auto a = [](int i, int j){ return i + j; }(1, 2);
+ auto b = []() -> int { return '0'; }();
+ auto c = [=](){ return a + b; }();
+ auto d = [&](){ return c; }();
+ auto e = [a, &b](int x) mutable {
+ const auto identity = [](int y){ return y; };
+ for (auto i = 0; i < a; ++i)
+ a += b--;
+ return x + identity(a + b);
+ }(0);
+ return a + b + c + d + e;
+ }
+
+ int
+ test3()
+ {
+ const auto nullary = [](){ return 0; };
+ const auto unary = [](int x){ return x; };
+ using nullary_t = decltype(nullary);
+ using unary_t = decltype(unary);
+ const auto higher1st = [](nullary_t f){ return f(); };
+ const auto higher2nd = [unary](nullary_t f1){
+ return [unary, f1](unary_t f2){ return f2(unary(f1())); };
+ };
+ return higher1st(nullary) + higher2nd(nullary)(unary);
+ }
+
+ }
+
+ namespace test_variadic_templates
+ {
+
+ template <int...>
+ struct sum;
+
+ template <int N0, int... N1toN>
+ struct sum<N0, N1toN...>
+ {
+ static constexpr auto value = N0 + sum<N1toN...>::value;
+ };
+
+ template <>
+ struct sum<>
+ {
+ static constexpr auto value = 0;
+ };
+
+ static_assert(sum<>::value == 0, "");
+ static_assert(sum<1>::value == 1, "");
+ static_assert(sum<23>::value == 23, "");
+ static_assert(sum<1, 2>::value == 3, "");
+ static_assert(sum<5, 5, 11>::value == 21, "");
+ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
+
+ }
+
+ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
+ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
+ // because of this.
+ namespace test_template_alias_sfinae
+ {
+
+ struct foo {};
+
+ template<typename T>
+ using member = typename T::member_type;
+
+ template<typename T>
+ void func(...) {}
+
+ template<typename T>
+ void func(member<T>*) {}
+
+ void test();
+
+ void test() { func<foo>(0); }
+
+ }
+
+} // namespace cxx11
+
+#endif // __cplusplus >= 201103L
+
+
+
+
+// If the compiler admits that it is not ready for C++14, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201402L
+
+#error "This is not a C++14 compiler"
+
+#else
+
+namespace cxx14
+{
+
+ namespace test_polymorphic_lambdas
+ {
+
+ int
+ test()
+ {
+ const auto lambda = [](auto&&... args){
+ const auto istiny = [](auto x){
+ return (sizeof(x) == 1UL) ? 1 : 0;
+ };
+ const int aretiny[] = { istiny(args)... };
+ return aretiny[0];
+ };
+ return lambda(1, 1L, 1.0f, '1');
+ }
+
+ }
+
+ namespace test_binary_literals
+ {
+
+ constexpr auto ivii = 0b0000000000101010;
+ static_assert(ivii == 42, "wrong value");
+
+ }
+
+ namespace test_generalized_constexpr
+ {
+
+ template < typename CharT >
+ constexpr unsigned long
+ strlen_c(const CharT *const s) noexcept
+ {
+ auto length = 0UL;
+ for (auto p = s; *p; ++p)
+ ++length;
+ return length;
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("x") == 1UL, "");
+ static_assert(strlen_c("test") == 4UL, "");
+ static_assert(strlen_c("another\0test") == 7UL, "");
+
+ }
+
+ namespace test_lambda_init_capture
+ {
+
+ int
+ test()
+ {
+ auto x = 0;
+ const auto lambda1 = [a = x](int b){ return a + b; };
+ const auto lambda2 = [a = lambda1(x)](){ return a; };
+ return lambda2();
+ }
+
+ }
+
+ namespace test_digit_separators
+ {
+
+ constexpr auto ten_million = 100'000'000;
+ static_assert(ten_million == 100000000, "");
+
+ }
+
+ namespace test_return_type_deduction
+ {
+
+ auto f(int& x) { return x; }
+ decltype(auto) g(int& x) { return x; }
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static constexpr auto value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static constexpr auto value = true;
+ };
+
+ int
+ test()
+ {
+ auto x = 0;
+ static_assert(is_same<int, decltype(f(x))>::value, "");
+ static_assert(is_same<int&, decltype(g(x))>::value, "");
+ return x;
+ }
+
+ }
+
+} // namespace cxx14
+
+#endif // __cplusplus >= 201402L
+
+
+
+
+// If the compiler admits that it is not ready for C++17, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201703L
+
+#error "This is not a C++17 compiler"
+
+#else
+
+#include <initializer_list>
+#include <utility>
+#include <type_traits>
+
+namespace cxx17
+{
+
+ namespace test_constexpr_lambdas
+ {
+
+ constexpr int foo = [](){return 42;}();
+
+ }
+
+ namespace test::nested_namespace::definitions
+ {
+
+ }
+
+ namespace test_fold_expression
+ {
+
+ template<typename... Args>
+ int multiply(Args... args)
+ {
+ return (args * ... * 1);
+ }
+
+ template<typename... Args>
+ bool all(Args... args)
+ {
+ return (args && ...);
+ }
+
+ }
+
+ namespace test_extended_static_assert
+ {
+
+ static_assert (true);
+
+ }
+
+ namespace test_auto_brace_init_list
+ {
+
+ auto foo = {5};
+ auto bar {5};
+
+ static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
+ static_assert(std::is_same<int, decltype(bar)>::value);
+ }
+
+ namespace test_typename_in_template_template_parameter
+ {
+
+ template<template<typename> typename X> struct D;
+
+ }
+
+ namespace test_fallthrough_nodiscard_maybe_unused_attributes
+ {
+
+ int f1()
+ {
+ return 42;
+ }
+
+ [[nodiscard]] int f2()
+ {
+ [[maybe_unused]] auto unused = f1();
+
+ switch (f1())
+ {
+ case 17:
+ f1();
+ [[fallthrough]];
+ case 42:
+ f1();
+ }
+ return f1();
+ }
+
+ }
+
+ namespace test_extended_aggregate_initialization
+ {
+
+ struct base1
+ {
+ int b1, b2 = 42;
+ };
+
+ struct base2
+ {
+ base2() {
+ b3 = 42;
+ }
+ int b3;
+ };
+
+ struct derived : base1, base2
+ {
+ int d;
+ };
+
+ derived d1 {{1, 2}, {}, 4}; // full initialization
+ derived d2 {{}, {}, 4}; // value-initialized bases
+
+ }
+
+ namespace test_general_range_based_for_loop
+ {
+
+ struct iter
+ {
+ int i;
+
+ int& operator* ()
+ {
+ return i;
+ }
+
+ const int& operator* () const
+ {
+ return i;
+ }
+
+ iter& operator++()
+ {
+ ++i;
+ return *this;
+ }
+ };
+
+ struct sentinel
+ {
+ int i;
+ };
+
+ bool operator== (const iter& i, const sentinel& s)
+ {
+ return i.i == s.i;
+ }
+
+ bool operator!= (const iter& i, const sentinel& s)
+ {
+ return !(i == s);
+ }
+
+ struct range
+ {
+ iter begin() const
+ {
+ return {0};
+ }
+
+ sentinel end() const
+ {
+ return {5};
+ }
+ };
+
+ void f()
+ {
+ range r {};
+
+ for (auto i : r)
+ {
+ [[maybe_unused]] auto v = i;
+ }
+ }
+
+ }
+
+ namespace test_lambda_capture_asterisk_this_by_value
+ {
+
+ struct t
+ {
+ int i;
+ int foo()
+ {
+ return [*this]()
+ {
+ return i;
+ }();
+ }
+ };
+
+ }
+
+ namespace test_enum_class_construction
+ {
+
+ enum class byte : unsigned char
+ {};
+
+ byte foo {42};
+
+ }
+
+ namespace test_constexpr_if
+ {
+
+ template <bool cond>
+ int f ()
+ {
+ if constexpr(cond)
+ {
+ return 13;
+ }
+ else
+ {
+ return 42;
+ }
+ }
+
+ }
+
+ namespace test_selection_statement_with_initializer
+ {
+
+ int f()
+ {
+ return 13;
+ }
+
+ int f2()
+ {
+ if (auto i = f(); i > 0)
+ {
+ return 3;
+ }
+
+ switch (auto i = f(); i + 4)
+ {
+ case 17:
+ return 2;
+
+ default:
+ return 1;
+ }
+ }
+
+ }
+
+ namespace test_template_argument_deduction_for_class_templates
+ {
+
+ template <typename T1, typename T2>
+ struct pair
+ {
+ pair (T1 p1, T2 p2)
+ : m1 {p1},
+ m2 {p2}
+ {}
+
+ T1 m1;
+ T2 m2;
+ };
+
+ void f()
+ {
+ [[maybe_unused]] auto p = pair{13, 42u};
+ }
+
+ }
+
+ namespace test_non_type_auto_template_parameters
+ {
+
+ template <auto n>
+ struct B
+ {};
+
+ B<5> b1;
+ B<'a'> b2;
+
+ }
+
+ namespace test_structured_bindings
+ {
+
+ int arr[2] = { 1, 2 };
+ std::pair<int, int> pr = { 1, 2 };
+
+ auto f1() -> int(&)[2]
+ {
+ return arr;
+ }
+
+ auto f2() -> std::pair<int, int>&
+ {
+ return pr;
+ }
+
+ struct S
+ {
+ int x1 : 2;
+ volatile double y1;
+ };
+
+ S f3()
+ {
+ return {};
+ }
+
+ auto [ x1, y1 ] = f1();
+ auto& [ xr1, yr1 ] = f1();
+ auto [ x2, y2 ] = f2();
+ auto& [ xr2, yr2 ] = f2();
+ const auto [ x3, y3 ] = f3();
+
+ }
+
+ namespace test_exception_spec_type_system
+ {
+
+ struct Good {};
+ struct Bad {};
+
+ void g1() noexcept;
+ void g2();
+
+ template<typename T>
+ Bad
+ f(T*, T*);
+
+ template<typename T1, typename T2>
+ Good
+ f(T1*, T2*);
+
+ static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
+
+ }
+
+ namespace test_inline_variables
+ {
+
+ template<class T> void f(T)
+ {}
+
+ template<class T> inline T g(T)
+ {
+ return T{};
+ }
+
+ template<> inline void f<>(int)
+ {}
+
+ template<> int g<>(int)
+ {
+ return 5;
+ }
+
+ }
+
+} // namespace cxx17
+
+#endif // __cplusplus < 201703L
+
+
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+ eval $cachevar=yes
+else
+ eval $cachevar=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CXX="$ac_save_CXX"
+fi
+eval ac_res=\$$cachevar
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ if eval test x\$$cachevar = xyes; then
+ CXX="$CXX $switch"
+ if test -n "$CXXCPP" ; then
+ CXXCPP="$CXXCPP $switch"
+ fi
+ ac_success=yes
+ break
+ fi
+ done
+ if test x$ac_success = xyes; then
+ break
+ fi
+ done
+ fi
+ ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ if test x$ax_cxx_compile_cxx17_required = xtrue; then
+ if test x$ac_success = xno; then
+ as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5
+ fi
+ fi
+ if test x$ac_success = xno; then
+ HAVE_CXX17=0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5
+$as_echo "$as_me: No compiler with C++17 support was found" >&6;}
+ else
+ HAVE_CXX17=1
+
+$as_echo "#define HAVE_CXX17 1" >>confdefs.h
+
+ fi
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we will enable compiler security checks" >&5
+$as_echo_n "checking whether we will enable compiler security checks... " >&6; }
+# Check whether --enable-hardening was given.
+if test "${enable_hardening+set}" = set; then :
+ enableval=$enable_hardening; enable_hardening=$enableval
+else
+ enable_hardening=yes
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_hardening" >&5
+$as_echo "$enable_hardening" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Werror -Wunknown-warning-option" >&5
+$as_echo_n "checking whether C++ compiler handles -Werror -Wunknown-warning-option... " >&6; }
+if ${gl_cv_warn_cxx__Werror__Wunknown_warning_option+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__Werror__Wunknown_warning_option=yes
+else
+ gl_cv_warn_cxx__Werror__Wunknown_warning_option=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Werror__Wunknown_warning_option" >&5
+$as_echo "$gl_cv_warn_cxx__Werror__Wunknown_warning_option" >&6; }
+if test "x$gl_cv_warn_cxx__Werror__Wunknown_warning_option" = xyes; then :
+ gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'
+else
+ gl_unknown_warnings_are_errors=
+fi
+
+if test "x$enable_hardening" != "xno"; then :
+
+
+
+ PIE_CFLAGS=
+ PIE_LDFLAGS=
+ OLD_CXXFLAGS=$CXXFLAGS
+ case "$host" in
+ *-*-mingw* | *-*-msvc* | *-*-cygwin* )
+ ;; *)
+ CXXFLAGS="-fPIE -DPIE"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -pie" >&5
+$as_echo_n "checking whether C++ compiler handles -pie... " >&6; }
+if ${gl_cv_warn_cxx__pie+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -pie"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <pthread.h>
+__thread unsigned int t_id;
+
+int
+main ()
+{
+t_id = 1;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__pie=yes
+else
+ gl_cv_warn_cxx__pie=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__pie" >&5
+$as_echo "$gl_cv_warn_cxx__pie" >&6; }
+if test "x$gl_cv_warn_cxx__pie" = xyes; then :
+
+ PIE_CFLAGS="-fPIE -DPIE"
+ PIE_LDFLAGS="-pie"
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -Wl,-pie" >&5
+$as_echo_n "checking whether C++ compiler handles -Wl,-pie... " >&6; }
+if ${gl_cv_warn_cxx__Wl__pie+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -Wl,-pie"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+#include <pthread.h>
+__thread unsigned int t_id;
+
+int
+main ()
+{
+t_id = 1;
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__Wl__pie=yes
+else
+ gl_cv_warn_cxx__Wl__pie=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__Wl__pie" >&5
+$as_echo "$gl_cv_warn_cxx__Wl__pie" >&6; }
+if test "x$gl_cv_warn_cxx__Wl__pie" = xyes; then :
+
+ PIE_CFLAGS="-fPIE -DPIE"
+ PIE_LDFLAGS="-Wl,-pie"
+
+fi
+
+
+fi
+
+ esac
+ CXXFLAGS=$OLD_CXXFLAGS
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -fstack-protector" >&5
+$as_echo_n "checking whether C++ compiler handles -fstack-protector... " >&6; }
+if ${gl_cv_warn_cxx__fstack_protector+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -fstack-protector"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__fstack_protector=yes
+else
+ gl_cv_warn_cxx__fstack_protector=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__fstack_protector" >&5
+$as_echo "$gl_cv_warn_cxx__fstack_protector" >&6; }
+if test "x$gl_cv_warn_cxx__fstack_protector" = xyes; then :
+
+ CFLAGS="-fstack-protector $CFLAGS"
+ CXXFLAGS="-fstack-protector $CXXFLAGS"
+
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles --param ssp-buffer-size=4" >&5
+$as_echo_n "checking whether C++ compiler handles --param ssp-buffer-size=4... " >&6; }
+if ${gl_cv_warn_cxx___param_ssp_buffer_size_4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors --param ssp-buffer-size=4"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx___param_ssp_buffer_size_4=yes
+else
+ gl_cv_warn_cxx___param_ssp_buffer_size_4=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx___param_ssp_buffer_size_4" >&5
+$as_echo "$gl_cv_warn_cxx___param_ssp_buffer_size_4" >&6; }
+if test "x$gl_cv_warn_cxx___param_ssp_buffer_size_4" = xyes; then :
+
+ CFLAGS="--param ssp-buffer-size=4 $CFLAGS"
+ CXXFLAGS="--param ssp-buffer-size=4 $CXXFLAGS"
+
+fi
+
+
+
+ OLD_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="-Wall -W -Werror $CXXFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -D_FORTIFY_SOURCE=2" >&5
+$as_echo_n "checking whether C++ compiler handles -D_FORTIFY_SOURCE=2... " >&6; }
+if ${gl_cv_warn_cxx__D_FORTIFY_SOURCE_2+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -D_FORTIFY_SOURCE=2"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdio.h>
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__D_FORTIFY_SOURCE_2=yes
+else
+ gl_cv_warn_cxx__D_FORTIFY_SOURCE_2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__D_FORTIFY_SOURCE_2" >&5
+$as_echo "$gl_cv_warn_cxx__D_FORTIFY_SOURCE_2" >&6; }
+if test "x$gl_cv_warn_cxx__D_FORTIFY_SOURCE_2" = xyes; then :
+
+ CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+ CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $OLD_CXXFLAGS"
+
+else
+ CXXFLAGS="$OLD_CXXFLAGS"
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for how to force completely read-only GOT table" >&5
+$as_echo_n "checking for how to force completely read-only GOT table... " >&6; }
+
+ RELRO_LDFLAGS=
+ ld_help=`$CXX -Wl,-help 2>&1`
+ case $ld_help in
+ *"-z relro"*) RELRO_LDFLAGS="-Wl,-z -Wl,relro" ;;
+ esac
+ case $ld_help in
+ *"-z now"*) RELRO_LDFLAGS="$RELRO_LDFLAGS -Wl,-z -Wl,now" ;;
+ esac
+
+ if test "x$RELRO_LDFLAGS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RELRO_LDFLAGS" >&5
+$as_echo "$RELRO_LDFLAGS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+$as_echo "unknown" >&6; }
+
+fi
+
+
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable AddressSanitizer" >&5
+$as_echo_n "checking whether to enable AddressSanitizer... " >&6; }
+ # Check whether --enable-asan was given.
+if test "${enable_asan+set}" = set; then :
+ enableval=$enable_asan; enable_asan=$enableval
+else
+ enable_asan=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_asan" >&5
+$as_echo "$enable_asan" >&6; }
+
+ if test "x$enable_asan" != "xno"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -fsanitize=address" >&5
+$as_echo_n "checking whether C++ compiler handles -fsanitize=address... " >&6; }
+if ${gl_cv_warn_cxx__fsanitize_address+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -fsanitize=address"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__fsanitize_address=yes
+else
+ gl_cv_warn_cxx__fsanitize_address=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__fsanitize_address" >&5
+$as_echo "$gl_cv_warn_cxx__fsanitize_address" >&6; }
+if test "x$gl_cv_warn_cxx__fsanitize_address" = xyes; then :
+
+ SANITIZER_FLAGS="-fsanitize=address $SANITIZER_FLAGS"
+ for ac_header in sanitizer/common_interface_defs.h
+do :
+ ac_fn_cxx_check_header_mongrel "$LINENO" "sanitizer/common_interface_defs.h" "ac_cv_header_sanitizer_common_interface_defs_h" "$ac_includes_default"
+if test "x$ac_cv_header_sanitizer_common_interface_defs_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_SANITIZER_COMMON_INTERFACE_DEFS_H 1
+_ACEOF
+ asan_headers=yes
+else
+ asan_headers=no
+fi
+
+done
+
+ if test x"$asan_headers" = "xyes" ; then :
+ ac_fn_cxx_check_decl "$LINENO" "__sanitizer_start_switch_fiber" "ac_cv_have_decl___sanitizer_start_switch_fiber" "#include <sanitizer/common_interface_defs.h>
+
+"
+if test "x$ac_cv_have_decl___sanitizer_start_switch_fiber" = xyes; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the exact signature of __sanitizer_finish_switch_fiber" >&5
+$as_echo_n "checking for the exact signature of __sanitizer_finish_switch_fiber... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sanitizer/common_interface_defs.h>
+int
+main ()
+{
+
+ __sanitizer_finish_switch_fiber(nullptr);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: a single pointer" >&5
+$as_echo "a single pointer" >&6; }
+
+$as_echo "#define HAVE_FIBER_SANITIZER 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_SANITIZER_FINISH_SWITCH_FIBER_SINGLE_PTR 1" >>confdefs.h
+
+
+else
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sanitizer/common_interface_defs.h>
+int
+main ()
+{
+
+ __sanitizer_finish_switch_fiber(nullptr, nullptr, nullptr);
+
+ ;
+ return 0;
+}
+
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: three pointers" >&5
+$as_echo "three pointers" >&6; }
+
+$as_echo "#define HAVE_FIBER_SANITIZER 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_SANITIZER_FINISH_SWITCH_FIBER_THREE_PTRS 1" >>confdefs.h
+
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
+$as_echo "unknown" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ASAN fiber switching is not available due to an unknown API version" >&5
+$as_echo "$as_me: ASAN fiber switching is not available due to an unknown API version" >&6;}
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ASAN fiber switching is not available" >&5
+$as_echo "$as_me: ASAN fiber switching is not available" >&6;}
+
+fi
+
+
+fi
+
+else
+ as_fn_error $? "Cannot enable AddressSanitizer" "$LINENO" 5
+
+fi
+
+
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable MemorySanitizer" >&5
+$as_echo_n "checking whether to enable MemorySanitizer... " >&6; }
+ # Check whether --enable-msan was given.
+if test "${enable_msan+set}" = set; then :
+ enableval=$enable_msan; enable_msan=$enableval
+else
+ enable_msan=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_msan" >&5
+$as_echo "$enable_msan" >&6; }
+
+ if test "x$enable_msan" != "xno"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -fsanitize=memory" >&5
+$as_echo_n "checking whether C++ compiler handles -fsanitize=memory... " >&6; }
+if ${gl_cv_warn_cxx__fsanitize_memory+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -fsanitize=memory"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__fsanitize_memory=yes
+else
+ gl_cv_warn_cxx__fsanitize_memory=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__fsanitize_memory" >&5
+$as_echo "$gl_cv_warn_cxx__fsanitize_memory" >&6; }
+if test "x$gl_cv_warn_cxx__fsanitize_memory" = xyes; then :
+ SANITIZER_FLAGS="-fsanitize=memory $SANITIZER_FLAGS"
+else
+ as_fn_error $? "Cannot enable MemorySanitizer" "$LINENO" 5
+
+fi
+
+
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ThreadSanitizer" >&5
+$as_echo_n "checking whether to enable ThreadSanitizer... " >&6; }
+ # Check whether --enable-tsan was given.
+if test "${enable_tsan+set}" = set; then :
+ enableval=$enable_tsan; enable_tsan=$enableval
+else
+ enable_tsan=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_tsan" >&5
+$as_echo "$enable_tsan" >&6; }
+
+ if test "x$enable_tsan" != "xno"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -fsanitize=thread" >&5
+$as_echo_n "checking whether C++ compiler handles -fsanitize=thread... " >&6; }
+if ${gl_cv_warn_cxx__fsanitize_thread+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -fsanitize=thread"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__fsanitize_thread=yes
+else
+ gl_cv_warn_cxx__fsanitize_thread=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__fsanitize_thread" >&5
+$as_echo "$gl_cv_warn_cxx__fsanitize_thread" >&6; }
+if test "x$gl_cv_warn_cxx__fsanitize_thread" = xyes; then :
+ SANITIZER_FLAGS="-fsanitize=thread $SANITIZER_FLAGS"
+else
+ as_fn_error $? "Cannot enable ThreadSanitizer" "$LINENO" 5
+
+fi
+
+
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable LeakSanitizer" >&5
+$as_echo_n "checking whether to enable LeakSanitizer... " >&6; }
+ # Check whether --enable-lsan was given.
+if test "${enable_lsan+set}" = set; then :
+ enableval=$enable_lsan; enable_lsan=$enableval
+else
+ enable_lsan=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_lsan" >&5
+$as_echo "$enable_lsan" >&6; }
+
+ if test "x$enable_lsan" != "xno"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -fsanitize=leak" >&5
+$as_echo_n "checking whether C++ compiler handles -fsanitize=leak... " >&6; }
+if ${gl_cv_warn_cxx__fsanitize_leak+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -fsanitize=leak"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__fsanitize_leak=yes
+else
+ gl_cv_warn_cxx__fsanitize_leak=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__fsanitize_leak" >&5
+$as_echo "$gl_cv_warn_cxx__fsanitize_leak" >&6; }
+if test "x$gl_cv_warn_cxx__fsanitize_leak" = xyes; then :
+ SANITIZER_FLAGS="-fsanitize=leak $SANITIZER_FLAGS"
+else
+ as_fn_error $? "Cannot enable LeakSanitizer" "$LINENO" 5
+
+fi
+
+
+fi
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable Undefined Behaviour Sanitizer" >&5
+$as_echo_n "checking whether to enable Undefined Behaviour Sanitizer... " >&6; }
+ # Check whether --enable-ubsan was given.
+if test "${enable_ubsan+set}" = set; then :
+ enableval=$enable_ubsan; enable_ubsan=$enableval
+else
+ enable_ubsan=no
+
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_ubsan" >&5
+$as_echo "$enable_ubsan" >&6; }
+
+ if test "x$enable_ubsan" != "xno"; then :
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -fsanitize=undefined" >&5
+$as_echo_n "checking whether C++ compiler handles -fsanitize=undefined... " >&6; }
+if ${gl_cv_warn_cxx__fsanitize_undefined+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -fsanitize=undefined"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__fsanitize_undefined=yes
+else
+ gl_cv_warn_cxx__fsanitize_undefined=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__fsanitize_undefined" >&5
+$as_echo "$gl_cv_warn_cxx__fsanitize_undefined" >&6; }
+if test "x$gl_cv_warn_cxx__fsanitize_undefined" = xyes; then :
+ SANITIZER_FLAGS="-fsanitize=undefined $SANITIZER_FLAGS"
+else
+ as_fn_error $? "Cannot enable Undefined Behaviour Sanitizer" "$LINENO" 5
+
+fi
+
+
+fi
+
+
+
+ if test "x$enable_asan" != "xno" -a "x$enable_tsan" != "xno"; then :
+
+ as_fn_error $? "Address Sanitizer is not compatible with Thread Sanitizer" "$LINENO" 5
+
+fi
+
+ if test "x$enable_msan" != "xno" -a "x$enable_asan" != "xno"; then :
+
+ as_fn_error $? "Memory Sanitizer is not compatible with Address Sanitizer" "$LINENO" 5
+
+fi
+
+ if test "x$enable_msan" != "xno" -a "x$enable_lsan" != "xno"; then :
+
+ as_fn_error $? "Memory Sanitizer is not compatible with Leak Sanitizer" "$LINENO" 5
+
+fi
+
+ if test "x$enable_msan" != "xno" -a "x$enable_tsan" != "xno"; then :
+
+ as_fn_error $? "Memory Sanitizer is not compatible with Thread Sanitizer" "$LINENO" 5
+
+fi
+
+ if test "x$enable_asan" != "xno" -o "x$enable_tsan" != "xno" -o "x$enable_lsan" != "xno" -o "x$enable_ubsan" != "xno" -o "x$enable_msan" != "xno"; then :
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler handles -fno-omit-frame-pointer" >&5
+$as_echo_n "checking whether C++ compiler handles -fno-omit-frame-pointer... " >&6; }
+if ${gl_cv_warn_cxx__fno_omit_frame_pointer+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ gl_save_compiler_FLAGS="$CXXFLAGS"
+ as_fn_append CXXFLAGS " $gl_unknown_warnings_are_errors -fno-omit-frame-pointer"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+ gl_cv_warn_cxx__fno_omit_frame_pointer=yes
+else
+ gl_cv_warn_cxx__fno_omit_frame_pointer=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ CXXFLAGS="$gl_save_compiler_FLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_cxx__fno_omit_frame_pointer" >&5
+$as_echo "$gl_cv_warn_cxx__fno_omit_frame_pointer" >&6; }
+if test "x$gl_cv_warn_cxx__fno_omit_frame_pointer" = xyes; then :
+ as_fn_append WARN_CFLAGS " -fno-omit-frame-pointer"
+fi
+
+
+
+fi
+
+
+
+
+
+
+
+
+
+ if test -n "$PYTHON"; then
+ # If the user set $PYTHON, use it and don't search something else.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3.6" >&5
+$as_echo_n "checking whether $PYTHON version is >= 3.6... " >&6; }
+ prog="import sys
+# split strings by '.' and convert to numeric. Append some zeros
+# because we need at least 4 digits for the hex conversion.
+# map returns an iterator in Python 3.0 and a list in 2.x
+minver = list(map(int, '3.6'.split('.'))) + [0, 0, 0]
+minverhex = 0
+# xrange is not present in Python 3.0 and range returns an iterator
+for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
+sys.exit(sys.hexversion < minverhex)"
+ if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5
+ ($PYTHON -c "$prog") >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ as_fn_error $? "Python interpreter is too old" "$LINENO" 5
+fi
+ am_display_PYTHON=$PYTHON
+ else
+ # Otherwise, try each interpreter until we find one that satisfies
+ # VERSION.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3.6" >&5
+$as_echo_n "checking for a Python interpreter with version >= 3.6... " >&6; }
+if ${am_cv_pathless_PYTHON+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ for am_cv_pathless_PYTHON in python python2 python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 python3.3 python3.2 python3.1 python3.0 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 none; do
+ test "$am_cv_pathless_PYTHON" = none && break
+ prog="import sys
+# split strings by '.' and convert to numeric. Append some zeros
+# because we need at least 4 digits for the hex conversion.
+# map returns an iterator in Python 3.0 and a list in 2.x
+minver = list(map(int, '3.6'.split('.'))) + [0, 0, 0]
+minverhex = 0
+# xrange is not present in Python 3.0 and range returns an iterator
+for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i]
+sys.exit(sys.hexversion < minverhex)"
+ if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5
+ ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then :
+ break
+fi
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5
+$as_echo "$am_cv_pathless_PYTHON" >&6; }
+ # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
+ if test "$am_cv_pathless_PYTHON" = none; then
+ PYTHON=:
+ else
+ # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args.
+set dummy $am_cv_pathless_PYTHON; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PYTHON+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $PYTHON in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PYTHON=$ac_cv_path_PYTHON
+if test -n "$PYTHON"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
+$as_echo "$PYTHON" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+ am_display_PYTHON=$am_cv_pathless_PYTHON
+ fi
+
+
+ if test "$PYTHON" = :; then
+ :
+ else
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5
+$as_echo_n "checking for $am_display_PYTHON version... " >&6; }
+if ${am_cv_python_version+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5
+$as_echo "$am_cv_python_version" >&6; }
+ PYTHON_VERSION=$am_cv_python_version
+
+
+
+ PYTHON_PREFIX='${prefix}'
+
+ PYTHON_EXEC_PREFIX='${exec_prefix}'
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5
+$as_echo_n "checking for $am_display_PYTHON platform... " >&6; }
+if ${am_cv_python_platform+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5
+$as_echo "$am_cv_python_platform" >&6; }
+ PYTHON_PLATFORM=$am_cv_python_platform
+
+
+ # Just factor out some code duplication.
+ am_python_setup_sysconfig="\
+import sys
+# Prefer sysconfig over distutils.sysconfig, for better compatibility
+# with python 3.x. See automake bug#10227.
+try:
+ import sysconfig
+except ImportError:
+ can_use_sysconfig = 0
+else:
+ can_use_sysconfig = 1
+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs:
+# <https://github.com/pypa/virtualenv/issues/118>
+try:
+ from platform import python_implementation
+ if python_implementation() == 'CPython' and sys.version[:3] == '2.7':
+ can_use_sysconfig = 0
+except ImportError:
+ pass"
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5
+$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; }
+if ${am_cv_python_pythondir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$prefix" = xNONE
+ then
+ am_py_prefix=$ac_default_prefix
+ else
+ am_py_prefix=$prefix
+ fi
+ am_cv_python_pythondir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
+ case $am_cv_python_pythondir in
+ $am_py_prefix*)
+ am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
+ am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"`
+ ;;
+ *)
+ case $am_py_prefix in
+ /usr|/System*) ;;
+ *)
+ am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
+ ;;
+ esac
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5
+$as_echo "$am_cv_python_pythondir" >&6; }
+ pythondir=$am_cv_python_pythondir
+
+
+
+ pkgpythondir=\${pythondir}/$PACKAGE
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5
+$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; }
+if ${am_cv_python_pyexecdir+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$exec_prefix" = xNONE
+ then
+ am_py_exec_prefix=$am_py_prefix
+ else
+ am_py_exec_prefix=$exec_prefix
+ fi
+ am_cv_python_pyexecdir=`$PYTHON -c "
+$am_python_setup_sysconfig
+if can_use_sysconfig:
+ sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'})
+else:
+ from distutils import sysconfig
+ sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+sys.stdout.write(sitedir)"`
+ case $am_cv_python_pyexecdir in
+ $am_py_exec_prefix*)
+ am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
+ am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"`
+ ;;
+ *)
+ case $am_py_exec_prefix in
+ /usr|/System*) ;;
+ *)
+ am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
+ ;;
+ esac
+ ;;
+ esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5
+$as_echo "$am_cv_python_pyexecdir" >&6; }
+ pyexecdir=$am_cv_python_pyexecdir
+
+
+
+ pkgpyexecdir=\${pyexecdir}/$PACKAGE
+
+
+
+ fi
+
+
+ if test "${PYTHON}" != ":"; then :
+
+
+ if test -z $PYTHON;
+ then
+ if test -z "";
+ then
+ PYTHON="python3"
+ else
+ PYTHON=""
+ fi
+ fi
+ PYTHON_NAME=`basename $PYTHON`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking $PYTHON_NAME module: venv" >&5
+$as_echo_n "checking $PYTHON_NAME module: venv... " >&6; }
+ $PYTHON -c "import venv" 2>/dev/null
+ if test $? -eq 0;
+ then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ eval HAVE_PYMOD_VENV=yes
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ eval HAVE_PYMOD_VENV=no
+ #
+ if test -n ""
+ then
+ as_fn_error $? "failed to find required module venv" "$LINENO" 5
+ exit 1
+ fi
+ fi
+
+
+fi
+ if test "x${HAVE_PYMOD_VENV}" = "xyes"; then
+ HAVE_VENV_TRUE=
+ HAVE_VENV_FALSE='#'
+else
+ HAVE_VENV_TRUE='#'
+ HAVE_VENV_FALSE=
+fi
+
+
+
+ if test -e "$srcdir/dnsdist.1"; then
+ HAVE_MANPAGES_TRUE=
+ HAVE_MANPAGES_FALSE='#'
+else
+ HAVE_MANPAGES_TRUE='#'
+ HAVE_MANPAGES_FALSE=
+fi
+
+if test -z "$HAVE_MANPAGES_TRUE"; then :
+ else
+
+ if test -z "$HAVE_VENV_TRUE"; then :
+ else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Python 3 and/or venv module are not available, documentation will not be built." >&5
+$as_echo "$as_me: WARNING: Python 3 and/or venv module are not available, documentation will not be built." >&2;}
+
+fi
+
+fi
+
+LDFLAGS="$RELRO_LDFLAGS $LDFLAGS"
+
+CFLAGS="$SANITIZER_FLAGS $PIE_CFLAGS $CFLAGS"
+CXXFLAGS="$SANITIZER_FLAGS $PIE_CFLAGS $CXXFLAGS"
+
+PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS"
+
+
+AM_CPPFLAGS="-I\$(top_builddir) -I\$(top_srcdir) $THREADFLAGS $BOOST_CPPFLAGS"
+
+
+
+
+if test "x$PACKAGEVERSION" != "x"; then :
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGEVERSION "$PACKAGEVERSION"
+_ACEOF
+
+
+fi
+
+ac_config_files="$ac_config_files Makefile ext/yahttp/Makefile ext/yahttp/yahttp/Makefile ext/ipcrypt/Makefile"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+ *) { eval $ac_var=; unset $ac_var;} ;;
+ esac ;;
+ esac
+ done
+
+ (set) 2>&1 |
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
+ # `set' does not quote correctly, so add quotes: double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \.
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;; #(
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ ;;
+ esac |
+ sort
+) |
+ sed '
+ /^ac_cv_env_/b end
+ t clear
+ :clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ if test "x$cache_file" != "x/dev/null"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+ if test ! -f "$cache_file" || test -h "$cache_file"; then
+ cat confcache >"$cache_file"
+ else
+ case $cache_file in #(
+ */* | ?:*)
+ mv -f confcache "$cache_file"$$ &&
+ mv -f "$cache_file"$$ "$cache_file" ;; #(
+ *)
+ mv -f confcache "$cache_file" ;;
+ esac
+ fi
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+ am__EXEEXT_TRUE=
+ am__EXEEXT_FALSE='#'
+else
+ am__EXEEXT_TRUE='#'
+ am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LIBSODIUM_TRUE}" && test -z "${LIBSODIUM_FALSE}"; then
+ as_fn_error $? "conditional \"LIBSODIUM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${FSTRM_TRUE}" && test -z "${FSTRM_FALSE}"; then
+ as_fn_error $? "conditional \"FSTRM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_FREEBSD_TRUE}" && test -z "${HAVE_FREEBSD_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_FREEBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_OPENBSD_TRUE}" && test -z "${HAVE_OPENBSD_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_OPENBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LINUX_TRUE}" && test -z "${HAVE_LINUX_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_DARWIN_TRUE}" && test -z "${HAVE_DARWIN_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_DARWIN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SOLARIS_TRUE}" && test -z "${HAVE_SOLARIS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SOLARIS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${UNIT_TESTS_TRUE}" && test -z "${UNIT_TESTS_FALSE}"; then
+ as_fn_error $? "conditional \"UNIT_TESTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_RE2_TRUE}" && test -z "${HAVE_RE2_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_RE2\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${DNSCRYPT_TRUE}" && test -z "${DNSCRYPT_FALSE}"; then
+ as_fn_error $? "conditional \"DNSCRYPT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_EBPF_TRUE}" && test -z "${HAVE_EBPF_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_EBPF\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_NET_SNMP_TRUE}" && test -z "${HAVE_NET_SNMP_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_NET_SNMP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LIBCAP_TRUE}" && test -z "${HAVE_LIBCAP_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LIBCAP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_DYNAMIC_USER_TRUE}" && test -z "${HAVE_SYSTEMD_DYNAMIC_USER_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_DYNAMIC_USER\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_LOCK_PERSONALITY_TRUE}" && test -z "${HAVE_SYSTEMD_LOCK_PERSONALITY_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_LOCK_PERSONALITY\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE_TRUE}" && test -z "${HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PERCENT_T_TRUE}" && test -z "${HAVE_SYSTEMD_PERCENT_T_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PERCENT_T\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PRIVATE_DEVICES_TRUE}" && test -z "${HAVE_SYSTEMD_PRIVATE_DEVICES_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PRIVATE_DEVICES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PRIVATE_MOUNTS_TRUE}" && test -z "${HAVE_SYSTEMD_PRIVATE_MOUNTS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PRIVATE_MOUNTS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PRIVATE_TMP_TRUE}" && test -z "${HAVE_SYSTEMD_PRIVATE_TMP_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PRIVATE_TMP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PRIVATE_USERS_TRUE}" && test -z "${HAVE_SYSTEMD_PRIVATE_USERS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PRIVATE_USERS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PROTECT_CLOCK_TRUE}" && test -z "${HAVE_SYSTEMD_PROTECT_CLOCK_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PROTECT_CLOCK\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS_TRUE}" && test -z "${HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PROTECT_HOME_TRUE}" && test -z "${HAVE_SYSTEMD_PROTECT_HOME_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PROTECT_HOME\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PROTECT_HOSTNAME_TRUE}" && test -z "${HAVE_SYSTEMD_PROTECT_HOSTNAME_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PROTECT_HOSTNAME\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PROTECT_KERNEL_LOGS_TRUE}" && test -z "${HAVE_SYSTEMD_PROTECT_KERNEL_LOGS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PROTECT_KERNEL_LOGS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PROTECT_KERNEL_MODULES_TRUE}" && test -z "${HAVE_SYSTEMD_PROTECT_KERNEL_MODULES_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PROTECT_KERNEL_MODULES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES_TRUE}" && test -z "${HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PROTECT_SYSTEM_TRUE}" && test -z "${HAVE_SYSTEMD_PROTECT_SYSTEM_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PROTECT_SYSTEM\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT_TRUE}" && test -z "${HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_REMOVE_IPC_TRUE}" && test -z "${HAVE_SYSTEMD_REMOVE_IPC_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_REMOVE_IPC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES_TRUE}" && test -z "${HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_RESTRICT_NAMESPACES_TRUE}" && test -z "${HAVE_SYSTEMD_RESTRICT_NAMESPACES_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_RESTRICT_NAMESPACES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_RESTRICT_REALTIME_TRUE}" && test -z "${HAVE_SYSTEMD_RESTRICT_REALTIME_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_RESTRICT_REALTIME\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_RESTRICT_SUIDSGID_TRUE}" && test -z "${HAVE_SYSTEMD_RESTRICT_SUIDSGID_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_RESTRICT_SUIDSGID\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES_TRUE}" && test -z "${HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_SYSTEM_CALL_FILTER_TRUE}" && test -z "${HAVE_SYSTEMD_SYSTEM_CALL_FILTER_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_SYSTEM_CALL_FILTER\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV_TRUE}" && test -z "${HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_SYSTEMD_TRUE}" && test -z "${HAVE_SYSTEMD_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_SYSTEMD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${LUA_TRUE}" && test -z "${LUA_FALSE}"; then
+ as_fn_error $? "conditional \"LUA\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LUA_HPP_TRUE}" && test -z "${HAVE_LUA_HPP_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LUA_HPP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_GNUTLS_TRUE}" && test -z "${HAVE_GNUTLS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_GNUTLS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LIBSSL_TRUE}" && test -z "${HAVE_LIBSSL_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LIBSSL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LMDB_TRUE}" && test -z "${HAVE_LMDB_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LMDB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_CDB_TRUE}" && test -z "${HAVE_CDB_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_CDB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LIBCRYPTO_TRUE}" && test -z "${HAVE_LIBCRYPTO_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LIBCRYPTO\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_DNS_OVER_TLS_TRUE}" && test -z "${HAVE_DNS_OVER_TLS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_DNS_OVER_TLS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_DNS_OVER_HTTPS_TRUE}" && test -z "${HAVE_DNS_OVER_HTTPS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_DNS_OVER_HTTPS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LIBSSL_TRUE}" && test -z "${HAVE_LIBSSL_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LIBSSL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_GNUTLS_TRUE}" && test -z "${HAVE_GNUTLS_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_GNUTLS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LIBH2OEVLOOP_TRUE}" && test -z "${HAVE_LIBH2OEVLOOP_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LIBH2OEVLOOP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_NGHTTP2_TRUE}" && test -z "${HAVE_NGHTTP2_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_NGHTTP2\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_CDB_TRUE}" && test -z "${HAVE_CDB_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_CDB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_LMDB_TRUE}" && test -z "${HAVE_LMDB_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LMDB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_VENV_TRUE}" && test -z "${HAVE_VENV_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_VENV\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAVE_MANPAGES_TRUE}" && test -z "${HAVE_MANPAGES_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_MANPAGES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in #(
+ *posix*) :
+ set -o posix ;; #(
+ *) :
+ ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='print -r --'
+ as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+ as_echo='printf %s\n'
+ as_echo_n='printf %s'
+else
+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+ as_echo_n='/usr/ucb/echo -n'
+ else
+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+ as_echo_n_body='eval
+ arg=$1;
+ case $arg in #(
+ *"$as_nl"*)
+ expr "X$arg" : "X\\(.*\\)$as_nl";
+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+ esac;
+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+ '
+ export as_echo_n_body
+ as_echo_n='sh -c $as_echo_n_body as_echo'
+ fi
+ export as_echo_body
+ as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there. '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+ as_status=$1; test $as_status -eq 0 && as_status=1
+ if test "$4"; then
+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+ fi
+ $as_echo "$as_me: error: $2" >&2
+ as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+ return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+ set +e
+ as_fn_set_status $1
+ exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+ { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+ eval 'as_fn_append ()
+ {
+ eval $1+=\$2
+ }'
+else
+ as_fn_append ()
+ {
+ eval $1=\$$1\$2
+ }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+ eval 'as_fn_arith ()
+ {
+ as_val=$(( $* ))
+ }'
+else
+ as_fn_arith ()
+ {
+ as_val=`expr "$@" || test $? -eq 1`
+ }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+ case `echo 'xy\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ xy) ECHO_C='\c';;
+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
+ ECHO_T=' ';;
+ esac;;
+*)
+ ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+ if ln -s conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -pR'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ as_ln_s='cp -pR'
+ elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+ else
+ as_ln_s='cp -pR'
+ fi
+else
+ as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || eval $as_mkdir_p || {
+ as_dirs=
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
+ done
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p='mkdir -p "$as_dir"'
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by dnsdist $as_me 1.7.3, which was
+generated by GNU Autoconf 2.69. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration. Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number and configuration settings, then exit
+ --config print configuration, then exit
+ -q, --quiet, --silent
+ do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+dnsdist config.status 1.7.3
+configured by $0, generated by GNU Autoconf 2.69,
+ with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2012 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=?*)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ --*=)
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=
+ ac_shift=:
+ ;;
+ *)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ $as_echo "$ac_cs_version"; exit ;;
+ --config | --confi | --conf | --con | --co | --c )
+ $as_echo "$ac_cs_config"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ '') as_fn_error $? "missing file argument" ;;
+ esac
+ as_fn_append CONFIG_FILES " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ case $ac_optarg in
+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+ ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+ --help | --hel | -h )
+ $as_echo "$ac_cs_usage"; exit ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+ *) as_fn_append ac_config_targets " $1"
+ ac_need_defaults=false ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ shift
+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+ CONFIG_SHELL='$SHELL'
+ export CONFIG_SHELL
+ exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
+nm_file_list_spec \
+lt_cv_truncate_bin \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+reload_flag_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_separator_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path \
+reload_cmds_CXX \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX \
+postlink_cmds_CXX; do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[\\\\\\\`\\"\\\$]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ RM='$RM'
+ ofile='$ofile'
+
+
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+ case $ac_config_target in
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "ext/yahttp/Makefile") CONFIG_FILES="$CONFIG_FILES ext/yahttp/Makefile" ;;
+ "ext/yahttp/yahttp/Makefile") CONFIG_FILES="$CONFIG_FILES ext/yahttp/yahttp/Makefile" ;;
+ "ext/ipcrypt/Makefile") CONFIG_FILES="$CONFIG_FILES ext/ipcrypt/Makefile" ;;
+
+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+ esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+ tmp= ac_tmp=
+ trap 'exit_status=$?
+ : "${ac_tmp:=$tmp}"
+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+ trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ test -d "$tmp"
+} ||
+{
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+ eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+ ac_cs_awk_cr='\\r'
+else
+ ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+ echo "cat >conf$$subs.awk <<_ACEOF" &&
+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+ echo "_ACEOF"
+} >conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ . ./conf$$subs.sh ||
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+ if test $ac_delim_n = $ac_delim_num; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+ N
+ s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+ for (key in S) S_is_set[key] = 1
+ FS = ""
+
+}
+{
+ line = $ 0
+ nfields = split(line, field, "@")
+ substed = 0
+ len = length(field[1])
+ for (i = 2; i < nfields; i++) {
+ key = field[i]
+ keylen = length(key)
+ if (S_is_set[key]) {
+ value = S[key]
+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+ len += length(value) + length(field[++i])
+ substed = 1
+ } else
+ len += 1 + keylen
+ }
+
+ print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+ cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
+h
+s///
+s/^/:/
+s/[ ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[ ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+ if test -z "$ac_tt"; then
+ break
+ elif $ac_last_try; then
+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any. Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[ ]*#[ ]*define[ ][ ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ for (key in D) D_is_set[key] = 1
+ FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+ line = \$ 0
+ split(line, arg, " ")
+ if (arg[1] == "#") {
+ defundef = arg[2]
+ mac1 = arg[3]
+ } else {
+ defundef = substr(arg[1], 2)
+ mac1 = arg[2]
+ }
+ split(mac1, mac2, "(") #)
+ macro = mac2[1]
+ prefix = substr(line, 1, index(line, defundef) - 1)
+ if (D_is_set[macro]) {
+ # Preserve the white space surrounding the "#".
+ print prefix "define", macro P[macro] D[macro]
+ next
+ } else {
+ # Replace #undef with comments. This is necessary, for example,
+ # in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ if (defundef == "undef") {
+ print "/*", prefix defundef, macro, "*/"
+ next
+ }
+ }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$ac_tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+ esac
+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+ as_fn_append ac_file_inputs " '$ac_f'"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input='Generated from '`
+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+ `' by configure.'
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+ fi
+ # Neutralize special characters interpreted by sed in replacement strings.
+ case $configure_input in #(
+ *\&* | *\|* | *\\* )
+ ac_sed_conf_input=`$as_echo "$configure_input" |
+ sed 's/[\\\\&|]/\\\\&/g'`;; #(
+ *) ac_sed_conf_input=$configure_input;;
+ esac
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$ac_tmp/stdin" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+ esac
+ ;;
+ esac
+
+ ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ as_dir="$ac_dir"; as_fn_mkdir_p
+ ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+ .) # We are building in place.
+ ac_srcdir=.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
+ "$ac_tmp/out"`; test -z "$ac_out"; } &&
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined" >&2;}
+
+ rm -f "$ac_tmp/stdin"
+ case $ac_file in
+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+ esac \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+ if test x"$ac_file" != x-; then
+ {
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+ } >"$ac_tmp/config.h" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ rm -f "$ac_file"
+ mv "$ac_tmp/config.h" "$ac_file" \
+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ fi
+ else
+ $as_echo "/* $configure_input */" \
+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+ || as_fn_error $? "could not create -" "$LINENO" 5
+ fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $_am_arg | $_am_arg:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
+
+
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+ # Older Autoconf quotes --file arguments for eval, but not when files
+ # are listed without --file. Let's play safe and only enable the eval
+ # if we detect the quoting.
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ case $CONFIG_FILES in #(
+ *\'*) :
+ eval set x "$CONFIG_FILES" ;; #(
+ *) :
+ set x $CONFIG_FILES ;; #(
+ *) :
+ ;;
+esac
+ shift
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
+ do
+ # Strip MF so we end up with the name of the file.
+ am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$am_mf" : 'X\(//\)[^/]' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles" >&5
+ (cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } || am_rc=$?
+ done
+ if test $am_rc -ne 0; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. Try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ { am_dirpart=; unset am_dirpart;}
+ { am_filepart=; unset am_filepart;}
+ { am_mf=; unset am_mf;}
+ { am_rc=; unset am_rc;}
+ rm -f conftest-deps.mk
+}
+ ;;
+ "libtool":C)
+
+ # See if we are running on zsh, and set the options that allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile=${ofile}T
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the same
+# distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 <http://www.gnu.org/licenses/>.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags='CXX '
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and where our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x$2 in
+ x)
+ ;;
+ *:)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+ ;;
+ x:*)
+ eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+ ;;
+ *)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+
+
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+
+ltmain=$ac_aux_dir/ltmain.sh
+
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+
+ cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+ ;;
+
+ esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuration summary" >&5
+$as_echo "$as_me: Configuration summary" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: =====================" >&5
+$as_echo "$as_me: =====================" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+if test "x$ac_configure_args" != "x"; then :
+ summary_conf_opts=$ac_configure_args
+else
+ summary_conf_opts="(no options)"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: dnsdist configured with: $summary_conf_opts" >&5
+$as_echo "$as_me: dnsdist configured with: $summary_conf_opts" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CC: $CC" >&5
+$as_echo "$as_me: CC: $CC" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CXX: $CXX" >&5
+$as_echo "$as_me: CXX: $CXX" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: LD: $LD" >&5
+$as_echo "$as_me: LD: $LD" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CFLAGS: $CFLAGS" >&5
+$as_echo "$as_me: CFLAGS: $CFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CPPFLAGS: $CPPFLAGS" >&5
+$as_echo "$as_me: CPPFLAGS: $CPPFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CXXFLAGS: $CXXFLAGS" >&5
+$as_echo "$as_me: CXXFLAGS: $CXXFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: LDFLAGS: $LDFLAGS" >&5
+$as_echo "$as_me: LDFLAGS: $LDFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: LIBS: $LIBS" >&5
+$as_echo "$as_me: LIBS: $LIBS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: BOOST_CPPFLAGS: $BOOST_CPPFLAGS" >&5
+$as_echo "$as_me: BOOST_CPPFLAGS: $BOOST_CPPFLAGS" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Features enabled" >&5
+$as_echo "$as_me: Features enabled" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: ----------------" >&5
+$as_echo "$as_me: ----------------" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Lua: $LUAPC" >&5
+$as_echo "$as_me: Lua: $LUAPC" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: Protobuf: yes" >&5
+$as_echo "$as_me: Protobuf: yes" >&6;}
+if test "x$systemd" != "xn"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: systemd: yes" >&5
+$as_echo "$as_me: systemd: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: systemd: no" >&5
+$as_echo "$as_me: systemd: no" >&6;}
+
+fi
+if test "x$LIBCRYPTO_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ipcipher: yes" >&5
+$as_echo "$as_me: ipcipher: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: ipcipher: no" >&5
+$as_echo "$as_me: ipcipher: no" >&6;}
+
+fi
+if test "x$LIBSODIUM_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: libsodium: yes" >&5
+$as_echo "$as_me: libsodium: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: libsodium: no" >&5
+$as_echo "$as_me: libsodium: no" >&6;}
+
+fi
+if test "x$enable_dnscrypt" != "xno"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: DNSCrypt: yes" >&5
+$as_echo "$as_me: DNSCrypt: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: DNSCrypt: no" >&5
+$as_echo "$as_me: DNSCrypt: no" >&6;}
+
+fi
+if test "x$FSTRM_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: dnstap: yes" >&5
+$as_echo "$as_me: dnstap: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: dnstap: no" >&5
+$as_echo "$as_me: dnstap: no" >&6;}
+
+fi
+if test "x$RE2_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: re2: yes" >&5
+$as_echo "$as_me: re2: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: re2: no" >&5
+$as_echo "$as_me: re2: no" >&6;}
+
+fi
+if test "x$NET_SNMP_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SNMP: yes" >&5
+$as_echo "$as_me: SNMP: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: SNMP: no" >&5
+$as_echo "$as_me: SNMP: no" >&6;}
+
+fi
+if test "x$enable_dns_over_tls" != "xno"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: DNS over TLS: yes" >&5
+$as_echo "$as_me: DNS over TLS: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: DNS over TLS: no" >&5
+$as_echo "$as_me: DNS over TLS: no" >&6;}
+
+fi
+if test "x$enable_dns_over_https" != "xno"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: DNS over HTTPS (DoH): yes" >&5
+$as_echo "$as_me: DNS over HTTPS (DoH): yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: DNS over HTTPS (DoH): no" >&5
+$as_echo "$as_me: DNS over HTTPS (DoH): no" >&6;}
+
+fi
+if test "x$enable_dns_over_tls" != "xno"; then :
+
+ if test "x$GNUTLS_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: GnuTLS: yes" >&5
+$as_echo "$as_me: GnuTLS: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: GnuTLS: no" >&5
+$as_echo "$as_me: GnuTLS: no" >&6;}
+
+fi
+
+fi
+if test "x$enable_dns_over_tls" != "xno" -o "x$enable_dns_over_https" != "xno"; then :
+
+ if test "x$LIBSSL_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: OpenSSL: yes" >&5
+$as_echo "$as_me: OpenSSL: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: OpenSSL: no" >&5
+$as_echo "$as_me: OpenSSL: no" >&6;}
+
+fi
+
+fi
+if test "x$NGHTTP2_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: nghttp2: yes" >&5
+$as_echo "$as_me: nghttp2: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: nghttp2: no" >&5
+$as_echo "$as_me: nghttp2: no" >&6;}
+
+fi
+if test "x$CDB_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: cdb: yes" >&5
+$as_echo "$as_me: cdb: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: cdb: no" >&5
+$as_echo "$as_me: cdb: no" >&6;}
+
+fi
+if test "x$LMDB_LIBS" != "x"; then :
+ { $as_echo "$as_me:${as_lineno-$LINENO}: lmdb: yes" >&5
+$as_echo "$as_me: lmdb: yes" >&6;}
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: lmdb: no" >&5
+$as_echo "$as_me: lmdb: no" >&6;}
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: " >&5
+$as_echo "$as_me: " >&6;}
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..3708df0
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,242 @@
+AC_PREREQ([2.69])
+
+AC_INIT([dnsdist], [1.7.3])
+AM_INIT_AUTOMAKE([foreign tar-ustar dist-bzip2 no-dist-gzip parallel-tests 1.11 subdir-objects])
+AM_SILENT_RULES([yes])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADERS([config.h])
+AC_PROG_CC
+AC_PROG_CXX
+AC_LANG([C++])
+
+PDNS_CHECK_TIME_T
+
+AC_DEFINE([DNSDIST], [1],
+ [This is dnsdist]
+)
+
+LT_PREREQ([2.2.2])
+LT_INIT([disable-static])
+
+CFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter $CFLAGS"
+CXXFLAGS="-g -O3 -Wall -Wextra -Wshadow -Wno-unused-parameter -Wmissing-declarations -Wredundant-decls $CXXFLAGS"
+
+PDNS_WITH_LIBSODIUM
+PDNS_CHECK_DNSTAP([auto])
+PDNS_CHECK_RAGEL([dnslabeltext.cc], [www.dnsdist.org])
+PDNS_CHECK_LIBEDIT
+PDNS_CHECK_CLOCK_GETTIME
+
+PDNS_CHECK_OS
+PTHREAD_SET_NAME
+PDNS_CHECK_NETWORK_LIBS
+PDNS_CHECK_PTHREAD_NP
+PDNS_CHECK_SECURE_MEMSET
+
+BOOST_REQUIRE([1.42])
+
+PDNS_ENABLE_UNIT_TESTS
+PDNS_WITH_RE2
+DNSDIST_ENABLE_DNSCRYPT
+PDNS_WITH_EBPF
+PDNS_WITH_NET_SNMP
+PDNS_WITH_LIBCAP
+
+AX_AVAILABLE_SYSTEMD
+AX_CHECK_SYSTEMD_FEATURES
+AM_CONDITIONAL([HAVE_SYSTEMD], [ test x"$systemd" = "xy" ])
+PDNS_WITH_SERVICE_USER([dnsdist])
+
+dnl the *_r functions are in posix so we can use them unconditionally, but the ext/yahttp code is
+dnl using the defines.
+AC_CHECK_FUNCS_ONCE([localtime_r gmtime_r])
+AC_SUBST([YAHTTP_CFLAGS], ['-I$(top_srcdir)/ext/yahttp'])
+AC_SUBST([YAHTTP_LIBS], ['$(top_builddir)/ext/yahttp/yahttp/libyahttp.la'])
+AC_SUBST([IPCRYPT_CFLAGS], ['-I$(top_srcdir)/ext/ipcrypt'])
+AC_SUBST([IPCRYPT_LIBS], ['$(top_builddir)/ext/ipcrypt/libipcrypt.la'])
+
+PDNS_WITH_LUA([mandatory])
+AS_IF([test "x$LUAPC" = "xluajit"], [
+ # export all symbols to be able to use the Lua FFI interface
+ AC_MSG_NOTICE([Adding -rdynamic to export all symbols for the Lua FFI interface])
+ LDFLAGS="$LDFLAGS -rdynamic"
+])
+PDNS_CHECK_LUA_HPP
+
+AM_CONDITIONAL([HAVE_GNUTLS], [false])
+AM_CONDITIONAL([HAVE_LIBSSL], [false])
+AM_CONDITIONAL([HAVE_LMDB], [false])
+AM_CONDITIONAL([HAVE_CDB], [false])
+
+PDNS_CHECK_LIBCRYPTO
+
+PDNS_ENABLE_DNS_OVER_TLS
+DNSDIST_ENABLE_DNS_OVER_HTTPS
+
+AS_IF([test "x$enable_dns_over_tls" != "xno" -o "x$enable_dns_over_https" != "xno"], [
+ PDNS_WITH_LIBSSL
+])
+
+AS_IF([test "x$enable_dns_over_tls" != "xno"], [
+ PDNS_WITH_GNUTLS
+
+ AS_IF([test "x$HAVE_GNUTLS" != "x1" -a "x$HAVE_LIBSSL" != "x1"], [
+ AC_MSG_ERROR([DNS over TLS support requested but neither GnuTLS nor OpenSSL are available])
+ ])
+])
+
+PDNS_CHECK_LIBH2OEVLOOP
+AS_IF([test "x$enable_dns_over_https" != "xno"], [
+ AS_IF([test "x$HAVE_LIBH2OEVLOOP" != "x1"], [
+ AC_MSG_ERROR([DNS over HTTPS support requested but libh2o-evloop was not found])
+ ])
+
+ AS_IF([test "x$HAVE_LIBSSL" != "x1"], [
+ AC_MSG_ERROR([DNS over HTTPS support requested but OpenSSL was not found])
+ ])
+])
+
+PDNS_WITH_NGHTTP2
+
+PDNS_CHECK_CDB
+PDNS_CHECK_LMDB
+
+AX_CXX_COMPILE_STDCXX_17([noext], [mandatory])
+
+AC_MSG_CHECKING([whether we will enable compiler security checks])
+AC_ARG_ENABLE([hardening],
+ [AS_HELP_STRING([--disable-hardening], [disable compiler security checks @<:@default=no@:>@])],
+ [enable_hardening=$enableval],
+ [enable_hardening=yes]
+)
+AC_MSG_RESULT([$enable_hardening])
+
+AS_IF([test "x$enable_hardening" != "xno"], [
+ AC_CC_PIE
+ AC_CC_STACK_PROTECTOR
+ AC_CC_PARAM_SSP_BUFFER_SIZE([4])
+ AC_CC_D_FORTIFY_SOURCE
+ AC_LD_RELRO
+])
+
+PDNS_ENABLE_SANITIZERS
+
+PDNS_CHECK_PYTHON_VENV
+
+AM_CONDITIONAL([HAVE_MANPAGES], [test -e "$srcdir/dnsdist.1"])
+AM_COND_IF([HAVE_MANPAGES],[],[
+ AM_COND_IF([HAVE_VENV],[],[
+ AC_MSG_WARN([Python 3 and/or venv module are not available, documentation will not be built.])
+ ])
+])
+
+LDFLAGS="$RELRO_LDFLAGS $LDFLAGS"
+
+CFLAGS="$SANITIZER_FLAGS $PIE_CFLAGS $CFLAGS"
+CXXFLAGS="$SANITIZER_FLAGS $PIE_CFLAGS $CXXFLAGS"
+
+PROGRAM_LDFLAGS="$PIE_LDFLAGS $PROGRAM_LDFLAGS"
+AC_SUBST([PROGRAM_LDFLAGS])
+
+AC_SUBST([AM_CPPFLAGS],
+ ["AS_ESCAPE([-I$(top_builddir) -I$(top_srcdir)]) $THREADFLAGS $BOOST_CPPFLAGS"]
+)
+
+AC_ARG_VAR(PACKAGEVERSION, [The version used in secpoll queries])
+AS_IF([test "x$PACKAGEVERSION" != "x"],
+ [AC_DEFINE_UNQUOTED([PACKAGEVERSION], "$PACKAGEVERSION", [Set to the package version used for secpoll])]
+)
+
+AC_CONFIG_FILES([Makefile
+ ext/yahttp/Makefile
+ ext/yahttp/yahttp/Makefile
+ ext/ipcrypt/Makefile])
+
+AC_OUTPUT
+
+AC_MSG_NOTICE([])
+AC_MSG_NOTICE([Configuration summary])
+AC_MSG_NOTICE([=====================])
+AC_MSG_NOTICE([])
+AS_IF([test "x$ac_configure_args" != "x"],
+ [summary_conf_opts=$ac_configure_args],
+ [summary_conf_opts="(no options)"]
+)
+AC_MSG_NOTICE([dnsdist configured with: $summary_conf_opts])
+AC_MSG_NOTICE([])
+AC_MSG_NOTICE([CC: $CC])
+AC_MSG_NOTICE([CXX: $CXX])
+AC_MSG_NOTICE([LD: $LD])
+AC_MSG_NOTICE([CFLAGS: $CFLAGS])
+AC_MSG_NOTICE([CPPFLAGS: $CPPFLAGS])
+AC_MSG_NOTICE([CXXFLAGS: $CXXFLAGS])
+AC_MSG_NOTICE([LDFLAGS: $LDFLAGS])
+AC_MSG_NOTICE([LIBS: $LIBS])
+AC_MSG_NOTICE([BOOST_CPPFLAGS: $BOOST_CPPFLAGS])
+AC_MSG_NOTICE([])
+AC_MSG_NOTICE([Features enabled])
+AC_MSG_NOTICE([----------------])
+AC_MSG_NOTICE([Lua: $LUAPC])
+AC_MSG_NOTICE([Protobuf: yes])
+AS_IF([test "x$systemd" != "xn"],
+ [AC_MSG_NOTICE([systemd: yes])],
+ [AC_MSG_NOTICE([systemd: no])]
+)
+AS_IF([test "x$LIBCRYPTO_LIBS" != "x"],
+ [AC_MSG_NOTICE([ipcipher: yes])],
+ [AC_MSG_NOTICE([ipcipher: no])]
+)
+AS_IF([test "x$LIBSODIUM_LIBS" != "x"],
+ [AC_MSG_NOTICE([libsodium: yes])],
+ [AC_MSG_NOTICE([libsodium: no])]
+)
+AS_IF([test "x$enable_dnscrypt" != "xno"],
+ [AC_MSG_NOTICE([DNSCrypt: yes])],
+ [AC_MSG_NOTICE([DNSCrypt: no])]
+)
+AS_IF([test "x$FSTRM_LIBS" != "x"],
+ [AC_MSG_NOTICE([dnstap: yes])],
+ [AC_MSG_NOTICE([dnstap: no])]
+)
+AS_IF([test "x$RE2_LIBS" != "x"],
+ [AC_MSG_NOTICE([re2: yes])],
+ [AC_MSG_NOTICE([re2: no])]
+)
+AS_IF([test "x$NET_SNMP_LIBS" != "x"],
+ [AC_MSG_NOTICE([SNMP: yes])],
+ [AC_MSG_NOTICE([SNMP: no])]
+)
+AS_IF([test "x$enable_dns_over_tls" != "xno"],
+ [AC_MSG_NOTICE([DNS over TLS: yes])],
+ [AC_MSG_NOTICE([DNS over TLS: no])]
+)
+AS_IF([test "x$enable_dns_over_https" != "xno"],
+ [AC_MSG_NOTICE([DNS over HTTPS (DoH): yes])],
+ [AC_MSG_NOTICE([DNS over HTTPS (DoH): no])]
+)
+AS_IF([test "x$enable_dns_over_tls" != "xno"], [
+ AS_IF([test "x$GNUTLS_LIBS" != "x"],
+ [AC_MSG_NOTICE([GnuTLS: yes])],
+ [AC_MSG_NOTICE([GnuTLS: no])]
+ )]
+)
+AS_IF([test "x$enable_dns_over_tls" != "xno" -o "x$enable_dns_over_https" != "xno"], [
+ AS_IF([test "x$LIBSSL_LIBS" != "x"],
+ [AC_MSG_NOTICE([OpenSSL: yes])],
+ [AC_MSG_NOTICE([OpenSSL: no])]
+ )]
+)
+AS_IF([test "x$NGHTTP2_LIBS" != "x"],
+ [AC_MSG_NOTICE([nghttp2: yes])],
+ [AC_MSG_NOTICE([nghttp2: no])]
+)
+AS_IF([test "x$CDB_LIBS" != "x"],
+ [AC_MSG_NOTICE([cdb: yes])],
+ [AC_MSG_NOTICE([cdb: no])]
+)
+AS_IF([test "x$LMDB_LIBS" != "x"],
+ [AC_MSG_NOTICE([lmdb: yes])],
+ [AC_MSG_NOTICE([lmdb: no])]
+)
+
+AC_MSG_NOTICE([])
diff --git a/connection-management.hh b/connection-management.hh
new file mode 100644
index 0000000..3237f74
--- /dev/null
+++ b/connection-management.hh
@@ -0,0 +1,66 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "lock.hh"
+
+class ConcurrentConnectionManager
+{
+public:
+ ConcurrentConnectionManager(size_t max)
+ {
+ setMaxConcurrentConnections(max);
+ }
+
+ void setMaxConcurrentConnections(size_t max)
+ {
+ d_data.lock()->d_maxConcurrentConnections = max;
+ }
+
+ size_t getMaxConcurrentConnections()
+ {
+ return d_data.lock()->d_maxConcurrentConnections;
+ }
+
+ bool registerConnection()
+ {
+ auto data = d_data.lock();
+ if (data->d_maxConcurrentConnections == 0 || data->d_currentConnectionsCount < data->d_maxConcurrentConnections) {
+ ++data->d_currentConnectionsCount;
+ return true;
+ }
+ return false;
+ }
+
+ void releaseConnection()
+ {
+ --(d_data.lock()->d_currentConnectionsCount);
+ }
+
+private:
+ struct Data {
+ size_t d_maxConcurrentConnections{0};
+ size_t d_currentConnectionsCount{0};
+ };
+
+ LockGuarded<Data> d_data;
+};
diff --git a/credentials.cc b/credentials.cc
new file mode 100644
index 0000000..d058a94
--- /dev/null
+++ b/credentials.cc
@@ -0,0 +1,477 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "config.h"
+
+#include <cmath>
+#include <stdexcept>
+
+#ifdef HAVE_LIBSODIUM
+#include <sodium.h>
+#endif
+
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+#include <openssl/evp.h>
+#include <openssl/kdf.h>
+#include <openssl/opensslv.h>
+#include <openssl/rand.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "base64.hh"
+#include "credentials.hh"
+#include "misc.hh"
+
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+static size_t const pwhash_max_size = 128U; /* maximum size of the output */
+static size_t const pwhash_output_size = 32U; /* size of the hashed output (before base64 encoding) */
+static unsigned int const pwhash_salt_size = 16U; /* size of the salt (before base64 encoding */
+static uint64_t const pwhash_max_work_factor = 32768U; /* max N for interactive login purposes */
+
+/* PHC string format, storing N as log2(N) as done by passlib.
+ for now we only support one algo but we might have to change that later */
+static std::string const pwhash_prefix = "$scrypt$";
+static size_t const pwhash_prefix_size = pwhash_prefix.size();
+#endif
+
+uint64_t const CredentialsHolder::s_defaultWorkFactor{1024U}; /* N */
+uint64_t const CredentialsHolder::s_defaultParallelFactor{1U}; /* p */
+uint64_t const CredentialsHolder::s_defaultBlockSize{8U}; /* r */
+
+SensitiveData::SensitiveData(std::string&& data) :
+ d_data(std::move(data))
+{
+#ifdef HAVE_LIBSODIUM
+ sodium_mlock(d_data.data(), d_data.size());
+#endif
+}
+
+SensitiveData& SensitiveData::operator=(SensitiveData&& rhs)
+{
+ d_data = std::move(rhs.d_data);
+ return *this;
+}
+
+SensitiveData::SensitiveData(size_t bytes)
+{
+ d_data.resize(bytes);
+#ifdef HAVE_LIBSODIUM
+ sodium_mlock(d_data.data(), d_data.size());
+#endif
+}
+
+SensitiveData::~SensitiveData()
+{
+ clear();
+}
+
+void SensitiveData::clear()
+{
+#ifdef HAVE_LIBSODIUM
+ sodium_munlock(d_data.data(), d_data.size());
+#endif
+ d_data.clear();
+}
+
+static std::string hashPasswordInternal(const std::string& password, const std::string& salt, uint64_t workFactor, uint64_t parallelFactor, uint64_t blockSize)
+{
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ auto pctx = std::unique_ptr<EVP_PKEY_CTX, void (*)(EVP_PKEY_CTX*)>(EVP_PKEY_CTX_new_id(EVP_PKEY_SCRYPT, nullptr), EVP_PKEY_CTX_free);
+ if (!pctx) {
+ throw std::runtime_error("Error getting a scrypt context to hash the supplied password");
+ }
+
+ if (EVP_PKEY_derive_init(pctx.get()) <= 0) {
+ throw std::runtime_error("Error intializing the scrypt context to hash the supplied password");
+ }
+
+ // OpenSSL 3.0 changed the string arg to const unsigned char*, other versions use const char *
+#if OPENSSL_VERSION_MAJOR >= 3
+ auto passwordData = reinterpret_cast<const char*>(password.data());
+#else
+ auto passwordData = reinterpret_cast<const unsigned char*>(password.data());
+#endif
+ if (EVP_PKEY_CTX_set1_pbe_pass(pctx.get(), passwordData, password.size()) <= 0) {
+ throw std::runtime_error("Error adding the password to the scrypt context to hash the supplied password");
+ }
+
+ if (EVP_PKEY_CTX_set1_scrypt_salt(pctx.get(), reinterpret_cast<const unsigned char*>(salt.data()), salt.size()) <= 0) {
+ throw std::runtime_error("Error adding the salt to the scrypt context to hash the supplied password");
+ }
+
+ if (EVP_PKEY_CTX_set_scrypt_N(pctx.get(), workFactor) <= 0) {
+ throw std::runtime_error("Error setting the work factor to the scrypt context to hash the supplied password");
+ }
+
+ if (EVP_PKEY_CTX_set_scrypt_r(pctx.get(), blockSize) <= 0) {
+ throw std::runtime_error("Error setting the block size to the scrypt context to hash the supplied password");
+ }
+
+ if (EVP_PKEY_CTX_set_scrypt_p(pctx.get(), parallelFactor) <= 0) {
+ throw std::runtime_error("Error setting the parallel factor to the scrypt context to hash the supplied password");
+ }
+
+ std::string out;
+ out.resize(pwhash_output_size);
+ size_t outlen = out.size();
+
+ if (EVP_PKEY_derive(pctx.get(), reinterpret_cast<unsigned char*>(out.data()), &outlen) <= 0 || outlen != pwhash_output_size) {
+ throw std::runtime_error("Error deriving the output from the scrypt context to hash the supplied password");
+ }
+
+ return out;
+#else
+ throw std::runtime_error("Hashing support is not available");
+#endif
+}
+
+static std::string generateRandomSalt()
+{
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ /* generate a random salt */
+ std::string salt;
+ salt.resize(pwhash_salt_size);
+
+ if (RAND_bytes(reinterpret_cast<unsigned char*>(salt.data()), salt.size()) != 1) {
+ throw std::runtime_error("Error while generating a salt to hash the supplied password");
+ }
+
+ return salt;
+#else
+ throw std::runtime_error("Generating a salted password requires scrypt support in OpenSSL, and it is not available");
+#endif
+}
+
+std::string hashPassword(const std::string& password, uint64_t workFactor, uint64_t parallelFactor, uint64_t blockSize)
+{
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ std::string result;
+ result.reserve(pwhash_max_size);
+
+ result.append(pwhash_prefix);
+ result.append("ln=");
+ result.append(std::to_string(static_cast<uint64_t>(std::log2(workFactor))));
+ result.append(",p=");
+ result.append(std::to_string(parallelFactor));
+ result.append(",r=");
+ result.append(std::to_string(blockSize));
+ result.append("$");
+ auto salt = generateRandomSalt();
+ result.append(Base64Encode(salt));
+ result.append("$");
+
+ auto out = hashPasswordInternal(password, salt, workFactor, parallelFactor, blockSize);
+
+ result.append(Base64Encode(out));
+
+ return result;
+#else
+ throw std::runtime_error("Hashing a password requires scrypt support in OpenSSL, and it is not available");
+#endif
+}
+
+std::string hashPassword(const std::string& password)
+{
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ return hashPassword(password, CredentialsHolder::s_defaultWorkFactor, CredentialsHolder::s_defaultParallelFactor, CredentialsHolder::s_defaultBlockSize);
+#else
+ throw std::runtime_error("Hashing a password requires scrypt support in OpenSSL, and it is not available");
+#endif
+}
+
+bool verifyPassword(const std::string& binaryHash, const std::string& salt, uint64_t workFactor, uint64_t parallelFactor, uint64_t blockSize, const std::string& binaryPassword)
+{
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ auto expected = hashPasswordInternal(binaryPassword, salt, workFactor, parallelFactor, blockSize);
+ return constantTimeStringEquals(expected, binaryHash);
+#else
+ throw std::runtime_error("Hashing a password requires scrypt support in OpenSSL, and it is not available");
+#endif
+}
+
+/* parse a hashed password in PHC string format */
+static void parseHashed(const std::string& hash, std::string& salt, std::string& hashedPassword, uint64_t& workFactor, uint64_t& parallelFactor, uint64_t& blockSize)
+{
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ auto parametersEnd = hash.find('$', pwhash_prefix.size());
+ if (parametersEnd == std::string::npos || parametersEnd == hash.size()) {
+ throw std::runtime_error("Invalid hashed password format, no parameters");
+ }
+
+ auto parametersStr = hash.substr(pwhash_prefix.size(), parametersEnd);
+ std::vector<std::string> parameters;
+ parameters.reserve(3);
+ stringtok(parameters, parametersStr, ",");
+ if (parameters.size() != 3) {
+ throw std::runtime_error("Invalid hashed password format, expecting 3 parameters, got " + std::to_string(parameters.size()));
+ }
+
+ if (!boost::starts_with(parameters.at(0), "ln=")) {
+ throw std::runtime_error("Invalid hashed password format, ln= parameter not found");
+ }
+
+ if (!boost::starts_with(parameters.at(1), "p=")) {
+ throw std::runtime_error("Invalid hashed password format, p= parameter not found");
+ }
+
+ if (!boost::starts_with(parameters.at(2), "r=")) {
+ throw std::runtime_error("Invalid hashed password format, r= parameter not found");
+ }
+
+ auto saltPos = parametersEnd + 1;
+ auto saltEnd = hash.find('$', saltPos);
+ if (saltEnd == std::string::npos || saltEnd == hash.size()) {
+ throw std::runtime_error("Invalid hashed password format");
+ }
+
+ try {
+ workFactor = pdns_stou(parameters.at(0).substr(3));
+ workFactor = static_cast<uint64_t>(1) << workFactor;
+ if (workFactor > pwhash_max_work_factor) {
+ throw std::runtime_error("Invalid work factor of " + std::to_string(workFactor) + " in hashed password string, maximum is " + std::to_string(pwhash_max_work_factor));
+ }
+
+ parallelFactor = pdns_stou(parameters.at(1).substr(2));
+ blockSize = pdns_stou(parameters.at(2).substr(2));
+
+ auto b64Salt = hash.substr(saltPos, saltEnd - saltPos);
+ salt.reserve(pwhash_salt_size);
+ B64Decode(b64Salt, salt);
+
+ if (salt.size() != pwhash_salt_size) {
+ throw std::runtime_error("Invalid salt in hashed password string");
+ }
+
+ hashedPassword.reserve(pwhash_output_size);
+ B64Decode(hash.substr(saltEnd + 1), hashedPassword);
+
+ if (hashedPassword.size() != pwhash_output_size) {
+ throw std::runtime_error("Invalid hash in hashed password string");
+ }
+ }
+ catch (const std::exception& e) {
+ throw std::runtime_error("Invalid hashed password format, unable to parse parameters");
+ }
+#endif
+}
+
+bool verifyPassword(const std::string& hash, const std::string& password)
+{
+ if (!isPasswordHashed(hash)) {
+ return false;
+ }
+
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ std::string salt;
+ std::string hashedPassword;
+ uint64_t workFactor = 0;
+ uint64_t parallelFactor = 0;
+ uint64_t blockSize = 0;
+ parseHashed(hash, salt, hashedPassword, workFactor, parallelFactor, blockSize);
+
+ auto expected = hashPasswordInternal(password, salt, workFactor, parallelFactor, blockSize);
+
+ return constantTimeStringEquals(expected, hashedPassword);
+#else
+ throw std::runtime_error("Verifying a hashed password requires scrypt support in OpenSSL, and it is not available");
+#endif
+}
+
+bool isPasswordHashed(const std::string& password)
+{
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ if (password.size() < pwhash_prefix_size || password.size() > pwhash_max_size) {
+ return false;
+ }
+
+ if (!boost::starts_with(password, pwhash_prefix)) {
+ return false;
+ }
+
+ auto parametersEnd = password.find('$', pwhash_prefix.size());
+ if (parametersEnd == std::string::npos || parametersEnd == password.size()) {
+ return false;
+ }
+
+ size_t parametersSize = parametersEnd - pwhash_prefix.size();
+ /* ln=X,p=Y,r=Z */
+ if (parametersSize < 12) {
+ return false;
+ }
+
+ auto saltEnd = password.find('$', parametersEnd + 1);
+ if (saltEnd == std::string::npos || saltEnd == password.size()) {
+ return false;
+ }
+
+ /* the salt is base64 encoded so it has to be larger than that */
+ if ((saltEnd - parametersEnd - 1) < pwhash_salt_size) {
+ return false;
+ }
+
+ /* the hash base64 encoded so it has to be larger than that */
+ if ((password.size() - saltEnd - 1) < pwhash_output_size) {
+ return false;
+ }
+
+ return true;
+#else
+ return false;
+#endif
+}
+
+/* if the password is in cleartext and hashing is available,
+ the hashed form will be kept in memory */
+CredentialsHolder::CredentialsHolder(std::string&& password, bool hashPlaintext) :
+ d_credentials(std::move(password))
+{
+ if (isHashingAvailable()) {
+ if (!isPasswordHashed(d_credentials.getString())) {
+ if (hashPlaintext) {
+ d_salt = generateRandomSalt();
+ d_workFactor = s_defaultWorkFactor;
+ d_parallelFactor = s_defaultParallelFactor;
+ d_blockSize = s_defaultBlockSize;
+ d_credentials = SensitiveData(hashPasswordInternal(d_credentials.getString(), d_salt, d_workFactor, d_parallelFactor, d_blockSize));
+ d_isHashed = true;
+ }
+ }
+ else {
+ d_wasHashed = true;
+ d_isHashed = true;
+ std::string hashedPassword;
+ parseHashed(d_credentials.getString(), d_salt, hashedPassword, d_workFactor, d_parallelFactor, d_blockSize);
+ d_credentials = SensitiveData(std::move(hashedPassword));
+ }
+ }
+
+ if (!d_isHashed) {
+ d_fallbackHashPerturb = random();
+ d_fallbackHash = burtle(reinterpret_cast<const unsigned char*>(d_credentials.getString().data()), d_credentials.getString().size(), d_fallbackHashPerturb);
+ }
+}
+
+CredentialsHolder::~CredentialsHolder()
+{
+ d_fallbackHashPerturb = 0;
+ d_fallbackHash = 0;
+}
+
+bool CredentialsHolder::matches(const std::string& password) const
+{
+ if (d_isHashed) {
+ return verifyPassword(d_credentials.getString(), d_salt, d_workFactor, d_parallelFactor, d_blockSize, password);
+ }
+ else {
+ uint32_t fallback = burtle(reinterpret_cast<const unsigned char*>(password.data()), password.size(), d_fallbackHashPerturb);
+ if (fallback != d_fallbackHash) {
+ return false;
+ }
+
+ return constantTimeStringEquals(password, d_credentials.getString());
+ }
+}
+
+bool CredentialsHolder::isHashingAvailable()
+{
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ return true;
+#else
+ return false;
+#endif
+}
+
+#include <signal.h>
+#include <termios.h>
+
+SensitiveData CredentialsHolder::readFromTerminal()
+{
+ struct termios term;
+ struct termios oterm;
+ bool restoreTermSettings = false;
+ int termAction = TCSAFLUSH;
+#ifdef TCSASOFT
+ termAction |= TCSASOFT;
+#endif
+
+ FDWrapper input(open("/dev/tty", O_RDONLY));
+ if (int(input) != -1) {
+ if (tcgetattr(input, &oterm) == 0) {
+ memcpy(&term, &oterm, sizeof(term));
+ term.c_lflag &= ~(ECHO | ECHONL);
+ tcsetattr(input, termAction, &term);
+ restoreTermSettings = true;
+ }
+ }
+ else {
+ input = FDWrapper(dup(STDIN_FILENO));
+ restoreTermSettings = false;
+ }
+
+ FDWrapper output(open("/dev/tty", O_WRONLY));
+ if (int(output) == -1) {
+ output = FDWrapper(dup(STDERR_FILENO));
+ }
+
+ struct std::map<int, struct sigaction> signals;
+ struct sigaction sa;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ sa.sa_handler = [](int s) {};
+ sigaction(SIGALRM, &sa, &signals[SIGALRM]);
+ sigaction(SIGHUP, &sa, &signals[SIGHUP]);
+ sigaction(SIGINT, &sa, &signals[SIGINT]);
+ sigaction(SIGPIPE, &sa, &signals[SIGPIPE]);
+ sigaction(SIGQUIT, &sa, &signals[SIGQUIT]);
+ sigaction(SIGTERM, &sa, &signals[SIGTERM]);
+ sigaction(SIGTSTP, &sa, &signals[SIGTSTP]);
+ sigaction(SIGTTIN, &sa, &signals[SIGTTIN]);
+ sigaction(SIGTTOU, &sa, &signals[SIGTTOU]);
+
+ std::string buffer;
+ /* let's allocate a huge buffer now to prevent reallocation,
+ which would leave parts of the buffer around */
+ buffer.reserve(512);
+
+ for (;;) {
+ char ch = '\0';
+ auto got = read(input, &ch, 1);
+ if (got == 1 && ch != '\n' && ch != '\r') {
+ buffer.push_back(ch);
+ }
+ else {
+ break;
+ }
+ }
+
+ if (restoreTermSettings) {
+ tcsetattr(input, termAction, &oterm);
+ }
+
+ for (const auto& sig : signals) {
+ sigaction(sig.first, &sig.second, nullptr);
+ }
+
+ return SensitiveData(std::move(buffer));
+}
diff --git a/credentials.hh b/credentials.hh
new file mode 100644
index 0000000..6e59c6b
--- /dev/null
+++ b/credentials.hh
@@ -0,0 +1,103 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <memory>
+#include <string>
+
+class SensitiveData
+{
+public:
+ SensitiveData(size_t bytes);
+ SensitiveData(std::string&& data);
+ SensitiveData& operator=(SensitiveData&&);
+
+ ~SensitiveData();
+ void clear();
+ const std::string& getString() const
+ {
+ return d_data;
+ }
+ std::string& getString()
+ {
+ return d_data;
+ }
+
+private:
+ std::string d_data;
+};
+
+std::string hashPassword(const std::string& password);
+std::string hashPassword(const std::string& password, uint64_t workFactor, uint64_t parallelFactor, uint64_t blockSize);
+bool verifyPassword(const std::string& hash, const std::string& password);
+bool verifyPassword(const std::string& binaryHash, const std::string& salt, uint64_t workFactor, uint64_t parallelFactor, uint64_t blockSize, const std::string& binaryPassword);
+bool isPasswordHashed(const std::string& password);
+
+class CredentialsHolder
+{
+public:
+ /* if hashPlaintext is true, the password is in cleartext and hashing is available,
+ the hashed form will be kept in memory.
+ Note that accepting hashed password from an untrusted source might open
+ us to a denial of service, since we currently don't cap the the parameters,
+ including the work factor */
+ CredentialsHolder(std::string&& password, bool hashPlaintext);
+ ~CredentialsHolder();
+
+ CredentialsHolder(const CredentialsHolder&) = delete;
+ CredentialsHolder& operator=(const CredentialsHolder&) = delete;
+
+ bool matches(const std::string& password) const;
+ /* whether it was constructed from a hashed and salted string */
+ bool wasHashed() const
+ {
+ return d_wasHashed;
+ }
+ /* whether it is hashed in memory */
+ bool isHashed() const
+ {
+ return d_isHashed;
+ }
+
+ static bool isHashingAvailable();
+ static SensitiveData readFromTerminal();
+
+ static uint64_t const s_defaultWorkFactor;
+ static uint64_t const s_defaultParallelFactor;
+ static uint64_t const s_defaultBlockSize;
+
+private:
+ SensitiveData d_credentials;
+ /* if the password is hashed, we only extract
+ the salt and parameters once */
+ std::string d_salt;
+ uint64_t d_workFactor{0};
+ uint64_t d_parallelFactor{0};
+ uint64_t d_blockSize{0};
+ /* seed our hash so it's not predictable */
+ uint32_t d_fallbackHashPerturb{0};
+ uint32_t d_fallbackHash{0};
+ /* whether it was constructed from a hashed and salted string */
+ bool d_wasHashed{false};
+ /* whether it is hashed in memory */
+ bool d_isHashed{false};
+};
diff --git a/delaypipe.cc b/delaypipe.cc
new file mode 100644
index 0000000..be363d6
--- /dev/null
+++ b/delaypipe.cc
@@ -0,0 +1,188 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "delaypipe.hh"
+#include "misc.hh"
+#include "gettime.hh"
+#include <thread>
+#include "threadname.hh"
+
+template<class T>
+ObjectPipe<T>::ObjectPipe()
+{
+ if(pipe(d_fds))
+ unixDie("pipe");
+}
+
+template<class T>
+ObjectPipe<T>::~ObjectPipe()
+{
+ ::close(d_fds[0]);
+ if(d_fds[1] >= 0)
+ ::close(d_fds[1]);
+}
+
+template<class T>
+void ObjectPipe<T>::close()
+{
+ if(d_fds[1] < 0)
+ return;
+ ::close(d_fds[1]); // the writing side
+ d_fds[1]=-1;
+}
+
+template<class T>
+void ObjectPipe<T>::write(T& t)
+{
+ auto ptr = new T(t);
+ if(::write(d_fds[1], &ptr, sizeof(ptr)) != sizeof(ptr)) {
+ delete ptr;
+ unixDie("write");
+ }
+}
+
+template<class T>
+int ObjectPipe<T>::readTimeout(T* t, double msec)
+{
+ while (true) {
+ int ret = waitForData(d_fds[0], 0, 1000*msec);
+ if (ret < 0) {
+ if (errno == EINTR) {
+ continue;
+ }
+ unixDie("waiting for data in object pipe");
+ }
+ else if (ret == 0) {
+ return -1;
+ }
+
+ T* ptr = nullptr;
+ ret = ::read(d_fds[0], &ptr, sizeof(ptr)); // this is BLOCKING!
+
+ if (ret < 0) {
+ if (errno == EINTR) {
+ continue;
+ }
+ unixDie("read");
+ }
+ else if (ret == 0) {
+ return false;
+ }
+
+ if (ret != sizeof(ptr)) {
+ throw std::runtime_error("Partial read, should not happen 2");
+ }
+
+ *t = *ptr;
+ delete ptr;
+ return 1;
+ }
+}
+
+
+template<class T>
+DelayPipe<T>::DelayPipe() : d_thread(&DelayPipe<T>::worker, this)
+{
+}
+
+template<class T>
+void DelayPipe<T>::gettime(struct timespec* ts)
+{
+ ::gettime(ts);
+}
+
+
+template<class T>
+void DelayPipe<T>::submit(T& t, int msec)
+{
+ struct timespec now;
+ gettime(&now);
+ now.tv_nsec += msec*1e6;
+ while(now.tv_nsec > 1e9) {
+ now.tv_sec++;
+ now.tv_nsec-=1e9;
+ }
+ Combo c{t, now};
+ d_pipe.write(c);
+}
+
+template<class T>
+DelayPipe<T>::~DelayPipe()
+{
+ d_pipe.close();
+ d_thread.join();
+}
+
+
+
+template<class T>
+void DelayPipe<T>::worker()
+{
+ setThreadName("dnsdist/delayPi");
+ Combo c;
+ for(;;) {
+ /* this code is slightly too subtle, but I don't see how it could be any simpler.
+ So we have a set of work to do, and we need to wait until the time arrives to do it.
+ Simultaneously new work might come in. So we try to combine both of these things by
+ setting a timeout on listening to the pipe over which new work comes in. This timeout
+ is equal to the wait until the first thing that needs to be done.
+
+ Two additional cases exist: we have no work to wait for, so we can wait infinitely long.
+ The other special case is that the first we have to do.. is in the past, so we need to do it
+ immediately. */
+
+
+ double delay=-1; // infinite
+ struct timespec now;
+ if(!d_work.empty()) {
+ gettime(&now);
+ delay=1000*tsdelta(d_work.begin()->first, now);
+ if(delay < 0) {
+ delay=0; // don't wait - we have work that is late already!
+ }
+ }
+ if(delay != 0 ) {
+ int ret = d_pipe.readTimeout(&c, delay);
+ if(ret > 0) { // we got an object
+ d_work.emplace(c.when, c.what);
+ }
+ else if(ret==0) { // EOF
+ break;
+ }
+ else {
+ ;
+ }
+ gettime(&now);
+ }
+
+ tscomp cmp;
+
+ for(auto iter = d_work.begin() ; iter != d_work.end(); ) { // do the needful
+ if(cmp(iter->first, now)) {
+ iter->second();
+ d_work.erase(iter++);
+ }
+ else {
+ break;
+ }
+ }
+ }
+}
diff --git a/delaypipe.hh b/delaypipe.hh
new file mode 100644
index 0000000..ad1626a
--- /dev/null
+++ b/delaypipe.hh
@@ -0,0 +1,85 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <map>
+#include <time.h>
+#include <thread>
+
+/**
+ General idea: many threads submit work to this class, but only one executes it. The work should therefore be entirely trivial.
+ The implementation is that submitter threads create an object that represents the work, and it gets sent over a pipe
+ to the worker thread.
+
+ The worker thread meanwhile listens on this pipe (non-blocking), with a delay set to the next object that needs to be executed.
+ If meanwhile new work comes in, all objects who's time has come are executed, a new sleep time is calculated.
+*/
+
+
+/* ObjectPipe facilitates the type-safe passing of types over a pipe */
+
+template<class T>
+class ObjectPipe
+{
+public:
+ ObjectPipe();
+ ~ObjectPipe();
+ void write(T& t);
+ int readTimeout(T* t, double msec); //!< -1 is timeout, 0 is no data, 1 is data. msec<0 waits infinitely long. msec==0 = undefined
+ void close();
+private:
+ int d_fds[2];
+};
+
+template<class T>
+class DelayPipe
+{
+public:
+ DelayPipe();
+ ~DelayPipe();
+ void submit(T& t, int msec); //!< don't try for more than 4294 msec
+
+private:
+ void worker();
+ struct Combo
+ {
+ T what;
+ struct timespec when;
+ };
+
+ double tsdelta(const struct timespec& a, const struct timespec& b) // read as a-b
+ {
+ return 1.0*(a.tv_sec-b.tv_sec)+1.0*(a.tv_nsec-b.tv_nsec)/1000000000.0;
+ }
+
+ ObjectPipe<Combo> d_pipe;
+ struct tscomp {
+ bool operator()(const struct timespec& a, const struct timespec& b) const
+ {
+ return std::tie(a.tv_sec, a.tv_nsec) < std::tie(b.tv_sec, b.tv_nsec);
+ }
+ };
+ std::multimap<struct timespec, T, tscomp> d_work;
+ void gettime(struct timespec* ts);
+ std::thread d_thread;
+};
+
+#include "delaypipe.cc"
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..65cbf70
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1999-2018 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 2, 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 <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try '$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by 'PROGRAMS ARGS'.
+ object Object file output by 'PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputting dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+# Get the directory component of the given path, and save it in the
+# global variables '$dir'. Note that this directory component will
+# be either empty or ending with a '/' character. This is deliberate.
+set_dir_from ()
+{
+ case $1 in
+ */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+ *) dir=;;
+ esac
+}
+
+# Get the suffix-stripped basename of the given path, and save it the
+# global variable '$base'.
+set_base_from ()
+{
+ base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
+}
+
+# If no dependency file was actually created by the compiler invocation,
+# we still have to create a dummy depfile, to avoid errors with the
+# Makefile "include basename.Plo" scheme.
+make_dummy_depfile ()
+{
+ echo "#dummy" > "$depfile"
+}
+
+# Factor out some common post-processing of the generated depfile.
+# Requires the auxiliary global variable '$tmpdepfile' to be set.
+aix_post_process_depfile ()
+{
+ # If the compiler actually managed to produce a dependency file,
+ # post-process it.
+ if test -f "$tmpdepfile"; then
+ # Each line is of the form 'foo.o: dependency.h'.
+ # Do two passes, one to just change these to
+ # $object: dependency.h
+ # and one to simply output
+ # dependency.h:
+ # which is needed to avoid the deleted-header problem.
+ { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
+ sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
+ } > "$depfile"
+ rm -f "$tmpdepfile"
+ else
+ make_dummy_depfile
+ fi
+}
+
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+# Character ranges might be problematic outside the C locale.
+# These definitions help.
+upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
+lower=abcdefghijklmnopqrstuvwxyz
+digits=0123456789
+alpha=${upper}${lower}
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Avoid interferences from the environment.
+gccflag= dashmflag=
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+ # This is just like msvisualcpp but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvisualcpp
+fi
+
+if test "$depmode" = msvc7msys; then
+ # This is just like msvc7 but w/o cygpath translation.
+ # Just convert the backslash-escaped backslashes to single forward
+ # slashes to satisfy depend.m4
+ cygpath_u='sed s,\\\\,/,g'
+ depmode=msvc7
+fi
+
+if test "$depmode" = xlc; then
+ # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
+ gccflag=-qmakedep=gcc,-MF
+ depmode=gcc
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
+## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
+## (see the conditional assignment to $gccflag above).
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say). Also, it might not be
+## supported by the other compilers which use the 'gcc' depmode.
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The second -e expression handles DOS-style file names with drive
+ # letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the "deleted header file" problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+## Some versions of gcc put a space before the ':'. On the theory
+## that the space means something, we add a space to the output as
+## well. hp depmode also adds that space, but also prefixes the VPATH
+## to the object. Take care to not repeat it in the output.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like '#:fec' to the end of the
+ # dependency line.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+ | tr "$nl" ' ' >> "$depfile"
+ echo >> "$depfile"
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+xlc)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts '$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
+ "$@" -Wc,-M
+ else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
+ "$@" -M
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ aix_post_process_depfile
+ ;;
+
+tcc)
+ # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
+ # FIXME: That version still under development at the moment of writing.
+ # Make that this statement remains true also for stable, released
+ # versions.
+ # It will wrap lines (doesn't matter whether long or short) with a
+ # trailing '\', as in:
+ #
+ # foo.o : \
+ # foo.c \
+ # foo.h \
+ #
+ # It will put a trailing '\' even on the last line, and will use leading
+ # spaces rather than leading tabs (at least since its commit 0394caf7
+ # "Emit spaces for -MD").
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
+ # We have to change lines of the first kind to '$object: \'.
+ sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
+ # And for each line of the second kind, we have to emit a 'dep.h:'
+ # dummy dependency, to avoid the deleted-header problem.
+ sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\' :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ set_dir_from "$object"
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ set_base_from "$source"
+ tmpdepfile=$base.d
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir=$base.d-lock
+ trap "
+ echo '$0: caught signal, cleaning up...' >&2
+ rmdir '$lockdir'
+ exit 1
+ " 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0; do
+ # mkdir is a portable test-and-set.
+ if mkdir "$lockdir" 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rmdir "$lockdir"
+ break
+ else
+ # If the lock is being held by a different process, wait
+ # until the winning process is done or we timeout.
+ while test -d "$lockdir" && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ set_dir_from "$object"
+ set_base_from "$object"
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add 'dependent.h:' lines.
+ sed -ne '2,${
+ s/^ *//
+ s/ \\*$//
+ s/$/:/
+ p
+ }' "$tmpdepfile" >> "$depfile"
+ else
+ make_dummy_depfile
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in 'foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ set_dir_from "$object"
+ set_base_from "$object"
+
+ if test "$libtool" = yes; then
+ # Libtool generates 2 separate objects for the 2 libraries. These
+ # two compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir$base.o.d # libtool 1.5
+ tmpdepfile2=$dir.libs/$base.o.d # Likewise.
+ tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ # Same post-processing that is required for AIX mode.
+ aix_post_process_depfile
+ ;;
+
+msvc7)
+ if test "$libtool" = yes; then
+ showIncludes=-Wc,-showIncludes
+ else
+ showIncludes=-showIncludes
+ fi
+ "$@" $showIncludes > "$tmpdepfile"
+ stat=$?
+ grep -v '^Note: including file: ' "$tmpdepfile"
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ # The first sed program below extracts the file names and escapes
+ # backslashes for cygpath. The second sed program outputs the file
+ # name when reading, but also accumulates all include files in the
+ # hold buffer in order to output them again at the end. This only
+ # works with sed implementations that can handle large buffers.
+ sed < "$tmpdepfile" -n '
+/^Note: including file: *\(.*\)/ {
+ s//\1/
+ s/\\/\\\\/g
+ p
+}' | $cygpath_u | sort -u | sed -n '
+s/ /\\ /g
+s/\(.*\)/'"$tab"'\1 \\/p
+s/.\(.*\) \\/\1:/
+H
+$ {
+ s/.*/'"$tab"'/
+ G
+ p
+}' >> "$depfile"
+ echo >> "$depfile" # make sure the fragment doesn't end with a backslash
+ rm -f "$tmpdepfile"
+ ;;
+
+msvc7msys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for ':'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
+ "$@" $dashmflag |
+ sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this sed invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ tr ' ' "$nl" < "$tmpdepfile" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no eat=no
+ for arg
+ do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ if test $eat = yes; then
+ eat=no
+ continue
+ fi
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -arch)
+ eat=yes ;;
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix=`echo "$object" | sed 's/^.*\././'`
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ # makedepend may prepend the VPATH from the source file name to the object.
+ # No need to regex-escape $object, excess matching of '.' is harmless.
+ sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process the last invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed '1,2d' "$tmpdepfile" \
+ | tr ' ' "$nl" \
+ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
+ | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove '-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E \
+ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ | sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test "X$1" != 'X--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E 2>/dev/null |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
+ echo "$tab" >> "$depfile"
+ sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvcmsys)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/devpollmplexer.cc b/devpollmplexer.cc
new file mode 100644
index 0000000..37a0d48
--- /dev/null
+++ b/devpollmplexer.cc
@@ -0,0 +1,216 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+/*
+ * NOTE: sys/devpoll.h relies on sigset_t being already defined so we need
+ * to include sys/signal.h *before* including sys/devpoll.h.
+ */
+#include <sys/signal.h>
+#include <sys/devpoll.h>
+#include "mplexer.hh"
+#include "sstuff.hh"
+#include <iostream>
+#include <unistd.h>
+#include "misc.hh"
+
+#include "namespaces.hh"
+
+class DevPollFDMultiplexer : public FDMultiplexer
+{
+public:
+ DevPollFDMultiplexer();
+ ~DevPollFDMultiplexer()
+ {
+ if (d_devpollfd >= 0) {
+ close(d_devpollfd);
+ }
+ }
+
+ int run(struct timeval* tv, int timeout = 500) override;
+ void getAvailableFDs(std::vector<int>& fds, int timeout) override;
+
+ void addFD(int fd, FDMultiplexer::EventKind kind) override;
+ void removeFD(int fd, FDMultiplexer::EventKind kind) override;
+
+ string getName() const override
+ {
+ return "/dev/poll";
+ }
+
+private:
+ int d_devpollfd;
+};
+
+static FDMultiplexer* makeDevPoll()
+{
+ return new DevPollFDMultiplexer();
+}
+
+static struct DevPollRegisterOurselves
+{
+ DevPollRegisterOurselves()
+ {
+ FDMultiplexer::getMultiplexerMap().emplace(1, &makeDevPoll); // priority 1, so that /dev/poll is preferred over poll, but not over completion ports!
+ }
+} doItDevPoll;
+
+DevPollFDMultiplexer::DevPollFDMultiplexer()
+{
+ d_devpollfd = open("/dev/poll", O_RDWR);
+ if (d_devpollfd < 0) {
+ throw FDMultiplexerException("Setting up /dev/poll: " + stringerror());
+ }
+}
+
+static int convertEventKind(FDMultiplexer::EventKind kind)
+{
+ switch (kind) {
+ case FDMultiplexer::EventKind::Read:
+ return POLLIN;
+ case FDMultiplexer::EventKind::Write:
+ return POLLOUT;
+ case FDMultiplexer::EventKind::Both:
+ return POLLIN | POLLOUT;
+ }
+ throw std::runtime_error("Unhandled event kind in the /dev/poll multiplexer");
+}
+
+void DevPollFDMultiplexer::addFD(int fd, FDMultiplexer::EventKind kind)
+{
+ struct pollfd devent;
+ devent.fd = fd;
+ devent.events = convertEventKind(kind);
+ devent.revents = 0;
+
+ if (write(d_devpollfd, &devent, sizeof(devent)) != sizeof(devent)) {
+ throw FDMultiplexerException("Adding fd to /dev/poll/ set: " + stringerror());
+ }
+}
+
+void DevPollFDMultiplexer::removeFD(int fd, FDMultiplexer::EventKind)
+{
+ struct pollfd devent;
+ devent.fd = fd;
+ devent.events = POLLREMOVE;
+ devent.revents = 0;
+
+ if (write(d_devpollfd, &devent, sizeof(devent)) != sizeof(devent)) {
+ throw FDMultiplexerException("Removing fd from epoll set: " + stringerror());
+ }
+}
+
+void DevPollFDMultiplexer::getAvailableFDs(std::vector<int>& fds, int timeout)
+{
+ std::vector<struct pollfd> pollfds(d_readCallbacks.size() + d_writeCallbacks.size());
+ struct dvpoll dvp;
+ dvp.dp_nfds = d_readCallbacks.size() + d_writeCallbacks.size();
+ dvp.dp_fds = pollfds.data();
+ dvp.dp_timeout = timeout;
+ int ret = ioctl(d_devpollfd, DP_POLL, &dvp);
+
+ if (ret < 0 && errno != EINTR) {
+ throw FDMultiplexerException("/dev/poll returned error: " + stringerror());
+ }
+
+ for (int n = 0; n < ret; ++n) {
+ fds.push_back(pollfds.at(n).fd);
+ }
+}
+
+int DevPollFDMultiplexer::run(struct timeval* now, int timeout)
+{
+ if (d_inrun) {
+ throw FDMultiplexerException("FDMultiplexer::run() is not reentrant!\n");
+ }
+ std::vector<struct pollfd> fds(d_readCallbacks.size() + d_writeCallbacks.size());
+ struct dvpoll dvp;
+ dvp.dp_nfds = d_readCallbacks.size() + d_writeCallbacks.size();
+ dvp.dp_fds = fds.data();
+ dvp.dp_timeout = timeout;
+ int ret = ioctl(d_devpollfd, DP_POLL, &dvp);
+ int err = errno;
+ gettimeofday(now, nullptr); // MANDATORY!
+
+ if (ret < 0 && err != EINTR) {
+ throw FDMultiplexerException("/dev/poll returned error: " + stringerror(err));
+ }
+
+ if (ret < 1) { // thanks AB!
+ return 0;
+ }
+
+ d_inrun = true;
+ int count = 0;
+ for (int n = 0; n < ret; ++n) {
+ if ((fds.at(n).revents & POLLIN) || (fds.at(n).revents & POLLERR) || (fds.at(n).revents & POLLHUP)) {
+ const auto& iter = d_readCallbacks.find(fds.at(n).fd);
+ if (iter != d_readCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ count++;
+ }
+ }
+
+ if ((fds.at(n).revents & POLLOUT) || (fds.at(n).revents & POLLERR)) {
+ const auto& iter = d_writeCallbacks.find(fds.at(n).fd);
+ if (iter != d_writeCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ count++;
+ }
+ }
+ }
+
+ d_inrun = false;
+ return count;
+}
+
+#if 0
+void acceptData(int fd, funcparam_t& parameter)
+{
+ cout<<"Have data on fd "<<fd<<endl;
+ Socket* sock=funcparam_t_cast<Socket*>(parameter);
+ string packet;
+ IPEndpoint rem;
+ sock->recvFrom(packet, rem);
+ cout<<"Received "<<packet.size()<<" bytes!\n";
+}
+
+
+int main()
+{
+ Socket s(AF_INET, SOCK_DGRAM);
+
+ IPEndpoint loc("0.0.0.0", 2000);
+ s.bind(loc);
+
+ DevPollFDMultiplexer sfm;
+
+ sfm.addReadFD(s.getHandle(), &acceptData, &s);
+
+ for(int n=0; n < 100 ; ++n) {
+ sfm.run();
+ }
+ sfm.removeReadFD(s.getHandle());
+ sfm.removeReadFD(s.getHandle());
+}
+#endif
diff --git a/dns.cc b/dns.cc
new file mode 100644
index 0000000..01a63d8
--- /dev/null
+++ b/dns.cc
@@ -0,0 +1,103 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "dns.hh"
+#include "misc.hh"
+#include <stdexcept>
+#include <iostream>
+#include <boost/algorithm/string.hpp>
+#include <boost/assign/list_of.hpp>
+#include "dnsparser.hh"
+
+std::vector<std::string> RCode::rcodes_s = boost::assign::list_of
+ ("No Error")
+ ("Form Error")
+ ("Server Failure")
+ ("Non-Existent domain")
+ ("Not Implemented")
+ ("Query Refused")
+ ("Name Exists when it should not")
+ ("RR Set Exists when it should not")
+ ("RR Set that should exist does not")
+ ("Server Not Authoritative for zone / Not Authorized")
+ ("Name not contained in zone")
+ ("Err#11")
+ ("Err#12")
+ ("Err#13")
+ ("Err#14")
+ ("Err#15") // Last non-extended RCode
+ ("Bad OPT Version / TSIG Signature Failure")
+ ("Key not recognized")
+ ("Signature out of time window")
+ ("Bad TKEY Mode")
+ ("Duplicate key name")
+ ("Algorithm not supported")
+ ("Bad Truncation")
+ ("Bad/missing Server Cookie")
+;
+
+std::string RCode::to_s(uint8_t rcode) {
+ if (rcode > 0xF)
+ return std::string("ErrOutOfRange");
+ return ERCode::to_s(rcode);
+}
+
+std::string ERCode::to_s(uint8_t rcode) {
+ if (rcode > RCode::rcodes_s.size()-1)
+ return std::string("Err#")+std::to_string(rcode);
+ return RCode::rcodes_s[rcode];
+}
+
+std::string Opcode::to_s(uint8_t opcode) {
+ static const std::vector<std::string> s_opcodes = { "Query", "IQuery", "Status", "3", "Notify", "Update" };
+
+ if (opcode >= s_opcodes.size()) {
+ return std::to_string(opcode);
+ }
+
+ return s_opcodes.at(opcode);
+}
+
+// goal is to hash based purely on the question name, and turn error into 'default'
+uint32_t hashQuestion(const uint8_t* packet, uint16_t packet_len, uint32_t init)
+{
+ if (packet_len < sizeof(dnsheader)) {
+ return init;
+ }
+ // C++ 17 does not have std::u8string_view
+ std::basic_string_view<uint8_t> name(packet + sizeof(dnsheader), packet_len - sizeof(dnsheader));
+ std::basic_string_view<uint8_t>::size_type len = 0;
+
+ while (len < name.length()) {
+ uint8_t labellen = name[len++];
+ if (labellen == 0) {
+ // len is name.length() at max as it was < before the increment
+ return burtleCI(name.data(), len, init);
+ }
+ len += labellen;
+ }
+ // We've encountered a label that is too long
+ return init;
+}
+
diff --git a/dns.hh b/dns.hh
new file mode 100644
index 0000000..a23ad5b
--- /dev/null
+++ b/dns.hh
@@ -0,0 +1,245 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/tuple/tuple_comparison.hpp>
+#include <boost/multi_index/key_extractors.hpp>
+#include <boost/multi_index/sequenced_index.hpp>
+#include "qtype.hh"
+#include "dnsname.hh"
+#include <time.h>
+#include <sys/types.h>
+
+#undef BADSIG // signal.h SIG_ERR
+
+class DNSBackend;
+struct DNSRecord;
+
+struct SOAData
+{
+ SOAData() : ttl(0), serial(0), refresh(0), retry(0), expire(0), minimum(0), db(0), domain_id(-1) {};
+
+ DNSName qname;
+ DNSName nameserver;
+ DNSName hostmaster;
+ uint32_t ttl;
+ uint32_t serial;
+ uint32_t refresh;
+ uint32_t retry;
+ uint32_t expire;
+ uint32_t minimum;
+ DNSBackend *db;
+ int domain_id;
+
+ uint32_t getNegativeTTL() const { return min(ttl, minimum); }
+};
+
+class RCode
+{
+public:
+ enum rcodes_ { NoError=0, FormErr=1, ServFail=2, NXDomain=3, NotImp=4, Refused=5, YXDomain=6, YXRRSet=7, NXRRSet=8, NotAuth=9, NotZone=10};
+ static std::string to_s(uint8_t rcode);
+ static std::vector<std::string> rcodes_s;
+};
+
+class ERCode
+{
+public:
+ enum rcodes_ { BADVERS=16, BADSIG=16, BADKEY=17, BADTIME=18, BADMODE=19, BADNAME=20, BADALG=21, BADTRUNC=22, BADCOOKIE=23 };
+ static std::string to_s(uint8_t rcode);
+};
+
+class Opcode
+{
+public:
+ enum { Query=0, IQuery=1, Status=2, Notify=4, Update=5 };
+ static std::string to_s(uint8_t opcode);
+};
+
+//! This class represents a resource record
+class DNSResourceRecord
+{
+public:
+ DNSResourceRecord() : last_modified(0), ttl(0), signttl(0), domain_id(-1), qclass(1), scopeMask(0), auth(1), disabled(0) {};
+ static DNSResourceRecord fromWire(const DNSRecord& d);
+
+ enum Place : uint8_t {QUESTION=0, ANSWER=1, AUTHORITY=2, ADDITIONAL=3}; //!< Type describing the positioning within, say, a DNSPacket
+
+ void setContent(const string& content);
+ string getZoneRepresentation(bool noDot=false) const;
+
+ // data
+ DNSName qname; //!< the name of this record, for example: www.powerdns.com
+ DNSName ordername;
+ DNSName wildcardname;
+ string content; //!< what this record points to. Example: 10.1.2.3
+
+ // Aligned on 8-byte boundaries on systems where time_t is 8 bytes and int
+ // is 4 bytes, aka modern linux on x86_64
+ time_t last_modified; //!< For autocalculating SOA serial numbers - the backend needs to fill this in
+
+ uint32_t ttl; //!< Time To Live of this record
+ uint32_t signttl; //!< If non-zero, use this TTL as original TTL in the RRSIG
+
+ int domain_id; //!< If a backend implements this, the domain_id of the zone this record is in
+ QType qtype; //!< qtype of this record, ie A, CNAME, MX etc
+ uint16_t qclass; //!< class of this record
+
+ uint8_t scopeMask;
+ bool auth;
+ bool disabled;
+
+ bool operator==(const DNSResourceRecord& rhs);
+
+ bool operator<(const DNSResourceRecord &b) const
+ {
+ if(qname < b.qname)
+ return true;
+ if(qname == b.qname)
+ return(content < b.content);
+ return false;
+ }
+};
+
+#define GCCPACKATTRIBUTE __attribute__((packed))
+
+struct dnsrecordheader
+{
+ uint16_t d_type;
+ uint16_t d_class;
+ uint32_t d_ttl;
+ uint16_t d_clen;
+} GCCPACKATTRIBUTE;
+
+struct EDNS0Record
+{
+ uint8_t extRCode, version;
+ uint16_t extFlags;
+} GCCPACKATTRIBUTE;
+
+static_assert(sizeof(EDNS0Record) == 4, "EDNS0Record size must be 4");
+
+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
+#include <machine/endian.h>
+#elif __linux__ || __GNU__
+# include <endian.h>
+
+#else // with thanks to <arpa/nameser.h>
+
+# define LITTLE_ENDIAN 1234 /* least-significant byte first (vax, pc) */
+# define BIG_ENDIAN 4321 /* most-significant byte first (IBM, net) */
+# define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long (pdp) */
+
+#if defined(vax) || defined(ns32000) || defined(sun386) || defined(i386) || \
+ defined(__i386) || defined(__ia64) || defined(__amd64) || \
+ defined(MIPSEL) || defined(_MIPSEL) || defined(BIT_ZERO_ON_RIGHT) || \
+ defined(__alpha__) || defined(__alpha) || \
+ (defined(__Lynx__) && defined(__x86__))
+# define BYTE_ORDER LITTLE_ENDIAN
+#endif
+
+#if defined(sel) || defined(pyr) || defined(mc68000) || defined(sparc) || \
+ defined(__sparc) || \
+ defined(is68k) || defined(tahoe) || defined(ibm032) || defined(ibm370) || \
+ defined(MIPSEB) || defined(_MIPSEB) || defined(_IBMR2) || defined(DGUX) ||\
+ defined(apollo) || defined(__convex__) || defined(_CRAY) || \
+ defined(__hppa) || defined(__hp9000) || \
+ defined(__hp9000s300) || defined(__hp9000s700) || \
+ defined(__hp3000s900) || defined(MPE) || \
+ defined(BIT_ZERO_ON_LEFT) || defined(m68k) || \
+ (defined(__Lynx__) && \
+ (defined(__68k__) || defined(__sparc__) || defined(__powerpc__)))
+# define BYTE_ORDER BIG_ENDIAN
+#endif
+
+#endif
+
+struct dnsheader {
+ unsigned id :16; /* query identification number */
+#if BYTE_ORDER == BIG_ENDIAN
+ /* fields in third byte */
+ unsigned qr: 1; /* response flag */
+ unsigned opcode: 4; /* purpose of message */
+ unsigned aa: 1; /* authoritative answer */
+ unsigned tc: 1; /* truncated message */
+ unsigned rd: 1; /* recursion desired */
+ /* fields in fourth byte */
+ unsigned ra: 1; /* recursion available */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned rcode :4; /* response code */
+#elif BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+ /* fields in third byte */
+ unsigned rd :1; /* recursion desired */
+ unsigned tc :1; /* truncated message */
+ unsigned aa :1; /* authoritative answer */
+ unsigned opcode :4; /* purpose of message */
+ unsigned qr :1; /* response flag */
+ /* fields in fourth byte */
+ unsigned rcode :4; /* response code */
+ unsigned cd: 1; /* checking disabled by resolver */
+ unsigned ad: 1; /* authentic data from named */
+ unsigned unused :1; /* unused bits (MBZ as of 4.9.3a3) */
+ unsigned ra :1; /* recursion available */
+#endif
+ /* remaining bytes */
+ unsigned qdcount :16; /* number of question entries */
+ unsigned ancount :16; /* number of answer entries */
+ unsigned nscount :16; /* number of authority entries */
+ unsigned arcount :16; /* number of resource entries */
+};
+
+static_assert(sizeof(dnsheader) == 12, "dnsheader size must be 12");
+
+inline uint16_t * getFlagsFromDNSHeader(struct dnsheader * dh)
+{
+ return (uint16_t*) (((char *) dh) + sizeof(uint16_t));
+}
+
+#define DNS_TYPE_SIZE (2)
+#define DNS_CLASS_SIZE (2)
+#define DNS_TTL_SIZE (4)
+#define DNS_RDLENGTH_SIZE (2)
+#define EDNS_EXTENDED_RCODE_SIZE (1)
+#define EDNS_VERSION_SIZE (1)
+#define EDNS_OPTION_CODE_SIZE (2)
+#define EDNS_OPTION_LENGTH_SIZE (2)
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define FLAGS_RD_OFFSET (8)
+#define FLAGS_CD_OFFSET (12)
+#elif BYTE_ORDER == LITTLE_ENDIAN || BYTE_ORDER == PDP_ENDIAN
+#define FLAGS_RD_OFFSET (0)
+#define FLAGS_CD_OFFSET (12)
+#endif
+
+extern time_t s_starttime;
+
+uint32_t hashQuestion(const uint8_t* packet, uint16_t len, uint32_t init);
+
+struct TSIGTriplet
+{
+ DNSName name, algo;
+ string secret;
+};
diff --git a/dnscrypt.cc b/dnscrypt.cc
new file mode 100644
index 0000000..74d9182
--- /dev/null
+++ b/dnscrypt.cc
@@ -0,0 +1,868 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "config.h"
+#ifdef HAVE_DNSCRYPT
+#include <fstream>
+#include "dolog.hh"
+#include "dnscrypt.hh"
+#include "dnswriter.hh"
+
+DNSCryptPrivateKey::DNSCryptPrivateKey()
+{
+ sodium_memzero(key, sizeof(key));
+ sodium_mlock(key, sizeof(key));
+}
+
+void DNSCryptPrivateKey::loadFromFile(const std::string& keyFile)
+{
+ ifstream file(keyFile);
+ sodium_memzero(key, sizeof(key));
+ file.read((char*) key, sizeof(key));
+
+ if (file.fail()) {
+ sodium_memzero(key, sizeof(key));
+ file.close();
+ throw std::runtime_error("Invalid DNSCrypt key file " + keyFile);
+ }
+
+ file.close();
+}
+
+void DNSCryptPrivateKey::saveToFile(const std::string& keyFile) const
+{
+ ofstream file(keyFile);
+ file.write(reinterpret_cast<const char*>(key), sizeof(key));
+ file.close();
+}
+
+DNSCryptPrivateKey::~DNSCryptPrivateKey()
+{
+ sodium_munlock(key, sizeof(key));
+}
+
+DNSCryptExchangeVersion DNSCryptQuery::getVersion() const
+{
+ if (d_pair == nullptr) {
+ throw std::runtime_error("Unable to determine the version of a DNSCrypt query if there is not associated cert");
+ }
+
+ return DNSCryptContext::getExchangeVersion(d_pair->cert);
+}
+
+#ifdef HAVE_CRYPTO_BOX_EASY_AFTERNM
+DNSCryptQuery::~DNSCryptQuery()
+{
+ if (d_sharedKeyComputed) {
+ sodium_munlock(d_sharedKey, sizeof(d_sharedKey));
+ }
+}
+
+int DNSCryptQuery::computeSharedKey()
+{
+ assert(d_pair != nullptr);
+
+ int res = 0;
+
+ if (d_sharedKeyComputed) {
+ return res;
+ }
+
+ const DNSCryptExchangeVersion version = DNSCryptContext::getExchangeVersion(d_pair->cert);
+
+ sodium_mlock(d_sharedKey, sizeof(d_sharedKey));
+
+ if (version == DNSCryptExchangeVersion::VERSION1) {
+ res = crypto_box_beforenm(d_sharedKey,
+ d_header.clientPK,
+ d_pair->privateKey.key);
+ }
+ else if (version == DNSCryptExchangeVersion::VERSION2) {
+#ifdef HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY
+ res = crypto_box_curve25519xchacha20poly1305_beforenm(d_sharedKey,
+ d_header.clientPK,
+ d_pair->privateKey.key);
+#else /* HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY */
+ res = -1;
+#endif /* HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY */
+ }
+ else {
+ res = -1;
+ }
+
+ if (res != 0) {
+ sodium_munlock(d_sharedKey, sizeof(d_sharedKey));
+ return res;
+ }
+
+ d_sharedKeyComputed = true;
+ return res;
+}
+#else
+DNSCryptQuery::~DNSCryptQuery()
+{
+}
+#endif /* HAVE_CRYPTO_BOX_EASY_AFTERNM */
+
+
+DNSCryptContext::~DNSCryptContext() {
+}
+
+DNSCryptContext::DNSCryptContext(const std::string& pName, const std::vector<CertKeyPaths>& certKeys): d_certKeyPaths(certKeys), providerName(pName)
+{
+ reloadCertificates();
+}
+
+DNSCryptContext::DNSCryptContext(const std::string& pName, const DNSCryptCert& certificate, const DNSCryptPrivateKey& pKey): providerName(pName)
+{
+ addNewCertificate(certificate, pKey);
+}
+
+void DNSCryptContext::generateProviderKeys(unsigned char publicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE], unsigned char privateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE])
+{
+ int res = crypto_sign_ed25519_keypair(publicKey, privateKey);
+
+ if (res != 0) {
+ throw std::runtime_error("Error generating DNSCrypt provider keys");
+ }
+}
+
+std::string DNSCryptContext::getProviderFingerprint(unsigned char publicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE])
+{
+ boost::format fmt("%02X%02X");
+ ostringstream ret;
+
+ for (size_t idx = 0; idx < DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE; idx += 2)
+ {
+ ret << (fmt % static_cast<int>(publicKey[idx]) % static_cast<int>(publicKey[idx+1]));
+ if (idx < (DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE - 2)) {
+ ret << ":";
+ }
+ }
+
+ return ret.str();
+}
+
+void DNSCryptContext::setExchangeVersion(const DNSCryptExchangeVersion& version, unsigned char esVersion[sizeof(DNSCryptCert::esVersion)])
+{
+ esVersion[0] = 0x00;
+
+ if (version == DNSCryptExchangeVersion::VERSION1) {
+ esVersion[1] = { 0x01 };
+ }
+ else if (version == DNSCryptExchangeVersion::VERSION2) {
+ esVersion[1] = { 0x02 };
+ }
+ else {
+ throw std::runtime_error("Unknown DNSCrypt exchange version");
+ }
+}
+
+DNSCryptExchangeVersion DNSCryptContext::getExchangeVersion(const unsigned char esVersion[sizeof(DNSCryptCert::esVersion)])
+{
+ if (esVersion[0] != 0x00) {
+ throw std::runtime_error("Unknown DNSCrypt exchange version");
+ }
+
+ if (esVersion[1] == 0x01) {
+ return DNSCryptExchangeVersion::VERSION1;
+ }
+ else if (esVersion[1] == 0x02) {
+ return DNSCryptExchangeVersion::VERSION2;
+ }
+
+ throw std::runtime_error("Unknown DNSCrypt exchange version");
+}
+
+DNSCryptExchangeVersion DNSCryptContext::getExchangeVersion(const DNSCryptCert& cert)
+{
+ return getExchangeVersion(cert.esVersion);
+}
+
+
+void DNSCryptContext::generateCertificate(uint32_t serial, time_t begin, time_t end, const DNSCryptExchangeVersion& version, const unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE], DNSCryptPrivateKey& privateKey, DNSCryptCert& cert)
+{
+ unsigned char magic[DNSCRYPT_CERT_MAGIC_SIZE] = DNSCRYPT_CERT_MAGIC_VALUE;
+ unsigned char protocolMinorVersion[] = DNSCRYPT_CERT_PROTOCOL_MINOR_VERSION_VALUE;
+ unsigned char pubK[DNSCRYPT_PUBLIC_KEY_SIZE];
+ unsigned char esVersion[sizeof(DNSCryptCert::esVersion)];
+ setExchangeVersion(version, esVersion);
+
+ generateResolverKeyPair(privateKey, pubK);
+
+ memcpy(cert.magic, magic, sizeof(magic));
+ memcpy(cert.esVersion, esVersion, sizeof(esVersion));
+ memcpy(cert.protocolMinorVersion, protocolMinorVersion, sizeof(protocolMinorVersion));
+ memcpy(cert.signedData.resolverPK, pubK, sizeof(cert.signedData.resolverPK));
+ memcpy(cert.signedData.clientMagic, pubK, sizeof(cert.signedData.clientMagic));
+ cert.signedData.serial = htonl(serial);
+ cert.signedData.tsStart = htonl((uint32_t) begin);
+ cert.signedData.tsEnd = htonl((uint32_t) end);
+
+ unsigned long long signatureSize = 0;
+
+ int res = crypto_sign_ed25519(cert.signature,
+ &signatureSize,
+ (unsigned char*) &cert.signedData,
+ sizeof(cert.signedData),
+ providerPrivateKey);
+
+ if (res == 0) {
+ assert(signatureSize == sizeof(DNSCryptCertSignedData) + DNSCRYPT_SIGNATURE_SIZE);
+ }
+ else {
+ throw std::runtime_error("Error generating DNSCrypt certificate");
+ }
+}
+
+void DNSCryptContext::loadCertFromFile(const std::string&filename, DNSCryptCert& dest)
+{
+ ifstream file(filename);
+ file.read((char *) &dest, sizeof(dest));
+
+ if (file.fail())
+ throw std::runtime_error("Invalid dnscrypt certificate file " + filename);
+
+ file.close();
+}
+
+void DNSCryptContext::saveCertFromFile(const DNSCryptCert& cert, const std::string&filename)
+{
+ ofstream file(filename);
+ file.write(reinterpret_cast<const char *>(&cert), sizeof(cert));
+ file.close();
+}
+
+void DNSCryptContext::generateResolverKeyPair(DNSCryptPrivateKey& privK, unsigned char pubK[DNSCRYPT_PUBLIC_KEY_SIZE])
+{
+ int res = crypto_box_keypair(pubK, privK.key);
+
+ if (res != 0) {
+ throw std::runtime_error("Error generating DNSCrypt resolver keys");
+ }
+}
+
+void DNSCryptContext::computePublicKeyFromPrivate(const DNSCryptPrivateKey& privK, unsigned char* pubK)
+{
+ int res = crypto_scalarmult_base(pubK,
+ privK.key);
+
+ if (res != 0) {
+ throw std::runtime_error("Error computing dnscrypt public key from the private one");
+ }
+}
+
+std::string DNSCryptContext::certificateDateToStr(uint32_t date)
+{
+ char buf[20];
+ time_t tdate = static_cast<time_t>(ntohl(date));
+ struct tm date_tm;
+
+ localtime_r(&tdate, &date_tm);
+ strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &date_tm);
+
+ return string(buf);
+}
+
+void DNSCryptContext::addNewCertificate(std::shared_ptr<DNSCryptCertificatePair>& newCert, bool reload)
+{
+ auto certs = d_certs.write_lock();
+
+ for (auto pair : *certs) {
+ if (pair->cert.getSerial() == newCert->cert.getSerial()) {
+ if (reload) {
+ /* on reload we just assume that this is the same certificate */
+ return;
+ }
+ else {
+ throw std::runtime_error("Error adding a new certificate: we already have a certificate with the same serial");
+ }
+ }
+ }
+
+ certs->push_back(newCert);
+}
+
+void DNSCryptContext::addNewCertificate(const DNSCryptCert& newCert, const DNSCryptPrivateKey& newKey, bool active, bool reload)
+{
+ auto pair = std::make_shared<DNSCryptCertificatePair>();
+ pair->cert = newCert;
+ pair->privateKey = newKey;
+ computePublicKeyFromPrivate(pair->privateKey, pair->publicKey);
+ pair->active = active;
+
+ addNewCertificate(pair, reload);
+}
+
+std::shared_ptr<DNSCryptCertificatePair> DNSCryptContext::loadCertificatePair(const std::string& certFile, const std::string& keyFile)
+{
+ auto pair = std::make_shared<DNSCryptCertificatePair>();
+ loadCertFromFile(certFile, pair->cert);
+ pair->privateKey.loadFromFile(keyFile);
+ pair->active = true;
+ computePublicKeyFromPrivate(pair->privateKey, pair->publicKey);
+ return pair;
+}
+
+void DNSCryptContext::loadNewCertificate(const std::string& certFile, const std::string& keyFile, bool active, bool reload)
+{
+ auto newPair = DNSCryptContext::loadCertificatePair(certFile, keyFile);
+ newPair->active = active;
+ addNewCertificate(newPair, reload);
+ d_certKeyPaths.write_lock()->push_back({certFile, keyFile});
+}
+
+void DNSCryptContext::reloadCertificates()
+{
+ std::vector<std::shared_ptr<DNSCryptCertificatePair>> newCerts;
+ {
+ auto paths = d_certKeyPaths.read_lock();
+ newCerts.reserve(paths->size());
+ for (const auto& pair : *paths) {
+ newCerts.push_back(DNSCryptContext::loadCertificatePair(pair.cert, pair.key));
+ }
+ }
+
+ {
+ *(d_certs.write_lock()) = std::move(newCerts);
+ }
+}
+
+std::vector<std::shared_ptr<DNSCryptCertificatePair>> DNSCryptContext::getCertificates() {
+ std::vector<std::shared_ptr<DNSCryptCertificatePair>> ret = *(d_certs.read_lock());
+ return ret;
+};
+
+void DNSCryptContext::markActive(uint32_t serial)
+{
+ for (auto pair : *d_certs.write_lock()) {
+ if (pair->active == false && pair->cert.getSerial() == serial) {
+ pair->active = true;
+ return;
+ }
+ }
+ throw std::runtime_error("No inactive certificate found with this serial");
+}
+
+void DNSCryptContext::markInactive(uint32_t serial)
+{
+ for (auto pair : *d_certs.write_lock()) {
+ if (pair->active == true && pair->cert.getSerial() == serial) {
+ pair->active = false;
+ return;
+ }
+ }
+ throw std::runtime_error("No active certificate found with this serial");
+}
+
+void DNSCryptContext::removeInactiveCertificate(uint32_t serial)
+{
+ auto certs = d_certs.write_lock();
+
+ for (auto it = certs->begin(); it != certs->end(); ) {
+ if ((*it)->active == false && (*it)->cert.getSerial() == serial) {
+ it = certs->erase(it);
+ return;
+ } else {
+ it++;
+ }
+ }
+ throw std::runtime_error("No inactive certificate found with this serial");
+}
+
+bool DNSCryptQuery::parsePlaintextQuery(const PacketBuffer& packet)
+{
+ assert(d_ctx != nullptr);
+
+ if (packet.size() < sizeof(dnsheader)) {
+ return false;
+ }
+
+ const struct dnsheader * dh = reinterpret_cast<const struct dnsheader *>(packet.data());
+ if (dh->qr || ntohs(dh->qdcount) != 1 || dh->ancount != 0 || dh->nscount != 0 || dh->opcode != Opcode::Query)
+ return false;
+
+ unsigned int qnameWireLength;
+ uint16_t qtype, qclass;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, &qclass, &qnameWireLength);
+ if ((packet.size() - sizeof(dnsheader)) < (qnameWireLength + sizeof(qtype) + sizeof(qclass))) {
+ return false;
+ }
+
+ if (qtype != QType::TXT || qclass != QClass::IN) {
+ return false;
+ }
+
+ if (qname != d_ctx->getProviderName()) {
+ return false;
+ }
+
+ d_qname = qname;
+ d_id = dh->id;
+ d_valid = true;
+
+ return true;
+}
+
+void DNSCryptContext::getCertificateResponse(time_t now, const DNSName& qname, uint16_t qid, PacketBuffer& response)
+{
+ GenericDNSPacketWriter<PacketBuffer> pw(response, qname, QType::TXT, QClass::IN, Opcode::Query);
+ struct dnsheader * dh = pw.getHeader();
+ dh->id = qid;
+ dh->qr = true;
+ dh->rcode = RCode::NoError;
+
+ auto certs = d_certs.read_lock();
+ for (const auto& pair : *certs) {
+ if (!pair->active || !pair->cert.isValid(now)) {
+ continue;
+ }
+
+ pw.startRecord(qname, QType::TXT, (DNSCRYPT_CERTIFICATE_RESPONSE_TTL), QClass::IN, DNSResourceRecord::ANSWER, true);
+ std::string scert;
+ uint8_t certSize = sizeof(pair->cert);
+ scert.assign((const char*) &certSize, sizeof(certSize));
+ scert.append((const char*) &pair->cert, certSize);
+
+ pw.xfrBlob(scert);
+ pw.commit();
+ }
+}
+
+bool DNSCryptContext::magicMatchesAPublicKey(DNSCryptQuery& query, time_t now)
+{
+ const unsigned char* magic = query.getClientMagic();
+
+ auto certs = d_certs.read_lock();
+ for (const auto& pair : *certs) {
+ if (pair->cert.isValid(now) && memcmp(magic, pair->cert.signedData.clientMagic, DNSCRYPT_CLIENT_MAGIC_SIZE) == 0) {
+ query.setCertificatePair(pair);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool DNSCryptQuery::isEncryptedQuery(const PacketBuffer& packet, bool tcp, time_t now)
+{
+ assert(d_ctx != nullptr);
+
+ d_encrypted = false;
+
+ if (packet.size() < sizeof(DNSCryptQueryHeader)) {
+ return false;
+ }
+
+ if (!tcp && packet.size() < DNSCryptQuery::s_minUDPLength) {
+ return false;
+ }
+
+ const struct DNSCryptQueryHeader* header = reinterpret_cast<const struct DNSCryptQueryHeader*>(packet.data());
+
+ d_header = *header;
+
+ if (!d_ctx->magicMatchesAPublicKey(*this, now)) {
+ return false;
+ }
+
+ d_encrypted = true;
+
+ return true;
+}
+
+void DNSCryptQuery::getDecrypted(bool tcp, PacketBuffer& packet)
+{
+ assert(d_encrypted);
+ assert(d_pair != nullptr);
+ assert(d_valid == false);
+
+#ifdef DNSCRYPT_STRICT_PADDING_LENGTH
+ if (tcp && ((packet.size() - sizeof(DNSCryptQueryHeader)) % DNSCRYPT_PADDED_BLOCK_SIZE) != 0) {
+ vinfolog("Dropping encrypted query with invalid size of %d (should be a multiple of %d)", (packet.size() - sizeof(DNSCryptQueryHeader)), DNSCRYPT_PADDED_BLOCK_SIZE);
+ return;
+ }
+#endif
+
+ unsigned char nonce[DNSCRYPT_NONCE_SIZE];
+ static_assert(sizeof(nonce) == (2* sizeof(d_header.clientNonce)), "Nonce should be larger than clientNonce (half)");
+ static_assert(sizeof(d_header.clientPK) == DNSCRYPT_PUBLIC_KEY_SIZE, "Client Public key size is not right");
+ static_assert(sizeof(d_pair->privateKey.key) == DNSCRYPT_PRIVATE_KEY_SIZE, "Private key size is not right");
+
+ memcpy(nonce, &d_header.clientNonce, sizeof(d_header.clientNonce));
+ memset(nonce + sizeof(d_header.clientNonce), 0, sizeof(nonce) - sizeof(d_header.clientNonce));
+
+#ifdef HAVE_CRYPTO_BOX_EASY_AFTERNM
+ int res = computeSharedKey();
+ if (res != 0) {
+ vinfolog("Dropping encrypted query we can't compute the shared key for");
+ return;
+ }
+
+ const DNSCryptExchangeVersion version = getVersion();
+
+ if (version == DNSCryptExchangeVersion::VERSION1) {
+ res = crypto_box_open_easy_afternm(reinterpret_cast<unsigned char*>(packet.data()),
+ reinterpret_cast<unsigned char*>(&packet.at(sizeof(DNSCryptQueryHeader))),
+ packet.size() - sizeof(DNSCryptQueryHeader),
+ nonce,
+ d_sharedKey);
+ }
+ else if (version == DNSCryptExchangeVersion::VERSION2) {
+#ifdef HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY
+ res = crypto_box_curve25519xchacha20poly1305_open_easy_afternm(reinterpret_cast<unsigned char*>(packet.data()),
+ reinterpret_cast<unsigned char*>(&packet.at(sizeof(DNSCryptQueryHeader))),
+ packet.size() - sizeof(DNSCryptQueryHeader),
+ nonce,
+ d_sharedKey);
+#else /* HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY */
+ res = -1;
+#endif /* HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY */
+ } else {
+ res = -1;
+ }
+
+#else /* HAVE_CRYPTO_BOX_EASY_AFTERNM */
+ int res = crypto_box_open_easy(reinterpret_cast<unsigned char*>(packet.data()),
+ reinterpret_cast<unsigned char*>(&packet.at(sizeof(DNSCryptQueryHeader))),
+ packet.size() - sizeof(DNSCryptQueryHeader),
+ nonce,
+ d_header.clientPK,
+ d_pair->privateKey.key);
+#endif /* HAVE_CRYPTO_BOX_EASY_AFTERNM */
+
+ if (res != 0) {
+ vinfolog("Dropping encrypted query we can't decrypt");
+ return;
+ }
+
+ uint16_t decryptedQueryLen = packet.size() - sizeof(DNSCryptQueryHeader) - DNSCRYPT_MAC_SIZE;
+ uint16_t pos = decryptedQueryLen;
+ assert(pos < packet.size());
+ d_paddedLen = decryptedQueryLen;
+
+ while (pos > 0 && packet.at(pos - 1) == 0) pos--;
+
+ if (pos == 0 || packet.at(pos - 1) != 0x80) {
+ vinfolog("Dropping encrypted query with invalid padding value");
+ return;
+ }
+
+ pos--;
+
+ size_t paddingLen = decryptedQueryLen - pos;
+ packet.resize(pos);
+
+ if (tcp && paddingLen > DNSCRYPT_MAX_TCP_PADDING_SIZE) {
+ vinfolog("Dropping encrypted query with too long padding size");
+ return;
+ }
+
+ d_len = pos;
+ d_valid = true;
+}
+
+void DNSCryptQuery::getCertificateResponse(time_t now, PacketBuffer& response) const
+{
+ assert(d_ctx != nullptr);
+ d_ctx->getCertificateResponse(now, d_qname, d_id, response);
+}
+
+void DNSCryptQuery::parsePacket(PacketBuffer& packet, bool tcp, time_t now)
+{
+ d_valid = false;
+
+ /* might be a plaintext certificate request or an authenticated request */
+ if (isEncryptedQuery(packet, tcp, now)) {
+ getDecrypted(tcp, packet);
+ }
+ else {
+ parsePlaintextQuery(packet);
+ }
+}
+
+void DNSCryptQuery::fillServerNonce(unsigned char* nonce) const
+{
+ uint32_t* dest = reinterpret_cast<uint32_t*>(nonce);
+ static const size_t nonceSize = DNSCRYPT_NONCE_SIZE / 2;
+
+ for (size_t pos = 0; pos < (nonceSize / sizeof(*dest)); pos++)
+ {
+ const uint32_t value = randombytes_random();
+ memcpy(dest + pos, &value, sizeof(value));
+ }
+}
+
+/*
+ "The length of <resolver-response-pad> must be between 0 and 256 bytes,
+ and must be constant for a given (<resolver-sk>, <client-nonce>) tuple."
+*/
+uint16_t DNSCryptQuery::computePaddingSize(uint16_t unpaddedLen, size_t maxLen) const
+{
+ size_t paddedSize = 0;
+ uint16_t result = 0;
+ uint32_t rnd = 0;
+ assert(d_header.clientNonce);
+ assert(d_pair != nullptr);
+
+ unsigned char nonce[DNSCRYPT_NONCE_SIZE];
+ memcpy(nonce, d_header.clientNonce, (DNSCRYPT_NONCE_SIZE / 2));
+ memcpy(&(nonce[DNSCRYPT_NONCE_SIZE / 2]), d_header.clientNonce, (DNSCRYPT_NONCE_SIZE / 2));
+ crypto_stream((unsigned char*) &rnd, sizeof(rnd), nonce, d_pair->privateKey.key);
+
+ paddedSize = unpaddedLen + rnd % (maxLen - unpaddedLen + 1);
+ paddedSize += DNSCRYPT_PADDED_BLOCK_SIZE - (paddedSize % DNSCRYPT_PADDED_BLOCK_SIZE);
+
+ if (paddedSize > maxLen)
+ paddedSize = maxLen;
+
+ result = paddedSize - unpaddedLen;
+
+ return result;
+}
+
+int DNSCryptQuery::encryptResponse(PacketBuffer& response, size_t maxResponseSize, bool tcp)
+{
+ struct DNSCryptResponseHeader responseHeader;
+ assert(response.size() > 0);
+ assert(maxResponseSize >= response.size());
+ assert(d_encrypted == true);
+ assert(d_pair != nullptr);
+
+ /* a DNSCrypt UDP response can't be larger than the (padded) DNSCrypt query */
+ if (!tcp && d_paddedLen < response.size()) {
+ /* so we need to truncate it */
+ size_t questionSize = 0;
+
+ if (response.size() > sizeof(dnsheader)) {
+ unsigned int qnameWireLength = 0;
+ DNSName tempQName(reinterpret_cast<const char*>(response.data()), response.size(), sizeof(dnsheader), false, 0, 0, &qnameWireLength);
+ if (qnameWireLength > 0) {
+ questionSize = qnameWireLength + DNS_TYPE_SIZE + DNS_CLASS_SIZE;
+ }
+ }
+
+ response.resize(sizeof(dnsheader) + questionSize);
+
+ if (response.size() > d_paddedLen) {
+ /* that does not seem right but let's truncate even more */
+ response.resize(d_paddedLen);
+ }
+ struct dnsheader* dh = reinterpret_cast<struct dnsheader*>(response.data());
+ dh->ancount = dh->arcount = dh->nscount = 0;
+ dh->tc = 1;
+ }
+
+ size_t requiredSize = sizeof(responseHeader) + DNSCRYPT_MAC_SIZE + response.size();
+ size_t maxSize = std::min(maxResponseSize, requiredSize + DNSCRYPT_MAX_RESPONSE_PADDING_SIZE);
+ uint16_t paddingSize = computePaddingSize(requiredSize, maxSize);
+ requiredSize += paddingSize;
+
+ if (requiredSize > maxResponseSize) {
+ return ENOBUFS;
+ }
+
+ memcpy(&responseHeader.nonce, &d_header.clientNonce, sizeof d_header.clientNonce);
+ fillServerNonce(&(responseHeader.nonce[sizeof(d_header.clientNonce)]));
+
+ size_t responseLen = response.size();
+ /* moving the existing response after the header + MAC */
+ response.resize(requiredSize);
+ std::copy_backward(response.begin(), response.begin() + responseLen, response.begin() + responseLen + sizeof(responseHeader) + DNSCRYPT_MAC_SIZE);
+
+ uint16_t pos = 0;
+ /* copying header */
+ memcpy(&response.at(pos), &responseHeader, sizeof(responseHeader));
+ pos += sizeof(responseHeader);
+ /* setting MAC bytes to 0 */
+ memset(&response.at(pos), 0, DNSCRYPT_MAC_SIZE);
+ pos += DNSCRYPT_MAC_SIZE;
+ uint16_t toEncryptPos = pos;
+ /* skipping response */
+ pos += responseLen;
+ /* padding */
+ response.at(pos) = static_cast<uint8_t>(0x80);
+ pos++;
+ memset(&response.at(pos), 0, paddingSize - 1);
+ pos += (paddingSize - 1);
+
+ /* encrypting */
+#ifdef HAVE_CRYPTO_BOX_EASY_AFTERNM
+ int res = computeSharedKey();
+ if (res != 0) {
+ return res;
+ }
+
+ const DNSCryptExchangeVersion version = getVersion();
+
+ if (version == DNSCryptExchangeVersion::VERSION1) {
+ res = crypto_box_easy_afternm(reinterpret_cast<unsigned char*>(&response.at(sizeof(responseHeader))),
+ reinterpret_cast<unsigned char*>(&response.at(toEncryptPos)),
+ responseLen + paddingSize,
+ responseHeader.nonce,
+ d_sharedKey);
+ }
+ else if (version == DNSCryptExchangeVersion::VERSION2) {
+#ifdef HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY
+ res = crypto_box_curve25519xchacha20poly1305_easy_afternm(reinterpret_cast<unsigned char*>(&response.at(sizeof(responseHeader))),
+ reinterpret_cast<unsigned char*>(&response.at(toEncryptPos)),
+ responseLen + paddingSize,
+ responseHeader.nonce,
+ d_sharedKey);
+#else /* HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY */
+ res = -1;
+#endif /* HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY */
+ }
+ else {
+ res = -1;
+ }
+#else
+ int res = crypto_box_easy(reinterpret_cast<unsigned char*>(&response.at(sizeof(responseHeader))),
+ reinterpret_cast<unsigned char*>(&response.at(toEncryptPos)),
+ responseLen + paddingSize,
+ responseHeader.nonce,
+ d_header.clientPK,
+ d_pair->privateKey.key);
+#endif /* HAVE_CRYPTO_BOX_EASY_AFTERNM */
+
+ if (res == 0) {
+ assert(pos == requiredSize);
+ }
+
+ return res;
+}
+
+int DNSCryptContext::encryptQuery(PacketBuffer& packet, size_t maximumSize, const unsigned char clientPublicKey[DNSCRYPT_PUBLIC_KEY_SIZE], const DNSCryptPrivateKey& clientPrivateKey, const unsigned char clientNonce[DNSCRYPT_NONCE_SIZE / 2], bool tcp, const std::shared_ptr<DNSCryptCert>& cert) const
+{
+ assert(packet.size() > 0);
+ assert(cert != nullptr);
+
+ size_t queryLen = packet.size();
+ unsigned char nonce[DNSCRYPT_NONCE_SIZE];
+ size_t requiredSize = sizeof(DNSCryptQueryHeader) + DNSCRYPT_MAC_SIZE + queryLen;
+ /* this is not optimal, we should compute a random padding size, multiple of DNSCRYPT_PADDED_BLOCK_SIZE,
+ DNSCRYPT_PADDED_BLOCK_SIZE <= padding size <= 4096? */
+ uint16_t paddingSize = DNSCRYPT_PADDED_BLOCK_SIZE - (queryLen % DNSCRYPT_PADDED_BLOCK_SIZE);
+ requiredSize += paddingSize;
+
+ if (!tcp && requiredSize < DNSCryptQuery::s_minUDPLength) {
+ paddingSize += (DNSCryptQuery::s_minUDPLength - requiredSize);
+ requiredSize = DNSCryptQuery::s_minUDPLength;
+ }
+
+ if (requiredSize > maximumSize) {
+ return ENOBUFS;
+ }
+
+ /* moving the existing query after the header + MAC */
+ packet.resize(requiredSize);
+ std::copy_backward(packet.begin(), packet.begin() + queryLen, packet.begin() + queryLen + sizeof(DNSCryptQueryHeader) + DNSCRYPT_MAC_SIZE);
+
+ size_t pos = 0;
+ /* client magic */
+ memcpy(&packet.at(pos), cert->signedData.clientMagic, sizeof(cert->signedData.clientMagic));
+ pos += sizeof(cert->signedData.clientMagic);
+
+ /* client PK */
+ memcpy(&packet.at(pos), clientPublicKey, DNSCRYPT_PUBLIC_KEY_SIZE);
+ pos += DNSCRYPT_PUBLIC_KEY_SIZE;
+
+ /* client nonce */
+ memcpy(&packet.at(pos), clientNonce, DNSCRYPT_NONCE_SIZE / 2);
+ pos += DNSCRYPT_NONCE_SIZE / 2;
+ size_t encryptedPos = pos;
+
+ /* clear the MAC bytes */
+ memset(&packet.at(pos), 0, DNSCRYPT_MAC_SIZE);
+ pos += DNSCRYPT_MAC_SIZE;
+
+ /* skipping data */
+ pos += queryLen;
+
+ /* padding */
+ packet.at(pos) = static_cast<uint8_t>(0x80);
+ pos++;
+ memset(&packet.at(pos), 0, paddingSize - 1);
+ pos += paddingSize - 1;
+
+ memcpy(nonce, clientNonce, DNSCRYPT_NONCE_SIZE / 2);
+ memset(nonce + (DNSCRYPT_NONCE_SIZE / 2), 0, DNSCRYPT_NONCE_SIZE / 2);
+
+ const DNSCryptExchangeVersion version = getExchangeVersion(*cert);
+ int res = -1;
+
+ if (version == DNSCryptExchangeVersion::VERSION1) {
+ res = crypto_box_easy(reinterpret_cast<unsigned char*>(&packet.at(encryptedPos)),
+ reinterpret_cast<unsigned char*>(&packet.at(encryptedPos + DNSCRYPT_MAC_SIZE)),
+ queryLen + paddingSize,
+ nonce,
+ cert->signedData.resolverPK,
+ clientPrivateKey.key);
+ }
+ else if (version == DNSCryptExchangeVersion::VERSION2) {
+#ifdef HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY
+ res = crypto_box_curve25519xchacha20poly1305_easy(reinterpret_cast<unsigned char*>(&packet.at(encryptedPos)),
+ reinterpret_cast<unsigned char*>(&packet.at(encryptedPos + DNSCRYPT_MAC_SIZE)),
+ queryLen + paddingSize,
+ nonce,
+ cert->signedData.resolverPK,
+ clientPrivateKey.key);
+#endif /* HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY */
+ }
+ else {
+ throw std::runtime_error("Unknown DNSCrypt exchange version");
+ }
+
+ if (res == 0) {
+ assert(pos == requiredSize);
+ }
+
+ return res;
+}
+
+bool generateDNSCryptCertificate(const std::string& providerPrivateKeyFile, uint32_t serial, time_t begin, time_t end, DNSCryptExchangeVersion version, DNSCryptCert& certOut, DNSCryptPrivateKey& keyOut)
+{
+ bool success = false;
+ unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE];
+ sodium_mlock(providerPrivateKey, sizeof(providerPrivateKey));
+ sodium_memzero(providerPrivateKey, sizeof(providerPrivateKey));
+
+ try {
+ ifstream providerKStream(providerPrivateKeyFile);
+ providerKStream.read((char*) providerPrivateKey, sizeof(providerPrivateKey));
+ if (providerKStream.fail()) {
+ providerKStream.close();
+ throw std::runtime_error("Invalid DNSCrypt provider key file " + providerPrivateKeyFile);
+ }
+
+ DNSCryptContext::generateCertificate(serial, begin, end, version, providerPrivateKey, keyOut, certOut);
+ success = true;
+ }
+ catch(const std::exception& e) {
+ errlog(e.what());
+ }
+
+ sodium_memzero(providerPrivateKey, sizeof(providerPrivateKey));
+ sodium_munlock(providerPrivateKey, sizeof(providerPrivateKey));
+ return success;
+}
+
+#endif
diff --git a/dnscrypt.hh b/dnscrypt.hh
new file mode 100644
index 0000000..ff4d94c
--- /dev/null
+++ b/dnscrypt.hh
@@ -0,0 +1,302 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "config.h"
+
+#ifndef HAVE_DNSCRYPT
+
+/* let's just define a few types and values so that the rest of
+ the code can ignore whether DNSCrypt support is available */
+#define DNSCRYPT_MAX_RESPONSE_PADDING_AND_MAC_SIZE (0)
+
+class DNSCryptContext
+{
+};
+
+class DNSCryptQuery
+{
+ DNSCryptQuery(const std::shared_ptr<DNSCryptContext>& ctx): d_ctx(ctx)
+ {
+ }
+private:
+ std::shared_ptr<DNSCryptContext> d_ctx{nullptr};
+};
+
+#else /* HAVE_DNSCRYPT */
+
+#include <memory>
+#include <string>
+#include <vector>
+#include <arpa/inet.h>
+
+#include <sodium.h>
+
+#include "dnsname.hh"
+#include "lock.hh"
+#include "noinitvector.hh"
+
+#define DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE (crypto_sign_ed25519_PUBLICKEYBYTES)
+#define DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE (crypto_sign_ed25519_SECRETKEYBYTES)
+#define DNSCRYPT_SIGNATURE_SIZE (crypto_sign_ed25519_BYTES)
+
+#define DNSCRYPT_PUBLIC_KEY_SIZE (crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES)
+#define DNSCRYPT_PRIVATE_KEY_SIZE (crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES)
+#define DNSCRYPT_NONCE_SIZE (crypto_box_curve25519xsalsa20poly1305_NONCEBYTES)
+#define DNSCRYPT_BEFORENM_SIZE (crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES)
+#define DNSCRYPT_MAC_SIZE (crypto_box_curve25519xsalsa20poly1305_MACBYTES)
+
+#ifdef HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY
+static_assert(crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES == crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES, "DNSCrypt public key size should be the same for all exchange versions");
+static_assert(crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES == crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES, "DNSCrypt private key size should be the same for all exchange versions");
+static_assert(crypto_box_curve25519xchacha20poly1305_NONCEBYTES == crypto_box_curve25519xsalsa20poly1305_NONCEBYTES, "DNSCrypt nonce size should be the same for all exchange versions");
+static_assert(crypto_box_curve25519xsalsa20poly1305_MACBYTES == crypto_box_curve25519xchacha20poly1305_MACBYTES, "DNSCrypt MAC size should be the same for all exchange versions");
+static_assert(crypto_box_curve25519xchacha20poly1305_BEFORENMBYTES == crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES, "DNSCrypt BEFORENM size should be the same for all exchange versions");
+#endif /* HAVE_CRYPTO_BOX_CURVE25519XCHACHA20POLY1305_EASY */
+
+#define DNSCRYPT_CERT_MAGIC_SIZE (4)
+#define DNSCRYPT_CERT_MAGIC_VALUE { 0x44, 0x4e, 0x53, 0x43 }
+#define DNSCRYPT_CERT_PROTOCOL_MINOR_VERSION_VALUE { 0x00, 0x00 }
+#define DNSCRYPT_CLIENT_MAGIC_SIZE (8)
+#define DNSCRYPT_RESOLVER_MAGIC { 0x72, 0x36, 0x66, 0x6e, 0x76, 0x57, 0x6a, 0x38 }
+#define DNSCRYPT_RESOLVER_MAGIC_SIZE (8)
+#define DNSCRYPT_PADDED_BLOCK_SIZE (64)
+#define DNSCRYPT_MAX_TCP_PADDING_SIZE (256)
+#define DNSCRYPT_MAX_RESPONSE_PADDING_SIZE (256)
+#define DNSCRYPT_MAX_RESPONSE_PADDING_AND_MAC_SIZE (DNSCRYPT_MAX_RESPONSE_PADDING_SIZE + DNSCRYPT_MAC_SIZE)
+
+/* "The client must check for new certificates every hour", so let's use one hour TTL */
+#define DNSCRYPT_CERTIFICATE_RESPONSE_TTL (3600)
+
+static_assert(DNSCRYPT_CLIENT_MAGIC_SIZE <= DNSCRYPT_PUBLIC_KEY_SIZE, "DNSCrypt Client Nonce size should be smaller or equal to public key size.");
+
+#define DNSCRYPT_CERT_ES_VERSION1_VALUE { 0x00, 0x01 }
+#define DNSCRYPT_CERT_ES_VERSION2_VALUE { 0x00, 0x02 }
+
+class DNSCryptContext;
+
+struct DNSCryptCertSignedData
+{
+ unsigned char resolverPK[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+ unsigned char clientMagic[DNSCRYPT_CLIENT_MAGIC_SIZE];
+ uint32_t serial;
+ uint32_t tsStart;
+ uint32_t tsEnd;
+};
+
+class DNSCryptCert
+{
+public:
+ uint32_t getSerial() const
+ {
+ return ntohl(signedData.serial);
+ }
+ uint32_t getTSStart() const
+ {
+ return signedData.tsStart;
+ }
+ uint32_t getTSEnd() const
+ {
+ return signedData.tsEnd;
+ }
+ bool isValid(time_t now) const
+ {
+ return ntohl(getTSStart()) <= static_cast<uint32_t>(now) && static_cast<uint32_t>(now) <= ntohl(getTSEnd());
+ }
+ unsigned char magic[DNSCRYPT_CERT_MAGIC_SIZE];
+ unsigned char esVersion[2];
+ unsigned char protocolMinorVersion[2];
+ unsigned char signature[DNSCRYPT_SIGNATURE_SIZE];
+ struct DNSCryptCertSignedData signedData;
+};
+
+static_assert((sizeof(DNSCryptCertSignedData) + DNSCRYPT_SIGNATURE_SIZE) == 116, "Dnscrypt cert signed data size + signature size should be 116!");
+static_assert(sizeof(DNSCryptCert) == 124, "Dnscrypt cert size should be 124!");
+
+struct DNSCryptQueryHeader
+{
+ unsigned char clientMagic[DNSCRYPT_CLIENT_MAGIC_SIZE];
+ unsigned char clientPK[DNSCRYPT_PUBLIC_KEY_SIZE];
+ unsigned char clientNonce[DNSCRYPT_NONCE_SIZE / 2];
+};
+
+static_assert(sizeof(DNSCryptQueryHeader) == 52, "Dnscrypt query header size should be 52!");
+
+struct DNSCryptResponseHeader
+{
+ const unsigned char resolverMagic[DNSCRYPT_RESOLVER_MAGIC_SIZE] = DNSCRYPT_RESOLVER_MAGIC;
+ unsigned char nonce[DNSCRYPT_NONCE_SIZE];
+};
+
+typedef enum {
+ VERSION1,
+ VERSION2
+} DNSCryptExchangeVersion;
+
+class DNSCryptPrivateKey
+{
+public:
+ DNSCryptPrivateKey();
+ ~DNSCryptPrivateKey();
+ void loadFromFile(const std::string& keyFile);
+ void saveToFile(const std::string& keyFile) const;
+
+ unsigned char key[DNSCRYPT_PRIVATE_KEY_SIZE];
+};
+
+struct DNSCryptCertificatePair
+{
+ unsigned char publicKey[DNSCRYPT_PUBLIC_KEY_SIZE];
+ DNSCryptCert cert;
+ DNSCryptPrivateKey privateKey;
+ bool active;
+};
+
+class DNSCryptQuery
+{
+public:
+ DNSCryptQuery(const std::shared_ptr<DNSCryptContext>& ctx): d_ctx(ctx)
+ {
+ memset(&d_header, 0, sizeof(d_header));
+#ifdef HAVE_CRYPTO_BOX_EASY_AFTERNM
+ memset(&d_sharedKey, 0, sizeof(d_sharedKey));
+#endif /* HAVE_CRYPTO_BOX_EASY_AFTERNM */
+ }
+
+ ~DNSCryptQuery();
+
+ bool isValid() const
+ {
+ return d_valid;
+ }
+
+ const DNSName& getQName() const
+ {
+ return d_qname;
+ }
+
+ uint16_t getID() const
+ {
+ return d_id;
+ }
+
+ const unsigned char* getClientMagic() const
+ {
+ return d_header.clientMagic;
+ }
+
+ bool isEncrypted() const
+ {
+ return d_encrypted;
+ }
+
+ void setCertificatePair(const std::shared_ptr<DNSCryptCertificatePair>& pair)
+ {
+ d_pair = pair;
+ }
+
+ void parsePacket(PacketBuffer& packet, bool tcp, time_t now);
+ void getDecrypted(bool tcp, PacketBuffer& packet);
+ void getCertificateResponse(time_t now, PacketBuffer& response) const;
+ int encryptResponse(PacketBuffer& response, size_t maxResponseSize, bool tcp);
+
+ static const size_t s_minUDPLength = 256;
+
+private:
+ DNSCryptExchangeVersion getVersion() const;
+#ifdef HAVE_CRYPTO_BOX_EASY_AFTERNM
+ int computeSharedKey();
+#endif /* HAVE_CRYPTO_BOX_EASY_AFTERNM */
+ void fillServerNonce(unsigned char* dest) const;
+ uint16_t computePaddingSize(uint16_t unpaddedLen, size_t maxLen) const;
+ bool parsePlaintextQuery(const PacketBuffer& packet);
+ bool isEncryptedQuery(const PacketBuffer& packet, bool tcp, time_t now);
+
+ DNSCryptQueryHeader d_header;
+#ifdef HAVE_CRYPTO_BOX_EASY_AFTERNM
+ unsigned char d_sharedKey[crypto_box_BEFORENMBYTES];
+#endif /* HAVE_CRYPTO_BOX_EASY_AFTERNM */
+ DNSName d_qname;
+ std::shared_ptr<DNSCryptContext> d_ctx{nullptr};
+ std::shared_ptr<DNSCryptCertificatePair> d_pair{nullptr};
+ uint16_t d_id{0};
+ uint16_t d_len{0};
+ uint16_t d_paddedLen{0};
+ bool d_encrypted{false};
+ bool d_valid{false};
+
+#ifdef HAVE_CRYPTO_BOX_EASY_AFTERNM
+ bool d_sharedKeyComputed{false};
+#endif /* HAVE_CRYPTO_BOX_EASY_AFTERNM */
+};
+
+class DNSCryptContext
+{
+public:
+ static void generateProviderKeys(unsigned char publicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE], unsigned char privateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE]);
+ static std::string getProviderFingerprint(unsigned char publicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE]);
+ static void generateCertificate(uint32_t serial, time_t begin, time_t end, const DNSCryptExchangeVersion& version, const unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE], DNSCryptPrivateKey& privateKey, DNSCryptCert& cert);
+ static void saveCertFromFile(const DNSCryptCert& cert, const std::string&filename);
+ static std::string certificateDateToStr(uint32_t date);
+ static void generateResolverKeyPair(DNSCryptPrivateKey& privK, unsigned char pubK[DNSCRYPT_PUBLIC_KEY_SIZE]);
+ static void setExchangeVersion(const DNSCryptExchangeVersion& version, unsigned char esVersion[sizeof(DNSCryptCert::esVersion)]);
+ static DNSCryptExchangeVersion getExchangeVersion(const unsigned char esVersion[sizeof(DNSCryptCert::esVersion)]);
+ static DNSCryptExchangeVersion getExchangeVersion(const DNSCryptCert& cert);
+
+ struct CertKeyPaths
+ {
+ std::string cert;
+ std::string key;
+ };
+
+ DNSCryptContext(const std::string& pName, const std::vector<CertKeyPaths>& certKeys);
+ DNSCryptContext(const std::string& pName, const DNSCryptCert& certificate, const DNSCryptPrivateKey& pKey);
+ ~DNSCryptContext();
+
+ void reloadCertificates();
+ void loadNewCertificate(const std::string& certFile, const std::string& keyFile, bool active=true, bool reload=false);
+ void addNewCertificate(const DNSCryptCert& newCert, const DNSCryptPrivateKey& newKey, bool active=true, bool reload=false);
+
+ void markActive(uint32_t serial);
+ void markInactive(uint32_t serial);
+ void removeInactiveCertificate(uint32_t serial);
+ std::vector<std::shared_ptr<DNSCryptCertificatePair>> getCertificates();
+ const DNSName& getProviderName() const { return providerName; }
+
+ int encryptQuery(PacketBuffer& query, size_t maximumSize, const unsigned char clientPublicKey[DNSCRYPT_PUBLIC_KEY_SIZE], const DNSCryptPrivateKey& clientPrivateKey, const unsigned char clientNonce[DNSCRYPT_NONCE_SIZE / 2], bool tcp, const std::shared_ptr<DNSCryptCert>& cert) const;
+ bool magicMatchesAPublicKey(DNSCryptQuery& query, time_t now);
+ void getCertificateResponse(time_t now, const DNSName& qname, uint16_t qid, PacketBuffer& response);
+
+private:
+ static void computePublicKeyFromPrivate(const DNSCryptPrivateKey& privK, unsigned char pubK[DNSCRYPT_PUBLIC_KEY_SIZE]);
+ static void loadCertFromFile(const std::string&filename, DNSCryptCert& dest);
+ static std::shared_ptr<DNSCryptCertificatePair> loadCertificatePair(const std::string& certFile, const std::string& keyFile);
+
+ void addNewCertificate(std::shared_ptr<DNSCryptCertificatePair>& newCert, bool reload=false);
+
+ SharedLockGuarded<std::vector<std::shared_ptr<DNSCryptCertificatePair>>> d_certs;
+ SharedLockGuarded<std::vector<CertKeyPaths>> d_certKeyPaths;
+ DNSName providerName;
+};
+
+bool generateDNSCryptCertificate(const std::string& providerPrivateKeyFile, uint32_t serial, time_t begin, time_t end, DNSCryptExchangeVersion version, DNSCryptCert& certOut, DNSCryptPrivateKey& keyOut);
+
+#endif
diff --git a/dnsdist-backend.cc b/dnsdist-backend.cc
new file mode 100644
index 0000000..2af756f
--- /dev/null
+++ b/dnsdist-backend.cc
@@ -0,0 +1,291 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "dnsdist.hh"
+#include "dnsdist-nghttp2.hh"
+#include "dnsdist-tcp.hh"
+#include "dolog.hh"
+
+
+bool DownstreamState::passCrossProtocolQuery(std::unique_ptr<CrossProtocolQuery>&& cpq)
+{
+ if (d_dohPath.empty()) {
+ return g_tcpclientthreads && g_tcpclientthreads->passCrossProtocolQueryToThread(std::move(cpq));
+ }
+ else {
+ return g_dohClientThreads && g_dohClientThreads->passCrossProtocolQueryToThread(std::move(cpq));
+ }
+}
+
+bool DownstreamState::reconnect()
+{
+ std::unique_lock<std::mutex> tl(connectLock, std::try_to_lock);
+ if (!tl.owns_lock() || isStopped()) {
+ /* we are already reconnecting or stopped anyway */
+ return false;
+ }
+
+ connected = false;
+ for (auto& fd : sockets) {
+ if (fd != -1) {
+ if (sockets.size() > 1) {
+ (*mplexer.lock())->removeReadFD(fd);
+ }
+ /* shutdown() is needed to wake up recv() in the responderThread */
+ shutdown(fd, SHUT_RDWR);
+ close(fd);
+ fd = -1;
+ }
+ if (!IsAnyAddress(remote)) {
+ fd = SSocket(remote.sin4.sin_family, SOCK_DGRAM, 0);
+ if (!IsAnyAddress(sourceAddr)) {
+ SSetsockopt(fd, SOL_SOCKET, SO_REUSEADDR, 1);
+ if (!sourceItfName.empty()) {
+#ifdef SO_BINDTODEVICE
+ int res = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, sourceItfName.c_str(), sourceItfName.length());
+ if (res != 0) {
+ infolog("Error setting up the interface on backend socket '%s': %s", remote.toStringWithPort(), stringerror());
+ }
+#endif
+ }
+
+ SBind(fd, sourceAddr);
+ }
+ try {
+ SConnect(fd, remote);
+ if (sockets.size() > 1) {
+ (*mplexer.lock())->addReadFD(fd, [](int, boost::any) {});
+ }
+ connected = true;
+ }
+ catch(const std::runtime_error& error) {
+ infolog("Error connecting to new server with address %s: %s", remote.toStringWithPort(), error.what());
+ connected = false;
+ break;
+ }
+ }
+ }
+
+ /* if at least one (re-)connection failed, close all sockets */
+ if (!connected) {
+ for (auto& fd : sockets) {
+ if (fd != -1) {
+ if (sockets.size() > 1) {
+ try {
+ (*mplexer.lock())->removeReadFD(fd);
+ }
+ catch (const FDMultiplexerException& e) {
+ /* some sockets might not have been added to the multiplexer
+ yet, that's fine */
+ }
+ }
+ /* shutdown() is needed to wake up recv() in the responderThread */
+ shutdown(fd, SHUT_RDWR);
+ close(fd);
+ fd = -1;
+ }
+ }
+ }
+
+ return connected;
+}
+
+void DownstreamState::stop()
+{
+ d_stopped = true;
+
+ {
+ std::lock_guard<std::mutex> tl(connectLock);
+ auto slock = mplexer.lock();
+
+ for (auto& fd : sockets) {
+ if (fd != -1) {
+ /* shutdown() is needed to wake up recv() in the responderThread */
+ shutdown(fd, SHUT_RDWR);
+ }
+ }
+ }
+}
+
+void DownstreamState::hash()
+{
+ vinfolog("Computing hashes for id=%s and weight=%d", id, weight);
+ auto w = weight;
+ auto lockedHashes = hashes.write_lock();
+ lockedHashes->clear();
+ lockedHashes->reserve(w);
+ while (w > 0) {
+ std::string uuid = boost::str(boost::format("%s-%d") % id % w);
+ unsigned int wshash = burtleCI(reinterpret_cast<const unsigned char*>(uuid.c_str()), uuid.size(), g_hashperturb);
+ lockedHashes->push_back(wshash);
+ --w;
+ }
+ std::sort(lockedHashes->begin(), lockedHashes->end());
+ hashesComputed = true;
+}
+
+void DownstreamState::setId(const boost::uuids::uuid& newId)
+{
+ id = newId;
+ // compute hashes only if already done
+ if (hashesComputed) {
+ hash();
+ }
+}
+
+void DownstreamState::setWeight(int newWeight)
+{
+ if (newWeight < 1) {
+ errlog("Error setting server's weight: downstream weight value must be greater than 0.");
+ return ;
+ }
+ weight = newWeight;
+ if (hashesComputed) {
+ hash();
+ }
+}
+
+DownstreamState::DownstreamState(const ComboAddress& remote_, const ComboAddress& sourceAddr_, unsigned int sourceItf_, const std::string& sourceItfName_): remote(remote_), sourceAddr(sourceAddr_), sourceItfName(sourceItfName_), name(remote_.toStringWithPort()), nameWithAddr(remote_.toStringWithPort()), sourceItf(sourceItf_)
+{
+ id = getUniqueID();
+ threadStarted.clear();
+
+ sw.start();
+}
+
+void DownstreamState::connectUDPSockets(size_t numberOfSockets)
+{
+ idStates.resize(g_maxOutstanding);
+ sockets.resize(numberOfSockets);
+
+ if (sockets.size() > 1) {
+ *(mplexer.lock()) = std::unique_ptr<FDMultiplexer>(FDMultiplexer::getMultiplexerSilent());
+ }
+
+ for (auto& fd : sockets) {
+ fd = -1;
+ }
+
+ reconnect();
+}
+
+DownstreamState::~DownstreamState()
+{
+ for (auto& fd : sockets) {
+ if (fd >= 0) {
+ close(fd);
+ fd = -1;
+ }
+ }
+
+ // we need to either detach or join the thread before it
+ // is destroyed
+ if (threadStarted.test_and_set()) {
+ tid.detach();
+ }
+}
+
+void DownstreamState::incCurrentConnectionsCount()
+{
+ auto currentConnectionsCount = ++tcpCurrentConnections;
+ if (currentConnectionsCount > tcpMaxConcurrentConnections) {
+ tcpMaxConcurrentConnections.store(currentConnectionsCount);
+ }
+}
+
+size_t ServerPool::countServers(bool upOnly)
+{
+ size_t count = 0;
+ auto servers = d_servers.read_lock();
+ for (const auto& server : **servers) {
+ if (!upOnly || std::get<1>(server)->isUp() ) {
+ count++;
+ }
+ }
+ return count;
+}
+
+size_t ServerPool::poolLoad()
+{
+ size_t load = 0;
+ auto servers = d_servers.read_lock();
+ for (const auto& server : **servers) {
+ size_t serverOutstanding = std::get<1>(server)->outstanding.load();
+ load += serverOutstanding;
+ }
+ return load;
+}
+
+const std::shared_ptr<ServerPolicy::NumberedServerVector> ServerPool::getServers()
+{
+ std::shared_ptr<ServerPolicy::NumberedServerVector> result;
+ {
+ result = *(d_servers.read_lock());
+ }
+ return result;
+}
+
+void ServerPool::addServer(shared_ptr<DownstreamState>& server)
+{
+ auto servers = d_servers.write_lock();
+ /* we can't update the content of the shared pointer directly even when holding the lock,
+ as other threads might hold a copy. We can however update the pointer as long as we hold the lock. */
+ unsigned int count = static_cast<unsigned int>((*servers)->size());
+ auto newServers = std::make_shared<ServerPolicy::NumberedServerVector>(*(*servers));
+ newServers->emplace_back(++count, server);
+ /* we need to reorder based on the server 'order' */
+ std::stable_sort(newServers->begin(), newServers->end(), [](const std::pair<unsigned int,std::shared_ptr<DownstreamState> >& a, const std::pair<unsigned int,std::shared_ptr<DownstreamState> >& b) {
+ return a.second->order < b.second->order;
+ });
+ /* and now we need to renumber for Lua (custom policies) */
+ size_t idx = 1;
+ for (auto& serv : *newServers) {
+ serv.first = idx++;
+ }
+ *servers = std::move(newServers);
+}
+
+void ServerPool::removeServer(shared_ptr<DownstreamState>& server)
+{
+ auto servers = d_servers.write_lock();
+ /* we can't update the content of the shared pointer directly even when holding the lock,
+ as other threads might hold a copy. We can however update the pointer as long as we hold the lock. */
+ auto newServers = std::make_shared<ServerPolicy::NumberedServerVector>(*(*servers));
+ size_t idx = 1;
+ bool found = false;
+ for (auto it = newServers->begin(); it != newServers->end();) {
+ if (found) {
+ /* we need to renumber the servers placed
+ after the removed one, for Lua (custom policies) */
+ it->first = idx++;
+ it++;
+ }
+ else if (it->second == server) {
+ it = newServers->erase(it);
+ found = true;
+ } else {
+ idx++;
+ it++;
+ }
+ }
+ *servers = std::move(newServers);
+}
diff --git a/dnsdist-cache.cc b/dnsdist-cache.cc
new file mode 100644
index 0000000..3ccb3e1
--- /dev/null
+++ b/dnsdist-cache.cc
@@ -0,0 +1,490 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include <cinttypes>
+
+#include "dnsdist.hh"
+#include "dolog.hh"
+#include "dnsparser.hh"
+#include "dnsdist-cache.hh"
+#include "dnsdist-ecs.hh"
+#include "ednssubnet.hh"
+#include "packetcache.hh"
+
+DNSDistPacketCache::DNSDistPacketCache(size_t maxEntries, uint32_t maxTTL, uint32_t minTTL, uint32_t tempFailureTTL, uint32_t maxNegativeTTL, uint32_t staleTTL, bool dontAge, uint32_t shards, bool deferrableInsertLock, bool parseECS): d_maxEntries(maxEntries), d_shardCount(shards), d_maxTTL(maxTTL), d_tempFailureTTL(tempFailureTTL), d_maxNegativeTTL(maxNegativeTTL), d_minTTL(minTTL), d_staleTTL(staleTTL), d_dontAge(dontAge), d_deferrableInsertLock(deferrableInsertLock), d_parseECS(parseECS)
+{
+ if (d_maxEntries == 0) {
+ throw std::runtime_error("Trying to create a 0-sized packet-cache");
+ }
+
+ d_shards.resize(d_shardCount);
+
+ /* we reserve maxEntries + 1 to avoid rehashing from occurring
+ when we get to maxEntries, as it means a load factor of 1 */
+ for (auto& shard : d_shards) {
+ shard.setSize((maxEntries / d_shardCount) + 1);
+ }
+}
+
+bool DNSDistPacketCache::getClientSubnet(const PacketBuffer& packet, size_t qnameWireLength, boost::optional<Netmask>& subnet)
+{
+ uint16_t optRDPosition;
+ size_t remaining = 0;
+
+ int res = getEDNSOptionsStart(packet, qnameWireLength, &optRDPosition, &remaining);
+
+ if (res == 0) {
+ size_t ecsOptionStartPosition = 0;
+ size_t ecsOptionSize = 0;
+
+ res = getEDNSOption(reinterpret_cast<const char*>(&packet.at(optRDPosition)), remaining, EDNSOptionCode::ECS, &ecsOptionStartPosition, &ecsOptionSize);
+
+ if (res == 0 && ecsOptionSize > (EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE)) {
+
+ EDNSSubnetOpts eso;
+ if (getEDNSSubnetOptsFromString(reinterpret_cast<const char*>(&packet.at(optRDPosition + ecsOptionStartPosition + (EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE))), ecsOptionSize - (EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE), &eso) == true) {
+ subnet = eso.source;
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool DNSDistPacketCache::cachedValueMatches(const CacheValue& cachedValue, uint16_t queryFlags, const DNSName& qname, uint16_t qtype, uint16_t qclass, bool receivedOverUDP, bool dnssecOK, const boost::optional<Netmask>& subnet) const
+{
+ if (cachedValue.queryFlags != queryFlags || cachedValue.dnssecOK != dnssecOK || cachedValue.receivedOverUDP != receivedOverUDP || cachedValue.qtype != qtype || cachedValue.qclass != qclass || cachedValue.qname != qname) {
+ return false;
+ }
+
+ if (d_parseECS && cachedValue.subnet != subnet) {
+ return false;
+ }
+
+ return true;
+}
+
+void DNSDistPacketCache::insertLocked(CacheShard& shard, std::unordered_map<uint32_t,CacheValue>& map, uint32_t key, CacheValue& newValue)
+{
+ /* check again now that we hold the lock to prevent a race */
+ if (map.size() >= (d_maxEntries / d_shardCount)) {
+ return;
+ }
+
+ std::unordered_map<uint32_t,CacheValue>::iterator it;
+ bool result;
+ tie(it, result) = map.insert({key, newValue});
+
+ if (result) {
+ ++shard.d_entriesCount;
+ return;
+ }
+
+ /* in case of collision, don't override the existing entry
+ except if it has expired */
+ CacheValue& value = it->second;
+ bool wasExpired = value.validity <= newValue.added;
+
+ if (!wasExpired && !cachedValueMatches(value, newValue.queryFlags, newValue.qname, newValue.qtype, newValue.qclass, newValue.receivedOverUDP, newValue.dnssecOK, newValue.subnet)) {
+ d_insertCollisions++;
+ return;
+ }
+
+ /* if the existing entry had a longer TTD, keep it */
+ if (newValue.validity <= value.validity) {
+ return;
+ }
+
+ value = newValue;
+}
+
+void DNSDistPacketCache::insert(uint32_t key, const boost::optional<Netmask>& subnet, uint16_t queryFlags, bool dnssecOK, const DNSName& qname, uint16_t qtype, uint16_t qclass, const PacketBuffer& response, bool receivedOverUDP, uint8_t rcode, boost::optional<uint32_t> tempFailureTTL)
+{
+ if (response.size() < sizeof(dnsheader)) {
+ return;
+ }
+
+ uint32_t minTTL;
+
+ if (rcode == RCode::ServFail || rcode == RCode::Refused) {
+ minTTL = tempFailureTTL == boost::none ? d_tempFailureTTL : *tempFailureTTL;
+ if (minTTL == 0) {
+ return;
+ }
+ }
+ else {
+ bool seenAuthSOA = false;
+ minTTL = getMinTTL(reinterpret_cast<const char*>(response.data()), response.size(), &seenAuthSOA);
+
+ /* no TTL found, we don't want to cache this */
+ if (minTTL == std::numeric_limits<uint32_t>::max()) {
+ return;
+ }
+
+ if (rcode == RCode::NXDomain || (rcode == RCode::NoError && seenAuthSOA)) {
+ minTTL = std::min(minTTL, d_maxNegativeTTL);
+ }
+ else if (minTTL > d_maxTTL) {
+ minTTL = d_maxTTL;
+ }
+
+ if (minTTL < d_minTTL) {
+ d_ttlTooShorts++;
+ return;
+ }
+ }
+
+ uint32_t shardIndex = getShardIndex(key);
+
+ if (d_shards.at(shardIndex).d_entriesCount >= (d_maxEntries / d_shardCount)) {
+ return;
+ }
+
+ const time_t now = time(nullptr);
+ time_t newValidity = now + minTTL;
+ CacheValue newValue;
+ newValue.qname = qname;
+ newValue.qtype = qtype;
+ newValue.qclass = qclass;
+ newValue.queryFlags = queryFlags;
+ newValue.len = response.size();
+ newValue.validity = newValidity;
+ newValue.added = now;
+ newValue.receivedOverUDP = receivedOverUDP;
+ newValue.dnssecOK = dnssecOK;
+ newValue.value = std::string(response.begin(), response.end());
+ newValue.subnet = subnet;
+
+ auto& shard = d_shards.at(shardIndex);
+
+ if (d_deferrableInsertLock) {
+ auto w = shard.d_map.try_write_lock();
+
+ if (!w.owns_lock()) {
+ d_deferredInserts++;
+ return;
+ }
+ insertLocked(shard, *w, key, newValue);
+ }
+ else {
+ auto w = shard.d_map.write_lock();
+
+ insertLocked(shard, *w, key, newValue);
+ }
+}
+
+bool DNSDistPacketCache::get(DNSQuestion& dq, uint16_t queryId, uint32_t* keyOut, boost::optional<Netmask>& subnet, bool dnssecOK, bool receivedOverUDP, uint32_t allowExpired, bool skipAging)
+{
+ const auto& dnsQName = dq.qname->getStorage();
+ uint32_t key = getKey(dnsQName, dq.qname->wirelength(), dq.getData(), receivedOverUDP);
+
+ if (keyOut) {
+ *keyOut = key;
+ }
+
+ if (d_parseECS) {
+ getClientSubnet(dq.getData(), dq.qname->wirelength(), subnet);
+ }
+
+ uint32_t shardIndex = getShardIndex(key);
+ time_t now = time(nullptr);
+ time_t age;
+ bool stale = false;
+ auto& response = dq.getMutableData();
+ auto& shard = d_shards.at(shardIndex);
+ {
+ auto map = shard.d_map.try_read_lock();
+ if (!map.owns_lock()) {
+ d_deferredLookups++;
+ return false;
+ }
+
+ std::unordered_map<uint32_t,CacheValue>::const_iterator it = map->find(key);
+ if (it == map->end()) {
+ d_misses++;
+ return false;
+ }
+
+ const CacheValue& value = it->second;
+ if (value.validity <= now) {
+ if ((now - value.validity) >= static_cast<time_t>(allowExpired)) {
+ d_misses++;
+ return false;
+ }
+ else {
+ stale = true;
+ }
+ }
+
+ if (value.len < sizeof(dnsheader)) {
+ return false;
+ }
+
+ /* check for collision */
+ if (!cachedValueMatches(value, *(getFlagsFromDNSHeader(dq.getHeader())), *dq.qname, dq.qtype, dq.qclass, receivedOverUDP, dnssecOK, subnet)) {
+ d_lookupCollisions++;
+ return false;
+ }
+
+ response.resize(value.len);
+ memcpy(&response.at(0), &queryId, sizeof(queryId));
+ memcpy(&response.at(sizeof(queryId)), &value.value.at(sizeof(queryId)), sizeof(dnsheader) - sizeof(queryId));
+
+ if (value.len == sizeof(dnsheader)) {
+ /* DNS header only, our work here is done */
+ d_hits++;
+ return true;
+ }
+
+ const size_t dnsQNameLen = dnsQName.length();
+ if (value.len < (sizeof(dnsheader) + dnsQNameLen)) {
+ return false;
+ }
+
+ memcpy(&response.at(sizeof(dnsheader)), dnsQName.c_str(), dnsQNameLen);
+ if (value.len > (sizeof(dnsheader) + dnsQNameLen)) {
+ memcpy(&response.at(sizeof(dnsheader) + dnsQNameLen), &value.value.at(sizeof(dnsheader) + dnsQNameLen), value.len - (sizeof(dnsheader) + dnsQNameLen));
+ }
+
+ if (!stale) {
+ age = now - value.added;
+ }
+ else {
+ age = (value.validity - value.added) - d_staleTTL;
+ }
+ }
+
+ if (!d_dontAge && !skipAging) {
+ if (!stale) {
+ ageDNSPacket(reinterpret_cast<char *>(&response[0]), response.size(), age);
+ }
+ else {
+ editDNSPacketTTL(reinterpret_cast<char *>(&response[0]), response.size(),
+ [staleTTL = d_staleTTL](uint8_t section, uint16_t class_, uint16_t type, uint32_t ttl) { return staleTTL; });
+ }
+ }
+
+ d_hits++;
+ return true;
+}
+
+/* Remove expired entries, until the cache has at most
+ upTo entries in it.
+ If the cache has more than one shard, we will try hard
+ to make sure that every shard has free space remaining.
+*/
+size_t DNSDistPacketCache::purgeExpired(size_t upTo, const time_t now)
+{
+ const size_t maxPerShard = upTo / d_shardCount;
+
+ size_t removed = 0;
+
+ for (auto& shard : d_shards) {
+ auto map = shard.d_map.write_lock();
+ if (map->size() <= maxPerShard) {
+ continue;
+ }
+
+ size_t toRemove = map->size() - maxPerShard;
+
+ for (auto it = map->begin(); toRemove > 0 && it != map->end(); ) {
+ const CacheValue& value = it->second;
+
+ if (value.validity <= now) {
+ it = map->erase(it);
+ --toRemove;
+ --shard.d_entriesCount;
+ ++removed;
+ } else {
+ ++it;
+ }
+ }
+ }
+
+ return removed;
+}
+
+/* Remove all entries, keeping only upTo
+ entries in the cache.
+ If the cache has more than one shard, we will try hard
+ to make sure that every shard has free space remaining.
+*/
+size_t DNSDistPacketCache::expunge(size_t upTo)
+{
+ const size_t maxPerShard = upTo / d_shardCount;
+
+ size_t removed = 0;
+
+ for (auto& shard : d_shards) {
+ auto map = shard.d_map.write_lock();
+
+ if (map->size() <= maxPerShard) {
+ continue;
+ }
+
+ size_t toRemove = map->size() - maxPerShard;
+
+ auto beginIt = map->begin();
+ auto endIt = beginIt;
+
+ if (map->size() >= toRemove) {
+ std::advance(endIt, toRemove);
+ map->erase(beginIt, endIt);
+ shard.d_entriesCount -= toRemove;
+ removed += toRemove;
+ }
+ else {
+ removed += map->size();
+ map->clear();
+ shard.d_entriesCount = 0;
+ }
+ }
+
+ return removed;
+}
+
+size_t DNSDistPacketCache::expungeByName(const DNSName& name, uint16_t qtype, bool suffixMatch)
+{
+ size_t removed = 0;
+
+ for (auto& shard : d_shards) {
+ auto map = shard.d_map.write_lock();
+
+ for(auto it = map->begin(); it != map->end(); ) {
+ const CacheValue& value = it->second;
+
+ if ((value.qname == name || (suffixMatch && value.qname.isPartOf(name))) && (qtype == QType::ANY || qtype == value.qtype)) {
+ it = map->erase(it);
+ --shard.d_entriesCount;
+ ++removed;
+ } else {
+ ++it;
+ }
+ }
+ }
+
+ return removed;
+}
+
+bool DNSDistPacketCache::isFull()
+{
+ return (getSize() >= d_maxEntries);
+}
+
+uint64_t DNSDistPacketCache::getSize()
+{
+ uint64_t count = 0;
+
+ for (auto& shard : d_shards) {
+ count += shard.d_entriesCount;
+ }
+
+ return count;
+}
+
+uint32_t DNSDistPacketCache::getMinTTL(const char* packet, uint16_t length, bool* seenNoDataSOA)
+{
+ return getDNSPacketMinTTL(packet, length, seenNoDataSOA);
+}
+
+uint32_t DNSDistPacketCache::getKey(const DNSName::string_t& qname, size_t qnameWireLength, const PacketBuffer& packet, bool receivedOverUDP)
+{
+ uint32_t result = 0;
+ /* skip the query ID */
+ if (packet.size() < sizeof(dnsheader)) {
+ throw std::range_error("Computing packet cache key for an invalid packet size (" + std::to_string(packet.size()) +")");
+ }
+
+ result = burtle(&packet.at(2), sizeof(dnsheader) - 2, result);
+ result = burtleCI((const unsigned char*) qname.c_str(), qname.length(), result);
+ if (packet.size() < sizeof(dnsheader) + qnameWireLength) {
+ throw std::range_error("Computing packet cache key for an invalid packet (" + std::to_string(packet.size()) + " < " + std::to_string(sizeof(dnsheader) + qnameWireLength) + ")");
+ }
+ if (packet.size() > ((sizeof(dnsheader) + qnameWireLength))) {
+ if (!d_optionsToSkip.empty()) {
+ /* skip EDNS options if any */
+ result = PacketCache::hashAfterQname(pdns_string_view(reinterpret_cast<const char*>(packet.data()), packet.size()), result, sizeof(dnsheader) + qnameWireLength, d_optionsToSkip);
+ }
+ else {
+ result = burtle(&packet.at(sizeof(dnsheader) + qnameWireLength), packet.size() - (sizeof(dnsheader) + qnameWireLength), result);
+ }
+ }
+ result = burtle((const unsigned char*) &receivedOverUDP, sizeof(receivedOverUDP), result);
+ return result;
+}
+
+uint32_t DNSDistPacketCache::getShardIndex(uint32_t key) const
+{
+ return key % d_shardCount;
+}
+
+string DNSDistPacketCache::toString()
+{
+ return std::to_string(getSize()) + "/" + std::to_string(d_maxEntries);
+}
+
+uint64_t DNSDistPacketCache::getEntriesCount()
+{
+ return getSize();
+}
+
+uint64_t DNSDistPacketCache::dump(int fd)
+{
+ auto fp = std::unique_ptr<FILE, int(*)(FILE*)>(fdopen(dup(fd), "w"), fclose);
+ if (fp == nullptr) {
+ return 0;
+ }
+
+ fprintf(fp.get(), "; dnsdist's packet cache dump follows\n;\n");
+
+ uint64_t count = 0;
+ time_t now = time(nullptr);
+ for (auto& shard : d_shards) {
+ auto map = shard.d_map.read_lock();
+
+ for (const auto& entry : *map) {
+ const CacheValue& value = entry.second;
+ count++;
+
+ try {
+ uint8_t rcode = 0;
+ if (value.len >= sizeof(dnsheader)) {
+ dnsheader dh;
+ memcpy(&dh, value.value.data(), sizeof(dnsheader));
+ rcode = dh.rcode;
+ }
+
+ fprintf(fp.get(), "%s %" PRId64 " %s ; rcode %" PRIu8 ", key %" PRIu32 ", length %" PRIu16 ", received over UDP %d, added %" PRId64 "\n", value.qname.toString().c_str(), static_cast<int64_t>(value.validity - now), QType(value.qtype).toString().c_str(), rcode, entry.first, value.len, value.receivedOverUDP, static_cast<int64_t>(value.added));
+ }
+ catch(...) {
+ fprintf(fp.get(), "; error printing '%s'\n", value.qname.empty() ? "EMPTY" : value.qname.toString().c_str());
+ }
+ }
+ }
+
+ return count;
+}
+
+void DNSDistPacketCache::setSkippedOptions(const std::unordered_set<uint16_t>& optionsToSkip)
+{
+ d_optionsToSkip = optionsToSkip;
+}
diff --git a/dnsdist-cache.hh b/dnsdist-cache.hh
new file mode 100644
index 0000000..3309459
--- /dev/null
+++ b/dnsdist-cache.hh
@@ -0,0 +1,145 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <atomic>
+#include <unordered_map>
+
+#include "iputils.hh"
+#include "lock.hh"
+#include "noinitvector.hh"
+#include "stat_t.hh"
+#include "ednsoptions.hh"
+
+struct DNSQuestion;
+
+class DNSDistPacketCache : boost::noncopyable
+{
+public:
+ DNSDistPacketCache(size_t maxEntries, uint32_t maxTTL=86400, uint32_t minTTL=0, uint32_t tempFailureTTL=60, uint32_t maxNegativeTTL=3600, uint32_t staleTTL=60, bool dontAge=false, uint32_t shards=1, bool deferrableInsertLock=true, bool parseECS=false);
+
+ void insert(uint32_t key, const boost::optional<Netmask>& subnet, uint16_t queryFlags, bool dnssecOK, const DNSName& qname, uint16_t qtype, uint16_t qclass, const PacketBuffer& response, bool receivedOverUDP, uint8_t rcode, boost::optional<uint32_t> tempFailureTTL);
+ bool get(DNSQuestion& dq, uint16_t queryId, uint32_t* keyOut, boost::optional<Netmask>& subnet, bool dnssecOK, bool receivedOverUDP, uint32_t allowExpired = 0, bool skipAging = false);
+ size_t purgeExpired(size_t upTo, const time_t now);
+ size_t expunge(size_t upTo=0);
+ size_t expungeByName(const DNSName& name, uint16_t qtype=QType::ANY, bool suffixMatch=false);
+ bool isFull();
+ string toString();
+ uint64_t getSize();
+ uint64_t getHits() const { return d_hits; }
+ uint64_t getMisses() const { return d_misses; }
+ uint64_t getDeferredLookups() const { return d_deferredLookups; }
+ uint64_t getDeferredInserts() const { return d_deferredInserts; }
+ uint64_t getLookupCollisions() const { return d_lookupCollisions; }
+ uint64_t getInsertCollisions() const { return d_insertCollisions; }
+ uint64_t getMaxEntries() const { return d_maxEntries; }
+ uint64_t getTTLTooShorts() const { return d_ttlTooShorts; }
+ uint64_t getEntriesCount();
+ uint64_t dump(int fd);
+ void setSkippedOptions(const std::unordered_set<uint16_t>& optionsToSkip);
+
+ bool isECSParsingEnabled() const { return d_parseECS; }
+
+ bool keepStaleData() const
+ {
+ return d_keepStaleData;
+ }
+ void setKeepStaleData(bool keep)
+ {
+ d_keepStaleData = keep;
+ }
+
+
+ void setECSParsingEnabled(bool enabled)
+ {
+ d_parseECS = enabled;
+ }
+
+ uint32_t getKey(const DNSName::string_t& qname, size_t qnameWireLength, const PacketBuffer& packet, bool receivedOverUDP);
+
+ static uint32_t getMinTTL(const char* packet, uint16_t length, bool* seenNoDataSOA);
+ static bool getClientSubnet(const PacketBuffer& packet, size_t qnameWireLength, boost::optional<Netmask>& subnet);
+
+private:
+
+ struct CacheValue
+ {
+ time_t getTTD() const { return validity; }
+ std::string value;
+ DNSName qname;
+ boost::optional<Netmask> subnet;
+ uint16_t qtype{0};
+ uint16_t qclass{0};
+ uint16_t queryFlags{0};
+ time_t added{0};
+ time_t validity{0};
+ uint16_t len{0};
+ bool receivedOverUDP{false};
+ bool dnssecOK{false};
+ };
+
+ class CacheShard
+ {
+ public:
+ CacheShard()
+ {
+ }
+ CacheShard(const CacheShard& old)
+ {
+ }
+
+ void setSize(size_t maxSize)
+ {
+ d_map.write_lock()->reserve(maxSize);
+ }
+
+ SharedLockGuarded<std::unordered_map<uint32_t,CacheValue>> d_map;
+ std::atomic<uint64_t> d_entriesCount{0};
+ };
+
+ bool cachedValueMatches(const CacheValue& cachedValue, uint16_t queryFlags, const DNSName& qname, uint16_t qtype, uint16_t qclass, bool receivedOverUDP, bool dnssecOK, const boost::optional<Netmask>& subnet) const;
+ uint32_t getShardIndex(uint32_t key) const;
+ void insertLocked(CacheShard& shard, std::unordered_map<uint32_t,CacheValue>& map, uint32_t key, CacheValue& newValue);
+
+ std::vector<CacheShard> d_shards;
+ std::unordered_set<uint16_t> d_optionsToSkip{EDNSOptionCode::COOKIE};
+
+ pdns::stat_t d_deferredLookups{0};
+ pdns::stat_t d_deferredInserts{0};
+ pdns::stat_t d_hits{0};
+ pdns::stat_t d_misses{0};
+ pdns::stat_t d_insertCollisions{0};
+ pdns::stat_t d_lookupCollisions{0};
+ pdns::stat_t d_ttlTooShorts{0};
+
+ size_t d_maxEntries;
+ uint32_t d_shardCount;
+ uint32_t d_maxTTL;
+ uint32_t d_tempFailureTTL;
+ uint32_t d_maxNegativeTTL;
+ uint32_t d_minTTL;
+ uint32_t d_staleTTL;
+ bool d_dontAge;
+ bool d_deferrableInsertLock;
+ bool d_parseECS;
+ bool d_keepStaleData{false};
+};
diff --git a/dnsdist-carbon.cc b/dnsdist-carbon.cc
new file mode 100644
index 0000000..4f3859a
--- /dev/null
+++ b/dnsdist-carbon.cc
@@ -0,0 +1,280 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "iputils.hh"
+#include "dolog.hh"
+#include "sstuff.hh"
+
+#include "namespaces.hh"
+#include "dnsdist.hh"
+#include "threadname.hh"
+
+GlobalStateHolder<vector<CarbonConfig> > g_carbon;
+static time_t s_start = time(nullptr);
+
+uint64_t uptimeOfProcess(const std::string& str)
+{
+ return time(nullptr) - s_start;
+}
+
+void carbonDumpThread()
+{
+ try
+ {
+ setThreadName("dnsdist/carbon");
+ auto localCarbon = g_carbon.getLocal();
+ for(int numloops=0;;++numloops) {
+ if(localCarbon->empty()) {
+ sleep(1);
+ continue;
+ }
+ /* this is wrong, we use the interval of the first server
+ for every single one of them */
+ if(numloops) {
+ const unsigned int interval = localCarbon->at(0).interval;
+ sleep(interval);
+ }
+
+ for (const auto& conf : *localCarbon) {
+ const auto& server = conf.server;
+ const std::string& namespace_name = conf.namespace_name;
+ std::string hostname = conf.ourname;
+ if (hostname.empty()) {
+ try {
+ hostname = getCarbonHostName();
+ }
+ catch(const std::exception& e) {
+ throw std::runtime_error(std::string("The 'ourname' setting in 'carbonServer()' has not been set and we are unable to determine the system's hostname: ") + e.what());
+ }
+ }
+ const std::string& instance_name = conf.instance_name;
+
+ try {
+ Socket s(server.sin4.sin_family, SOCK_STREAM);
+ s.setNonBlocking();
+ s.connect(server); // we do the connect so the attempt happens while we gather stats
+ ostringstream str;
+ time_t now=time(0);
+ for(const auto& e : g_stats.entries) {
+ str<<namespace_name<<"."<<hostname<<"."<<instance_name<<"."<<e.first<<' ';
+ if(const auto& val = boost::get<pdns::stat_t*>(&e.second))
+ str<<(*val)->load();
+ else if (const auto& dval = boost::get<double*>(&e.second))
+ str<<**dval;
+ else
+ str<<(*boost::get<DNSDistStats::statfunction_t>(&e.second))(e.first);
+ str<<' '<<now<<"\r\n";
+ }
+ auto states = g_dstates.getLocal();
+ for(const auto& state : *states) {
+ string serverName = state->getName().empty() ? state->remote.toStringWithPort() : state->getName();
+ boost::replace_all(serverName, ".", "_");
+ const string base = namespace_name + "." + hostname + "." + instance_name + ".servers." + serverName + ".";
+ str<<base<<"queries" << ' ' << state->queries.load() << " " << now << "\r\n";
+ str<<base<<"responses" << ' ' << state->responses.load() << " " << now << "\r\n";
+ str<<base<<"drops" << ' ' << state->reuseds.load() << " " << now << "\r\n";
+ str<<base<<"latency" << ' ' << (state->availability != DownstreamState::Availability::Down ? state->latencyUsec/1000.0 : 0) << " " << now << "\r\n";
+ str<<base<<"senderrors" << ' ' << state->sendErrors.load() << " " << now << "\r\n";
+ str<<base<<"outstanding" << ' ' << state->outstanding.load() << " " << now << "\r\n";
+ str<<base<<"tcpdiedsendingquery" << ' '<< state->tcpDiedSendingQuery.load() << " " << now << "\r\n";
+ str<<base<<"tcpdiedreaddingresponse" << ' '<< state->tcpDiedReadingResponse.load() << " " << now << "\r\n";
+ str<<base<<"tcpgaveup" << ' '<< state->tcpGaveUp.load() << " " << now << "\r\n";
+ str<<base<<"tcpreadimeouts" << ' '<< state->tcpReadTimeouts.load() << " " << now << "\r\n";
+ str<<base<<"tcpwritetimeouts" << ' '<< state->tcpWriteTimeouts.load() << " " << now << "\r\n";
+ str<<base<<"tcpconnecttimeouts" << ' '<< state->tcpConnectTimeouts.load() << " " << now << "\r\n";
+ str<<base<<"tcpcurrentconnections" << ' '<< state->tcpCurrentConnections.load() << " " << now << "\r\n";
+ str<<base<<"tcpmaxconcurrentconnections" << ' '<< state->tcpMaxConcurrentConnections.load() << " " << now << "\r\n";
+ str<<base<<"tcpnewconnections" << ' '<< state->tcpNewConnections.load() << " " << now << "\r\n";
+ str<<base<<"tcpreusedconnections" << ' '<< state->tcpReusedConnections.load() << " " << now << "\r\n";
+ str<<base<<"tlsresumptions" << ' '<< state->tlsResumptions.load() << " " << now << "\r\n";
+ str<<base<<"tcpavgqueriesperconnection" << ' '<< state->tcpAvgQueriesPerConnection.load() << " " << now << "\r\n";
+ str<<base<<"tcpavgconnectionduration" << ' '<< state->tcpAvgConnectionDuration.load() << " " << now << "\r\n";
+ }
+
+ std::map<std::string,uint64_t> frontendDuplicates;
+ for(const auto& front : g_frontends) {
+ if (front->udpFD == -1 && front->tcpFD == -1)
+ continue;
+
+ string frontName = front->local.toStringWithPort() + (front->udpFD >= 0 ? "_udp" : "_tcp");
+ boost::replace_all(frontName, ".", "_");
+ auto dupPair = frontendDuplicates.insert({frontName, 1});
+ if (!dupPair.second) {
+ frontName = frontName + "_" + std::to_string(dupPair.first->second);
+ ++(dupPair.first->second);
+ }
+
+ const string base = namespace_name + "." + hostname + "." + instance_name + ".frontends." + frontName + ".";
+ str<<base<<"queries" << ' ' << front->queries.load() << " " << now << "\r\n";
+ str<<base<<"responses" << ' ' << front->responses.load() << " " << now << "\r\n";
+ str<<base<<"tcpdiedreadingquery" << ' '<< front->tcpDiedReadingQuery.load() << " " << now << "\r\n";
+ str<<base<<"tcpdiedsendingresponse" << ' '<< front->tcpDiedSendingResponse.load() << " " << now << "\r\n";
+ str<<base<<"tcpgaveup" << ' '<< front->tcpGaveUp.load() << " " << now << "\r\n";
+ str<<base<<"tcpclientimeouts" << ' '<< front->tcpClientTimeouts.load() << " " << now << "\r\n";
+ str<<base<<"tcpdownstreamtimeouts" << ' '<< front->tcpDownstreamTimeouts.load() << " " << now << "\r\n";
+ str<<base<<"tcpcurrentconnections" << ' '<< front->tcpCurrentConnections.load() << " " << now << "\r\n";
+ str<<base<<"tcpmaxconcurrentconnections" << ' '<< front->tcpMaxConcurrentConnections.load() << " " << now << "\r\n";
+ str<<base<<"tcpavgqueriesperconnection" << ' '<< front->tcpAvgQueriesPerConnection.load() << " " << now << "\r\n";
+ str<<base<<"tcpavgconnectionduration" << ' '<< front->tcpAvgConnectionDuration.load() << " " << now << "\r\n";
+ str<<base<<"tls10-queries" << ' ' << front->tls10queries.load() << " " << now << "\r\n";
+ str<<base<<"tls11-queries" << ' ' << front->tls11queries.load() << " " << now << "\r\n";
+ str<<base<<"tls12-queries" << ' ' << front->tls12queries.load() << " " << now << "\r\n";
+ str<<base<<"tls13-queries" << ' ' << front->tls13queries.load() << " " << now << "\r\n";
+ str<<base<<"tls-unknown-queries" << ' ' << front->tlsUnknownqueries.load() << " " << now << "\r\n";
+ str<<base<<"tlsnewsessions" << ' ' << front->tlsNewSessions.load() << " " << now << "\r\n";
+ str<<base<<"tlsresumptions" << ' ' << front->tlsResumptions.load() << " " << now << "\r\n";
+ str<<base<<"tlsunknownticketkeys" << ' ' << front->tlsUnknownTicketKey.load() << " " << now << "\r\n";
+ str<<base<<"tlsinactiveticketkeys" << ' ' << front->tlsInactiveTicketKey.load() << " " << now << "\r\n";
+ const TLSErrorCounters* errorCounters = nullptr;
+ if (front->tlsFrontend != nullptr) {
+ errorCounters = &front->tlsFrontend->d_tlsCounters;
+ }
+ else if (front->dohFrontend != nullptr) {
+ errorCounters = &front->dohFrontend->d_tlsCounters;
+ }
+ if (errorCounters != nullptr) {
+ str<<base<<"tlsdhkeytoosmall" << ' ' << errorCounters->d_dhKeyTooSmall << " " << now << "\r\n";
+ str<<base<<"tlsinappropriatefallback" << ' ' << errorCounters->d_inappropriateFallBack << " " << now << "\r\n";
+ str<<base<<"tlsnosharedcipher" << ' ' << errorCounters->d_noSharedCipher << " " << now << "\r\n";
+ str<<base<<"tlsunknownciphertype" << ' ' << errorCounters->d_unknownCipherType << " " << now << "\r\n";
+ str<<base<<"tlsunknownkeyexchangetype" << ' ' << errorCounters->d_unknownKeyExchangeType << " " << now << "\r\n";
+ str<<base<<"tlsunknownprotocol" << ' ' << errorCounters->d_unknownProtocol << " " << now << "\r\n";
+ str<<base<<"tlsunsupportedec" << ' ' << errorCounters->d_unsupportedEC << " " << now << "\r\n";
+ str<<base<<"tlsunsupportedprotocol" << ' ' << errorCounters->d_unsupportedProtocol << " " << now << "\r\n";
+ }
+ }
+
+ auto localPools = g_pools.getLocal();
+ for (const auto& entry : *localPools) {
+ string poolName = entry.first;
+ boost::replace_all(poolName, ".", "_");
+ if (poolName.empty()) {
+ poolName = "_default_";
+ }
+ const string base = namespace_name + "." + hostname + "." + instance_name + ".pools." + poolName + ".";
+ const std::shared_ptr<ServerPool> pool = entry.second;
+ str<<base<<"servers" << " " << pool->countServers(false) << " " << now << "\r\n";
+ str<<base<<"servers-up" << " " << pool->countServers(true) << " " << now << "\r\n";
+ if (pool->packetCache != nullptr) {
+ const auto& cache = pool->packetCache;
+ str<<base<<"cache-size" << " " << cache->getMaxEntries() << " " << now << "\r\n";
+ str<<base<<"cache-entries" << " " << cache->getEntriesCount() << " " << now << "\r\n";
+ str<<base<<"cache-hits" << " " << cache->getHits() << " " << now << "\r\n";
+ str<<base<<"cache-misses" << " " << cache->getMisses() << " " << now << "\r\n";
+ str<<base<<"cache-deferred-inserts" << " " << cache->getDeferredInserts() << " " << now << "\r\n";
+ str<<base<<"cache-deferred-lookups" << " " << cache->getDeferredLookups() << " " << now << "\r\n";
+ str<<base<<"cache-lookup-collisions" << " " << cache->getLookupCollisions() << " " << now << "\r\n";
+ str<<base<<"cache-insert-collisions" << " " << cache->getInsertCollisions() << " " << now << "\r\n";
+ str<<base<<"cache-ttl-too-shorts" << " " << cache->getTTLTooShorts() << " " << now << "\r\n";
+ }
+ }
+
+#ifdef HAVE_DNS_OVER_HTTPS
+ {
+ std::map<std::string,uint64_t> dohFrontendDuplicates;
+ const string base = "dnsdist." + hostname + ".main.doh.";
+ for(const auto& doh : g_dohlocals) {
+ string name = doh->d_local.toStringWithPort();
+ boost::replace_all(name, ".", "_");
+ boost::replace_all(name, ":", "_");
+ boost::replace_all(name, "[", "_");
+ boost::replace_all(name, "]", "_");
+
+ auto dupPair = dohFrontendDuplicates.insert({name, 1});
+ if (!dupPair.second) {
+ name = name + "_" + std::to_string(dupPair.first->second);
+ ++(dupPair.first->second);
+ }
+
+ vector<pair<const char*, const pdns::stat_t&>> v{
+ {"http-connects", doh->d_httpconnects},
+ {"http1-queries", doh->d_http1Stats.d_nbQueries},
+ {"http2-queries", doh->d_http2Stats.d_nbQueries},
+ {"http1-200-responses", doh->d_http1Stats.d_nb200Responses},
+ {"http2-200-responses", doh->d_http2Stats.d_nb200Responses},
+ {"http1-400-responses", doh->d_http1Stats.d_nb400Responses},
+ {"http2-400-responses", doh->d_http2Stats.d_nb400Responses},
+ {"http1-403-responses", doh->d_http1Stats.d_nb403Responses},
+ {"http2-403-responses", doh->d_http2Stats.d_nb403Responses},
+ {"http1-500-responses", doh->d_http1Stats.d_nb500Responses},
+ {"http2-500-responses", doh->d_http2Stats.d_nb500Responses},
+ {"http1-502-responses", doh->d_http1Stats.d_nb502Responses},
+ {"http2-502-responses", doh->d_http2Stats.d_nb502Responses},
+ {"http1-other-responses", doh->d_http1Stats.d_nbOtherResponses},
+ {"http2-other-responses", doh->d_http2Stats.d_nbOtherResponses},
+ {"get-queries", doh->d_getqueries},
+ {"post-queries", doh->d_postqueries},
+ {"bad-requests", doh->d_badrequests},
+ {"error-responses", doh->d_errorresponses},
+ {"redirect-responses", doh->d_redirectresponses},
+ {"valid-responses", doh->d_validresponses}
+ };
+
+ for(const auto& item : v) {
+ str<<base<<name<<"."<<item.first << " " << item.second << " " << now <<"\r\n";
+ }
+ }
+ }
+#endif /* HAVE_DNS_OVER_HTTPS */
+
+ {
+ std::string qname;
+ auto records = g_qcount.records.write_lock();
+ for (const auto &record : *records) {
+ qname = record.first;
+ boost::replace_all(qname, ".", "_");
+ str<<"dnsdist.querycount." << qname << ".queries " << record.second << " " << now << "\r\n";
+ }
+ records->clear();
+ }
+
+ const string msg = str.str();
+
+ int ret = waitForRWData(s.getHandle(), false, 1 , 0);
+ if(ret <= 0 ) {
+ vinfolog("Unable to write data to carbon server on %s: %s", server.toStringWithPort(), (ret<0 ? stringerror() : "Timeout"));
+ continue;
+ }
+ s.setBlocking();
+ writen2(s.getHandle(), msg.c_str(), msg.size());
+ }
+ catch(const std::exception& e) {
+ warnlog("Problem sending carbon data: %s", e.what());
+ }
+ }
+ }
+ }
+ catch(const std::exception& e)
+ {
+ errlog("Carbon thread died: %s", e.what());
+ }
+ catch(const PDNSException& e)
+ {
+ errlog("Carbon thread died, PDNSException: %s", e.reason);
+ }
+ catch(...)
+ {
+ errlog("Carbon thread died");
+ }
+}
diff --git a/dnsdist-console.cc b/dnsdist-console.cc
new file mode 100644
index 0000000..a052779
--- /dev/null
+++ b/dnsdist-console.cc
@@ -0,0 +1,936 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <fstream>
+// we need this to get the home directory of the current user
+#include <pwd.h>
+#include <thread>
+
+#if defined (__OpenBSD__) || defined(__NetBSD__)
+// If this is not undeffed, __attribute__ wil be redefined by /usr/include/readline/rlstdc.h
+#undef __STRICT_ANSI__
+#include <readline/readline.h>
+#include <readline/history.h>
+#else
+#include <editline/readline.h>
+#endif
+
+#include "ext/json11/json11.hpp"
+
+#include "connection-management.hh"
+#include "dolog.hh"
+#include "dnsdist.hh"
+#include "dnsdist-console.hh"
+#include "sodcrypto.hh"
+#include "threadname.hh"
+
+GlobalStateHolder<NetmaskGroup> g_consoleACL;
+vector<pair<struct timeval, string> > g_confDelta;
+std::string g_consoleKey;
+bool g_logConsoleConnections{true};
+bool g_consoleEnabled{false};
+uint32_t g_consoleOutputMsgMaxSize{10000000};
+
+static ConcurrentConnectionManager s_connManager(100);
+
+class ConsoleConnection
+{
+public:
+ ConsoleConnection(const ComboAddress& client, int fd): d_client(client), d_fd(fd)
+ {
+ if (!s_connManager.registerConnection()) {
+ close(fd);
+ throw std::runtime_error("Too many concurrent console connections");
+ }
+ }
+ ConsoleConnection(ConsoleConnection&& rhs): d_client(rhs.d_client), d_fd(rhs.d_fd)
+ {
+ rhs.d_fd = -1;
+ }
+
+ ConsoleConnection(const ConsoleConnection&) = delete;
+ ConsoleConnection& operator=(const ConsoleConnection&) = delete;
+
+ ~ConsoleConnection()
+ {
+ if (d_fd != -1) {
+ close(d_fd);
+ s_connManager.releaseConnection();
+ }
+ }
+
+ int getFD() const
+ {
+ return d_fd;
+ }
+
+ const ComboAddress& getClient() const
+ {
+ return d_client;
+ }
+
+private:
+ ComboAddress d_client;
+ int d_fd{-1};
+};
+
+void setConsoleMaximumConcurrentConnections(size_t max)
+{
+ s_connManager.setMaxConcurrentConnections(max);
+}
+
+// MUST BE CALLED UNDER A LOCK - right now the LuaLock
+static void feedConfigDelta(const std::string& line)
+{
+ if(line.empty())
+ return;
+ struct timeval now;
+ gettimeofday(&now, 0);
+ g_confDelta.emplace_back(now, line);
+}
+
+static string historyFile(const bool &ignoreHOME = false)
+{
+ string ret;
+
+ struct passwd pwd;
+ struct passwd *result;
+ char buf[16384];
+ getpwuid_r(geteuid(), &pwd, buf, sizeof(buf), &result);
+
+ const char *homedir = getenv("HOME");
+ if (result)
+ ret = string(pwd.pw_dir);
+ if (homedir && !ignoreHOME) // $HOME overrides what the OS tells us
+ ret = string(homedir);
+ if (ret.empty())
+ ret = "."; // CWD if nothing works..
+ ret.append("/.dnsdist_history");
+ return ret;
+}
+
+static bool getMsgLen32(int fd, uint32_t* len)
+{
+ try
+ {
+ uint32_t raw;
+ size_t ret = readn2(fd, &raw, sizeof raw);
+
+ if (ret != sizeof raw) {
+ return false;
+ }
+
+ *len = ntohl(raw);
+ if (*len > g_consoleOutputMsgMaxSize) {
+ return false;
+ }
+
+ return true;
+ }
+ catch(...) {
+ return false;
+ }
+}
+
+static bool putMsgLen32(int fd, uint32_t len)
+{
+ try
+ {
+ uint32_t raw = htonl(len);
+ size_t ret = writen2(fd, &raw, sizeof raw);
+ return ret == sizeof raw;
+ }
+ catch(...) {
+ return false;
+ }
+}
+
+static bool sendMessageToServer(int fd, const std::string& line, SodiumNonce& readingNonce, SodiumNonce& writingNonce, const bool outputEmptyLine)
+{
+ string msg = sodEncryptSym(line, g_consoleKey, writingNonce);
+ const auto msgLen = msg.length();
+ if (msgLen > std::numeric_limits<uint32_t>::max()) {
+ cout << "Encrypted message is too long to be sent to the server, "<< std::to_string(msgLen) << " > " << std::numeric_limits<uint32_t>::max() << endl;
+ return true;
+ }
+
+ putMsgLen32(fd, static_cast<uint32_t>(msgLen));
+
+ if (!msg.empty()) {
+ writen2(fd, msg);
+ }
+
+ uint32_t len;
+ if(!getMsgLen32(fd, &len)) {
+ cout << "Connection closed by the server." << endl;
+ return false;
+ }
+
+ if (len == 0) {
+ if (outputEmptyLine) {
+ cout << endl;
+ }
+
+ return true;
+ }
+
+ msg.clear();
+ msg.resize(len);
+ readn2(fd, msg.data(), len);
+ msg = sodDecryptSym(msg, g_consoleKey, readingNonce);
+ cout << msg;
+ cout.flush();
+
+ return true;
+}
+
+void doClient(ComboAddress server, const std::string& command)
+{
+ if (!sodIsValidKey(g_consoleKey)) {
+ cerr << "The currently configured console key is not valid, please configure a valid key using the setKey() directive" << endl;
+ return;
+ }
+
+ if (g_verbose) {
+ cout<<"Connecting to "<<server.toStringWithPort()<<endl;
+ }
+
+ int fd=socket(server.sin4.sin_family, SOCK_STREAM, 0);
+ if (fd < 0) {
+ cerr<<"Unable to connect to "<<server.toStringWithPort()<<endl;
+ return;
+ }
+ SConnect(fd, server);
+ setTCPNoDelay(fd);
+ SodiumNonce theirs, ours, readingNonce, writingNonce;
+ ours.init();
+
+ writen2(fd, (const char*)ours.value, sizeof(ours.value));
+ readn2(fd, (char*)theirs.value, sizeof(theirs.value));
+ readingNonce.merge(ours, theirs);
+ writingNonce.merge(theirs, ours);
+
+ /* try sending an empty message, the server should send an empty
+ one back. If it closes the connection instead, we are probably
+ having a key mismatch issue. */
+ if (!sendMessageToServer(fd, "", readingNonce, writingNonce, false)) {
+ cerr<<"The server closed the connection right away, likely indicating a key mismatch. Please check your setKey() directive."<<endl;
+ close(fd);
+ return;
+ }
+
+ if (!command.empty()) {
+ sendMessageToServer(fd, command, readingNonce, writingNonce, false);
+
+ close(fd);
+ return;
+ }
+
+ string histfile = historyFile();
+ {
+ ifstream history(histfile);
+ string line;
+ while(getline(history, line))
+ add_history(line.c_str());
+ }
+ ofstream history(histfile, std::ios_base::app);
+ string lastline;
+ for(;;) {
+ char* sline = readline("> ");
+ rl_bind_key('\t',rl_complete);
+ if(!sline)
+ break;
+
+ string line(sline);
+ if(!line.empty() && line != lastline) {
+ add_history(sline);
+ history << sline <<endl;
+ history.flush();
+ }
+ lastline=line;
+ free(sline);
+
+ if(line=="quit")
+ break;
+ if(line=="help" || line=="?")
+ line="help()";
+
+ /* no need to send an empty line to the server */
+ if(line.empty())
+ continue;
+
+ if (!sendMessageToServer(fd, line, readingNonce, writingNonce, true)) {
+ break;
+ }
+ }
+ close(fd);
+}
+
+void doConsole()
+{
+ string histfile = historyFile(true);
+ {
+ ifstream history(histfile);
+ string line;
+ while(getline(history, line))
+ add_history(line.c_str());
+ }
+ ofstream history(histfile, std::ios_base::app);
+ string lastline;
+ for(;;) {
+ char* sline = readline("> ");
+ rl_bind_key('\t',rl_complete);
+ if(!sline)
+ break;
+
+ string line(sline);
+ if(!line.empty() && line != lastline) {
+ add_history(sline);
+ history << sline <<endl;
+ history.flush();
+ }
+ lastline=line;
+ free(sline);
+
+ if(line=="quit")
+ break;
+ if(line=="help" || line=="?")
+ line="help()";
+
+ string response;
+ try {
+ bool withReturn=true;
+ retry:;
+ try {
+ auto lua = g_lua.lock();
+ g_outputBuffer.clear();
+ resetLuaSideEffect();
+ auto ret = lua->executeCode<
+ boost::optional<
+ boost::variant<
+ string,
+ shared_ptr<DownstreamState>,
+ ClientState*,
+ std::unordered_map<string, double>
+ >
+ >
+ >(withReturn ? ("return "+line) : line);
+ if(ret) {
+ if (const auto dsValue = boost::get<shared_ptr<DownstreamState>>(&*ret)) {
+ if (*dsValue) {
+ cout<<(*dsValue)->getName()<<endl;
+ }
+ }
+ else if (const auto csValue = boost::get<ClientState*>(&*ret)) {
+ if (*csValue) {
+ cout<<(*csValue)->local.toStringWithPort()<<endl;
+ }
+ }
+ else if (const auto strValue = boost::get<string>(&*ret)) {
+ cout<<*strValue<<endl;
+ }
+ else if(const auto um = boost::get<std::unordered_map<string, double> >(&*ret)) {
+ using namespace json11;
+ Json::object o;
+ for(const auto& v : *um)
+ o[v.first]=v.second;
+ Json out = o;
+ cout<<out.dump()<<endl;
+ }
+ }
+ else
+ cout << g_outputBuffer << std::flush;
+ if(!getLuaNoSideEffect())
+ feedConfigDelta(line);
+ }
+ catch(const LuaContext::SyntaxErrorException&) {
+ if(withReturn) {
+ withReturn=false;
+ goto retry;
+ }
+ throw;
+ }
+ }
+ catch(const LuaContext::WrongTypeException& e) {
+ std::cerr<<"Command returned an object we can't print: "<<std::string(e.what())<<std::endl;
+ // tried to return something we don't understand
+ }
+ catch(const LuaContext::ExecutionErrorException& e) {
+ if(!strcmp(e.what(),"invalid key to 'next'"))
+ std::cerr<<"Error parsing parameters, did you forget parameter name?";
+ else
+ std::cerr << e.what();
+ try {
+ std::rethrow_if_nested(e);
+
+ std::cerr << std::endl;
+ } catch(const std::exception& ne) {
+ // ne is the exception that was thrown from inside the lambda
+ std::cerr << ": " << ne.what() << std::endl;
+ }
+ catch(const PDNSException& ne) {
+ // ne is the exception that was thrown from inside the lambda
+ std::cerr << ": " << ne.reason << std::endl;
+ }
+ }
+ catch(const std::exception& e) {
+ std::cerr << e.what() << std::endl;
+ }
+ }
+}
+/**** CARGO CULT CODE AHEAD ****/
+const std::vector<ConsoleKeyword> g_consoleKeywords{
+ /* keyword, function, parameters, description */
+ { "addACL", true, "netmask", "add to the ACL set who can use this server" },
+ { "addAction", true, "DNS rule, DNS action [, {uuid=\"UUID\", name=\"name\"}]", "add a rule" },
+ { "addBPFFilterDynBlocks", true, "addresses, dynbpf[[, seconds=10], msg]", "This is the eBPF equivalent of addDynBlocks(), blocking a set of addresses for (optionally) a number of seconds, using an eBPF dynamic filter" },
+ { "addCapabilitiesToRetain", true, "capability or list of capabilities", "Linux capabilities to retain after startup, like CAP_BPF" },
+ { "addConsoleACL", true, "netmask", "add a netmask to the console ACL" },
+ { "addDNSCryptBind", true, "\"127.0.0.1:8443\", \"provider name\", \"/path/to/resolver.cert\", \"/path/to/resolver.key\", {reusePort=false, tcpFastOpenQueueSize=0, interface=\"\", cpus={}}", "listen to incoming DNSCrypt queries on 127.0.0.1 port 8443, with a provider name of `provider name`, using a resolver certificate and associated key stored respectively in the `resolver.cert` and `resolver.key` files. The fifth optional parameter is a table of parameters" },
+ { "addDOHLocal", true, "addr, certFile, keyFile [, urls [, vars]]", "listen to incoming DNS over HTTPS queries on the specified address using the specified certificate and key. The last two parameters are tables" },
+ { "addDynBlocks", true, "addresses, message[, seconds[, action]]", "block the set of addresses with message `msg`, for `seconds` seconds (10 by default), applying `action` (default to the one set with `setDynBlocksAction()`)" },
+ { "addDynBlockSMT", true, "names, message[, seconds [, action]]", "block the set of names with message `msg`, for `seconds` seconds (10 by default), applying `action` (default to the one set with `setDynBlocksAction()`)" },
+ { "addLocal", true, "addr [, {doTCP=true, reusePort=false, tcpFastOpenQueueSize=0, interface=\"\", cpus={}}]", "add `addr` to the list of addresses we listen on" },
+ { "addCacheHitResponseAction", true, "DNS rule, DNS response action [, {uuid=\"UUID\", name=\"name\"}}]", "add a cache hit response rule" },
+ { "addResponseAction", true, "DNS rule, DNS response action [, {uuid=\"UUID\", name=\"name\"}}]", "add a response rule" },
+ { "addSelfAnsweredResponseAction", true, "DNS rule, DNS response action [, {uuid=\"UUID\", name=\"name\"}}]", "add a self-answered response rule" },
+ { "addTLSLocal", true, "addr, certFile(s), keyFile(s) [,params]", "listen to incoming DNS over TLS queries on the specified address using the specified certificate (or list of) and key (or list of). The last parameter is a table" },
+ { "AllowAction", true, "", "let these packets go through" },
+ { "AllowResponseAction", true, "", "let these packets go through" },
+ { "AllRule", true, "", "matches all traffic" },
+ { "AndRule", true, "list of DNS rules", "matches if all sub-rules matches" },
+ { "benchRule", true, "DNS Rule [, iterations [, suffix]]", "bench the specified DNS rule" },
+ { "carbonServer", true, "serverIP, [ourname], [interval]", "report statistics to serverIP using our hostname, or 'ourname' if provided, every 'interval' seconds" },
+ { "clearConsoleHistory", true, "", "clear the internal (in-memory) history of console commands" },
+ { "clearDynBlocks", true, "", "clear all dynamic blocks" },
+ { "clearQueryCounters", true, "", "clears the query counter buffer" },
+ { "clearRules", true, "", "remove all current rules" },
+ { "controlSocket", true, "addr", "open a control socket on this address / connect to this address in client mode" },
+ { "ContinueAction", true, "action", "execute the specified action and continue the processing of the remaining rules, regardless of the return of the action" },
+ { "DelayAction", true, "milliseconds", "delay the response by the specified amount of milliseconds (UDP-only)" },
+ { "DelayResponseAction", true, "milliseconds", "delay the response by the specified amount of milliseconds (UDP-only)" },
+ { "delta", true, "", "shows all commands entered that changed the configuration" },
+ { "DNSSECRule", true, "", "matches queries with the DO bit set" },
+ { "DnstapLogAction", true, "identity, FrameStreamLogger [, alterFunction]", "send the contents of this query to a FrameStreamLogger or RemoteLogger as dnstap. `alterFunction` is a callback, receiving a DNSQuestion and a DnstapMessage, that can be used to modify the dnstap message" },
+ { "DnstapLogResponseAction", true, "identity, FrameStreamLogger [, alterFunction]", "send the contents of this response to a remote or FrameStreamLogger or RemoteLogger as dnstap. `alterFunction` is a callback, receiving a DNSResponse and a DnstapMessage, that can be used to modify the dnstap message" },
+ { "DropAction", true, "", "drop these packets" },
+ { "DropResponseAction", true, "", "drop these packets" },
+ { "DSTPortRule", true, "port", "matches questions received to the destination port specified" },
+ { "dumpStats", true, "", "print all statistics we gather" },
+ { "dynBlockRulesGroup", true, "", "return a new DynBlockRulesGroup object" },
+ { "EDNSVersionRule", true, "version", "matches queries with the specified EDNS version" },
+ { "EDNSOptionRule", true, "optcode", "matches queries with the specified EDNS0 option present" },
+ { "ERCodeAction", true, "ercode", "Reply immediately by turning the query into a response with the specified EDNS extended rcode" },
+ { "ERCodeRule", true, "rcode", "matches responses with the specified extended rcode (EDNS0)" },
+ { "exceedNXDOMAINs", true, "rate, seconds", "get set of addresses that exceed `rate` NXDOMAIN/s over `seconds` seconds" },
+ { "exceedQRate", true, "rate, seconds", "get set of address that exceed `rate` queries/s over `seconds` seconds" },
+ { "exceedQTypeRate", true, "type, rate, seconds", "get set of address that exceed `rate` queries/s for queries of type `type` over `seconds` seconds" },
+ { "exceedRespByterate", true, "rate, seconds", "get set of addresses that exceeded `rate` bytes/s answers over `seconds` seconds" },
+ { "exceedServFails", true, "rate, seconds", "get set of addresses that exceed `rate` servfails/s over `seconds` seconds" },
+ { "firstAvailable", false, "", "picks the server with the lowest `order` that has not exceeded its QPS limit" },
+ { "fixupCase", true, "bool", "if set (default to no), rewrite the first qname of the question part of the answer to match the one from the query. It is only useful when you have a downstream server that messes up the case of the question qname in the answer" },
+ { "generateDNSCryptCertificate", true, "\"/path/to/providerPrivate.key\", \"/path/to/resolver.cert\", \"/path/to/resolver.key\", serial, validFrom, validUntil", "generate a new resolver private key and related certificate, valid from the `validFrom` timestamp until the `validUntil` one, signed with the provider private key" },
+ { "generateDNSCryptProviderKeys", true, "\"/path/to/providerPublic.key\", \"/path/to/providerPrivate.key\"", "generate a new provider keypair" },
+ { "getAction", true, "n", "Returns the Action associated with rule n" },
+ { "getBind", true, "n", "returns the listener at index n" },
+ { "getBindCount", true, "", "returns the number of listeners all kinds" },
+ { "getDNSCryptBind", true, "n", "return the `DNSCryptContext` object corresponding to the bind `n`" },
+ { "getDNSCryptBindCount", true, "", "returns the number of DNSCrypt listeners" },
+ { "getDOHFrontend", true, "n", "returns the DOH frontend with index n" },
+ { "getDOHFrontendCount", true, "", "returns the number of DoH listeners" },
+ { "getOutgoingTLSSessionCacheSize", true, "", "returns the number of TLS sessions (for outgoing connections) currently cached" },
+ { "getPool", true, "name", "return the pool named `name`, or \"\" for the default pool" },
+ { "getPoolServers", true, "pool", "return servers part of this pool" },
+ { "getQueryCounters", true, "[max=10]", "show current buffer of query counters, limited by 'max' if provided" },
+ { "getResponseRing", true, "", "return the current content of the response ring" },
+ { "getRespRing", true, "", "return the qname/rcode content of the response ring" },
+ { "getServer", true, "id", "returns server with index 'n' or whose uuid matches if 'id' is an UUID string" },
+ { "getServers", true, "", "returns a table with all defined servers" },
+ { "getStatisticsCounters", true, "", "returns a map of statistic counters" },
+ { "getTopCacheHitResponseRules", true, "[top]", "return the `top` cache-hit response rules" },
+ { "getTopResponseRules", true, "[top]", "return the `top` response rules" },
+ { "getTopRules", true, "[top]", "return the `top` rules" },
+ { "getTopSelfAnsweredResponseRules", true, "[top]", "return the `top` self-answered response rules" },
+ { "getTLSContext", true, "n", "returns the TLS context with index n" },
+ { "getTLSFrontend", true, "n", "returns the TLS frontend with index n" },
+ { "getTLSFrontendCount", true, "", "returns the number of DoT listeners" },
+ { "grepq", true, "Netmask|DNS Name|100ms|{\"::1\", \"powerdns.com\", \"100ms\"} [, n]", "shows the last n queries and responses matching the specified client address or range (Netmask), or the specified DNS Name, or slower than 100ms" },
+ { "hashPassword", true, "password [, workFactor]", "Returns a hashed and salted version of the supplied password, usable with 'setWebserverConfig()'"},
+ { "HTTPHeaderRule", true, "name, regex", "matches DoH queries with a HTTP header 'name' whose content matches the regular expression 'regex'"},
+ { "HTTPPathRegexRule", true, "regex", "matches DoH queries whose HTTP path matches 'regex'"},
+ { "HTTPPathRule", true, "path", "matches DoH queries whose HTTP path is an exact match to 'path'"},
+ { "HTTPStatusAction", true, "status, reason, body", "return an HTTP response"},
+ { "inClientStartup", true, "", "returns true during console client parsing of configuration" },
+ { "includeDirectory", true, "path", "include configuration files from `path`" },
+ { "KeyValueLookupKeyQName", true, "[wireFormat]", "Return a new KeyValueLookupKey object that, when passed to KeyValueStoreLookupAction or KeyValueStoreLookupRule, will return the qname of the query, either in wire format (default) or in plain text if 'wireFormat' is false" },
+ { "KeyValueLookupKeySourceIP", true, "[v4Mask [, v6Mask [, includePort]]]", "Return a new KeyValueLookupKey object that, when passed to KeyValueStoreLookupAction or KeyValueStoreLookupRule, will return the (possibly bitmasked) source IP of the client in network byte-order." },
+ { "KeyValueLookupKeySuffix", true, "[minLabels [,wireFormat]]", "Return a new KeyValueLookupKey object that, when passed to KeyValueStoreLookupAction or KeyValueStoreLookupRule, will return a vector of keys based on the labels of the qname in DNS wire format or plain text" },
+ { "KeyValueLookupKeyTag", true, "tag", "Return a new KeyValueLookupKey object that, when passed to KeyValueStoreLookupAction or KeyValueStoreLookupRule, will return the value of the corresponding tag for this query, if it exists" },
+ { "KeyValueStoreLookupAction", true, "kvs, lookupKey, destinationTag", "does a lookup into the key value store referenced by 'kvs' using the key returned by 'lookupKey', and storing the result if any into the tag named 'destinationTag'" },
+ { "KeyValueStoreRangeLookupAction", true, "kvs, lookupKey, destinationTag", "does a range-based lookup into the key value store referenced by 'kvs' using the key returned by 'lookupKey', and storing the result if any into the tag named 'destinationTag'" },
+ { "KeyValueStoreLookupRule", true, "kvs, lookupKey", "matches queries if the key is found in the specified Key Value store" },
+ { "KeyValueStoreRangeLookupRule", true, "kvs, lookupKey", "matches queries if the key is found in the specified Key Value store" },
+ { "leastOutstanding", false, "", "Send traffic to downstream server with least outstanding queries, with the lowest 'order', and within that the lowest recent latency"},
+ { "LogAction", true, "[filename], [binary], [append], [buffered]", "Log a line for each query, to the specified file if any, to the console (require verbose) otherwise. When logging to a file, the `binary` optional parameter specifies whether we log in binary form (default) or in textual form, the `append` optional parameter specifies whether we open the file for appending or truncate each time (default), and the `buffered` optional parameter specifies whether writes to the file are buffered (default) or not." },
+ { "LogResponseAction", true, "[filename], [append], [buffered]", "Log a line for each response, to the specified file if any, to the console (require verbose) otherwise. The `append` optional parameter specifies whether we open the file for appending or truncate each time (default), and the `buffered` optional parameter specifies whether writes to the file are buffered (default) or not." },
+ { "LuaAction", true, "function", "Invoke a Lua function that accepts a DNSQuestion" },
+ { "LuaFFIAction", true, "function", "Invoke a Lua FFI function that accepts a DNSQuestion" },
+ { "LuaFFIPerThreadAction", true, "function", "Invoke a Lua FFI function that accepts a DNSQuestion, with a per-thread Lua context" },
+ { "LuaFFIPerThreadResponseAction", true, "function", "Invoke a Lua FFI function that accepts a DNSResponse, with a per-thread Lua context" },
+ { "LuaFFIResponseAction", true, "function", "Invoke a Lua FFI function that accepts a DNSResponse" },
+ { "LuaFFIRule", true, "function", "Invoke a Lua FFI function that filters DNS questions" },
+ { "LuaResponseAction", true, "function", "Invoke a Lua function that accepts a DNSResponse" },
+ { "LuaRule", true, "function", "Invoke a Lua function that filters DNS questions" },
+ { "makeIPCipherKey", true, "password", "generates a 16-byte key that can be used to pseudonymize IP addresses with IP cipher" },
+ { "makeKey", true, "", "generate a new server access key, emit configuration line ready for pasting" },
+ { "makeRule", true, "rule", "Make a NetmaskGroupRule() or a SuffixMatchNodeRule(), depending on how it is called" } ,
+ { "MaxQPSIPRule", true, "qps, [v4Mask=32 [, v6Mask=64 [, burst=qps [, expiration=300 [, cleanupDelay=60]]]]]", "matches traffic exceeding the qps limit per subnet" },
+ { "MaxQPSRule", true, "qps", "matches traffic **not** exceeding this qps limit" },
+ { "mvCacheHitResponseRule", true, "from, to", "move cache hit response rule 'from' to a position where it is in front of 'to'. 'to' can be one larger than the largest rule" },
+ { "mvCacheHitResponseRuleToTop", true, "", "move the last cache hit response rule to the first position" },
+ { "mvResponseRule", true, "from, to", "move response rule 'from' to a position where it is in front of 'to'. 'to' can be one larger than the largest rule" },
+ { "mvResponseRuleToTop", true, "", "move the last response rule to the first position" },
+ { "mvRule", true, "from, to", "move rule 'from' to a position where it is in front of 'to'. 'to' can be one larger than the largest rule, in which case the rule will be moved to the last position" },
+ { "mvRuleToTop", true, "", "move the last rule to the first position" },
+ { "mvSelfAnsweredResponseRule", true, "from, to", "move self-answered response rule 'from' to a position where it is in front of 'to'. 'to' can be one larger than the largest rule" },
+ { "mvSelfAnsweredResponseRuleToTop", true, "", "move the last self-answered response rule to the first position" },
+ { "NetmaskGroupRule", true, "nmg[, src]", "Matches traffic from/to the network range specified in nmg. Set the src parameter to false to match nmg against destination address instead of source address. This can be used to differentiate between clients" },
+ { "newBPFFilter", true, "maxV4, maxV6, maxQNames", "Return a new eBPF socket filter with a maximum of maxV4 IPv4, maxV6 IPv6 and maxQNames qname entries in the block table" },
+ { "newCA", true, "address", "Returns a ComboAddress based on `address`" },
+#ifdef HAVE_CDB
+ { "newCDBKVStore", true, "fname, refreshDelay", "Return a new KeyValueStore object associated to the corresponding CDB database" },
+#endif
+ { "newDNSName", true, "name", "make a DNSName based on this .-terminated name" },
+ { "newDNSNameSet", true, "", "returns a new DNSNameSet" },
+ { "newDynBPFFilter", true, "bpf", "Return a new dynamic eBPF filter associated to a given BPF Filter" },
+ { "newFrameStreamTcpLogger", true, "addr [, options]", "create a FrameStream logger object writing to a TCP address (addr should be ip:port), to use with `DnstapLogAction()` and `DnstapLogResponseAction()`" },
+ { "newFrameStreamUnixLogger", true, "socket [, options]", "create a FrameStream logger object writing to a local unix socket, to use with `DnstapLogAction()` and `DnstapLogResponseAction()`" },
+#ifdef HAVE_LMDB
+ { "newLMDBKVStore", true, "fname, dbName [, noLock]", "Return a new KeyValueStore object associated to the corresponding LMDB database" },
+#endif
+ { "newNMG", true, "", "Returns a NetmaskGroup" },
+ { "newPacketCache", true, "maxEntries[, maxTTL=86400, minTTL=0, temporaryFailureTTL=60, staleTTL=60, dontAge=false, numberOfShards=1, deferrableInsertLock=true, options={}]", "return a new Packet Cache" },
+ { "newQPSLimiter", true, "rate, burst", "configure a QPS limiter with that rate and that burst capacity" },
+ { "newRemoteLogger", true, "address:port [, timeout=2, maxQueuedEntries=100, reconnectWaitTime=1]", "create a Remote Logger object, to use with `RemoteLogAction()` and `RemoteLogResponseAction()`" },
+ { "newRuleAction", true, "DNS rule, DNS action [, {uuid=\"UUID\", name=\"name\"}]", "return a pair of DNS Rule and DNS Action, to be used with `setRules()`" },
+ { "newServer", true, "{address=\"ip:port\", qps=1000, order=1, weight=10, pool=\"abuse\", retries=5, tcpConnectTimeout=5, tcpSendTimeout=30, tcpRecvTimeout=30, checkName=\"a.root-servers.net.\", checkType=\"A\", maxCheckFailures=1, mustResolve=false, useClientSubnet=true, source=\"address|interface name|address@interface\", sockets=1, reconnectOnUp=false}", "instantiate a server" },
+ { "newServerPolicy", true, "name, function", "create a policy object from a Lua function" },
+ { "newSuffixMatchNode", true, "", "returns a new SuffixMatchNode" },
+ { "newSVCRecordParameters", true, "priority, target, mandatoryParams, alpns, noDefaultAlpn [, port [, ech [, ipv4hints [, ipv6hints [, additionalParameters ]]]]]", "return a new SVCRecordParameters object, to use with SpoofSVCAction" },
+ { "NegativeAndSOAAction", true, "nxd, zone, ttl, mname, rname, serial, refresh, retry, expire, minimum [, options]", "Turn a query into a NXDomain or NoData answer and sets a SOA record in the additional section" },
+ { "NoneAction", true, "", "Does nothing. Subsequent rules are processed after this action" },
+ { "NotRule", true, "selector", "Matches the traffic if the selector rule does not match" },
+ { "OpcodeRule", true, "code", "Matches queries with opcode code. code can be directly specified as an integer, or one of the built-in DNSOpcodes" },
+ { "OrRule", true, "selectors", "Matches the traffic if one or more of the the selectors rules does match" },
+ { "PoolAction", true, "poolname", "set the packet into the specified pool" },
+ { "PoolAvailableRule", true, "poolname", "Check whether a pool has any servers available to handle queries" },
+ { "PoolOutstandingRule", true, "poolname, limit", "Check whether a pool has outstanding queries above limit" },
+ { "printDNSCryptProviderFingerprint", true, "\"/path/to/providerPublic.key\"", "display the fingerprint of the provided resolver public key" },
+ { "ProbaRule", true, "probability", "Matches queries with a given probability. 1.0 means always" },
+ { "ProxyProtocolValueRule", true, "type [, value]", "matches queries with a specified Proxy Protocol TLV value of that type, optionally matching the content of the option as well" },
+ { "QClassRule", true, "qclass", "Matches queries with the specified qclass. class can be specified as an integer or as one of the built-in DNSClass" },
+ { "QNameLabelsCountRule", true, "min, max", "matches if the qname has less than `min` or more than `max` labels" },
+ { "QNameRule", true, "qname", "matches queries with the specified qname" },
+ { "QNameSetRule", true, "set", "Matches if the set contains exact qname" },
+ { "QNameWireLengthRule", true, "min, max", "matches if the qname's length on the wire is less than `min` or more than `max` bytes" },
+ { "QPSAction", true, "maxqps", "Drop a packet if it does exceed the maxqps queries per second limits. Letting the subsequent rules apply otherwise" },
+ { "QPSPoolAction", true, "maxqps, poolname", "Send the packet into the specified pool only if it does not exceed the maxqps queries per second limits. Letting the subsequent rules apply otherwise" },
+ { "QTypeRule", true, "qtype", "matches queries with the specified qtype" },
+ { "RCodeAction", true, "rcode", "Reply immediately by turning the query into a response with the specified rcode" },
+ { "RCodeRule", true, "rcode", "matches responses with the specified rcode" },
+ { "RDRule", true, "", "Matches queries with the RD flag set" },
+ { "RecordsCountRule", true, "section, minCount, maxCount", "Matches if there is at least minCount and at most maxCount records in the section section. section can be specified as an integer or as a DNS Packet Sections" },
+ { "RecordsTypeCountRule", true, "section, qtype, minCount, maxCount", "Matches if there is at least minCount and at most maxCount records of type type in the section section" },
+ { "RegexRule", true, "regex", "matches the query name against the supplied regex" },
+ { "registerDynBPFFilter", true, "DynBPFFilter", "register this dynamic BPF filter into the web interface so that its counters are displayed" },
+ { "reloadAllCertificates", true, "", "reload all DNSCrypt and TLS certificates, along with their associated keys" },
+ { "RemoteLogAction", true, "RemoteLogger [, alterFunction [, serverID]]", "send the content of this query to a remote logger via Protocol Buffer. `alterFunction` is a callback, receiving a DNSQuestion and a DNSDistProtoBufMessage, that can be used to modify the Protocol Buffer content, for example for anonymization purposes. `serverID` is the server identifier." },
+ { "RemoteLogResponseAction", true, "RemoteLogger [,alterFunction [,includeCNAME [, serverID]]]", "send the content of this response to a remote logger via Protocol Buffer. `alterFunction` is the same callback than the one in `RemoteLogAction` and `includeCNAME` indicates whether CNAME records inside the response should be parsed and exported. The default is to only exports A and AAAA records. `serverID` is the server identifier." },
+ { "requestTCPStatesDump", true, "", "Request a dump of the TCP states (incoming connections, outgoing connections) during the next scan. Useful for debugging purposes only" },
+ { "rmACL", true, "netmask", "remove netmask from ACL" },
+ { "rmCacheHitResponseRule", true, "id", "remove cache hit response rule in position 'id', or whose uuid matches if 'id' is an UUID string, or finally whose name matches if 'id' is a string but not a valid UUID" },
+ { "rmResponseRule", true, "id", "remove response rule in position 'id', or whose uuid matches if 'id' is an UUID string, or finally whose name matches if 'id' is a string but not a valid UUID" },
+ { "rmRule", true, "id", "remove rule in position 'id', or whose uuid matches if 'id' is an UUID string, or finally whose name matches if 'id' is a string but not a valid UUID" },
+ { "rmSelfAnsweredResponseRule", true, "id", "remove self-answered response rule in position 'id', or whose uuid matches if 'id' is an UUID string, or finally whose name matches if 'id' is a string but not a valid UUID" },
+ { "rmServer", true, "id", "remove server with index 'id' or whose uuid matches if 'id' is an UUID string" },
+ { "roundrobin", false, "", "Simple round robin over available servers" },
+ { "sendCustomTrap", true, "str", "send a custom `SNMP` trap from Lua, containing the `str` string"},
+ { "setACL", true, "{netmask, netmask}", "replace the ACL set with these netmasks. Use `setACL({})` to reset the list, meaning no one can use us" },
+ { "setACLFromFile", true, "file", "replace the ACL set with netmasks in this file" },
+ { "setAddEDNSToSelfGeneratedResponses", true, "add", "set whether to add EDNS to self-generated responses, provided that the initial query had EDNS" },
+ { "setAllowEmptyResponse", true, "allow", "Set to true (defaults to false) to allow empty responses (qdcount=0) with a NoError or NXDomain rcode (default) from backends" },
+ { "setAPIWritable", true, "bool, dir", "allow modifications via the API. if `dir` is set, it must be a valid directory where the configuration files will be written by the API" },
+ { "setCacheCleaningDelay", true, "num", "Set the interval in seconds between two runs of the cache cleaning algorithm, removing expired entries" },
+ { "setCacheCleaningPercentage", true, "num", "Set the percentage of the cache that the cache cleaning algorithm will try to free by removing expired entries. By default (100), all expired entries are remove" },
+ { "setConsistentHashingBalancingFactor", true, "factor", "Set the balancing factor for bounded-load consistent hashing" },
+ { "setConsoleACL", true, "{netmask, netmask}", "replace the console ACL set with these netmasks" },
+ { "setConsoleConnectionsLogging", true, "enabled", "whether to log the opening and closing of console connections" },
+ { "setConsoleMaximumConcurrentConnections", true, "max", "Set the maximum number of concurrent console connections" },
+ { "setConsoleOutputMaxMsgSize", true, "messageSize", "set console message maximum size in bytes, default is 10 MB" },
+ { "setDefaultBPFFilter", true, "filter", "When used at configuration time, the corresponding BPFFilter will be attached to every bind" },
+ { "setDoHDownstreamCleanupInterval", true, "interval", "minimum interval in seconds between two cleanups of the idle DoH downstream connections" },
+ { "setDoHDownstreamMaxIdleTime", true, "time", "Maximum time in seconds that a downstream DoH connection to a backend might stay idle" },
+ { "setDynBlocksAction", true, "action", "set which action is performed when a query is blocked. Only DNSAction.Drop (the default) and DNSAction.Refused are supported" },
+ { "setDynBlocksPurgeInterval", true, "sec", "set how often the expired dynamic block entries should be removed" },
+ { "setDropEmptyQueries", true, "drop", "Whether to drop empty queries right away instead of sending a NOTIMP response" },
+ { "setECSOverride", true, "bool", "whether to override an existing EDNS Client Subnet value in the query" },
+ { "setECSSourcePrefixV4", true, "prefix-length", "the EDNS Client Subnet prefix-length used for IPv4 queries" },
+ { "setECSSourcePrefixV6", true, "prefix-length", "the EDNS Client Subnet prefix-length used for IPv6 queries" },
+ { "setKey", true, "key", "set access key to that key" },
+ { "setLocal", true, "addr [, {doTCP=true, reusePort=false, tcpFastOpenQueueSize=0, interface=\"\", cpus={}}]", "reset the list of addresses we listen on to this address" },
+ { "setMaxCachedDoHConnectionsPerDownstream", true, "max", "Set the maximum number of inactive DoH connections to a backend cached by each worker DoH thread" },
+ { "setMaxCachedTCPConnectionsPerDownstream", true, "max", "Set the maximum number of inactive TCP connections to a backend cached by each worker TCP thread" },
+ { "setMaxTCPClientThreads", true, "n", "set the maximum of TCP client threads, handling TCP connections" },
+ { "setMaxTCPConnectionDuration", true, "n", "set the maximum duration of an incoming TCP connection, in seconds. 0 means unlimited" },
+ { "setMaxTCPConnectionsPerClient", true, "n", "set the maximum number of TCP connections per client. 0 means unlimited" },
+ { "setMaxTCPQueriesPerConnection", true, "n", "set the maximum number of queries in an incoming TCP connection. 0 means unlimited" },
+ { "setMaxTCPQueuedConnections", true, "n", "set the maximum number of TCP connections queued (waiting to be picked up by a client thread)" },
+ { "setMaxUDPOutstanding", true, "n", "set the maximum number of outstanding UDP queries to a given backend server. This can only be set at configuration time and defaults to 65535" },
+ { "setPayloadSizeOnSelfGeneratedAnswers", true, "payloadSize", "set the UDP payload size advertised via EDNS on self-generated responses" },
+ { "setPoolServerPolicy", true, "policy, pool", "set the server selection policy for this pool to that policy" },
+ { "setPoolServerPolicyLua", true, "name, function, pool", "set the server selection policy for this pool to one named 'name' and provided by 'function'" },
+ { "setPoolServerPolicyLuaFFI", true, "name, function, pool", "set the server selection policy for this pool to one named 'name' and provided by 'function'" },
+ { "setPoolServerPolicyLuaFFIPerThread", true, "name, code", "set server selection policy for this pool to one named 'name' and returned by the Lua FFI code passed in 'code'" },
+ { "setProxyProtocolACL", true, "{netmask, netmask}", "Set the netmasks who are allowed to send Proxy Protocol headers in front of queries/connections" },
+ { "setProxyProtocolApplyACLToProxiedClients", true, "apply", "Whether the general ACL should be applied to the source IP address gathered from a Proxy Protocol header, in addition to being first applied to the source address seen by dnsdist" },
+ { "setProxyProtocolMaximumPayloadSize", true, "max", "Set the maximum size of a Proxy Protocol payload, in bytes" },
+ { "setQueryCount", true, "bool", "set whether queries should be counted" },
+ { "setQueryCountFilter", true, "func", "filter queries that would be counted, where `func` is a function with parameter `dq` which decides whether a query should and how it should be counted" },
+ { "setRingBuffersLockRetries", true, "n", "set the number of attempts to get a non-blocking lock to a ringbuffer shard before blocking" },
+ { "setRingBuffersSize", true, "n [, numberOfShards]", "set the capacity of the ringbuffers used for live traffic inspection to `n`, and optionally the number of shards to use to `numberOfShards`" },
+ { "setRoundRobinFailOnNoServer", true, "value", "By default the roundrobin load-balancing policy will still try to select a backend even if all backends are currently down. Setting this to true will make the policy fail and return that no server is available instead" },
+ { "setRules", true, "list of rules", "replace the current rules with the supplied list of pairs of DNS Rules and DNS Actions (see `newRuleAction()`)" },
+ { "setSecurityPollInterval", true, "n", "set the security polling interval to `n` seconds" },
+ { "setSecurityPollSuffix", true, "suffix", "set the security polling suffix to the specified value" },
+ { "setServerPolicy", true, "policy", "set server selection policy to that policy" },
+ { "setServerPolicyLua", true, "name, function", "set server selection policy to one named 'name' and provided by 'function'" },
+ { "setServerPolicyLuaFFI", true, "name, function", "set server selection policy to one named 'name' and provided by the Lua FFI 'function'" },
+ { "setServerPolicyLuaFFIPerThread", true, "name, code", "set server selection policy to one named 'name' and returned by the Lua FFI code passed in 'code'" },
+ { "setServFailWhenNoServer", true, "bool", "if set, return a ServFail when no servers are available, instead of the default behaviour of dropping the query" },
+ { "setStaleCacheEntriesTTL", true, "n", "allows using cache entries expired for at most n seconds when there is no backend available to answer for a query" },
+ { "setSyslogFacility", true, "facility", "set the syslog logging facility to 'facility'. Defaults to LOG_DAEMON" },
+ { "setTCPDownstreamCleanupInterval", true, "interval", "minimum interval in seconds between two cleanups of the idle TCP downstream connections" },
+ { "setTCPDownstreamMaxIdleTime", true, "time", "Maximum time in seconds that a downstream TCP connection to a backend might stay idle" },
+ { "setTCPInternalPipeBufferSize", true, "size", "Set the size in bytes of the internal buffer of the pipes used internally to distribute connections to TCP (and DoT) workers threads" },
+ { "setTCPRecvTimeout", true, "n", "set the read timeout on TCP connections from the client, in seconds" },
+ { "setTCPSendTimeout", true, "n", "set the write timeout on TCP connections from the client, in seconds" },
+ { "setUDPMultipleMessagesVectorSize", true, "n", "set the size of the vector passed to recvmmsg() to receive UDP messages. Default to 1 which means that the feature is disabled and recvmsg() is used instead" },
+ { "setUDPSocketBufferSizes", true, "recv, send", "Set the size of the receive (SO_RCVBUF) and send (SO_SNDBUF) buffers for incoming UDP sockets" },
+ { "setUDPTimeout", true, "n", "set the maximum time dnsdist will wait for a response from a backend over UDP, in seconds" },
+ { "setVerboseHealthChecks", true, "bool", "set whether health check errors will be logged" },
+ { "setWebserverConfig", true, "[{password=string, apiKey=string, customHeaders, statsRequireAuthentication}]", "Updates webserver configuration" },
+ { "setWeightedBalancingFactor", true, "factor", "Set the balancing factor for bounded-load weighted policies (whashed, wrandom)" },
+ { "setWHashedPertubation", true, "value", "Set the hash perturbation value to be used in the whashed policy instead of a random one, allowing to have consistent whashed results on different instance" },
+ { "show", true, "string", "outputs `string`" },
+ { "showACL", true, "", "show our ACL set" },
+ { "showBinds", true, "", "show listening addresses (frontends)" },
+ { "showCacheHitResponseRules", true, "[{showUUIDs=false, truncateRuleWidth=-1}]", "show all defined cache hit response rules, optionally with their UUIDs and optionally truncated to a given width" },
+ { "showConsoleACL", true, "", "show our current console ACL set" },
+ { "showDNSCryptBinds", true, "", "display the currently configured DNSCrypt binds" },
+ { "showDOHFrontends", true, "", "list all the available DOH frontends" },
+ { "showDOHResponseCodes", true, "", "show the HTTP response code statistics for the DoH frontends"},
+ { "showDynBlocks", true, "", "show dynamic blocks in force" },
+ { "showPools", true, "", "show the available pools" },
+ { "showPoolServerPolicy", true, "pool", "show server selection policy for this pool" },
+ { "showResponseLatency", true, "", "show a plot of the response time latency distribution" },
+ { "showResponseRules", true, "[{showUUIDs=false, truncateRuleWidth=-1}]", "show all defined response rules, optionally with their UUIDs and optionally truncated to a given width" },
+ { "showRules", true, "[{showUUIDs=false, truncateRuleWidth=-1}]", "show all defined rules, optionally with their UUIDs and optionally truncated to a given width" },
+ { "showSecurityStatus", true, "", "Show the security status"},
+ { "showSelfAnsweredResponseRules", true, "[{showUUIDs=false, truncateRuleWidth=-1}]", "show all defined self-answered response rules, optionally with their UUIDs and optionally truncated to a given width" },
+ { "showServerPolicy", true, "", "show name of currently operational server selection policy" },
+ { "showServers", true, "[{showUUIDs=false}]", "output all servers, optionally with their UUIDs" },
+ { "showTCPStats", true, "", "show some statistics regarding TCP" },
+ { "showTLSContexts", true, "", "list all the available TLS contexts" },
+ { "showTLSErrorCounters", true, "", "show metrics about TLS handshake failures" },
+ { "showVersion", true, "", "show the current version" },
+ { "showWebserverConfig", true, "", "Show the current webserver configuration" },
+ { "shutdown", true, "", "shut down `dnsdist`" },
+ { "snmpAgent", true, "enableTraps [, daemonSocket]", "enable `SNMP` support. `enableTraps` is a boolean indicating whether traps should be sent and `daemonSocket` an optional string specifying how to connect to the daemon agent"},
+ { "SetAdditionalProxyProtocolValueAction", true, "type, value", "Add a Proxy Protocol TLV value of this type" },
+ { "SetDisableECSAction", true, "", "Disable the sending of ECS to the backend. Subsequent rules are processed after this action." },
+ { "SetDisableValidationAction", true, "", "set the CD bit in the question, let it go through" },
+ { "SetECSAction", true, "v4[, v6]", "Set the ECS prefix and prefix length sent to backends to an arbitrary value" },
+ { "SetECSOverrideAction", true, "override", "Whether an existing EDNS Client Subnet value should be overridden (true) or not (false). Subsequent rules are processed after this action" },
+ { "SetECSPrefixLengthAction", true, "v4, v6", "Set the ECS prefix length. Subsequent rules are processed after this action" },
+ { "SetMacAddrAction", true, "option", "Add the source MAC address to the query as EDNS0 option option. This action is currently only supported on Linux. Subsequent rules are processed after this action" },
+ { "SetEDNSOptionAction", true, "option, data", "Add arbitrary EDNS option and data to the query. Subsequent rules are processed after this action" },
+ { "SetNoRecurseAction", true, "", "strip RD bit from the question, let it go through" },
+ { "setOutgoingDoHWorkerThreads", true, "n", "Number of outgoing DoH worker threads" },
+ { "SetProxyProtocolValuesAction", true, "values", "Set the Proxy-Protocol values for this queries to 'values'" },
+ { "SetSkipCacheAction", true, "", "Don’t lookup the cache for this query, don’t store the answer" },
+ { "SetSkipCacheResponseAction", true, "", "Don’t store this response into the cache" },
+ { "SetTagAction", true, "name, value", "set the tag named 'name' to the given value" },
+ { "SetTagResponseAction", true, "name, value", "set the tag named 'name' to the given value" },
+ { "SetTempFailureCacheTTLAction", true, "ttl", "set packetcache TTL for temporary failure replies" },
+ { "SNIRule", true, "name", "Create a rule which matches on the incoming TLS SNI value, if any (DoT or DoH)" },
+ { "SNMPTrapAction", true, "[reason]", "send an SNMP trap, adding the optional `reason` string as the query description"},
+ { "SNMPTrapResponseAction", true, "[reason]", "send an SNMP trap, adding the optional `reason` string as the response description"},
+ { "SpoofAction", true, "ip|list of ips [, options]", "forge a response with the specified IPv4 (for an A query) or IPv6 (for an AAAA). If you specify multiple addresses, all that match the query type (A, AAAA or ANY) will get spoofed in" },
+ { "SpoofCNAMEAction", true, "cname [, options]", "Forge a response with the specified CNAME value" },
+ { "SpoofRawAction", true, "raw|list of raws [, options]", "Forge a response with the specified record data as raw bytes. If you specify multiple raws (it is assumed they match the query type), all will get spoofed in" },
+ { "SpoofSVCAction", true, "list of svcParams [, options]", "Forge a response with the specified SVC record data" } ,
+ { "SuffixMatchNodeRule", true, "smn[, quiet]", "Matches based on a group of domain suffixes for rapid testing of membership. Pass true as second parameter to prevent listing of all domains matched" },
+ { "TagRule", true, "name [, value]", "matches if the tag named 'name' is present, with the given 'value' matching if any" },
+ { "TCAction", true, "", "create answer to query with TC and RD bits set, to move to TCP" },
+ { "TCPRule", true, "[tcp]", "Matches question received over TCP if tcp is true, over UDP otherwise" },
+ { "TeeAction", true, "remote [, addECS]", "send copy of query to remote, optionally adding ECS info" },
+ { "testCrypto", true, "", "test of the crypto all works" },
+ { "TimedIPSetRule", true, "", "Create a rule which matches a set of IP addresses which expire"},
+ { "topBandwidth", true, "top", "show top-`top` clients that consume the most bandwidth over length of ringbuffer" },
+ { "topCacheHitResponseRules", true, "[top][, vars]", "show `top` cache-hit response rules" },
+ { "topClients", true, "n", "show top-`n` clients sending the most queries over length of ringbuffer" },
+ { "topQueries", true, "n[, labels]", "show top 'n' queries, as grouped when optionally cut down to 'labels' labels" },
+ { "topResponses", true, "n, kind[, labels]", "show top 'n' responses with RCODE=kind (0=NO Error, 2=ServFail, 3=NXDomain), as grouped when optionally cut down to 'labels' labels" },
+ { "topResponseRules", true, "[top][, vars]", "show `top` response rules" },
+ { "topRules", true, "[top][, vars]", "show `top` rules" },
+ { "topSelfAnsweredResponseRules", true, "[top][, vars]", "show `top` self-answered response rules" },
+ { "topSlow", true, "[top][, limit][, labels]", "show `top` queries slower than `limit` milliseconds, grouped by last `labels` labels" },
+ { "TrailingDataRule", true, "", "Matches if the query has trailing data" },
+ { "truncateTC", true, "bool", "if set (defaults to no starting with dnsdist 1.2.0) truncate TC=1 answers so they are actually empty. Fixes an issue for PowerDNS Authoritative Server 2.9.22. Note: turning this on breaks compatibility with RFC 6891." },
+ { "unregisterDynBPFFilter", true, "DynBPFFilter", "unregister this dynamic BPF filter" },
+ { "webserver", true, "address:port", "launch a webserver with stats on that address" },
+ { "whashed", false, "", "Weighted hashed ('sticky') distribution over available servers, based on the server 'weight' parameter" },
+ { "chashed", false, "", "Consistent hashed ('sticky') distribution over available servers, also based on the server 'weight' parameter" },
+ { "wrandom", false, "", "Weighted random over available servers, based on the server 'weight' parameter" },
+};
+
+extern "C" {
+static char* my_generator(const char* text, int state)
+{
+ string t(text);
+ /* to keep it readable, we try to keep only 4 keywords per line
+ and to start a new line when the first letter changes */
+ static int s_counter=0;
+ int counter=0;
+ if(!state)
+ s_counter=0;
+
+ for(const auto& keyword : g_consoleKeywords) {
+ if(boost::starts_with(keyword.name, t) && counter++ == s_counter) {
+ std::string value(keyword.name);
+ s_counter++;
+ if (keyword.function) {
+ value += "(";
+ if (keyword.parameters.empty()) {
+ value += ")";
+ }
+ }
+ return strdup(value.c_str());
+ }
+ }
+ return 0;
+}
+
+char** my_completion( const char * text , int start, int end)
+{
+ char **matches=0;
+ if (start == 0)
+ matches = rl_completion_matches ((char*)text, &my_generator);
+
+ // skip default filename completion.
+ rl_attempted_completion_over = 1;
+
+ return matches;
+}
+}
+
+static void controlClientThread(ConsoleConnection&& conn)
+{
+ try
+ {
+ setThreadName("dnsdist/conscli");
+
+ setTCPNoDelay(conn.getFD());
+
+ SodiumNonce theirs, ours, readingNonce, writingNonce;
+ ours.init();
+ readn2(conn.getFD(), (char*)theirs.value, sizeof(theirs.value));
+ writen2(conn.getFD(), (char*)ours.value, sizeof(ours.value));
+ readingNonce.merge(ours, theirs);
+ writingNonce.merge(theirs, ours);
+
+ for(;;) {
+ uint32_t len;
+ if (!getMsgLen32(conn.getFD(), &len)) {
+ break;
+ }
+
+ if (len == 0) {
+ /* just ACK an empty message
+ with an empty response */
+ putMsgLen32(conn.getFD(), 0);
+ continue;
+ }
+
+ std::string line;
+ line.resize(len);
+ readn2(conn.getFD(), line.data(), len);
+
+ line = sodDecryptSym(line, g_consoleKey, readingNonce);
+
+ string response;
+ try {
+ bool withReturn=true;
+ retry:;
+ try {
+ auto lua = g_lua.lock();
+
+ g_outputBuffer.clear();
+ resetLuaSideEffect();
+ auto ret = lua->executeCode<
+ boost::optional<
+ boost::variant<
+ string,
+ shared_ptr<DownstreamState>,
+ ClientState*,
+ std::unordered_map<string, double>
+ >
+ >
+ >(withReturn ? ("return "+line) : line);
+
+ if(ret) {
+ if (const auto dsValue = boost::get<shared_ptr<DownstreamState>>(&*ret)) {
+ if (*dsValue) {
+ response=(*dsValue)->getName()+"\n";
+ } else {
+ response="";
+ }
+ }
+ else if (const auto csValue = boost::get<ClientState*>(&*ret)) {
+ if (*csValue) {
+ response=(*csValue)->local.toStringWithPort()+"\n";
+ } else {
+ response="";
+ }
+ }
+ else if (const auto strValue = boost::get<string>(&*ret)) {
+ response=*strValue+"\n";
+ }
+ else if(const auto um = boost::get<std::unordered_map<string, double> >(&*ret)) {
+ using namespace json11;
+ Json::object o;
+ for(const auto& v : *um)
+ o[v.first]=v.second;
+ Json out = o;
+ response=out.dump()+"\n";
+ }
+ }
+ else
+ response=g_outputBuffer;
+ if(!getLuaNoSideEffect())
+ feedConfigDelta(line);
+ }
+ catch(const LuaContext::SyntaxErrorException&) {
+ if(withReturn) {
+ withReturn=false;
+ goto retry;
+ }
+ throw;
+ }
+ }
+ catch(const LuaContext::WrongTypeException& e) {
+ response = "Command returned an object we can't print: " +std::string(e.what()) + "\n";
+ // tried to return something we don't understand
+ }
+ catch(const LuaContext::ExecutionErrorException& e) {
+ if(!strcmp(e.what(),"invalid key to 'next'"))
+ response = "Error: Parsing function parameters, did you forget parameter name?";
+ else
+ response = "Error: " + string(e.what());
+ try {
+ std::rethrow_if_nested(e);
+ } catch(const std::exception& ne) {
+ // ne is the exception that was thrown from inside the lambda
+ response+= ": " + string(ne.what());
+ }
+ catch(const PDNSException& ne) {
+ // ne is the exception that was thrown from inside the lambda
+ response += ": " + string(ne.reason);
+ }
+ }
+ catch(const LuaContext::SyntaxErrorException& e) {
+ response = "Error: " + string(e.what()) + ": ";
+ }
+ response = sodEncryptSym(response, g_consoleKey, writingNonce);
+ putMsgLen32(conn.getFD(), response.length());
+ writen2(conn.getFD(), response.c_str(), response.length());
+ }
+ if (g_logConsoleConnections) {
+ infolog("Closed control connection from %s", conn.getClient().toStringWithPort());
+ }
+ }
+ catch (const std::exception& e)
+ {
+ errlog("Got an exception in client connection from %s: %s", conn.getClient().toStringWithPort(), e.what());
+ }
+}
+
+void controlThread(int fd, ComboAddress local)
+{
+ try
+ {
+ setThreadName("dnsdist/control");
+ ComboAddress client;
+ int sock;
+ auto localACL = g_consoleACL.getLocal();
+ infolog("Accepting control connections on %s", local.toStringWithPort());
+
+ while ((sock = SAccept(fd, client)) >= 0) {
+
+ if (!sodIsValidKey(g_consoleKey)) {
+ vinfolog("Control connection from %s dropped because we don't have a valid key configured, please configure one using setKey()", client.toStringWithPort());
+ close(sock);
+ continue;
+ }
+
+ if (!localACL->match(client)) {
+ vinfolog("Control connection from %s dropped because of ACL", client.toStringWithPort());
+ close(sock);
+ continue;
+ }
+
+ try {
+ ConsoleConnection conn(client, sock);
+ if (g_logConsoleConnections) {
+ warnlog("Got control connection from %s", client.toStringWithPort());
+ }
+
+ std::thread t(controlClientThread, std::move(conn));
+ t.detach();
+ }
+ catch (const std::exception& e) {
+ errlog("Control connection died: %s", e.what());
+ }
+ }
+ }
+ catch (const std::exception& e)
+ {
+ close(fd);
+ errlog("Control thread died: %s", e.what());
+ }
+}
+
+void clearConsoleHistory()
+{
+ clear_history();
+ g_confDelta.clear();
+}
diff --git a/dnsdist-console.hh b/dnsdist-console.hh
new file mode 100644
index 0000000..5697c8a
--- /dev/null
+++ b/dnsdist-console.hh
@@ -0,0 +1,56 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+struct ConsoleKeyword {
+ std::string name;
+ bool function;
+ std::string parameters;
+ std::string description;
+ std::string toString() const
+ {
+ std::string res(name);
+ if (function) {
+ res += "(" + parameters + ")";
+ }
+ res += ": ";
+ res += description;
+ return res;
+ }
+};
+
+extern GlobalStateHolder<NetmaskGroup> g_consoleACL;
+extern const std::vector<ConsoleKeyword> g_consoleKeywords;
+extern std::string g_consoleKey; // in theory needs locking
+extern bool g_logConsoleConnections;
+extern bool g_consoleEnabled;
+extern uint32_t g_consoleOutputMsgMaxSize;
+
+void doClient(ComboAddress server, const std::string& command);
+void doConsole();
+extern "C" {
+char** my_completion( const char * text , int start, int end);
+}
+void controlThread(int fd, ComboAddress local);
+void clearConsoleHistory();
+
+void setConsoleMaximumConcurrentConnections(size_t max);
diff --git a/dnsdist-dnscrypt.cc b/dnsdist-dnscrypt.cc
new file mode 100644
index 0000000..9930144
--- /dev/null
+++ b/dnsdist-dnscrypt.cc
@@ -0,0 +1,49 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dolog.hh"
+#include "dnsdist.hh"
+#include "dnscrypt.hh"
+
+#ifdef HAVE_DNSCRYPT
+int handleDNSCryptQuery(PacketBuffer& packet, DNSCryptQuery& query, bool tcp, time_t now, PacketBuffer& response)
+{
+ query.parsePacket(packet, tcp, now);
+
+ if (query.isValid() == false) {
+ vinfolog("Dropping DNSCrypt invalid query");
+ return false;
+ }
+
+ if (query.isEncrypted() == false) {
+ query.getCertificateResponse(now, response);
+
+ return false;
+ }
+
+ if (packet.size() < static_cast<uint16_t>(sizeof(struct dnsheader))) {
+ ++g_stats.nonCompliantQueries;
+ return false;
+ }
+
+ return true;
+}
+#endif
diff --git a/dnsdist-dynblocks.cc b/dnsdist-dynblocks.cc
new file mode 100644
index 0000000..30d4f2c
--- /dev/null
+++ b/dnsdist-dynblocks.cc
@@ -0,0 +1,756 @@
+
+#include "dnsdist.hh"
+#include "dnsdist-dynblocks.hh"
+
+GlobalStateHolder<NetmaskTree<DynBlock, AddressAndPortRange>> g_dynblockNMG;
+GlobalStateHolder<SuffixMatchTree<DynBlock>> g_dynblockSMT;
+DNSAction::Action g_dynBlockAction = DNSAction::Action::Drop;
+
+void DynBlockRulesGroup::apply(const struct timespec& now)
+{
+ counts_t counts;
+ StatNode statNodeRoot;
+
+ size_t entriesCount = 0;
+ if (hasQueryRules()) {
+ entriesCount += g_rings.getNumberOfQueryEntries();
+ }
+ if (hasResponseRules()) {
+ entriesCount += g_rings.getNumberOfResponseEntries();
+ }
+ counts.reserve(entriesCount);
+
+ processQueryRules(counts, now);
+ processResponseRules(counts, statNodeRoot, now);
+
+ if (counts.empty() && statNodeRoot.empty()) {
+ return;
+ }
+
+ boost::optional<NetmaskTree<DynBlock, AddressAndPortRange> > blocks;
+ bool updated = false;
+
+ for (const auto& entry : counts) {
+ const auto& requestor = entry.first;
+ const auto& counters = entry.second;
+
+ if (d_queryRateRule.warningRateExceeded(counters.queries, now)) {
+ handleWarning(blocks, now, requestor, d_queryRateRule, updated);
+ }
+
+ if (d_queryRateRule.rateExceeded(counters.queries, now)) {
+ addBlock(blocks, now, requestor, d_queryRateRule, updated);
+ continue;
+ }
+
+ if (d_respRateRule.warningRateExceeded(counters.respBytes, now)) {
+ handleWarning(blocks, now, requestor, d_respRateRule, updated);
+ }
+
+ if (d_respRateRule.rateExceeded(counters.respBytes, now)) {
+ addBlock(blocks, now, requestor, d_respRateRule, updated);
+ continue;
+ }
+
+ for (const auto& pair : d_qtypeRules) {
+ const auto qtype = pair.first;
+
+ const auto& typeIt = counters.d_qtypeCounts.find(qtype);
+ if (typeIt != counters.d_qtypeCounts.cend()) {
+
+ if (pair.second.warningRateExceeded(typeIt->second, now)) {
+ handleWarning(blocks, now, requestor, pair.second, updated);
+ }
+
+ if (pair.second.rateExceeded(typeIt->second, now)) {
+ addBlock(blocks, now, requestor, pair.second, updated);
+ break;
+ }
+ }
+ }
+
+ for (const auto& pair : d_rcodeRules) {
+ const auto rcode = pair.first;
+
+ const auto& rcodeIt = counters.d_rcodeCounts.find(rcode);
+ if (rcodeIt != counters.d_rcodeCounts.cend()) {
+ if (pair.second.warningRateExceeded(rcodeIt->second, now)) {
+ handleWarning(blocks, now, requestor, pair.second, updated);
+ }
+
+ if (pair.second.rateExceeded(rcodeIt->second, now)) {
+ addBlock(blocks, now, requestor, pair.second, updated);
+ break;
+ }
+ }
+ }
+
+ for (const auto& pair : d_rcodeRatioRules) {
+ const auto rcode = pair.first;
+
+ const auto& rcodeIt = counters.d_rcodeCounts.find(rcode);
+ if (rcodeIt != counters.d_rcodeCounts.cend()) {
+ if (pair.second.warningRatioExceeded(counters.responses, rcodeIt->second)) {
+ handleWarning(blocks, now, requestor, pair.second, updated);
+ }
+
+ if (pair.second.ratioExceeded(counters.responses, rcodeIt->second)) {
+ addBlock(blocks, now, requestor, pair.second, updated);
+ break;
+ }
+ }
+ }
+ }
+
+ if (updated && blocks) {
+ g_dynblockNMG.setState(std::move(*blocks));
+ }
+
+ if (!statNodeRoot.empty()) {
+ StatNode::Stat node;
+ std::unordered_map<DNSName, std::optional<std::string>> namesToBlock;
+ statNodeRoot.visit([this,&namesToBlock](const StatNode* node_, const StatNode::Stat& self, const StatNode::Stat& children) {
+ bool block = false;
+ std::optional<std::string> reason;
+
+ if (d_smtVisitorFFI) {
+ dnsdist_ffi_stat_node_t tmp(*node_, self, children, reason);
+ block = d_smtVisitorFFI(&tmp);
+ }
+ else {
+ auto ret = d_smtVisitor(*node_, self, children);
+ block = std::get<0>(ret);
+ if (block) {
+ if (boost::optional<std::string> tmp = std::get<1>(ret)) {
+ reason = std::move(*tmp);
+ }
+ }
+ }
+
+ if (block) {
+ namesToBlock.insert({DNSName(node_->fullname), std::move(reason)});
+ }
+ },
+ node);
+
+ if (!namesToBlock.empty()) {
+ updated = false;
+ SuffixMatchTree<DynBlock> smtBlocks = g_dynblockSMT.getCopy();
+ for (auto& [name, reason] : namesToBlock) {
+ if (reason) {
+ DynBlockRule rule(d_suffixMatchRule);
+ rule.d_blockReason = std::move(*reason);
+ addOrRefreshBlockSMT(smtBlocks, now, std::move(name), std::move(rule), updated);
+ }
+ else {
+ addOrRefreshBlockSMT(smtBlocks, now, std::move(name), d_suffixMatchRule, updated);
+ }
+ }
+ if (updated) {
+ g_dynblockSMT.setState(std::move(smtBlocks));
+ }
+ }
+ }
+}
+
+bool DynBlockRulesGroup::checkIfQueryTypeMatches(const Rings::Query& query)
+{
+ auto rule = d_qtypeRules.find(query.qtype);
+ if (rule == d_qtypeRules.end()) {
+ return false;
+ }
+
+ return rule->second.matches(query.when);
+}
+
+bool DynBlockRulesGroup::checkIfResponseCodeMatches(const Rings::Response& response)
+{
+ auto rule = d_rcodeRules.find(response.dh.rcode);
+ if (rule != d_rcodeRules.end() && rule->second.matches(response.when)) {
+ return true;
+ }
+
+ auto ratio = d_rcodeRatioRules.find(response.dh.rcode);
+ if (ratio != d_rcodeRatioRules.end() && ratio->second.matches(response.when)) {
+ return true;
+ }
+
+ return false;
+}
+
+/* return the actual action that will be taken by that block:
+ - either the one set on that block, if any
+ - or the one set with setDynBlocksAction in g_dynBlockAction
+*/
+static DNSAction::Action getActualAction(const DynBlock& block)
+{
+ if (block.action != DNSAction::Action::None) {
+ return block.action;
+ }
+ return g_dynBlockAction;
+}
+
+void DynBlockRulesGroup::addOrRefreshBlock(boost::optional<NetmaskTree<DynBlock, AddressAndPortRange> >& blocks, const struct timespec& now, const AddressAndPortRange& requestor, const DynBlockRule& rule, bool& updated, bool warning)
+{
+ /* network exclusions are address-based only (no port) */
+ if (d_excludedSubnets.match(requestor.getNetwork())) {
+ /* do not add a block for excluded subnets */
+ return;
+ }
+
+ if (!blocks) {
+ blocks = g_dynblockNMG.getCopy();
+ }
+ struct timespec until = now;
+ until.tv_sec += rule.d_blockDuration;
+ unsigned int count = 0;
+ const auto& got = blocks->lookup(requestor);
+ bool expired = false;
+ bool wasWarning = false;
+ bool bpf = false;
+
+ if (got) {
+ bpf = got->second.bpf;
+
+ if (warning && !got->second.warning) {
+ /* we have an existing entry which is not a warning,
+ don't override it */
+ return;
+ }
+ else if (!warning && got->second.warning) {
+ wasWarning = true;
+ }
+ else {
+ if (until < got->second.until) {
+ // had a longer policy
+ return;
+ }
+ }
+
+ if (now < got->second.until) {
+ // only inherit count on fresh query we are extending
+ count = got->second.blocks;
+ }
+ else {
+ expired = true;
+ }
+ }
+
+ DynBlock db{rule.d_blockReason, until, DNSName(), warning ? DNSAction::Action::NoOp : rule.d_action};
+ db.blocks = count;
+ db.warning = warning;
+ if (!got || expired || wasWarning) {
+ const auto actualAction = getActualAction(db);
+ if (g_defaultBPFFilter &&
+ ((requestor.isIPv4() && requestor.getBits() == 32) || (requestor.isIPv6() && requestor.getBits() == 128)) &&
+ (actualAction == DNSAction::Action::Drop || actualAction == DNSAction::Action::Truncate)) {
+ try {
+ BPFFilter::MatchAction bpfAction = actualAction == DNSAction::Action::Drop ? BPFFilter::MatchAction::Drop : BPFFilter::MatchAction::Truncate;
+ if (g_defaultBPFFilter->supportsMatchAction(bpfAction)) {
+ /* the current BPF filter implementation only supports full addresses (/32 or /128) and no port */
+ g_defaultBPFFilter->block(requestor.getNetwork(), bpfAction);
+ bpf = true;
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Unable to insert eBPF dynamic block for %s, falling back to regular dynamic block: %s", requestor.toString(), e.what());
+ }
+ }
+
+ if (!d_beQuiet) {
+ warnlog("Inserting %sdynamic block for %s for %d seconds: %s", warning ? "(warning) " :"", requestor.toString(), rule.d_blockDuration, rule.d_blockReason);
+ }
+ }
+
+ db.bpf = bpf;
+
+ blocks->insert(requestor).second = std::move(db);
+
+ updated = true;
+}
+
+void DynBlockRulesGroup::addOrRefreshBlockSMT(SuffixMatchTree<DynBlock>& blocks, const struct timespec& now, const DNSName& name, const DynBlockRule& rule, bool& updated)
+{
+ if (d_excludedDomains.check(name)) {
+ /* do not add a block for excluded domains */
+ return;
+ }
+
+ struct timespec until = now;
+ until.tv_sec += rule.d_blockDuration;
+ unsigned int count = 0;
+ /* be careful, if you try to insert a longer suffix
+ lookup() might return a shorter one if it is
+ already in the tree as a final node */
+ const DynBlock* got = blocks.lookup(name);
+ if (got && got->domain != name) {
+ got = nullptr;
+ }
+ bool expired = false;
+
+ if (got) {
+ if (until < got->until) {
+ // had a longer policy
+ return;
+ }
+
+ if (now < got->until) {
+ // only inherit count on fresh query we are extending
+ count = got->blocks;
+ }
+ else {
+ expired = true;
+ }
+ }
+
+ DynBlock db{rule.d_blockReason, until, name.makeLowerCase(), rule.d_action};
+ db.blocks = count;
+
+ if (!d_beQuiet && (!got || expired)) {
+ warnlog("Inserting dynamic block for %s for %d seconds: %s", name, rule.d_blockDuration, rule.d_blockReason);
+ }
+ blocks.add(name, std::move(db));
+ updated = true;
+}
+
+void DynBlockRulesGroup::processQueryRules(counts_t& counts, const struct timespec& now)
+{
+ if (!hasQueryRules()) {
+ return;
+ }
+
+ d_queryRateRule.d_cutOff = d_queryRateRule.d_minTime = now;
+ d_queryRateRule.d_cutOff.tv_sec -= d_queryRateRule.d_seconds;
+
+ for (auto& rule : d_qtypeRules) {
+ rule.second.d_cutOff = rule.second.d_minTime = now;
+ rule.second.d_cutOff.tv_sec -= rule.second.d_seconds;
+ }
+
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->queryRing.lock();
+ for(const auto& c : *rl) {
+ if (now < c.when) {
+ continue;
+ }
+
+ bool qRateMatches = d_queryRateRule.matches(c.when);
+ bool typeRuleMatches = checkIfQueryTypeMatches(c);
+
+ if (qRateMatches || typeRuleMatches) {
+ auto& entry = counts[AddressAndPortRange(c.requestor, c.requestor.isIPv4() ? d_v4Mask : d_v6Mask, d_portMask)];
+ if (qRateMatches) {
+ ++entry.queries;
+ }
+ if (typeRuleMatches) {
+ ++entry.d_qtypeCounts[c.qtype];
+ }
+ }
+ }
+ }
+}
+
+void DynBlockRulesGroup::processResponseRules(counts_t& counts, StatNode& root, const struct timespec& now)
+{
+ if (!hasResponseRules() && !hasSuffixMatchRules()) {
+ return;
+ }
+
+ struct timespec responseCutOff = now;
+
+ d_respRateRule.d_cutOff = d_respRateRule.d_minTime = now;
+ d_respRateRule.d_cutOff.tv_sec -= d_respRateRule.d_seconds;
+ if (d_respRateRule.d_cutOff < responseCutOff) {
+ responseCutOff = d_respRateRule.d_cutOff;
+ }
+
+ d_suffixMatchRule.d_cutOff = d_suffixMatchRule.d_minTime = now;
+ d_suffixMatchRule.d_cutOff.tv_sec -= d_suffixMatchRule.d_seconds;
+ if (d_suffixMatchRule.d_cutOff < responseCutOff) {
+ responseCutOff = d_suffixMatchRule.d_cutOff;
+ }
+
+ for (auto& rule : d_rcodeRules) {
+ rule.second.d_cutOff = rule.second.d_minTime = now;
+ rule.second.d_cutOff.tv_sec -= rule.second.d_seconds;
+ if (rule.second.d_cutOff < responseCutOff) {
+ responseCutOff = rule.second.d_cutOff;
+ }
+ }
+
+ for (auto& rule : d_rcodeRatioRules) {
+ rule.second.d_cutOff = rule.second.d_minTime = now;
+ rule.second.d_cutOff.tv_sec -= rule.second.d_seconds;
+ if (rule.second.d_cutOff < responseCutOff) {
+ responseCutOff = rule.second.d_cutOff;
+ }
+ }
+
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->respRing.lock();
+ for(const auto& c : *rl) {
+ if (now < c.when) {
+ continue;
+ }
+
+ if (c.when < responseCutOff) {
+ continue;
+ }
+
+ auto& entry = counts[AddressAndPortRange(c.requestor, c.requestor.isIPv4() ? d_v4Mask : d_v6Mask, d_portMask)];
+ ++entry.responses;
+
+ bool respRateMatches = d_respRateRule.matches(c.when);
+ bool suffixMatchRuleMatches = d_suffixMatchRule.matches(c.when);
+ bool rcodeRuleMatches = checkIfResponseCodeMatches(c);
+
+ if (respRateMatches || rcodeRuleMatches) {
+ if (respRateMatches) {
+ entry.respBytes += c.size;
+ }
+ if (rcodeRuleMatches) {
+ ++entry.d_rcodeCounts[c.dh.rcode];
+ }
+ }
+
+ if (suffixMatchRuleMatches) {
+ root.submit(c.name, ((c.dh.rcode == 0 && c.usec == std::numeric_limits<unsigned int>::max()) ? -1 : c.dh.rcode), c.size, boost::none);
+ }
+ }
+ }
+}
+
+void DynBlockMaintenance::purgeExpired(const struct timespec& now)
+{
+ {
+ auto blocks = g_dynblockNMG.getLocal();
+ std::vector<AddressAndPortRange> toRemove;
+ for (const auto& entry : *blocks) {
+ if (!(now < entry.second.until)) {
+ toRemove.push_back(entry.first);
+ if (g_defaultBPFFilter && entry.second.bpf) {
+ try {
+ g_defaultBPFFilter->unblock(entry.first.getNetwork());
+ }
+ catch (const std::exception& e) {
+ vinfolog("Error while removing eBPF dynamic block for %s: %s", entry.first.toString(), e.what());
+ }
+ }
+ }
+ }
+ if (!toRemove.empty()) {
+ auto updated = g_dynblockNMG.getCopy();
+ for (const auto& entry : toRemove) {
+ updated.erase(entry);
+ }
+ g_dynblockNMG.setState(std::move(updated));
+ }
+ }
+
+ {
+ std::vector<DNSName> toRemove;
+ auto blocks = g_dynblockSMT.getLocal();
+ blocks->visit([&toRemove, now](const SuffixMatchTree<DynBlock>& node) {
+ if (!(now < node.d_value.until)) {
+ toRemove.push_back(node.d_value.domain);
+ }
+ });
+ if (!toRemove.empty()) {
+ auto updated = g_dynblockSMT.getCopy();
+ for (const auto& entry : toRemove) {
+ updated.remove(entry);
+ }
+ g_dynblockSMT.setState(std::move(updated));
+ }
+ }
+}
+
+std::map<std::string, std::list<std::pair<AddressAndPortRange, unsigned int>>> DynBlockMaintenance::getTopNetmasks(size_t topN)
+{
+ std::map<std::string, std::list<std::pair<AddressAndPortRange, unsigned int>>> results;
+ if (topN == 0) {
+ return results;
+ }
+
+ auto blocks = g_dynblockNMG.getLocal();
+ for (const auto& entry : *blocks) {
+ auto& topsForReason = results[entry.second.reason];
+ uint64_t value = entry.second.blocks.load();
+
+ if (g_defaultBPFFilter && entry.second.bpf) {
+ value += g_defaultBPFFilter->getHits(entry.first.getNetwork());
+ }
+
+ if (topsForReason.size() < topN || topsForReason.front().second < value) {
+ auto newEntry = std::pair(entry.first, value);
+
+ if (topsForReason.size() >= topN) {
+ topsForReason.pop_front();
+ }
+
+ topsForReason.insert(std::lower_bound(topsForReason.begin(), topsForReason.end(), newEntry, [](const std::pair<AddressAndPortRange, unsigned int>& a, const std::pair<AddressAndPortRange, unsigned int>& b) {
+ return a.second < b.second;
+ }),
+ newEntry);
+ }
+ }
+
+ return results;
+}
+
+std::map<std::string, std::list<std::pair<DNSName, unsigned int>>> DynBlockMaintenance::getTopSuffixes(size_t topN)
+{
+ std::map<std::string, std::list<std::pair<DNSName, unsigned int>>> results;
+ if (topN == 0) {
+ return results;
+ }
+
+ auto blocks = g_dynblockSMT.getLocal();
+ blocks->visit([&results, topN](const SuffixMatchTree<DynBlock>& node) {
+ auto& topsForReason = results[node.d_value.reason];
+ if (topsForReason.size() < topN || topsForReason.front().second < node.d_value.blocks) {
+ auto newEntry = std::pair(node.d_value.domain, node.d_value.blocks.load());
+
+ if (topsForReason.size() >= topN) {
+ topsForReason.pop_front();
+ }
+
+ topsForReason.insert(std::lower_bound(topsForReason.begin(), topsForReason.end(), newEntry, [](const std::pair<DNSName, unsigned int>& a, const std::pair<DNSName, unsigned int>& b) {
+ return a.second < b.second;
+ }),
+ newEntry);
+ }
+ });
+
+ return results;
+}
+
+struct DynBlockEntryStat
+{
+ size_t sum;
+ unsigned int lastSeenValue{0};
+};
+
+std::list<DynBlockMaintenance::MetricsSnapshot> DynBlockMaintenance::s_metricsData;
+
+LockGuarded<DynBlockMaintenance::Tops> DynBlockMaintenance::s_tops;
+size_t DynBlockMaintenance::s_topN{20};
+time_t DynBlockMaintenance::s_expiredDynBlocksPurgeInterval{60};
+
+void DynBlockMaintenance::collectMetrics()
+{
+ MetricsSnapshot snapshot;
+ /* over sampling to get entries that are not in the top N
+ every time a chance to be at the end */
+ snapshot.smtData = getTopSuffixes(s_topN * 5);
+ snapshot.nmgData = getTopNetmasks(s_topN * 5);
+
+ if (s_metricsData.size() >= 7) {
+ s_metricsData.pop_front();
+ }
+ s_metricsData.push_back(std::move(snapshot));
+}
+
+void DynBlockMaintenance::generateMetrics()
+{
+ if (s_metricsData.empty()) {
+ return;
+ }
+
+ /* do NMG */
+ std::map<std::string, std::map<AddressAndPortRange, DynBlockEntryStat>> nm;
+ for (const auto& reason : s_metricsData.front().nmgData) {
+ auto& reasonStat = nm[reason.first];
+
+ /* prepare the counters by scanning the oldest entry (N+1) */
+ for (const auto& entry : reason.second) {
+ auto& stat = reasonStat[entry.first];
+ stat.sum = 0;
+ stat.lastSeenValue = entry.second;
+ }
+ }
+
+ /* scan all the N entries, updating the counters */
+ bool first = true;
+ for (const auto& snap : s_metricsData) {
+ if (first) {
+ first = false;
+ continue;
+ }
+
+ auto& nmgData = snap.nmgData;
+ for (const auto& reason : nmgData) {
+ auto& reasonStat = nm[reason.first];
+ for (const auto& entry : reason.second) {
+ auto& stat = reasonStat[entry.first];
+ if (entry.second < stat.lastSeenValue) {
+ /* it wrapped, or we did not have a last value */
+ stat.sum += entry.second;
+ }
+ else {
+ stat.sum += entry.second - stat.lastSeenValue;
+ }
+ stat.lastSeenValue = entry.second;
+ }
+ }
+ }
+
+ /* now we need to get the top N entries (for each "reason") based on our counters (sum of the last N entries) */
+ std::map<std::string, std::list<std::pair<AddressAndPortRange, unsigned int>>> topNMGs;
+ {
+ for (const auto& reason : nm) {
+ auto& topsForReason = topNMGs[reason.first];
+ for (const auto& entry : reason.second) {
+ if (topsForReason.size() < s_topN || topsForReason.front().second < entry.second.sum) {
+ /* Note that this is a gauge, so we need to divide by the number of elapsed seconds */
+ auto newEntry = std::pair<AddressAndPortRange, unsigned int>(entry.first, std::round(entry.second.sum / 60.0));
+ if (topsForReason.size() >= s_topN) {
+ topsForReason.pop_front();
+ }
+
+ topsForReason.insert(std::lower_bound(topsForReason.begin(), topsForReason.end(), newEntry, [](const std::pair<AddressAndPortRange, unsigned int>& a, const std::pair<AddressAndPortRange, unsigned int>& b) {
+ return a.second < b.second;
+ }),
+ newEntry);
+ }
+ }
+ }
+ }
+
+ /* do SMT */
+ std::map<std::string, std::map<DNSName, DynBlockEntryStat>> smt;
+ for (const auto& reason : s_metricsData.front().smtData) {
+ auto& reasonStat = smt[reason.first];
+
+ /* prepare the counters by scanning the oldest entry (N+1) */
+ for (const auto& entry : reason.second) {
+ auto& stat = reasonStat[entry.first];
+ stat.sum = 0;
+ stat.lastSeenValue = entry.second;
+ }
+ }
+
+ /* scan all the N entries, updating the counters */
+ first = true;
+ for (const auto& snap : s_metricsData) {
+ if (first) {
+ first = false;
+ continue;
+ }
+
+ auto& smtData = snap.smtData;
+ for (const auto& reason : smtData) {
+ auto& reasonStat = smt[reason.first];
+ for (const auto& entry : reason.second) {
+ auto& stat = reasonStat[entry.first];
+ if (entry.second < stat.lastSeenValue) {
+ /* it wrapped, or we did not have a last value */
+ stat.sum = entry.second;
+ }
+ else {
+ stat.sum = entry.second - stat.lastSeenValue;
+ }
+ stat.lastSeenValue = entry.second;
+ }
+ }
+ }
+
+ /* now we need to get the top N entries (for each "reason") based on our counters (sum of the last N entries) */
+ std::map<std::string, std::list<std::pair<DNSName, unsigned int>>> topSMTs;
+ {
+ for (const auto& reason : smt) {
+ auto& topsForReason = topSMTs[reason.first];
+ for (const auto& entry : reason.second) {
+ if (topsForReason.size() < s_topN || topsForReason.front().second < entry.second.sum) {
+ /* Note that this is a gauge, so we need to divide by the number of elapsed seconds */
+ auto newEntry = std::pair<DNSName, unsigned int>(entry.first, std::round(entry.second.sum / 60.0));
+ if (topsForReason.size() >= s_topN) {
+ topsForReason.pop_front();
+ }
+
+ topsForReason.insert(std::lower_bound(topsForReason.begin(), topsForReason.end(), newEntry, [](const std::pair<DNSName, unsigned int>& a, const std::pair<DNSName, unsigned int>& b) {
+ return a.second < b.second;
+ }),
+ newEntry);
+ }
+ }
+ }
+ }
+
+ {
+ auto tops = s_tops.lock();
+ tops->topNMGsByReason = std::move(topNMGs);
+ tops->topSMTsByReason = std::move(topSMTs);
+ }
+}
+
+void DynBlockMaintenance::run()
+{
+ /* alright, so the main idea is to:
+ 1/ clean up the NMG and SMT from expired entries from time to time
+ 2/ generate metrics that can be used in the API and prometheus endpoints
+ */
+
+ static const time_t metricsCollectionInterval = 10;
+ static const time_t metricsGenerationInterval = 60;
+
+ time_t now = time(nullptr);
+ time_t nextExpiredPurge = now + s_expiredDynBlocksPurgeInterval;
+ time_t nextMetricsCollect = now + metricsCollectionInterval;
+ time_t nextMetricsGeneration = now + metricsGenerationInterval;
+
+ while (true) {
+ time_t sleepDelay = std::numeric_limits<time_t>::max();
+ if (s_expiredDynBlocksPurgeInterval > 0) {
+ sleepDelay = std::min(sleepDelay, (nextExpiredPurge - now));
+ }
+ sleepDelay = std::min(sleepDelay, (nextMetricsCollect - now));
+ sleepDelay = std::min(sleepDelay, (nextMetricsGeneration - now));
+
+ sleep(sleepDelay);
+
+ try {
+ now = time(nullptr);
+ if (now >= nextMetricsCollect) {
+ /* every ten seconds we store the top N entries */
+ collectMetrics();
+
+ now = time(nullptr);
+ nextMetricsCollect = now + metricsCollectionInterval;
+ }
+
+ if (now >= nextMetricsGeneration) {
+ generateMetrics();
+
+ now = time(nullptr);
+ /* every minute we compute the averaged top N entries of the last 60 seconds,
+ and update the cached entry. */
+ nextMetricsGeneration = now + metricsGenerationInterval;
+ }
+
+ if (s_expiredDynBlocksPurgeInterval > 0 && now >= nextExpiredPurge) {
+ struct timespec tspec;
+ gettime(&tspec);
+ purgeExpired(tspec);
+
+ now = time(nullptr);
+ nextExpiredPurge = now + s_expiredDynBlocksPurgeInterval;
+ }
+ }
+ catch (const std::exception& e) {
+ warnlog("Error in the dynamic block maintenance thread: %s", e.what());
+ }
+ catch (...) {
+ }
+ }
+}
+
+std::map<std::string, std::list<std::pair<AddressAndPortRange, unsigned int>>> DynBlockMaintenance::getHitsForTopNetmasks()
+{
+ return s_tops.lock()->topNMGsByReason;
+}
+
+std::map<std::string, std::list<std::pair<DNSName, unsigned int>>> DynBlockMaintenance::getHitsForTopSuffixes()
+{
+ return s_tops.lock()->topSMTsByReason;
+}
diff --git a/dnsdist-dynblocks.hh b/dnsdist-dynblocks.hh
new file mode 100644
index 0000000..7bd9d97
--- /dev/null
+++ b/dnsdist-dynblocks.hh
@@ -0,0 +1,437 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <unordered_set>
+
+#include "dolog.hh"
+#include "dnsdist-rings.hh"
+#include "statnode.hh"
+
+#include "dnsdist-lua-inspection-ffi.hh"
+
+// dnsdist_ffi_stat_node_t is a lightuserdata
+template<>
+struct LuaContext::Pusher<dnsdist_ffi_stat_node_t*> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, dnsdist_ffi_stat_node_t* ptr) noexcept {
+ lua_pushlightuserdata(state, ptr);
+ return PushedObject{state, 1};
+ }
+};
+
+typedef std::function<bool(dnsdist_ffi_stat_node_t*)> dnsdist_ffi_stat_node_visitor_t;
+
+struct dnsdist_ffi_stat_node_t
+{
+ dnsdist_ffi_stat_node_t(const StatNode& node_, const StatNode::Stat& self_, const StatNode::Stat& children_, std::optional<std::string>& reason_): node(node_), self(self_), children(children_), reason(reason_)
+ {
+ }
+
+ const StatNode& node;
+ const StatNode::Stat& self;
+ const StatNode::Stat& children;
+ std::optional<std::string>& reason;
+};
+
+class DynBlockRulesGroup
+{
+private:
+
+ struct Counts
+ {
+ std::map<uint8_t, uint64_t> d_rcodeCounts;
+ std::map<uint16_t, uint64_t> d_qtypeCounts;
+ uint64_t queries{0};
+ uint64_t responses{0};
+ uint64_t respBytes{0};
+ };
+
+ struct DynBlockRule
+ {
+ DynBlockRule(): d_enabled(false)
+ {
+ }
+
+ DynBlockRule(const std::string& blockReason, unsigned int blockDuration, unsigned int rate, unsigned int warningRate, unsigned int seconds, DNSAction::Action action): d_blockReason(blockReason), d_blockDuration(blockDuration), d_rate(rate), d_warningRate(warningRate), d_seconds(seconds), d_action(action), d_enabled(true)
+ {
+ }
+
+ bool matches(const struct timespec& when)
+ {
+ if (!d_enabled) {
+ return false;
+ }
+
+ if (d_seconds && when < d_cutOff) {
+ return false;
+ }
+
+ if (when < d_minTime) {
+ d_minTime = when;
+ }
+
+ return true;
+ }
+
+ bool rateExceeded(unsigned int count, const struct timespec& now) const
+ {
+ if (!d_enabled) {
+ return false;
+ }
+
+ double delta = d_seconds ? d_seconds : DiffTime(now, d_minTime);
+ double limit = delta * d_rate;
+ return (count > limit);
+ }
+
+ bool warningRateExceeded(unsigned int count, const struct timespec& now) const
+ {
+ if (!d_enabled) {
+ return false;
+ }
+
+ if (d_warningRate == 0) {
+ return false;
+ }
+
+ double delta = d_seconds ? d_seconds : DiffTime(now, d_minTime);
+ double limit = delta * d_warningRate;
+ return (count > limit);
+ }
+
+ bool isEnabled() const
+ {
+ return d_enabled;
+ }
+
+ std::string toString() const
+ {
+ if (!isEnabled()) {
+ return "";
+ }
+
+ std::stringstream result;
+ if (d_action != DNSAction::Action::None) {
+ result << DNSAction::typeToString(d_action) << " ";
+ }
+ else {
+ result << "Apply the global DynBlock action ";
+ }
+ result << "for " << std::to_string(d_blockDuration) << " seconds when over " << std::to_string(d_rate) << " during the last " << d_seconds << " seconds, reason: '" << d_blockReason << "'";
+
+ return result.str();
+ }
+
+ std::string d_blockReason;
+ struct timespec d_cutOff;
+ struct timespec d_minTime;
+ unsigned int d_blockDuration{0};
+ unsigned int d_rate{0};
+ unsigned int d_warningRate{0};
+ unsigned int d_seconds{0};
+ DNSAction::Action d_action{DNSAction::Action::None};
+ bool d_enabled{false};
+ };
+
+ struct DynBlockRatioRule: DynBlockRule
+ {
+ DynBlockRatioRule(): DynBlockRule()
+ {
+ }
+
+ DynBlockRatioRule(const std::string& blockReason, unsigned int blockDuration, double ratio, double warningRatio, unsigned int seconds, DNSAction::Action action, size_t minimumNumberOfResponses): DynBlockRule(blockReason, blockDuration, 0, 0, seconds, action), d_minimumNumberOfResponses(minimumNumberOfResponses), d_ratio(ratio), d_warningRatio(warningRatio)
+ {
+ }
+
+ bool ratioExceeded(unsigned int total, unsigned int count) const
+ {
+ if (!d_enabled) {
+ return false;
+ }
+
+ if (total < d_minimumNumberOfResponses) {
+ return false;
+ }
+
+ double allowed = d_ratio * static_cast<double>(total);
+ return (count > allowed);
+ }
+
+ bool warningRatioExceeded(unsigned int total, unsigned int count) const
+ {
+ if (!d_enabled) {
+ return false;
+ }
+
+ if (d_warningRatio == 0.0) {
+ return false;
+ }
+
+ if (total < d_minimumNumberOfResponses) {
+ return false;
+ }
+
+ double allowed = d_warningRatio * static_cast<double>(total);
+ return (count > allowed);
+ }
+
+ std::string toString() const
+ {
+ if (!isEnabled()) {
+ return "";
+ }
+
+ std::stringstream result;
+ if (d_action != DNSAction::Action::None) {
+ result << DNSAction::typeToString(d_action) << " ";
+ }
+ else {
+ result << "Apply the global DynBlock action ";
+ }
+ result << "for " << std::to_string(d_blockDuration) << " seconds when over " << std::to_string(d_ratio) << " ratio during the last " << d_seconds << " seconds, reason: '" << d_blockReason << "'";
+
+ return result.str();
+ }
+
+ size_t d_minimumNumberOfResponses{0};
+ double d_ratio{0.0};
+ double d_warningRatio{0.0};
+ };
+
+ typedef std::unordered_map<AddressAndPortRange, Counts, AddressAndPortRange::hash> counts_t;
+
+public:
+ DynBlockRulesGroup()
+ {
+ }
+
+ void setQueryRate(unsigned int rate, unsigned int warningRate, unsigned int seconds, std::string reason, unsigned int blockDuration, DNSAction::Action action)
+ {
+ d_queryRateRule = DynBlockRule(reason, blockDuration, rate, warningRate, seconds, action);
+ }
+
+ /* rate is in bytes per second */
+ void setResponseByteRate(unsigned int rate, unsigned int warningRate, unsigned int seconds, std::string reason, unsigned int blockDuration, DNSAction::Action action)
+ {
+ d_respRateRule = DynBlockRule(reason, blockDuration, rate, warningRate, seconds, action);
+ }
+
+ void setRCodeRate(uint8_t rcode, unsigned int rate, unsigned int warningRate, unsigned int seconds, std::string reason, unsigned int blockDuration, DNSAction::Action action)
+ {
+ auto& entry = d_rcodeRules[rcode];
+ entry = DynBlockRule(reason, blockDuration, rate, warningRate, seconds, action);
+ }
+
+ void setRCodeRatio(uint8_t rcode, double ratio, double warningRatio, unsigned int seconds, std::string reason, unsigned int blockDuration, DNSAction::Action action, size_t minimumNumberOfResponses)
+ {
+ auto& entry = d_rcodeRatioRules[rcode];
+ entry = DynBlockRatioRule(reason, blockDuration, ratio, warningRatio, seconds, action, minimumNumberOfResponses);
+ }
+
+ void setQTypeRate(uint16_t qtype, unsigned int rate, unsigned int warningRate, unsigned int seconds, std::string reason, unsigned int blockDuration, DNSAction::Action action)
+ {
+ auto& entry = d_qtypeRules[qtype];
+ entry = DynBlockRule(reason, blockDuration, rate, warningRate, seconds, action);
+ }
+
+ typedef std::function<std::tuple<bool, boost::optional<std::string>>(const StatNode&, const StatNode::Stat&, const StatNode::Stat&)> smtVisitor_t;
+
+ void setSuffixMatchRule(unsigned int seconds, std::string reason, unsigned int blockDuration, DNSAction::Action action, smtVisitor_t visitor)
+ {
+ d_suffixMatchRule = DynBlockRule(reason, blockDuration, 0, 0, seconds, action);
+ d_smtVisitor = visitor;
+ }
+
+ void setSuffixMatchRuleFFI(unsigned int seconds, std::string reason, unsigned int blockDuration, DNSAction::Action action, dnsdist_ffi_stat_node_visitor_t visitor)
+ {
+ d_suffixMatchRule = DynBlockRule(reason, blockDuration, 0, 0, seconds, action);
+ d_smtVisitorFFI = visitor;
+ }
+
+ void setMasks(uint8_t v4, uint8_t v6, uint8_t port)
+ {
+ d_v4Mask = v4;
+ d_v6Mask = v6;
+ d_portMask = port;
+ }
+
+ void apply()
+ {
+ struct timespec now;
+ gettime(&now);
+
+ apply(now);
+ }
+
+ void apply(const struct timespec& now);
+
+ void excludeRange(const Netmask& range)
+ {
+ d_excludedSubnets.addMask(range);
+ }
+
+ void excludeRange(const NetmaskGroup& group)
+ {
+ d_excludedSubnets.addMasks(group, true);
+ }
+
+ void includeRange(const Netmask& range)
+ {
+ d_excludedSubnets.addMask(range, false);
+ }
+
+ void includeRange(const NetmaskGroup& group)
+ {
+ d_excludedSubnets.addMasks(group, false);
+ }
+
+ void excludeDomain(const DNSName& domain)
+ {
+ d_excludedDomains.add(domain);
+ }
+
+ std::string toString() const
+ {
+ std::stringstream result;
+
+ result << "Query rate rule: " << d_queryRateRule.toString() << std::endl;
+ result << "Response rate rule: " << d_respRateRule.toString() << std::endl;
+ result << "SuffixMatch rule: " << d_suffixMatchRule.toString() << std::endl;
+ result << "RCode rules: " << std::endl;
+ for (const auto& rule : d_rcodeRules) {
+ result << "- " << RCode::to_s(rule.first) << ": " << rule.second.toString() << std::endl;
+ }
+ for (const auto& rule : d_rcodeRatioRules) {
+ result << "- " << RCode::to_s(rule.first) << ": " << rule.second.toString() << std::endl;
+ }
+ result << "QType rules: " << std::endl;
+ for (const auto& rule : d_qtypeRules) {
+ result << "- " << QType(rule.first).toString() << ": " << rule.second.toString() << std::endl;
+ }
+ result << "Excluded Subnets: " << d_excludedSubnets.toString() << std::endl;
+ result << "Excluded Domains: " << d_excludedDomains.toString() << std::endl;
+
+ return result.str();
+ }
+
+ void setQuiet(bool quiet)
+ {
+ d_beQuiet = quiet;
+ }
+
+private:
+
+ bool checkIfQueryTypeMatches(const Rings::Query& query);
+ bool checkIfResponseCodeMatches(const Rings::Response& response);
+ void addOrRefreshBlock(boost::optional<NetmaskTree<DynBlock, AddressAndPortRange> >& blocks, const struct timespec& now, const AddressAndPortRange& requestor, const DynBlockRule& rule, bool& updated, bool warning);
+ void addOrRefreshBlockSMT(SuffixMatchTree<DynBlock>& blocks, const struct timespec& now, const DNSName& name, const DynBlockRule& rule, bool& updated);
+
+ void addBlock(boost::optional<NetmaskTree<DynBlock, AddressAndPortRange> >& blocks, const struct timespec& now, const AddressAndPortRange& requestor, const DynBlockRule& rule, bool& updated)
+ {
+ addOrRefreshBlock(blocks, now, requestor, rule, updated, false);
+ }
+
+ void handleWarning(boost::optional<NetmaskTree<DynBlock, AddressAndPortRange> >& blocks, const struct timespec& now, const AddressAndPortRange& requestor, const DynBlockRule& rule, bool& updated)
+ {
+ addOrRefreshBlock(blocks, now, requestor, rule, updated, true);
+ }
+
+ bool hasQueryRules() const
+ {
+ return d_queryRateRule.isEnabled() || !d_qtypeRules.empty();
+ }
+
+ bool hasResponseRules() const
+ {
+ return d_respRateRule.isEnabled() || !d_rcodeRules.empty() || !d_rcodeRatioRules.empty();
+ }
+
+ bool hasSuffixMatchRules() const
+ {
+ return d_suffixMatchRule.isEnabled();
+ }
+
+ bool hasRules() const
+ {
+ return hasQueryRules() || hasResponseRules();
+ }
+
+ void processQueryRules(counts_t& counts, const struct timespec& now);
+ void processResponseRules(counts_t& counts, StatNode& root, const struct timespec& now);
+
+ std::map<uint8_t, DynBlockRule> d_rcodeRules;
+ std::map<uint8_t, DynBlockRatioRule> d_rcodeRatioRules;
+ std::map<uint16_t, DynBlockRule> d_qtypeRules;
+ DynBlockRule d_queryRateRule;
+ DynBlockRule d_respRateRule;
+ DynBlockRule d_suffixMatchRule;
+ NetmaskGroup d_excludedSubnets;
+ SuffixMatchNode d_excludedDomains;
+ smtVisitor_t d_smtVisitor;
+ dnsdist_ffi_stat_node_visitor_t d_smtVisitorFFI;
+ uint8_t d_v6Mask{128};
+ uint8_t d_v4Mask{32};
+ uint8_t d_portMask{0};
+ bool d_beQuiet{false};
+};
+
+class DynBlockMaintenance
+{
+public:
+ static void run();
+
+ /* return the (cached) number of hits per second for the top offenders, averaged over 60s */
+ static std::map<std::string, std::list<std::pair<AddressAndPortRange, unsigned int>>> getHitsForTopNetmasks();
+ static std::map<std::string, std::list<std::pair<DNSName, unsigned int>>> getHitsForTopSuffixes();
+
+ /* get the the top offenders based on the current value of the counters */
+ static std::map<std::string, std::list<std::pair<AddressAndPortRange, unsigned int>>> getTopNetmasks(size_t topN);
+ static std::map<std::string, std::list<std::pair<DNSName, unsigned int>>> getTopSuffixes(size_t topN);
+ static void purgeExpired(const struct timespec& now);
+
+ static time_t s_expiredDynBlocksPurgeInterval;
+
+private:
+ static void collectMetrics();
+ static void generateMetrics();
+
+ struct MetricsSnapshot
+ {
+ std::map<std::string, std::list<std::pair<AddressAndPortRange, unsigned int>>> nmgData;
+ std::map<std::string, std::list<std::pair<DNSName, unsigned int>>> smtData;
+ };
+
+ struct Tops
+ {
+ std::map<std::string, std::list<std::pair<AddressAndPortRange, unsigned int>>> topNMGsByReason;
+ std::map<std::string, std::list<std::pair<DNSName, unsigned int>>> topSMTsByReason;
+ };
+
+ static LockGuarded<Tops> s_tops;
+ /* s_metricsData should only be accessed by the dynamic blocks maintenance thread so it does not need a lock */
+ // need N+1 datapoints to be able to do the diff after a collection point has been reached
+ static std::list<MetricsSnapshot> s_metricsData;
+ static size_t s_topN;
+};
diff --git a/dnsdist-dynbpf.cc b/dnsdist-dynbpf.cc
new file mode 100644
index 0000000..ec549c3
--- /dev/null
+++ b/dnsdist-dynbpf.cc
@@ -0,0 +1,85 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsdist-dynbpf.hh"
+
+bool DynBPFFilter::block(const ComboAddress& addr, const struct timespec& until)
+{
+ bool inserted = false;
+ auto data = d_data.lock();
+
+ if (data->d_excludedSubnets.match(addr)) {
+ /* do not add a block for excluded subnets */
+ return inserted;
+ }
+
+ const container_t::iterator it = data->d_entries.find(addr);
+ if (it != data->d_entries.end()) {
+ if (it->d_until < until) {
+ data->d_entries.replace(it, BlockEntry(addr, until));
+ }
+ }
+ else {
+ data->d_bpf->block(addr, BPFFilter::MatchAction::Drop);
+ data->d_entries.insert(BlockEntry(addr, until));
+ inserted = true;
+ }
+ return inserted;
+}
+
+void DynBPFFilter::purgeExpired(const struct timespec& now)
+{
+ auto data = d_data.lock();
+
+ typedef nth_index<container_t,1>::type ordered_until;
+ ordered_until& ou = get<1>(data->d_entries);
+
+ for (ordered_until::iterator it = ou.begin(); it != ou.end(); ) {
+ if (it->d_until < now) {
+ ComboAddress addr = it->d_addr;
+ it = ou.erase(it);
+ data->d_bpf->unblock(addr);
+ }
+ else {
+ break;
+ }
+ }
+}
+
+std::vector<std::tuple<ComboAddress, uint64_t, struct timespec> > DynBPFFilter::getAddrStats()
+{
+ std::vector<std::tuple<ComboAddress, uint64_t, struct timespec> > result;
+ auto data = d_data.lock();
+
+ if (!data->d_bpf) {
+ return result;
+ }
+
+ const auto& stats = data->d_bpf->getAddrStats();
+ result.reserve(stats.size());
+ for (const auto& stat : stats) {
+ const container_t::iterator it = data->d_entries.find(stat.first);
+ if (it != data->d_entries.end()) {
+ result.push_back(std::make_tuple(stat.first, stat.second, it->d_until));
+ }
+ }
+ return result;
+}
diff --git a/dnsdist-dynbpf.hh b/dnsdist-dynbpf.hh
new file mode 100644
index 0000000..afe7796
--- /dev/null
+++ b/dnsdist-dynbpf.hh
@@ -0,0 +1,75 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "config.h"
+
+#include "bpf-filter.hh"
+#include "iputils.hh"
+
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+
+class DynBPFFilter
+{
+public:
+ DynBPFFilter(std::shared_ptr<BPFFilter>& bpf)
+ {
+ d_data.lock()->d_bpf = bpf;
+ }
+ ~DynBPFFilter()
+ {
+ }
+ void excludeRange(const Netmask& range)
+ {
+ d_data.lock()->d_excludedSubnets.addMask(range);
+ }
+ void includeRange(const Netmask& range)
+ {
+ d_data.lock()->d_excludedSubnets.addMask(range, false);
+ }
+ /* returns true if the addr wasn't already blocked, false otherwise */
+ bool block(const ComboAddress& addr, const struct timespec& until);
+ void purgeExpired(const struct timespec& now);
+ std::vector<std::tuple<ComboAddress, uint64_t, struct timespec> > getAddrStats();
+private:
+ struct BlockEntry
+ {
+ BlockEntry(const ComboAddress& addr, const struct timespec until): d_addr(addr), d_until(until)
+ {
+ }
+ ComboAddress d_addr;
+ struct timespec d_until;
+ };
+ typedef multi_index_container<BlockEntry,
+ indexed_by <
+ ordered_unique< member<BlockEntry,ComboAddress,&BlockEntry::d_addr>, ComboAddress::addressOnlyLessThan >,
+ ordered_non_unique< member<BlockEntry,struct timespec,&BlockEntry::d_until> >
+ >
+ > container_t;
+ struct Data {
+ container_t d_entries;
+ std::shared_ptr<BPFFilter> d_bpf{nullptr};
+ NetmaskGroup d_excludedSubnets;
+ };
+ LockGuarded<Data> d_data;
+};
+
diff --git a/dnsdist-ecs.cc b/dnsdist-ecs.cc
new file mode 100644
index 0000000..e4e3bd6
--- /dev/null
+++ b/dnsdist-ecs.cc
@@ -0,0 +1,1070 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dolog.hh"
+#include "dnsdist.hh"
+#include "dnsdist-ecs.hh"
+#include "dnsparser.hh"
+#include "dnswriter.hh"
+#include "ednsoptions.hh"
+#include "ednssubnet.hh"
+
+/* when we add EDNS to a query, we don't want to advertise
+ a large buffer size */
+size_t g_EdnsUDPPayloadSize = 512;
+static const uint16_t defaultPayloadSizeSelfGenAnswers = 1232;
+static_assert(defaultPayloadSizeSelfGenAnswers < s_udpIncomingBufferSize, "The UDP responder's payload size should be smaller or equal to our incoming buffer size");
+uint16_t g_PayloadSizeSelfGenAnswers{defaultPayloadSizeSelfGenAnswers};
+
+/* draft-ietf-dnsop-edns-client-subnet-04 "11.1. Privacy" */
+uint16_t g_ECSSourcePrefixV4 = 24;
+uint16_t g_ECSSourcePrefixV6 = 56;
+
+bool g_ECSOverride{false};
+bool g_addEDNSToSelfGeneratedResponses{true};
+
+int rewriteResponseWithoutEDNS(const PacketBuffer& initialPacket, PacketBuffer& newContent)
+{
+ assert(initialPacket.size() >= sizeof(dnsheader));
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(initialPacket.data());
+
+ if (ntohs(dh->arcount) == 0)
+ return ENOENT;
+
+ if (ntohs(dh->qdcount) == 0)
+ return ENOENT;
+
+ PacketReader pr(pdns_string_view(reinterpret_cast<const char*>(initialPacket.data()), initialPacket.size()));
+
+ size_t idx = 0;
+ DNSName rrname;
+ uint16_t qdcount = ntohs(dh->qdcount);
+ uint16_t ancount = ntohs(dh->ancount);
+ uint16_t nscount = ntohs(dh->nscount);
+ uint16_t arcount = ntohs(dh->arcount);
+ uint16_t rrtype;
+ uint16_t rrclass;
+ string blob;
+ struct dnsrecordheader ah;
+
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+
+ GenericDNSPacketWriter<PacketBuffer> pw(newContent, rrname, rrtype, rrclass, dh->opcode);
+ pw.getHeader()->id=dh->id;
+ pw.getHeader()->qr=dh->qr;
+ pw.getHeader()->aa=dh->aa;
+ pw.getHeader()->tc=dh->tc;
+ pw.getHeader()->rd=dh->rd;
+ pw.getHeader()->ra=dh->ra;
+ pw.getHeader()->ad=dh->ad;
+ pw.getHeader()->cd=dh->cd;
+ pw.getHeader()->rcode=dh->rcode;
+
+ /* consume remaining qd if any */
+ if (qdcount > 1) {
+ for(idx = 1; idx < qdcount; idx++) {
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+ (void) rrtype;
+ (void) rrclass;
+ }
+ }
+
+ /* copy AN and NS */
+ for (idx = 0; idx < ancount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::ANSWER, true);
+ pr.xfrBlob(blob);
+ pw.xfrBlob(blob);
+ }
+
+ for (idx = 0; idx < nscount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::AUTHORITY, true);
+ pr.xfrBlob(blob);
+ pw.xfrBlob(blob);
+ }
+ /* consume AR, looking for OPT */
+ for (idx = 0; idx < arcount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ if (ah.d_type != QType::OPT) {
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::ADDITIONAL, true);
+ pr.xfrBlob(blob);
+ pw.xfrBlob(blob);
+ } else {
+
+ pr.skip(ah.d_clen);
+ }
+ }
+ pw.commit();
+
+ return 0;
+}
+
+static bool addOrReplaceEDNSOption(std::vector<std::pair<uint16_t, std::string>>& options, uint16_t optionCode, bool& optionAdded, bool overrideExisting, const string& newOptionContent)
+{
+ for (auto it = options.begin(); it != options.end(); ) {
+ if (it->first == optionCode) {
+ optionAdded = false;
+
+ if (!overrideExisting) {
+ return false;
+ }
+
+ it = options.erase(it);
+ }
+ else {
+ ++it;
+ }
+ }
+
+ options.emplace_back(optionCode, std::string(&newOptionContent.at(EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE), newOptionContent.size() - (EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE)));
+ return true;
+}
+
+bool slowRewriteEDNSOptionInQueryWithRecords(const PacketBuffer& initialPacket, PacketBuffer& newContent, bool& ednsAdded, uint16_t optionToReplace, bool& optionAdded, bool overrideExisting, const string& newOptionContent)
+{
+ assert(initialPacket.size() >= sizeof(dnsheader));
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(initialPacket.data());
+
+ if (ntohs(dh->qdcount) == 0) {
+ return false;
+ }
+
+ if (ntohs(dh->ancount) == 0 && ntohs(dh->nscount) == 0 && ntohs(dh->arcount) == 0) {
+ throw std::runtime_error(std::string(__PRETTY_FUNCTION__) + " should not be called for queries that have no records");
+ }
+
+ optionAdded = false;
+ ednsAdded = true;
+
+ PacketReader pr(pdns_string_view(reinterpret_cast<const char*>(initialPacket.data()), initialPacket.size()));
+
+ size_t idx = 0;
+ DNSName rrname;
+ uint16_t qdcount = ntohs(dh->qdcount);
+ uint16_t ancount = ntohs(dh->ancount);
+ uint16_t nscount = ntohs(dh->nscount);
+ uint16_t arcount = ntohs(dh->arcount);
+ uint16_t rrtype;
+ uint16_t rrclass;
+ string blob;
+ struct dnsrecordheader ah;
+
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+
+ GenericDNSPacketWriter<PacketBuffer> pw(newContent, rrname, rrtype, rrclass, dh->opcode);
+ pw.getHeader()->id=dh->id;
+ pw.getHeader()->qr=dh->qr;
+ pw.getHeader()->aa=dh->aa;
+ pw.getHeader()->tc=dh->tc;
+ pw.getHeader()->rd=dh->rd;
+ pw.getHeader()->ra=dh->ra;
+ pw.getHeader()->ad=dh->ad;
+ pw.getHeader()->cd=dh->cd;
+ pw.getHeader()->rcode=dh->rcode;
+
+ /* consume remaining qd if any */
+ if (qdcount > 1) {
+ for(idx = 1; idx < qdcount; idx++) {
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+ (void) rrtype;
+ (void) rrclass;
+ }
+ }
+
+ /* copy AN and NS */
+ for (idx = 0; idx < ancount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::ANSWER, true);
+ pr.xfrBlob(blob);
+ pw.xfrBlob(blob);
+ }
+
+ for (idx = 0; idx < nscount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::AUTHORITY, true);
+ pr.xfrBlob(blob);
+ pw.xfrBlob(blob);
+ }
+
+ /* consume AR, looking for OPT */
+ for (idx = 0; idx < arcount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ if (ah.d_type != QType::OPT) {
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::ADDITIONAL, true);
+ pr.xfrBlob(blob);
+ pw.xfrBlob(blob);
+ } else {
+
+ ednsAdded = false;
+ pr.xfrBlob(blob);
+
+ std::vector<std::pair<uint16_t, std::string>> options;
+ getEDNSOptionsFromContent(blob, options);
+
+ EDNS0Record edns0;
+ static_assert(sizeof(edns0) == sizeof(ah.d_ttl), "sizeof(EDNS0Record) must match sizeof(uint32_t) AKA RR TTL size");
+ memcpy(&edns0, &ah.d_ttl, sizeof(edns0));
+
+ /* addOrReplaceEDNSOption will set it to false if there is already an existing option */
+ optionAdded = true;
+ addOrReplaceEDNSOption(options, optionToReplace, optionAdded, overrideExisting, newOptionContent);
+ pw.addOpt(ah.d_class, edns0.extRCode, edns0.extFlags, options, edns0.version);
+ }
+ }
+
+ if (ednsAdded) {
+ pw.addOpt(g_EdnsUDPPayloadSize, 0, 0, {{optionToReplace, std::string(&newOptionContent.at(EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE), newOptionContent.size() - (EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE))}}, 0);
+ optionAdded = true;
+ }
+
+ pw.commit();
+
+ return true;
+}
+
+static bool slowParseEDNSOptions(const PacketBuffer& packet, std::shared_ptr<std::map<uint16_t, EDNSOptionView> >& options)
+{
+ if (packet.size() < sizeof(dnsheader)) {
+ return false;
+ }
+
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(packet.data());
+
+ if (ntohs(dh->qdcount) == 0) {
+ return false;
+ }
+
+ if (ntohs(dh->arcount) == 0) {
+ throw std::runtime_error("slowParseEDNSOptions() should not be called for queries that have no EDNS");
+ }
+
+ try {
+ uint64_t numrecords = ntohs(dh->ancount) + ntohs(dh->nscount) + ntohs(dh->arcount);
+ DNSPacketMangler dpm(const_cast<char*>(reinterpret_cast<const char*>(&packet.at(0))), packet.size());
+ uint64_t n;
+ for(n=0; n < ntohs(dh->qdcount) ; ++n) {
+ dpm.skipDomainName();
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+
+ for(n=0; n < numrecords; ++n) {
+ dpm.skipDomainName();
+
+ uint8_t section = n < ntohs(dh->ancount) ? 1 : (n < (ntohs(dh->ancount) + ntohs(dh->nscount)) ? 2 : 3);
+ uint16_t dnstype = dpm.get16BitInt();
+ dpm.get16BitInt();
+ dpm.skipBytes(4); /* TTL */
+
+ if(section == 3 && dnstype == QType::OPT) {
+ uint32_t offset = dpm.getOffset();
+ if (offset >= packet.size()) {
+ return false;
+ }
+ /* if we survive this call, we can parse it safely */
+ dpm.skipRData();
+ return getEDNSOptions(reinterpret_cast<const char*>(&packet.at(offset)), packet.size() - offset, *options) == 0;
+ }
+ else {
+ dpm.skipRData();
+ }
+ }
+ }
+ catch(...)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+int locateEDNSOptRR(const PacketBuffer& packet, uint16_t * optStart, size_t * optLen, bool * last)
+{
+ assert(optStart != NULL);
+ assert(optLen != NULL);
+ assert(last != NULL);
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(packet.data());
+
+ if (ntohs(dh->arcount) == 0)
+ return ENOENT;
+
+ PacketReader pr(pdns_string_view(reinterpret_cast<const char*>(packet.data()), packet.size()));
+
+ size_t idx = 0;
+ DNSName rrname;
+ uint16_t qdcount = ntohs(dh->qdcount);
+ uint16_t ancount = ntohs(dh->ancount);
+ uint16_t nscount = ntohs(dh->nscount);
+ uint16_t arcount = ntohs(dh->arcount);
+ uint16_t rrtype;
+ uint16_t rrclass;
+ struct dnsrecordheader ah;
+
+ /* consume qd */
+ for(idx = 0; idx < qdcount; idx++) {
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+ (void) rrtype;
+ (void) rrclass;
+ }
+
+ /* consume AN and NS */
+ for (idx = 0; idx < ancount + nscount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+ pr.skip(ah.d_clen);
+ }
+
+ /* consume AR, looking for OPT */
+ for (idx = 0; idx < arcount; idx++) {
+ uint16_t start = pr.getPosition();
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ if (ah.d_type == QType::OPT) {
+ *optStart = start;
+ *optLen = (pr.getPosition() - start) + ah.d_clen;
+
+ if (packet.size() < (*optStart + *optLen)) {
+ throw std::range_error("Opt record overflow");
+ }
+
+ if (idx == ((size_t) arcount - 1)) {
+ *last = true;
+ }
+ else {
+ *last = false;
+ }
+ return 0;
+ }
+ pr.skip(ah.d_clen);
+ }
+
+ return ENOENT;
+}
+
+/* extract the start of the OPT RR in a QUERY packet if any */
+int getEDNSOptionsStart(const PacketBuffer& packet, const size_t offset, uint16_t* optRDPosition, size_t* remaining)
+{
+ assert(optRDPosition != nullptr);
+ assert(remaining != nullptr);
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(packet.data());
+
+ if (offset >= packet.size()) {
+ return ENOENT;
+ }
+
+ if (ntohs(dh->qdcount) != 1 || ntohs(dh->ancount) != 0 || ntohs(dh->arcount) != 1 || ntohs(dh->nscount) != 0)
+ return ENOENT;
+
+ size_t pos = sizeof(dnsheader) + offset;
+ pos += DNS_TYPE_SIZE + DNS_CLASS_SIZE;
+
+ if (pos >= packet.size())
+ return ENOENT;
+
+ if ((pos + /* root */ 1 + DNS_TYPE_SIZE + DNS_CLASS_SIZE) >= packet.size()) {
+ return ENOENT;
+ }
+
+ if (packet[pos] != 0) {
+ /* not the root so not an OPT record */
+ return ENOENT;
+ }
+ pos += 1;
+
+ uint16_t qtype = packet.at(pos)*256 + packet.at(pos+1);
+ pos += DNS_TYPE_SIZE;
+ pos += DNS_CLASS_SIZE;
+
+ if (qtype != QType::OPT || (packet.size() - pos) < (DNS_TTL_SIZE + DNS_RDLENGTH_SIZE)) {
+ return ENOENT;
+ }
+
+ pos += DNS_TTL_SIZE;
+ *optRDPosition = pos;
+ *remaining = packet.size() - pos;
+
+ return 0;
+}
+
+void generateECSOption(const ComboAddress& source, string& res, uint16_t ECSPrefixLength)
+{
+ Netmask sourceNetmask(source, ECSPrefixLength);
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = sourceNetmask;
+ string payload = makeEDNSSubnetOptsString(ecsOpts);
+ generateEDNSOption(EDNSOptionCode::ECS, payload, res);
+}
+
+bool generateOptRR(const std::string& optRData, PacketBuffer& res, size_t maximumSize, uint16_t udpPayloadSize, uint8_t ednsrcode, bool dnssecOK)
+{
+ const uint8_t name = 0;
+ dnsrecordheader dh;
+ EDNS0Record edns0;
+ edns0.extRCode = ednsrcode;
+ edns0.version = 0;
+ edns0.extFlags = dnssecOK ? htons(EDNS_HEADER_FLAG_DO) : 0;
+
+ if ((maximumSize - res.size()) < (sizeof(name) + sizeof(dh) + optRData.length())) {
+ return false;
+ }
+
+ dh.d_type = htons(QType::OPT);
+ dh.d_class = htons(udpPayloadSize);
+ static_assert(sizeof(EDNS0Record) == sizeof(dh.d_ttl), "sizeof(EDNS0Record) must match sizeof(dnsrecordheader.d_ttl)");
+ memcpy(&dh.d_ttl, &edns0, sizeof edns0);
+ dh.d_clen = htons(static_cast<uint16_t>(optRData.length()));
+
+ res.reserve(res.size() + sizeof(name) + sizeof(dh) + optRData.length());
+ res.insert(res.end(), reinterpret_cast<const uint8_t*>(&name), reinterpret_cast<const uint8_t*>(&name) + sizeof(name));
+ res.insert(res.end(), reinterpret_cast<const uint8_t*>(&dh), reinterpret_cast<const uint8_t*>(&dh) + sizeof(dh));
+ res.insert(res.end(), reinterpret_cast<const uint8_t*>(optRData.data()), reinterpret_cast<const uint8_t*>(optRData.data()) + optRData.length());
+
+ return true;
+}
+
+static bool replaceEDNSClientSubnetOption(PacketBuffer& packet, size_t maximumSize, size_t const oldEcsOptionStartPosition, size_t const oldEcsOptionSize, size_t const optRDLenPosition, const string& newECSOption)
+{
+ assert(oldEcsOptionStartPosition < packet.size());
+ assert(optRDLenPosition < packet.size());
+
+ if (newECSOption.size() == oldEcsOptionSize) {
+ /* same size as the existing option */
+ memcpy(&packet.at(oldEcsOptionStartPosition), newECSOption.c_str(), oldEcsOptionSize);
+ }
+ else {
+ /* different size than the existing option */
+ const unsigned int newPacketLen = packet.size() + (newECSOption.length() - oldEcsOptionSize);
+ const size_t beforeOptionLen = oldEcsOptionStartPosition;
+ const size_t dataBehindSize = packet.size() - beforeOptionLen - oldEcsOptionSize;
+
+ /* check that it fits in the existing buffer */
+ if (newPacketLen > packet.size()) {
+ if (newPacketLen > maximumSize) {
+ return false;
+ }
+
+ packet.resize(newPacketLen);
+ }
+
+ /* fix the size of ECS Option RDLen */
+ uint16_t newRDLen = (packet.at(optRDLenPosition) * 256) + packet.at(optRDLenPosition + 1);
+ newRDLen += (newECSOption.size() - oldEcsOptionSize);
+ packet.at(optRDLenPosition) = newRDLen / 256;
+ packet.at(optRDLenPosition + 1) = newRDLen % 256;
+
+ if (dataBehindSize > 0) {
+ memmove(&packet.at(oldEcsOptionStartPosition), &packet.at(oldEcsOptionStartPosition + oldEcsOptionSize), dataBehindSize);
+ }
+ memcpy(&packet.at(oldEcsOptionStartPosition + dataBehindSize), newECSOption.c_str(), newECSOption.size());
+ packet.resize(newPacketLen);
+ }
+
+ return true;
+}
+
+/* This function looks for an OPT RR, return true if a valid one was found (even if there was no options)
+ and false otherwise. */
+bool parseEDNSOptions(const DNSQuestion& dq)
+{
+ const auto dh = dq.getHeader();
+ if (dq.ednsOptions != nullptr) {
+ return true;
+ }
+
+ dq.ednsOptions = std::make_shared<std::map<uint16_t, EDNSOptionView> >();
+
+ if (ntohs(dh->arcount) == 0) {
+ /* nothing in additional so no EDNS */
+ return false;
+ }
+
+ if (ntohs(dh->ancount) != 0 || ntohs(dh->nscount) != 0 || ntohs(dh->arcount) > 1) {
+ return slowParseEDNSOptions(dq.getData(), dq.ednsOptions);
+ }
+
+ size_t remaining = 0;
+ uint16_t optRDPosition;
+ int res = getEDNSOptionsStart(dq.getData(), dq.qname->wirelength(), &optRDPosition, &remaining);
+
+ if (res == 0) {
+ res = getEDNSOptions(reinterpret_cast<const char*>(&dq.getData().at(optRDPosition)), remaining, *dq.ednsOptions);
+ return (res == 0);
+ }
+
+ return false;
+}
+
+static bool addECSToExistingOPT(PacketBuffer& packet, size_t maximumSize, const string& newECSOption, size_t optRDLenPosition, bool& ecsAdded)
+{
+ /* we need to add one EDNS0 ECS option, fixing the size of EDNS0 RDLENGTH */
+ /* getEDNSOptionsStart has already checked that there is exactly one AR,
+ no NS and no AN */
+ uint16_t oldRDLen = (packet.at(optRDLenPosition) * 256) + packet.at(optRDLenPosition + 1);
+ if (packet.size() != (optRDLenPosition + sizeof(uint16_t) + oldRDLen)) {
+ /* we are supposed to be the last record, do we have some trailing data to remove? */
+ uint32_t realPacketLen = getDNSPacketLength(reinterpret_cast<const char*>(packet.data()), packet.size());
+ packet.resize(realPacketLen);
+ }
+
+ if ((maximumSize - packet.size()) < newECSOption.size()) {
+ return false;
+ }
+
+ uint16_t newRDLen = oldRDLen + newECSOption.size();
+ packet.at(optRDLenPosition) = newRDLen / 256;
+ packet.at(optRDLenPosition + 1) = newRDLen % 256;
+
+ packet.insert(packet.end(), newECSOption.begin(), newECSOption.end());
+ ecsAdded = true;
+
+ return true;
+}
+
+static bool addEDNSWithECS(PacketBuffer& packet, size_t maximumSize, const string& newECSOption, bool& ednsAdded, bool& ecsAdded)
+{
+ if (!generateOptRR(newECSOption, packet, maximumSize, g_EdnsUDPPayloadSize, 0, false)) {
+ return false;
+ }
+
+ struct dnsheader* dh = reinterpret_cast<struct dnsheader*>(packet.data());
+ uint16_t arcount = ntohs(dh->arcount);
+ arcount++;
+ dh->arcount = htons(arcount);
+ ednsAdded = true;
+ ecsAdded = true;
+
+ return true;
+}
+
+bool handleEDNSClientSubnet(PacketBuffer& packet, const size_t maximumSize, const size_t qnameWireLength, bool& ednsAdded, bool& ecsAdded, bool overrideExisting, const string& newECSOption)
+{
+ assert(qnameWireLength <= packet.size());
+
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(packet.data());
+
+ if (ntohs(dh->ancount) != 0 || ntohs(dh->nscount) != 0 || (ntohs(dh->arcount) != 0 && ntohs(dh->arcount) != 1)) {
+ PacketBuffer newContent;
+ newContent.reserve(packet.size());
+
+ if (!slowRewriteEDNSOptionInQueryWithRecords(packet, newContent, ednsAdded, EDNSOptionCode::ECS, ecsAdded, overrideExisting, newECSOption)) {
+ return false;
+ }
+
+ if (newContent.size() > maximumSize) {
+ ednsAdded = false;
+ ecsAdded = false;
+ return false;
+ }
+
+ packet = std::move(newContent);
+ return true;
+ }
+
+ uint16_t optRDPosition = 0;
+ size_t remaining = 0;
+
+ int res = getEDNSOptionsStart(packet, qnameWireLength, &optRDPosition, &remaining);
+
+ if (res != 0) {
+ /* no EDNS but there might be another record in additional (TSIG?) */
+ /* Careful, this code assumes that ANCOUNT == 0 && NSCOUNT == 0 */
+ size_t minimumPacketSize = sizeof(dnsheader) + qnameWireLength + sizeof(uint16_t) + sizeof(uint16_t);
+ if (packet.size() > minimumPacketSize) {
+ if (ntohs(dh->arcount) == 0) {
+ /* well now.. */
+ packet.resize(minimumPacketSize);
+ }
+ else {
+ uint32_t realPacketLen = getDNSPacketLength(reinterpret_cast<const char*>(packet.data()), packet.size());
+ packet.resize(realPacketLen);
+ }
+ }
+
+ return addEDNSWithECS(packet, maximumSize, newECSOption, ednsAdded, ecsAdded);
+ }
+
+ size_t ecsOptionStartPosition = 0;
+ size_t ecsOptionSize = 0;
+
+ res = getEDNSOption(reinterpret_cast<const char*>(&packet.at(optRDPosition)), remaining, EDNSOptionCode::ECS, &ecsOptionStartPosition, &ecsOptionSize);
+
+ if (res == 0) {
+ /* there is already an ECS value */
+ if (!overrideExisting) {
+ return true;
+ }
+
+ return replaceEDNSClientSubnetOption(packet, maximumSize, optRDPosition + ecsOptionStartPosition, ecsOptionSize, optRDPosition, newECSOption);
+ } else {
+ /* we have an EDNS OPT RR but no existing ECS option */
+ return addECSToExistingOPT(packet, maximumSize, newECSOption, optRDPosition, ecsAdded);
+ }
+
+ return true;
+}
+
+bool handleEDNSClientSubnet(DNSQuestion& dq, bool& ednsAdded, bool& ecsAdded)
+{
+ assert(dq.remote != nullptr);
+ string newECSOption;
+ generateECSOption(dq.ecsSet ? dq.ecs.getNetwork() : *dq.remote, newECSOption, dq.ecsSet ? dq.ecs.getBits() : dq.ecsPrefixLength);
+
+ return handleEDNSClientSubnet(dq.getMutableData(), dq.getMaximumSize(), dq.qname->wirelength(), ednsAdded, ecsAdded, dq.ecsOverride, newECSOption);
+}
+
+static int removeEDNSOptionFromOptions(unsigned char* optionsStart, const uint16_t optionsLen, const uint16_t optionCodeToRemove, uint16_t* newOptionsLen)
+{
+ unsigned char* p = optionsStart;
+ size_t pos = 0;
+ while ((pos + 4) <= optionsLen) {
+ unsigned char* optionBegin = p;
+ const uint16_t optionCode = 0x100*p[0] + p[1];
+ p += sizeof(optionCode);
+ pos += sizeof(optionCode);
+ const uint16_t optionLen = 0x100*p[0] + p[1];
+ p += sizeof(optionLen);
+ pos += sizeof(optionLen);
+ if ((pos + optionLen) > optionsLen) {
+ return EINVAL;
+ }
+ if (optionCode == optionCodeToRemove) {
+ if (pos + optionLen < optionsLen) {
+ /* move remaining options over the removed one,
+ if any */
+ memmove(optionBegin, p + optionLen, optionsLen - (pos + optionLen));
+ }
+ *newOptionsLen = optionsLen - (sizeof(optionCode) + sizeof(optionLen) + optionLen);
+ return 0;
+ }
+ p += optionLen;
+ pos += optionLen;
+ }
+ return ENOENT;
+}
+
+int removeEDNSOptionFromOPT(char* optStart, size_t* optLen, const uint16_t optionCodeToRemove)
+{
+ if (*optLen < optRecordMinimumSize) {
+ return EINVAL;
+ }
+ const unsigned char* end = (const unsigned char*) optStart + *optLen;
+ unsigned char* p = (unsigned char*) optStart + 9;
+ unsigned char* rdLenPtr = p;
+ uint16_t rdLen = (0x100*p[0] + p[1]);
+ p += sizeof(rdLen);
+ if (p + rdLen != end) {
+ return EINVAL;
+ }
+ uint16_t newRdLen = 0;
+ int res = removeEDNSOptionFromOptions(p, rdLen, optionCodeToRemove, &newRdLen);
+ if (res != 0) {
+ return res;
+ }
+ *optLen -= (rdLen - newRdLen);
+ rdLenPtr[0] = newRdLen / 0x100;
+ rdLenPtr[1] = newRdLen % 0x100;
+ return 0;
+}
+
+bool isEDNSOptionInOpt(const PacketBuffer& packet, const size_t optStart, const size_t optLen, const uint16_t optionCodeToFind, size_t* optContentStart, uint16_t* optContentLen)
+{
+ if (optLen < optRecordMinimumSize) {
+ return false;
+ }
+ size_t p = optStart + 9;
+ uint16_t rdLen = (0x100*static_cast<unsigned char>(packet.at(p)) + static_cast<unsigned char>(packet.at(p+1)));
+ p += sizeof(rdLen);
+ if (rdLen > (optLen - optRecordMinimumSize)) {
+ return false;
+ }
+
+ size_t rdEnd = p + rdLen;
+ while ((p + 4) <= rdEnd) {
+ const uint16_t optionCode = 0x100*static_cast<unsigned char>(packet.at(p)) + static_cast<unsigned char>(packet.at(p+1));
+ p += sizeof(optionCode);
+ const uint16_t optionLen = 0x100*static_cast<unsigned char>(packet.at(p)) + static_cast<unsigned char>(packet.at(p+1));
+ p += sizeof(optionLen);
+
+ if ((p + optionLen) > rdEnd) {
+ return false;
+ }
+
+ if (optionCode == optionCodeToFind) {
+ if (optContentStart != nullptr) {
+ *optContentStart = p;
+ }
+
+ if (optContentLen != nullptr) {
+ *optContentLen = optionLen;
+ }
+
+ return true;
+ }
+ p += optionLen;
+ }
+ return false;
+}
+
+int rewriteResponseWithoutEDNSOption(const PacketBuffer& initialPacket, const uint16_t optionCodeToSkip, PacketBuffer& newContent)
+{
+ assert(initialPacket.size() >= sizeof(dnsheader));
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(initialPacket.data());
+
+ if (ntohs(dh->arcount) == 0)
+ return ENOENT;
+
+ if (ntohs(dh->qdcount) == 0)
+ return ENOENT;
+
+ PacketReader pr(pdns_string_view(reinterpret_cast<const char*>(initialPacket.data()), initialPacket.size()));
+
+ size_t idx = 0;
+ DNSName rrname;
+ uint16_t qdcount = ntohs(dh->qdcount);
+ uint16_t ancount = ntohs(dh->ancount);
+ uint16_t nscount = ntohs(dh->nscount);
+ uint16_t arcount = ntohs(dh->arcount);
+ uint16_t rrtype;
+ uint16_t rrclass;
+ string blob;
+ struct dnsrecordheader ah;
+
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+
+ GenericDNSPacketWriter<PacketBuffer> pw(newContent, rrname, rrtype, rrclass, dh->opcode);
+ pw.getHeader()->id=dh->id;
+ pw.getHeader()->qr=dh->qr;
+ pw.getHeader()->aa=dh->aa;
+ pw.getHeader()->tc=dh->tc;
+ pw.getHeader()->rd=dh->rd;
+ pw.getHeader()->ra=dh->ra;
+ pw.getHeader()->ad=dh->ad;
+ pw.getHeader()->cd=dh->cd;
+ pw.getHeader()->rcode=dh->rcode;
+
+ /* consume remaining qd if any */
+ if (qdcount > 1) {
+ for(idx = 1; idx < qdcount; idx++) {
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+ (void) rrtype;
+ (void) rrclass;
+ }
+ }
+
+ /* copy AN and NS */
+ for (idx = 0; idx < ancount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::ANSWER, true);
+ pr.xfrBlob(blob);
+ pw.xfrBlob(blob);
+ }
+
+ for (idx = 0; idx < nscount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::AUTHORITY, true);
+ pr.xfrBlob(blob);
+ pw.xfrBlob(blob);
+ }
+
+ /* consume AR, looking for OPT */
+ for (idx = 0; idx < arcount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ if (ah.d_type != QType::OPT) {
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::ADDITIONAL, true);
+ pr.xfrBlob(blob);
+ pw.xfrBlob(blob);
+ } else {
+ pw.startRecord(rrname, ah.d_type, ah.d_ttl, ah.d_class, DNSResourceRecord::ADDITIONAL, false);
+ pr.xfrBlob(blob);
+ uint16_t rdLen = blob.length();
+ removeEDNSOptionFromOptions((unsigned char*)blob.c_str(), rdLen, optionCodeToSkip, &rdLen);
+ /* xfrBlob(string, size) completely ignores size.. */
+ if (rdLen > 0) {
+ blob.resize((size_t)rdLen);
+ pw.xfrBlob(blob);
+ } else {
+ pw.commit();
+ }
+ }
+ }
+ pw.commit();
+
+ return 0;
+}
+
+bool addEDNS(PacketBuffer& packet, size_t maximumSize, bool dnssecOK, uint16_t payloadSize, uint8_t ednsrcode)
+{
+ if (!generateOptRR(std::string(), packet, maximumSize, payloadSize, ednsrcode, dnssecOK)) {
+ return false;
+ }
+
+ auto dh = reinterpret_cast<dnsheader*>(packet.data());
+ dh->arcount = htons(ntohs(dh->arcount) + 1);
+
+ return true;
+}
+
+/*
+ This function keeps the existing header and DNSSECOK bit (if any) but wipes anything else,
+ generating a NXD or NODATA answer with a SOA record in the additional section.
+*/
+bool setNegativeAndAdditionalSOA(DNSQuestion& dq, bool nxd, const DNSName& zone, uint32_t ttl, const DNSName& mname, const DNSName& rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum)
+{
+ auto& packet = dq.getMutableData();
+ auto dh = dq.getHeader();
+ if (ntohs(dh->qdcount) != 1) {
+ return false;
+ }
+
+ size_t queryPartSize = sizeof(dnsheader) + dq.qname->wirelength() + DNS_TYPE_SIZE + DNS_CLASS_SIZE;
+ if (packet.size() < queryPartSize) {
+ /* something is already wrong, don't build on flawed foundations */
+ return false;
+ }
+
+ uint16_t qtype = htons(QType::SOA);
+ uint16_t qclass = htons(QClass::IN);
+ uint16_t rdLength = mname.wirelength() + rname.wirelength() + sizeof(serial) + sizeof(refresh) + sizeof(retry) + sizeof(expire) + sizeof(minimum);
+ size_t soaSize = zone.wirelength() + sizeof(qtype) + sizeof(qclass) + sizeof(ttl) + sizeof(rdLength) + rdLength;
+ bool hadEDNS = false;
+ bool dnssecOK = false;
+
+ if (g_addEDNSToSelfGeneratedResponses) {
+ uint16_t payloadSize = 0;
+ uint16_t z = 0;
+ hadEDNS = getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(packet.data()), packet.size(), &payloadSize, &z);
+ if (hadEDNS) {
+ dnssecOK = z & EDNS_HEADER_FLAG_DO;
+ }
+ }
+
+ /* chop off everything after the question */
+ packet.resize(queryPartSize);
+ dh = dq.getHeader();
+ if (nxd) {
+ dh->rcode = RCode::NXDomain;
+ }
+ else {
+ dh->rcode = RCode::NoError;
+ }
+ dh->qr = true;
+ dh->ancount = 0;
+ dh->nscount = 0;
+ dh->arcount = 0;
+
+ rdLength = htons(rdLength);
+ ttl = htonl(ttl);
+ serial = htonl(serial);
+ refresh = htonl(refresh);
+ retry = htonl(retry);
+ expire = htonl(expire);
+ minimum = htonl(minimum);
+
+ std::string soa;
+ soa.reserve(soaSize);
+ soa.append(zone.toDNSString());
+ soa.append(reinterpret_cast<const char*>(&qtype), sizeof(qtype));
+ soa.append(reinterpret_cast<const char*>(&qclass), sizeof(qclass));
+ soa.append(reinterpret_cast<const char*>(&ttl), sizeof(ttl));
+ soa.append(reinterpret_cast<const char*>(&rdLength), sizeof(rdLength));
+ soa.append(mname.toDNSString());
+ soa.append(rname.toDNSString());
+ soa.append(reinterpret_cast<const char*>(&serial), sizeof(serial));
+ soa.append(reinterpret_cast<const char*>(&refresh), sizeof(refresh));
+ soa.append(reinterpret_cast<const char*>(&retry), sizeof(retry));
+ soa.append(reinterpret_cast<const char*>(&expire), sizeof(expire));
+ soa.append(reinterpret_cast<const char*>(&minimum), sizeof(minimum));
+
+ if (soa.size() != soaSize) {
+ throw std::runtime_error("Unexpected SOA response size: " + std::to_string(soa.size()) + " vs " + std::to_string(soaSize));
+ }
+
+ packet.insert(packet.end(), soa.begin(), soa.end());
+ dh = dq.getHeader();
+ dh->arcount = htons(1);
+
+ if (hadEDNS) {
+ /* now we need to add a new OPT record */
+ return addEDNS(packet, dq.getMaximumSize(), dnssecOK, g_PayloadSizeSelfGenAnswers, dq.ednsRCode);
+ }
+
+ return true;
+}
+
+bool addEDNSToQueryTurnedResponse(DNSQuestion& dq)
+{
+ uint16_t optRDPosition;
+ /* remaining is at least the size of the rdlen + the options if any + the following records if any */
+ size_t remaining = 0;
+
+ auto& packet = dq.getMutableData();
+ int res = getEDNSOptionsStart(packet, dq.qname->wirelength(), &optRDPosition, &remaining);
+
+ if (res != 0) {
+ /* if the initial query did not have EDNS0, we are done */
+ return true;
+ }
+
+ const size_t existingOptLen = /* root */ 1 + DNS_TYPE_SIZE + DNS_CLASS_SIZE + EDNS_EXTENDED_RCODE_SIZE + EDNS_VERSION_SIZE + /* Z */ 2 + remaining;
+ if (existingOptLen >= packet.size()) {
+ /* something is wrong, bail out */
+ return false;
+ }
+
+ uint8_t* optRDLen = &packet.at(optRDPosition);
+ uint8_t* optPtr = (optRDLen - (/* root */ 1 + DNS_TYPE_SIZE + DNS_CLASS_SIZE + EDNS_EXTENDED_RCODE_SIZE + EDNS_VERSION_SIZE + /* Z */ 2));
+
+ const uint8_t* zPtr = optPtr + /* root */ 1 + DNS_TYPE_SIZE + DNS_CLASS_SIZE + EDNS_EXTENDED_RCODE_SIZE + EDNS_VERSION_SIZE;
+ uint16_t z = 0x100 * (*zPtr) + *(zPtr + 1);
+ bool dnssecOK = z & EDNS_HEADER_FLAG_DO;
+
+ /* remove the existing OPT record, and everything else that follows (any SIG or TSIG would be useless anyway) */
+ packet.resize(packet.size() - existingOptLen);
+ dq.getHeader()->arcount = 0;
+
+ if (g_addEDNSToSelfGeneratedResponses) {
+ /* now we need to add a new OPT record */
+ return addEDNS(packet, dq.getMaximumSize(), dnssecOK, g_PayloadSizeSelfGenAnswers, dq.ednsRCode);
+ }
+
+ /* otherwise we are just fine */
+ return true;
+}
+
+// goal in life - if you send us a reasonably normal packet, we'll get Z for you, otherwise 0
+int getEDNSZ(const DNSQuestion& dq)
+{
+ try
+ {
+ const auto& dh = dq.getHeader();
+ if (ntohs(dh->qdcount) != 1 || dh->ancount != 0 || ntohs(dh->arcount) != 1 || dh->nscount != 0) {
+ return 0;
+ }
+
+ if (dq.getData().size() <= sizeof(dnsheader)) {
+ return 0;
+ }
+
+ size_t pos = sizeof(dnsheader) + dq.qname->wirelength() + DNS_TYPE_SIZE + DNS_CLASS_SIZE;
+
+ if (dq.getData().size() <= (pos + /* root */ 1 + DNS_TYPE_SIZE + DNS_CLASS_SIZE)) {
+ return 0;
+ }
+
+ auto& packet = dq.getData();
+
+ if (packet.at(pos) != 0) {
+ /* not root, so not a valid OPT record */
+ return 0;
+ }
+
+ pos++;
+
+ uint16_t qtype = packet.at(pos)*256 + packet.at(pos+1);
+ pos += DNS_TYPE_SIZE;
+ pos += DNS_CLASS_SIZE;
+
+ if (qtype != QType::OPT || (pos + EDNS_EXTENDED_RCODE_SIZE + EDNS_VERSION_SIZE + 1) >= packet.size()) {
+ return 0;
+ }
+
+ const uint8_t* z = &packet.at(pos + EDNS_EXTENDED_RCODE_SIZE + EDNS_VERSION_SIZE);
+ return 0x100 * (*z) + *(z+1);
+ }
+ catch(...)
+ {
+ return 0;
+ }
+}
+
+bool queryHasEDNS(const DNSQuestion& dq)
+{
+ uint16_t optRDPosition;
+ size_t ecsRemaining = 0;
+
+ int res = getEDNSOptionsStart(dq.getData(), dq.qname->wirelength(), &optRDPosition, &ecsRemaining);
+ if (res == 0) {
+ return true;
+ }
+
+ return false;
+}
+
+bool getEDNS0Record(const DNSQuestion& dq, EDNS0Record& edns0)
+{
+ uint16_t optStart;
+ size_t optLen = 0;
+ bool last = false;
+ const auto& packet = dq.getData();
+ int res = locateEDNSOptRR(packet, &optStart, &optLen, &last);
+ if (res != 0) {
+ // no EDNS OPT RR
+ return false;
+ }
+
+ if (optLen < optRecordMinimumSize) {
+ return false;
+ }
+
+ if (optStart < packet.size() && packet.at(optStart) != 0) {
+ // OPT RR Name != '.'
+ return false;
+ }
+
+ static_assert(sizeof(EDNS0Record) == sizeof(uint32_t), "sizeof(EDNS0Record) must match sizeof(uint32_t) AKA RR TTL size");
+ // copy out 4-byte "ttl" (really the EDNS0 record), after root label (1) + type (2) + class (2).
+ memcpy(&edns0, &packet.at(optStart + 5), sizeof edns0);
+ return true;
+}
diff --git a/dnsdist-ecs.hh b/dnsdist-ecs.hh
new file mode 100644
index 0000000..89e6237
--- /dev/null
+++ b/dnsdist-ecs.hh
@@ -0,0 +1,50 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+// root label (1), type (2), class (2), ttl (4) + rdlen (2)
+static const size_t optRecordMinimumSize = 11;
+
+extern size_t g_EdnsUDPPayloadSize;
+extern uint16_t g_PayloadSizeSelfGenAnswers;
+
+int rewriteResponseWithoutEDNS(const PacketBuffer& initialPacket, PacketBuffer& newContent);
+bool slowRewriteEDNSOptionInQueryWithRecords(const PacketBuffer& initialPacket, PacketBuffer& newContent, bool& ednsAdded, uint16_t optionToReplace, bool& optionAdded, bool overrideExisting, const string& newOptionContent);
+int locateEDNSOptRR(const PacketBuffer & packet, uint16_t * optStart, size_t * optLen, bool * last);
+bool generateOptRR(const std::string& optRData, PacketBuffer& res, size_t maximumSize, uint16_t udpPayloadSize, uint8_t ednsrcode, bool dnssecOK);
+void generateECSOption(const ComboAddress& source, string& res, uint16_t ECSPrefixLength);
+int removeEDNSOptionFromOPT(char* optStart, size_t* optLen, const uint16_t optionCodeToRemove);
+int rewriteResponseWithoutEDNSOption(const PacketBuffer& initialPacket, const uint16_t optionCodeToSkip, PacketBuffer& newContent);
+int getEDNSOptionsStart(const PacketBuffer& packet, const size_t offset, uint16_t* optRDPosition, size_t * remaining);
+bool isEDNSOptionInOpt(const PacketBuffer& packet, const size_t optStart, const size_t optLen, const uint16_t optionCodeToFind, size_t* optContentStart = nullptr, uint16_t* optContentLen = nullptr);
+bool addEDNS(PacketBuffer& packet, size_t maximumSize, bool dnssecOK, uint16_t payloadSize, uint8_t ednsrcode);
+bool addEDNSToQueryTurnedResponse(DNSQuestion& dq);
+bool setNegativeAndAdditionalSOA(DNSQuestion& dq, bool nxd, const DNSName& zone, uint32_t ttl, const DNSName& mname, const DNSName& rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum);
+
+bool handleEDNSClientSubnet(DNSQuestion& dq, bool& ednsAdded, bool& ecsAdded);
+bool handleEDNSClientSubnet(PacketBuffer& packet, size_t maximumSize, size_t qnameWireLength, bool& ednsAdded, bool& ecsAdded, bool overrideExisting, const string& newECSOption);
+
+bool parseEDNSOptions(const DNSQuestion& dq);
+
+int getEDNSZ(const DNSQuestion& dq);
+bool queryHasEDNS(const DNSQuestion& dq);
+bool getEDNS0Record(const DNSQuestion& dq, EDNS0Record& edns0);
diff --git a/dnsdist-healthchecks.cc b/dnsdist-healthchecks.cc
new file mode 100644
index 0000000..50b9341
--- /dev/null
+++ b/dnsdist-healthchecks.cc
@@ -0,0 +1,545 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "dnsdist-healthchecks.hh"
+#include "tcpiohandler-mplexer.hh"
+#include "dnswriter.hh"
+#include "dolog.hh"
+#include "dnsdist-tcp.hh"
+#include "dnsdist-nghttp2.hh"
+#include "dnsdist-session-cache.hh"
+
+bool g_verboseHealthChecks{false};
+
+struct HealthCheckData
+{
+ enum class TCPState : uint8_t { WritingQuery, ReadingResponseSize, ReadingResponse };
+
+ HealthCheckData(FDMultiplexer& mplexer, const std::shared_ptr<DownstreamState>& ds, DNSName&& checkName, uint16_t checkType, uint16_t checkClass, uint16_t queryID): d_ds(ds), d_mplexer(mplexer), d_udpSocket(-1), d_checkName(std::move(checkName)), d_checkType(checkType), d_checkClass(checkClass), d_queryID(queryID)
+ {
+ }
+
+ const std::shared_ptr<DownstreamState> d_ds;
+ FDMultiplexer& d_mplexer;
+ std::unique_ptr<TCPIOHandler> d_tcpHandler{nullptr};
+ std::unique_ptr<IOStateHandler> d_ioState{nullptr};
+ PacketBuffer d_buffer;
+ Socket d_udpSocket;
+ DNSName d_checkName;
+ struct timeval d_ttd{0, 0};
+ size_t d_bufferPos{0};
+ uint16_t d_checkType;
+ uint16_t d_checkClass;
+ uint16_t d_queryID;
+ TCPState d_tcpState{TCPState::WritingQuery};
+ bool d_initial{false};
+};
+
+void updateHealthCheckResult(const std::shared_ptr<DownstreamState>& dss, bool initial, bool newState)
+{
+ if (initial) {
+ warnlog("Marking downstream %s as '%s'", dss->getNameWithAddr(), newState ? "up" : "down");
+ dss->setUpStatus(newState);
+ return;
+ }
+
+ if (newState) {
+ /* check succeeded */
+ dss->currentCheckFailures = 0;
+
+ if (!dss->upStatus) {
+ /* we were marked as down */
+ dss->consecutiveSuccessfulChecks++;
+ if (dss->consecutiveSuccessfulChecks < dss->minRiseSuccesses) {
+ /* if we need more than one successful check to rise
+ and we didn't reach the threshold yet,
+ let's stay down */
+ newState = false;
+ }
+ }
+ }
+ else {
+ /* check failed */
+ dss->consecutiveSuccessfulChecks = 0;
+
+ if (dss->upStatus) {
+ /* we are currently up */
+ dss->currentCheckFailures++;
+ if (dss->currentCheckFailures < dss->maxCheckFailures) {
+ /* we need more than one failure to be marked as down,
+ and we did not reach the threshold yet, let's stay up */
+ newState = true;
+ }
+ }
+ }
+
+ if (newState != dss->upStatus) {
+ warnlog("Marking downstream %s as '%s'", dss->getNameWithAddr(), newState ? "up" : "down");
+
+ if (newState && !dss->isTCPOnly() && (!dss->connected || dss->reconnectOnUp)) {
+ newState = dss->reconnect();
+
+ if (dss->connected && !dss->threadStarted.test_and_set()) {
+ dss->tid = std::thread(responderThread, dss);
+ }
+ }
+
+ dss->setUpStatus(newState);
+ dss->currentCheckFailures = 0;
+ dss->consecutiveSuccessfulChecks = 0;
+ if (g_snmpAgent && g_snmpTrapsEnabled) {
+ g_snmpAgent->sendBackendStatusChangeTrap(dss);
+ }
+ }
+}
+
+static bool handleResponse(std::shared_ptr<HealthCheckData>& data)
+{
+ auto& ds = data->d_ds;
+ try {
+ if (data->d_buffer.size() < sizeof(dnsheader)) {
+ if (g_verboseHealthChecks) {
+ infolog("Invalid health check response of size %d from backend %s, expecting at least %d", data->d_buffer.size(), ds->getNameWithAddr(), sizeof(dnsheader));
+ }
+ return false;
+ }
+
+ const dnsheader * responseHeader = reinterpret_cast<const dnsheader*>(data->d_buffer.data());
+ if (responseHeader->id != data->d_queryID) {
+ if (g_verboseHealthChecks) {
+ infolog("Invalid health check response id %d from backend %s, expecting %d", data->d_queryID, ds->getNameWithAddr(), data->d_queryID);
+ }
+ return false;
+ }
+
+ if (!responseHeader->qr) {
+ if (g_verboseHealthChecks) {
+ infolog("Invalid health check response from backend %s, expecting QR to be set", ds->getNameWithAddr());
+ }
+ return false;
+ }
+
+ if (responseHeader->rcode == RCode::ServFail) {
+ if (g_verboseHealthChecks) {
+ infolog("Backend %s responded to health check with ServFail", ds->getNameWithAddr());
+ }
+ return false;
+ }
+
+ if (ds->mustResolve && (responseHeader->rcode == RCode::NXDomain || responseHeader->rcode == RCode::Refused)) {
+ if (g_verboseHealthChecks) {
+ infolog("Backend %s responded to health check with %s while mustResolve is set", ds->getNameWithAddr(), responseHeader->rcode == RCode::NXDomain ? "NXDomain" : "Refused");
+ }
+ return false;
+ }
+
+ uint16_t receivedType;
+ uint16_t receivedClass;
+ DNSName receivedName(reinterpret_cast<const char*>(data->d_buffer.data()), data->d_buffer.size(), sizeof(dnsheader), false, &receivedType, &receivedClass);
+
+ if (receivedName != data->d_checkName || receivedType != data->d_checkType || receivedClass != data->d_checkClass) {
+ if (g_verboseHealthChecks) {
+ infolog("Backend %s responded to health check with an invalid qname (%s vs %s), qtype (%s vs %s) or qclass (%d vs %d)", ds->getNameWithAddr(), receivedName.toLogString(), data->d_checkName.toLogString(), QType(receivedType).toString(), QType(data->d_checkType).toString(), receivedClass, data->d_checkClass);
+ }
+ return false;
+ }
+ }
+ catch(const std::exception& e)
+ {
+ if (g_verboseHealthChecks) {
+ infolog("Error checking the health of backend %s: %s", ds->getNameWithAddr(), e.what());
+ }
+ return false;
+ }
+ catch(...)
+ {
+ if (g_verboseHealthChecks) {
+ infolog("Unknown exception while checking the health of backend %s", ds->getNameWithAddr());
+ }
+ return false;
+ }
+
+ return true;
+}
+
+class HealthCheckQuerySender : public TCPQuerySender
+{
+public:
+ HealthCheckQuerySender(std::shared_ptr<HealthCheckData>& data): d_data(data)
+ {
+ }
+
+ ~HealthCheckQuerySender()
+ {
+ }
+
+ bool active() const override
+ {
+ return true;
+ }
+
+ const ClientState* getClientState() const override
+ {
+ return nullptr;
+ }
+
+ void handleResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ d_data->d_buffer = std::move(response.d_buffer);
+ updateHealthCheckResult(d_data->d_ds, d_data->d_initial, ::handleResponse(d_data));
+ }
+
+ void handleXFRResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ throw std::runtime_error("Unexpected XFR reponse to a health check query");
+ }
+
+ void notifyIOError(IDState&& query, const struct timeval& now) override
+ {
+ updateHealthCheckResult(d_data->d_ds, d_data->d_initial, false);
+ }
+
+private:
+ std::shared_ptr<HealthCheckData> d_data;
+};
+
+static void healthCheckUDPCallback(int fd, FDMultiplexer::funcparam_t& param)
+{
+ auto data = boost::any_cast<std::shared_ptr<HealthCheckData>>(param);
+ data->d_mplexer.removeReadFD(fd);
+
+ ComboAddress from;
+ from.sin4.sin_family = data->d_ds->remote.sin4.sin_family;
+ auto fromlen = from.getSocklen();
+ data->d_buffer.resize(512);
+ auto got = recvfrom(data->d_udpSocket.getHandle(), &data->d_buffer.at(0), data->d_buffer.size(), 0, reinterpret_cast<sockaddr *>(&from), &fromlen);
+ if (got < 0) {
+ if (g_verboseHealthChecks) {
+ infolog("Error receiving health check response from %s: %s", data->d_ds->remote.toStringWithPort(), stringerror());
+ }
+ updateHealthCheckResult(data->d_ds, data->d_initial, false);
+ }
+
+ /* we are using a connected socket but hey.. */
+ if (from != data->d_ds->remote) {
+ if (g_verboseHealthChecks) {
+ infolog("Invalid health check response received from %s, expecting one from %s", from.toStringWithPort(), data->d_ds->remote.toStringWithPort());
+ }
+ updateHealthCheckResult(data->d_ds, data->d_initial, false);
+ }
+
+ updateHealthCheckResult(data->d_ds, data->d_initial, handleResponse(data));
+}
+
+static void healthCheckTCPCallback(int fd, FDMultiplexer::funcparam_t& param)
+{
+ auto data = boost::any_cast<std::shared_ptr<HealthCheckData>>(param);
+
+ IOStateGuard ioGuard(data->d_ioState);
+ try {
+ auto ioState = IOState::Done;
+
+ if (data->d_tcpState == HealthCheckData::TCPState::WritingQuery) {
+ ioState = data->d_tcpHandler->tryWrite(data->d_buffer, data->d_bufferPos, data->d_buffer.size());
+ if (ioState == IOState::Done) {
+ data->d_bufferPos = 0;
+ data->d_buffer.resize(sizeof(uint16_t));
+ data->d_tcpState = HealthCheckData::TCPState::ReadingResponseSize;
+ }
+ }
+
+ if (data->d_tcpState == HealthCheckData::TCPState::ReadingResponseSize) {
+ ioState = data->d_tcpHandler->tryRead(data->d_buffer, data->d_bufferPos, data->d_buffer.size());
+ if (ioState == IOState::Done) {
+ data->d_bufferPos = 0;
+ uint16_t responseSize;
+ memcpy(&responseSize, &data->d_buffer.at(0), sizeof(responseSize));
+ data->d_buffer.resize(ntohs(responseSize));
+ data->d_tcpState = HealthCheckData::TCPState::ReadingResponse;
+ }
+ }
+
+ if (data->d_tcpState == HealthCheckData::TCPState::ReadingResponse) {
+ ioState = data->d_tcpHandler->tryRead(data->d_buffer, data->d_bufferPos, data->d_buffer.size());
+ if (ioState == IOState::Done) {
+ updateHealthCheckResult(data->d_ds, data->d_initial, handleResponse(data));
+ }
+ }
+
+ if (ioState == IOState::Done) {
+ /* remove us from the mplexer, we are done */
+ data->d_ioState->update(ioState, healthCheckTCPCallback, data);
+ if (data->d_tcpHandler->isTLS()) {
+ try {
+ auto sessions = data->d_tcpHandler->getTLSSessions();
+ if (!sessions.empty()) {
+ g_sessionCache.putSessions(data->d_ds->getID(), time(nullptr), std::move(sessions));
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Unable to get a TLS session from the DoT healthcheck: %s", e.what());
+ }
+ }
+ }
+ else {
+ data->d_ioState->update(ioState, healthCheckTCPCallback, data, data->d_ttd);
+ }
+
+ /* the state has been updated, we can release the guard */
+ ioGuard.release();
+ }
+ catch (const std::exception& e) {
+ updateHealthCheckResult(data->d_ds, data->d_initial, false);
+ if (g_verboseHealthChecks) {
+ infolog("Error checking the health of backend %s: %s", data->d_ds->getNameWithAddr(), e.what());
+ }
+ }
+ catch (...) {
+ updateHealthCheckResult(data->d_ds, data->d_initial, false);
+ if (g_verboseHealthChecks) {
+ infolog("Unknown exception while checking the health of backend %s", data->d_ds->getNameWithAddr());
+ }
+ }
+}
+
+bool queueHealthCheck(std::unique_ptr<FDMultiplexer>& mplexer, const std::shared_ptr<DownstreamState>& ds, bool initialCheck)
+{
+ try
+ {
+ uint16_t queryID = getRandomDNSID();
+ DNSName checkName = ds->checkName;
+ uint16_t checkType = ds->checkType.getCode();
+ uint16_t checkClass = ds->checkClass;
+ dnsheader checkHeader;
+ memset(&checkHeader, 0, sizeof(checkHeader));
+
+ checkHeader.qdcount = htons(1);
+ checkHeader.id = queryID;
+
+ checkHeader.rd = true;
+ if (ds->setCD) {
+ checkHeader.cd = true;
+ }
+
+ if (ds->checkFunction) {
+ auto lock = g_lua.lock();
+ auto ret = ds->checkFunction(checkName, checkType, checkClass, &checkHeader);
+ checkName = std::get<0>(ret);
+ checkType = std::get<1>(ret);
+ checkClass = std::get<2>(ret);
+ }
+
+ PacketBuffer packet;
+ GenericDNSPacketWriter<PacketBuffer> dpw(packet, checkName, checkType, checkClass);
+ dnsheader* requestHeader = dpw.getHeader();
+ *requestHeader = checkHeader;
+
+ /* we need to compute that _before_ adding the proxy protocol payload */
+ uint16_t packetSize = packet.size();
+ std::string proxyProtocolPayload;
+ size_t proxyProtocolPayloadSize = 0;
+ if (ds->useProxyProtocol) {
+ proxyProtocolPayload = makeLocalProxyHeader();
+ proxyProtocolPayloadSize = proxyProtocolPayload.size();
+ if (!ds->isDoH()) {
+ packet.insert(packet.begin(), proxyProtocolPayload.begin(), proxyProtocolPayload.end());
+ }
+ }
+
+ Socket sock(ds->remote.sin4.sin_family, ds->doHealthcheckOverTCP() ? SOCK_STREAM : SOCK_DGRAM);
+
+ sock.setNonBlocking();
+ if (!IsAnyAddress(ds->sourceAddr)) {
+ sock.setReuseAddr();
+#ifdef IP_BIND_ADDRESS_NO_PORT
+ if (ds->ipBindAddrNoPort) {
+ SSetsockopt(sock.getHandle(), SOL_IP, IP_BIND_ADDRESS_NO_PORT, 1);
+ }
+#endif
+
+ if (!ds->sourceItfName.empty()) {
+#ifdef SO_BINDTODEVICE
+ int res = setsockopt(sock.getHandle(), SOL_SOCKET, SO_BINDTODEVICE, ds->sourceItfName.c_str(), ds->sourceItfName.length());
+ if (res != 0 && g_verboseHealthChecks) {
+ infolog("Error setting SO_BINDTODEVICE on the health check socket for backend '%s': %s", ds->getNameWithAddr(), stringerror());
+ }
+#endif
+ }
+ sock.bind(ds->sourceAddr);
+ }
+
+ auto data = std::make_shared<HealthCheckData>(*mplexer, ds, std::move(checkName), checkType, checkClass, queryID);
+ data->d_initial = initialCheck;
+
+ gettimeofday(&data->d_ttd, nullptr);
+ data->d_ttd.tv_sec += ds->checkTimeout / 1000; /* ms to seconds */
+ data->d_ttd.tv_usec += (ds->checkTimeout % 1000) * 1000; /* remaining ms to us */
+ if (data->d_ttd.tv_usec > 1000000) {
+ ++data->d_ttd.tv_sec;
+ data->d_ttd.tv_usec -= 1000000;
+ }
+
+ if (!ds->doHealthcheckOverTCP()) {
+ sock.connect(ds->remote);
+ data->d_udpSocket = std::move(sock);
+ ssize_t sent = udpClientSendRequestToBackend(ds, data->d_udpSocket.getHandle(), packet, true);
+ if (sent < 0) {
+ int ret = errno;
+ if (g_verboseHealthChecks) {
+ infolog("Error while sending a health check query to backend %s: %d", ds->getNameWithAddr(), ret);
+ }
+ return false;
+ }
+
+ mplexer->addReadFD(data->d_udpSocket.getHandle(), &healthCheckUDPCallback, data, &data->d_ttd);
+ }
+ else if (ds->isDoH()) {
+ InternalQuery query(std::move(packet), IDState());
+ query.d_proxyProtocolPayload = std::move(proxyProtocolPayload);
+ auto sender = std::shared_ptr<TCPQuerySender>(new HealthCheckQuerySender(data));
+ if (!sendH2Query(ds, mplexer, sender, std::move(query), true)) {
+ updateHealthCheckResult(data->d_ds, data->d_initial, false);
+ }
+ }
+ else {
+ time_t now = time(nullptr);
+ data->d_tcpHandler = std::make_unique<TCPIOHandler>(ds->d_tlsSubjectName, sock.releaseHandle(), timeval{ds->checkTimeout,0}, ds->d_tlsCtx, now);
+ data->d_ioState = std::make_unique<IOStateHandler>(*mplexer, data->d_tcpHandler->getDescriptor());
+ if (ds->d_tlsCtx) {
+ try {
+ auto tlsSession = g_sessionCache.getSession(ds->getID(), now);
+ if (tlsSession) {
+ data->d_tcpHandler->setTLSSession(tlsSession);
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Unable to restore a TLS session for the DoT healthcheck: %s", e.what());
+ }
+ }
+ data->d_tcpHandler->tryConnect(ds->tcpFastOpen, ds->remote);
+
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(packetSize / 256), static_cast<uint8_t>(packetSize % 256) };
+ packet.insert(packet.begin() + proxyProtocolPayloadSize, sizeBytes, sizeBytes + 2);
+ data->d_buffer = std::move(packet);
+
+ auto ioState = data->d_tcpHandler->tryWrite(data->d_buffer, data->d_bufferPos, data->d_buffer.size());
+ if (ioState == IOState::Done) {
+ data->d_bufferPos = 0;
+ data->d_buffer.resize(sizeof(uint16_t));
+ data->d_tcpState = HealthCheckData::TCPState::ReadingResponseSize;
+ ioState = IOState::NeedRead;
+ }
+
+ data->d_ioState->update(ioState, healthCheckTCPCallback, data, data->d_ttd);
+ }
+
+ return true;
+ }
+ catch (const std::exception& e)
+ {
+ if (g_verboseHealthChecks) {
+ infolog("Error checking the health of backend %s: %s", ds->getNameWithAddr(), e.what());
+ }
+ return false;
+ }
+ catch (...)
+ {
+ if (g_verboseHealthChecks) {
+ infolog("Unknown exception while checking the health of backend %s", ds->getNameWithAddr());
+ }
+ return false;
+ }
+}
+
+void handleQueuedHealthChecks(FDMultiplexer& mplexer, bool initial)
+{
+ while (mplexer.getWatchedFDCount(false) > 0 || mplexer.getWatchedFDCount(true) > 0) {
+ struct timeval now;
+ int ret = mplexer.run(&now, 100);
+ if (ret == -1) {
+ if (g_verboseHealthChecks) {
+ infolog("Error while waiting for the health check response from backends: %d", ret);
+ }
+ break;
+ }
+
+ handleH2Timeouts(mplexer, now);
+
+ auto timeouts = mplexer.getTimeouts(now);
+ for (const auto& timeout : timeouts) {
+ if (timeout.second.type() != typeid(std::shared_ptr<HealthCheckData>)) {
+ continue;
+ }
+
+ auto data = boost::any_cast<std::shared_ptr<HealthCheckData>>(timeout.second);
+ try {
+ if (data->d_ioState) {
+ data->d_ioState.reset();
+ }
+ else {
+ mplexer.removeReadFD(timeout.first);
+ }
+ if (g_verboseHealthChecks) {
+ infolog("Timeout while waiting for the health check response from backend %s", data->d_ds->getNameWithAddr());
+ }
+
+ updateHealthCheckResult(data->d_ds, initial, false);
+ }
+ catch (const std::exception& e) {
+ if (g_verboseHealthChecks) {
+ infolog("Error while dealing with a timeout for the health check response from backend %s: %s", data->d_ds->getNameWithAddr(), e.what());
+ }
+ }
+ catch (...) {
+ if (g_verboseHealthChecks) {
+ infolog("Error while dealing with a timeout for the health check response from backend %s", data->d_ds->getNameWithAddr());
+ }
+ }
+ }
+
+ timeouts = mplexer.getTimeouts(now, true);
+ for (const auto& timeout : timeouts) {
+ if (timeout.second.type() != typeid(std::shared_ptr<HealthCheckData>)) {
+ continue;
+ }
+ auto data = boost::any_cast<std::shared_ptr<HealthCheckData>>(timeout.second);
+ try {
+ data->d_ioState.reset();
+ if (g_verboseHealthChecks) {
+ infolog("Timeout while waiting for the health check response from backend %s", data->d_ds->getNameWithAddr());
+ }
+
+ updateHealthCheckResult(data->d_ds, initial, false);
+ }
+ catch (const std::exception& e) {
+ if (g_verboseHealthChecks) {
+ infolog("Error while dealing with a timeout for the health check response from backend %s: %s", data->d_ds->getNameWithAddr(), e.what());
+ }
+ }
+ catch (...) {
+ if (g_verboseHealthChecks) {
+ infolog("Error while dealing with a timeout for the health check response from backend %s", data->d_ds->getNameWithAddr());
+ }
+ }
+ }
+ }
+}
diff --git a/dnsdist-healthchecks.hh b/dnsdist-healthchecks.hh
new file mode 100644
index 0000000..04af75b
--- /dev/null
+++ b/dnsdist-healthchecks.hh
@@ -0,0 +1,33 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "dnsdist.hh"
+#include "mplexer.hh"
+#include "sstuff.hh"
+
+extern bool g_verboseHealthChecks;
+
+void updateHealthCheckResult(const std::shared_ptr<DownstreamState>& dss, bool initial, bool newState);
+bool queueHealthCheck(std::unique_ptr<FDMultiplexer>& mplexer, const std::shared_ptr<DownstreamState>& ds, bool initial=false);
+void handleQueuedHealthChecks(FDMultiplexer& mplexer, bool initial=false);
+
diff --git a/dnsdist-idstate.cc b/dnsdist-idstate.cc
new file mode 100644
index 0000000..286808c
--- /dev/null
+++ b/dnsdist-idstate.cc
@@ -0,0 +1,75 @@
+
+#include "dnsdist.hh"
+
+DNSResponse makeDNSResponseFromIDState(IDState& ids, PacketBuffer& data)
+{
+ DNSResponse dr(&ids.qname, ids.qtype, ids.qclass, &ids.origDest, &ids.origRemote, data, ids.protocol, &ids.sentTime.d_start);
+ dr.origFlags = ids.origFlags;
+ dr.cacheFlags = ids.cacheFlags;
+ dr.ecsAdded = ids.ecsAdded;
+ dr.ednsAdded = ids.ednsAdded;
+ dr.useZeroScope = ids.useZeroScope;
+ dr.packetCache = std::move(ids.packetCache);
+ dr.delayMsec = ids.delayMsec;
+ dr.skipCache = ids.skipCache;
+ dr.cacheKey = ids.cacheKey;
+ dr.cacheKeyNoECS = ids.cacheKeyNoECS;
+ dr.cacheKeyUDP = ids.cacheKeyUDP;
+ dr.dnssecOK = ids.dnssecOK;
+ dr.tempFailureTTL = ids.tempFailureTTL;
+ dr.qTag = std::move(ids.qTag);
+ dr.subnet = std::move(ids.subnet);
+ dr.uniqueId = std::move(ids.uniqueId);
+
+ if (ids.dnsCryptQuery) {
+ dr.dnsCryptQuery = std::move(ids.dnsCryptQuery);
+ }
+
+ dr.hopRemote = &ids.hopRemote;
+ dr.hopLocal = &ids.hopLocal;
+
+ return dr;
+}
+
+void setIDStateFromDNSQuestion(IDState& ids, DNSQuestion& dq, DNSName&& qname)
+{
+ ids.origRemote = *dq.remote;
+ ids.origDest = *dq.local;
+ ids.sentTime.set(*dq.queryTime);
+ ids.qname = std::move(qname);
+ ids.qtype = dq.qtype;
+ ids.qclass = dq.qclass;
+ ids.protocol = dq.protocol;
+ ids.delayMsec = dq.delayMsec;
+ ids.tempFailureTTL = dq.tempFailureTTL;
+ ids.origFlags = dq.origFlags;
+ ids.cacheFlags = dq.cacheFlags;
+ ids.cacheKey = dq.cacheKey;
+ ids.cacheKeyNoECS = dq.cacheKeyNoECS;
+ ids.cacheKeyUDP = dq.cacheKeyUDP;
+ ids.subnet = dq.subnet;
+ ids.skipCache = dq.skipCache;
+ ids.packetCache = dq.packetCache;
+ ids.ednsAdded = dq.ednsAdded;
+ ids.ecsAdded = dq.ecsAdded;
+ ids.useZeroScope = dq.useZeroScope;
+ ids.qTag = std::move(dq.qTag);
+ ids.dnssecOK = dq.dnssecOK;
+ ids.uniqueId = std::move(dq.uniqueId);
+
+ if (dq.hopRemote) {
+ ids.hopRemote = *dq.hopRemote;
+ }
+ else {
+ ids.hopRemote.sin4.sin_family = 0;
+ }
+
+ if (dq.hopLocal) {
+ ids.hopLocal = *dq.hopLocal;
+ }
+ else {
+ ids.hopLocal.sin4.sin_family = 0;
+ }
+
+ ids.dnsCryptQuery = std::move(dq.dnsCryptQuery);
+}
diff --git a/dnsdist-idstate.hh b/dnsdist-idstate.hh
new file mode 100644
index 0000000..fd0b6a6
--- /dev/null
+++ b/dnsdist-idstate.hh
@@ -0,0 +1,272 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "config.h"
+#include "dnsname.hh"
+#include "dnsdist-protocols.hh"
+#include "gettime.hh"
+#include "iputils.hh"
+#include "uuid-utils.hh"
+
+struct ClientState;
+struct DOHUnit;
+class DNSCryptQuery;
+class DNSDistPacketCache;
+
+using QTag = std::unordered_map<string, string>;
+
+struct StopWatch
+{
+ StopWatch(bool realTime = false) :
+ d_needRealTime(realTime)
+ {
+ }
+
+ void start()
+ {
+ d_start = getCurrentTime();
+ }
+
+ void set(const struct timespec& from)
+ {
+ d_start = from;
+ }
+
+ double udiff() const
+ {
+ struct timespec now = getCurrentTime();
+ return 1000000.0 * (now.tv_sec - d_start.tv_sec) + (now.tv_nsec - d_start.tv_nsec) / 1000.0;
+ }
+
+ double udiffAndSet()
+ {
+ struct timespec now = getCurrentTime();
+ auto ret = 1000000.0 * (now.tv_sec - d_start.tv_sec) + (now.tv_nsec - d_start.tv_nsec) / 1000.0;
+ d_start = now;
+ return ret;
+ }
+
+ struct timespec getCurrentTime() const
+ {
+ struct timespec now;
+ if (gettime(&now, d_needRealTime) < 0) {
+ unixDie("Getting timestamp");
+ }
+ return now;
+ }
+
+ struct timespec d_start
+ {
+ 0, 0
+ };
+
+private:
+ bool d_needRealTime;
+};
+
+/* g++ defines __SANITIZE_THREAD__
+ clang++ supports the nice __has_feature(thread_sanitizer),
+ let's merge them */
+#if defined(__has_feature)
+#if __has_feature(thread_sanitizer)
+#define __SANITIZE_THREAD__ 1
+#endif
+#endif
+
+struct IDState
+{
+ IDState() :
+ sentTime(true), tempFailureTTL(boost::none) { origDest.sin4.sin_family = 0; }
+ IDState(const IDState& orig) = delete;
+ IDState(IDState&& rhs) :
+ subnet(rhs.subnet), origRemote(rhs.origRemote), origDest(rhs.origDest), hopRemote(rhs.hopRemote), hopLocal(rhs.hopLocal), qname(std::move(rhs.qname)), sentTime(rhs.sentTime), packetCache(std::move(rhs.packetCache)), dnsCryptQuery(std::move(rhs.dnsCryptQuery)), qTag(std::move(rhs.qTag)), tempFailureTTL(rhs.tempFailureTTL), cs(rhs.cs), du(std::move(rhs.du)), cacheKey(rhs.cacheKey), cacheKeyNoECS(rhs.cacheKeyNoECS), cacheKeyUDP(rhs.cacheKeyUDP), origFD(rhs.origFD), delayMsec(rhs.delayMsec), qtype(rhs.qtype), qclass(rhs.qclass), origID(rhs.origID), origFlags(rhs.origFlags), cacheFlags(rhs.cacheFlags), protocol(rhs.protocol), ednsAdded(rhs.ednsAdded), ecsAdded(rhs.ecsAdded), skipCache(rhs.skipCache), destHarvested(rhs.destHarvested), dnssecOK(rhs.dnssecOK), useZeroScope(rhs.useZeroScope)
+ {
+ if (rhs.isInUse()) {
+ throw std::runtime_error("Trying to move an in-use IDState");
+ }
+
+ uniqueId = std::move(rhs.uniqueId);
+#ifdef __SANITIZE_THREAD__
+ age.store(rhs.age.load());
+#else
+ age = rhs.age;
+#endif
+ }
+
+ IDState& operator=(IDState&& rhs)
+ {
+ if (isInUse()) {
+ throw std::runtime_error("Trying to overwrite an in-use IDState");
+ }
+
+ if (rhs.isInUse()) {
+ throw std::runtime_error("Trying to move an in-use IDState");
+ }
+
+ subnet = std::move(rhs.subnet);
+ origRemote = rhs.origRemote;
+ origDest = rhs.origDest;
+ hopRemote = rhs.hopRemote;
+ hopLocal = rhs.hopLocal;
+ qname = std::move(rhs.qname);
+ sentTime = rhs.sentTime;
+ dnsCryptQuery = std::move(rhs.dnsCryptQuery);
+ packetCache = std::move(rhs.packetCache);
+ qTag = std::move(rhs.qTag);
+ tempFailureTTL = std::move(rhs.tempFailureTTL);
+ cs = rhs.cs;
+ du = std::move(rhs.du);
+ cacheKey = rhs.cacheKey;
+ cacheKeyNoECS = rhs.cacheKeyNoECS;
+ cacheKeyUDP = rhs.cacheKeyUDP;
+ origFD = rhs.origFD;
+ delayMsec = rhs.delayMsec;
+#ifdef __SANITIZE_THREAD__
+ age.store(rhs.age.load());
+#else
+ age = rhs.age;
+#endif
+ qtype = rhs.qtype;
+ qclass = rhs.qclass;
+ origID = rhs.origID;
+ origFlags = rhs.origFlags;
+ cacheFlags = rhs.cacheFlags;
+ protocol = rhs.protocol;
+ uniqueId = std::move(rhs.uniqueId);
+ ednsAdded = rhs.ednsAdded;
+ ecsAdded = rhs.ecsAdded;
+ skipCache = rhs.skipCache;
+ destHarvested = rhs.destHarvested;
+ dnssecOK = rhs.dnssecOK;
+ useZeroScope = rhs.useZeroScope;
+
+ return *this;
+ }
+
+ static const int64_t unusedIndicator = -1;
+
+ static bool isInUse(int64_t usageIndicator)
+ {
+ return usageIndicator != unusedIndicator;
+ }
+
+ bool isInUse() const
+ {
+ return usageIndicator != unusedIndicator;
+ }
+
+ /* return true if the value has been successfully replaced meaning that
+ no-one updated the usage indicator in the meantime */
+ bool tryMarkUnused(int64_t expectedUsageIndicator)
+ {
+ return usageIndicator.compare_exchange_strong(expectedUsageIndicator, unusedIndicator);
+ }
+
+ /* mark as used no matter what, return true if the state was in use before */
+ bool markAsUsed()
+ {
+ auto currentGeneration = generation++;
+ return markAsUsed(currentGeneration);
+ }
+
+ /* mark as used no matter what, return true if the state was in use before */
+ bool markAsUsed(int64_t currentGeneration)
+ {
+ int64_t oldUsage = usageIndicator.exchange(currentGeneration);
+ return oldUsage != unusedIndicator;
+ }
+
+ /* We use this value to detect whether this state is in use.
+ For performance reasons we don't want to use a lock here, but that means
+ we need to be very careful when modifying this value. Modifications happen
+ from:
+ - one of the UDP or DoH 'client' threads receiving a query, selecting a backend
+ then picking one of the states associated to this backend (via the idOffset).
+ Most of the time this state should not be in use and usageIndicator is -1, but we
+ might not yet have received a response for the query previously associated to this
+ state, meaning that we will 'reuse' this state and erase the existing state.
+ If we ever receive a response for this state, it will be discarded. This is
+ mostly fine for UDP except that we still need to be careful in order to miss
+ the 'outstanding' counters, which should only be increased when we are picking
+ an empty state, and not when reusing ;
+ For DoH, though, we have dynamically allocated a DOHUnit object that needs to
+ be freed, as well as internal objects internals to libh2o.
+ - one of the UDP receiver threads receiving a response from a backend, picking
+ the corresponding state and sending the response to the client ;
+ - the 'healthcheck' thread scanning the states to actively discover timeouts,
+ mostly to keep some counters like the 'outstanding' one sane.
+ We previously based that logic on the origFD (FD on which the query was received,
+ and therefore from where the response should be sent) but this suffered from an
+ ABA problem since it was quite likely that a UDP 'client thread' would reset it to the
+ same value since we only have so much incoming sockets:
+ - 1/ 'client' thread gets a query and set origFD to its FD, say 5 ;
+ - 2/ 'receiver' thread gets a response, read the value of origFD to 5, check that the qname,
+ qtype and qclass match
+ - 3/ during that time the 'client' thread reuses the state, setting again origFD to 5 ;
+ - 4/ the 'receiver' thread uses compare_exchange_strong() to only replace the value if it's still
+ 5, except it's not the same 5 anymore and it overrides a fresh state.
+ We now use a 32-bit unsigned counter instead, which is incremented every time the state is set,
+ wrapping around if necessary, and we set an atomic signed 64-bit value, so that we still have -1
+ when the state is unused and the value of our counter otherwise.
+ */
+ boost::optional<Netmask> subnet{boost::none}; // 40
+ ComboAddress origRemote; // 28
+ ComboAddress origDest; // 28
+ ComboAddress hopRemote;
+ ComboAddress hopLocal;
+ DNSName qname; // 24
+ StopWatch sentTime; // 16
+ std::shared_ptr<DNSDistPacketCache> packetCache{nullptr}; // 16
+ std::unique_ptr<DNSCryptQuery> dnsCryptQuery{nullptr}; // 8
+ std::unique_ptr<QTag> qTag{nullptr}; // 8
+ boost::optional<uint32_t> tempFailureTTL; // 8
+ const ClientState* cs{nullptr}; // 8
+ DOHUnit* du{nullptr}; // 8 (not a unique_ptr because we currently need to be able to peek at it without taking ownership until later)
+ std::atomic<int64_t> usageIndicator{unusedIndicator}; // set to unusedIndicator to indicate this state is empty // 8
+ std::atomic<uint32_t> generation{0}; // increased every time a state is used, to be able to detect an ABA issue // 4
+ uint32_t cacheKey{0}; // 4
+ uint32_t cacheKeyNoECS{0}; // 4
+ // DoH-only */
+ uint32_t cacheKeyUDP{0}; // 4
+ int origFD{-1}; // 4
+ int delayMsec{0};
+#ifdef __SANITIZE_THREAD__
+ std::atomic<uint16_t> age{0};
+#else
+ uint16_t age{0}; // 2
+#endif
+ uint16_t qtype{0}; // 2
+ uint16_t qclass{0}; // 2
+ // origID is in network-byte order
+ uint16_t origID{0}; // 2
+ uint16_t origFlags{0}; // 2
+ uint16_t cacheFlags{0}; // DNS flags as sent to the backend // 2
+ dnsdist::Protocol protocol; // 1
+ boost::optional<boost::uuids::uuid> uniqueId{boost::none}; // 17 (placed here to reduce the space lost to padding)
+ bool ednsAdded{false};
+ bool ecsAdded{false};
+ bool skipCache{false};
+ bool destHarvested{false}; // if true, origDest holds the original dest addr, otherwise the listening addr
+ bool dnssecOK{false};
+ bool useZeroScope{false};
+};
diff --git a/dnsdist-kvs.cc b/dnsdist-kvs.cc
new file mode 100644
index 0000000..c2b6272
--- /dev/null
+++ b/dnsdist-kvs.cc
@@ -0,0 +1,285 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "dnsdist-kvs.hh"
+#include "dolog.hh"
+
+#include <sys/stat.h>
+
+std::vector<std::string> KeyValueLookupKeySourceIP::getKeys(const ComboAddress& addr)
+{
+ std::vector<std::string> result;
+ ComboAddress truncated(addr);
+
+ std::string key;
+ if (truncated.isIPv4()) {
+ truncated.truncate(d_v4Mask);
+ key.reserve(sizeof(truncated.sin4.sin_addr.s_addr) + (d_includePort ? sizeof(truncated.sin4.sin_port) : 0));
+ key.append(reinterpret_cast<const char*>(&truncated.sin4.sin_addr.s_addr), sizeof(truncated.sin4.sin_addr.s_addr));
+ }
+ else if (truncated.isIPv6()) {
+ truncated.truncate(d_v6Mask);
+ key.reserve(sizeof(truncated.sin6.sin6_addr.s6_addr) + (d_includePort ? sizeof(truncated.sin4.sin_port) : 0));
+ key.append(reinterpret_cast<const char*>(&truncated.sin6.sin6_addr.s6_addr), sizeof(truncated.sin6.sin6_addr.s6_addr));
+ }
+
+ if (d_includePort) {
+ key.append(reinterpret_cast<const char*>(&truncated.sin4.sin_port), sizeof(truncated.sin4.sin_port));
+ }
+
+ result.push_back(std::move(key));
+
+ return result;
+}
+
+std::vector<std::string> KeyValueLookupKeySuffix::getKeys(const DNSName& qname)
+{
+ if (qname.empty() || qname.isRoot()) {
+ return {};
+ }
+
+ auto lowerQName = qname.makeLowerCase();
+ size_t labelsCount = lowerQName.countLabels();
+ if (d_minLabels != 0) {
+ if (labelsCount < d_minLabels) {
+ return {};
+ }
+ labelsCount -= (d_minLabels - 1);
+ }
+
+ std::vector<std::string> result;
+ result.reserve(labelsCount);
+
+ while(!lowerQName.isRoot()) {
+ result.emplace_back(d_wireFormat ? lowerQName.toDNSString() : lowerQName.toStringRootDot());
+ labelsCount--;
+ if (!lowerQName.chopOff() || labelsCount == 0) {
+ break;
+ }
+ }
+
+ return result;
+}
+
+#ifdef HAVE_LMDB
+
+bool LMDBKVStore::getValue(const std::string& key, std::string& value)
+{
+ try {
+ auto transaction = d_env.getROTransaction();
+ MDBOutVal result;
+ int rc = transaction->get(d_dbi, MDBInVal(key), result);
+ if (rc == 0) {
+ value = result.get<std::string>();
+ return true;
+ }
+ else if (rc == MDB_NOTFOUND) {
+ return false;
+ }
+ }
+ catch(const std::exception& e) {
+ warnlog("Error while looking up key '%s' from LMDB file '%s', database '%s': %s", key, d_fname, d_dbName, e.what());
+ }
+ return false;
+}
+
+bool LMDBKVStore::keyExists(const std::string& key)
+{
+ try {
+ auto transaction = d_env.getROTransaction();
+ MDBOutVal result;
+ int rc = transaction->get(d_dbi, MDBInVal(key), result);
+ if (rc == 0) {
+ return true;
+ }
+ else if (rc == MDB_NOTFOUND) {
+ return false;
+ }
+ }
+ catch(const std::exception& e) {
+ warnlog("Error while looking up key '%s' from LMDB file '%s', database '%s': %s", key, d_fname, d_dbName, e.what());
+ }
+ return false;
+}
+
+bool LMDBKVStore::getRangeValue(const std::string& key, std::string& value)
+{
+ try {
+ auto transaction = d_env.getROTransaction();
+ auto cursor = transaction->getROCursor(d_dbi);
+ MDBOutVal actualKey;
+ MDBOutVal result;
+ // for range-based lookups, we expect the data in LMDB
+ // to be stored with the last value of the range as key
+ // and the first value of the range as data, sometimes
+ // followed by any other content we don't care about
+ // range-based lookups are mostly useful for network ranges,
+ // for which we expect addresses to be stored in network byte
+ // order
+
+ // retrieve the first key greater or equal to our key
+ int rc = cursor.lower_bound(MDBInVal(key), actualKey, result);
+
+ if (rc == 0) {
+ auto last = actualKey.get<std::string>();
+ if (last.size() != key.size() || key > last) {
+ return false;
+ }
+
+ value = result.get<std::string>();
+ if (value.size() < key.size()) {
+ return false;
+ }
+
+ // take the first part of the data, which should be
+ // the first address of the range
+ auto first = value.substr(0, key.size());
+ if (first.size() != key.size() || key < first) {
+ return false;
+ }
+
+ return true;
+ }
+ else if (rc == MDB_NOTFOUND) {
+ return false;
+ }
+ }
+ catch(const std::exception& e) {
+ vinfolog("Error while looking up a range from LMDB file '%s', database '%s': %s", d_fname, d_dbName, e.what());
+ }
+ return false;
+}
+
+#endif /* HAVE_LMDB */
+
+#ifdef HAVE_CDB
+
+CDBKVStore::CDBKVStore(const std::string& fname, time_t refreshDelay): d_fname(fname), d_refreshDelay(refreshDelay)
+{
+ d_refreshing.clear();
+
+ time_t now = time(nullptr);
+ if (d_refreshDelay > 0) {
+ d_nextCheck = now + d_refreshDelay;
+ }
+
+ refreshDBIfNeeded(now);
+}
+
+CDBKVStore::~CDBKVStore() {
+}
+
+bool CDBKVStore::reload(const struct stat& st)
+{
+ auto newCDB = std::make_unique<CDB>(d_fname);
+ {
+ *(d_cdb.write_lock()) = std::move(newCDB);
+ }
+ d_mtime = st.st_mtime;
+ return true;
+}
+
+bool CDBKVStore::reload()
+{
+ struct stat st;
+ if (stat(d_fname.c_str(), &st) == 0) {
+ return reload(st);
+ }
+ else {
+ warnlog("Error while retrieving the last modification time of CDB database '%s': %s", d_fname, stringerror());
+ return false;
+ }
+}
+
+void CDBKVStore::refreshDBIfNeeded(time_t now)
+{
+ if (d_refreshing.test_and_set()) {
+ /* someone else is already refreshing */
+ return;
+ }
+
+ try {
+ struct stat st;
+ if (stat(d_fname.c_str(), &st) == 0) {
+ if (st.st_mtime > d_mtime) {
+ reload(st);
+ }
+ }
+ else {
+ warnlog("Error while retrieving the last modification time of CDB database '%s': %s", d_fname, stringerror());
+ }
+ d_nextCheck = now + d_refreshDelay;
+ d_refreshing.clear();
+ }
+ catch(...) {
+ d_refreshing.clear();
+ throw;
+ }
+}
+
+bool CDBKVStore::getValue(const std::string& key, std::string& value)
+{
+ time_t now = time(nullptr);
+
+ try {
+ if (d_nextCheck != 0 && now >= d_nextCheck) {
+ refreshDBIfNeeded(now);
+ }
+
+ {
+ auto cdb = d_cdb.read_lock();
+ if (*cdb && (*cdb)->findOne(key, value)) {
+ return true;
+ }
+ }
+ }
+ catch(const std::exception& e) {
+ warnlog("Error while looking up key '%s' from CDB file '%s': %s", key, d_fname, e.what());
+ }
+ return false;
+}
+
+bool CDBKVStore::keyExists(const std::string& key)
+{
+ time_t now = time(nullptr);
+
+ try {
+ if (d_nextCheck != 0 && now >= d_nextCheck) {
+ refreshDBIfNeeded(now);
+ }
+
+ {
+ auto cdb = d_cdb.read_lock();
+ if (!*cdb) {
+ return false;
+ }
+
+ return (*cdb)->keyExists(key);
+ }
+ }
+ catch(const std::exception& e) {
+ warnlog("Error while looking up key '%s' from CDB file '%s': %s", key, d_fname, e.what());
+ }
+ return false;
+}
+
+#endif /* HAVE_CDB */
diff --git a/dnsdist-kvs.hh b/dnsdist-kvs.hh
new file mode 100644
index 0000000..14d0bed
--- /dev/null
+++ b/dnsdist-kvs.hh
@@ -0,0 +1,221 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "dnsdist.hh"
+
+class KeyValueLookupKey
+{
+public:
+ virtual ~KeyValueLookupKey()
+ {
+ }
+ virtual std::vector<std::string> getKeys(const DNSQuestion&) = 0;
+ virtual std::string toString() const = 0;
+};
+
+class KeyValueLookupKeySourceIP: public KeyValueLookupKey
+{
+public:
+ KeyValueLookupKeySourceIP(uint8_t v4Mask, uint8_t v6Mask, bool includePort): d_v4Mask(v4Mask), d_v6Mask(v6Mask), d_includePort(includePort)
+ {
+ }
+
+ std::vector<std::string> getKeys(const ComboAddress& addr);
+
+ std::vector<std::string> getKeys(const DNSQuestion& dq) override
+ {
+ return getKeys(*dq.remote);
+ }
+
+ std::string toString() const override
+ {
+ return "source IP (masked to " + std::to_string(d_v4Mask) + " (v4) / " + std::to_string(d_v6Mask) + " (v6) bits)" + (d_includePort ? " including the port" : "");
+ }
+private:
+ uint8_t d_v4Mask;
+ uint8_t d_v6Mask;
+ bool d_includePort;
+};
+
+class KeyValueLookupKeyQName: public KeyValueLookupKey
+{
+public:
+
+ KeyValueLookupKeyQName(bool wireFormat): d_wireFormat(wireFormat)
+ {
+ }
+
+ std::vector<std::string> getKeys(const DNSName& qname)
+ {
+ if (d_wireFormat) {
+ return {qname.toDNSStringLC()};
+ }
+ return {qname.makeLowerCase().toStringRootDot()};
+ }
+
+ std::vector<std::string> getKeys(const DNSQuestion& dq) override
+ {
+ return getKeys(*dq.qname);
+ }
+
+ std::string toString() const override
+ {
+ if (d_wireFormat) {
+ return "qname in wire format";
+ }
+ return "qname";
+ }
+
+private:
+ bool d_wireFormat;
+};
+
+class KeyValueLookupKeySuffix: public KeyValueLookupKey
+{
+public:
+ KeyValueLookupKeySuffix(size_t minLabels, bool wireFormat): d_minLabels(minLabels), d_wireFormat(wireFormat)
+ {
+ }
+
+ std::vector<std::string> getKeys(const DNSName& qname);
+
+ std::vector<std::string> getKeys(const DNSQuestion& dq) override
+ {
+ return getKeys(*dq.qname);
+ }
+
+ std::string toString() const override
+ {
+ if (d_minLabels > 0) {
+ return "suffix " + std::string(d_wireFormat ? "in wire format " : "") + "with at least " + std::to_string(d_minLabels) + " label(s)";
+ }
+ return "suffix" + std::string(d_wireFormat ? " in wire format" : "");
+ }
+
+private:
+ size_t d_minLabels;
+ bool d_wireFormat;
+};
+
+class KeyValueLookupKeyTag: public KeyValueLookupKey
+{
+public:
+ KeyValueLookupKeyTag(const std::string& tag): d_tag(tag)
+ {
+ }
+
+ std::vector<std::string> getKeys(const DNSQuestion& dq) override
+ {
+ if (dq.qTag) {
+ const auto& it = dq.qTag->find(d_tag);
+ if (it != dq.qTag->end()) {
+ return { it->second };
+ }
+ }
+ return {};
+ }
+
+ std::string toString() const override
+ {
+ return "value of the tag named '" + d_tag + "'";
+ }
+
+private:
+ std::string d_tag;
+};
+
+class KeyValueStore
+{
+public:
+ virtual ~KeyValueStore()
+ {
+ }
+
+ virtual bool keyExists(const std::string& key) = 0;
+ virtual bool getValue(const std::string& key, std::string& value) = 0;
+ // do a range-based lookup (mostly useful for IP addresses), assuming that:
+ // there is a key for the last element of the range (2001:0db8:ffff:ffff:ffff:ffff:ffff:ffff, in network byte order, for 2001:db8::/32)
+ // which contains the first element of the range (2001:0db8:0000:0000:0000:0000:0000:0000, in network bytes order) followed by any data in the value
+ // AND there is no overlapping ranges in the database !!
+ // This requires that the underlying store supports ordered keys, which is true for LMDB but not for CDB, for example.
+ virtual bool getRangeValue(const std::string& key, std::string& value)
+ {
+ throw std::runtime_error("range-based lookups are not implemented for this Key-Value Store");
+ }
+ virtual bool reload()
+ {
+ return false;
+ }
+};
+
+#ifdef HAVE_LMDB
+
+#include "ext/lmdb-safe/lmdb-safe.hh"
+
+class LMDBKVStore: public KeyValueStore
+{
+public:
+ LMDBKVStore(const std::string& fname, const std::string& dbName, bool noLock=false): d_env(fname.c_str(), noLock ? MDB_NOSUBDIR|MDB_RDONLY|MDB_NOLOCK : MDB_NOSUBDIR|MDB_RDONLY, 0600), d_dbi(d_env.openDB(dbName, 0)), d_fname(fname), d_dbName(dbName)
+ {
+ }
+
+ bool keyExists(const std::string& key) override;
+ bool getValue(const std::string& key, std::string& value) override;
+ bool getRangeValue(const std::string& key, std::string& value) override;
+
+private:
+ MDBEnv d_env;
+ MDBDbi d_dbi;
+ std::string d_fname;
+ std::string d_dbName;
+};
+
+#endif /* HAVE_LMDB */
+
+#ifdef HAVE_CDB
+
+#include "cdb.hh"
+
+class CDBKVStore: public KeyValueStore
+{
+public:
+ CDBKVStore(const std::string& fname, time_t refreshDelay);
+ ~CDBKVStore();
+
+ bool keyExists(const std::string& key) override;
+ bool getValue(const std::string& key, std::string& value) override;
+ bool reload() override;
+
+private:
+ void refreshDBIfNeeded(time_t now);
+ bool reload(const struct stat& st);
+
+ SharedLockGuarded<std::unique_ptr<CDB>> d_cdb{nullptr};
+ std::string d_fname;
+ time_t d_mtime{0};
+ time_t d_nextCheck{0};
+ time_t d_refreshDelay{0};
+ std::atomic_flag d_refreshing;
+};
+
+#endif /* HAVE_LMDB */
diff --git a/dnsdist-lbpolicies.cc b/dnsdist-lbpolicies.cc
new file mode 100644
index 0000000..d747ca7
--- /dev/null
+++ b/dnsdist-lbpolicies.cc
@@ -0,0 +1,357 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "dnsdist.hh"
+#include "dnsdist-lbpolicies.hh"
+#include "dnsdist-lua.hh"
+#include "dnsdist-lua-ffi.hh"
+#include "dolog.hh"
+
+GlobalStateHolder<ServerPolicy> g_policy;
+bool g_roundrobinFailOnNoServer{false};
+
+// get server with least outstanding queries, and within those, with the lowest order, and within those: the fastest
+shared_ptr<DownstreamState> leastOutstanding(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq)
+{
+ if (servers.size() == 1 && servers[0].second->isUp()) {
+ return servers[0].second;
+ }
+
+ vector<pair<tuple<int,int,double>, size_t>> poss;
+ /* so you might wonder, why do we go through this trouble? The data on which we sort could change during the sort,
+ which would suck royally and could even lead to crashes. So first we snapshot on what we sort, and then we sort */
+ poss.reserve(servers.size());
+ size_t position = 0;
+ for(const auto& d : servers) {
+ if(d.second->isUp()) {
+ poss.emplace_back(make_tuple(d.second->outstanding.load(), d.second->order, d.second->latencyUsec), position);
+ }
+ ++position;
+ }
+
+ if (poss.empty()) {
+ return shared_ptr<DownstreamState>();
+ }
+
+ nth_element(poss.begin(), poss.begin(), poss.end(), [](const decltype(poss)::value_type& a, const decltype(poss)::value_type& b) { return a.first < b.first; });
+ return servers.at(poss.begin()->second).second;
+}
+
+shared_ptr<DownstreamState> firstAvailable(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq)
+{
+ for(auto& d : servers) {
+ if (d.second->isUp() && d.second->qps.checkOnly()) {
+ return d.second;
+ }
+ }
+ return leastOutstanding(servers, dq);
+}
+
+double g_weightedBalancingFactor = 0;
+
+static shared_ptr<DownstreamState> valrandom(unsigned int val, const ServerPolicy::NumberedServerVector& servers)
+{
+ vector<pair<int, size_t>> poss;
+ poss.reserve(servers.size());
+ int sum = 0;
+ int max = std::numeric_limits<int>::max();
+ double targetLoad = std::numeric_limits<double>::max();
+
+ if (g_weightedBalancingFactor > 0) {
+ /* we start with one, representing the query we are currently handling */
+ double currentLoad = 1;
+ size_t totalWeight = 0;
+ for (const auto& pair : servers) {
+ if (pair.second->isUp()) {
+ currentLoad += pair.second->outstanding;
+ totalWeight += pair.second->weight;
+ }
+ }
+
+ if (totalWeight > 0) {
+ targetLoad = (currentLoad / totalWeight) * g_weightedBalancingFactor;
+ }
+ }
+
+ for (const auto& d : servers) { // w=1, w=10 -> 1, 11
+ if (d.second->isUp() && (g_weightedBalancingFactor == 0 || (d.second->outstanding <= (targetLoad * d.second->weight)))) {
+ // Don't overflow sum when adding high weights
+ if (d.second->weight > max - sum) {
+ sum = max;
+ } else {
+ sum += d.second->weight;
+ }
+
+ poss.emplace_back(sum, d.first);
+ }
+ }
+
+ // Catch poss & sum are empty to avoid SIGFPE
+ if (poss.empty() || sum == 0) {
+ return shared_ptr<DownstreamState>();
+ }
+
+ int r = val % sum;
+ auto p = upper_bound(poss.begin(), poss.end(),r, [](int r_, const decltype(poss)::value_type& a) { return r_ < a.first;});
+ if (p == poss.end()) {
+ return shared_ptr<DownstreamState>();
+ }
+
+ return servers.at(p->second - 1).second;
+}
+
+shared_ptr<DownstreamState> wrandom(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq)
+{
+ return valrandom(random(), servers);
+}
+
+uint32_t g_hashperturb;
+double g_consistentHashBalancingFactor = 0;
+
+shared_ptr<DownstreamState> whashedFromHash(const ServerPolicy::NumberedServerVector& servers, size_t hash)
+{
+ return valrandom(hash, servers);
+}
+
+shared_ptr<DownstreamState> whashed(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq)
+{
+ return whashedFromHash(servers, dq->qname->hash(g_hashperturb));
+}
+
+shared_ptr<DownstreamState> chashedFromHash(const ServerPolicy::NumberedServerVector& servers, size_t qhash)
+{
+ unsigned int sel = std::numeric_limits<unsigned int>::max();
+ unsigned int min = std::numeric_limits<unsigned int>::max();
+ shared_ptr<DownstreamState> ret = nullptr, first = nullptr;
+
+ double targetLoad = std::numeric_limits<double>::max();
+ if (g_consistentHashBalancingFactor > 0) {
+ /* we start with one, representing the query we are currently handling */
+ double currentLoad = 1;
+ size_t totalWeight = 0;
+ for (const auto& pair : servers) {
+ if (pair.second->isUp()) {
+ currentLoad += pair.second->outstanding;
+ totalWeight += pair.second->weight;
+ }
+ }
+
+ if (totalWeight > 0) {
+ targetLoad = (currentLoad / totalWeight) * g_consistentHashBalancingFactor;
+ }
+ }
+
+ for (const auto& d: servers) {
+ if (d.second->isUp() && (g_consistentHashBalancingFactor == 0 || d.second->outstanding <= (targetLoad * d.second->weight))) {
+ // make sure hashes have been computed
+ if (!d.second->hashesComputed) {
+ d.second->hash();
+ }
+ {
+ const auto& server = d.second;
+ auto hashes = server->hashes.read_lock();
+ // we want to keep track of the last hash
+ if (min > *(hashes->begin())) {
+ min = *(hashes->begin());
+ first = server;
+ }
+
+ auto hash_it = std::lower_bound(hashes->begin(), hashes->end(), qhash);
+ if (hash_it != hashes->end()) {
+ if (*hash_it < sel) {
+ sel = *hash_it;
+ ret = server;
+ }
+ }
+ }
+ }
+ }
+ if (ret != nullptr) {
+ return ret;
+ }
+ if (first != nullptr) {
+ return first;
+ }
+ return shared_ptr<DownstreamState>();
+}
+
+shared_ptr<DownstreamState> chashed(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq)
+{
+ return chashedFromHash(servers, dq->qname->hash(g_hashperturb));
+}
+
+shared_ptr<DownstreamState> roundrobin(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq)
+{
+ if (servers.empty()) {
+ return shared_ptr<DownstreamState>();
+ }
+
+ vector<size_t> candidates;
+ candidates.reserve(servers.size());
+
+ for (auto& d : servers) {
+ if (d.second->isUp()) {
+ candidates.push_back(d.first);
+ }
+ }
+
+ if (candidates.empty()) {
+ if (g_roundrobinFailOnNoServer) {
+ return shared_ptr<DownstreamState>();
+ }
+ for (auto& d : servers) {
+ candidates.push_back(d.first);
+ }
+ }
+
+ static unsigned int counter;
+ return servers.at(candidates.at((counter++) % candidates.size()) - 1).second;
+}
+
+const std::shared_ptr<ServerPolicy::NumberedServerVector> getDownstreamCandidates(const pools_t& pools, const std::string& poolName)
+{
+ std::shared_ptr<ServerPool> pool = getPool(pools, poolName);
+ return pool->getServers();
+}
+
+std::shared_ptr<ServerPool> createPoolIfNotExists(pools_t& pools, const string& poolName)
+{
+ std::shared_ptr<ServerPool> pool;
+ pools_t::iterator it = pools.find(poolName);
+ if (it != pools.end()) {
+ pool = it->second;
+ }
+ else {
+ if (!poolName.empty())
+ vinfolog("Creating pool %s", poolName);
+ pool = std::make_shared<ServerPool>();
+ pools.insert(std::pair<std::string,std::shared_ptr<ServerPool> >(poolName, pool));
+ }
+ return pool;
+}
+
+void setPoolPolicy(pools_t& pools, const string& poolName, std::shared_ptr<ServerPolicy> policy)
+{
+ std::shared_ptr<ServerPool> pool = createPoolIfNotExists(pools, poolName);
+ if (!poolName.empty()) {
+ vinfolog("Setting pool %s server selection policy to %s", poolName, policy->getName());
+ } else {
+ vinfolog("Setting default pool server selection policy to %s", policy->getName());
+ }
+ pool->policy = policy;
+}
+
+void addServerToPool(pools_t& pools, const string& poolName, std::shared_ptr<DownstreamState> server)
+{
+ std::shared_ptr<ServerPool> pool = createPoolIfNotExists(pools, poolName);
+ if (!poolName.empty()) {
+ vinfolog("Adding server to pool %s", poolName);
+ } else {
+ vinfolog("Adding server to default pool");
+ }
+ pool->addServer(server);
+}
+
+void removeServerFromPool(pools_t& pools, const string& poolName, std::shared_ptr<DownstreamState> server)
+{
+ std::shared_ptr<ServerPool> pool = getPool(pools, poolName);
+
+ if (!poolName.empty()) {
+ vinfolog("Removing server from pool %s", poolName);
+ }
+ else {
+ vinfolog("Removing server from default pool");
+ }
+
+ pool->removeServer(server);
+}
+
+std::shared_ptr<ServerPool> getPool(const pools_t& pools, const std::string& poolName)
+{
+ pools_t::const_iterator it = pools.find(poolName);
+
+ if (it == pools.end()) {
+ throw std::out_of_range("No pool named " + poolName);
+ }
+
+ return it->second;
+}
+
+ServerPolicy::ServerPolicy(const std::string& name_, const std::string& code): d_name(name_), d_perThreadPolicyCode(code), d_isLua(true), d_isFFI(true), d_isPerThread(true)
+{
+ LuaContext tmpContext;
+ setupLuaLoadBalancingContext(tmpContext);
+ auto ret = tmpContext.executeCode<ServerPolicy::ffipolicyfunc_t>(code);
+}
+
+thread_local ServerPolicy::PerThreadState ServerPolicy::t_perThreadState;
+
+const ServerPolicy::ffipolicyfunc_t& ServerPolicy::getPerThreadPolicy() const
+{
+ auto& state = t_perThreadState;
+ if (!state.d_initialized) {
+ setupLuaLoadBalancingContext(state.d_luaContext);
+ state.d_initialized = true;
+ }
+
+ const auto& it = state.d_policies.find(d_name);
+ if (it != state.d_policies.end()) {
+ return it->second;
+ }
+
+ auto newPolicy = state.d_luaContext.executeCode<ServerPolicy::ffipolicyfunc_t>(d_perThreadPolicyCode);
+ state.d_policies[d_name] = std::move(newPolicy);
+ return state.d_policies.at(d_name);
+}
+
+std::shared_ptr<DownstreamState> ServerPolicy::getSelectedBackend(const ServerPolicy::NumberedServerVector& servers, DNSQuestion& dq) const
+{
+ std::shared_ptr<DownstreamState> selectedBackend{nullptr};
+
+ if (d_isLua) {
+ if (!d_isFFI) {
+ auto lock = g_lua.lock();
+ selectedBackend = d_policy(servers, &dq);
+ }
+ else {
+ dnsdist_ffi_dnsquestion_t dnsq(&dq);
+ dnsdist_ffi_servers_list_t serversList(servers);
+ unsigned int selected = 0;
+
+ if (!d_isPerThread) {
+ auto lock = g_lua.lock();
+ selected = d_ffipolicy(&serversList, &dnsq);
+ }
+ else {
+ const auto& policy = getPerThreadPolicy();
+ selected = policy(&serversList, &dnsq);
+ }
+
+ selectedBackend = servers.at(selected).second;
+ }
+ }
+ else {
+ selectedBackend = d_policy(servers, &dq);
+ }
+
+ return selectedBackend;
+}
diff --git a/dnsdist-lbpolicies.hh b/dnsdist-lbpolicies.hh
new file mode 100644
index 0000000..395deec
--- /dev/null
+++ b/dnsdist-lbpolicies.hh
@@ -0,0 +1,114 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+struct dnsdist_ffi_servers_list_t;
+struct dnsdist_ffi_server_t;
+struct dnsdist_ffi_dnsquestion_t;
+
+struct DownstreamState;
+
+struct PerThreadPoliciesState;
+
+class ServerPolicy
+{
+public:
+ template <class T> using NumberedVector = std::vector<std::pair<unsigned int, T> >;
+ using NumberedServerVector = NumberedVector<shared_ptr<DownstreamState>>;
+ typedef std::function<shared_ptr<DownstreamState>(const NumberedServerVector& servers, const DNSQuestion*)> policyfunc_t;
+ typedef std::function<unsigned int(dnsdist_ffi_servers_list_t* servers, dnsdist_ffi_dnsquestion_t* dq)> ffipolicyfunc_t;
+
+ ServerPolicy(const std::string& name_, policyfunc_t policy_, bool isLua_): d_name(name_), d_policy(policy_), d_isLua(isLua_)
+ {
+ }
+
+ ServerPolicy(const std::string& name_, ffipolicyfunc_t policy_): d_name(name_), d_ffipolicy(policy_), d_isLua(true), d_isFFI(true)
+ {
+ }
+
+ /* create a per-thread FFI policy */
+ ServerPolicy(const std::string& name_, const std::string& code);
+
+ ServerPolicy()
+ {
+ }
+
+ std::shared_ptr<DownstreamState> getSelectedBackend(const ServerPolicy::NumberedServerVector& servers, DNSQuestion& dq) const;
+
+ const std::string& getName() const
+ {
+ return d_name;
+ }
+
+ std::string toString() const {
+ return string("ServerPolicy") + (d_isLua ? " (Lua)" : "") + " \"" + d_name + "\"";
+ }
+
+private:
+ struct PerThreadState
+ {
+ LuaContext d_luaContext;
+ std::unordered_map<std::string, ffipolicyfunc_t> d_policies;
+ bool d_initialized{false};
+ };
+
+ const ffipolicyfunc_t& getPerThreadPolicy() const;
+ static thread_local PerThreadState t_perThreadState;
+
+
+public:
+ std::string d_name;
+ std::string d_perThreadPolicyCode;
+
+ policyfunc_t d_policy;
+ ffipolicyfunc_t d_ffipolicy;
+
+ bool d_isLua{false};
+ bool d_isFFI{false};
+ bool d_isPerThread{false};
+};
+
+struct ServerPool;
+
+using pools_t = map<std::string, std::shared_ptr<ServerPool>>;
+std::shared_ptr<ServerPool> getPool(const pools_t& pools, const std::string& poolName);
+std::shared_ptr<ServerPool> createPoolIfNotExists(pools_t& pools, const string& poolName);
+void setPoolPolicy(pools_t& pools, const string& poolName, std::shared_ptr<ServerPolicy> policy);
+void addServerToPool(pools_t& pools, const string& poolName, std::shared_ptr<DownstreamState> server);
+void removeServerFromPool(pools_t& pools, const string& poolName, std::shared_ptr<DownstreamState> server);
+
+const std::shared_ptr<ServerPolicy::NumberedServerVector> getDownstreamCandidates(const map<std::string,std::shared_ptr<ServerPool>>& pools, const std::string& poolName);
+
+std::shared_ptr<DownstreamState> firstAvailable(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq);
+
+std::shared_ptr<DownstreamState> leastOutstanding(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq);
+std::shared_ptr<DownstreamState> wrandom(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq);
+std::shared_ptr<DownstreamState> whashed(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq);
+std::shared_ptr<DownstreamState> whashedFromHash(const ServerPolicy::NumberedServerVector& servers, size_t hash);
+std::shared_ptr<DownstreamState> chashed(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq);
+std::shared_ptr<DownstreamState> chashedFromHash(const ServerPolicy::NumberedServerVector& servers, size_t hash);
+std::shared_ptr<DownstreamState> roundrobin(const ServerPolicy::NumberedServerVector& servers, const DNSQuestion* dq);
+
+extern double g_consistentHashBalancingFactor;
+extern double g_weightedBalancingFactor;
+extern uint32_t g_hashperturb;
+extern bool g_roundrobinFailOnNoServer;
diff --git a/dnsdist-lua-actions.cc b/dnsdist-lua-actions.cc
new file mode 100644
index 0000000..03475f7
--- /dev/null
+++ b/dnsdist-lua-actions.cc
@@ -0,0 +1,2454 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "config.h"
+#include "threadname.hh"
+#include "dnsdist.hh"
+#include "dnsdist-ecs.hh"
+#include "dnsdist-lua.hh"
+#include "dnsdist-lua-ffi.hh"
+#include "dnsdist-protobuf.hh"
+#include "dnsdist-kvs.hh"
+#include "dnsdist-svc.hh"
+
+#include "dolog.hh"
+#include "dnstap.hh"
+#include "dnswriter.hh"
+#include "ednsoptions.hh"
+#include "fstrm_logger.hh"
+#include "remote_logger.hh"
+#include "svc-records.hh"
+
+#include <boost/optional/optional_io.hpp>
+
+#ifdef HAVE_LIBCRYPTO
+#include "ipcipher.hh"
+#endif /* HAVE_LIBCRYPTO */
+
+class DropAction : public DNSAction
+{
+public:
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ return Action::Drop;
+ }
+ std::string toString() const override
+ {
+ return "drop";
+ }
+};
+
+class AllowAction : public DNSAction
+{
+public:
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ return Action::Allow;
+ }
+ std::string toString() const override
+ {
+ return "allow";
+ }
+};
+
+class NoneAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "no op";
+ }
+};
+
+class QPSAction : public DNSAction
+{
+public:
+ QPSAction(int limit) : d_qps(QPSLimiter(limit, limit))
+ {
+ }
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ if (d_qps.lock()->check()) {
+ return Action::None;
+ }
+ else {
+ return Action::Drop;
+ }
+ }
+ std::string toString() const override
+ {
+ return "qps limit to "+std::to_string(d_qps.lock()->getRate());
+ }
+private:
+ mutable LockGuarded<QPSLimiter> d_qps;
+};
+
+class DelayAction : public DNSAction
+{
+public:
+ DelayAction(int msec) : d_msec(msec)
+ {
+ }
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ *ruleresult = std::to_string(d_msec);
+ return Action::Delay;
+ }
+ std::string toString() const override
+ {
+ return "delay by "+std::to_string(d_msec)+ " msec";
+ }
+private:
+ int d_msec;
+};
+
+class TeeAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ TeeAction(const ComboAddress& ca, bool addECS=false);
+ ~TeeAction() override;
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override;
+ std::string toString() const override;
+ std::map<std::string, double> getStats() const override;
+
+private:
+ ComboAddress d_remote;
+ std::thread d_worker;
+ void worker();
+
+ int d_fd{-1};
+ mutable std::atomic<unsigned long> d_senderrors{0};
+ unsigned long d_recverrors{0};
+ mutable std::atomic<unsigned long> d_queries{0};
+ stat_t d_responses{0};
+ stat_t d_nxdomains{0};
+ stat_t d_servfails{0};
+ stat_t d_refuseds{0};
+ stat_t d_formerrs{0};
+ stat_t d_notimps{0};
+ stat_t d_noerrors{0};
+ mutable stat_t d_tcpdrops{0};
+ stat_t d_otherrcode{0};
+ std::atomic<bool> d_pleaseQuit{false};
+ bool d_addECS{false};
+};
+
+TeeAction::TeeAction(const ComboAddress& ca, bool addECS) : d_remote(ca), d_addECS(addECS)
+{
+ d_fd=SSocket(d_remote.sin4.sin_family, SOCK_DGRAM, 0);
+ try {
+ SConnect(d_fd, d_remote);
+ setNonBlocking(d_fd);
+ d_worker=std::thread([this](){worker();});
+ }
+ catch (...) {
+ if (d_fd != -1) {
+ close(d_fd);
+ }
+ throw;
+ }
+}
+
+TeeAction::~TeeAction()
+{
+ d_pleaseQuit=true;
+ close(d_fd);
+ d_worker.join();
+}
+
+DNSAction::Action TeeAction::operator()(DNSQuestion* dq, std::string* ruleresult) const
+{
+ if (dq->overTCP()) {
+ d_tcpdrops++;
+ }
+ else {
+ ssize_t res;
+ d_queries++;
+
+ if(d_addECS) {
+ PacketBuffer query(dq->getData());
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+
+ std::string newECSOption;
+ generateECSOption(dq->ecsSet ? dq->ecs.getNetwork() : *dq->remote, newECSOption, dq->ecsSet ? dq->ecs.getBits() : dq->ecsPrefixLength);
+
+ if (!handleEDNSClientSubnet(query, dq->getMaximumSize(), dq->qname->wirelength(), ednsAdded, ecsAdded, dq->ecsOverride, newECSOption)) {
+ return DNSAction::Action::None;
+ }
+
+ res = send(d_fd, query.data(), query.size(), 0);
+ }
+ else {
+ res = send(d_fd, dq->getData().data(), dq->getData().size(), 0);
+ }
+
+ if (res <= 0) {
+ d_senderrors++;
+ }
+ }
+
+ return DNSAction::Action::None;
+}
+
+std::string TeeAction::toString() const
+{
+ return "tee to "+d_remote.toStringWithPort();
+}
+
+std::map<std::string,double> TeeAction::getStats() const
+{
+ return {{"queries", d_queries},
+ {"responses", d_responses},
+ {"recv-errors", d_recverrors},
+ {"send-errors", d_senderrors},
+ {"noerrors", d_noerrors},
+ {"nxdomains", d_nxdomains},
+ {"refuseds", d_refuseds},
+ {"servfails", d_servfails},
+ {"other-rcode", d_otherrcode},
+ {"tcp-drops", d_tcpdrops}
+ };
+}
+
+void TeeAction::worker()
+{
+ setThreadName("dnsdist/TeeWork");
+ char packet[1500];
+ int res=0;
+ struct dnsheader* dh=(struct dnsheader*)packet;
+ for(;;) {
+ res=waitForData(d_fd, 0, 250000);
+ if(d_pleaseQuit)
+ break;
+ if(res < 0) {
+ usleep(250000);
+ continue;
+ }
+ if(res==0)
+ continue;
+ res=recv(d_fd, packet, sizeof(packet), 0);
+ if(res <= (int)sizeof(struct dnsheader))
+ d_recverrors++;
+ else
+ d_responses++;
+
+ if(dh->rcode == RCode::NoError)
+ d_noerrors++;
+ else if(dh->rcode == RCode::ServFail)
+ d_servfails++;
+ else if(dh->rcode == RCode::NXDomain)
+ d_nxdomains++;
+ else if(dh->rcode == RCode::Refused)
+ d_refuseds++;
+ else if(dh->rcode == RCode::FormErr)
+ d_formerrs++;
+ else if(dh->rcode == RCode::NotImp)
+ d_notimps++;
+ }
+}
+
+class PoolAction : public DNSAction
+{
+public:
+ PoolAction(const std::string& pool) : d_pool(pool) {}
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ *ruleresult=d_pool;
+ return Action::Pool;
+ }
+ std::string toString() const override
+ {
+ return "to pool "+d_pool;
+ }
+
+private:
+ std::string d_pool;
+};
+
+
+class QPSPoolAction : public DNSAction
+{
+public:
+ QPSPoolAction(unsigned int limit, const std::string& pool) : d_qps(QPSLimiter(limit, limit)), d_pool(pool) {}
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ if (d_qps.lock()->check()) {
+ *ruleresult = d_pool;
+ return Action::Pool;
+ }
+ else {
+ return Action::None;
+ }
+ }
+ std::string toString() const override
+ {
+ return "max " +std::to_string(d_qps.lock()->getRate())+" to pool "+d_pool;
+ }
+
+private:
+ mutable LockGuarded<QPSLimiter> d_qps;
+ const std::string d_pool;
+};
+
+class RCodeAction : public DNSAction
+{
+public:
+ RCodeAction(uint8_t rcode) : d_rcode(rcode) {}
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->getHeader()->rcode = d_rcode;
+ dq->getHeader()->qr = true; // for good measure
+ setResponseHeadersFromConfig(*dq->getHeader(), d_responseConfig);
+ return Action::HeaderModify;
+ }
+ std::string toString() const override
+ {
+ return "set rcode "+std::to_string(d_rcode);
+ }
+
+ ResponseConfig d_responseConfig;
+private:
+ uint8_t d_rcode;
+};
+
+class ERCodeAction : public DNSAction
+{
+public:
+ ERCodeAction(uint8_t rcode) : d_rcode(rcode) {}
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->getHeader()->rcode = (d_rcode & 0xF);
+ dq->ednsRCode = ((d_rcode & 0xFFF0) >> 4);
+ dq->getHeader()->qr = true; // for good measure
+ setResponseHeadersFromConfig(*dq->getHeader(), d_responseConfig);
+ return Action::HeaderModify;
+ }
+ std::string toString() const override
+ {
+ return "set ercode "+ERCode::to_s(d_rcode);
+ }
+
+ ResponseConfig d_responseConfig;
+private:
+ uint8_t d_rcode;
+};
+
+class SpoofSVCAction : public DNSAction
+{
+public:
+ SpoofSVCAction(const std::vector<std::pair<int, SVCRecordParameters>>& parameters)
+ {
+ d_payloads.reserve(parameters.size());
+
+ for (const auto& param : parameters) {
+ std::vector<uint8_t> payload;
+ if (!generateSVCPayload(payload, param.second)) {
+ throw std::runtime_error("Unable to generate a valid SVC record from the supplied parameters");
+ }
+
+ d_totalPayloadsSize += payload.size();
+ d_payloads.push_back(std::move(payload));
+
+ for (const auto& hint : param.second.ipv4hints) {
+ d_additionals4.insert({ param.second.target, ComboAddress(hint) });
+ }
+
+ for (const auto& hint : param.second.ipv6hints) {
+ d_additionals6.insert({ param.second.target, ComboAddress(hint) });
+ }
+ }
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ /* it will likely be a bit bigger than that because of additionals */
+ uint16_t numberOfRecords = d_payloads.size();
+ const auto qnameWireLength = dq->qname->wirelength();
+ if (dq->getMaximumSize() < (sizeof(dnsheader) + qnameWireLength + 4 + numberOfRecords*12 /* recordstart */ + d_totalPayloadsSize)) {
+ return Action::None;
+ }
+
+ PacketBuffer newPacket;
+ newPacket.reserve(sizeof(dnsheader) + qnameWireLength + 4 + numberOfRecords*12 /* recordstart */ + d_totalPayloadsSize);
+ GenericDNSPacketWriter<PacketBuffer> pw(newPacket, *dq->qname, dq->qtype);
+ for (const auto& payload : d_payloads) {
+ pw.startRecord(*dq->qname, dq->qtype, d_responseConfig.ttl);
+ pw.xfrBlob(payload);
+ pw.commit();
+ }
+
+ if (newPacket.size() < dq->getMaximumSize()) {
+ for (const auto& additional : d_additionals4) {
+ pw.startRecord(additional.first.isRoot() ? *dq->qname : additional.first, QType::A, d_responseConfig.ttl, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pw.xfrCAWithoutPort(4, additional.second);
+ pw.commit();
+ }
+ }
+
+ if (newPacket.size() < dq->getMaximumSize()) {
+ for (const auto& additional : d_additionals6) {
+ pw.startRecord(additional.first.isRoot() ? *dq->qname : additional.first, QType::AAAA, d_responseConfig.ttl, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pw.xfrCAWithoutPort(6, additional.second);
+ pw.commit();
+ }
+ }
+
+ if (g_addEDNSToSelfGeneratedResponses && queryHasEDNS(*dq)) {
+ bool dnssecOK = getEDNSZ(*dq) & EDNS_HEADER_FLAG_DO;
+ pw.addOpt(g_PayloadSizeSelfGenAnswers, 0, dnssecOK ? EDNS_HEADER_FLAG_DO : 0);
+ pw.commit();
+ }
+
+ if (newPacket.size() >= dq->getMaximumSize()) {
+ /* sorry! */
+ return Action::None;
+ }
+
+ pw.getHeader()->id = dq->getHeader()->id;
+ pw.getHeader()->qr = true; // for good measure
+ setResponseHeadersFromConfig(*pw.getHeader(), d_responseConfig);
+ dq->getMutableData() = std::move(newPacket);
+
+ return Action::HeaderModify;
+ }
+ std::string toString() const override
+ {
+ return "spoof SVC record ";
+ }
+
+ ResponseConfig d_responseConfig;
+private:
+ std::vector<std::vector<uint8_t>> d_payloads;
+ std::set<std::pair<DNSName, ComboAddress>> d_additionals4;
+ std::set<std::pair<DNSName, ComboAddress>> d_additionals6;
+ size_t d_totalPayloadsSize{0};
+};
+
+class TCAction : public DNSAction
+{
+public:
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ return Action::Truncate;
+ }
+ std::string toString() const override
+ {
+ return "tc=1 answer";
+ }
+};
+
+class LuaAction : public DNSAction
+{
+public:
+ typedef std::function<std::tuple<int, boost::optional<string> >(DNSQuestion* dq)> func_t;
+ LuaAction(const LuaAction::func_t& func) : d_func(func)
+ {}
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ auto lock = g_lua.lock();
+ try {
+ auto ret = d_func(dq);
+ if (ruleresult) {
+ if (boost::optional<std::string> rule = std::get<1>(ret)) {
+ *ruleresult = *rule;
+ }
+ else {
+ // default to empty string
+ ruleresult->clear();
+ }
+ }
+ return static_cast<Action>(std::get<0>(ret));
+ } catch (const std::exception &e) {
+ warnlog("LuaAction failed inside Lua, returning ServFail: %s", e.what());
+ } catch (...) {
+ warnlog("LuaAction failed inside Lua, returning ServFail: [unknown exception]");
+ }
+ return DNSAction::Action::ServFail;
+ }
+
+ string toString() const override
+ {
+ return "Lua script";
+ }
+private:
+ func_t d_func;
+};
+
+class LuaResponseAction : public DNSResponseAction
+{
+public:
+ typedef std::function<std::tuple<int, boost::optional<string> >(DNSResponse* dr)> func_t;
+ LuaResponseAction(const LuaResponseAction::func_t& func) : d_func(func)
+ {}
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ auto lock = g_lua.lock();
+ try {
+ auto ret = d_func(dr);
+ if (ruleresult) {
+ if (boost::optional<std::string> rule = std::get<1>(ret)) {
+ *ruleresult = *rule;
+ }
+ else {
+ // default to empty string
+ ruleresult->clear();
+ }
+ }
+ return static_cast<Action>(std::get<0>(ret));
+ } catch (const std::exception &e) {
+ warnlog("LuaResponseAction failed inside Lua, returning ServFail: %s", e.what());
+ } catch (...) {
+ warnlog("LuaResponseAction failed inside Lua, returning ServFail: [unknown exception]");
+ }
+ return DNSResponseAction::Action::ServFail;
+ }
+
+ string toString() const override
+ {
+ return "Lua response script";
+ }
+private:
+ func_t d_func;
+};
+
+class LuaFFIAction: public DNSAction
+{
+public:
+ typedef std::function<int(dnsdist_ffi_dnsquestion_t* dq)> func_t;
+
+ LuaFFIAction(const LuaFFIAction::func_t& func): d_func(func)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dnsdist_ffi_dnsquestion_t dqffi(dq);
+ try {
+ auto lock = g_lua.lock();
+ auto ret = d_func(&dqffi);
+ if (ruleresult) {
+ if (dqffi.result) {
+ *ruleresult = *dqffi.result;
+ }
+ else {
+ // default to empty string
+ ruleresult->clear();
+ }
+ }
+ return static_cast<DNSAction::Action>(ret);
+ } catch (const std::exception &e) {
+ warnlog("LuaFFIAction failed inside Lua, returning ServFail: %s", e.what());
+ } catch (...) {
+ warnlog("LuaFFIAction failed inside Lua, returning ServFail: [unknown exception]");
+ }
+ return DNSAction::Action::ServFail;
+ }
+
+ string toString() const override
+ {
+ return "Lua FFI script";
+ }
+private:
+ func_t d_func;
+};
+
+class LuaFFIPerThreadAction: public DNSAction
+{
+public:
+ typedef std::function<int(dnsdist_ffi_dnsquestion_t* dq)> func_t;
+
+ LuaFFIPerThreadAction(const std::string& code): d_functionCode(code), d_functionID(s_functionsCounter++)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ try {
+ auto& state = t_perThreadStates[d_functionID];
+ if (!state.d_initialized) {
+ setupLuaFFIPerThreadContext(state.d_luaContext);
+ /* mark the state as initialized first so if there is a syntax error
+ we only try to execute the code once */
+ state.d_initialized = true;
+ state.d_func = state.d_luaContext.executeCode<func_t>(d_functionCode);
+ }
+
+ if (!state.d_func) {
+ /* the function was not properly initialized */
+ return DNSAction::Action::None;
+ }
+
+ dnsdist_ffi_dnsquestion_t dqffi(dq);
+ auto ret = state.d_func(&dqffi);
+ if (ruleresult) {
+ if (dqffi.result) {
+ *ruleresult = *dqffi.result;
+ }
+ else {
+ // default to empty string
+ ruleresult->clear();
+ }
+ }
+ return static_cast<DNSAction::Action>(ret);
+ }
+ catch (const std::exception &e) {
+ warnlog("LuaFFIPerThreadAction failed inside Lua, returning ServFail: %s", e.what());
+ }
+ catch (...) {
+ warnlog("LuaFFIPerthreadAction failed inside Lua, returning ServFail: [unknown exception]");
+ }
+ return DNSAction::Action::ServFail;
+ }
+
+ string toString() const override
+ {
+ return "Lua FFI per-thread script";
+ }
+
+private:
+ struct PerThreadState
+ {
+ LuaContext d_luaContext;
+ func_t d_func;
+ bool d_initialized{false};
+ };
+ static std::atomic<uint64_t> s_functionsCounter;
+ static thread_local std::map<uint64_t, PerThreadState> t_perThreadStates;
+ const std::string d_functionCode;
+ const uint64_t d_functionID;
+};
+
+std::atomic<uint64_t> LuaFFIPerThreadAction::s_functionsCounter = 0;
+thread_local std::map<uint64_t, LuaFFIPerThreadAction::PerThreadState> LuaFFIPerThreadAction::t_perThreadStates;
+
+class LuaFFIResponseAction: public DNSResponseAction
+{
+public:
+ typedef std::function<int(dnsdist_ffi_dnsquestion_t* dq)> func_t;
+
+ LuaFFIResponseAction(const LuaFFIResponseAction::func_t& func): d_func(func)
+ {
+ }
+
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ DNSQuestion* dq = dynamic_cast<DNSQuestion*>(dr);
+ if (dq == nullptr) {
+ return DNSResponseAction::Action::ServFail;
+ }
+
+ dnsdist_ffi_dnsquestion_t dqffi(dq);
+ try {
+ auto lock = g_lua.lock();
+ auto ret = d_func(&dqffi);
+ if (ruleresult) {
+ if (dqffi.result) {
+ *ruleresult = *dqffi.result;
+ }
+ else {
+ // default to empty string
+ ruleresult->clear();
+ }
+ }
+ return static_cast<DNSResponseAction::Action>(ret);
+ } catch (const std::exception &e) {
+ warnlog("LuaFFIResponseAction failed inside Lua, returning ServFail: %s", e.what());
+ } catch (...) {
+ warnlog("LuaFFIResponseAction failed inside Lua, returning ServFail: [unknown exception]");
+ }
+ return DNSResponseAction::Action::ServFail;
+ }
+
+ string toString() const override
+ {
+ return "Lua FFI script";
+ }
+private:
+ func_t d_func;
+};
+
+class LuaFFIPerThreadResponseAction: public DNSResponseAction
+{
+public:
+ typedef std::function<int(dnsdist_ffi_dnsquestion_t* dq)> func_t;
+
+ LuaFFIPerThreadResponseAction(const std::string& code): d_functionCode(code), d_functionID(s_functionsCounter++)
+ {
+ }
+
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ DNSQuestion* dq = dynamic_cast<DNSQuestion*>(dr);
+ if (dq == nullptr) {
+ return DNSResponseAction::Action::ServFail;
+ }
+
+ try {
+ auto& state = t_perThreadStates[d_functionID];
+ if (!state.d_initialized) {
+ setupLuaFFIPerThreadContext(state.d_luaContext);
+ /* mark the state as initialized first so if there is a syntax error
+ we only try to execute the code once */
+ state.d_initialized = true;
+ state.d_func = state.d_luaContext.executeCode<func_t>(d_functionCode);
+ }
+
+ if (!state.d_func) {
+ /* the function was not properly initialized */
+ return DNSResponseAction::Action::None;
+ }
+
+ dnsdist_ffi_dnsquestion_t dqffi(dq);
+ auto ret = state.d_func(&dqffi);
+ if (ruleresult) {
+ if (dqffi.result) {
+ *ruleresult = *dqffi.result;
+ }
+ else {
+ // default to empty string
+ ruleresult->clear();
+ }
+ }
+ return static_cast<DNSResponseAction::Action>(ret);
+ }
+ catch (const std::exception &e) {
+ warnlog("LuaFFIPerThreadResponseAction failed inside Lua, returning ServFail: %s", e.what());
+ }
+ catch (...) {
+ warnlog("LuaFFIPerthreadResponseAction failed inside Lua, returning ServFail: [unknown exception]");
+ }
+ return DNSResponseAction::Action::ServFail;
+ }
+
+ string toString() const override
+ {
+ return "Lua FFI per-thread script";
+ }
+
+private:
+ struct PerThreadState
+ {
+ LuaContext d_luaContext;
+ func_t d_func;
+ bool d_initialized{false};
+ };
+
+ static std::atomic<uint64_t> s_functionsCounter;
+ static thread_local std::map<uint64_t, PerThreadState> t_perThreadStates;
+ const std::string d_functionCode;
+ const uint64_t d_functionID;
+};
+
+std::atomic<uint64_t> LuaFFIPerThreadResponseAction::s_functionsCounter = 0;
+thread_local std::map<uint64_t, LuaFFIPerThreadResponseAction::PerThreadState> LuaFFIPerThreadResponseAction::t_perThreadStates;
+
+thread_local std::default_random_engine SpoofAction::t_randomEngine;
+
+DNSAction::Action SpoofAction::operator()(DNSQuestion* dq, std::string* ruleresult) const
+{
+ uint16_t qtype = dq->qtype;
+ // do we even have a response?
+ if (d_cname.empty() &&
+ d_rawResponses.empty() &&
+ d_types.count(qtype) == 0) {
+ return Action::None;
+ }
+
+ vector<ComboAddress> addrs;
+ vector<std::string> rawResponses;
+ unsigned int totrdatalen = 0;
+ uint16_t numberOfRecords = 0;
+ if (!d_cname.empty()) {
+ qtype = QType::CNAME;
+ totrdatalen += d_cname.getStorage().size();
+ numberOfRecords = 1;
+ } else if (!d_rawResponses.empty()) {
+ rawResponses.reserve(d_rawResponses.size());
+ for(const auto& rawResponse : d_rawResponses){
+ totrdatalen += rawResponse.size();
+ rawResponses.push_back(rawResponse);
+ ++numberOfRecords;
+ }
+ if (rawResponses.size() > 1) {
+ shuffle(rawResponses.begin(), rawResponses.end(), t_randomEngine);
+ }
+ }
+ else {
+ for(const auto& addr : d_addrs) {
+ if(qtype != QType::ANY && ((addr.sin4.sin_family == AF_INET && qtype != QType::A) ||
+ (addr.sin4.sin_family == AF_INET6 && qtype != QType::AAAA))) {
+ continue;
+ }
+ totrdatalen += addr.sin4.sin_family == AF_INET ? sizeof(addr.sin4.sin_addr.s_addr) : sizeof(addr.sin6.sin6_addr.s6_addr);
+ addrs.push_back(addr);
+ ++numberOfRecords;
+ }
+ }
+
+ if (addrs.size() > 1) {
+ shuffle(addrs.begin(), addrs.end(), t_randomEngine);
+ }
+
+ unsigned int qnameWireLength=0;
+ DNSName ignore(reinterpret_cast<const char*>(dq->getData().data()), dq->getData().size(), sizeof(dnsheader), false, 0, 0, &qnameWireLength);
+
+ if (dq->getMaximumSize() < (sizeof(dnsheader) + qnameWireLength + 4 + numberOfRecords*12 /* recordstart */ + totrdatalen)) {
+ return Action::None;
+ }
+
+ bool dnssecOK = false;
+ bool hadEDNS = false;
+ if (g_addEDNSToSelfGeneratedResponses && queryHasEDNS(*dq)) {
+ hadEDNS = true;
+ dnssecOK = getEDNSZ(*dq) & EDNS_HEADER_FLAG_DO;
+ }
+
+ auto& data = dq->getMutableData();
+ data.resize(sizeof(dnsheader) + qnameWireLength + 4 + numberOfRecords*12 /* recordstart */ + totrdatalen); // there goes your EDNS
+ uint8_t* dest = &(data.at(sizeof(dnsheader) + qnameWireLength + 4));
+
+ dq->getHeader()->qr = true; // for good measure
+ setResponseHeadersFromConfig(*dq->getHeader(), d_responseConfig);
+ dq->getHeader()->ancount = 0;
+ dq->getHeader()->arcount = 0; // for now, forget about your EDNS, we're marching over it
+
+ uint32_t ttl = htonl(d_responseConfig.ttl);
+ unsigned char recordstart[] = {0xc0, 0x0c, // compressed name
+ 0, 0, // QTYPE
+ 0, QClass::IN,
+ 0, 0, 0, 0, // TTL
+ 0, 0 }; // rdata length
+ static_assert(sizeof(recordstart) == 12, "sizeof(recordstart) must be equal to 12, otherwise the above check is invalid");
+ memcpy(&recordstart[6], &ttl, sizeof(ttl));
+ bool raw = false;
+
+ if (qtype == QType::CNAME) {
+ const auto& wireData = d_cname.getStorage(); // Note! This doesn't do compression!
+ uint16_t rdataLen = htons(wireData.length());
+ qtype = htons(qtype);
+ memcpy(&recordstart[2], &qtype, sizeof(qtype));
+ memcpy(&recordstart[10], &rdataLen, sizeof(rdataLen));
+
+ memcpy(dest, recordstart, sizeof(recordstart));
+ dest += sizeof(recordstart);
+ memcpy(dest, wireData.c_str(), wireData.length());
+ dq->getHeader()->ancount++;
+ }
+ else if (!rawResponses.empty()) {
+ qtype = htons(qtype);
+ for(const auto& rawResponse : rawResponses){
+ uint16_t rdataLen = htons(rawResponse.size());
+ memcpy(&recordstart[2], &qtype, sizeof(qtype));
+ memcpy(&recordstart[10], &rdataLen, sizeof(rdataLen));
+
+ memcpy(dest, recordstart, sizeof(recordstart));
+ dest += sizeof(recordstart);
+
+ memcpy(dest, rawResponse.c_str(), rawResponse.size());
+ dest += rawResponse.size();
+
+ dq->getHeader()->ancount++;
+ }
+ raw = true;
+ }
+ else {
+ for(const auto& addr : addrs) {
+ uint16_t rdataLen = htons(addr.sin4.sin_family == AF_INET ? sizeof(addr.sin4.sin_addr.s_addr) : sizeof(addr.sin6.sin6_addr.s6_addr));
+ qtype = htons(addr.sin4.sin_family == AF_INET ? QType::A : QType::AAAA);
+ memcpy(&recordstart[2], &qtype, sizeof(qtype));
+ memcpy(&recordstart[10], &rdataLen, sizeof(rdataLen));
+
+ memcpy(dest, recordstart, sizeof(recordstart));
+ dest += sizeof(recordstart);
+
+ memcpy(dest,
+ addr.sin4.sin_family == AF_INET ? reinterpret_cast<const void*>(&addr.sin4.sin_addr.s_addr) : reinterpret_cast<const void*>(&addr.sin6.sin6_addr.s6_addr),
+ addr.sin4.sin_family == AF_INET ? sizeof(addr.sin4.sin_addr.s_addr) : sizeof(addr.sin6.sin6_addr.s6_addr));
+ dest += (addr.sin4.sin_family == AF_INET ? sizeof(addr.sin4.sin_addr.s_addr) : sizeof(addr.sin6.sin6_addr.s6_addr));
+ dq->getHeader()->ancount++;
+ }
+ }
+
+ dq->getHeader()->ancount = htons(dq->getHeader()->ancount);
+
+ if (hadEDNS && raw == false) {
+ addEDNS(dq->getMutableData(), dq->getMaximumSize(), dnssecOK, g_PayloadSizeSelfGenAnswers, 0);
+ }
+
+ return Action::HeaderModify;
+}
+
+class SetMacAddrAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SetMacAddrAction(uint16_t code) : d_code(code)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ std::string mac = getMACAddress(*dq->remote);
+ if (mac.empty()) {
+ return Action::None;
+ }
+
+ std::string optRData;
+ generateEDNSOption(d_code, mac, optRData);
+
+ if (dq->getHeader()->arcount) {
+ bool ednsAdded = false;
+ bool optionAdded = false;
+ PacketBuffer newContent;
+ newContent.reserve(dq->getData().size());
+
+ if (!slowRewriteEDNSOptionInQueryWithRecords(dq->getData(), newContent, ednsAdded, d_code, optionAdded, true, optRData)) {
+ return Action::None;
+ }
+
+ if (newContent.size() > dq->getMaximumSize()) {
+ return Action::None;
+ }
+
+ dq->getMutableData() = std::move(newContent);
+ if (!dq->ednsAdded && ednsAdded) {
+ dq->ednsAdded = true;
+ }
+
+ return Action::None;
+ }
+
+ auto& data = dq->getMutableData();
+ if (generateOptRR(optRData, data, dq->getMaximumSize(), g_EdnsUDPPayloadSize, 0, false)) {
+ dq->getHeader()->arcount = htons(1);
+ // make sure that any EDNS sent by the backend is removed before forwarding the response to the client
+ dq->ednsAdded = true;
+ }
+
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "add EDNS MAC (code=" + std::to_string(d_code) + ")";
+ }
+private:
+ uint16_t d_code{3};
+};
+
+
+class SetEDNSOptionAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SetEDNSOptionAction(uint16_t code, const std::string& data) : d_code(code), d_data(data)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ std::string optRData;
+ generateEDNSOption(d_code, d_data, optRData);
+
+ if (dq->getHeader()->arcount) {
+ bool ednsAdded = false;
+ bool optionAdded = false;
+ PacketBuffer newContent;
+ newContent.reserve(dq->getData().size());
+
+ if (!slowRewriteEDNSOptionInQueryWithRecords(dq->getData(), newContent, ednsAdded, d_code, optionAdded, true, optRData)) {
+ return Action::None;
+ }
+
+ if (newContent.size() > dq->getMaximumSize()) {
+ return Action::None;
+ }
+
+ dq->getMutableData() = std::move(newContent);
+ if (!dq->ednsAdded && ednsAdded) {
+ dq->ednsAdded = true;
+ }
+
+ return Action::None;
+ }
+
+ auto& data = dq->getMutableData();
+ if (generateOptRR(optRData, data, dq->getMaximumSize(), g_EdnsUDPPayloadSize, 0, false)) {
+ dq->getHeader()->arcount = htons(1);
+ // make sure that any EDNS sent by the backend is removed before forwarding the response to the client
+ dq->ednsAdded = true;
+ }
+
+ return Action::None;
+ }
+
+ std::string toString() const override
+ {
+ return "add EDNS Option (code=" + std::to_string(d_code) + ")";
+ }
+
+private:
+ uint16_t d_code;
+ std::string d_data;
+};
+
+class SetNoRecurseAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->getHeader()->rd = false;
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "set rd=0";
+ }
+};
+
+class LogAction : public DNSAction, public boost::noncopyable
+{
+public:
+ // this action does not stop the processing
+ LogAction()
+ {
+ }
+
+ LogAction(const std::string& str, bool binary=true, bool append=false, bool buffered=true, bool verboseOnly=true, bool includeTimestamp=false): d_fname(str), d_binary(binary), d_verboseOnly(verboseOnly), d_includeTimestamp(includeTimestamp), d_append(append), d_buffered(buffered)
+ {
+ if (str.empty()) {
+ return;
+ }
+
+ if (!reopenLogFile()) {
+ throw std::runtime_error("Unable to open file '" + str + "' for logging: " + stringerror());
+ }
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ auto fp = std::atomic_load_explicit(&d_fp, std::memory_order_acquire);
+ if (!fp) {
+ if (!d_verboseOnly || g_verbose) {
+ if (d_includeTimestamp) {
+ infolog("[%u.%u] Packet from %s for %s %s with id %d", static_cast<unsigned long long>(dq->queryTime->tv_sec), static_cast<unsigned long>(dq->queryTime->tv_nsec), dq->remote->toStringWithPort(), dq->qname->toString(), QType(dq->qtype).toString(), dq->getHeader()->id);
+ }
+ else {
+ infolog("Packet from %s for %s %s with id %d", dq->remote->toStringWithPort(), dq->qname->toString(), QType(dq->qtype).toString(), dq->getHeader()->id);
+ }
+ }
+ }
+ else {
+ if (d_binary) {
+ const auto& out = dq->qname->getStorage();
+ if (d_includeTimestamp) {
+ uint64_t tv_sec = static_cast<uint64_t>(dq->queryTime->tv_sec);
+ uint32_t tv_nsec = static_cast<uint32_t>(dq->queryTime->tv_nsec);
+ fwrite(&tv_sec, sizeof(tv_sec), 1, fp.get());
+ fwrite(&tv_nsec, sizeof(tv_nsec), 1, fp.get());
+ }
+ uint16_t id = dq->getHeader()->id;
+ fwrite(&id, sizeof(id), 1, fp.get());
+ fwrite(out.c_str(), 1, out.size(), fp.get());
+ fwrite(&dq->qtype, sizeof(dq->qtype), 1, fp.get());
+ fwrite(&dq->remote->sin4.sin_family, sizeof(dq->remote->sin4.sin_family), 1, fp.get());
+ if (dq->remote->sin4.sin_family == AF_INET) {
+ fwrite(&dq->remote->sin4.sin_addr.s_addr, sizeof(dq->remote->sin4.sin_addr.s_addr), 1, fp.get());
+ }
+ else if (dq->remote->sin4.sin_family == AF_INET6) {
+ fwrite(&dq->remote->sin6.sin6_addr.s6_addr, sizeof(dq->remote->sin6.sin6_addr.s6_addr), 1, fp.get());
+ }
+ fwrite(&dq->remote->sin4.sin_port, sizeof(dq->remote->sin4.sin_port), 1, fp.get());
+ }
+ else {
+ if (d_includeTimestamp) {
+ fprintf(fp.get(), "[%llu.%lu] Packet from %s for %s %s with id %d\n", static_cast<unsigned long long>(dq->queryTime->tv_sec), static_cast<unsigned long>(dq->queryTime->tv_nsec), dq->remote->toStringWithPort().c_str(), dq->qname->toString().c_str(), QType(dq->qtype).toString().c_str(), dq->getHeader()->id);
+ }
+ else {
+ fprintf(fp.get(), "Packet from %s for %s %s with id %d\n", dq->remote->toStringWithPort().c_str(), dq->qname->toString().c_str(), QType(dq->qtype).toString().c_str(), dq->getHeader()->id);
+ }
+ }
+ }
+ return Action::None;
+ }
+
+ std::string toString() const override
+ {
+ if (!d_fname.empty()) {
+ return "log to " + d_fname;
+ }
+ return "log";
+ }
+
+ void reload() override
+ {
+ if (!reopenLogFile()) {
+ warnlog("Unable to open file '%s' for logging: %s", d_fname, stringerror());
+ }
+ }
+
+private:
+ bool reopenLogFile()
+ {
+ // we are using a naked pointer here because we don't want fclose to be called
+ // with a nullptr, which would happen if we constructor a shared_ptr with fclose
+ // as a custom deleter and nullptr as a FILE*
+ auto nfp = fopen(d_fname.c_str(), d_append ? "a+" : "w");
+ if (!nfp) {
+ /* don't fall on our sword when reopening */
+ return false;
+ }
+
+ auto fp = std::shared_ptr<FILE>(nfp, fclose);
+ nfp = nullptr;
+
+ if (!d_buffered) {
+ setbuf(fp.get(), 0);
+ }
+
+ std::atomic_store_explicit(&d_fp, fp, std::memory_order_release);
+ return true;
+ }
+
+ std::string d_fname;
+ std::shared_ptr<FILE> d_fp{nullptr};
+ bool d_binary{true};
+ bool d_verboseOnly{true};
+ bool d_includeTimestamp{false};
+ bool d_append{false};
+ bool d_buffered{true};
+};
+
+class LogResponseAction : public DNSResponseAction, public boost::noncopyable
+{
+public:
+ LogResponseAction()
+ {
+ }
+
+ LogResponseAction(const std::string& str, bool append=false, bool buffered=true, bool verboseOnly=true, bool includeTimestamp=false): d_fname(str), d_verboseOnly(verboseOnly), d_includeTimestamp(includeTimestamp), d_append(append), d_buffered(buffered)
+ {
+ if (str.empty()) {
+ return;
+ }
+
+ if (!reopenLogFile()) {
+ throw std::runtime_error("Unable to open file '" + str + "' for logging: " + stringerror());
+ }
+ }
+
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ auto fp = std::atomic_load_explicit(&d_fp, std::memory_order_acquire);
+ if (!fp) {
+ if (!d_verboseOnly || g_verbose) {
+ if (d_includeTimestamp) {
+ infolog("[%u.%u] Answer to %s for %s %s (%s) with id %d", static_cast<unsigned long long>(dr->queryTime->tv_sec), static_cast<unsigned long>(dr->queryTime->tv_nsec), dr->remote->toStringWithPort(), dr->qname->toString(), QType(dr->qtype).toString(), RCode::to_s(dr->getHeader()->rcode), dr->getHeader()->id);
+ }
+ else {
+ infolog("Answer to %s for %s %s (%s) with id %d", dr->remote->toStringWithPort(), dr->qname->toString(), QType(dr->qtype).toString(), RCode::to_s(dr->getHeader()->rcode), dr->getHeader()->id);
+ }
+ }
+ }
+ else {
+ if (d_includeTimestamp) {
+ fprintf(fp.get(), "[%llu.%lu] Answer to %s for %s %s (%s) with id %d\n", static_cast<unsigned long long>(dr->queryTime->tv_sec), static_cast<unsigned long>(dr->queryTime->tv_nsec), dr->remote->toStringWithPort().c_str(), dr->qname->toString().c_str(), QType(dr->qtype).toString().c_str(), RCode::to_s(dr->getHeader()->rcode).c_str(), dr->getHeader()->id);
+ }
+ else {
+ fprintf(fp.get(), "Answer to %s for %s %s (%s) with id %d\n", dr->remote->toStringWithPort().c_str(), dr->qname->toString().c_str(), QType(dr->qtype).toString().c_str(), RCode::to_s(dr->getHeader()->rcode).c_str(), dr->getHeader()->id);
+ }
+ }
+ return Action::None;
+ }
+
+ std::string toString() const override
+ {
+ if (!d_fname.empty()) {
+ return "log to " + d_fname;
+ }
+ return "log";
+ }
+
+ void reload() override
+ {
+ if (!reopenLogFile()) {
+ warnlog("Unable to open file '%s' for logging: %s", d_fname, stringerror());
+ }
+ }
+
+private:
+ bool reopenLogFile()
+ {
+ // we are using a naked pointer here because we don't want fclose to be called
+ // with a nullptr, which would happen if we constructor a shared_ptr with fclose
+ // as a custom deleter and nullptr as a FILE*
+ auto nfp = fopen(d_fname.c_str(), d_append ? "a+" : "w");
+ if (!nfp) {
+ /* don't fall on our sword when reopening */
+ return false;
+ }
+
+ auto fp = std::shared_ptr<FILE>(nfp, fclose);
+ nfp = nullptr;
+
+ if (!d_buffered) {
+ setbuf(fp.get(), 0);
+ }
+
+ std::atomic_store_explicit(&d_fp, fp, std::memory_order_release);
+ return true;
+ }
+
+ std::string d_fname;
+ std::shared_ptr<FILE> d_fp{nullptr};
+ bool d_verboseOnly{true};
+ bool d_includeTimestamp{false};
+ bool d_append{false};
+ bool d_buffered{true};
+};
+
+
+class SetDisableValidationAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->getHeader()->cd = true;
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "set cd=1";
+ }
+};
+
+class SetSkipCacheAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->skipCache = true;
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "skip cache";
+ }
+};
+
+class SetSkipCacheResponseAction : public DNSResponseAction
+{
+public:
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ dr->skipCache = true;
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "skip cache";
+ }
+};
+
+class SetTempFailureCacheTTLAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SetTempFailureCacheTTLAction(uint32_t ttl) : d_ttl(ttl)
+ {
+ }
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->tempFailureTTL = d_ttl;
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "set tempfailure cache ttl to "+std::to_string(d_ttl);
+ }
+private:
+ uint32_t d_ttl;
+};
+
+class SetECSPrefixLengthAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SetECSPrefixLengthAction(uint16_t v4Length, uint16_t v6Length) : d_v4PrefixLength(v4Length), d_v6PrefixLength(v6Length)
+ {
+ }
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->ecsPrefixLength = dq->remote->sin4.sin_family == AF_INET ? d_v4PrefixLength : d_v6PrefixLength;
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "set ECS prefix length to " + std::to_string(d_v4PrefixLength) + "/" + std::to_string(d_v6PrefixLength);
+ }
+private:
+ uint16_t d_v4PrefixLength;
+ uint16_t d_v6PrefixLength;
+};
+
+class SetECSOverrideAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SetECSOverrideAction(bool ecsOverride) : d_ecsOverride(ecsOverride)
+ {
+ }
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->ecsOverride = d_ecsOverride;
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "set ECS override to " + std::to_string(d_ecsOverride);
+ }
+private:
+ bool d_ecsOverride;
+};
+
+
+class SetDisableECSAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->useECS = false;
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "disable ECS";
+ }
+};
+
+class SetECSAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SetECSAction(const Netmask& v4): d_v4(v4), d_hasV6(false)
+ {
+ }
+
+ SetECSAction(const Netmask& v4, const Netmask& v6): d_v4(v4), d_v6(v6), d_hasV6(true)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->ecsSet = true;
+
+ if (d_hasV6) {
+ dq->ecs = dq->remote->isIPv4() ? d_v4 : d_v6;
+ }
+ else {
+ dq->ecs = d_v4;
+ }
+
+ return Action::None;
+ }
+
+ std::string toString() const override
+ {
+ std::string result = "set ECS to " + d_v4.toString();
+ if (d_hasV6) {
+ result += " / " + d_v6.toString();
+ }
+ return result;
+ }
+
+private:
+ Netmask d_v4;
+ Netmask d_v6;
+ bool d_hasV6;
+};
+
+static DnstapMessage::ProtocolType ProtocolToDNSTap(dnsdist::Protocol protocol)
+{
+ if (protocol == dnsdist::Protocol::DoUDP) {
+ return DnstapMessage::ProtocolType::DoUDP;
+ }
+ else if (protocol == dnsdist::Protocol::DoTCP) {
+ return DnstapMessage::ProtocolType::DoTCP;
+ }
+ else if (protocol == dnsdist::Protocol::DoT) {
+ return DnstapMessage::ProtocolType::DoT;
+ }
+ else if (protocol == dnsdist::Protocol::DoH) {
+ return DnstapMessage::ProtocolType::DoH;
+ }
+ else if (protocol == dnsdist::Protocol::DNSCryptUDP) {
+ return DnstapMessage::ProtocolType::DNSCryptUDP;
+ }
+ else if (protocol == dnsdist::Protocol::DNSCryptTCP) {
+ return DnstapMessage::ProtocolType::DNSCryptTCP;
+ }
+ throw std::runtime_error("Unhandled protocol for dnstap: " + protocol.toPrettyString());
+}
+
+class DnstapLogAction : public DNSAction, public boost::noncopyable
+{
+public:
+ // this action does not stop the processing
+ DnstapLogAction(const std::string& identity, std::shared_ptr<RemoteLoggerInterface>& logger, boost::optional<std::function<void(DNSQuestion*, DnstapMessage*)> > alterFunc): d_identity(identity), d_logger(logger), d_alterFunc(alterFunc)
+ {
+ }
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ static thread_local std::string data;
+ data.clear();
+
+ DnstapMessage::ProtocolType protocol = ProtocolToDNSTap(dq->getProtocol());
+ DnstapMessage message(data, !dq->getHeader()->qr ? DnstapMessage::MessageType::client_query : DnstapMessage::MessageType::client_response, d_identity, dq->remote, dq->local, protocol, reinterpret_cast<const char*>(dq->getData().data()), dq->getData().size(), dq->queryTime, nullptr);
+ {
+ if (d_alterFunc) {
+ auto lock = g_lua.lock();
+ (*d_alterFunc)(dq, &message);
+ }
+ }
+
+ d_logger->queueData(data);
+
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "remote log as dnstap to " + (d_logger ? d_logger->toString() : "");
+ }
+private:
+ std::string d_identity;
+ std::shared_ptr<RemoteLoggerInterface> d_logger;
+ boost::optional<std::function<void(DNSQuestion*, DnstapMessage*)> > d_alterFunc;
+};
+
+class RemoteLogAction : public DNSAction, public boost::noncopyable
+{
+public:
+ // this action does not stop the processing
+ RemoteLogAction(std::shared_ptr<RemoteLoggerInterface>& logger, boost::optional<std::function<void(DNSQuestion*, DNSDistProtoBufMessage*)> > alterFunc, const std::string& serverID, const std::string& ipEncryptKey): d_logger(logger), d_alterFunc(alterFunc), d_serverID(serverID), d_ipEncryptKey(ipEncryptKey)
+ {
+ }
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ if (!dq->uniqueId) {
+ dq->uniqueId = getUniqueID();
+ }
+
+ DNSDistProtoBufMessage message(*dq);
+ if (!d_serverID.empty()) {
+ message.setServerIdentity(d_serverID);
+ }
+
+#if HAVE_LIBCRYPTO
+ if (!d_ipEncryptKey.empty())
+ {
+ message.setRequestor(encryptCA(*dq->remote, d_ipEncryptKey));
+ }
+#endif /* HAVE_LIBCRYPTO */
+
+ if (d_alterFunc) {
+ auto lock = g_lua.lock();
+ (*d_alterFunc)(dq, &message);
+ }
+
+ static thread_local std::string data;
+ data.clear();
+ message.serialize(data);
+ d_logger->queueData(data);
+
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "remote log to " + (d_logger ? d_logger->toString() : "");
+ }
+private:
+ std::shared_ptr<RemoteLoggerInterface> d_logger;
+ boost::optional<std::function<void(DNSQuestion*, DNSDistProtoBufMessage*)> > d_alterFunc;
+ std::string d_serverID;
+ std::string d_ipEncryptKey;
+};
+
+class SNMPTrapAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SNMPTrapAction(const std::string& reason): d_reason(reason)
+ {
+ }
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ if (g_snmpAgent && g_snmpTrapsEnabled) {
+ g_snmpAgent->sendDNSTrap(*dq, d_reason);
+ }
+
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "send SNMP trap";
+ }
+private:
+ std::string d_reason;
+};
+
+class SetTagAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SetTagAction(const std::string& tag, const std::string& value): d_tag(tag), d_value(value)
+ {
+ }
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ dq->setTag(d_tag, d_value);
+
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "set tag '" + d_tag + "' to value '" + d_value + "'";
+ }
+private:
+ std::string d_tag;
+ std::string d_value;
+};
+
+class DnstapLogResponseAction : public DNSResponseAction, public boost::noncopyable
+{
+public:
+ // this action does not stop the processing
+ DnstapLogResponseAction(const std::string& identity, std::shared_ptr<RemoteLoggerInterface>& logger, boost::optional<std::function<void(DNSResponse*, DnstapMessage*)> > alterFunc): d_identity(identity), d_logger(logger), d_alterFunc(alterFunc)
+ {
+ }
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ static thread_local std::string data;
+ struct timespec now;
+ gettime(&now, true);
+ data.clear();
+
+ DnstapMessage::ProtocolType protocol = ProtocolToDNSTap(dr->getProtocol());
+ DnstapMessage message(data, DnstapMessage::MessageType::client_response, d_identity, dr->remote, dr->local, protocol, reinterpret_cast<const char*>(dr->getData().data()), dr->getData().size(), dr->queryTime, &now);
+ {
+ if (d_alterFunc) {
+ auto lock = g_lua.lock();
+ (*d_alterFunc)(dr, &message);
+ }
+ }
+
+ d_logger->queueData(data);
+
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "log response as dnstap to " + (d_logger ? d_logger->toString() : "");
+ }
+private:
+ std::string d_identity;
+ std::shared_ptr<RemoteLoggerInterface> d_logger;
+ boost::optional<std::function<void(DNSResponse*, DnstapMessage*)> > d_alterFunc;
+};
+
+class RemoteLogResponseAction : public DNSResponseAction, public boost::noncopyable
+{
+public:
+ // this action does not stop the processing
+ RemoteLogResponseAction(std::shared_ptr<RemoteLoggerInterface>& logger, boost::optional<std::function<void(DNSResponse*, DNSDistProtoBufMessage*)> > alterFunc, const std::string& serverID, const std::string& ipEncryptKey, bool includeCNAME): d_logger(logger), d_alterFunc(alterFunc), d_serverID(serverID), d_ipEncryptKey(ipEncryptKey), d_includeCNAME(includeCNAME)
+ {
+ }
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ if (!dr->uniqueId) {
+ dr->uniqueId = getUniqueID();
+ }
+
+ DNSDistProtoBufMessage message(*dr, d_includeCNAME);
+ if (!d_serverID.empty()) {
+ message.setServerIdentity(d_serverID);
+ }
+
+#if HAVE_LIBCRYPTO
+ if (!d_ipEncryptKey.empty())
+ {
+ message.setRequestor(encryptCA(*dr->remote, d_ipEncryptKey));
+ }
+#endif /* HAVE_LIBCRYPTO */
+
+ if (d_alterFunc) {
+ auto lock = g_lua.lock();
+ (*d_alterFunc)(dr, &message);
+ }
+
+ static thread_local std::string data;
+ data.clear();
+ message.serialize(data);
+ d_logger->queueData(data);
+
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "remote log response to " + (d_logger ? d_logger->toString() : "");
+ }
+private:
+ std::shared_ptr<RemoteLoggerInterface> d_logger;
+ boost::optional<std::function<void(DNSResponse*, DNSDistProtoBufMessage*)> > d_alterFunc;
+ std::string d_serverID;
+ std::string d_ipEncryptKey;
+ bool d_includeCNAME;
+};
+
+class DropResponseAction : public DNSResponseAction
+{
+public:
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ return Action::Drop;
+ }
+ std::string toString() const override
+ {
+ return "drop";
+ }
+};
+
+class AllowResponseAction : public DNSResponseAction
+{
+public:
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ return Action::Allow;
+ }
+ std::string toString() const override
+ {
+ return "allow";
+ }
+};
+
+class DelayResponseAction : public DNSResponseAction
+{
+public:
+ DelayResponseAction(int msec) : d_msec(msec)
+ {
+ }
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ *ruleresult = std::to_string(d_msec);
+ return Action::Delay;
+ }
+ std::string toString() const override
+ {
+ return "delay by "+std::to_string(d_msec)+ " msec";
+ }
+private:
+ int d_msec;
+};
+
+class SNMPTrapResponseAction : public DNSResponseAction
+{
+public:
+ // this action does not stop the processing
+ SNMPTrapResponseAction(const std::string& reason): d_reason(reason)
+ {
+ }
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ if (g_snmpAgent && g_snmpTrapsEnabled) {
+ g_snmpAgent->sendDNSTrap(*dr, d_reason);
+ }
+
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "send SNMP trap";
+ }
+private:
+ std::string d_reason;
+};
+
+class SetTagResponseAction : public DNSResponseAction
+{
+public:
+ // this action does not stop the processing
+ SetTagResponseAction(const std::string& tag, const std::string& value): d_tag(tag), d_value(value)
+ {
+ }
+ DNSResponseAction::Action operator()(DNSResponse* dr, std::string* ruleresult) const override
+ {
+ dr->setTag(d_tag, d_value);
+
+ return Action::None;
+ }
+ std::string toString() const override
+ {
+ return "set tag '" + d_tag + "' to value '" + d_value + "'";
+ }
+private:
+ std::string d_tag;
+ std::string d_value;
+};
+
+class ContinueAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ ContinueAction(std::shared_ptr<DNSAction>& action): d_action(action)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ if (d_action) {
+ /* call the action */
+ auto action = (*d_action)(dq, ruleresult);
+ bool drop = false;
+ /* apply the changes if needed (pool selection, flags, etc */
+ processRulesResult(action, *dq, *ruleresult, drop);
+ }
+
+ /* but ignore the resulting action no matter what */
+ return Action::None;
+ }
+
+ std::string toString() const override
+ {
+ if (d_action) {
+ return "continue after: " + (d_action ? d_action->toString() : "");
+ }
+ else {
+ return "no op";
+ }
+ }
+
+private:
+ std::shared_ptr<DNSAction> d_action;
+};
+
+#ifdef HAVE_DNS_OVER_HTTPS
+class HTTPStatusAction: public DNSAction
+{
+public:
+ HTTPStatusAction(int code, const PacketBuffer& body, const std::string& contentType): d_body(body), d_contentType(contentType), d_code(code)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ if (!dq->du) {
+ return Action::None;
+ }
+
+ dq->du->setHTTPResponse(d_code, PacketBuffer(d_body), d_contentType);
+ dq->getHeader()->qr = true; // for good measure
+ setResponseHeadersFromConfig(*dq->getHeader(), d_responseConfig);
+ return Action::HeaderModify;
+ }
+
+ std::string toString() const override
+ {
+ return "return an HTTP status of " + std::to_string(d_code);
+ }
+
+ ResponseConfig d_responseConfig;
+private:
+ PacketBuffer d_body;
+ std::string d_contentType;
+ int d_code;
+};
+#endif /* HAVE_DNS_OVER_HTTPS */
+
+class KeyValueStoreLookupAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ KeyValueStoreLookupAction(std::shared_ptr<KeyValueStore>& kvs, std::shared_ptr<KeyValueLookupKey>& lookupKey, const std::string& destinationTag): d_kvs(kvs), d_key(lookupKey), d_tag(destinationTag)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ std::vector<std::string> keys = d_key->getKeys(*dq);
+ std::string result;
+ for (const auto& key : keys) {
+ if (d_kvs->getValue(key, result) == true) {
+ break;
+ }
+ }
+
+ dq->setTag(d_tag, std::move(result));
+
+ return Action::None;
+ }
+
+ std::string toString() const override
+ {
+ return "lookup key-value store based on '" + d_key->toString() + "' and set the result in tag '" + d_tag + "'";
+ }
+
+private:
+ std::shared_ptr<KeyValueStore> d_kvs;
+ std::shared_ptr<KeyValueLookupKey> d_key;
+ std::string d_tag;
+};
+
+class KeyValueStoreRangeLookupAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ KeyValueStoreRangeLookupAction(std::shared_ptr<KeyValueStore>& kvs, std::shared_ptr<KeyValueLookupKey>& lookupKey, const std::string& destinationTag): d_kvs(kvs), d_key(lookupKey), d_tag(destinationTag)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ std::vector<std::string> keys = d_key->getKeys(*dq);
+ std::string result;
+ for (const auto& key : keys) {
+ if (d_kvs->getRangeValue(key, result) == true) {
+ break;
+ }
+ }
+
+ dq->setTag(d_tag, std::move(result));
+
+ return Action::None;
+ }
+
+ std::string toString() const override
+ {
+ return "do a range-based lookup in key-value store based on '" + d_key->toString() + "' and set the result in tag '" + d_tag + "'";
+ }
+
+private:
+ std::shared_ptr<KeyValueStore> d_kvs;
+ std::shared_ptr<KeyValueLookupKey> d_key;
+ std::string d_tag;
+};
+
+class NegativeAndSOAAction: public DNSAction
+{
+public:
+ NegativeAndSOAAction(bool nxd, const DNSName& zone, uint32_t ttl, const DNSName& mname, const DNSName& rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum): d_zone(zone), d_mname(mname), d_rname(rname), d_ttl(ttl), d_serial(serial), d_refresh(refresh), d_retry(retry), d_expire(expire), d_minimum(minimum), d_nxd(nxd)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ if (!setNegativeAndAdditionalSOA(*dq, d_nxd, d_zone, d_ttl, d_mname, d_rname, d_serial, d_refresh, d_retry, d_expire, d_minimum)) {
+ return Action::None;
+ }
+
+ setResponseHeadersFromConfig(*dq->getHeader(), d_responseConfig);
+
+ return Action::Allow;
+ }
+
+ std::string toString() const override
+ {
+ return std::string(d_nxd ? "NXD " : "NODATA") + " with SOA";
+ }
+
+ ResponseConfig d_responseConfig;
+
+private:
+ DNSName d_zone;
+ DNSName d_mname;
+ DNSName d_rname;
+ uint32_t d_ttl;
+ uint32_t d_serial;
+ uint32_t d_refresh;
+ uint32_t d_retry;
+ uint32_t d_expire;
+ uint32_t d_minimum;
+ bool d_nxd;
+};
+
+class SetProxyProtocolValuesAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SetProxyProtocolValuesAction(const std::vector<std::pair<uint8_t, std::string>>& values)
+ {
+ d_values.reserve(values.size());
+ for (const auto& value : values) {
+ d_values.push_back({value.second, value.first});
+ }
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ if (!dq->proxyProtocolValues) {
+ dq->proxyProtocolValues = make_unique<std::vector<ProxyProtocolValue>>();
+ }
+
+ *(dq->proxyProtocolValues) = d_values;
+
+ return Action::None;
+ }
+
+ std::string toString() const override
+ {
+ return "set Proxy-Protocol values";
+ }
+
+private:
+ std::vector<ProxyProtocolValue> d_values;
+};
+
+class SetAdditionalProxyProtocolValueAction : public DNSAction
+{
+public:
+ // this action does not stop the processing
+ SetAdditionalProxyProtocolValueAction(uint8_t type, const std::string& value): d_value(value), d_type(type)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, std::string* ruleresult) const override
+ {
+ if (!dq->proxyProtocolValues) {
+ dq->proxyProtocolValues = make_unique<std::vector<ProxyProtocolValue>>();
+ }
+
+ dq->proxyProtocolValues->push_back({ d_value, d_type });
+
+ return Action::None;
+ }
+
+ std::string toString() const override
+ {
+ return "add a Proxy-Protocol value of type " + std::to_string(d_type);
+ }
+
+private:
+ std::string d_value;
+ uint8_t d_type;
+};
+
+template<typename T, typename ActionT>
+static void addAction(GlobalStateHolder<vector<T> > *someRuleActions, const luadnsrule_t& var, const std::shared_ptr<ActionT>& action, boost::optional<luaruleparams_t>& params) {
+ setLuaSideEffect();
+
+ std::string name;
+ boost::uuids::uuid uuid;
+ uint64_t creationOrder;
+ parseRuleParams(params, uuid, name, creationOrder);
+
+ auto rule = makeRule(var);
+ someRuleActions->modify([&rule, &action, &uuid, creationOrder, &name](vector<T>& ruleactions){
+ ruleactions.push_back({std::move(rule), std::move(action), std::move(name), std::move(uuid), creationOrder});
+ });
+}
+
+typedef std::unordered_map<std::string, boost::variant<bool, uint32_t> > responseParams_t;
+
+static void parseResponseConfig(boost::optional<responseParams_t> vars, ResponseConfig& config)
+{
+ if (vars) {
+ if (vars->count("ttl")) {
+ config.ttl = boost::get<uint32_t>((*vars)["ttl"]);
+ }
+ if (vars->count("aa")) {
+ config.setAA = boost::get<bool>((*vars)["aa"]);
+ }
+ if (vars->count("ad")) {
+ config.setAD = boost::get<bool>((*vars)["ad"]);
+ }
+ if (vars->count("ra")) {
+ config.setRA = boost::get<bool>((*vars)["ra"]);
+ }
+ }
+}
+
+void setResponseHeadersFromConfig(dnsheader& dh, const ResponseConfig& config)
+{
+ if (config.setAA) {
+ dh.aa = *config.setAA;
+ }
+ if (config.setAD) {
+ dh.ad = *config.setAD;
+ }
+ else {
+ dh.ad = false;
+ }
+ if (config.setRA) {
+ dh.ra = *config.setRA;
+ }
+ else {
+ dh.ra = dh.rd; // for good measure
+ }
+}
+
+void setupLuaActions(LuaContext& luaCtx)
+{
+ luaCtx.writeFunction("newRuleAction", [](luadnsrule_t dnsrule, std::shared_ptr<DNSAction> action, boost::optional<luaruleparams_t> params) {
+ boost::uuids::uuid uuid;
+ uint64_t creationOrder;
+ std::string name;
+ parseRuleParams(params, uuid, name, creationOrder);
+
+ auto rule = makeRule(dnsrule);
+ DNSDistRuleAction ra({std::move(rule), action, std::move(name), uuid, creationOrder});
+ return std::make_shared<DNSDistRuleAction>(ra);
+ });
+
+ luaCtx.writeFunction("addAction", [](luadnsrule_t var, boost::variant<std::shared_ptr<DNSAction>, std::shared_ptr<DNSResponseAction> > era, boost::optional<luaruleparams_t> params) {
+ if (era.type() != typeid(std::shared_ptr<DNSAction>)) {
+ throw std::runtime_error("addAction() can only be called with query-related actions, not response-related ones. Are you looking for addResponseAction()?");
+ }
+
+ addAction(&g_ruleactions, var, boost::get<std::shared_ptr<DNSAction> >(era), params);
+ });
+
+ luaCtx.writeFunction("addResponseAction", [](luadnsrule_t var, boost::variant<std::shared_ptr<DNSAction>, std::shared_ptr<DNSResponseAction> > era, boost::optional<luaruleparams_t> params) {
+ if (era.type() != typeid(std::shared_ptr<DNSResponseAction>)) {
+ throw std::runtime_error("addResponseAction() can only be called with response-related actions, not query-related ones. Are you looking for addAction()?");
+ }
+
+ addAction(&g_respruleactions, var, boost::get<std::shared_ptr<DNSResponseAction> >(era), params);
+ });
+
+ luaCtx.writeFunction("addCacheHitResponseAction", [](luadnsrule_t var, boost::variant<std::shared_ptr<DNSAction>, std::shared_ptr<DNSResponseAction>> era, boost::optional<luaruleparams_t> params) {
+ if (era.type() != typeid(std::shared_ptr<DNSResponseAction>)) {
+ throw std::runtime_error("addCacheHitResponseAction() can only be called with response-related actions, not query-related ones. Are you looking for addAction()?");
+ }
+
+ addAction(&g_cachehitrespruleactions, var, boost::get<std::shared_ptr<DNSResponseAction> >(era), params);
+ });
+
+ luaCtx.writeFunction("addSelfAnsweredResponseAction", [](luadnsrule_t var, boost::variant<std::shared_ptr<DNSAction>, std::shared_ptr<DNSResponseAction>> era, boost::optional<luaruleparams_t> params) {
+ if (era.type() != typeid(std::shared_ptr<DNSResponseAction>)) {
+ throw std::runtime_error("addSelfAnsweredResponseAction() can only be called with response-related actions, not query-related ones. Are you looking for addAction()?");
+ }
+
+ addAction(&g_selfansweredrespruleactions, var, boost::get<std::shared_ptr<DNSResponseAction> >(era), params);
+ });
+
+ luaCtx.registerFunction<void(DNSAction::*)()const>("printStats", [](const DNSAction& ta) {
+ setLuaNoSideEffect();
+ auto stats = ta.getStats();
+ for(const auto& s : stats) {
+ g_outputBuffer+=s.first+"\t";
+ if((uint64_t)s.second == s.second)
+ g_outputBuffer += std::to_string((uint64_t)s.second)+"\n";
+ else
+ g_outputBuffer += std::to_string(s.second)+"\n";
+ }
+ });
+
+ luaCtx.writeFunction("getAction", [](unsigned int num) {
+ setLuaNoSideEffect();
+ boost::optional<std::shared_ptr<DNSAction>> ret;
+ auto ruleactions = g_ruleactions.getCopy();
+ if(num < ruleactions.size())
+ ret=ruleactions[num].d_action;
+ return ret;
+ });
+
+ luaCtx.registerFunction("getStats", &DNSAction::getStats);
+ luaCtx.registerFunction("reload", &DNSAction::reload);
+ luaCtx.registerFunction("reload", &DNSResponseAction::reload);
+
+ luaCtx.writeFunction("LuaAction", [](LuaAction::func_t func) {
+ setLuaSideEffect();
+ return std::shared_ptr<DNSAction>(new LuaAction(func));
+ });
+
+ luaCtx.writeFunction("LuaFFIAction", [](LuaFFIAction::func_t func) {
+ setLuaSideEffect();
+ return std::shared_ptr<DNSAction>(new LuaFFIAction(func));
+ });
+
+ luaCtx.writeFunction("LuaFFIPerThreadAction", [](std::string code) {
+ setLuaSideEffect();
+ return std::shared_ptr<DNSAction>(new LuaFFIPerThreadAction(code));
+ });
+
+ luaCtx.writeFunction("SetNoRecurseAction", []() {
+ return std::shared_ptr<DNSAction>(new SetNoRecurseAction);
+ });
+
+ luaCtx.writeFunction("NoRecurseAction", []() {
+ warnlog("access to NoRecurseAction is deprecated and will be removed in a future version, please use SetNoRecurseAction instead");
+ return std::shared_ptr<DNSAction>(new SetNoRecurseAction);
+ });
+
+ luaCtx.writeFunction("SetMacAddrAction", [](int code) {
+ return std::shared_ptr<DNSAction>(new SetMacAddrAction(code));
+ });
+
+ luaCtx.writeFunction("SetEDNSOptionAction", [](int code, const std::string& data) {
+ return std::shared_ptr<DNSAction>(new SetEDNSOptionAction(code, data));
+ });
+
+ luaCtx.writeFunction("MacAddrAction", [](int code) {
+ warnlog("access to MacAddrAction is deprecated and will be removed in a future version, please use SetMacAddrAction instead");
+ return std::shared_ptr<DNSAction>(new SetMacAddrAction(code));
+ });
+
+ luaCtx.writeFunction("PoolAction", [](const std::string& a) {
+ return std::shared_ptr<DNSAction>(new PoolAction(a));
+ });
+
+ luaCtx.writeFunction("QPSAction", [](int limit) {
+ return std::shared_ptr<DNSAction>(new QPSAction(limit));
+ });
+
+ luaCtx.writeFunction("QPSPoolAction", [](int limit, const std::string& a) {
+ return std::shared_ptr<DNSAction>(new QPSPoolAction(limit, a));
+ });
+
+ luaCtx.writeFunction("SpoofAction", [](boost::variant<std::string,vector<pair<int, std::string>>> inp, boost::optional<responseParams_t> vars) {
+ vector<ComboAddress> addrs;
+ if(auto s = boost::get<std::string>(&inp)) {
+ addrs.push_back(ComboAddress(*s));
+ } else {
+ const auto& v = boost::get<vector<pair<int,std::string>>>(inp);
+ for(const auto& a: v) {
+ addrs.push_back(ComboAddress(a.second));
+ }
+ }
+
+ auto ret = std::shared_ptr<DNSAction>(new SpoofAction(addrs));
+ auto sa = std::dynamic_pointer_cast<SpoofAction>(ret);
+ parseResponseConfig(vars, sa->d_responseConfig);
+ return ret;
+ });
+
+ luaCtx.writeFunction("SpoofSVCAction", [](const std::vector<std::pair<int, SVCRecordParameters>>& parameters, boost::optional<responseParams_t> vars) {
+ auto ret = std::shared_ptr<DNSAction>(new SpoofSVCAction(parameters));
+ auto sa = std::dynamic_pointer_cast<SpoofSVCAction>(ret);
+ parseResponseConfig(vars, sa->d_responseConfig);
+ return ret;
+ });
+
+ luaCtx.writeFunction("SpoofCNAMEAction", [](const std::string& a, boost::optional<responseParams_t> vars) {
+ auto ret = std::shared_ptr<DNSAction>(new SpoofAction(DNSName(a)));
+ auto sa = std::dynamic_pointer_cast<SpoofAction>(ret);
+ parseResponseConfig(vars, sa->d_responseConfig);
+ return ret;
+ });
+
+ luaCtx.writeFunction("SpoofRawAction", [](boost::variant<std::string,vector<pair<int, std::string>>> inp, boost::optional<responseParams_t> vars) {
+ vector<string> raws;
+ if(auto s = boost::get<std::string>(&inp)) {
+ raws.push_back(*s);
+ } else {
+ const auto& v = boost::get<vector<pair<int,std::string>>>(inp);
+ for(const auto& raw: v) {
+ raws.push_back(raw.second);
+ }
+ }
+
+ auto ret = std::shared_ptr<DNSAction>(new SpoofAction(raws));
+ auto sa = std::dynamic_pointer_cast<SpoofAction>(ret);
+ parseResponseConfig(vars, sa->d_responseConfig);
+ return ret;
+ });
+
+ luaCtx.writeFunction("DropAction", []() {
+ return std::shared_ptr<DNSAction>(new DropAction);
+ });
+
+ luaCtx.writeFunction("AllowAction", []() {
+ return std::shared_ptr<DNSAction>(new AllowAction);
+ });
+
+ luaCtx.writeFunction("NoneAction", []() {
+ return std::shared_ptr<DNSAction>(new NoneAction);
+ });
+
+ luaCtx.writeFunction("DelayAction", [](int msec) {
+ return std::shared_ptr<DNSAction>(new DelayAction(msec));
+ });
+
+ luaCtx.writeFunction("TCAction", []() {
+ return std::shared_ptr<DNSAction>(new TCAction);
+ });
+
+ luaCtx.writeFunction("SetDisableValidationAction", []() {
+ return std::shared_ptr<DNSAction>(new SetDisableValidationAction);
+ });
+
+ luaCtx.writeFunction("DisableValidationAction", []() {
+ warnlog("access to DisableValidationAction is deprecated and will be removed in a future version, please use SetDisableValidationAction instead");
+ return std::shared_ptr<DNSAction>(new SetDisableValidationAction);
+ });
+
+ luaCtx.writeFunction("LogAction", [](boost::optional<std::string> fname, boost::optional<bool> binary, boost::optional<bool> append, boost::optional<bool> buffered, boost::optional<bool> verboseOnly, boost::optional<bool> includeTimestamp) {
+ return std::shared_ptr<DNSAction>(new LogAction(fname ? *fname : "", binary ? *binary : true, append ? *append : false, buffered ? *buffered : false, verboseOnly ? *verboseOnly : true, includeTimestamp ? *includeTimestamp : false));
+ });
+
+ luaCtx.writeFunction("LogResponseAction", [](boost::optional<std::string> fname, boost::optional<bool> append, boost::optional<bool> buffered, boost::optional<bool> verboseOnly, boost::optional<bool> includeTimestamp) {
+ return std::shared_ptr<DNSResponseAction>(new LogResponseAction(fname ? *fname : "", append ? *append : false, buffered ? *buffered : false, verboseOnly ? *verboseOnly : true, includeTimestamp ? *includeTimestamp : false));
+ });
+
+ luaCtx.writeFunction("RCodeAction", [](uint8_t rcode, boost::optional<responseParams_t> vars) {
+ auto ret = std::shared_ptr<DNSAction>(new RCodeAction(rcode));
+ auto rca = std::dynamic_pointer_cast<RCodeAction>(ret);
+ parseResponseConfig(vars, rca->d_responseConfig);
+ return ret;
+ });
+
+ luaCtx.writeFunction("ERCodeAction", [](uint8_t rcode, boost::optional<responseParams_t> vars) {
+ auto ret = std::shared_ptr<DNSAction>(new ERCodeAction(rcode));
+ auto erca = std::dynamic_pointer_cast<ERCodeAction>(ret);
+ parseResponseConfig(vars, erca->d_responseConfig);
+ return ret;
+ });
+
+ luaCtx.writeFunction("SetSkipCacheAction", []() {
+ return std::shared_ptr<DNSAction>(new SetSkipCacheAction);
+ });
+
+ luaCtx.writeFunction("SkipCacheAction", []() {
+ warnlog("access to SkipCacheAction is deprecated and will be removed in a future version, please use SetSkipCacheAction instead");
+ return std::shared_ptr<DNSAction>(new SetSkipCacheAction);
+ });
+
+ luaCtx.writeFunction("SetSkipCacheResponseAction", []() {
+ return std::shared_ptr<DNSResponseAction>(new SetSkipCacheResponseAction);
+ });
+
+ luaCtx.writeFunction("SetTempFailureCacheTTLAction", [](int maxTTL) {
+ return std::shared_ptr<DNSAction>(new SetTempFailureCacheTTLAction(maxTTL));
+ });
+
+ luaCtx.writeFunction("TempFailureCacheTTLAction", [](int maxTTL) {
+ warnlog("access to TempFailureCacheTTLAction is deprecated and will be removed in a future version, please use SetTempFailureCacheTTLAction instead");
+ return std::shared_ptr<DNSAction>(new SetTempFailureCacheTTLAction(maxTTL));
+ });
+
+ luaCtx.writeFunction("DropResponseAction", []() {
+ return std::shared_ptr<DNSResponseAction>(new DropResponseAction);
+ });
+
+ luaCtx.writeFunction("AllowResponseAction", []() {
+ return std::shared_ptr<DNSResponseAction>(new AllowResponseAction);
+ });
+
+ luaCtx.writeFunction("DelayResponseAction", [](int msec) {
+ return std::shared_ptr<DNSResponseAction>(new DelayResponseAction(msec));
+ });
+
+ luaCtx.writeFunction("LuaResponseAction", [](LuaResponseAction::func_t func) {
+ setLuaSideEffect();
+ return std::shared_ptr<DNSResponseAction>(new LuaResponseAction(func));
+ });
+
+ luaCtx.writeFunction("LuaFFIResponseAction", [](LuaFFIResponseAction::func_t func) {
+ setLuaSideEffect();
+ return std::shared_ptr<DNSResponseAction>(new LuaFFIResponseAction(func));
+ });
+
+ luaCtx.writeFunction("LuaFFIPerThreadResponseAction", [](std::string code) {
+ setLuaSideEffect();
+ return std::shared_ptr<DNSResponseAction>(new LuaFFIPerThreadResponseAction(code));
+ });
+
+ luaCtx.writeFunction("RemoteLogAction", [](std::shared_ptr<RemoteLoggerInterface> logger, boost::optional<std::function<void(DNSQuestion*, DNSDistProtoBufMessage*)> > alterFunc, boost::optional<std::unordered_map<std::string, std::string>> vars) {
+ if (logger) {
+ // avoids potentially-evaluated-expression warning with clang.
+ RemoteLoggerInterface& rl = *logger.get();
+ if (typeid(rl) != typeid(RemoteLogger)) {
+ // We could let the user do what he wants, but wrapping PowerDNS Protobuf inside a FrameStream tagged as dnstap is logically wrong.
+ throw std::runtime_error(std::string("RemoteLogAction only takes RemoteLogger. For other types, please look at DnstapLogAction."));
+ }
+ }
+
+ std::string serverID;
+ std::string ipEncryptKey;
+ if (vars) {
+ if (vars->count("serverID")) {
+ serverID = boost::get<std::string>((*vars)["serverID"]);
+ }
+ if (vars->count("ipEncryptKey")) {
+ ipEncryptKey = boost::get<std::string>((*vars)["ipEncryptKey"]);
+ }
+ }
+
+ return std::shared_ptr<DNSAction>(new RemoteLogAction(logger, alterFunc, serverID, ipEncryptKey));
+ });
+
+ luaCtx.writeFunction("RemoteLogResponseAction", [](std::shared_ptr<RemoteLoggerInterface> logger, boost::optional<std::function<void(DNSResponse*, DNSDistProtoBufMessage*)> > alterFunc, boost::optional<bool> includeCNAME, boost::optional<std::unordered_map<std::string, std::string>> vars) {
+ if (logger) {
+ // avoids potentially-evaluated-expression warning with clang.
+ RemoteLoggerInterface& rl = *logger.get();
+ if (typeid(rl) != typeid(RemoteLogger)) {
+ // We could let the user do what he wants, but wrapping PowerDNS Protobuf inside a FrameStream tagged as dnstap is logically wrong.
+ throw std::runtime_error("RemoteLogResponseAction only takes RemoteLogger. For other types, please look at DnstapLogResponseAction.");
+ }
+ }
+
+ std::string serverID;
+ std::string ipEncryptKey;
+ if (vars) {
+ if (vars->count("serverID")) {
+ serverID = boost::get<std::string>((*vars)["serverID"]);
+ }
+ if (vars->count("ipEncryptKey")) {
+ ipEncryptKey = boost::get<std::string>((*vars)["ipEncryptKey"]);
+ }
+ }
+
+ return std::shared_ptr<DNSResponseAction>(new RemoteLogResponseAction(logger, alterFunc, serverID, ipEncryptKey, includeCNAME ? *includeCNAME : false));
+ });
+
+ luaCtx.writeFunction("DnstapLogAction", [](const std::string& identity, std::shared_ptr<RemoteLoggerInterface> logger, boost::optional<std::function<void(DNSQuestion*, DnstapMessage*)> > alterFunc) {
+ return std::shared_ptr<DNSAction>(new DnstapLogAction(identity, logger, alterFunc));
+ });
+
+ luaCtx.writeFunction("DnstapLogResponseAction", [](const std::string& identity, std::shared_ptr<RemoteLoggerInterface> logger, boost::optional<std::function<void(DNSResponse*, DnstapMessage*)> > alterFunc) {
+ return std::shared_ptr<DNSResponseAction>(new DnstapLogResponseAction(identity, logger, alterFunc));
+ });
+
+ luaCtx.writeFunction("TeeAction", [](const std::string& remote, boost::optional<bool> addECS) {
+ return std::shared_ptr<DNSAction>(new TeeAction(ComboAddress(remote, 53), addECS ? *addECS : false));
+ });
+
+ luaCtx.writeFunction("SetECSPrefixLengthAction", [](uint16_t v4PrefixLength, uint16_t v6PrefixLength) {
+ return std::shared_ptr<DNSAction>(new SetECSPrefixLengthAction(v4PrefixLength, v6PrefixLength));
+ });
+
+ luaCtx.writeFunction("ECSPrefixLengthAction", [](uint16_t v4PrefixLength, uint16_t v6PrefixLength) {
+ warnlog("access to ECSPrefixLengthAction is deprecated and will be removed in a future version, please use SetECSPrefixLengthAction instead");
+ return std::shared_ptr<DNSAction>(new SetECSPrefixLengthAction(v4PrefixLength, v6PrefixLength));
+ });
+
+ luaCtx.writeFunction("SetECSOverrideAction", [](bool ecsOverride) {
+ return std::shared_ptr<DNSAction>(new SetECSOverrideAction(ecsOverride));
+ });
+
+ luaCtx.writeFunction("ECSOverrideAction", [](bool ecsOverride) {
+ warnlog("access to ECSOverrideAction is deprecated and will be removed in a future version, please use SetECSOverrideAction instead");
+ return std::shared_ptr<DNSAction>(new SetECSOverrideAction(ecsOverride));
+ });
+
+ luaCtx.writeFunction("SetDisableECSAction", []() {
+ return std::shared_ptr<DNSAction>(new SetDisableECSAction());
+ });
+
+ luaCtx.writeFunction("DisableECSAction", []() {
+ warnlog("access to DisableECSAction is deprecated and will be removed in a future version, please use SetDisableECSAction instead");
+ return std::shared_ptr<DNSAction>(new SetDisableECSAction());
+ });
+
+ luaCtx.writeFunction("SetECSAction", [](const std::string v4, boost::optional<std::string> v6) {
+ if (v6) {
+ return std::shared_ptr<DNSAction>(new SetECSAction(Netmask(v4), Netmask(*v6)));
+ }
+ return std::shared_ptr<DNSAction>(new SetECSAction(Netmask(v4)));
+ });
+
+ luaCtx.writeFunction("SNMPTrapAction", [](boost::optional<std::string> reason) {
+#ifdef HAVE_NET_SNMP
+ return std::shared_ptr<DNSAction>(new SNMPTrapAction(reason ? *reason : ""));
+#else
+ throw std::runtime_error("NET SNMP support is required to use SNMPTrapAction()");
+#endif /* HAVE_NET_SNMP */
+ });
+
+ luaCtx.writeFunction("SNMPTrapResponseAction", [](boost::optional<std::string> reason) {
+#ifdef HAVE_NET_SNMP
+ return std::shared_ptr<DNSResponseAction>(new SNMPTrapResponseAction(reason ? *reason : ""));
+#else
+ throw std::runtime_error("NET SNMP support is required to use SNMPTrapResponseAction()");
+#endif /* HAVE_NET_SNMP */
+ });
+
+ luaCtx.writeFunction("SetTagAction", [](std::string tag, std::string value) {
+ return std::shared_ptr<DNSAction>(new SetTagAction(tag, value));
+ });
+
+ luaCtx.writeFunction("TagAction", [](std::string tag, std::string value) {
+ warnlog("access to TagAction is deprecated and will be removed in a future version, please use SetTagAction instead");
+ return std::shared_ptr<DNSAction>(new SetTagAction(tag, value));
+ });
+
+ luaCtx.writeFunction("SetTagResponseAction", [](std::string tag, std::string value) {
+ return std::shared_ptr<DNSResponseAction>(new SetTagResponseAction(tag, value));
+ });
+
+ luaCtx.writeFunction("TagResponseAction", [](std::string tag, std::string value) {
+ warnlog("access to TagResponseAction is deprecated and will be removed in a future version, please use SetTagResponseAction instead");
+ return std::shared_ptr<DNSResponseAction>(new SetTagResponseAction(tag, value));
+ });
+
+ luaCtx.writeFunction("ContinueAction", [](std::shared_ptr<DNSAction> action) {
+ return std::shared_ptr<DNSAction>(new ContinueAction(action));
+ });
+
+#ifdef HAVE_DNS_OVER_HTTPS
+ luaCtx.writeFunction("HTTPStatusAction", [](uint16_t status, std::string body, boost::optional<std::string> contentType, boost::optional<responseParams_t> vars) {
+ auto ret = std::shared_ptr<DNSAction>(new HTTPStatusAction(status, PacketBuffer(body.begin(), body.end()), contentType ? *contentType : ""));
+ auto hsa = std::dynamic_pointer_cast<HTTPStatusAction>(ret);
+ parseResponseConfig(vars, hsa->d_responseConfig);
+ return ret;
+ });
+#endif /* HAVE_DNS_OVER_HTTPS */
+
+ luaCtx.writeFunction("KeyValueStoreLookupAction", [](std::shared_ptr<KeyValueStore>& kvs, std::shared_ptr<KeyValueLookupKey>& lookupKey, const std::string& destinationTag) {
+ return std::shared_ptr<DNSAction>(new KeyValueStoreLookupAction(kvs, lookupKey, destinationTag));
+ });
+
+ luaCtx.writeFunction("KeyValueStoreRangeLookupAction", [](std::shared_ptr<KeyValueStore>& kvs, std::shared_ptr<KeyValueLookupKey>& lookupKey, const std::string& destinationTag) {
+ return std::shared_ptr<DNSAction>(new KeyValueStoreRangeLookupAction(kvs, lookupKey, destinationTag));
+ });
+
+ luaCtx.writeFunction("NegativeAndSOAAction", [](bool nxd, const std::string& zone, uint32_t ttl, const std::string& mname, const std::string& rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum, boost::optional<responseParams_t> vars) {
+ auto ret = std::shared_ptr<DNSAction>(new NegativeAndSOAAction(nxd, DNSName(zone), ttl, DNSName(mname), DNSName(rname), serial, refresh, retry, expire, minimum));
+ auto action = std::dynamic_pointer_cast<NegativeAndSOAAction>(ret);
+ parseResponseConfig(vars, action->d_responseConfig);
+ return ret;
+ });
+
+ luaCtx.writeFunction("SetNegativeAndSOAAction", [](bool nxd, const std::string& zone, uint32_t ttl, const std::string& mname, const std::string& rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum, boost::optional<responseParams_t> vars) {
+ warnlog("access to SetNegativeAndSOAAction is deprecated and will be removed in a future version, please use NegativeAndSOAAction instead");
+ auto ret = std::shared_ptr<DNSAction>(new NegativeAndSOAAction(nxd, DNSName(zone), ttl, DNSName(mname), DNSName(rname), serial, refresh, retry, expire, minimum));
+ auto action = std::dynamic_pointer_cast<NegativeAndSOAAction>(ret);
+ parseResponseConfig(vars, action->d_responseConfig);
+ return ret;
+ });
+
+ luaCtx.writeFunction("SetProxyProtocolValuesAction", [](const std::vector<std::pair<uint8_t, std::string>>& values) {
+ return std::shared_ptr<DNSAction>(new SetProxyProtocolValuesAction(values));
+ });
+
+ luaCtx.writeFunction("SetAdditionalProxyProtocolValueAction", [](uint8_t type, const std::string& value) {
+ return std::shared_ptr<DNSAction>(new SetAdditionalProxyProtocolValueAction(type, value));
+ });
+}
diff --git a/dnsdist-lua-bindings-dnscrypt.cc b/dnsdist-lua-bindings-dnscrypt.cc
new file mode 100644
index 0000000..9ea3fc8
--- /dev/null
+++ b/dnsdist-lua-bindings-dnscrypt.cc
@@ -0,0 +1,155 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+#include "dnsdist.hh"
+#include "dnsdist-lua.hh"
+
+#include "dolog.hh"
+
+void setupLuaBindingsDNSCrypt(LuaContext& luaCtx)
+{
+#ifdef HAVE_DNSCRYPT
+ /* DNSCryptContext bindings */
+ luaCtx.registerFunction<std::string(DNSCryptContext::*)()const>("getProviderName", [](const DNSCryptContext& ctx) { return ctx.getProviderName().toStringNoDot(); });
+ luaCtx.registerFunction("markActive", &DNSCryptContext::markActive);
+ luaCtx.registerFunction("markInactive", &DNSCryptContext::markInactive);
+ luaCtx.registerFunction("reloadCertificates", &DNSCryptContext::reloadCertificates);
+ luaCtx.registerFunction("removeInactiveCertificate", &DNSCryptContext::removeInactiveCertificate);
+ luaCtx.registerFunction<void(std::shared_ptr<DNSCryptContext>::*)(const std::string& certFile, const std::string& keyFile, boost::optional<bool> active)>("loadNewCertificate", [](std::shared_ptr<DNSCryptContext> ctx, const std::string& certFile, const std::string& keyFile, boost::optional<bool> active) {
+
+ if (ctx == nullptr) {
+ throw std::runtime_error("DNSCryptContext::loadNewCertificate() called on a nil value");
+ }
+
+ ctx->loadNewCertificate(certFile, keyFile, active ? *active : true);
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DNSCryptContext>::*)(const DNSCryptCert& newCert, const DNSCryptPrivateKey& newKey, boost::optional<bool> active)>("addNewCertificate", [](std::shared_ptr<DNSCryptContext> ctx, const DNSCryptCert& newCert, const DNSCryptPrivateKey& newKey, boost::optional<bool> active) {
+
+ if (ctx == nullptr) {
+ throw std::runtime_error("DNSCryptContext::addNewCertificate() called on a nil value");
+ }
+
+ ctx->addNewCertificate(newCert, newKey, active ? *active : true);
+ });
+ luaCtx.registerFunction<std::map<int, std::shared_ptr<DNSCryptCertificatePair>>(std::shared_ptr<DNSCryptContext>::*)()>("getCertificatePairs", [](std::shared_ptr<DNSCryptContext> ctx) {
+ std::map<int, std::shared_ptr<DNSCryptCertificatePair>> result;
+
+ if (ctx != nullptr) {
+ size_t idx = 1;
+ for (auto pair : ctx->getCertificates()) {
+ result[idx++] = pair;
+ }
+ }
+
+ return result;
+ });
+
+ luaCtx.registerFunction<std::shared_ptr<DNSCryptCertificatePair>(std::shared_ptr<DNSCryptContext>::*)(size_t idx)>("getCertificatePair", [](std::shared_ptr<DNSCryptContext> ctx, size_t idx) {
+
+ if (ctx == nullptr) {
+ throw std::runtime_error("DNSCryptContext::getCertificatePair() called on a nil value");
+ }
+
+ std::shared_ptr<DNSCryptCertificatePair> result = nullptr;
+ auto pairs = ctx->getCertificates();
+ if (idx < pairs.size()) {
+ result = pairs.at(idx);
+ }
+
+ return result;
+ });
+
+ luaCtx.registerFunction<const DNSCryptCert(std::shared_ptr<DNSCryptContext>::*)(size_t idx)>("getCertificate", [](std::shared_ptr<DNSCryptContext> ctx, size_t idx) {
+
+ if (ctx == nullptr) {
+ throw std::runtime_error("DNSCryptContext::getCertificate() called on a nil value");
+ }
+
+ auto pairs = ctx->getCertificates();
+ if (idx < pairs.size()) {
+ return pairs.at(idx)->cert;
+ }
+
+ throw std::runtime_error("This DNSCrypt context has no certificate at index " + std::to_string(idx));
+ });
+
+ luaCtx.registerFunction<std::string(std::shared_ptr<DNSCryptContext>::*)()const>("printCertificates", [](const std::shared_ptr<DNSCryptContext> ctx) {
+ ostringstream ret;
+
+ if (ctx != nullptr) {
+ size_t idx = 1;
+ boost::format fmt("%1$-3d %|5t|%2$-8d %|10t|%3$-7d %|20t|%4$-21.21s %|41t|%5$-21.21s");
+ ret << (fmt % "#" % "Serial" % "Version" % "From" % "To" ) << endl;
+
+ for (auto pair : ctx->getCertificates()) {
+ const auto cert = pair->cert;
+ const DNSCryptExchangeVersion version = DNSCryptContext::getExchangeVersion(cert);
+
+ ret << (fmt % idx % cert.getSerial() % (version == DNSCryptExchangeVersion::VERSION1 ? 1 : 2) % DNSCryptContext::certificateDateToStr(cert.getTSStart()) % DNSCryptContext::certificateDateToStr(cert.getTSEnd())) << endl;
+ }
+ }
+
+ return ret.str();
+ });
+
+ luaCtx.registerFunction<void(DNSCryptContext::*)(const std::string& providerPrivateKeyFile, uint32_t serial, time_t begin, time_t end, boost::optional<DNSCryptExchangeVersion> version)>("generateAndLoadInMemoryCertificate", [](DNSCryptContext& ctx, const std::string& providerPrivateKeyFile, uint32_t serial, time_t begin, time_t end, boost::optional<DNSCryptExchangeVersion> version) {
+ DNSCryptPrivateKey privateKey;
+ DNSCryptCert cert;
+
+ try {
+ if (generateDNSCryptCertificate(providerPrivateKeyFile, serial, begin, end, version ? *version : DNSCryptExchangeVersion::VERSION1, cert, privateKey)) {
+ ctx.addNewCertificate(cert, privateKey);
+ }
+ }
+ catch(const std::exception& e) {
+ errlog(e.what());
+ g_outputBuffer="Error: "+string(e.what())+"\n";
+ }
+ });
+
+ /* DNSCryptCertificatePair */
+ luaCtx.registerFunction<const DNSCryptCert(std::shared_ptr<DNSCryptCertificatePair>::*)()const>("getCertificate", [](const std::shared_ptr<DNSCryptCertificatePair> pair) {
+ if (pair == nullptr) {
+ throw std::runtime_error("DNSCryptCertificatePair::getCertificate() called on a nil value");
+ }
+ return pair->cert;
+ });
+ luaCtx.registerFunction<bool(std::shared_ptr<DNSCryptCertificatePair>::*)()const>("isActive", [](const std::shared_ptr<DNSCryptCertificatePair> pair) {
+ if (pair == nullptr) {
+ throw std::runtime_error("DNSCryptCertificatePair::isActive() called on a nil value");
+ }
+ return pair->active;
+ });
+
+ /* DNSCryptCert */
+ luaCtx.registerFunction<std::string(DNSCryptCert::*)()const>("getMagic", [](const DNSCryptCert& cert) { return std::string(reinterpret_cast<const char*>(cert.magic), sizeof(cert.magic)); });
+ luaCtx.registerFunction<std::string(DNSCryptCert::*)()const>("getEsVersion", [](const DNSCryptCert& cert) { return std::string(reinterpret_cast<const char*>(cert.esVersion), sizeof(cert.esVersion)); });
+ luaCtx.registerFunction<std::string(DNSCryptCert::*)()const>("getProtocolMinorVersion", [](const DNSCryptCert& cert) { return std::string(reinterpret_cast<const char*>(cert.protocolMinorVersion), sizeof(cert.protocolMinorVersion)); });
+ luaCtx.registerFunction<std::string(DNSCryptCert::*)()const>("getSignature", [](const DNSCryptCert& cert) { return std::string(reinterpret_cast<const char*>(cert.signature), sizeof(cert.signature)); });
+ luaCtx.registerFunction<std::string(DNSCryptCert::*)()const>("getResolverPublicKey", [](const DNSCryptCert& cert) { return std::string(reinterpret_cast<const char*>(cert.signedData.resolverPK), sizeof(cert.signedData.resolverPK)); });
+ luaCtx.registerFunction<std::string(DNSCryptCert::*)()const>("getClientMagic", [](const DNSCryptCert& cert) { return std::string(reinterpret_cast<const char*>(cert.signedData.clientMagic), sizeof(cert.signedData.clientMagic)); });
+ luaCtx.registerFunction<uint32_t(DNSCryptCert::*)()const>("getSerial", [](const DNSCryptCert& cert) { return cert.getSerial(); });
+ luaCtx.registerFunction<uint32_t(DNSCryptCert::*)()const>("getTSStart", [](const DNSCryptCert& cert) { return ntohl(cert.getTSStart()); });
+ luaCtx.registerFunction<uint32_t(DNSCryptCert::*)()const>("getTSEnd", [](const DNSCryptCert& cert) { return ntohl(cert.getTSEnd()); });
+#endif
+}
diff --git a/dnsdist-lua-bindings-dnsquestion.cc b/dnsdist-lua-bindings-dnsquestion.cc
new file mode 100644
index 0000000..492f188
--- /dev/null
+++ b/dnsdist-lua-bindings-dnsquestion.cc
@@ -0,0 +1,305 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsdist.hh"
+#include "dnsdist-ecs.hh"
+#include "dnsdist-lua.hh"
+#include "dnsparser.hh"
+
+void setupLuaBindingsDNSQuestion(LuaContext& luaCtx)
+{
+ /* DNSQuestion */
+ /* PowerDNS DNSQuestion compat */
+ luaCtx.registerMember<const ComboAddress (DNSQuestion::*)>("localaddr", [](const DNSQuestion& dq) -> const ComboAddress { return *dq.local; }, [](DNSQuestion& dq, const ComboAddress newLocal) { (void) newLocal; });
+ luaCtx.registerMember<const DNSName (DNSQuestion::*)>("qname", [](const DNSQuestion& dq) -> const DNSName { return *dq.qname; }, [](DNSQuestion& dq, const DNSName newName) { (void) newName; });
+ luaCtx.registerMember<uint16_t (DNSQuestion::*)>("qtype", [](const DNSQuestion& dq) -> uint16_t { return dq.qtype; }, [](DNSQuestion& dq, uint16_t newType) { (void) newType; });
+ luaCtx.registerMember<uint16_t (DNSQuestion::*)>("qclass", [](const DNSQuestion& dq) -> uint16_t { return dq.qclass; }, [](DNSQuestion& dq, uint16_t newClass) { (void) newClass; });
+ luaCtx.registerMember<int (DNSQuestion::*)>("rcode", [](const DNSQuestion& dq) -> int { return dq.getHeader()->rcode; }, [](DNSQuestion& dq, int newRCode) { dq.getHeader()->rcode = newRCode; });
+ luaCtx.registerMember<const ComboAddress (DNSQuestion::*)>("remoteaddr", [](const DNSQuestion& dq) -> const ComboAddress { return *dq.remote; }, [](DNSQuestion& dq, const ComboAddress newRemote) { (void) newRemote; });
+ /* DNSDist DNSQuestion */
+ luaCtx.registerMember<dnsheader* (DNSQuestion::*)>("dh", [](const DNSQuestion& dq) -> dnsheader* { return const_cast<DNSQuestion&>(dq).getHeader(); }, [](DNSQuestion& dq, const dnsheader* dh) { *(dq.getHeader()) = *dh; });
+ luaCtx.registerMember<uint16_t (DNSQuestion::*)>("len", [](const DNSQuestion& dq) -> uint16_t { return dq.getData().size(); }, [](DNSQuestion& dq, uint16_t newlen) { dq.getMutableData().resize(newlen); });
+ luaCtx.registerMember<uint8_t (DNSQuestion::*)>("opcode", [](const DNSQuestion& dq) -> uint8_t { return dq.getHeader()->opcode; }, [](DNSQuestion& dq, uint8_t newOpcode) { (void) newOpcode; });
+ luaCtx.registerMember<bool (DNSQuestion::*)>("tcp", [](const DNSQuestion& dq) -> bool { return dq.overTCP(); }, [](DNSQuestion& dq, bool newTcp) { (void) newTcp; });
+ luaCtx.registerMember<bool (DNSQuestion::*)>("skipCache", [](const DNSQuestion& dq) -> bool { return dq.skipCache; }, [](DNSQuestion& dq, bool newSkipCache) { dq.skipCache = newSkipCache; });
+ luaCtx.registerMember<bool (DNSQuestion::*)>("useECS", [](const DNSQuestion& dq) -> bool { return dq.useECS; }, [](DNSQuestion& dq, bool useECS) { dq.useECS = useECS; });
+ luaCtx.registerMember<bool (DNSQuestion::*)>("ecsOverride", [](const DNSQuestion& dq) -> bool { return dq.ecsOverride; }, [](DNSQuestion& dq, bool ecsOverride) { dq.ecsOverride = ecsOverride; });
+ luaCtx.registerMember<uint16_t (DNSQuestion::*)>("ecsPrefixLength", [](const DNSQuestion& dq) -> uint16_t { return dq.ecsPrefixLength; }, [](DNSQuestion& dq, uint16_t newPrefixLength) { dq.ecsPrefixLength = newPrefixLength; });
+ luaCtx.registerMember<boost::optional<uint32_t> (DNSQuestion::*)>("tempFailureTTL",
+ [](const DNSQuestion& dq) -> boost::optional<uint32_t> {
+ return dq.tempFailureTTL;
+ },
+ [](DNSQuestion& dq, boost::optional<uint32_t> newValue) {
+ dq.tempFailureTTL = newValue;
+ }
+ );
+ luaCtx.registerFunction<bool(DNSQuestion::*)()const>("getDO", [](const DNSQuestion& dq) {
+ return getEDNSZ(dq) & EDNS_HEADER_FLAG_DO;
+ });
+ luaCtx.registerFunction<std::string(DNSQuestion::*)()const>("getContent", [](const DNSQuestion& dq) {
+ return std::string(reinterpret_cast<const char*>(dq.getData().data()), dq.getData().size());
+ });
+ luaCtx.registerFunction<std::map<uint16_t, EDNSOptionView>(DNSQuestion::*)()const>("getEDNSOptions", [](const DNSQuestion& dq) {
+ if (dq.ednsOptions == nullptr) {
+ parseEDNSOptions(dq);
+ }
+
+ return *dq.ednsOptions;
+ });
+ luaCtx.registerFunction<std::string(DNSQuestion::*)(void)const>("getTrailingData", [](const DNSQuestion& dq) {
+ return dq.getTrailingData();
+ });
+ luaCtx.registerFunction<bool(DNSQuestion::*)(std::string)>("setTrailingData", [](DNSQuestion& dq, const std::string& tail) {
+ return dq.setTrailingData(tail);
+ });
+
+ luaCtx.registerFunction<std::string(DNSQuestion::*)()const>("getServerNameIndication", [](const DNSQuestion& dq) {
+ return dq.sni;
+ });
+
+ luaCtx.registerFunction<std::string (DNSQuestion::*)()const>("getProtocol", [](const DNSQuestion& dq) {
+ return dq.getProtocol().toPrettyString();
+ });
+
+ luaCtx.registerFunction<void(DNSQuestion::*)(std::string)>("sendTrap", [](const DNSQuestion& dq, boost::optional<std::string> reason) {
+#ifdef HAVE_NET_SNMP
+ if (g_snmpAgent && g_snmpTrapsEnabled) {
+ g_snmpAgent->sendDNSTrap(dq, reason ? *reason : "");
+ }
+#endif /* HAVE_NET_SNMP */
+ });
+
+ luaCtx.registerFunction<void(DNSQuestion::*)(std::string, std::string)>("setTag", [](DNSQuestion& dq, const std::string& strLabel, const std::string& strValue) {
+ dq.setTag(strLabel, strValue);
+ });
+ luaCtx.registerFunction<void(DNSQuestion::*)(vector<pair<string, string>>)>("setTagArray", [](DNSQuestion& dq, const vector<pair<string, string>>&tags) {
+ for (const auto& tag : tags) {
+ dq.setTag(tag.first, tag.second);
+ }
+ });
+ luaCtx.registerFunction<string(DNSQuestion::*)(std::string)const>("getTag", [](const DNSQuestion& dq, const std::string& strLabel) {
+ if (!dq.qTag) {
+ return string();
+ }
+
+ std::string strValue;
+ const auto it = dq.qTag->find(strLabel);
+ if (it == dq.qTag->cend()) {
+ return string();
+ }
+ return it->second;
+ });
+ luaCtx.registerFunction<QTag(DNSQuestion::*)(void)const>("getTagArray", [](const DNSQuestion& dq) {
+ if (!dq.qTag) {
+ QTag empty;
+ return empty;
+ }
+
+ return *dq.qTag;
+ });
+
+ luaCtx.registerFunction<void(DNSQuestion::*)(std::vector<std::pair<uint8_t, std::string>>)>("setProxyProtocolValues", [](DNSQuestion& dq, const std::vector<std::pair<uint8_t, std::string>>& values) {
+ if (!dq.proxyProtocolValues) {
+ dq.proxyProtocolValues = make_unique<std::vector<ProxyProtocolValue>>();
+ }
+
+ dq.proxyProtocolValues->clear();
+ dq.proxyProtocolValues->reserve(values.size());
+ for (const auto& value : values) {
+ dq.proxyProtocolValues->push_back({value.second, value.first});
+ }
+ });
+
+ luaCtx.registerFunction<void(DNSQuestion::*)(uint8_t, std::string)>("addProxyProtocolValue", [](DNSQuestion& dq, uint8_t type, std::string value) {
+ if (!dq.proxyProtocolValues) {
+ dq.proxyProtocolValues = make_unique<std::vector<ProxyProtocolValue>>();
+ }
+
+ dq.proxyProtocolValues->push_back({value, type});
+ });
+
+ luaCtx.registerFunction<std::vector<std::pair<uint8_t, std::string>>(DNSQuestion::*)()>("getProxyProtocolValues", [](const DNSQuestion& dq) {
+ if (!dq.proxyProtocolValues) {
+ return std::vector<std::pair<uint8_t, std::string>>();
+ }
+
+ std::vector<std::pair<uint8_t, std::string>> result;
+ result.resize(dq.proxyProtocolValues->size());
+ for (const auto& value : *dq.proxyProtocolValues) {
+ result.push_back({ value.type, value.content });
+ }
+
+ return result;
+ });
+
+ luaCtx.registerFunction<void(DNSQuestion::*)(const boost::variant<std::vector<std::pair<int, ComboAddress>>, std::vector<std::pair<int, std::string>>>& response)>("spoof", [](DNSQuestion& dq, const boost::variant<std::vector<std::pair<int, ComboAddress>>, std::vector<std::pair<int, std::string>>>& response) {
+ if (response.type() == typeid(vector<pair<int, ComboAddress>>)) {
+ std::vector<ComboAddress> data;
+ auto responses = boost::get<vector<pair<int, ComboAddress>>>(response);
+ data.reserve(responses.size());
+ for (const auto& resp : responses) {
+ data.push_back(resp.second);
+ }
+ std::string result;
+ SpoofAction sa(data);
+ sa(&dq, &result);
+ return;
+ }
+ if (response.type() == typeid(vector<pair<int, string>>)) {
+ std::vector<std::string> data;
+ auto responses = boost::get<vector<pair<int, string>>>(response);
+ data.reserve(responses.size());
+ for (const auto& resp : responses) {
+ data.push_back(resp.second);
+ }
+ std::string result;
+ SpoofAction sa(data);
+ sa(&dq, &result);
+ return;
+ }
+ });
+
+ /* LuaWrapper doesn't support inheritance */
+ luaCtx.registerMember<const ComboAddress (DNSResponse::*)>("localaddr", [](const DNSResponse& dq) -> const ComboAddress { return *dq.local; }, [](DNSResponse& dq, const ComboAddress newLocal) { (void) newLocal; });
+ luaCtx.registerMember<const DNSName (DNSResponse::*)>("qname", [](const DNSResponse& dq) -> const DNSName { return *dq.qname; }, [](DNSResponse& dq, const DNSName newName) { (void) newName; });
+ luaCtx.registerMember<uint16_t (DNSResponse::*)>("qtype", [](const DNSResponse& dq) -> uint16_t { return dq.qtype; }, [](DNSResponse& dq, uint16_t newType) { (void) newType; });
+ luaCtx.registerMember<uint16_t (DNSResponse::*)>("qclass", [](const DNSResponse& dq) -> uint16_t { return dq.qclass; }, [](DNSResponse& dq, uint16_t newClass) { (void) newClass; });
+ luaCtx.registerMember<int (DNSResponse::*)>("rcode", [](const DNSResponse& dq) -> int { return dq.getHeader()->rcode; }, [](DNSResponse& dq, int newRCode) { dq.getHeader()->rcode = newRCode; });
+ luaCtx.registerMember<const ComboAddress (DNSResponse::*)>("remoteaddr", [](const DNSResponse& dq) -> const ComboAddress { return *dq.remote; }, [](DNSResponse& dq, const ComboAddress newRemote) { (void) newRemote; });
+ luaCtx.registerMember<dnsheader* (DNSResponse::*)>("dh", [](const DNSResponse& dr) -> dnsheader* { return const_cast<DNSResponse&>(dr).getHeader(); }, [](DNSResponse& dr, const dnsheader* dh) { *(dr.getHeader()) = *dh; });
+ luaCtx.registerMember<uint16_t (DNSResponse::*)>("len", [](const DNSResponse& dq) -> uint16_t { return dq.getData().size(); }, [](DNSResponse& dq, uint16_t newlen) { dq.getMutableData().resize(newlen); });
+ luaCtx.registerMember<uint8_t (DNSResponse::*)>("opcode", [](const DNSResponse& dq) -> uint8_t { return dq.getHeader()->opcode; }, [](DNSResponse& dq, uint8_t newOpcode) { (void) newOpcode; });
+ luaCtx.registerMember<bool (DNSResponse::*)>("tcp", [](const DNSResponse& dq) -> bool { return dq.overTCP(); }, [](DNSResponse& dq, bool newTcp) { (void) newTcp; });
+ luaCtx.registerMember<bool (DNSResponse::*)>("skipCache", [](const DNSResponse& dq) -> bool { return dq.skipCache; }, [](DNSResponse& dq, bool newSkipCache) { dq.skipCache = newSkipCache; });
+ luaCtx.registerFunction<void(DNSResponse::*)(std::function<uint32_t(uint8_t section, uint16_t qclass, uint16_t qtype, uint32_t ttl)> editFunc)>("editTTLs", [](DNSResponse& dr, std::function<uint32_t(uint8_t section, uint16_t qclass, uint16_t qtype, uint32_t ttl)> editFunc) {
+ editDNSPacketTTL(reinterpret_cast<char *>(dr.getMutableData().data()), dr.getData().size(), editFunc);
+ });
+ luaCtx.registerFunction<bool(DNSResponse::*)()const>("getDO", [](const DNSResponse& dq) {
+ return getEDNSZ(dq) & EDNS_HEADER_FLAG_DO;
+ });
+ luaCtx.registerFunction<std::string(DNSResponse::*)()const>("getContent", [](const DNSResponse& dq) {
+ return std::string(reinterpret_cast<const char*>(dq.getData().data()), dq.getData().size());
+ });
+ luaCtx.registerFunction<std::map<uint16_t, EDNSOptionView>(DNSResponse::*)()const>("getEDNSOptions", [](const DNSResponse& dq) {
+ if (dq.ednsOptions == nullptr) {
+ parseEDNSOptions(dq);
+ }
+
+ return *dq.ednsOptions;
+ });
+ luaCtx.registerFunction<std::string(DNSResponse::*)(void)const>("getTrailingData", [](const DNSResponse& dq) {
+ return dq.getTrailingData();
+ });
+ luaCtx.registerFunction<bool(DNSResponse::*)(std::string)>("setTrailingData", [](DNSResponse& dq, const std::string& tail) {
+ return dq.setTrailingData(tail);
+ });
+
+ luaCtx.registerFunction<void(DNSResponse::*)(std::string, std::string)>("setTag", [](DNSResponse& dr, const std::string& strLabel, const std::string& strValue) {
+ dr.setTag(strLabel, strValue);
+ });
+
+ luaCtx.registerFunction<void(DNSResponse::*)(vector<pair<string, string>>)>("setTagArray", [](DNSResponse& dr, const vector<pair<string, string>>&tags) {
+ for (const auto& tag : tags) {
+ dr.setTag(tag.first, tag.second);
+ }
+ });
+ luaCtx.registerFunction<string(DNSResponse::*)(std::string)const>("getTag", [](const DNSResponse& dr, const std::string& strLabel) {
+ if (!dr.qTag) {
+ return string();
+ }
+
+ std::string strValue;
+ const auto it = dr.qTag->find(strLabel);
+ if (it == dr.qTag->cend()) {
+ return string();
+ }
+ return it->second;
+ });
+ luaCtx.registerFunction<QTag(DNSResponse::*)(void)const>("getTagArray", [](const DNSResponse& dr) {
+ if (!dr.qTag) {
+ QTag empty;
+ return empty;
+ }
+
+ return *dr.qTag;
+ });
+
+ luaCtx.registerFunction<std::string (DNSResponse::*)()const>("getProtocol", [](const DNSResponse& dr) {
+ return dr.getProtocol().toPrettyString();
+ });
+
+ luaCtx.registerFunction<void(DNSResponse::*)(std::string)>("sendTrap", [](const DNSResponse& dr, boost::optional<std::string> reason) {
+#ifdef HAVE_NET_SNMP
+ if (g_snmpAgent && g_snmpTrapsEnabled) {
+ g_snmpAgent->sendDNSTrap(dr, reason ? *reason : "");
+ }
+#endif /* HAVE_NET_SNMP */
+ });
+
+#ifdef HAVE_DNS_OVER_HTTPS
+ luaCtx.registerFunction<std::string(DNSQuestion::*)(void)const>("getHTTPPath", [](const DNSQuestion& dq) {
+ if (dq.du == nullptr) {
+ return std::string();
+ }
+ return dq.du->getHTTPPath();
+ });
+
+ luaCtx.registerFunction<std::string(DNSQuestion::*)(void)const>("getHTTPQueryString", [](const DNSQuestion& dq) {
+ if (dq.du == nullptr) {
+ return std::string();
+ }
+ return dq.du->getHTTPQueryString();
+ });
+
+ luaCtx.registerFunction<std::string(DNSQuestion::*)(void)const>("getHTTPHost", [](const DNSQuestion& dq) {
+ if (dq.du == nullptr) {
+ return std::string();
+ }
+ return dq.du->getHTTPHost();
+ });
+
+ luaCtx.registerFunction<std::string(DNSQuestion::*)(void)const>("getHTTPScheme", [](const DNSQuestion& dq) {
+ if (dq.du == nullptr) {
+ return std::string();
+ }
+ return dq.du->getHTTPScheme();
+ });
+
+ luaCtx.registerFunction<std::unordered_map<std::string, std::string>(DNSQuestion::*)(void)const>("getHTTPHeaders", [](const DNSQuestion& dq) {
+ if (dq.du == nullptr) {
+ return std::unordered_map<std::string, std::string>();
+ }
+ return dq.du->getHTTPHeaders();
+ });
+
+ luaCtx.registerFunction<void(DNSQuestion::*)(uint16_t statusCode, const std::string& body, const boost::optional<std::string> contentType)>("setHTTPResponse", [](DNSQuestion& dq, uint16_t statusCode, const std::string& body, const boost::optional<std::string> contentType) {
+ if (dq.du == nullptr) {
+ return;
+ }
+ PacketBuffer vect(body.begin(), body.end());
+ dq.du->setHTTPResponse(statusCode, std::move(vect), contentType ? *contentType : "");
+ });
+#endif /* HAVE_DNS_OVER_HTTPS */
+
+ luaCtx.registerFunction<bool(DNSQuestion::*)(bool nxd, const std::string& zone, uint32_t ttl, const std::string& mname, const std::string& rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum)>("setNegativeAndAdditionalSOA", [](DNSQuestion& dq, bool nxd, const std::string& zone, uint32_t ttl, const std::string& mname, const std::string& rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum) {
+ return setNegativeAndAdditionalSOA(dq, nxd, DNSName(zone), ttl, DNSName(mname), DNSName(rname), serial, refresh, retry, expire, minimum);
+ });
+}
diff --git a/dnsdist-lua-bindings-kvs.cc b/dnsdist-lua-bindings-kvs.cc
new file mode 100644
index 0000000..b1e0c0f
--- /dev/null
+++ b/dnsdist-lua-bindings-kvs.cc
@@ -0,0 +1,115 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsdist.hh"
+#include "dnsdist-kvs.hh"
+#include "dnsdist-lua.hh"
+
+void setupLuaBindingsKVS(LuaContext& luaCtx, bool client)
+{
+ /* Key Value Store objects */
+ luaCtx.writeFunction("KeyValueLookupKeySourceIP", [](boost::optional<uint8_t> v4Mask, boost::optional<uint8_t> v6Mask, boost::optional<bool> includePort) {
+ return std::shared_ptr<KeyValueLookupKey>(new KeyValueLookupKeySourceIP(v4Mask.get_value_or(32), v6Mask.get_value_or(128), includePort.get_value_or(false)));
+ });
+ luaCtx.writeFunction("KeyValueLookupKeyQName", [](boost::optional<bool> wireFormat) {
+ return std::shared_ptr<KeyValueLookupKey>(new KeyValueLookupKeyQName(wireFormat ? *wireFormat : true));
+ });
+ luaCtx.writeFunction("KeyValueLookupKeySuffix", [](boost::optional<size_t> minLabels, boost::optional<bool> wireFormat) {
+ return std::shared_ptr<KeyValueLookupKey>(new KeyValueLookupKeySuffix(minLabels ? *minLabels : 0, wireFormat ? *wireFormat : true));
+ });
+ luaCtx.writeFunction("KeyValueLookupKeyTag", [](const std::string& tag) {
+ return std::shared_ptr<KeyValueLookupKey>(new KeyValueLookupKeyTag(tag));
+ });
+
+#ifdef HAVE_LMDB
+ luaCtx.writeFunction("newLMDBKVStore", [client](const std::string& fname, const std::string& dbName, boost::optional<bool> noLock) {
+ if (client) {
+ return std::shared_ptr<KeyValueStore>(nullptr);
+ }
+ return std::shared_ptr<KeyValueStore>(new LMDBKVStore(fname, dbName, noLock.get_value_or(false)));
+ });
+#endif /* HAVE_LMDB */
+
+#ifdef HAVE_CDB
+ luaCtx.writeFunction("newCDBKVStore", [client](const std::string& fname, time_t refreshDelay) {
+ if (client) {
+ return std::shared_ptr<KeyValueStore>(nullptr);
+ }
+ return std::shared_ptr<KeyValueStore>(new CDBKVStore(fname, refreshDelay));
+ });
+#endif /* HAVE_CDB */
+
+ luaCtx.registerFunction<std::string(std::shared_ptr<KeyValueStore>::*)(const boost::variant<ComboAddress, DNSName, std::string>, boost::optional<bool> wireFormat)>("lookup", [](std::shared_ptr<KeyValueStore>& kvs, const boost::variant<ComboAddress, DNSName, std::string> keyVar, boost::optional<bool> wireFormat) {
+ std::string result;
+ if (!kvs) {
+ return result;
+ }
+
+ if (keyVar.type() == typeid(ComboAddress)) {
+ const auto ca = boost::get<ComboAddress>(&keyVar);
+ KeyValueLookupKeySourceIP lookup(32, 128, false);
+ for (const auto& key : lookup.getKeys(*ca)) {
+ if (kvs->getValue(key, result)) {
+ return result;
+ }
+ }
+ }
+ else if (keyVar.type() == typeid(DNSName)) {
+ const DNSName* dn = boost::get<DNSName>(&keyVar);
+ KeyValueLookupKeyQName lookup(wireFormat ? *wireFormat : true);
+ for (const auto& key : lookup.getKeys(*dn)) {
+ if (kvs->getValue(key, result)) {
+ return result;
+ }
+ }
+ }
+ else if (keyVar.type() == typeid(std::string)) {
+ const std::string* keyStr = boost::get<std::string>(&keyVar);
+ kvs->getValue(*keyStr, result);
+ }
+
+ return result;
+ });
+
+ luaCtx.registerFunction<std::string(std::shared_ptr<KeyValueStore>::*)(const DNSName&, boost::optional<size_t> minLabels, boost::optional<bool> wireFormat)>("lookupSuffix", [](std::shared_ptr<KeyValueStore>& kvs, const DNSName& dn, boost::optional<size_t> minLabels, boost::optional<bool> wireFormat) {
+ std::string result;
+ if (!kvs) {
+ return result;
+ }
+
+ KeyValueLookupKeySuffix lookup(minLabels ? *minLabels : 0, wireFormat ? *wireFormat : true);
+ for (const auto& key : lookup.getKeys(dn)) {
+ if (kvs->getValue(key, result)) {
+ return result;
+ }
+ }
+
+ return result;
+ });
+
+ luaCtx.registerFunction<bool(std::shared_ptr<KeyValueStore>::*)()>("reload", [](std::shared_ptr<KeyValueStore>& kvs) {
+ if (!kvs) {
+ return false;
+ }
+
+ return kvs->reload();
+ });
+}
diff --git a/dnsdist-lua-bindings-packetcache.cc b/dnsdist-lua-bindings-packetcache.cc
new file mode 100644
index 0000000..086fb5d
--- /dev/null
+++ b/dnsdist-lua-bindings-packetcache.cc
@@ -0,0 +1,220 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include "config.h"
+#include "dolog.hh"
+#include "dnsdist.hh"
+#include "dnsdist-lua.hh"
+
+#include <boost/lexical_cast.hpp>
+
+void setupLuaBindingsPacketCache(LuaContext& luaCtx, bool client)
+{
+ /* PacketCache */
+ luaCtx.writeFunction("newPacketCache", [client](size_t maxEntries, boost::optional<std::unordered_map<std::string, boost::variant<bool, size_t, std::vector<std::pair<int, uint16_t>>>>> vars) {
+
+ bool keepStaleData = false;
+ size_t maxTTL = 86400;
+ size_t minTTL = 0;
+ size_t tempFailTTL = 60;
+ size_t maxNegativeTTL = 3600;
+ size_t staleTTL = 60;
+ size_t numberOfShards = 20;
+ bool dontAge = false;
+ bool deferrableInsertLock = true;
+ bool ecsParsing = false;
+ std::unordered_set<uint16_t> optionsToSkip{EDNSOptionCode::COOKIE};
+
+ if (vars) {
+
+ if (vars->count("deferrableInsertLock")) {
+ deferrableInsertLock = boost::get<bool>((*vars)["deferrableInsertLock"]);
+ }
+
+ if (vars->count("dontAge")) {
+ dontAge = boost::get<bool>((*vars)["dontAge"]);
+ }
+
+ if (vars->count("keepStaleData")) {
+ keepStaleData = boost::get<bool>((*vars)["keepStaleData"]);
+ }
+
+ if (vars->count("maxNegativeTTL")) {
+ maxNegativeTTL = boost::get<size_t>((*vars)["maxNegativeTTL"]);
+ }
+
+ if (vars->count("maxTTL")) {
+ maxTTL = boost::get<size_t>((*vars)["maxTTL"]);
+ }
+
+ if (vars->count("minTTL")) {
+ minTTL = boost::get<size_t>((*vars)["minTTL"]);
+ }
+
+ if (vars->count("numberOfShards")) {
+ numberOfShards = boost::get<size_t>((*vars)["numberOfShards"]);
+ }
+
+ if (vars->count("parseECS")) {
+ ecsParsing = boost::get<bool>((*vars)["parseECS"]);
+ }
+
+ if (vars->count("staleTTL")) {
+ staleTTL = boost::get<size_t>((*vars)["staleTTL"]);
+ }
+
+ if (vars->count("temporaryFailureTTL")) {
+ tempFailTTL = boost::get<size_t>((*vars)["temporaryFailureTTL"]);
+ }
+
+ if (vars->count("cookieHashing")) {
+ if (boost::get<bool>((*vars)["cookieHashing"])) {
+ optionsToSkip.erase(EDNSOptionCode::COOKIE);
+ }
+ }
+ if (vars->count("skipOptions")) {
+ for (auto option: boost::get<std::vector<std::pair<int, uint16_t>>>(vars->at("skipOptions"))) {
+ optionsToSkip.insert(option.second);
+ }
+ }
+ }
+
+ if (maxEntries == 0) {
+ warnlog("The number of entries in the packet cache is set to 0, raising to 1");
+ g_outputBuffer += "The number of entries in the packet cache is set to 0, raising to 1";
+ maxEntries = 1;
+ }
+
+ if (maxEntries < numberOfShards) {
+ warnlog("The number of entries (%d) in the packet cache is smaller than the number of shards (%d), decreasing the number of shards to %d", maxEntries, numberOfShards, maxEntries);
+ g_outputBuffer += "The number of entries (" + std::to_string(maxEntries) + " in the packet cache is smaller than the number of shards (" + std::to_string(numberOfShards) + "), decreasing the number of shards to " + std::to_string(maxEntries);
+ numberOfShards = maxEntries;
+ }
+
+ if (client) {
+ maxEntries = 1;
+ numberOfShards = 1;
+ }
+
+ auto res = std::make_shared<DNSDistPacketCache>(maxEntries, maxTTL, minTTL, tempFailTTL, maxNegativeTTL, staleTTL, dontAge, numberOfShards, deferrableInsertLock, ecsParsing);
+
+ res->setKeepStaleData(keepStaleData);
+ res->setSkippedOptions(optionsToSkip);
+
+ return res;
+ });
+ luaCtx.registerFunction<std::string(std::shared_ptr<DNSDistPacketCache>::*)()const>("toString", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
+ if (cache) {
+ return cache->toString();
+ }
+ return std::string();
+ });
+ luaCtx.registerFunction<bool(std::shared_ptr<DNSDistPacketCache>::*)()const>("isFull", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
+ if (cache) {
+ return cache->isFull();
+ }
+ return false;
+ });
+ luaCtx.registerFunction<size_t(std::shared_ptr<DNSDistPacketCache>::*)(size_t)>("purgeExpired", [](std::shared_ptr<DNSDistPacketCache>& cache, size_t upTo) {
+ if (cache) {
+ const time_t now = time(nullptr);
+
+ return cache->purgeExpired(upTo, now);
+ }
+ return static_cast<size_t>(0);
+ });
+ luaCtx.registerFunction<size_t(std::shared_ptr<DNSDistPacketCache>::*)(size_t)>("expunge", [](std::shared_ptr<DNSDistPacketCache>& cache, size_t upTo) {
+ if (cache) {
+ return cache->expunge(upTo);
+ }
+ return static_cast<size_t>(0);
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DNSDistPacketCache>::*)(const boost::variant<DNSName, string>& dname, boost::optional<uint16_t> qtype, boost::optional<bool> suffixMatch)>("expungeByName", [](
+ std::shared_ptr<DNSDistPacketCache>& cache,
+ const boost::variant<DNSName, string>& dname,
+ boost::optional<uint16_t> qtype,
+ boost::optional<bool> suffixMatch) {
+ DNSName qname;
+ if (dname.type() == typeid(DNSName)) {
+ qname = boost::get<DNSName>(dname);
+ }
+ if (dname.type() == typeid(string)) {
+ qname = DNSName(boost::get<string>(dname));
+ }
+ if (cache) {
+ g_outputBuffer="Expunged " + std::to_string(cache->expungeByName(qname, qtype ? *qtype : QType(QType::ANY).getCode(), suffixMatch ? *suffixMatch : false)) + " records\n";
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DNSDistPacketCache>::*)()const>("printStats", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
+ if (cache) {
+ g_outputBuffer="Entries: " + std::to_string(cache->getEntriesCount()) + "/" + std::to_string(cache->getMaxEntries()) + "\n";
+ g_outputBuffer+="Hits: " + std::to_string(cache->getHits()) + "\n";
+ g_outputBuffer+="Misses: " + std::to_string(cache->getMisses()) + "\n";
+ g_outputBuffer+="Deferred inserts: " + std::to_string(cache->getDeferredInserts()) + "\n";
+ g_outputBuffer+="Deferred lookups: " + std::to_string(cache->getDeferredLookups()) + "\n";
+ g_outputBuffer+="Lookup Collisions: " + std::to_string(cache->getLookupCollisions()) + "\n";
+ g_outputBuffer+="Insert Collisions: " + std::to_string(cache->getInsertCollisions()) + "\n";
+ g_outputBuffer+="TTL Too Shorts: " + std::to_string(cache->getTTLTooShorts()) + "\n";
+ }
+ });
+ luaCtx.registerFunction<std::unordered_map<std::string, uint64_t>(std::shared_ptr<DNSDistPacketCache>::*)()const>("getStats", [](const std::shared_ptr<DNSDistPacketCache>& cache) {
+ std::unordered_map<std::string, uint64_t> stats;
+ if (cache) {
+ stats["entries"] = cache->getEntriesCount();
+ stats["maxEntries"] = cache->getMaxEntries();
+ stats["hits"] = cache->getHits();
+ stats["misses"] = cache->getMisses();
+ stats["deferredInserts"] = cache->getDeferredInserts();
+ stats["deferredLookups"] = cache->getDeferredLookups();
+ stats["lookupCollisions"] = cache->getLookupCollisions();
+ stats["insertCollisions"] = cache->getInsertCollisions();
+ stats["ttlTooShorts"] = cache->getTTLTooShorts();
+ }
+ return stats;
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DNSDistPacketCache>::*)(const std::string& fname)const>("dump", [](const std::shared_ptr<DNSDistPacketCache>& cache, const std::string& fname) {
+ if (cache) {
+
+ int fd = open(fname.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660);
+ if (fd < 0) {
+ g_outputBuffer = "Error opening dump file for writing: " + stringerror() + "\n";
+ return;
+ }
+
+ uint64_t records = 0;
+ try {
+ records = cache->dump(fd);
+ }
+ catch (const std::exception& e) {
+ close(fd);
+ throw;
+ }
+
+ close(fd);
+
+ g_outputBuffer += "Dumped " + std::to_string(records) + " records\n";
+ }
+ });
+}
diff --git a/dnsdist-lua-bindings-protobuf.cc b/dnsdist-lua-bindings-protobuf.cc
new file mode 100644
index 0000000..373c841
--- /dev/null
+++ b/dnsdist-lua-bindings-protobuf.cc
@@ -0,0 +1,168 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "config.h"
+#include "dnsdist.hh"
+#include "dnsdist-lua.hh"
+
+#include "dnsdist-protobuf.hh"
+#include "dnstap.hh"
+#include "fstrm_logger.hh"
+#include "remote_logger.hh"
+
+#ifdef HAVE_LIBCRYPTO
+#include "ipcipher.hh"
+#endif /* HAVE_LIBCRYPTO */
+
+#ifdef HAVE_FSTRM
+static void parseFSTRMOptions(const boost::optional<std::unordered_map<std::string, unsigned int>>& params, std::unordered_map<string, unsigned int>& options)
+{
+ if (!params) {
+ return;
+ }
+
+ static std::vector<std::string> const potentialOptions = { "bufferHint", "flushTimeout", "inputQueueSize", "outputQueueSize", "queueNotifyThreshold", "reopenInterval" };
+
+ for (const auto& potentialOption : potentialOptions) {
+ if (params->count(potentialOption)) {
+ options[potentialOption] = boost::get<unsigned int>(params->at(potentialOption));
+ }
+ }
+}
+#endif /* HAVE_FSTRM */
+
+void setupLuaBindingsProtoBuf(LuaContext& luaCtx, bool client, bool configCheck)
+{
+#ifdef HAVE_LIBCRYPTO
+ luaCtx.registerFunction<ComboAddress(ComboAddress::*)(const std::string& key)const>("ipencrypt", [](const ComboAddress& ca, const std::string& key) {
+ return encryptCA(ca, key);
+ });
+ luaCtx.registerFunction<ComboAddress(ComboAddress::*)(const std::string& key)const>("ipdecrypt", [](const ComboAddress& ca, const std::string& key) {
+ return decryptCA(ca, key);
+ });
+
+ luaCtx.writeFunction("makeIPCipherKey", [](const std::string& password) {
+ return makeIPCipherKey(password);
+ });
+#endif /* HAVE_LIBCRYPTO */
+
+ /* ProtobufMessage */
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(std::string)>("setTag", [](DNSDistProtoBufMessage& message, const std::string& strValue) {
+ message.addTag(strValue);
+ });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(vector<pair<int, string>>)>("setTagArray", [](DNSDistProtoBufMessage& message, const vector<pair<int, string>>&tags) {
+ for (const auto& tag : tags) {
+ message.addTag(tag.second);
+ }
+ });
+
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(boost::optional <time_t> sec, boost::optional <uint32_t> uSec)>("setProtobufResponseType",
+ [](DNSDistProtoBufMessage& message, boost::optional <time_t> sec, boost::optional <uint32_t> uSec) {
+ message.setType(pdns::ProtoZero::Message::MessageType::DNSResponseType);
+ message.setQueryTime(sec ? *sec : 0, uSec ? *uSec : 0);
+ });
+
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(const std::string& strQueryName, uint16_t uType, uint16_t uClass, uint32_t uTTL, const std::string& strBlob)>("addResponseRR", [](DNSDistProtoBufMessage& message,
+ const std::string& strQueryName, uint16_t uType, uint16_t uClass, uint32_t uTTL, const std::string& strBlob) {
+ message.addRR(DNSName(strQueryName), uType, uClass, uTTL, strBlob);
+ });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(const Netmask&)>("setEDNSSubnet", [](DNSDistProtoBufMessage& message, const Netmask& subnet) { message.setEDNSSubnet(subnet); });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(const DNSName&, uint16_t, uint16_t)>("setQuestion", [](DNSDistProtoBufMessage& message, const DNSName& qname, uint16_t qtype, uint16_t qclass) { message.setQuestion(qname, qtype, qclass); });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(size_t)>("setBytes", [](DNSDistProtoBufMessage& message, size_t bytes) { message.setBytes(bytes); });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(time_t, uint32_t)>("setTime", [](DNSDistProtoBufMessage& message, time_t sec, uint32_t usec) { message.setTime(sec, usec); });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(time_t, uint32_t)>("setQueryTime", [](DNSDistProtoBufMessage& message, time_t sec, uint32_t usec) { message.setQueryTime(sec, usec); });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(uint8_t)>("setResponseCode", [](DNSDistProtoBufMessage& message, uint8_t rcode) { message.setResponseCode(rcode); });
+
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(const ComboAddress&, boost::optional<uint16_t>)>("setRequestor", [](DNSDistProtoBufMessage& message, const ComboAddress& addr, boost::optional<uint16_t> port) {
+ message.setRequestor(addr);
+ if (port) {
+ message.setRequestorPort(*port);
+ }
+ });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(const std::string&, boost::optional<uint16_t>)>("setRequestorFromString", [](DNSDistProtoBufMessage& message, const std::string& str, boost::optional<uint16_t> port) {
+ message.setRequestor(ComboAddress(str));
+ if (port) {
+ message.setRequestorPort(*port);
+ }
+ });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(const ComboAddress&, boost::optional<uint16_t>)>("setResponder", [](DNSDistProtoBufMessage& message, const ComboAddress& addr, boost::optional<uint16_t> port) {
+ message.setResponder(addr);
+ if (port) {
+ message.setResponderPort(*port);
+ }
+ });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(const std::string&, boost::optional<uint16_t>)>("setResponderFromString", [](DNSDistProtoBufMessage& message, const std::string& str, boost::optional<uint16_t> port) {
+ message.setResponder(ComboAddress(str));
+ if (port) {
+ message.setResponderPort(*port);
+ }
+ });
+ luaCtx.registerFunction<void(DNSDistProtoBufMessage::*)(const std::string&)>("setServerIdentity", [](DNSDistProtoBufMessage& message, const std::string& str) {
+ message.setServerIdentity(str);
+ });
+
+ luaCtx.registerFunction<void(DnstapMessage::*)(const std::string&)>("setExtra", [](DnstapMessage& message, const std::string& str) {
+ message.setExtra(str);
+ });
+
+ /* RemoteLogger */
+ luaCtx.writeFunction("newRemoteLogger", [client,configCheck](const std::string& remote, boost::optional<uint16_t> timeout, boost::optional<uint64_t> maxQueuedEntries, boost::optional<uint8_t> reconnectWaitTime) {
+ if (client || configCheck) {
+ return std::shared_ptr<RemoteLoggerInterface>(nullptr);
+ }
+ return std::shared_ptr<RemoteLoggerInterface>(new RemoteLogger(ComboAddress(remote), timeout ? *timeout : 2, maxQueuedEntries ? (*maxQueuedEntries*100) : 10000, reconnectWaitTime ? *reconnectWaitTime : 1, client));
+ });
+
+ luaCtx.writeFunction("newFrameStreamUnixLogger", [client,configCheck](const std::string& address, boost::optional<std::unordered_map<std::string, unsigned int>> params) {
+#ifdef HAVE_FSTRM
+ if (client || configCheck) {
+ return std::shared_ptr<RemoteLoggerInterface>(nullptr);
+ }
+
+ std::unordered_map<string, unsigned int> options;
+ parseFSTRMOptions(params, options);
+ return std::shared_ptr<RemoteLoggerInterface>(new FrameStreamLogger(AF_UNIX, address, !client, options));
+#else
+ throw std::runtime_error("fstrm support is required to build an AF_UNIX FrameStreamLogger");
+#endif /* HAVE_FSTRM */
+ });
+
+ luaCtx.writeFunction("newFrameStreamTcpLogger", [client,configCheck](const std::string& address, boost::optional<std::unordered_map<std::string, unsigned int>> params) {
+#if defined(HAVE_FSTRM) && defined(HAVE_FSTRM_TCP_WRITER_INIT)
+ if (client || configCheck) {
+ return std::shared_ptr<RemoteLoggerInterface>(nullptr);
+ }
+
+ std::unordered_map<string, unsigned int> options;
+ parseFSTRMOptions(params, options);
+ return std::shared_ptr<RemoteLoggerInterface>(new FrameStreamLogger(AF_INET, address, !client, options));
+#else
+ throw std::runtime_error("fstrm with TCP support is required to build an AF_INET FrameStreamLogger");
+#endif /* HAVE_FSTRM */
+ });
+
+ luaCtx.registerFunction<std::string(std::shared_ptr<RemoteLoggerInterface>::*)()const>("toString", [](const std::shared_ptr<RemoteLoggerInterface>& logger) {
+ if (logger) {
+ return logger->toString();
+ }
+ return std::string();
+ });
+}
diff --git a/dnsdist-lua-bindings.cc b/dnsdist-lua-bindings.cc
new file mode 100644
index 0000000..e0abed5
--- /dev/null
+++ b/dnsdist-lua-bindings.cc
@@ -0,0 +1,624 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "config.h"
+#include "dnsdist.hh"
+#include "dnsdist-lua.hh"
+#include "dnsdist-svc.hh"
+
+#include "dolog.hh"
+
+void setupLuaBindings(LuaContext& luaCtx, bool client)
+{
+ luaCtx.writeFunction("infolog", [](const string& arg) {
+ infolog("%s", arg);
+ });
+ luaCtx.writeFunction("errlog", [](const string& arg) {
+ errlog("%s", arg);
+ });
+ luaCtx.writeFunction("warnlog", [](const string& arg) {
+ warnlog("%s", arg);
+ });
+ luaCtx.writeFunction("show", [](const string& arg) {
+ g_outputBuffer+=arg;
+ g_outputBuffer+="\n";
+ });
+
+ /* Exceptions */
+ luaCtx.registerFunction<string(std::exception_ptr::*)()const>("__tostring", [](const std::exception_ptr& eptr) {
+ try {
+ if (eptr) {
+ std::rethrow_exception(eptr);
+ }
+ } catch(const std::exception& e) {
+ return string(e.what());
+ } catch(const PDNSException& e) {
+ return e.reason;
+ } catch(...) {
+ return string("Unknown exception");
+ }
+ return string("No exception");
+ });
+ /* ServerPolicy */
+ luaCtx.writeFunction("newServerPolicy", [](string name, ServerPolicy::policyfunc_t policy) { return std::make_shared<ServerPolicy>(name, policy, true);});
+ luaCtx.registerMember("name", &ServerPolicy::d_name);
+ luaCtx.registerMember("policy", &ServerPolicy::d_policy);
+ luaCtx.registerMember("ffipolicy", &ServerPolicy::d_ffipolicy);
+ luaCtx.registerMember("isLua", &ServerPolicy::d_isLua);
+ luaCtx.registerMember("isFFI", &ServerPolicy::d_isFFI);
+ luaCtx.registerMember("isPerThread", &ServerPolicy::d_isPerThread);
+ luaCtx.registerFunction("toString", &ServerPolicy::toString);
+ luaCtx.registerFunction("__tostring", &ServerPolicy::toString);
+
+ ServerPolicy policies[] = {
+ ServerPolicy{"firstAvailable", firstAvailable, false},
+ ServerPolicy{"roundrobin", roundrobin, false},
+ ServerPolicy{"wrandom", wrandom, false},
+ ServerPolicy{"whashed", whashed, false},
+ ServerPolicy{"chashed", chashed, false},
+ ServerPolicy{"leastOutstanding", leastOutstanding, false}
+ };
+ for (auto& policy : policies) {
+ luaCtx.writeVariable(policy.d_name, policy);
+ }
+
+ /* ServerPool */
+ luaCtx.registerFunction<void(std::shared_ptr<ServerPool>::*)(std::shared_ptr<DNSDistPacketCache>)>("setCache", [](std::shared_ptr<ServerPool> pool, std::shared_ptr<DNSDistPacketCache> cache) {
+ if (pool) {
+ pool->packetCache = cache;
+ }
+ });
+ luaCtx.registerFunction("getCache", &ServerPool::getCache);
+ luaCtx.registerFunction<void(std::shared_ptr<ServerPool>::*)()>("unsetCache", [](std::shared_ptr<ServerPool> pool) {
+ if (pool) {
+ pool->packetCache = nullptr;
+ }
+ });
+ luaCtx.registerFunction("getECS", &ServerPool::getECS);
+ luaCtx.registerFunction("setECS", &ServerPool::setECS);
+
+ /* DownstreamState */
+ luaCtx.registerFunction<void(DownstreamState::*)(int)>("setQPS", [](DownstreamState& s, int lim) { s.qps = lim ? QPSLimiter(lim, lim) : QPSLimiter(); });
+ luaCtx.registerFunction<void(std::shared_ptr<DownstreamState>::*)(string)>("addPool", [](std::shared_ptr<DownstreamState> s, string pool) {
+ auto localPools = g_pools.getCopy();
+ addServerToPool(localPools, pool, s);
+ g_pools.setState(localPools);
+ s->pools.insert(pool);
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DownstreamState>::*)(string)>("rmPool", [](std::shared_ptr<DownstreamState> s, string pool) {
+ auto localPools = g_pools.getCopy();
+ removeServerFromPool(localPools, pool, s);
+ g_pools.setState(localPools);
+ s->pools.erase(pool);
+ });
+ luaCtx.registerFunction<uint64_t(DownstreamState::*)()const>("getOutstanding", [](const DownstreamState& s) { return s.outstanding.load(); });
+ luaCtx.registerFunction<uint64_t(DownstreamState::*)()const>("getDrops", [](const DownstreamState& s) { return s.reuseds.load(); });
+ luaCtx.registerFunction<double(DownstreamState::*)()const>("getLatency", [](const DownstreamState& s) { return s.latencyUsec; });
+ luaCtx.registerFunction("isUp", &DownstreamState::isUp);
+ luaCtx.registerFunction("setDown", &DownstreamState::setDown);
+ luaCtx.registerFunction("setUp", &DownstreamState::setUp);
+ luaCtx.registerFunction<void(DownstreamState::*)(boost::optional<bool> newStatus)>("setAuto", [](DownstreamState& s, boost::optional<bool> newStatus) {
+ if (newStatus) {
+ s.setUpStatus(*newStatus);
+ }
+ s.setAuto();
+ });
+ luaCtx.registerFunction<std::string(DownstreamState::*)()const>("getName", [](const DownstreamState& s) { return s.getName(); });
+ luaCtx.registerFunction<std::string(DownstreamState::*)()const>("getNameWithAddr", [](const DownstreamState& s) { return s.getNameWithAddr(); });
+ luaCtx.registerMember("upStatus", &DownstreamState::upStatus);
+ luaCtx.registerMember<int (DownstreamState::*)>("weight",
+ [](const DownstreamState& s) -> int {return s.weight;},
+ [](DownstreamState& s, int newWeight) {s.setWeight(newWeight);}
+ );
+ luaCtx.registerMember("order", &DownstreamState::order);
+ luaCtx.registerMember<const std::string(DownstreamState::*)>("name", [](const DownstreamState& backend) -> const std::string { return backend.getName(); }, [](DownstreamState& backend, const std::string& newName) { backend.setName(newName); });
+ luaCtx.registerFunction<std::string(DownstreamState::*)()const>("getID", [](const DownstreamState& s) { return boost::uuids::to_string(s.id); });
+
+ /* dnsheader */
+ luaCtx.registerFunction<void(dnsheader::*)(bool)>("setRD", [](dnsheader& dh, bool v) {
+ dh.rd=v;
+ });
+
+ luaCtx.registerFunction<bool(dnsheader::*)()>("getRD", [](dnsheader& dh) {
+ return (bool)dh.rd;
+ });
+
+ luaCtx.registerFunction<void(dnsheader::*)(bool)>("setRA", [](dnsheader& dh, bool v) {
+ dh.ra=v;
+ });
+
+ luaCtx.registerFunction<bool(dnsheader::*)()>("getRA", [](dnsheader& dh) {
+ return (bool)dh.ra;
+ });
+
+ luaCtx.registerFunction<void(dnsheader::*)(bool)>("setAD", [](dnsheader& dh, bool v) {
+ dh.ad=v;
+ });
+
+ luaCtx.registerFunction<bool(dnsheader::*)()>("getAD", [](dnsheader& dh) {
+ return (bool)dh.ad;
+ });
+
+ luaCtx.registerFunction<void(dnsheader::*)(bool)>("setAA", [](dnsheader& dh, bool v) {
+ dh.aa=v;
+ });
+
+ luaCtx.registerFunction<bool(dnsheader::*)()>("getAA", [](dnsheader& dh) {
+ return (bool)dh.aa;
+ });
+
+ luaCtx.registerFunction<void(dnsheader::*)(bool)>("setCD", [](dnsheader& dh, bool v) {
+ dh.cd=v;
+ });
+
+ luaCtx.registerFunction<bool(dnsheader::*)()>("getCD", [](dnsheader& dh) {
+ return (bool)dh.cd;
+ });
+
+ luaCtx.registerFunction<void(dnsheader::*)(bool)>("setTC", [](dnsheader& dh, bool v) {
+ dh.tc=v;
+ if(v) dh.ra = dh.rd; // you'll always need this, otherwise TC=1 gets ignored
+ });
+
+ luaCtx.registerFunction<void(dnsheader::*)(bool)>("setQR", [](dnsheader& dh, bool v) {
+ dh.qr=v;
+ });
+
+ /* ComboAddress */
+ luaCtx.writeFunction("newCA", [](const std::string& name) { return ComboAddress(name); });
+ luaCtx.writeFunction("newCAFromRaw", [](const std::string& raw, boost::optional<uint16_t> port) {
+ if (raw.size() == 4) {
+ struct sockaddr_in sin4;
+ memset(&sin4, 0, sizeof(sin4));
+ sin4.sin_family = AF_INET;
+ memcpy(&sin4.sin_addr.s_addr, raw.c_str(), raw.size());
+ if (port) {
+ sin4.sin_port = htons(*port);
+ }
+ return ComboAddress(&sin4);
+ }
+ else if (raw.size() == 16) {
+ struct sockaddr_in6 sin6;
+ memset(&sin6, 0, sizeof(sin6));
+ sin6.sin6_family = AF_INET6;
+ memcpy(&sin6.sin6_addr.s6_addr, raw.c_str(), raw.size());
+ if (port) {
+ sin6.sin6_port = htons(*port);
+ }
+ return ComboAddress(&sin6);
+ }
+ return ComboAddress();
+ });
+ luaCtx.registerFunction<string(ComboAddress::*)()const>("tostring", [](const ComboAddress& ca) { return ca.toString(); });
+ luaCtx.registerFunction<string(ComboAddress::*)()const>("tostringWithPort", [](const ComboAddress& ca) { return ca.toStringWithPort(); });
+ luaCtx.registerFunction<string(ComboAddress::*)()const>("__tostring", [](const ComboAddress& ca) { return ca.toString(); });
+ luaCtx.registerFunction<string(ComboAddress::*)()const>("toString", [](const ComboAddress& ca) { return ca.toString(); });
+ luaCtx.registerFunction<string(ComboAddress::*)()const>("toStringWithPort", [](const ComboAddress& ca) { return ca.toStringWithPort(); });
+ luaCtx.registerFunction<uint16_t(ComboAddress::*)()const>("getPort", [](const ComboAddress& ca) { return ntohs(ca.sin4.sin_port); } );
+ luaCtx.registerFunction<void(ComboAddress::*)(unsigned int)>("truncate", [](ComboAddress& ca, unsigned int bits) { ca.truncate(bits); });
+ luaCtx.registerFunction<bool(ComboAddress::*)()const>("isIPv4", [](const ComboAddress& ca) { return ca.sin4.sin_family == AF_INET; });
+ luaCtx.registerFunction<bool(ComboAddress::*)()const>("isIPv6", [](const ComboAddress& ca) { return ca.sin4.sin_family == AF_INET6; });
+ luaCtx.registerFunction<bool(ComboAddress::*)()const>("isMappedIPv4", [](const ComboAddress& ca) { return ca.isMappedIPv4(); });
+ luaCtx.registerFunction<ComboAddress(ComboAddress::*)()const>("mapToIPv4", [](const ComboAddress& ca) { return ca.mapToIPv4(); });
+ luaCtx.registerFunction<bool(nmts_t::*)(const ComboAddress&)>("match", [](nmts_t& s, const ComboAddress& ca) { return s.match(ca); });
+
+ /* DNSName */
+ luaCtx.registerFunction("isPartOf", &DNSName::isPartOf);
+ luaCtx.registerFunction<bool(DNSName::*)()>("chopOff", [](DNSName&dn ) { return dn.chopOff(); });
+ luaCtx.registerFunction<unsigned int(DNSName::*)()const>("countLabels", [](const DNSName& name) { return name.countLabels(); });
+ luaCtx.registerFunction<size_t(DNSName::*)()const>("hash", [](const DNSName& name) { return name.hash(); });
+ luaCtx.registerFunction<size_t(DNSName::*)()const>("wirelength", [](const DNSName& name) { return name.wirelength(); });
+ luaCtx.registerFunction<string(DNSName::*)()const>("tostring", [](const DNSName&dn ) { return dn.toString(); });
+ luaCtx.registerFunction<string(DNSName::*)()const>("toString", [](const DNSName&dn ) { return dn.toString(); });
+ luaCtx.registerFunction<string(DNSName::*)()const>("__tostring", [](const DNSName&dn ) { return dn.toString(); });
+ luaCtx.registerFunction<string(DNSName::*)()const>("toDNSString", [](const DNSName&dn ) { return dn.toDNSString(); });
+ luaCtx.writeFunction("newDNSName", [](const std::string& name) { return DNSName(name); });
+ luaCtx.writeFunction("newDNSNameFromRaw", [](const std::string& name) { return DNSName(name.c_str(), name.size(), 0, false); });
+ luaCtx.writeFunction("newSuffixMatchNode", []() { return SuffixMatchNode(); });
+ luaCtx.writeFunction("newDNSNameSet", []() { return DNSNameSet(); });
+
+ /* DNSNameSet */
+ luaCtx.registerFunction<string(DNSNameSet::*)()const>("toString", [](const DNSNameSet&dns ) { return dns.toString(); });
+ luaCtx.registerFunction<string(DNSNameSet::*)()const>("__tostring", [](const DNSNameSet&dns ) { return dns.toString(); });
+ luaCtx.registerFunction<void(DNSNameSet::*)(DNSName&)>("add", [](DNSNameSet& dns, DNSName& dn) { dns.insert(dn); });
+ luaCtx.registerFunction<bool(DNSNameSet::*)(DNSName&)>("check", [](DNSNameSet& dns, DNSName& dn) { return dns.find(dn) != dns.end(); });
+ luaCtx.registerFunction("delete",(size_t (DNSNameSet::*)(const DNSName&)) &DNSNameSet::erase);
+ luaCtx.registerFunction("size",(size_t (DNSNameSet::*)() const) &DNSNameSet::size);
+ luaCtx.registerFunction("clear",(void (DNSNameSet::*)()) &DNSNameSet::clear);
+ luaCtx.registerFunction("empty",(bool (DNSNameSet::*)() const) &DNSNameSet::empty);
+
+ /* SuffixMatchNode */
+ luaCtx.registerFunction<void (SuffixMatchNode::*)(const boost::variant<DNSName, string, vector<pair<int, DNSName>>, vector<pair<int, string>>> &name)>("add", [](SuffixMatchNode &smn, const boost::variant<DNSName, string, vector<pair<int, DNSName>>, vector<pair<int, string>>> &name) {
+ if (name.type() == typeid(DNSName)) {
+ auto n = boost::get<DNSName>(name);
+ smn.add(n);
+ return;
+ }
+ if (name.type() == typeid(string)) {
+ auto n = boost::get<string>(name);
+ smn.add(n);
+ return;
+ }
+ if (name.type() == typeid(vector<pair<int, DNSName>>)) {
+ auto names = boost::get<vector<pair<int, DNSName>>>(name);
+ for (const auto& n : names) {
+ smn.add(n.second);
+ }
+ return;
+ }
+ if (name.type() == typeid(vector<pair<int, string>>)) {
+ auto names = boost::get<vector<pair<int, string>>>(name);
+ for (const auto& n : names) {
+ smn.add(n.second);
+ }
+ return;
+ }
+ });
+ luaCtx.registerFunction<void (SuffixMatchNode::*)(const boost::variant<DNSName, string, vector<pair<int, DNSName>>, vector<pair<int, string>>> &name)>("remove", [](SuffixMatchNode &smn, const boost::variant<DNSName, string, vector<pair<int, DNSName>>, vector<pair<int, string>>> &name) {
+ if (name.type() == typeid(DNSName)) {
+ auto n = boost::get<DNSName>(name);
+ smn.remove(n);
+ return;
+ }
+ if (name.type() == typeid(string)) {
+ auto n = boost::get<string>(name);
+ DNSName d(n);
+ smn.remove(d);
+ return;
+ }
+ if (name.type() == typeid(vector<pair<int, DNSName>>)) {
+ auto names = boost::get<vector<pair<int, DNSName>>>(name);
+ for (const auto& n : names) {
+ smn.remove(n.second);
+ }
+ return;
+ }
+ if (name.type() == typeid(vector<pair<int, string>>)) {
+ auto names = boost::get<vector<pair<int, string>>>(name);
+ for (const auto& n : names) {
+ DNSName d(n.second);
+ smn.remove(d);
+ }
+ return;
+ }
+ });
+
+ luaCtx.registerFunction("check",(bool (SuffixMatchNode::*)(const DNSName&) const) &SuffixMatchNode::check);
+
+ /* Netmask */
+ luaCtx.writeFunction("newNetmask", [](boost::variant<std::string,ComboAddress> s, boost::optional<uint8_t> bits) {
+ if (s.type() == typeid(ComboAddress)) {
+ auto ca = boost::get<ComboAddress>(s);
+ if (bits) {
+ return Netmask(ca, *bits);
+ }
+ return Netmask(ca);
+ }
+ else if (s.type() == typeid(std::string)) {
+ auto str = boost::get<std::string>(s);
+ return Netmask(str);
+ }
+ throw std::runtime_error("Invalid parameter passed to 'newNetmask()'");
+ });
+ luaCtx.registerFunction("empty", &Netmask::empty);
+ luaCtx.registerFunction("getBits", &Netmask::getBits);
+ luaCtx.registerFunction<ComboAddress(Netmask::*)()const>("getNetwork", [](const Netmask& nm) { return nm.getNetwork(); } ); // const reference makes this necessary
+ luaCtx.registerFunction<ComboAddress(Netmask::*)()const>("getMaskedNetwork", [](const Netmask& nm) { return nm.getMaskedNetwork(); } );
+ luaCtx.registerFunction("isIpv4", &Netmask::isIPv4);
+ luaCtx.registerFunction("isIPv4", &Netmask::isIPv4);
+ luaCtx.registerFunction("isIpv6", &Netmask::isIPv6);
+ luaCtx.registerFunction("isIPv6", &Netmask::isIPv6);
+ luaCtx.registerFunction("match", (bool (Netmask::*)(const string&) const)&Netmask::match);
+ luaCtx.registerFunction("toString", &Netmask::toString);
+ luaCtx.registerFunction("__tostring", &Netmask::toString);
+ luaCtx.registerEqFunction(&Netmask::operator==);
+ luaCtx.registerToStringFunction(&Netmask::toString);
+
+ /* NetmaskGroup */
+ luaCtx.writeFunction("newNMG", []() { return NetmaskGroup(); });
+ luaCtx.registerFunction<void(NetmaskGroup::*)(const std::string&mask)>("addMask", [](NetmaskGroup&nmg, const std::string& mask)
+ {
+ nmg.addMask(mask);
+ });
+ luaCtx.registerFunction<void(NetmaskGroup::*)(const std::map<ComboAddress,int>& map)>("addMasks", [](NetmaskGroup&nmg, const std::map<ComboAddress,int>& map)
+ {
+ for (const auto& entry : map) {
+ nmg.addMask(Netmask(entry.first));
+ }
+ });
+
+ luaCtx.registerFunction("match", (bool (NetmaskGroup::*)(const ComboAddress&) const)&NetmaskGroup::match);
+ luaCtx.registerFunction("size", &NetmaskGroup::size);
+ luaCtx.registerFunction("clear", &NetmaskGroup::clear);
+ luaCtx.registerFunction<string(NetmaskGroup::*)()const>("toString", [](const NetmaskGroup& nmg ) { return "NetmaskGroup " + nmg.toString(); });
+ luaCtx.registerFunction<string(NetmaskGroup::*)()const>("__tostring", [](const NetmaskGroup& nmg ) { return "NetmaskGroup " + nmg.toString(); });
+
+ /* QPSLimiter */
+ luaCtx.writeFunction("newQPSLimiter", [](int rate, int burst) { return QPSLimiter(rate, burst); });
+ luaCtx.registerFunction("check", &QPSLimiter::check);
+
+ /* ClientState */
+ luaCtx.registerFunction<std::string(ClientState::*)()const>("toString", [](const ClientState& fe) {
+ setLuaNoSideEffect();
+ return fe.local.toStringWithPort();
+ });
+ luaCtx.registerFunction<std::string(ClientState::*)()const>("__tostring", [](const ClientState& fe) {
+ setLuaNoSideEffect();
+ return fe.local.toStringWithPort();
+ });
+ luaCtx.registerFunction<std::string(ClientState::*)()const>("getType", [](const ClientState& fe) {
+ setLuaNoSideEffect();
+ return fe.getType();
+ });
+ luaCtx.registerFunction<std::string(ClientState::*)()const>("getConfiguredTLSProvider", [](const ClientState& fe) {
+ setLuaNoSideEffect();
+ if (fe.tlsFrontend != nullptr) {
+ return fe.tlsFrontend->getRequestedProvider();
+ }
+ else if (fe.dohFrontend != nullptr) {
+ return std::string("openssl");
+ }
+ return std::string();
+ });
+ luaCtx.registerFunction<std::string(ClientState::*)()const>("getEffectiveTLSProvider", [](const ClientState& fe) {
+ setLuaNoSideEffect();
+ if (fe.tlsFrontend != nullptr) {
+ return fe.tlsFrontend->getEffectiveProvider();
+ }
+ else if (fe.dohFrontend != nullptr) {
+ return std::string("openssl");
+ }
+ return std::string();
+ });
+ luaCtx.registerMember("muted", &ClientState::muted);
+#ifdef HAVE_EBPF
+ luaCtx.registerFunction<void(ClientState::*)(std::shared_ptr<BPFFilter>)>("attachFilter", [](ClientState& frontend, std::shared_ptr<BPFFilter> bpf) {
+ if (bpf) {
+ frontend.attachFilter(bpf);
+ }
+ });
+ luaCtx.registerFunction<void(ClientState::*)()>("detachFilter", [](ClientState& frontend) {
+ frontend.detachFilter();
+ });
+#endif /* HAVE_EBPF */
+
+ /* BPF Filter */
+#ifdef HAVE_EBPF
+ using bpfFilterMapParams = boost::variant<uint32_t, std::unordered_map<std::string, boost::variant<uint32_t, std::string>>>;
+ luaCtx.writeFunction("newBPFFilter", [client](bpfFilterMapParams v4Params, bpfFilterMapParams v6Params, bpfFilterMapParams qnameParams, boost::optional<bool> external) {
+ if (client) {
+ return std::shared_ptr<BPFFilter>(nullptr);
+ }
+
+ BPFFilter::MapConfiguration v4Config, v6Config, qnameConfig;
+
+ auto convertParamsToConfig = [](bpfFilterMapParams& params, BPFFilter::MapType type, BPFFilter::MapConfiguration& config) {
+ config.d_type = type;
+ if (params.type() == typeid(uint32_t)) {
+ config.d_maxItems = boost::get<uint32_t>(params);
+ }
+ else if (params.type() == typeid(std::unordered_map<std::string, boost::variant<uint32_t, std::string>>)) {
+ auto map = boost::get<std::unordered_map<std::string, boost::variant<uint32_t, std::string>>>(params);
+ if (map.count("maxItems")) {
+ config.d_maxItems = boost::get<uint32_t>(map.at("maxItems"));
+ }
+ if (map.count("pinnedPath")) {
+ config.d_pinnedPath = boost::get<std::string>(map.at("pinnedPath"));
+ }
+ }
+ };
+
+ convertParamsToConfig(v4Params, BPFFilter::MapType::IPv4, v4Config);
+ convertParamsToConfig(v6Params, BPFFilter::MapType::IPv6, v6Config);
+ convertParamsToConfig(qnameParams, BPFFilter::MapType::QNames, qnameConfig);
+
+ BPFFilter::MapFormat format = BPFFilter::MapFormat::Legacy;
+ if (external && *external) {
+ format = BPFFilter::MapFormat::WithActions;
+ }
+
+ return std::make_shared<BPFFilter>(v4Config, v6Config, qnameConfig, format, external.value_or(false));
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<BPFFilter>::*)(const ComboAddress& ca, boost::optional<uint32_t> action)>("block", [](std::shared_ptr<BPFFilter> bpf, const ComboAddress& ca, boost::optional<uint32_t> action) {
+ if (bpf) {
+ if (!action) {
+ return bpf->block(ca, BPFFilter::MatchAction::Drop);
+ }
+ else {
+ BPFFilter::MatchAction match;
+
+ switch (*action) {
+ case 0:
+ match = BPFFilter::MatchAction::Pass;
+ break;
+ case 1:
+ match = BPFFilter::MatchAction::Drop;
+ break;
+ case 2:
+ match = BPFFilter::MatchAction::Truncate;
+ break;
+ default:
+ throw std::runtime_error("Unsupported action for BPFFilter::block");
+ }
+ return bpf->block(ca, match);
+ }
+ }
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<BPFFilter>::*)(const DNSName& qname, boost::optional<uint16_t> qtype, boost::optional<uint32_t> action)>("blockQName", [](std::shared_ptr<BPFFilter> bpf, const DNSName& qname, boost::optional<uint16_t> qtype, boost::optional<uint32_t> action) {
+ if (bpf) {
+ if (!action) {
+ return bpf->block(qname, BPFFilter::MatchAction::Drop, qtype.value_or(255));
+ }
+ else {
+ BPFFilter::MatchAction match;
+
+ switch (*action) {
+ case 0:
+ match = BPFFilter::MatchAction::Pass;
+ break;
+ case 1:
+ match = BPFFilter::MatchAction::Drop;
+ break;
+ case 2:
+ match = BPFFilter::MatchAction::Truncate;
+ break;
+ default:
+ throw std::runtime_error("Unsupported action for BPFFilter::blockQName");
+ }
+ return bpf->block(qname, match, qtype.value_or(255));
+ }
+ }
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<BPFFilter>::*)(const ComboAddress& ca)>("unblock", [](std::shared_ptr<BPFFilter> bpf, const ComboAddress& ca) {
+ if (bpf) {
+ return bpf->unblock(ca);
+ }
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<BPFFilter>::*)(const DNSName& qname, boost::optional<uint16_t> qtype)>("unblockQName", [](std::shared_ptr<BPFFilter> bpf, const DNSName& qname, boost::optional<uint16_t> qtype) {
+ if (bpf) {
+ return bpf->unblock(qname, qtype ? *qtype : 255);
+ }
+ });
+
+ luaCtx.registerFunction<std::string(std::shared_ptr<BPFFilter>::*)()const>("getStats", [](const std::shared_ptr<BPFFilter> bpf) {
+ setLuaNoSideEffect();
+ std::string res;
+ if (bpf) {
+ auto stats = bpf->getAddrStats();
+ for (const auto& value : stats) {
+ if (value.first.sin4.sin_family == AF_INET) {
+ res += value.first.toString() + ": " + std::to_string(value.second) + "\n";
+ }
+ else if (value.first.sin4.sin_family == AF_INET6) {
+ res += "[" + value.first.toString() + "]: " + std::to_string(value.second) + "\n";
+ }
+ }
+ auto qstats = bpf->getQNameStats();
+ for (const auto& value : qstats) {
+ res += std::get<0>(value).toString() + " " + std::to_string(std::get<1>(value)) + ": " + std::to_string(std::get<2>(value)) + "\n";
+ }
+ }
+ return res;
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<BPFFilter>::*)()>("attachToAllBinds", [](std::shared_ptr<BPFFilter> bpf) {
+ std::string res;
+ if (bpf) {
+ for (const auto& frontend : g_frontends) {
+ frontend->attachFilter(bpf);
+ }
+ }
+ });
+
+ luaCtx.writeFunction("newDynBPFFilter", [client](std::shared_ptr<BPFFilter> bpf) {
+ if (client) {
+ return std::shared_ptr<DynBPFFilter>(nullptr);
+ }
+ return std::make_shared<DynBPFFilter>(bpf);
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<DynBPFFilter>::*)(const ComboAddress& addr, boost::optional<int> seconds)>("block", [](std::shared_ptr<DynBPFFilter> dbpf, const ComboAddress& addr, boost::optional<int> seconds) {
+ if (dbpf) {
+ struct timespec until;
+ clock_gettime(CLOCK_MONOTONIC, &until);
+ until.tv_sec += seconds ? *seconds : 10;
+ dbpf->block(addr, until);
+ }
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<DynBPFFilter>::*)()>("purgeExpired", [](std::shared_ptr<DynBPFFilter> dbpf) {
+ if (dbpf) {
+ struct timespec now;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ dbpf->purgeExpired(now);
+ }
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<DynBPFFilter>::*)(boost::variant<std::string, std::vector<std::pair<int, std::string>>>)>("excludeRange", [](std::shared_ptr<DynBPFFilter> dbpf, boost::variant<std::string, std::vector<std::pair<int, std::string>>> ranges) {
+ if (!dbpf) {
+ return;
+ }
+
+ if (ranges.type() == typeid(std::vector<std::pair<int, std::string>>)) {
+ for (const auto& range : *boost::get<std::vector<std::pair<int, std::string>>>(&ranges)) {
+ dbpf->excludeRange(Netmask(range.second));
+ }
+ }
+ else {
+ dbpf->excludeRange(Netmask(*boost::get<std::string>(&ranges)));
+ }
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<DynBPFFilter>::*)(boost::variant<std::string, std::vector<std::pair<int, std::string>>>)>("includeRange", [](std::shared_ptr<DynBPFFilter> dbpf, boost::variant<std::string, std::vector<std::pair<int, std::string>>> ranges) {
+ if (!dbpf) {
+ return;
+ }
+
+ if (ranges.type() == typeid(std::vector<std::pair<int, std::string>>)) {
+ for (const auto& range : *boost::get<std::vector<std::pair<int, std::string>>>(&ranges)) {
+ dbpf->includeRange(Netmask(range.second));
+ }
+ }
+ else {
+ dbpf->includeRange(Netmask(*boost::get<std::string>(&ranges)));
+ }
+ });
+#endif /* HAVE_EBPF */
+
+ /* EDNSOptionView */
+ luaCtx.registerFunction<size_t(EDNSOptionView::*)()const>("count", [](const EDNSOptionView& option) {
+ return option.values.size();
+ });
+ luaCtx.registerFunction<std::vector<string>(EDNSOptionView::*)()const>("getValues", [] (const EDNSOptionView& option) {
+ std::vector<string> values;
+ for (const auto& value : option.values) {
+ values.push_back(std::string(value.content, value.size));
+ }
+ return values;
+ });
+
+ luaCtx.writeFunction("newDOHResponseMapEntry", [](const std::string& regex, uint16_t status, const std::string& content, boost::optional<std::map<std::string, std::string>> customHeaders) {
+ boost::optional<std::vector<std::pair<std::string, std::string>>> headers{boost::none};
+ if (customHeaders) {
+ headers = std::vector<std::pair<std::string, std::string>>();
+ for (const auto& header : *customHeaders) {
+ headers->push_back({ boost::to_lower_copy(header.first), header.second });
+ }
+ }
+ return std::make_shared<DOHResponseMapEntry>(regex, status, PacketBuffer(content.begin(), content.end()), headers);
+ });
+
+ luaCtx.writeFunction("newSVCRecordParameters", [](uint16_t priority, const std::string& target, boost::optional<svcParamsLua_t> additionalParameters)
+ {
+ SVCRecordParameters parameters;
+ if (additionalParameters) {
+ parameters = parseSVCParameters(*additionalParameters);
+ }
+ parameters.priority = priority;
+ parameters.target = DNSName(target);
+
+ return parameters;
+ });
+}
diff --git a/dnsdist-lua-ffi-interface.h b/dnsdist-lua-ffi-interface.h
new file mode 100644
index 0000000..71faeb1
--- /dev/null
+++ b/dnsdist-lua-ffi-interface.h
@@ -0,0 +1,125 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/* we don't use a guard (C++ pragma once or even #ifndef because this file (the .inc version)
+ is passed to the Lua FFI wrapper which doesn't support it */
+
+typedef struct dnsdist_ffi_dnsquestion_t dnsdist_ffi_dnsquestion_t;
+typedef struct dnsdist_ffi_servers_list_t dnsdist_ffi_servers_list_t;
+typedef struct dnsdist_ffi_server_t dnsdist_ffi_server_t;
+
+typedef struct dnsdist_ffi_ednsoption {
+ uint16_t optionCode;
+ uint16_t len;
+ const void* data;
+} dnsdist_ffi_ednsoption_t;
+
+typedef struct dnsdist_ffi_http_header {
+ const char* name;
+ const char* value;
+} dnsdist_ffi_http_header_t;
+
+typedef struct dnsdist_ffi_tag {
+ const char* name;
+ const char* value;
+} dnsdist_ffi_tag_t;
+
+typedef struct dnsdist_ffi_raw_value {
+ const char* value;
+ uint16_t size;
+} dnsdist_ffi_raw_value_t;
+
+void dnsdist_ffi_dnsquestion_get_localaddr(const dnsdist_ffi_dnsquestion_t* dq, const void** addr, size_t* addrSize) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_local_port(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_get_remoteaddr(const dnsdist_ffi_dnsquestion_t* dq, const void** addr, size_t* addrSize) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_get_masked_remoteaddr(dnsdist_ffi_dnsquestion_t* dq, const void** addr, size_t* addrSize, uint8_t bits) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_remote_port(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_get_qname_raw(const dnsdist_ffi_dnsquestion_t* dq, const char** qname, size_t* qnameSize) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_dnsquestion_get_qname_hash(const dnsdist_ffi_dnsquestion_t* dq, size_t init) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_qtype(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_qclass(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+int dnsdist_ffi_dnsquestion_get_rcode(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void* dnsdist_ffi_dnsquestion_get_header(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_len(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_dnsquestion_get_size(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_set_size(dnsdist_ffi_dnsquestion_t* dq, size_t newSize) __attribute__ ((visibility ("default")));
+uint8_t dnsdist_ffi_dnsquestion_get_opcode(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_tcp(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_skip_cache(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_use_ecs(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_add_xpf(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_ecs_override(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_ecs_prefix_length(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_is_temp_failure_ttl_set(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+uint32_t dnsdist_ffi_dnsquestion_get_temp_failure_ttl(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_do(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_get_sni(const dnsdist_ffi_dnsquestion_t* dq, const char** sni, size_t* sniSize) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_tag(const dnsdist_ffi_dnsquestion_t* dq, const char* label) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_http_path(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_http_query_string(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_http_host(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_http_scheme(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+
+// returns the length of the resulting 'out' array. 'out' is not set if the length is 0
+size_t dnsdist_ffi_dnsquestion_get_edns_options(dnsdist_ffi_dnsquestion_t* ref, const dnsdist_ffi_ednsoption_t** out) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_dnsquestion_get_http_headers(dnsdist_ffi_dnsquestion_t* ref, const dnsdist_ffi_http_header_t** out) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_dnsquestion_get_tag_array(dnsdist_ffi_dnsquestion_t* ref, const dnsdist_ffi_tag_t** out) __attribute__ ((visibility ("default")));
+
+void dnsdist_ffi_dnsquestion_set_result(dnsdist_ffi_dnsquestion_t* dq, const char* str, size_t strSize) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_rcode(dnsdist_ffi_dnsquestion_t* dq, int rcode) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_len(dnsdist_ffi_dnsquestion_t* dq, uint16_t len) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_skip_cache(dnsdist_ffi_dnsquestion_t* dq, bool skipCache) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_use_ecs(dnsdist_ffi_dnsquestion_t* dq, bool useECS) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_ecs_override(dnsdist_ffi_dnsquestion_t* dq, bool ecsOverride) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_ecs_prefix_length(dnsdist_ffi_dnsquestion_t* dq, uint16_t ecsPrefixLength) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_temp_failure_ttl(dnsdist_ffi_dnsquestion_t* dq, uint32_t tempFailureTTL) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_unset_temp_failure_ttl(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_tag(dnsdist_ffi_dnsquestion_t* dq, const char* label, const char* value) __attribute__ ((visibility ("default")));
+
+void dnsdist_ffi_dnsquestion_set_http_response(dnsdist_ffi_dnsquestion_t* dq, uint16_t statusCode, const char* body, size_t bodyLen, const char* contentType) __attribute__ ((visibility ("default")));
+
+size_t dnsdist_ffi_dnsquestion_get_trailing_data(dnsdist_ffi_dnsquestion_t* dq, const char** out) __attribute__ ((visibility ("default")));
+
+bool dnsdist_ffi_dnsquestion_set_trailing_data(dnsdist_ffi_dnsquestion_t* dq, const char* data, size_t dataLen) __attribute__ ((visibility ("default")));
+
+void dnsdist_ffi_dnsquestion_send_trap(dnsdist_ffi_dnsquestion_t* dq, const char* reason, size_t reasonLen) __attribute__ ((visibility ("default")));
+
+// the content of values should contain raw DNS record data ('\192\000\002\001' for A, '\034this text has a comma at the end,' for TXT, etc)
+void dnsdist_ffi_dnsquestion_spoof_raw(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_raw_value_t* values, size_t valuesCount) __attribute__ ((visibility ("default")));
+// the content of values should contain raw IPv4 or IPv6 addresses in network byte-order
+void dnsdist_ffi_dnsquestion_spoof_addrs(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_raw_value_t* values, size_t valuesCount) __attribute__ ((visibility ("default")));
+
+typedef struct dnsdist_ffi_servers_list_t dnsdist_ffi_servers_list_t;
+typedef struct dnsdist_ffi_server_t dnsdist_ffi_server_t;
+
+size_t dnsdist_ffi_servers_list_get_count(const dnsdist_ffi_servers_list_t* list) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_servers_list_get_server(const dnsdist_ffi_servers_list_t* list, size_t idx, const dnsdist_ffi_server_t** out) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_servers_list_chashed(const dnsdist_ffi_servers_list_t* list, const dnsdist_ffi_dnsquestion_t* dq, size_t hash) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_servers_list_whashed(const dnsdist_ffi_servers_list_t* list, const dnsdist_ffi_dnsquestion_t* dq, size_t hash) __attribute__ ((visibility ("default")));
+
+uint64_t dnsdist_ffi_server_get_outstanding(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_server_is_up(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_server_get_name(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_server_get_name_with_addr(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+int dnsdist_ffi_server_get_weight(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+int dnsdist_ffi_server_get_order(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+double dnsdist_ffi_server_get_latency(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
diff --git a/dnsdist-lua-ffi-interface.inc b/dnsdist-lua-ffi-interface.inc
new file mode 100644
index 0000000..5a3fadd
--- /dev/null
+++ b/dnsdist-lua-ffi-interface.inc
@@ -0,0 +1,127 @@
+R"FFIContent(
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/* we don't use a guard (C++ pragma once or even #ifndef because this file (the .inc version)
+ is passed to the Lua FFI wrapper which doesn't support it */
+
+typedef struct dnsdist_ffi_dnsquestion_t dnsdist_ffi_dnsquestion_t;
+typedef struct dnsdist_ffi_servers_list_t dnsdist_ffi_servers_list_t;
+typedef struct dnsdist_ffi_server_t dnsdist_ffi_server_t;
+
+typedef struct dnsdist_ffi_ednsoption {
+ uint16_t optionCode;
+ uint16_t len;
+ const void* data;
+} dnsdist_ffi_ednsoption_t;
+
+typedef struct dnsdist_ffi_http_header {
+ const char* name;
+ const char* value;
+} dnsdist_ffi_http_header_t;
+
+typedef struct dnsdist_ffi_tag {
+ const char* name;
+ const char* value;
+} dnsdist_ffi_tag_t;
+
+typedef struct dnsdist_ffi_raw_value {
+ const char* value;
+ uint16_t size;
+} dnsdist_ffi_raw_value_t;
+
+void dnsdist_ffi_dnsquestion_get_localaddr(const dnsdist_ffi_dnsquestion_t* dq, const void** addr, size_t* addrSize) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_local_port(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_get_remoteaddr(const dnsdist_ffi_dnsquestion_t* dq, const void** addr, size_t* addrSize) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_get_masked_remoteaddr(dnsdist_ffi_dnsquestion_t* dq, const void** addr, size_t* addrSize, uint8_t bits) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_remote_port(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_get_qname_raw(const dnsdist_ffi_dnsquestion_t* dq, const char** qname, size_t* qnameSize) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_dnsquestion_get_qname_hash(const dnsdist_ffi_dnsquestion_t* dq, size_t init) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_qtype(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_qclass(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+int dnsdist_ffi_dnsquestion_get_rcode(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void* dnsdist_ffi_dnsquestion_get_header(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_len(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_dnsquestion_get_size(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_set_size(dnsdist_ffi_dnsquestion_t* dq, size_t newSize) __attribute__ ((visibility ("default")));
+uint8_t dnsdist_ffi_dnsquestion_get_opcode(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_tcp(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_skip_cache(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_use_ecs(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_add_xpf(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_ecs_override(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+uint16_t dnsdist_ffi_dnsquestion_get_ecs_prefix_length(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_is_temp_failure_ttl_set(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+uint32_t dnsdist_ffi_dnsquestion_get_temp_failure_ttl(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_dnsquestion_get_do(const dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_get_sni(const dnsdist_ffi_dnsquestion_t* dq, const char** sni, size_t* sniSize) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_tag(const dnsdist_ffi_dnsquestion_t* dq, const char* label) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_http_path(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_http_query_string(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_http_host(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_dnsquestion_get_http_scheme(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+
+// returns the length of the resulting 'out' array. 'out' is not set if the length is 0
+size_t dnsdist_ffi_dnsquestion_get_edns_options(dnsdist_ffi_dnsquestion_t* ref, const dnsdist_ffi_ednsoption_t** out) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_dnsquestion_get_http_headers(dnsdist_ffi_dnsquestion_t* ref, const dnsdist_ffi_http_header_t** out) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_dnsquestion_get_tag_array(dnsdist_ffi_dnsquestion_t* ref, const dnsdist_ffi_tag_t** out) __attribute__ ((visibility ("default")));
+
+void dnsdist_ffi_dnsquestion_set_result(dnsdist_ffi_dnsquestion_t* dq, const char* str, size_t strSize) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_rcode(dnsdist_ffi_dnsquestion_t* dq, int rcode) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_len(dnsdist_ffi_dnsquestion_t* dq, uint16_t len) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_skip_cache(dnsdist_ffi_dnsquestion_t* dq, bool skipCache) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_use_ecs(dnsdist_ffi_dnsquestion_t* dq, bool useECS) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_ecs_override(dnsdist_ffi_dnsquestion_t* dq, bool ecsOverride) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_ecs_prefix_length(dnsdist_ffi_dnsquestion_t* dq, uint16_t ecsPrefixLength) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_temp_failure_ttl(dnsdist_ffi_dnsquestion_t* dq, uint32_t tempFailureTTL) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_unset_temp_failure_ttl(dnsdist_ffi_dnsquestion_t* dq) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_dnsquestion_set_tag(dnsdist_ffi_dnsquestion_t* dq, const char* label, const char* value) __attribute__ ((visibility ("default")));
+
+void dnsdist_ffi_dnsquestion_set_http_response(dnsdist_ffi_dnsquestion_t* dq, uint16_t statusCode, const char* body, size_t bodyLen, const char* contentType) __attribute__ ((visibility ("default")));
+
+size_t dnsdist_ffi_dnsquestion_get_trailing_data(dnsdist_ffi_dnsquestion_t* dq, const char** out) __attribute__ ((visibility ("default")));
+
+bool dnsdist_ffi_dnsquestion_set_trailing_data(dnsdist_ffi_dnsquestion_t* dq, const char* data, size_t dataLen) __attribute__ ((visibility ("default")));
+
+void dnsdist_ffi_dnsquestion_send_trap(dnsdist_ffi_dnsquestion_t* dq, const char* reason, size_t reasonLen) __attribute__ ((visibility ("default")));
+
+// the content of values should contain raw DNS record data ('\192\000\002\001' for A, '\034this text has a comma at the end,' for TXT, etc)
+void dnsdist_ffi_dnsquestion_spoof_raw(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_raw_value_t* values, size_t valuesCount) __attribute__ ((visibility ("default")));
+// the content of values should contain raw IPv4 or IPv6 addresses in network byte-order
+void dnsdist_ffi_dnsquestion_spoof_addrs(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_raw_value_t* values, size_t valuesCount) __attribute__ ((visibility ("default")));
+
+typedef struct dnsdist_ffi_servers_list_t dnsdist_ffi_servers_list_t;
+typedef struct dnsdist_ffi_server_t dnsdist_ffi_server_t;
+
+size_t dnsdist_ffi_servers_list_get_count(const dnsdist_ffi_servers_list_t* list) __attribute__ ((visibility ("default")));
+void dnsdist_ffi_servers_list_get_server(const dnsdist_ffi_servers_list_t* list, size_t idx, const dnsdist_ffi_server_t** out) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_servers_list_chashed(const dnsdist_ffi_servers_list_t* list, const dnsdist_ffi_dnsquestion_t* dq, size_t hash) __attribute__ ((visibility ("default")));
+size_t dnsdist_ffi_servers_list_whashed(const dnsdist_ffi_servers_list_t* list, const dnsdist_ffi_dnsquestion_t* dq, size_t hash) __attribute__ ((visibility ("default")));
+
+uint64_t dnsdist_ffi_server_get_outstanding(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+bool dnsdist_ffi_server_is_up(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_server_get_name(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+const char* dnsdist_ffi_server_get_name_with_addr(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+int dnsdist_ffi_server_get_weight(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+int dnsdist_ffi_server_get_order(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+double dnsdist_ffi_server_get_latency(const dnsdist_ffi_server_t* server) __attribute__ ((visibility ("default")));
+)FFIContent"
diff --git a/dnsdist-lua-ffi.cc b/dnsdist-lua-ffi.cc
new file mode 100644
index 0000000..25e36c2
--- /dev/null
+++ b/dnsdist-lua-ffi.cc
@@ -0,0 +1,583 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "dnsdist-lua-ffi.hh"
+#include "dnsdist-lua.hh"
+#include "dnsdist-ecs.hh"
+
+uint16_t dnsdist_ffi_dnsquestion_get_qtype(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->qtype;
+}
+
+uint16_t dnsdist_ffi_dnsquestion_get_qclass(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->qclass;
+}
+
+static void dnsdist_ffi_comboaddress_to_raw(const ComboAddress& ca, const void** addr, size_t* addrSize)
+{
+ if (ca.isIPv4()) {
+ *addr = &ca.sin4.sin_addr.s_addr;
+ *addrSize = sizeof(ca.sin4.sin_addr.s_addr);
+ }
+ else {
+ *addr = &ca.sin6.sin6_addr.s6_addr;
+ *addrSize = sizeof(ca.sin6.sin6_addr.s6_addr);
+ }
+}
+
+void dnsdist_ffi_dnsquestion_get_localaddr(const dnsdist_ffi_dnsquestion_t* dq, const void** addr, size_t* addrSize)
+{
+ dnsdist_ffi_comboaddress_to_raw(*dq->dq->local, addr, addrSize);
+}
+
+void dnsdist_ffi_dnsquestion_get_remoteaddr(const dnsdist_ffi_dnsquestion_t* dq, const void** addr, size_t* addrSize)
+{
+ dnsdist_ffi_comboaddress_to_raw(*dq->dq->remote, addr, addrSize);
+}
+
+void dnsdist_ffi_dnsquestion_get_masked_remoteaddr(dnsdist_ffi_dnsquestion_t* dq, const void** addr, size_t* addrSize, uint8_t bits)
+{
+ dq->maskedRemote = Netmask(*dq->dq->remote, bits).getMaskedNetwork();
+ dnsdist_ffi_comboaddress_to_raw(dq->maskedRemote, addr, addrSize);
+}
+
+uint16_t dnsdist_ffi_dnsquestion_get_local_port(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->local->getPort();
+}
+
+uint16_t dnsdist_ffi_dnsquestion_get_remote_port(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->remote->getPort();
+}
+
+void dnsdist_ffi_dnsquestion_get_qname_raw(const dnsdist_ffi_dnsquestion_t* dq, const char** qname, size_t* qnameSize)
+{
+ const auto& storage = dq->dq->qname->getStorage();
+ *qname = storage.data();
+ *qnameSize = storage.size();
+}
+
+size_t dnsdist_ffi_dnsquestion_get_qname_hash(const dnsdist_ffi_dnsquestion_t* dq, size_t init)
+{
+ return dq->dq->qname->hash(init);
+}
+
+int dnsdist_ffi_dnsquestion_get_rcode(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->getHeader()->rcode;
+}
+
+void* dnsdist_ffi_dnsquestion_get_header(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->getHeader();
+}
+
+uint16_t dnsdist_ffi_dnsquestion_get_len(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->getData().size();
+}
+
+size_t dnsdist_ffi_dnsquestion_get_size(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->getData().size();
+}
+
+bool dnsdist_ffi_dnsquestion_set_size(dnsdist_ffi_dnsquestion_t* dq, size_t newSize)
+{
+ try {
+ dq->dq->getMutableData().resize(newSize);
+ return true;
+ }
+ catch (const std::exception& e) {
+ return false;
+ }
+}
+
+uint8_t dnsdist_ffi_dnsquestion_get_opcode(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->getHeader()->opcode;
+}
+
+bool dnsdist_ffi_dnsquestion_get_tcp(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->overTCP();
+}
+
+bool dnsdist_ffi_dnsquestion_get_skip_cache(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->skipCache;
+}
+
+bool dnsdist_ffi_dnsquestion_get_use_ecs(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->useECS;
+}
+
+bool dnsdist_ffi_dnsquestion_get_add_xpf(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->addXPF;
+}
+
+bool dnsdist_ffi_dnsquestion_get_ecs_override(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->ecsOverride;
+}
+
+uint16_t dnsdist_ffi_dnsquestion_get_ecs_prefix_length(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->ecsPrefixLength;
+}
+
+bool dnsdist_ffi_dnsquestion_is_temp_failure_ttl_set(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return dq->dq->tempFailureTTL != boost::none;
+}
+
+uint32_t dnsdist_ffi_dnsquestion_get_temp_failure_ttl(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ if (dq->dq->tempFailureTTL) {
+ return *dq->dq->tempFailureTTL;
+ }
+ return 0;
+}
+
+bool dnsdist_ffi_dnsquestion_get_do(const dnsdist_ffi_dnsquestion_t* dq)
+{
+ return getEDNSZ(*dq->dq) & EDNS_HEADER_FLAG_DO;
+}
+
+void dnsdist_ffi_dnsquestion_get_sni(const dnsdist_ffi_dnsquestion_t* dq, const char** sni, size_t* sniSize)
+{
+ *sniSize = dq->dq->sni.size();
+ *sni = dq->dq->sni.c_str();
+}
+
+const char* dnsdist_ffi_dnsquestion_get_tag(const dnsdist_ffi_dnsquestion_t* dq, const char* label)
+{
+ const char * result = nullptr;
+
+ if (dq->dq->qTag != nullptr) {
+ const auto it = dq->dq->qTag->find(label);
+ if (it != dq->dq->qTag->cend()) {
+ result = it->second.c_str();
+ }
+ }
+
+ return result;
+}
+
+const char* dnsdist_ffi_dnsquestion_get_http_path(dnsdist_ffi_dnsquestion_t* dq)
+{
+ if (!dq->httpPath) {
+ if (dq->dq->du == nullptr) {
+ return nullptr;
+ }
+#ifdef HAVE_DNS_OVER_HTTPS
+ dq->httpPath = dq->dq->du->getHTTPPath();
+#endif /* HAVE_DNS_OVER_HTTPS */
+ }
+ if (dq->httpPath) {
+ return dq->httpPath->c_str();
+ }
+ return nullptr;
+}
+
+const char* dnsdist_ffi_dnsquestion_get_http_query_string(dnsdist_ffi_dnsquestion_t* dq)
+{
+ if (!dq->httpQueryString) {
+ if (dq->dq->du == nullptr) {
+ return nullptr;
+ }
+#ifdef HAVE_DNS_OVER_HTTPS
+ dq->httpQueryString = dq->dq->du->getHTTPQueryString();
+#endif /* HAVE_DNS_OVER_HTTPS */
+ }
+ if (dq->httpQueryString) {
+ return dq->httpQueryString->c_str();
+ }
+ return nullptr;
+}
+
+const char* dnsdist_ffi_dnsquestion_get_http_host(dnsdist_ffi_dnsquestion_t* dq)
+{
+ if (!dq->httpHost) {
+ if (dq->dq->du == nullptr) {
+ return nullptr;
+ }
+#ifdef HAVE_DNS_OVER_HTTPS
+ dq->httpHost = dq->dq->du->getHTTPHost();
+#endif /* HAVE_DNS_OVER_HTTPS */
+ }
+ if (dq->httpHost) {
+ return dq->httpHost->c_str();
+ }
+ return nullptr;
+}
+
+const char* dnsdist_ffi_dnsquestion_get_http_scheme(dnsdist_ffi_dnsquestion_t* dq)
+{
+ if (!dq->httpScheme) {
+ if (dq->dq->du == nullptr) {
+ return nullptr;
+ }
+#ifdef HAVE_DNS_OVER_HTTPS
+ dq->httpScheme = dq->dq->du->getHTTPScheme();
+#endif /* HAVE_DNS_OVER_HTTPS */
+ }
+ if (dq->httpScheme) {
+ return dq->httpScheme->c_str();
+ }
+ return nullptr;
+}
+
+static void fill_edns_option(const EDNSOptionViewValue& value, dnsdist_ffi_ednsoption_t& option)
+{
+ option.len = value.size;
+ option.data = nullptr;
+
+ if (value.size > 0) {
+ option.data = value.content;
+ }
+}
+
+// returns the length of the resulting 'out' array. 'out' is not set if the length is 0
+size_t dnsdist_ffi_dnsquestion_get_edns_options(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_ednsoption_t** out)
+{
+ if (dq->dq->ednsOptions == nullptr) {
+ parseEDNSOptions(*(dq->dq));
+
+ if (dq->dq->ednsOptions == nullptr) {
+ return 0;
+ }
+ }
+
+ size_t totalCount = 0;
+ for (const auto& option : *dq->dq->ednsOptions) {
+ totalCount += option.second.values.size();
+ }
+
+ dq->ednsOptionsVect.clear();
+ dq->ednsOptionsVect.resize(totalCount);
+ size_t pos = 0;
+ for (const auto& option : *dq->dq->ednsOptions) {
+ for (const auto& entry : option.second.values) {
+ fill_edns_option(entry, dq->ednsOptionsVect.at(pos));
+ dq->ednsOptionsVect.at(pos).optionCode = option.first;
+ pos++;
+ }
+ }
+
+ if (totalCount > 0) {
+ *out = dq->ednsOptionsVect.data();
+ }
+
+ return totalCount;
+}
+
+size_t dnsdist_ffi_dnsquestion_get_http_headers(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_http_header_t** out)
+{
+ if (dq->dq->du == nullptr) {
+ return 0;
+ }
+
+#ifdef HAVE_DNS_OVER_HTTPS
+ dq->httpHeaders = dq->dq->du->getHTTPHeaders();
+ dq->httpHeadersVect.clear();
+ dq->httpHeadersVect.resize(dq->httpHeaders.size());
+ size_t pos = 0;
+ for (const auto& header : dq->httpHeaders) {
+ dq->httpHeadersVect.at(pos).name = header.first.c_str();
+ dq->httpHeadersVect.at(pos).value = header.second.c_str();
+ ++pos;
+ }
+
+ if (!dq->httpHeadersVect.empty()) {
+ *out = dq->httpHeadersVect.data();
+ }
+
+ return dq->httpHeadersVect.size();
+#else
+ return 0;
+#endif
+}
+
+size_t dnsdist_ffi_dnsquestion_get_tag_array(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_tag_t** out)
+{
+ if (dq->dq->qTag == nullptr || dq->dq->qTag->size() == 0) {
+ return 0;
+ }
+
+ dq->tagsVect.clear();
+ dq->tagsVect.resize(dq->dq->qTag->size());
+ size_t pos = 0;
+
+ for (const auto& tag : *dq->dq->qTag) {
+ auto& entry = dq->tagsVect.at(pos);
+ entry.name = tag.first.c_str();
+ entry.value = tag.second.c_str();
+ ++pos;
+ }
+
+
+ if (!dq->tagsVect.empty()) {
+ *out = dq->tagsVect.data();
+ }
+
+ return dq->tagsVect.size();
+}
+
+void dnsdist_ffi_dnsquestion_set_result(dnsdist_ffi_dnsquestion_t* dq, const char* str, size_t strSize)
+{
+ dq->result = std::string(str, strSize);
+}
+
+void dnsdist_ffi_dnsquestion_set_http_response(dnsdist_ffi_dnsquestion_t* dq, uint16_t statusCode, const char* body, size_t bodyLen, const char* contentType)
+{
+ if (dq->dq->du == nullptr) {
+ return;
+ }
+
+#ifdef HAVE_DNS_OVER_HTTPS
+ PacketBuffer bodyVect(body, body + bodyLen);
+ dq->dq->du->setHTTPResponse(statusCode, std::move(bodyVect), contentType);
+ dq->dq->getHeader()->qr = true;
+#endif
+}
+
+void dnsdist_ffi_dnsquestion_set_rcode(dnsdist_ffi_dnsquestion_t* dq, int rcode)
+{
+ dq->dq->getHeader()->rcode = rcode;
+ dq->dq->getHeader()->qr = true;
+}
+
+void dnsdist_ffi_dnsquestion_set_len(dnsdist_ffi_dnsquestion_t* dq, uint16_t len)
+{
+ dq->dq->getMutableData().resize(len);
+}
+
+void dnsdist_ffi_dnsquestion_set_skip_cache(dnsdist_ffi_dnsquestion_t* dq, bool skipCache)
+{
+ dq->dq->skipCache = skipCache;
+}
+
+void dnsdist_ffi_dnsquestion_set_use_ecs(dnsdist_ffi_dnsquestion_t* dq, bool useECS)
+{
+ dq->dq->useECS = useECS;
+}
+
+void dnsdist_ffi_dnsquestion_set_ecs_override(dnsdist_ffi_dnsquestion_t* dq, bool ecsOverride)
+{
+ dq->dq->ecsOverride = ecsOverride;
+}
+
+void dnsdist_ffi_dnsquestion_set_ecs_prefix_length(dnsdist_ffi_dnsquestion_t* dq, uint16_t ecsPrefixLength)
+{
+ dq->dq->ecsPrefixLength = ecsPrefixLength;
+}
+
+void dnsdist_ffi_dnsquestion_set_temp_failure_ttl(dnsdist_ffi_dnsquestion_t* dq, uint32_t tempFailureTTL)
+{
+ dq->dq->tempFailureTTL = tempFailureTTL;
+}
+
+void dnsdist_ffi_dnsquestion_unset_temp_failure_ttl(dnsdist_ffi_dnsquestion_t* dq)
+{
+ dq->dq->tempFailureTTL = boost::none;
+}
+
+void dnsdist_ffi_dnsquestion_set_tag(dnsdist_ffi_dnsquestion_t* dq, const char* label, const char* value)
+{
+ dq->dq->setTag(label, value);
+}
+
+size_t dnsdist_ffi_dnsquestion_get_trailing_data(dnsdist_ffi_dnsquestion_t* dq, const char** out)
+{
+ dq->trailingData = dq->dq->getTrailingData();
+ if (!dq->trailingData.empty()) {
+ *out = dq->trailingData.data();
+ }
+
+ return dq->trailingData.size();
+}
+
+bool dnsdist_ffi_dnsquestion_set_trailing_data(dnsdist_ffi_dnsquestion_t* dq, const char* data, size_t dataLen)
+{
+ return dq->dq->setTrailingData(std::string(data, dataLen));
+}
+
+void dnsdist_ffi_dnsquestion_send_trap(dnsdist_ffi_dnsquestion_t* dq, const char* reason, size_t reasonLen)
+{
+ if (g_snmpAgent && g_snmpTrapsEnabled) {
+ g_snmpAgent->sendDNSTrap(*dq->dq, std::string(reason, reasonLen));
+ }
+}
+
+void dnsdist_ffi_dnsquestion_spoof_raw(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_raw_value_t* values, size_t valuesCount)
+{
+ std::vector<std::string> data;
+ data.reserve(valuesCount);
+
+ for (size_t idx = 0; idx < valuesCount; idx++) {
+ data.emplace_back(values[idx].value, values[idx].size);
+ }
+
+ std::string result;
+ SpoofAction sa(data);
+ sa(dq->dq, &result);
+}
+
+void dnsdist_ffi_dnsquestion_spoof_addrs(dnsdist_ffi_dnsquestion_t* dq, const dnsdist_ffi_raw_value_t* values, size_t valuesCount)
+{
+ std::vector<ComboAddress> data;
+ data.reserve(valuesCount);
+
+ for (size_t idx = 0; idx < valuesCount; idx++) {
+ if (values[idx].size == 4) {
+ sockaddr_in sin;
+ sin.sin_family = AF_INET;
+ sin.sin_port = 0;
+ memcpy(&sin.sin_addr.s_addr, values[idx].value, sizeof(sin.sin_addr.s_addr));
+ data.emplace_back(&sin);
+ }
+ else if (values[idx].size == 16) {
+ sockaddr_in6 sin6;
+ sin6.sin6_family = AF_INET6;
+ sin6.sin6_port = 0;
+ sin6.sin6_scope_id = 0;
+ sin6.sin6_flowinfo = 0;
+ memcpy(&sin6.sin6_addr.s6_addr, values[idx].value, sizeof(sin6.sin6_addr.s6_addr));
+ data.emplace_back(&sin6);
+ }
+ }
+
+ std::string result;
+ SpoofAction sa(data);
+ sa(dq->dq, &result);
+}
+
+size_t dnsdist_ffi_servers_list_get_count(const dnsdist_ffi_servers_list_t* list)
+{
+ return list->ffiServers.size();
+}
+
+void dnsdist_ffi_servers_list_get_server(const dnsdist_ffi_servers_list_t* list, size_t idx, const dnsdist_ffi_server_t** out)
+{
+ *out = &list->ffiServers.at(idx);
+}
+
+static size_t dnsdist_ffi_servers_get_index_from_server(const ServerPolicy::NumberedServerVector& servers, const std::shared_ptr<DownstreamState>& server)
+{
+ for (const auto& pair : servers) {
+ if (pair.second == server) {
+ return pair.first - 1;
+ }
+ }
+ throw std::runtime_error("Unable to find servers in server list");
+}
+
+size_t dnsdist_ffi_servers_list_chashed(const dnsdist_ffi_servers_list_t* list, const dnsdist_ffi_dnsquestion_t* dq, size_t hash)
+{
+ auto server = chashedFromHash(list->servers, hash);
+ return dnsdist_ffi_servers_get_index_from_server(list->servers, server);
+}
+
+size_t dnsdist_ffi_servers_list_whashed(const dnsdist_ffi_servers_list_t* list, const dnsdist_ffi_dnsquestion_t* dq, size_t hash)
+{
+ auto server = whashedFromHash(list->servers, hash);
+ return dnsdist_ffi_servers_get_index_from_server(list->servers, server);
+}
+
+uint64_t dnsdist_ffi_server_get_outstanding(const dnsdist_ffi_server_t* server)
+{
+ return server->server->outstanding;
+}
+
+int dnsdist_ffi_server_get_weight(const dnsdist_ffi_server_t* server)
+{
+ return server->server->weight;
+}
+
+int dnsdist_ffi_server_get_order(const dnsdist_ffi_server_t* server)
+{
+ return server->server->order;
+}
+
+double dnsdist_ffi_server_get_latency(const dnsdist_ffi_server_t* server)
+{
+ return server->server->latencyUsec;
+}
+
+bool dnsdist_ffi_server_is_up(const dnsdist_ffi_server_t* server)
+{
+ return server->server->isUp();
+}
+
+const char* dnsdist_ffi_server_get_name(const dnsdist_ffi_server_t* server)
+{
+ return server->server->getName().c_str();
+}
+
+const char* dnsdist_ffi_server_get_name_with_addr(const dnsdist_ffi_server_t* server)
+{
+ return server->server->getNameWithAddr().c_str();
+}
+
+const std::string& getLuaFFIWrappers()
+{
+ static const std::string interface =
+#include "dnsdist-lua-ffi-interface.inc"
+ ;
+ static const std::string code = R"FFICodeContent(
+ local ffi = require("ffi")
+ local C = ffi.C
+
+ ffi.cdef[[
+)FFICodeContent" + interface + R"FFICodeContent(
+ ]]
+
+)FFICodeContent";
+ return code;
+}
+
+void setupLuaLoadBalancingContext(LuaContext& luaCtx)
+{
+ setupLuaBindings(luaCtx, true);
+ setupLuaBindingsDNSQuestion(luaCtx);
+ setupLuaBindingsKVS(luaCtx, true);
+ setupLuaVars(luaCtx);
+
+#ifdef LUAJIT_VERSION
+ luaCtx.executeCode(getLuaFFIWrappers());
+#endif
+}
+
+void setupLuaFFIPerThreadContext(LuaContext& luaCtx)
+{
+ setupLuaVars(luaCtx);
+
+#ifdef LUAJIT_VERSION
+ luaCtx.executeCode(getLuaFFIWrappers());
+#endif
+}
diff --git a/dnsdist-lua-ffi.hh b/dnsdist-lua-ffi.hh
new file mode 100644
index 0000000..1030659
--- /dev/null
+++ b/dnsdist-lua-ffi.hh
@@ -0,0 +1,110 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "dnsdist.hh"
+
+extern "C" {
+#include "dnsdist-lua-ffi-interface.h"
+}
+
+// dnsdist_ffi_dnsquestion_t is a lightuserdata
+template<>
+struct LuaContext::Pusher<dnsdist_ffi_dnsquestion_t*> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, dnsdist_ffi_dnsquestion_t* ptr) noexcept {
+ lua_pushlightuserdata(state, ptr);
+ return PushedObject{state, 1};
+ }
+};
+
+struct dnsdist_ffi_dnsquestion_t
+{
+ dnsdist_ffi_dnsquestion_t(DNSQuestion* dq_): dq(dq_)
+ {
+ }
+
+ DNSQuestion* dq{nullptr};
+ std::vector<dnsdist_ffi_ednsoption_t> ednsOptionsVect;
+ std::vector<dnsdist_ffi_http_header_t> httpHeadersVect;
+ std::vector<dnsdist_ffi_tag_t> tagsVect;
+ std::unordered_map<std::string, std::string> httpHeaders;
+ std::string trailingData;
+ ComboAddress maskedRemote;
+ boost::optional<std::string> result{boost::none};
+ boost::optional<std::string> httpPath{boost::none};
+ boost::optional<std::string> httpQueryString{boost::none};
+ boost::optional<std::string> httpHost{boost::none};
+ boost::optional<std::string> httpScheme{boost::none};
+};
+
+// dnsdist_ffi_server_t is a lightuserdata
+template<>
+struct LuaContext::Pusher<dnsdist_ffi_server_t*> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, dnsdist_ffi_server_t* ptr) noexcept {
+ lua_pushlightuserdata(state, ptr);
+ return PushedObject{state, 1};
+ }
+};
+
+struct dnsdist_ffi_server_t
+{
+ dnsdist_ffi_server_t(const std::shared_ptr<DownstreamState>& server_): server(server_)
+ {
+ }
+
+ const std::shared_ptr<DownstreamState>& server;
+};
+
+// dnsdist_ffi_servers_list_t is a lightuserdata
+template<>
+struct LuaContext::Pusher<dnsdist_ffi_servers_list_t*> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, dnsdist_ffi_servers_list_t* ptr) noexcept {
+ lua_pushlightuserdata(state, ptr);
+ return PushedObject{state, 1};
+ }
+};
+
+struct dnsdist_ffi_servers_list_t
+{
+ dnsdist_ffi_servers_list_t(const ServerPolicy::NumberedServerVector& servers_): servers(servers_)
+ {
+ ffiServers.reserve(servers.size());
+ for (const auto& server: servers) {
+ ffiServers.push_back(dnsdist_ffi_server_t(server.second));
+ }
+ }
+
+ std::vector<dnsdist_ffi_server_t> ffiServers;
+ const ServerPolicy::NumberedServerVector& servers;
+};
+
+const std::string& getLuaFFIWrappers();
+void setupLuaFFIPerThreadContext(LuaContext& luaCtx);
diff --git a/dnsdist-lua-inspection-ffi.cc b/dnsdist-lua-inspection-ffi.cc
new file mode 100644
index 0000000..13158fa
--- /dev/null
+++ b/dnsdist-lua-inspection-ffi.cc
@@ -0,0 +1,106 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "dnsdist.hh"
+#include "dnsdist-dynblocks.hh"
+
+uint64_t dnsdist_ffi_stat_node_get_queries_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->self.queries;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_noerrors_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->self.noerrors;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_nxdomains_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->self.nxdomains;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_servfails_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->self.servfails;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_drops_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->self.drops;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_bytes(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->self.bytes;
+}
+
+unsigned int dnsdist_ffi_stat_node_get_labels_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->node.labelsCount;
+}
+
+void dnsdist_ffi_stat_node_get_full_name_raw(const dnsdist_ffi_stat_node_t* node, const char** name, size_t* nameSize)
+{
+ const auto& storage = node->node.fullname;
+ *name = storage.c_str();
+ *nameSize = storage.size();
+}
+
+unsigned int dnsdist_ffi_stat_node_get_children_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->node.children.size();
+}
+
+uint64_t dnsdist_ffi_stat_node_get_children_queries_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->children.queries;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_children_noerrors_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->children.noerrors;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_children_nxdomains_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->children.nxdomains;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_children_servfails_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->children.servfails;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_children_drops_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->children.drops;
+}
+
+uint64_t dnsdist_ffi_stat_node_get_children_bytes_count(const dnsdist_ffi_stat_node_t* node)
+{
+ return node->children.bytes;
+}
+
+void dnsdist_ffi_state_node_set_reason(dnsdist_ffi_stat_node_t* node, const char* reason, size_t reasonSize)
+{
+ node->reason = std::string(reason, reasonSize);
+}
diff --git a/dnsdist-lua-inspection-ffi.hh b/dnsdist-lua-inspection-ffi.hh
new file mode 100644
index 0000000..05f087f
--- /dev/null
+++ b/dnsdist-lua-inspection-ffi.hh
@@ -0,0 +1,45 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+extern "C" {
+ typedef struct dnsdist_ffi_stat_node_t dnsdist_ffi_stat_node_t;
+
+ uint64_t dnsdist_ffi_stat_node_get_queries_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_noerrors_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_nxdomains_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_servfails_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_drops_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_bytes(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ unsigned int dnsdist_ffi_stat_node_get_labels_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ void dnsdist_ffi_stat_node_get_full_name_raw(const dnsdist_ffi_stat_node_t* node, const char** name, size_t* nameSize) __attribute__ ((visibility ("default")));
+
+ unsigned int dnsdist_ffi_stat_node_get_children_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+
+ uint64_t dnsdist_ffi_stat_node_get_children_queries_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_children_noerrors_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_children_nxdomains_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_children_servfails_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_children_drops_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+ uint64_t dnsdist_ffi_stat_node_get_children_bytes_count(const dnsdist_ffi_stat_node_t* node) __attribute__ ((visibility ("default")));
+
+ void dnsdist_ffi_state_node_set_reason(dnsdist_ffi_stat_node_t* node, const char* reason, size_t reasonSize) __attribute__ ((visibility ("default")));
+}
diff --git a/dnsdist-lua-inspection.cc b/dnsdist-lua-inspection.cc
new file mode 100644
index 0000000..451682a
--- /dev/null
+++ b/dnsdist-lua-inspection.cc
@@ -0,0 +1,857 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsdist.hh"
+#include "dnsdist-lua.hh"
+#include "dnsdist-dynblocks.hh"
+#include "dnsdist-nghttp2.hh"
+#include "dnsdist-rings.hh"
+#include "dnsdist-tcp.hh"
+
+#include "statnode.hh"
+
+static std::unordered_map<unsigned int, vector<boost::variant<string,double>>> getGenResponses(unsigned int top, boost::optional<int> labels, std::function<bool(const Rings::Response&)> pred)
+{
+ setLuaNoSideEffect();
+ map<DNSName, unsigned int> counts;
+ unsigned int total=0;
+ {
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->respRing.lock();
+ if (!labels) {
+ for(const auto& a : *rl) {
+ if(!pred(a))
+ continue;
+ counts[a.name]++;
+ total++;
+ }
+ }
+ else {
+ unsigned int lab = *labels;
+ for(const auto& a : *rl) {
+ if(!pred(a))
+ continue;
+
+ DNSName temp(a.name);
+ temp.trimToLabels(lab);
+ counts[temp]++;
+ total++;
+ }
+ }
+ }
+ }
+ // cout<<"Looked at "<<total<<" responses, "<<counts.size()<<" different ones"<<endl;
+ vector<pair<unsigned int, DNSName>> rcounts;
+ rcounts.reserve(counts.size());
+ for(const auto& c : counts)
+ rcounts.emplace_back(c.second, c.first.makeLowerCase());
+
+ sort(rcounts.begin(), rcounts.end(), [](const decltype(rcounts)::value_type& a,
+ const decltype(rcounts)::value_type& b) {
+ return b.first < a.first;
+ });
+
+ std::unordered_map<unsigned int, vector<boost::variant<string,double>>> ret;
+ unsigned int count=1, rest=0;
+ for(const auto& rc : rcounts) {
+ if(count==top+1)
+ rest+=rc.first;
+ else
+ ret.insert({count++, {rc.second.toString(), rc.first, 100.0*rc.first/total}});
+ }
+
+ if (total > 0) {
+ ret.insert({count, {"Rest", rest, 100.0*rest/total}});
+ }
+ else {
+ ret.insert({count, {"Rest", rest, 100.0 }});
+ }
+
+ return ret;
+}
+
+typedef std::unordered_map<ComboAddress, unsigned int, ComboAddress::addressOnlyHash, ComboAddress::addressOnlyEqual> counts_t;
+
+static counts_t filterScore(const counts_t& counts,
+ double delta, unsigned int rate)
+{
+ counts_t ret;
+
+ double lim = delta*rate;
+ for(const auto& c : counts) {
+ if (c.second > lim) {
+ ret[c.first] = c.second;
+ }
+ }
+
+ return ret;
+}
+
+
+typedef std::function<void(const StatNode&, const StatNode::Stat&, const StatNode::Stat&)> statvisitor_t;
+
+static void statNodeRespRing(statvisitor_t visitor, unsigned int seconds)
+{
+ struct timespec cutoff, now;
+ gettime(&now);
+ cutoff = now;
+ cutoff.tv_sec -= seconds;
+
+ StatNode root;
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->respRing.lock();
+
+ for(const auto& c : *rl) {
+ if (now < c.when)
+ continue;
+
+ if (seconds && c.when < cutoff)
+ continue;
+
+ root.submit(c.name, ((c.dh.rcode == 0 && c.usec == std::numeric_limits<unsigned int>::max()) ? -1 : c.dh.rcode), c.size, boost::none);
+ }
+ }
+
+ StatNode::Stat node;
+ root.visit([visitor](const StatNode* node_, const StatNode::Stat& self, const StatNode::Stat& children) {
+ visitor(*node_, self, children);}, node);
+}
+
+static vector<pair<unsigned int, std::unordered_map<string,string> > > getRespRing(boost::optional<int> rcode)
+{
+ typedef std::unordered_map<string,string> entry_t;
+ vector<pair<unsigned int, entry_t > > ret;
+
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->respRing.lock();
+
+ entry_t e;
+ unsigned int count=1;
+ for(const auto& c : *rl) {
+ if(rcode && (rcode.get() != c.dh.rcode))
+ continue;
+ e["qname"]=c.name.toString();
+ e["rcode"]=std::to_string(c.dh.rcode);
+ ret.emplace_back(count, e);
+ count++;
+ }
+ }
+
+ return ret;
+}
+
+static counts_t exceedRespGen(unsigned int rate, int seconds, std::function<void(counts_t&, const Rings::Response&)> T)
+{
+ counts_t counts;
+ struct timespec cutoff, mintime, now;
+ gettime(&now);
+ cutoff = mintime = now;
+ cutoff.tv_sec -= seconds;
+
+ counts.reserve(g_rings.getNumberOfResponseEntries());
+
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->respRing.lock();
+ for(const auto& c : *rl) {
+
+ if(seconds && c.when < cutoff)
+ continue;
+ if(now < c.when)
+ continue;
+
+ T(counts, c);
+ if(c.when < mintime)
+ mintime = c.when;
+ }
+ }
+
+ double delta = seconds ? seconds : DiffTime(now, mintime);
+ return filterScore(counts, delta, rate);
+}
+
+static counts_t exceedQueryGen(unsigned int rate, int seconds, std::function<void(counts_t&, const Rings::Query&)> T)
+{
+ counts_t counts;
+ struct timespec cutoff, mintime, now;
+ gettime(&now);
+ cutoff = mintime = now;
+ cutoff.tv_sec -= seconds;
+
+ counts.reserve(g_rings.getNumberOfQueryEntries());
+
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->queryRing.lock();
+ for(const auto& c : *rl) {
+ if(seconds && c.when < cutoff)
+ continue;
+ if(now < c.when)
+ continue;
+ T(counts, c);
+ if(c.when < mintime)
+ mintime = c.when;
+ }
+ }
+
+ double delta = seconds ? seconds : DiffTime(now, mintime);
+ return filterScore(counts, delta, rate);
+}
+
+
+static counts_t exceedRCode(unsigned int rate, int seconds, int rcode)
+{
+ return exceedRespGen(rate, seconds, [rcode](counts_t& counts, const Rings::Response& r)
+ {
+ if(r.dh.rcode == rcode)
+ counts[r.requestor]++;
+ });
+}
+
+static counts_t exceedRespByterate(unsigned int rate, int seconds)
+{
+ return exceedRespGen(rate, seconds, [](counts_t& counts, const Rings::Response& r)
+ {
+ counts[r.requestor]+=r.size;
+ });
+}
+
+void setupLuaInspection(LuaContext& luaCtx)
+{
+ luaCtx.writeFunction("topClients", [](boost::optional<unsigned int> top_) {
+ setLuaNoSideEffect();
+ auto top = top_.get_value_or(10);
+ map<ComboAddress, unsigned int,ComboAddress::addressOnlyLessThan > counts;
+ unsigned int total=0;
+ {
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->queryRing.lock();
+ for(const auto& c : *rl) {
+ counts[c.requestor]++;
+ total++;
+ }
+ }
+ }
+ vector<pair<unsigned int, ComboAddress>> rcounts;
+ rcounts.reserve(counts.size());
+ for(const auto& c : counts)
+ rcounts.emplace_back(c.second, c.first);
+
+ sort(rcounts.begin(), rcounts.end(), [](const decltype(rcounts)::value_type& a,
+ const decltype(rcounts)::value_type& b) {
+ return b.first < a.first;
+ });
+ unsigned int count=1, rest=0;
+ boost::format fmt("%4d %-40s %4d %4.1f%%\n");
+ for(const auto& rc : rcounts) {
+ if(count==top+1)
+ rest+=rc.first;
+ else
+ g_outputBuffer += (fmt % (count++) % rc.second.toString() % rc.first % (100.0*rc.first/total)).str();
+ }
+ g_outputBuffer += (fmt % (count) % "Rest" % rest % (total > 0 ? 100.0*rest/total : 100.0)).str();
+ });
+
+ luaCtx.writeFunction("getTopQueries", [](unsigned int top, boost::optional<int> labels) {
+ setLuaNoSideEffect();
+ map<DNSName, unsigned int> counts;
+ unsigned int total=0;
+ if(!labels) {
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->queryRing.lock();
+ for(const auto& a : *rl) {
+ counts[a.name]++;
+ total++;
+ }
+ }
+ }
+ else {
+ unsigned int lab = *labels;
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->queryRing.lock();
+ for(auto a : *rl) {
+ a.name.trimToLabels(lab);
+ counts[a.name]++;
+ total++;
+ }
+ }
+ }
+ // cout<<"Looked at "<<total<<" queries, "<<counts.size()<<" different ones"<<endl;
+ vector<pair<unsigned int, DNSName>> rcounts;
+ rcounts.reserve(counts.size());
+ for(const auto& c : counts)
+ rcounts.emplace_back(c.second, c.first.makeLowerCase());
+
+ sort(rcounts.begin(), rcounts.end(), [](const decltype(rcounts)::value_type& a,
+ const decltype(rcounts)::value_type& b) {
+ return b.first < a.first;
+ });
+
+ std::unordered_map<unsigned int, vector<boost::variant<string,double>>> ret;
+ unsigned int count=1, rest=0;
+ for(const auto& rc : rcounts) {
+ if(count==top+1)
+ rest+=rc.first;
+ else
+ ret.insert({count++, {rc.second.toString(), rc.first, 100.0*rc.first/total}});
+ }
+
+ if (total > 0) {
+ ret.insert({count, {"Rest", rest, 100.0*rest/total}});
+ }
+ else {
+ ret.insert({count, {"Rest", rest, 100.0}});
+ }
+
+ return ret;
+
+ });
+
+ luaCtx.executeCode(R"(function topQueries(top, labels) top = top or 10; for k,v in ipairs(getTopQueries(top,labels)) do show(string.format("%4d %-40s %4d %4.1f%%",k,v[1],v[2], v[3])) end end)");
+
+ luaCtx.writeFunction("getResponseRing", []() {
+ setLuaNoSideEffect();
+ size_t totalEntries = 0;
+ std::vector<boost::circular_buffer<Rings::Response>> rings;
+ rings.reserve(g_rings.getNumberOfShards());
+ for (const auto& shard : g_rings.d_shards) {
+ {
+ auto rl = shard->respRing.lock();
+ rings.push_back(*rl);
+ }
+ totalEntries += rings.back().size();
+ }
+ vector<std::unordered_map<string, boost::variant<string, unsigned int> > > ret;
+ ret.reserve(totalEntries);
+ decltype(ret)::value_type item;
+ for (size_t idx = 0; idx < rings.size(); idx++) {
+ for(const auto& r : rings[idx]) {
+ item["name"]=r.name.toString();
+ item["qtype"]=r.qtype;
+ item["rcode"]=r.dh.rcode;
+ item["usec"]=r.usec;
+ ret.push_back(item);
+ }
+ }
+ return ret;
+ });
+
+ luaCtx.writeFunction("getTopResponses", [](unsigned int top, unsigned int kind, boost::optional<int> labels) {
+ return getGenResponses(top, labels, [kind](const Rings::Response& r) { return r.dh.rcode == kind; });
+ });
+
+ luaCtx.executeCode(R"(function topResponses(top, kind, labels) top = top or 10; kind = kind or 0; for k,v in ipairs(getTopResponses(top, kind, labels)) do show(string.format("%4d %-40s %4d %4.1f%%",k,v[1],v[2],v[3])) end end)");
+
+
+ luaCtx.writeFunction("getSlowResponses", [](unsigned int top, unsigned int msec, boost::optional<int> labels) {
+ return getGenResponses(top, labels, [msec](const Rings::Response& r) { return r.usec > msec*1000; });
+ });
+
+
+ luaCtx.executeCode(R"(function topSlow(top, msec, labels) top = top or 10; msec = msec or 500; for k,v in ipairs(getSlowResponses(top, msec, labels)) do show(string.format("%4d %-40s %4d %4.1f%%",k,v[1],v[2],v[3])) end end)");
+
+ luaCtx.writeFunction("getTopBandwidth", [](unsigned int top) {
+ setLuaNoSideEffect();
+ return g_rings.getTopBandwidth(top);
+ });
+
+ luaCtx.executeCode(R"(function topBandwidth(top) top = top or 10; for k,v in ipairs(getTopBandwidth(top)) do show(string.format("%4d %-40s %4d %4.1f%%",k,v[1],v[2],v[3])) end end)");
+
+ luaCtx.writeFunction("delta", []() {
+ setLuaNoSideEffect();
+ // we hold the lua lock already!
+ for(const auto& d : g_confDelta) {
+ struct tm tm;
+ localtime_r(&d.first.tv_sec, &tm);
+ char date[80];
+ strftime(date, sizeof(date)-1, "-- %a %b %d %Y %H:%M:%S %Z\n", &tm);
+ g_outputBuffer += date;
+ g_outputBuffer += d.second + "\n";
+ }
+ });
+
+ luaCtx.writeFunction("grepq", [](boost::variant<string, vector<pair<int,string> > > inp, boost::optional<unsigned int> limit) {
+ setLuaNoSideEffect();
+ boost::optional<Netmask> nm;
+ boost::optional<DNSName> dn;
+ int msec=-1;
+
+ vector<string> vec;
+ auto str=boost::get<string>(&inp);
+ if(str)
+ vec.push_back(*str);
+ else {
+ auto v = boost::get<vector<pair<int, string> > >(inp);
+ for(const auto& a: v)
+ vec.push_back(a.second);
+ }
+
+ for(const auto& s : vec) {
+ try
+ {
+ nm = Netmask(s);
+ }
+ catch(...) {
+ if(boost::ends_with(s,"ms") && sscanf(s.c_str(), "%ums", &msec)) {
+ ;
+ }
+ else {
+ try { dn=DNSName(s); }
+ catch(...)
+ {
+ g_outputBuffer = "Could not parse '"+s+"' as domain name or netmask";
+ return;
+ }
+ }
+ }
+ }
+
+ std::vector<Rings::Query> qr;
+ std::vector<Rings::Response> rr;
+ qr.reserve(g_rings.getNumberOfQueryEntries());
+ rr.reserve(g_rings.getNumberOfResponseEntries());
+ for (const auto& shard : g_rings.d_shards) {
+ {
+ auto rl = shard->queryRing.lock();
+ for (const auto& entry : *rl) {
+ qr.push_back(entry);
+ }
+ }
+ {
+ auto rl = shard->respRing.lock();
+ for (const auto& entry : *rl) {
+ rr.push_back(entry);
+ }
+ }
+ }
+
+ sort(qr.begin(), qr.end(), [](const decltype(qr)::value_type& a, const decltype(qr)::value_type& b) {
+ return b.when < a.when;
+ });
+
+ sort(rr.begin(), rr.end(), [](const decltype(rr)::value_type& a, const decltype(rr)::value_type& b) {
+ return b.when < a.when;
+ });
+
+ unsigned int num=0;
+ struct timespec now;
+ gettime(&now);
+
+ std::multimap<struct timespec, string> out;
+
+ boost::format fmt("%-7.1f %-47s %-12s %-12s %-5d %-25s %-5s %-6.1f %-2s %-2s %-2s %-s\n");
+ g_outputBuffer+= (fmt % "Time" % "Client" % "Protocol" % "Server" % "ID" % "Name" % "Type" % "Lat." % "TC" % "RD" % "AA" % "Rcode").str();
+
+ if(msec==-1) {
+ for(const auto& c : qr) {
+ bool nmmatch=true, dnmatch=true;
+ if (nm) {
+ nmmatch = nm->match(c.requestor);
+ }
+ if (dn) {
+ if (c.name.empty()) {
+ dnmatch = false;
+ }
+ else {
+ dnmatch = c.name.isPartOf(*dn);
+ }
+ }
+ if (nmmatch && dnmatch) {
+ QType qt(c.qtype);
+ std::string extra;
+ if (c.dh.opcode != 0) {
+ extra = " (" + Opcode::to_s(c.dh.opcode) + ")";
+ }
+ out.emplace(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % dnsdist::Protocol(c.protocol).toString() % "" % htons(c.dh.id) % c.name.toString() % qt.toString() % "" % (c.dh.tc ? "TC" : "") % (c.dh.rd ? "RD" : "") % (c.dh.aa ? "AA" : "") % ("Question" + extra)).str());
+
+ if(limit && *limit==++num)
+ break;
+ }
+ }
+ }
+ num=0;
+
+
+ string extra;
+ for(const auto& c : rr) {
+ bool nmmatch=true, dnmatch=true, msecmatch=true;
+ if (nm) {
+ nmmatch = nm->match(c.requestor);
+ }
+ if (dn) {
+ if (c.name.empty()) {
+ dnmatch = false;
+ }
+ else {
+ dnmatch = c.name.isPartOf(*dn);
+ }
+ }
+ if (msec != -1) {
+ msecmatch=(c.usec/1000 > (unsigned int)msec);
+ }
+
+ if (nmmatch && dnmatch && msecmatch) {
+ QType qt(c.qtype);
+ if (!c.dh.rcode) {
+ extra=". " +std::to_string(htons(c.dh.ancount))+ " answers";
+ }
+ else {
+ extra.clear();
+ }
+
+ if (c.usec != std::numeric_limits<decltype(c.usec)>::max()) {
+ out.emplace(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % dnsdist::Protocol(c.protocol).toString() % c.ds.toStringWithPort() % htons(c.dh.id) % c.name.toString() % qt.toString() % (c.usec / 1000.0) % (c.dh.tc ? "TC" : "") % (c.dh.rd ? "RD" : "") % (c.dh.aa ? "AA" : "") % (RCode::to_s(c.dh.rcode) + extra)).str());
+ }
+ else {
+ out.emplace(c.when, (fmt % DiffTime(now, c.when) % c.requestor.toStringWithPort() % dnsdist::Protocol(c.protocol).toString() % c.ds.toStringWithPort() % htons(c.dh.id) % c.name.toString() % qt.toString() % "T.O" % (c.dh.tc ? "TC" : "") % (c.dh.rd ? "RD" : "") % (c.dh.aa ? "AA" : "") % (RCode::to_s(c.dh.rcode) + extra)).str());
+ }
+
+ if (limit && *limit == ++num) {
+ break;
+ }
+ }
+ }
+
+ for(const auto& p : out) {
+ g_outputBuffer+=p.second;
+ }
+ });
+
+ luaCtx.writeFunction("showResponseLatency", []() {
+ setLuaNoSideEffect();
+ map<double, unsigned int> histo;
+ double bin=100;
+ for(int i=0; i < 15; ++i) {
+ histo[bin];
+ bin*=2;
+ }
+
+ double totlat=0;
+ unsigned int size=0;
+ {
+ for (const auto& shard : g_rings.d_shards) {
+ auto rl = shard->respRing.lock();
+ for(const auto& r : *rl) {
+ /* skip actively discovered timeouts */
+ if (r.usec == std::numeric_limits<unsigned int>::max())
+ continue;
+
+ ++size;
+ auto iter = histo.lower_bound(r.usec);
+ if(iter != histo.end())
+ iter->second++;
+ else
+ histo.rbegin()++;
+ totlat+=r.usec;
+ }
+ }
+ }
+
+ if (size == 0) {
+ g_outputBuffer = "No traffic yet.\n";
+ return;
+ }
+
+ g_outputBuffer = (boost::format("Average response latency: %.02f msec\n") % (0.001*totlat/size)).str();
+ double highest=0;
+
+ for(auto iter = histo.cbegin(); iter != histo.cend(); ++iter) {
+ highest=std::max(highest, iter->second*1.0);
+ }
+ boost::format fmt("%7.2f\t%s\n");
+ g_outputBuffer += (fmt % "msec" % "").str();
+
+ for(auto iter = histo.cbegin(); iter != histo.cend(); ++iter) {
+ int stars = (70.0 * iter->second/highest);
+ char c='*';
+ if(!stars && iter->second) {
+ stars=1; // you get 1 . to show something is there..
+ if(70.0*iter->second/highest > 0.5)
+ c=':';
+ else
+ c='.';
+ }
+ g_outputBuffer += (fmt % (iter->first/1000.0) % string(stars, c)).str();
+ }
+ });
+
+ luaCtx.writeFunction("showTCPStats", [] {
+ setLuaNoSideEffect();
+ ostringstream ret;
+ boost::format fmt("%-12d %-12d %-12d %-12d");
+ ret << (fmt % "Workers" % "Max Workers" % "Queued" % "Max Queued") << endl;
+ ret << (fmt % g_tcpclientthreads->getThreadsCount() % (g_maxTCPClientThreads ? *g_maxTCPClientThreads : 0) % g_tcpclientthreads->getQueuedCount() % g_maxTCPQueuedConnections) << endl;
+ ret << endl;
+
+ ret << "Frontends:" << endl;
+ fmt = boost::format("%-3d %-20.20s %-20d %-20d %-20d %-25d %-20d %-20d %-20d %-20f %-20f %-20d %-20d %-25d %-25d %-15d %-15d %-15d %-15d %-15d");
+ ret << (fmt % "#" % "Address" % "Connections" % "Max concurrent conn" % "Died reading query" % "Died sending response" % "Gave up" % "Client timeouts" % "Downstream timeouts" % "Avg queries/conn" % "Avg duration" % "TLS new sessions" % "TLS Resumptions" % "TLS unknown ticket keys" % "TLS inactive ticket keys" % "TLS 1.0" % "TLS 1.1" % "TLS 1.2" % "TLS 1.3" % "TLS other") << endl;
+
+ size_t counter = 0;
+ for(const auto& f : g_frontends) {
+ ret << (fmt % counter % f->local.toStringWithPort() % f->tcpCurrentConnections % f->tcpMaxConcurrentConnections % f->tcpDiedReadingQuery % f->tcpDiedSendingResponse % f->tcpGaveUp % f->tcpClientTimeouts % f->tcpDownstreamTimeouts % f->tcpAvgQueriesPerConnection % f->tcpAvgConnectionDuration % f->tlsNewSessions % f->tlsResumptions % f->tlsUnknownTicketKey % f->tlsInactiveTicketKey % f->tls10queries % f->tls11queries % f->tls12queries % f->tls13queries % f->tlsUnknownqueries) << endl;
+ ++counter;
+ }
+ ret << endl;
+
+ ret << "Backends:" << endl;
+ fmt = boost::format("%-3d %-20.20s %-20.20s %-20d %-20d %-25d %-25d %-20d %-20d %-20d %-20d %-20d %-20d %-20d %-20f %-20f");
+ ret << (fmt % "#" % "Name" % "Address" % "Connections" % "Max concurrent conn" % "Died sending query" % "Died reading response" % "Gave up" % "Read timeouts" % "Write timeouts" % "Connect timeouts" % "Total connections" % "Reused connections" % "TLS resumptions" % "Avg queries/conn" % "Avg duration") << endl;
+
+ auto states = g_dstates.getLocal();
+ counter = 0;
+ for(const auto& s : *states) {
+ ret << (fmt % counter % s->getName() % s->remote.toStringWithPort() % s->tcpCurrentConnections % s->tcpMaxConcurrentConnections % s->tcpDiedSendingQuery % s->tcpDiedReadingResponse % s->tcpGaveUp % s->tcpReadTimeouts % s->tcpWriteTimeouts % s->tcpConnectTimeouts % s->tcpNewConnections % s->tcpReusedConnections % s->tlsResumptions % s->tcpAvgQueriesPerConnection % s->tcpAvgConnectionDuration) << endl;
+ ++counter;
+ }
+
+ g_outputBuffer=ret.str();
+ });
+
+ luaCtx.writeFunction("showTLSErrorCounters", [] {
+ setLuaNoSideEffect();
+ ostringstream ret;
+ boost::format fmt("%-3d %-20.20s %-23d %-23d %-23d %-23d %-23d %-23d %-23d %-23d");
+
+ ret << (fmt % "#" % "Address" % "DH key too small" % "Inappropriate fallback" % "No shared cipher" % "Unknown cipher type" % "Unknown exchange type" % "Unknown protocol" % "Unsupported EC" % "Unsupported protocol") << endl;
+
+ size_t counter = 0;
+ for(const auto& f : g_frontends) {
+ if (!f->hasTLS()) {
+ continue;
+ }
+ const TLSErrorCounters* errorCounters = nullptr;
+ if (f->tlsFrontend != nullptr) {
+ errorCounters = &f->tlsFrontend->d_tlsCounters;
+ }
+ else if (f->dohFrontend != nullptr) {
+ errorCounters = &f->dohFrontend->d_tlsCounters;
+ }
+ if (errorCounters == nullptr) {
+ continue;
+ }
+
+ ret << (fmt % counter % f->local.toStringWithPort() % errorCounters->d_dhKeyTooSmall % errorCounters->d_inappropriateFallBack % errorCounters->d_noSharedCipher % errorCounters->d_unknownCipherType % errorCounters->d_unknownKeyExchangeType % errorCounters->d_unknownProtocol % errorCounters->d_unsupportedEC % errorCounters->d_unsupportedProtocol) << endl;
+ ++counter;
+ }
+ ret << endl;
+
+ g_outputBuffer=ret.str();
+ });
+
+ luaCtx.writeFunction("requestTCPStatesDump", [] {
+ setLuaNoSideEffect();
+ extern std::atomic<uint64_t> g_tcpStatesDumpRequested;
+ g_tcpStatesDumpRequested += g_tcpclientthreads->getThreadsCount();
+ });
+
+ luaCtx.writeFunction("requestDoHStatesDump", [] {
+ setLuaNoSideEffect();
+ g_dohStatesDumpRequested += g_dohClientThreads->getThreadsCount();
+ });
+
+ luaCtx.writeFunction("dumpStats", [] {
+ setLuaNoSideEffect();
+ vector<string> leftcolumn, rightcolumn;
+
+ boost::format fmt("%-35s\t%+11s");
+ g_outputBuffer.clear();
+ auto entries = g_stats.entries;
+ sort(entries.begin(), entries.end(),
+ [](const decltype(entries)::value_type& a, const decltype(entries)::value_type& b) {
+ return a.first < b.first;
+ });
+ boost::format flt(" %9.1f");
+ for(const auto& e : entries) {
+ string second;
+ if(const auto& val = boost::get<pdns::stat_t*>(&e.second))
+ second=std::to_string((*val)->load());
+ else if (const auto& dval = boost::get<double*>(&e.second))
+ second=(flt % (**dval)).str();
+ else
+ second=std::to_string((*boost::get<DNSDistStats::statfunction_t>(&e.second))(e.first));
+
+ if(leftcolumn.size() < g_stats.entries.size()/2)
+ leftcolumn.push_back((fmt % e.first % second).str());
+ else
+ rightcolumn.push_back((fmt % e.first % second).str());
+ }
+
+ auto leftiter=leftcolumn.begin(), rightiter=rightcolumn.begin();
+ boost::format clmn("%|0t|%1% %|51t|%2%\n");
+
+ for(;leftiter != leftcolumn.end() || rightiter != rightcolumn.end();) {
+ string lentry, rentry;
+ if(leftiter!= leftcolumn.end()) {
+ lentry = *leftiter;
+ leftiter++;
+ }
+ if(rightiter!= rightcolumn.end()) {
+ rentry = *rightiter;
+ rightiter++;
+ }
+ g_outputBuffer += (clmn % lentry % rentry).str();
+ }
+ });
+
+ luaCtx.writeFunction("exceedServFails", [](unsigned int rate, int seconds) {
+ setLuaNoSideEffect();
+ return exceedRCode(rate, seconds, RCode::ServFail);
+ });
+ luaCtx.writeFunction("exceedNXDOMAINs", [](unsigned int rate, int seconds) {
+ setLuaNoSideEffect();
+ return exceedRCode(rate, seconds, RCode::NXDomain);
+ });
+
+ luaCtx.writeFunction("exceedRespByterate", [](unsigned int rate, int seconds) {
+ setLuaNoSideEffect();
+ return exceedRespByterate(rate, seconds);
+ });
+
+ luaCtx.writeFunction("exceedQTypeRate", [](uint16_t type, unsigned int rate, int seconds) {
+ setLuaNoSideEffect();
+ return exceedQueryGen(rate, seconds, [type](counts_t& counts, const Rings::Query& q) {
+ if(q.qtype==type)
+ counts[q.requestor]++;
+ });
+ });
+
+ luaCtx.writeFunction("exceedQRate", [](unsigned int rate, int seconds) {
+ setLuaNoSideEffect();
+ return exceedQueryGen(rate, seconds, [](counts_t& counts, const Rings::Query& q) {
+ counts[q.requestor]++;
+ });
+ });
+
+ luaCtx.writeFunction("getRespRing", getRespRing);
+
+ /* StatNode */
+ luaCtx.registerFunction<StatNode, unsigned int()>("numChildren",
+ [](StatNode& sn) -> unsigned int {
+ return sn.children.size();
+ } );
+ luaCtx.registerMember("fullname", &StatNode::fullname);
+ luaCtx.registerMember("labelsCount", &StatNode::labelsCount);
+ luaCtx.registerMember("servfails", &StatNode::Stat::servfails);
+ luaCtx.registerMember("nxdomains", &StatNode::Stat::nxdomains);
+ luaCtx.registerMember("queries", &StatNode::Stat::queries);
+ luaCtx.registerMember("noerrors", &StatNode::Stat::noerrors);
+ luaCtx.registerMember("drops", &StatNode::Stat::drops);
+ luaCtx.registerMember("bytes", &StatNode::Stat::bytes);
+
+ luaCtx.writeFunction("statNodeRespRing", [](statvisitor_t visitor, boost::optional<unsigned int> seconds) {
+ statNodeRespRing(visitor, seconds ? *seconds : 0);
+ });
+
+ /* DynBlockRulesGroup */
+ luaCtx.writeFunction("dynBlockRulesGroup", []() { return std::make_shared<DynBlockRulesGroup>(); });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(unsigned int, unsigned int, const std::string&, unsigned int, boost::optional<DNSAction::Action>, boost::optional<unsigned int>)>("setQueryRate", [](std::shared_ptr<DynBlockRulesGroup>& group, unsigned int rate, unsigned int seconds, const std::string& reason, unsigned int blockDuration, boost::optional<DNSAction::Action> action, boost::optional<unsigned int> warningRate) {
+ if (group) {
+ group->setQueryRate(rate, warningRate ? *warningRate : 0, seconds, reason, blockDuration, action ? *action : DNSAction::Action::None);
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(unsigned int, unsigned int, const std::string&, unsigned int, boost::optional<DNSAction::Action>, boost::optional<unsigned int>)>("setResponseByteRate", [](std::shared_ptr<DynBlockRulesGroup>& group, unsigned int rate, unsigned int seconds, const std::string& reason, unsigned int blockDuration, boost::optional<DNSAction::Action> action, boost::optional<unsigned int> warningRate) {
+ if (group) {
+ group->setResponseByteRate(rate, warningRate ? *warningRate : 0, seconds, reason, blockDuration, action ? *action : DNSAction::Action::None);
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(unsigned int, const std::string&, unsigned int, boost::optional<DNSAction::Action>, DynBlockRulesGroup::smtVisitor_t)>("setSuffixMatchRule", [](std::shared_ptr<DynBlockRulesGroup>& group, unsigned int seconds, const std::string& reason, unsigned int blockDuration, boost::optional<DNSAction::Action> action, DynBlockRulesGroup::smtVisitor_t visitor) {
+ if (group) {
+ group->setSuffixMatchRule(seconds, reason, blockDuration, action ? *action : DNSAction::Action::None, visitor);
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(unsigned int, const std::string&, unsigned int, boost::optional<DNSAction::Action>, dnsdist_ffi_stat_node_visitor_t)>("setSuffixMatchRuleFFI", [](std::shared_ptr<DynBlockRulesGroup>& group, unsigned int seconds, const std::string& reason, unsigned int blockDuration, boost::optional<DNSAction::Action> action, dnsdist_ffi_stat_node_visitor_t visitor) {
+ if (group) {
+ group->setSuffixMatchRuleFFI(seconds, reason, blockDuration, action ? *action : DNSAction::Action::None, visitor);
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(uint8_t, unsigned int, unsigned int, const std::string&, unsigned int, boost::optional<DNSAction::Action>, boost::optional<unsigned int>)>("setRCodeRate", [](std::shared_ptr<DynBlockRulesGroup>& group, uint8_t rcode, unsigned int rate, unsigned int seconds, const std::string& reason, unsigned int blockDuration, boost::optional<DNSAction::Action> action, boost::optional<unsigned int> warningRate) {
+ if (group) {
+ group->setRCodeRate(rcode, rate, warningRate ? *warningRate : 0, seconds, reason, blockDuration, action ? *action : DNSAction::Action::None);
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(uint8_t, double, unsigned int, const std::string&, unsigned int, size_t, boost::optional<DNSAction::Action>, boost::optional<double>)>("setRCodeRatio", [](std::shared_ptr<DynBlockRulesGroup>& group, uint8_t rcode, double ratio, unsigned int seconds, const std::string& reason, unsigned int blockDuration, size_t minimumNumberOfResponses, boost::optional<DNSAction::Action> action, boost::optional<double> warningRatio) {
+ if (group) {
+ group->setRCodeRatio(rcode, ratio, warningRatio ? *warningRatio : 0.0, seconds, reason, blockDuration, action ? *action : DNSAction::Action::None, minimumNumberOfResponses);
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(uint16_t, unsigned int, unsigned int, const std::string&, unsigned int, boost::optional<DNSAction::Action>, boost::optional<unsigned int>)>("setQTypeRate", [](std::shared_ptr<DynBlockRulesGroup>& group, uint16_t qtype, unsigned int rate, unsigned int seconds, const std::string& reason, unsigned int blockDuration, boost::optional<DNSAction::Action> action, boost::optional<unsigned int> warningRate) {
+ if (group) {
+ group->setQTypeRate(qtype, rate, warningRate ? *warningRate : 0, seconds, reason, blockDuration, action ? *action : DNSAction::Action::None);
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(uint8_t, uint8_t, uint8_t)>("setMasks", [](std::shared_ptr<DynBlockRulesGroup>& group, uint8_t v4, uint8_t v6, uint8_t port) {
+ if (group) {
+ if (v4 > 32) {
+ throw std::runtime_error("Trying to set an invalid IPv4 mask (" + std::to_string(v4) + ") to a Dynamic Block object");
+ }
+ if (v6 > 128) {
+ throw std::runtime_error("Trying to set an invalid IPv6 mask (" + std::to_string(v6) + ") to a Dynamic Block object");
+ }
+ if (port > 16) {
+ throw std::runtime_error("Trying to set an invalid port mask (" + std::to_string(port) + ") to a Dynamic Block object");
+ }
+ if (port > 0 && v4 != 32) {
+ throw std::runtime_error("Setting a non-zero port mask for Dynamic Blocks while only considering parts of IPv4 addresses does not make sense");
+ }
+ group->setMasks(v4, v6, port);
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(boost::variant<std::string, std::vector<std::pair<int, std::string>>, NetmaskGroup>)>("excludeRange", [](std::shared_ptr<DynBlockRulesGroup>& group, boost::variant<std::string, std::vector<std::pair<int, std::string>>, NetmaskGroup> ranges) {
+ if (ranges.type() == typeid(std::vector<std::pair<int, std::string>>)) {
+ for (const auto& range : *boost::get<std::vector<std::pair<int, std::string>>>(&ranges)) {
+ group->excludeRange(Netmask(range.second));
+ }
+ }
+ else if (ranges.type() == typeid(NetmaskGroup)) {
+ group->excludeRange(*boost::get<NetmaskGroup>(&ranges));
+ }
+ else {
+ group->excludeRange(Netmask(*boost::get<std::string>(&ranges)));
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(boost::variant<std::string, std::vector<std::pair<int, std::string>>, NetmaskGroup>)>("includeRange", [](std::shared_ptr<DynBlockRulesGroup>& group, boost::variant<std::string, std::vector<std::pair<int, std::string>>, NetmaskGroup> ranges) {
+ if (ranges.type() == typeid(std::vector<std::pair<int, std::string>>)) {
+ for (const auto& range : *boost::get<std::vector<std::pair<int, std::string>>>(&ranges)) {
+ group->includeRange(Netmask(range.second));
+ }
+ }
+ else if (ranges.type() == typeid(NetmaskGroup)) {
+ group->includeRange(*boost::get<NetmaskGroup>(&ranges));
+ }
+ else {
+ group->includeRange(Netmask(*boost::get<std::string>(&ranges)));
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)(boost::variant<std::string, std::vector<std::pair<int, std::string>>>)>("excludeDomains", [](std::shared_ptr<DynBlockRulesGroup>& group, boost::variant<std::string, std::vector<std::pair<int, std::string>>> domains) {
+ if (domains.type() == typeid(std::vector<std::pair<int, std::string>>)) {
+ for (const auto& range : *boost::get<std::vector<std::pair<int, std::string>>>(&domains)) {
+ group->excludeDomain(DNSName(range.second));
+ }
+ }
+ else {
+ group->excludeDomain(DNSName(*boost::get<std::string>(&domains)));
+ }
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<DynBlockRulesGroup>::*)()>("apply", [](std::shared_ptr<DynBlockRulesGroup>& group) {
+ group->apply();
+ });
+ luaCtx.registerFunction("setQuiet", &DynBlockRulesGroup::setQuiet);
+ luaCtx.registerFunction("toString", &DynBlockRulesGroup::toString);
+}
diff --git a/dnsdist-lua-rules.cc b/dnsdist-lua-rules.cc
new file mode 100644
index 0000000..19eec4c
--- /dev/null
+++ b/dnsdist-lua-rules.cc
@@ -0,0 +1,621 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsdist.hh"
+#include "dnsdist-lua.hh"
+#include "dnsdist-rules.hh"
+
+std::shared_ptr<DNSRule> makeRule(const luadnsrule_t& var)
+{
+ if (var.type() == typeid(std::shared_ptr<DNSRule>))
+ return *boost::get<std::shared_ptr<DNSRule>>(&var);
+
+ SuffixMatchNode smn;
+ NetmaskGroup nmg;
+ auto add=[&](string src) {
+ try {
+ nmg.addMask(src); // need to try mask first, all masks are domain names!
+ } catch(...) {
+ smn.add(DNSName(src));
+ }
+ };
+
+ if (var.type() == typeid(string))
+ add(*boost::get<string>(&var));
+
+ else if (var.type() == typeid(vector<pair<int, string>>))
+ for(const auto& a : *boost::get<vector<pair<int, string>>>(&var))
+ add(a.second);
+
+ else if (var.type() == typeid(DNSName))
+ smn.add(*boost::get<DNSName>(&var));
+
+ else if (var.type() == typeid(vector<pair<int, DNSName>>))
+ for(const auto& a : *boost::get<vector<pair<int, DNSName>>>(&var))
+ smn.add(a.second);
+
+ if(nmg.empty())
+ return std::make_shared<SuffixMatchNodeRule>(smn);
+ else
+ return std::make_shared<NetmaskGroupRule>(nmg, true);
+}
+
+static boost::uuids::uuid makeRuleID(std::string& id)
+{
+ if (id.empty()) {
+ return getUniqueID();
+ }
+
+ return getUniqueID(id);
+}
+
+void parseRuleParams(boost::optional<luaruleparams_t> params, boost::uuids::uuid& uuid, std::string& name, uint64_t& creationOrder)
+{
+ static uint64_t s_creationOrder = 0;
+
+ string uuidStr;
+
+ if (params) {
+ if (params->count("uuid")) {
+ uuidStr = boost::get<std::string>((*params)["uuid"]);
+ }
+ if (params->count("name")) {
+ name = boost::get<std::string>((*params)["name"]);
+ }
+ }
+
+ uuid = makeRuleID(uuidStr);
+ creationOrder = s_creationOrder++;
+}
+
+typedef std::unordered_map<std::string, boost::variant<bool, int, std::string, std::vector<std::pair<int,int> > > > ruleparams_t;
+
+template<typename T>
+static std::string rulesToString(const std::vector<T>& rules, boost::optional<ruleparams_t> vars)
+{
+ int num = 0;
+ bool showUUIDs = false;
+ size_t truncateRuleWidth = string::npos;
+ std::string result;
+
+ if (vars) {
+ if (vars->count("showUUIDs")) {
+ showUUIDs = boost::get<bool>((*vars)["showUUIDs"]);
+ }
+ if (vars->count("truncateRuleWidth")) {
+ truncateRuleWidth = boost::get<int>((*vars)["truncateRuleWidth"]);
+ }
+ }
+
+ if (showUUIDs) {
+ boost::format fmt("%-3d %-30s %-38s %9d %9d %-56s %s\n");
+ result += (fmt % "#" % "Name" % "UUID" % "Cr. Order" % "Matches" % "Rule" % "Action").str();
+ for(const auto& lim : rules) {
+ string desc = lim.d_rule->toString().substr(0, truncateRuleWidth);
+ result += (fmt % num % lim.d_name % boost::uuids::to_string(lim.d_id) % lim.d_creationOrder % lim.d_rule->d_matches % desc % lim.d_action->toString()).str();
+ ++num;
+ }
+ }
+ else {
+ boost::format fmt("%-3d %-30s %9d %-56s %s\n");
+ result += (fmt % "#" % "Name" % "Matches" % "Rule" % "Action").str();
+ for(const auto& lim : rules) {
+ string desc = lim.d_rule->toString().substr(0, truncateRuleWidth);
+ result += (fmt % num % lim.d_name % lim.d_rule->d_matches % desc % lim.d_action->toString()).str();
+ ++num;
+ }
+ }
+ return result;
+}
+
+template<typename T>
+static void showRules(GlobalStateHolder<vector<T> > *someRuleActions, boost::optional<ruleparams_t> vars) {
+ setLuaNoSideEffect();
+
+ auto rules = someRuleActions->getLocal();
+ g_outputBuffer += rulesToString(*rules, vars);
+}
+
+template<typename T>
+static void rmRule(GlobalStateHolder<vector<T> > *someRuleActions, boost::variant<unsigned int, std::string> id) {
+ setLuaSideEffect();
+ auto rules = someRuleActions->getCopy();
+ if (auto str = boost::get<std::string>(&id)) {
+ try {
+ const auto uuid = getUniqueID(*str);
+ if (rules.erase(std::remove_if(rules.begin(),
+ rules.end(),
+ [uuid](const T& a) { return a.d_id == uuid; }),
+ rules.end()) == rules.end()) {
+ g_outputBuffer = "Error: no rule matched\n";
+ return;
+ }
+ }
+ catch (const std::runtime_error& e) {
+ /* it was not an UUID, let's see if it was a name instead */
+ if (rules.erase(std::remove_if(rules.begin(),
+ rules.end(),
+ [&str](const T& a) { return a.d_name == *str; }),
+ rules.end()) == rules.end()) {
+ g_outputBuffer = "Error: no rule matched\n";
+ return;
+ }
+ }
+ }
+ else if (auto pos = boost::get<unsigned int>(&id)) {
+ if (*pos >= rules.size()) {
+ g_outputBuffer = "Error: attempt to delete non-existing rule\n";
+ return;
+ }
+ rules.erase(rules.begin()+*pos);
+ }
+ someRuleActions->setState(std::move(rules));
+}
+
+template<typename T>
+static void moveRuleToTop(GlobalStateHolder<vector<T> > *someRuleActions) {
+ setLuaSideEffect();
+ auto rules = someRuleActions->getCopy();
+ if(rules.empty())
+ return;
+ auto subject = *rules.rbegin();
+ rules.erase(std::prev(rules.end()));
+ rules.insert(rules.begin(), subject);
+ someRuleActions->setState(std::move(rules));
+}
+
+template<typename T>
+static void mvRule(GlobalStateHolder<vector<T> > *someRespRuleActions, unsigned int from, unsigned int to) {
+ setLuaSideEffect();
+ auto rules = someRespRuleActions->getCopy();
+ if(from >= rules.size() || to > rules.size()) {
+ g_outputBuffer = "Error: attempt to move rules from/to invalid index\n";
+ return;
+ }
+ auto subject = rules[from];
+ rules.erase(rules.begin()+from);
+ if(to > rules.size())
+ rules.push_back(subject);
+ else {
+ if(from < to)
+ --to;
+ rules.insert(rules.begin()+to, subject);
+ }
+ someRespRuleActions->setState(std::move(rules));
+}
+
+template<typename T>
+static std::vector<T> getTopRules(const std::vector<T>& rules, unsigned int top)
+{
+ std::vector<std::pair<size_t, size_t>> counts;
+ counts.reserve(rules.size());
+
+ size_t pos = 0;
+ for (const auto& rule : rules) {
+ counts.push_back({rule.d_rule->d_matches.load(), pos});
+ pos++;
+ }
+
+ sort(counts.begin(), counts.end(), [](const decltype(counts)::value_type& a,
+ const decltype(counts)::value_type& b) {
+ return b.first < a.first;
+ });
+
+ std::vector<T> results;
+ results.reserve(top);
+
+ size_t count = 0;
+ for (const auto& entry : counts) {
+ results.emplace_back(rules.at(entry.second));
+ ++count;
+ if (count == top) {
+ break;
+ }
+ }
+
+ return results;
+}
+
+void setupLuaRules(LuaContext& luaCtx)
+{
+ luaCtx.writeFunction("makeRule", makeRule);
+
+ luaCtx.registerFunction<string(std::shared_ptr<DNSRule>::*)()const>("toString", [](const std::shared_ptr<DNSRule>& rule) { return rule->toString(); });
+
+ luaCtx.writeFunction("showResponseRules", [](boost::optional<ruleparams_t> vars) {
+ showRules(&g_respruleactions, vars);
+ });
+
+ luaCtx.writeFunction("rmResponseRule", [](boost::variant<unsigned int, std::string> id) {
+ rmRule(&g_respruleactions, id);
+ });
+
+ luaCtx.writeFunction("mvResponseRuleToTop", []() {
+ moveRuleToTop(&g_respruleactions);
+ });
+
+ luaCtx.writeFunction("mvResponseRule", [](unsigned int from, unsigned int to) {
+ mvRule(&g_respruleactions, from, to);
+ });
+
+ luaCtx.writeFunction("showCacheHitResponseRules", [](boost::optional<ruleparams_t> vars) {
+ showRules(&g_cachehitrespruleactions, vars);
+ });
+
+ luaCtx.writeFunction("rmCacheHitResponseRule", [](boost::variant<unsigned int, std::string> id) {
+ rmRule(&g_cachehitrespruleactions, id);
+ });
+
+ luaCtx.writeFunction("mvCacheHitResponseRuleToTop", []() {
+ moveRuleToTop(&g_cachehitrespruleactions);
+ });
+
+ luaCtx.writeFunction("mvCacheHitResponseRule", [](unsigned int from, unsigned int to) {
+ mvRule(&g_cachehitrespruleactions, from, to);
+ });
+
+ luaCtx.writeFunction("showSelfAnsweredResponseRules", [](boost::optional<ruleparams_t> vars) {
+ showRules(&g_selfansweredrespruleactions, vars);
+ });
+
+ luaCtx.writeFunction("rmSelfAnsweredResponseRule", [](boost::variant<unsigned int, std::string> id) {
+ rmRule(&g_selfansweredrespruleactions, id);
+ });
+
+ luaCtx.writeFunction("mvSelfAnsweredResponseRuleToTop", []() {
+ moveRuleToTop(&g_selfansweredrespruleactions);
+ });
+
+ luaCtx.writeFunction("mvSelfAnsweredResponseRule", [](unsigned int from, unsigned int to) {
+ mvRule(&g_selfansweredrespruleactions, from, to);
+ });
+
+ luaCtx.writeFunction("rmRule", [](boost::variant<unsigned int, std::string> id) {
+ rmRule(&g_ruleactions, id);
+ });
+
+ luaCtx.writeFunction("mvRuleToTop", []() {
+ moveRuleToTop(&g_ruleactions);
+ });
+
+ luaCtx.writeFunction("mvRule", [](unsigned int from, unsigned int to) {
+ mvRule(&g_ruleactions, from, to);
+ });
+
+ luaCtx.writeFunction("clearRules", []() {
+ setLuaSideEffect();
+ g_ruleactions.modify([](decltype(g_ruleactions)::value_type& ruleactions) {
+ ruleactions.clear();
+ });
+ });
+
+ luaCtx.writeFunction("setRules", [](const std::vector<std::pair<int, std::shared_ptr<DNSDistRuleAction>>>& newruleactions) {
+ setLuaSideEffect();
+ g_ruleactions.modify([newruleactions](decltype(g_ruleactions)::value_type& gruleactions) {
+ gruleactions.clear();
+ for (const auto& pair : newruleactions) {
+ const auto& newruleaction = pair.second;
+ if (newruleaction->d_action) {
+ auto rule = makeRule(newruleaction->d_rule);
+ gruleactions.push_back({std::move(rule), newruleaction->d_action, newruleaction->d_name, newruleaction->d_id, newruleaction->d_creationOrder});
+ }
+ }
+ });
+ });
+
+ luaCtx.writeFunction("getTopRules", [](boost::optional<unsigned int> top) {
+ setLuaNoSideEffect();
+ auto rules = g_ruleactions.getLocal();
+ return getTopRules(*rules, top.get_value_or(10));
+ });
+
+ luaCtx.writeFunction("topRules", [](boost::optional<unsigned int> top, boost::optional<ruleparams_t> vars) {
+ setLuaNoSideEffect();
+ auto rules = g_ruleactions.getLocal();
+ return rulesToString(getTopRules(*rules, top.get_value_or(10)), vars);
+ });
+
+ luaCtx.writeFunction("getCacheHitResponseRules", [](boost::optional<unsigned int> top) {
+ setLuaNoSideEffect();
+ auto rules = g_cachehitrespruleactions.getLocal();
+ return getTopRules(*rules, top.get_value_or(10));
+ });
+
+ luaCtx.writeFunction("topCacheHitRules", [](boost::optional<unsigned int> top, boost::optional<ruleparams_t> vars) {
+ setLuaNoSideEffect();
+ auto rules = g_cachehitrespruleactions.getLocal();
+ return rulesToString(getTopRules(*rules, top.get_value_or(10)), vars);
+ });
+
+ luaCtx.writeFunction("getTopResponseRules", [](boost::optional<unsigned int> top) {
+ setLuaNoSideEffect();
+ auto rules = g_respruleactions.getLocal();
+ return getTopRules(*rules, top.get_value_or(10));
+ });
+
+ luaCtx.writeFunction("topResponseRules", [](boost::optional<unsigned int> top, boost::optional<ruleparams_t> vars) {
+ setLuaNoSideEffect();
+ auto rules = g_respruleactions.getLocal();
+ return rulesToString(getTopRules(*rules, top.get_value_or(10)), vars);
+ });
+
+ luaCtx.writeFunction("getTopSelfAnsweredResponseRules", [](boost::optional<unsigned int> top) {
+ setLuaNoSideEffect();
+ auto rules = g_selfansweredrespruleactions.getLocal();
+ return getTopRules(*rules, top.get_value_or(10));
+ });
+
+ luaCtx.writeFunction("topSelfAnsweredResponseRules", [](boost::optional<unsigned int> top, boost::optional<ruleparams_t> vars) {
+ setLuaNoSideEffect();
+ auto rules = g_selfansweredrespruleactions.getLocal();
+ return rulesToString(getTopRules(*rules, top.get_value_or(10)), vars);
+ });
+
+ luaCtx.writeFunction("MaxQPSIPRule", [](unsigned int qps, boost::optional<int> ipv4trunc, boost::optional<int> ipv6trunc, boost::optional<int> burst, boost::optional<unsigned int> expiration, boost::optional<unsigned int> cleanupDelay, boost::optional<unsigned int> scanFraction) {
+ return std::shared_ptr<DNSRule>(new MaxQPSIPRule(qps, burst.get_value_or(qps), ipv4trunc.get_value_or(32), ipv6trunc.get_value_or(64), expiration.get_value_or(300), cleanupDelay.get_value_or(60), scanFraction.get_value_or(10)));
+ });
+
+ luaCtx.writeFunction("MaxQPSRule", [](unsigned int qps, boost::optional<int> burst) {
+ if(!burst)
+ return std::shared_ptr<DNSRule>(new MaxQPSRule(qps));
+ else
+ return std::shared_ptr<DNSRule>(new MaxQPSRule(qps, *burst));
+ });
+
+ luaCtx.writeFunction("RegexRule", [](const std::string& str) {
+ return std::shared_ptr<DNSRule>(new RegexRule(str));
+ });
+
+#ifdef HAVE_DNS_OVER_HTTPS
+ luaCtx.writeFunction("HTTPHeaderRule", [](const std::string& header, const std::string& regex) {
+ return std::shared_ptr<DNSRule>(new HTTPHeaderRule(header, regex));
+ });
+ luaCtx.writeFunction("HTTPPathRule", [](const std::string& path) {
+ return std::shared_ptr<DNSRule>(new HTTPPathRule(path));
+ });
+ luaCtx.writeFunction("HTTPPathRegexRule", [](const std::string& regex) {
+ return std::shared_ptr<DNSRule>(new HTTPPathRegexRule(regex));
+ });
+#endif
+
+#ifdef HAVE_RE2
+ luaCtx.writeFunction("RE2Rule", [](const std::string& str) {
+ return std::shared_ptr<DNSRule>(new RE2Rule(str));
+ });
+#endif
+
+ luaCtx.writeFunction("SNIRule", [](const std::string& name) {
+ return std::shared_ptr<DNSRule>(new SNIRule(name));
+ });
+
+ luaCtx.writeFunction("SuffixMatchNodeRule", [](const SuffixMatchNode& smn, boost::optional<bool> quiet) {
+ return std::shared_ptr<DNSRule>(new SuffixMatchNodeRule(smn, quiet ? *quiet : false));
+ });
+
+ luaCtx.writeFunction("NetmaskGroupRule", [](const NetmaskGroup& nmg, boost::optional<bool> src, boost::optional<bool> quiet) {
+ return std::shared_ptr<DNSRule>(new NetmaskGroupRule(nmg, src ? *src : true, quiet ? *quiet : false));
+ });
+
+ luaCtx.writeFunction("benchRule", [](std::shared_ptr<DNSRule> rule, boost::optional<int> times_, boost::optional<string> suffix_) {
+ setLuaNoSideEffect();
+ int times = times_.get_value_or(100000);
+ DNSName suffix(suffix_.get_value_or("powerdns.com"));
+ struct item {
+ PacketBuffer packet;
+ ComboAddress rem;
+ DNSName qname;
+ uint16_t qtype, qclass;
+ };
+ vector<item> items;
+ items.reserve(1000);
+ for(int n=0; n < 1000; ++n) {
+ struct item i;
+ i.qname=DNSName(std::to_string(random()));
+ i.qname += suffix;
+ i.qtype = random() % 0xff;
+ i.qclass = 1;
+ i.rem=ComboAddress("127.0.0.1");
+ i.rem.sin4.sin_addr.s_addr = random();
+ GenericDNSPacketWriter<PacketBuffer> pw(i.packet, i.qname, i.qtype);
+ items.push_back(i);
+ }
+
+ int matches=0;
+ ComboAddress dummy("127.0.0.1");
+ StopWatch sw;
+ sw.start();
+ for(int n=0; n < times; ++n) {
+ item& i = items[n % items.size()];
+ DNSQuestion dq(&i.qname, i.qtype, i.qclass, &i.rem, &i.rem, i.packet, dnsdist::Protocol::DoUDP, &sw.d_start);
+ if (rule->matches(&dq)) {
+ matches++;
+ }
+ }
+ double udiff=sw.udiff();
+ g_outputBuffer=(boost::format("Had %d matches out of %d, %.1f qps, in %.1f usec\n") % matches % times % (1000000*(1.0*times/udiff)) % udiff).str();
+
+ });
+
+ luaCtx.writeFunction("AllRule", []() {
+ return std::shared_ptr<DNSRule>(new AllRule());
+ });
+
+ luaCtx.writeFunction("ProbaRule", [](double proba) {
+ return std::shared_ptr<DNSRule>(new ProbaRule(proba));
+ });
+
+ luaCtx.writeFunction("QNameRule", [](const std::string& qname) {
+ return std::shared_ptr<DNSRule>(new QNameRule(DNSName(qname)));
+ });
+
+ luaCtx.writeFunction("QTypeRule", [](boost::variant<int, std::string> str) {
+ uint16_t qtype;
+ if(auto dir = boost::get<int>(&str)) {
+ qtype = *dir;
+ }
+ else {
+ string val=boost::get<string>(str);
+ qtype = QType::chartocode(val.c_str());
+ if(!qtype)
+ throw std::runtime_error("Unable to convert '"+val+"' to a DNS type");
+ }
+ return std::shared_ptr<DNSRule>(new QTypeRule(qtype));
+ });
+
+ luaCtx.writeFunction("QClassRule", [](int c) {
+ return std::shared_ptr<DNSRule>(new QClassRule(c));
+ });
+
+ luaCtx.writeFunction("OpcodeRule", [](uint8_t code) {
+ return std::shared_ptr<DNSRule>(new OpcodeRule(code));
+ });
+
+ luaCtx.writeFunction("AndRule", [](vector<pair<int, std::shared_ptr<DNSRule> > >a) {
+ return std::shared_ptr<DNSRule>(new AndRule(a));
+ });
+
+ luaCtx.writeFunction("OrRule", [](vector<pair<int, std::shared_ptr<DNSRule> > >a) {
+ return std::shared_ptr<DNSRule>(new OrRule(a));
+ });
+
+ luaCtx.writeFunction("DSTPortRule", [](uint16_t port) {
+ return std::shared_ptr<DNSRule>(new DSTPortRule(port));
+ });
+
+ luaCtx.writeFunction("TCPRule", [](bool tcp) {
+ return std::shared_ptr<DNSRule>(new TCPRule(tcp));
+ });
+
+ luaCtx.writeFunction("DNSSECRule", []() {
+ return std::shared_ptr<DNSRule>(new DNSSECRule());
+ });
+
+ luaCtx.writeFunction("NotRule", [](std::shared_ptr<DNSRule>rule) {
+ return std::shared_ptr<DNSRule>(new NotRule(rule));
+ });
+
+ luaCtx.writeFunction("RecordsCountRule", [](uint8_t section, uint16_t minCount, uint16_t maxCount) {
+ return std::shared_ptr<DNSRule>(new RecordsCountRule(section, minCount, maxCount));
+ });
+
+ luaCtx.writeFunction("RecordsTypeCountRule", [](uint8_t section, uint16_t type, uint16_t minCount, uint16_t maxCount) {
+ return std::shared_ptr<DNSRule>(new RecordsTypeCountRule(section, type, minCount, maxCount));
+ });
+
+ luaCtx.writeFunction("TrailingDataRule", []() {
+ return std::shared_ptr<DNSRule>(new TrailingDataRule());
+ });
+
+ luaCtx.writeFunction("QNameLabelsCountRule", [](unsigned int minLabelsCount, unsigned int maxLabelsCount) {
+ return std::shared_ptr<DNSRule>(new QNameLabelsCountRule(minLabelsCount, maxLabelsCount));
+ });
+
+ luaCtx.writeFunction("QNameWireLengthRule", [](size_t min, size_t max) {
+ return std::shared_ptr<DNSRule>(new QNameWireLengthRule(min, max));
+ });
+
+ luaCtx.writeFunction("RCodeRule", [](uint8_t rcode) {
+ return std::shared_ptr<DNSRule>(new RCodeRule(rcode));
+ });
+
+ luaCtx.writeFunction("ERCodeRule", [](uint8_t rcode) {
+ return std::shared_ptr<DNSRule>(new ERCodeRule(rcode));
+ });
+
+ luaCtx.writeFunction("EDNSVersionRule", [](uint8_t version) {
+ return std::shared_ptr<DNSRule>(new EDNSVersionRule(version));
+ });
+
+ luaCtx.writeFunction("EDNSOptionRule", [](uint16_t optcode) {
+ return std::shared_ptr<DNSRule>(new EDNSOptionRule(optcode));
+ });
+
+ luaCtx.writeFunction("showRules", [](boost::optional<ruleparams_t> vars) {
+ showRules(&g_ruleactions, vars);
+ });
+
+ luaCtx.writeFunction("RDRule", []() {
+ return std::shared_ptr<DNSRule>(new RDRule());
+ });
+
+ luaCtx.writeFunction("TagRule", [](std::string tag, boost::optional<std::string> value) {
+ return std::shared_ptr<DNSRule>(new TagRule(tag, value));
+ });
+
+ luaCtx.writeFunction("TimedIPSetRule", []() {
+ return std::shared_ptr<TimedIPSetRule>(new TimedIPSetRule());
+ });
+
+ luaCtx.writeFunction("PoolAvailableRule", [](std::string poolname) {
+ return std::shared_ptr<DNSRule>(new PoolAvailableRule(poolname));
+ });
+
+ luaCtx.writeFunction("PoolOutstandingRule", [](std::string poolname, size_t limit) {
+ return std::shared_ptr<DNSRule>(new PoolOutstandingRule(poolname, limit));
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<TimedIPSetRule>::*)()>("clear", [](std::shared_ptr<TimedIPSetRule> tisr) {
+ tisr->clear();
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<TimedIPSetRule>::*)()>("cleanup", [](std::shared_ptr<TimedIPSetRule> tisr) {
+ tisr->cleanup();
+ });
+
+ luaCtx.registerFunction<void(std::shared_ptr<TimedIPSetRule>::*)(const ComboAddress& ca, int t)>("add", [](std::shared_ptr<TimedIPSetRule> tisr, const ComboAddress& ca, int t) {
+ tisr->add(ca, time(0)+t);
+ });
+
+ luaCtx.registerFunction<std::shared_ptr<DNSRule>(std::shared_ptr<TimedIPSetRule>::*)()>("slice", [](std::shared_ptr<TimedIPSetRule> tisr) {
+ return std::dynamic_pointer_cast<DNSRule>(tisr);
+ });
+ luaCtx.registerFunction<void(std::shared_ptr<TimedIPSetRule>::*)()>("__tostring", [](std::shared_ptr<TimedIPSetRule> tisr) {
+ tisr->toString();
+ });
+
+ luaCtx.writeFunction("QNameSetRule", [](const DNSNameSet& names) {
+ return std::shared_ptr<DNSRule>(new QNameSetRule(names));
+ });
+
+ luaCtx.writeFunction("KeyValueStoreLookupRule", [](std::shared_ptr<KeyValueStore>& kvs, std::shared_ptr<KeyValueLookupKey>& lookupKey) {
+ return std::shared_ptr<DNSRule>(new KeyValueStoreLookupRule(kvs, lookupKey));
+ });
+
+ luaCtx.writeFunction("KeyValueStoreRangeLookupRule", [](std::shared_ptr<KeyValueStore>& kvs, std::shared_ptr<KeyValueLookupKey>& lookupKey) {
+ return std::shared_ptr<DNSRule>(new KeyValueStoreRangeLookupRule(kvs, lookupKey));
+ });
+
+ luaCtx.writeFunction("LuaRule", [](LuaRule::func_t func) {
+ return std::shared_ptr<DNSRule>(new LuaRule(func));
+ });
+
+ luaCtx.writeFunction("LuaFFIRule", [](LuaFFIRule::func_t func) {
+ return std::shared_ptr<DNSRule>(new LuaFFIRule(func));
+ });
+
+ luaCtx.writeFunction("LuaFFIPerThreadRule", [](std::string code) {
+ return std::shared_ptr<DNSRule>(new LuaFFIPerThreadRule(code));
+ });
+
+ luaCtx.writeFunction("ProxyProtocolValueRule", [](uint8_t type, boost::optional<std::string> value) {
+ return std::shared_ptr<DNSRule>(new ProxyProtocolValueRule(type, value));
+ });
+}
diff --git a/dnsdist-lua-vars.cc b/dnsdist-lua-vars.cc
new file mode 100644
index 0000000..82c4a8e
--- /dev/null
+++ b/dnsdist-lua-vars.cc
@@ -0,0 +1,126 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsdist.hh"
+#include "dnsdist-lua.hh"
+#include "ednsoptions.hh"
+
+#undef BADSIG // signal.h SIG_ERR
+
+void setupLuaVars(LuaContext& luaCtx)
+{
+ luaCtx.writeVariable("DNSAction", std::unordered_map<string,int>{
+ {"Drop", (int)DNSAction::Action::Drop},
+ {"Nxdomain", (int)DNSAction::Action::Nxdomain},
+ {"Refused", (int)DNSAction::Action::Refused},
+ {"Spoof", (int)DNSAction::Action::Spoof},
+ {"SpoofRaw", (int)DNSAction::Action::SpoofRaw},
+ {"Allow", (int)DNSAction::Action::Allow},
+ {"HeaderModify", (int)DNSAction::Action::HeaderModify},
+ {"Pool", (int)DNSAction::Action::Pool},
+ {"None",(int)DNSAction::Action::None},
+ {"NoOp",(int)DNSAction::Action::NoOp},
+ {"Delay", (int)DNSAction::Action::Delay},
+ {"Truncate", (int)DNSAction::Action::Truncate},
+ {"ServFail", (int)DNSAction::Action::ServFail},
+ {"NoRecurse", (int)DNSAction::Action::NoRecurse}
+ });
+
+ luaCtx.writeVariable("DNSResponseAction", std::unordered_map<string,int>{
+ {"Allow", (int)DNSResponseAction::Action::Allow },
+ {"Delay", (int)DNSResponseAction::Action::Delay },
+ {"Drop", (int)DNSResponseAction::Action::Drop },
+ {"HeaderModify", (int)DNSResponseAction::Action::HeaderModify },
+ {"ServFail", (int)DNSResponseAction::Action::ServFail },
+ {"None", (int)DNSResponseAction::Action::None }
+ });
+
+ luaCtx.writeVariable("DNSClass", std::unordered_map<string,int>{
+ {"IN", QClass::IN },
+ {"CHAOS", QClass::CHAOS },
+ {"NONE", QClass::NONE },
+ {"ANY", QClass::ANY }
+ });
+
+ luaCtx.writeVariable("DNSOpcode", std::unordered_map<string,int>{
+ {"Query", Opcode::Query },
+ {"IQuery", Opcode::IQuery },
+ {"Status", Opcode::Status },
+ {"Notify", Opcode::Notify },
+ {"Update", Opcode::Update }
+ });
+
+ luaCtx.writeVariable("DNSSection", std::unordered_map<string,int>{
+ {"Question", 0 },
+ {"Answer", 1 },
+ {"Authority", 2 },
+ {"Additional",3 }
+ });
+
+ luaCtx.writeVariable("EDNSOptionCode", std::unordered_map<string,int>{
+ {"NSID", EDNSOptionCode::NSID },
+ {"DAU", EDNSOptionCode::DAU },
+ {"DHU", EDNSOptionCode::DHU },
+ {"N3U", EDNSOptionCode::N3U },
+ {"ECS", EDNSOptionCode::ECS },
+ {"EXPIRE", EDNSOptionCode::EXPIRE },
+ {"COOKIE", EDNSOptionCode::COOKIE },
+ {"TCPKEEPALIVE", EDNSOptionCode::TCPKEEPALIVE },
+ {"PADDING", EDNSOptionCode::PADDING },
+ {"CHAIN", EDNSOptionCode::CHAIN },
+ {"KEYTAG", EDNSOptionCode::KEYTAG }
+ });
+
+ luaCtx.writeVariable("DNSRCode", std::unordered_map<string, int>{
+ {"NOERROR", RCode::NoError },
+ {"FORMERR", RCode::FormErr },
+ {"SERVFAIL", RCode::ServFail },
+ {"NXDOMAIN", RCode::NXDomain },
+ {"NOTIMP", RCode::NotImp },
+ {"REFUSED", RCode::Refused },
+ {"YXDOMAIN", RCode::YXDomain },
+ {"YXRRSET", RCode::YXRRSet },
+ {"NXRRSET", RCode::NXRRSet },
+ {"NOTAUTH", RCode::NotAuth },
+ {"NOTZONE", RCode::NotZone },
+ {"BADVERS", ERCode::BADVERS },
+ {"BADSIG", ERCode::BADSIG },
+ {"BADKEY", ERCode::BADKEY },
+ {"BADTIME", ERCode::BADTIME },
+ {"BADMODE", ERCode::BADMODE },
+ {"BADNAME", ERCode::BADNAME },
+ {"BADALG", ERCode::BADALG },
+ {"BADTRUNC", ERCode::BADTRUNC },
+ {"BADCOOKIE",ERCode::BADCOOKIE }
+ });
+
+ vector<pair<string, int> > dd;
+ for(const auto& n : QType::names)
+ dd.push_back({n.first, n.second});
+ luaCtx.writeVariable("DNSQType", dd);
+
+#ifdef HAVE_DNSCRYPT
+ luaCtx.writeVariable("DNSCryptExchangeVersion", std::unordered_map<string,int>{
+ { "VERSION1", DNSCryptExchangeVersion::VERSION1 },
+ { "VERSION2", DNSCryptExchangeVersion::VERSION2 },
+ });
+#endif
+}
diff --git a/dnsdist-lua-web.cc b/dnsdist-lua-web.cc
new file mode 100644
index 0000000..4b5c20b
--- /dev/null
+++ b/dnsdist-lua-web.cc
@@ -0,0 +1,79 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include <yahttp/yahttp.hpp>
+
+#include "dnsdist.hh"
+#include "dnsdist-lua.hh"
+#include "dnsdist-web.hh"
+
+void registerWebHandler(const std::string& endpoint, std::function<void(const YaHTTP::Request&, YaHTTP::Response&)> handler);
+
+void setupLuaWeb(LuaContext& luaCtx)
+{
+ luaCtx.writeFunction("registerWebHandler", [](const std::string& path, std::function<void(const YaHTTP::Request*, YaHTTP::Response*)> handler) {
+ /* LuaWrapper does a copy for objects passed by reference, so we pass a pointer */
+ registerWebHandler(path, [handler](const YaHTTP::Request& req, YaHTTP::Response& resp) { handler(&req, &resp); });
+ });
+
+ luaCtx.registerMember<std::string(YaHTTP::Request::*)>("path", [](const YaHTTP::Request& req) -> std::string { return req.url.path; }, [](YaHTTP::Request& req, const std::string& path) { (void) path; });
+ luaCtx.registerMember<int(YaHTTP::Request::*)>("version", [](const YaHTTP::Request& req) -> int { return req.version; }, [](YaHTTP::Request& req, int version) { (void) version; });
+ luaCtx.registerMember<std::string(YaHTTP::Request::*)>("method", [](const YaHTTP::Request& req) -> std::string { return req.method; }, [](YaHTTP::Request& req, const std::string& method) { (void) method; });
+ luaCtx.registerMember<std::string(YaHTTP::Request::*)>("body", [](const YaHTTP::Request& req) -> const std::string { return req.body; }, [](YaHTTP::Request& req, const std::string& body) { (void) body; });
+ luaCtx.registerMember<std::unordered_map<std::string, std::string>(YaHTTP::Request::*)>("getvars", [](const YaHTTP::Request& req) {
+ std::unordered_map<std::string, std::string> values;
+ for (const auto& entry : req.getvars) {
+ values.insert({entry.first, entry.second});
+ }
+ return values;
+ }, [](YaHTTP::Request& req, const std::unordered_map<std::string, std::string>& values) { (void) values; });
+ luaCtx.registerMember<std::unordered_map<std::string, std::string>(YaHTTP::Request::*)>("postvars", [](const YaHTTP::Request& req) {
+ std::unordered_map<std::string, std::string> values;
+ for (const auto& entry : req.postvars) {
+ values.insert({entry.first, entry.second});
+ }
+ return values;
+ }, [](YaHTTP::Request& req, const std::unordered_map<std::string, std::string>& values) { (void) values; });
+ luaCtx.registerMember<std::unordered_map<std::string, std::string>(YaHTTP::Request::*)>("headers", [](const YaHTTP::Request& req) {
+ std::unordered_map<std::string, std::string> values;
+ for (const auto& entry : req.headers) {
+ values.insert({entry.first, entry.second});
+ }
+ return values;
+ }, [](YaHTTP::Request& req, const std::unordered_map<std::string, std::string>& values) { (void) values; });
+
+ /* Response */
+ luaCtx.registerMember<std::string(YaHTTP::Response::*)>("body", [](const YaHTTP::Response& resp) -> const std::string { return resp.body; }, [](YaHTTP::Response& resp, const std::string& body) { resp.body = body; });
+ luaCtx.registerMember<int(YaHTTP::Response::*)>("status", [](const YaHTTP::Response& resp) -> int { return resp.status; }, [](YaHTTP::Response& resp, int status) { resp.status = status; });
+ luaCtx.registerMember<std::unordered_map<std::string, std::string>(YaHTTP::Response::*)>("headers", [](const YaHTTP::Response& resp) {
+ std::unordered_map<std::string, std::string> values;
+ for (const auto& entry : resp.headers) {
+ values.insert({entry.first, entry.second});
+ }
+ return values;
+ }, [](YaHTTP::Response& resp, const std::unordered_map<std::string, std::string>& values) {
+ resp.headers.clear();
+ for (const auto& entry : values) {
+ resp.headers.insert({entry.first, entry.second});
+ }
+ });
+}
+
diff --git a/dnsdist-lua.cc b/dnsdist-lua.cc
new file mode 100644
index 0000000..641464c
--- /dev/null
+++ b/dnsdist-lua.cc
@@ -0,0 +1,2860 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <dirent.h>
+#include <fstream>
+
+// for OpenBSD, sys/socket.h needs to come before net/if.h
+#include <sys/socket.h>
+#include <net/if.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <thread>
+
+#include "dnsdist.hh"
+#include "dnsdist-console.hh"
+#include "dnsdist-dynblocks.hh"
+#include "dnsdist-ecs.hh"
+#include "dnsdist-healthchecks.hh"
+#include "dnsdist-lua.hh"
+#ifdef LUAJIT_VERSION
+#include "dnsdist-lua-ffi.hh"
+#endif /* LUAJIT_VERSION */
+#include "dnsdist-nghttp2.hh"
+#include "dnsdist-proxy-protocol.hh"
+#include "dnsdist-rings.hh"
+#include "dnsdist-secpoll.hh"
+#include "dnsdist-session-cache.hh"
+#include "dnsdist-tcp-downstream.hh"
+#include "dnsdist-web.hh"
+
+#include "base64.hh"
+#include "dnswriter.hh"
+#include "dolog.hh"
+#include "lock.hh"
+#include "sodcrypto.hh"
+
+#ifdef HAVE_LIBSSL
+#include "libssl.hh"
+#endif
+
+#include <boost/logic/tribool.hpp>
+#include <boost/lexical_cast.hpp>
+
+#ifdef HAVE_SYSTEMD
+#include <systemd/sd-daemon.h>
+#endif
+
+using std::thread;
+
+static boost::optional<std::vector<std::function<void(void)>>> g_launchWork = boost::none;
+
+boost::tribool g_noLuaSideEffect;
+static bool g_included{false};
+
+/* this is a best effort way to prevent logging calls with no side-effects in the output of delta()
+ Functions can declare setLuaNoSideEffect() and if nothing else does declare a side effect, or nothing
+ has done so before on this invocation, this call won't be part of delta() output */
+void setLuaNoSideEffect()
+{
+ if (g_noLuaSideEffect == false) // there has been a side effect already
+ return;
+ g_noLuaSideEffect = true;
+}
+
+void setLuaSideEffect()
+{
+ g_noLuaSideEffect = false;
+}
+
+bool getLuaNoSideEffect()
+{
+ if (g_noLuaSideEffect) {
+ return true;
+ }
+ return false;
+}
+
+void resetLuaSideEffect()
+{
+ g_noLuaSideEffect = boost::logic::indeterminate;
+}
+
+typedef std::unordered_map<std::string, boost::variant<bool, int, std::string, std::vector<std::pair<int, int>>, std::vector<std::pair<int, std::string>>, std::map<std::string, std::string>>> localbind_t;
+
+static void parseLocalBindVars(boost::optional<localbind_t> vars, bool& reusePort, int& tcpFastOpenQueueSize, std::string& interface, std::set<int>& cpus, int& tcpListenQueueSize, size_t& maxInFlightQueriesPerConnection, size_t& tcpMaxConcurrentConnections)
+{
+ if (vars) {
+ if (vars->count("reusePort")) {
+ reusePort = boost::get<bool>((*vars)["reusePort"]);
+ }
+ if (vars->count("tcpFastOpenQueueSize")) {
+ tcpFastOpenQueueSize = boost::get<int>((*vars)["tcpFastOpenQueueSize"]);
+ }
+ if (vars->count("tcpListenQueueSize")) {
+ tcpListenQueueSize = boost::get<int>((*vars)["tcpListenQueueSize"]);
+ }
+ if (vars->count("maxConcurrentTCPConnections")) {
+ tcpMaxConcurrentConnections = boost::get<int>((*vars)["maxConcurrentTCPConnections"]);
+ }
+ if (vars->count("maxInFlight")) {
+ maxInFlightQueriesPerConnection = boost::get<int>((*vars)["maxInFlight"]);
+ }
+ if (vars->count("interface")) {
+ interface = boost::get<std::string>((*vars)["interface"]);
+ }
+ if (vars->count("cpus")) {
+ for (const auto& cpu : boost::get<std::vector<std::pair<int, int>>>((*vars)["cpus"])) {
+ cpus.insert(cpu.second);
+ }
+ }
+ }
+}
+
+#if defined(HAVE_DNS_OVER_TLS) || defined(HAVE_DNS_OVER_HTTPS)
+static bool loadTLSCertificateAndKeys(const std::string& context, std::vector<std::pair<std::string, std::string>>& pairs, boost::variant<std::string, std::vector<std::pair<int, std::string>>> certFiles, boost::variant<std::string, std::vector<std::pair<int, std::string>>> keyFiles)
+{
+ if (certFiles.type() == typeid(std::string) && keyFiles.type() == typeid(std::string)) {
+ auto certFile = boost::get<std::string>(certFiles);
+ auto keyFile = boost::get<std::string>(keyFiles);
+ pairs.clear();
+ pairs.emplace_back(certFile, keyFile);
+ }
+ else if (certFiles.type() == typeid(std::vector<std::pair<int, std::string>>) && keyFiles.type() == typeid(std::vector<std::pair<int, std::string>>)) {
+ auto certFilesVect = boost::get<std::vector<std::pair<int, std::string>>>(certFiles);
+ auto keyFilesVect = boost::get<std::vector<std::pair<int, std::string>>>(keyFiles);
+ if (certFilesVect.size() == keyFilesVect.size()) {
+ pairs.clear();
+ for (size_t idx = 0; idx < certFilesVect.size(); idx++) {
+ pairs.emplace_back(certFilesVect.at(idx).second, keyFilesVect.at(idx).second);
+ }
+ }
+ else {
+ errlog("Error, mismatching number of certificates and keys in call to %s()!", context);
+ g_outputBuffer = "Error, mismatching number of certificates and keys in call to " + context + "()!";
+ return false;
+ }
+ }
+ else {
+ errlog("Error, mismatching number of certificates and keys in call to %s()!", context);
+ g_outputBuffer = "Error, mismatching number of certificates and keys in call to " + context + "()!";
+ return false;
+ }
+
+ return true;
+}
+
+static void parseTLSConfig(TLSConfig& config, const std::string& context, boost::optional<localbind_t> vars)
+{
+ if (vars->count("ciphers")) {
+ config.d_ciphers = boost::get<const string>((*vars)["ciphers"]);
+ }
+
+ if (vars->count("ciphersTLS13")) {
+ config.d_ciphers13 = boost::get<const string>((*vars)["ciphersTLS13"]);
+ }
+
+#ifdef HAVE_LIBSSL
+ if (vars->count("minTLSVersion")) {
+ config.d_minTLSVersion = libssl_tls_version_from_string(boost::get<const string>((*vars)["minTLSVersion"]));
+ }
+#endif /* HAVE_LIBSSL */
+
+ if (vars->count("ticketKeyFile")) {
+ config.d_ticketKeyFile = boost::get<const string>((*vars)["ticketKeyFile"]);
+ }
+
+ if (vars->count("ticketsKeysRotationDelay")) {
+ config.d_ticketsKeyRotationDelay = boost::get<int>((*vars)["ticketsKeysRotationDelay"]);
+ }
+
+ if (vars->count("numberOfTicketsKeys")) {
+ config.d_numberOfTicketsKeys = boost::get<int>((*vars)["numberOfTicketsKeys"]);
+ }
+
+ if (vars->count("preferServerCiphers")) {
+ config.d_preferServerCiphers = boost::get<bool>((*vars)["preferServerCiphers"]);
+ }
+
+ if (vars->count("sessionTimeout")) {
+ config.d_sessionTimeout = boost::get<int>((*vars)["sessionTimeout"]);
+ }
+
+ if (vars->count("sessionTickets")) {
+ config.d_enableTickets = boost::get<bool>((*vars)["sessionTickets"]);
+ }
+
+ if (vars->count("numberOfStoredSessions")) {
+ auto value = boost::get<int>((*vars)["numberOfStoredSessions"]);
+ if (value < 0) {
+ errlog("Invalid value '%d' for %s() parameter 'numberOfStoredSessions', should be >= 0, dismissing", value, context);
+ g_outputBuffer = "Invalid value '" + std::to_string(value) + "' for " + context + "() parameter 'numberOfStoredSessions', should be >= 0, dismissing";
+ }
+ config.d_maxStoredSessions = value;
+ }
+
+ if (vars->count("ocspResponses")) {
+ auto files = boost::get<std::vector<std::pair<int, std::string>>>((*vars)["ocspResponses"]);
+ for (const auto& file : files) {
+ config.d_ocspFiles.push_back(file.second);
+ }
+ }
+
+ if (vars->count("keyLogFile")) {
+#ifdef HAVE_SSL_CTX_SET_KEYLOG_CALLBACK
+ config.d_keyLogFile = boost::get<const string>((*vars)["keyLogFile"]);
+#else
+ errlog("TLS Key logging has been enabled using the 'keyLogFile' parameter to %s(), but this version of OpenSSL does not support it", context);
+ g_outputBuffer = "TLS Key logging has been enabled using the 'keyLogFile' parameter to " + context + "(), but this version of OpenSSL does not support it";
+#endif
+ }
+
+ if (vars->count("releaseBuffers")) {
+ config.d_releaseBuffers = boost::get<bool>((*vars)["releaseBuffers"]);
+ }
+
+ if (vars->count("enableRenegotiation")) {
+ config.d_enableRenegotiation = boost::get<bool>((*vars)["enableRenegotiation"]);
+ }
+}
+
+#endif // defined(HAVE_DNS_OVER_TLS) || defined(HAVE_DNS_OVER_HTTPS)
+
+static void checkParameterBound(const std::string& parameter, uint64_t value, size_t max = std::numeric_limits<uint16_t>::max())
+{
+ if (value > max) {
+ throw std::runtime_error("The value (" + std::to_string(value) + ") passed to " + parameter + " is too large, the maximum is " + std::to_string(max));
+ }
+}
+
+static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
+{
+ typedef std::unordered_map<std::string, boost::variant<bool, std::string, vector<pair<int, std::string>>, DownstreamState::checkfunc_t>> newserver_t;
+ luaCtx.writeFunction("inClientStartup", [client]() {
+ return client && !g_configurationDone;
+ });
+
+ luaCtx.writeFunction("inConfigCheck", [configCheck]() {
+ return configCheck;
+ });
+
+ luaCtx.writeFunction("newServer",
+ [client, configCheck](boost::variant<string, newserver_t> pvars, boost::optional<int> qps) {
+ setLuaSideEffect();
+
+ newserver_t vars;
+
+ ComboAddress serverAddr;
+ std::string serverAddressStr;
+ if (auto addrStr = boost::get<string>(&pvars)) {
+ serverAddressStr = *addrStr;
+ if (qps) {
+ vars["qps"] = std::to_string(*qps);
+ }
+ }
+ else {
+ vars = boost::get<newserver_t>(pvars);
+ serverAddressStr = boost::get<string>(vars["address"]);
+ }
+
+ try {
+ serverAddr = ComboAddress(serverAddressStr, 53);
+ }
+ catch (const PDNSException& e) {
+ g_outputBuffer = "Error creating new server: " + string(e.reason);
+ errlog("Error creating new server with address %s: %s", serverAddressStr, e.reason);
+ return std::shared_ptr<DownstreamState>();
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = "Error creating new server: " + string(e.what());
+ errlog("Error creating new server with address %s: %s", serverAddressStr, e.what());
+ return std::shared_ptr<DownstreamState>();
+ }
+
+ if (IsAnyAddress(serverAddr)) {
+ g_outputBuffer = "Error creating new server: invalid address for a downstream server.";
+ errlog("Error creating new server: %s is not a valid address for a downstream server", serverAddressStr);
+ return std::shared_ptr<DownstreamState>();
+ }
+
+ ComboAddress sourceAddr;
+ std::string sourceItfName;
+ unsigned int sourceItf = 0;
+ size_t numberOfSockets = 1;
+ std::set<int> cpus;
+
+ if (vars.count("source")) {
+ /* handle source in the following forms:
+ - v4 address ("192.0.2.1")
+ - v6 address ("2001:DB8::1")
+ - interface name ("eth0")
+ - v4 address and interface name ("192.0.2.1@eth0")
+ - v6 address and interface name ("2001:DB8::1@eth0")
+ */
+ const string source = boost::get<string>(vars["source"]);
+ bool parsed = false;
+ std::string::size_type pos = source.find("@");
+ if (pos == std::string::npos) {
+ /* no '@', try to parse that as a valid v4/v6 address */
+ try {
+ sourceAddr = ComboAddress(source);
+ parsed = true;
+ }
+ catch (...) {
+ }
+ }
+
+ if (parsed == false) {
+ /* try to parse as interface name, or v4/v6@itf */
+ sourceItfName = source.substr(pos == std::string::npos ? 0 : pos + 1);
+ unsigned int itfIdx = if_nametoindex(sourceItfName.c_str());
+
+ if (itfIdx != 0) {
+ if (pos == 0 || pos == std::string::npos) {
+ /* "eth0" or "@eth0" */
+ sourceItf = itfIdx;
+ }
+ else {
+ /* "192.0.2.1@eth0" */
+ sourceAddr = ComboAddress(source.substr(0, pos));
+ sourceItf = itfIdx;
+ }
+#ifdef SO_BINDTODEVICE
+ /* we need to retain CAP_NET_RAW to be able to set SO_BINDTODEVICE in the health checks */
+ g_capabilitiesToRetain.insert("CAP_NET_RAW");
+#endif
+ }
+ else {
+ warnlog("Dismissing source %s because '%s' is not a valid interface name", source, sourceItfName);
+ }
+ }
+ }
+
+ if (vars.count("sockets")) {
+ numberOfSockets = std::stoul(boost::get<string>(vars["sockets"]));
+ if (numberOfSockets == 0) {
+ warnlog("Dismissing invalid number of sockets '%s', using 1 instead", boost::get<string>(vars["sockets"]));
+ numberOfSockets = 1;
+ }
+ }
+
+ // create but don't connect the socket in client or check-config modes
+ auto ret = std::make_shared<DownstreamState>(serverAddr, sourceAddr, sourceItf, sourceItfName);
+ if (!(client || configCheck)) {
+ infolog("Added downstream server %s", serverAddr.toStringWithPort());
+ }
+
+ if (vars.count("qps")) {
+ int qpsVal = std::stoi(boost::get<string>(vars["qps"]));
+ ret->qps = QPSLimiter(qpsVal, qpsVal);
+ }
+
+ if (vars.count("order")) {
+ ret->order = std::stoi(boost::get<string>(vars["order"]));
+ }
+
+ if (vars.count("weight")) {
+ try {
+ int weightVal = std::stoi(boost::get<string>(vars["weight"]));
+
+ if (weightVal < 1) {
+ errlog("Error creating new server: downstream weight value must be greater than 0.");
+ return ret;
+ }
+
+ ret->setWeight(weightVal);
+ }
+ catch (const std::exception& e) {
+ // std::stoi will throw an exception if the string isn't in a value int range
+ errlog("Error creating new server: downstream weight value must be between %s and %s", 1, std::numeric_limits<int>::max());
+ return ret;
+ }
+ }
+
+ if (vars.count("retries")) {
+ ret->d_retries = std::stoi(boost::get<string>(vars["retries"]));
+ }
+
+ if (vars.count("checkInterval")) {
+ ret->checkInterval = static_cast<unsigned int>(std::stoul(boost::get<string>(vars["checkInterval"])));
+ }
+
+ if (vars.count("tcpConnectTimeout")) {
+ ret->tcpConnectTimeout = std::stoi(boost::get<string>(vars["tcpConnectTimeout"]));
+ }
+
+ if (vars.count("tcpSendTimeout")) {
+ ret->tcpSendTimeout = std::stoi(boost::get<string>(vars["tcpSendTimeout"]));
+ }
+
+ if (vars.count("tcpRecvTimeout")) {
+ ret->tcpRecvTimeout = std::stoi(boost::get<string>(vars["tcpRecvTimeout"]));
+ }
+
+ if (vars.count("tcpFastOpen")) {
+ bool fastOpen = boost::get<bool>(vars["tcpFastOpen"]);
+ if (fastOpen) {
+#ifdef MSG_FASTOPEN
+ ret->tcpFastOpen = true;
+#else
+ warnlog("TCP Fast Open has been configured on downstream server %s but is not supported", boost::get<string>(vars["address"]));
+#endif
+ }
+ }
+
+ if (vars.count("maxInFlight")) {
+ ret->d_maxInFlightQueriesPerConn = std::stoi(boost::get<string>(vars["maxInFlight"]));
+ }
+
+ if (vars.count("name")) {
+ ret->setName(boost::get<string>(vars["name"]));
+ }
+
+ if (vars.count("id")) {
+ ret->setId(boost::lexical_cast<boost::uuids::uuid>(boost::get<string>(vars["id"])));
+ }
+
+ if (vars.count("checkName")) {
+ ret->checkName = DNSName(boost::get<string>(vars["checkName"]));
+ }
+
+ if (vars.count("checkType")) {
+ ret->checkType = boost::get<string>(vars["checkType"]);
+ }
+
+ if (vars.count("checkClass")) {
+ ret->checkClass = std::stoi(boost::get<string>(vars["checkClass"]));
+ }
+
+ if (vars.count("checkFunction")) {
+ ret->checkFunction = boost::get<DownstreamState::checkfunc_t>(vars["checkFunction"]);
+ }
+
+ if (vars.count("checkTimeout")) {
+ ret->checkTimeout = std::stoi(boost::get<string>(vars["checkTimeout"]));
+ }
+
+ if (vars.count("checkTCP")) {
+ ret->d_tcpCheck = boost::get<bool>(vars.at("checkTCP"));
+ }
+
+ if (vars.count("setCD")) {
+ ret->setCD = boost::get<bool>(vars["setCD"]);
+ }
+
+ if (vars.count("mustResolve")) {
+ ret->mustResolve = boost::get<bool>(vars["mustResolve"]);
+ }
+
+ if (vars.count("useClientSubnet")) {
+ ret->useECS = boost::get<bool>(vars["useClientSubnet"]);
+ }
+
+ if (vars.count("useProxyProtocol")) {
+ ret->useProxyProtocol = boost::get<bool>(vars["useProxyProtocol"]);
+ }
+
+ if (vars.count("disableZeroScope")) {
+ ret->disableZeroScope = boost::get<bool>(vars["disableZeroScope"]);
+ }
+
+ if (vars.count("ipBindAddrNoPort")) {
+ ret->ipBindAddrNoPort = boost::get<bool>(vars["ipBindAddrNoPort"]);
+ }
+
+ if (vars.count("addXPF")) {
+ ret->xpfRRCode = std::stoi(boost::get<string>(vars["addXPF"]));
+ }
+
+ if (vars.count("maxCheckFailures")) {
+ ret->maxCheckFailures = std::stoi(boost::get<string>(vars["maxCheckFailures"]));
+ }
+
+ if (vars.count("rise")) {
+ ret->minRiseSuccesses = std::stoi(boost::get<string>(vars["rise"]));
+ }
+
+ if (vars.count("reconnectOnUp")) {
+ ret->reconnectOnUp = boost::get<bool>(vars["reconnectOnUp"]);
+ }
+
+ if (vars.count("cpus")) {
+ for (const auto& cpu : boost::get<vector<pair<int, string>>>(vars["cpus"])) {
+ cpus.insert(std::stoi(cpu.second));
+ }
+ }
+
+ if (vars.count("tcpOnly")) {
+ ret->d_tcpOnly = boost::get<bool>(vars.at("tcpOnly"));
+ }
+
+ if (vars.count("tls")) {
+ TLSContextParameters tlsParams;
+ std::string ciphers;
+ std::string ciphers13;
+
+ tlsParams.d_provider = boost::get<string>(vars.at("tls"));
+
+ if (vars.count("ciphers")) {
+ tlsParams.d_ciphers = boost::get<string>(vars.at("ciphers"));
+ }
+ if (vars.count("ciphers13")) {
+ tlsParams.d_ciphers13 = boost::get<string>(vars.at("ciphers13"));
+ }
+ if (vars.count("caStore")) {
+ tlsParams.d_caStore = boost::get<string>(vars.at("caStore"));
+ }
+ if (vars.count("validateCertificates")) {
+ tlsParams.d_validateCertificates = boost::get<bool>(vars.at("validateCertificates"));
+ }
+ if (vars.count("releaseBuffers")) {
+ tlsParams.d_releaseBuffers = boost::get<bool>(vars.at("releaseBuffers"));
+ }
+ if (vars.count("enableRenegotiation")) {
+ tlsParams.d_enableRenegotiation = boost::get<bool>(vars.at("enableRenegotiation"));
+ }
+ if (vars.count("subjectName")) {
+ ret->d_tlsSubjectName = boost::get<string>(vars.at("subjectName"));
+ }
+
+ ret->d_tlsCtx = getTLSContext(tlsParams);
+
+ if (vars.count("dohPath")) {
+#ifdef HAVE_NGHTTP2
+ ret->d_dohPath = boost::get<string>(vars.at("dohPath"));
+ if (ret->d_tlsCtx) {
+ setupDoHClientProtocolNegotiation(ret->d_tlsCtx);
+ }
+
+ if (g_configurationDone && g_outgoingDoHWorkerThreads && *g_outgoingDoHWorkerThreads == 0) {
+ throw std::runtime_error("Error: setOutgoingDoHWorkerThreads() is set to 0 so no outgoing DoH worker thread is available to serve queries");
+ }
+
+ if (!g_outgoingDoHWorkerThreads || *g_outgoingDoHWorkerThreads == 0) {
+ g_outgoingDoHWorkerThreads = 1;
+ }
+
+ if (vars.count("addXForwardedHeaders")) {
+ ret->d_addXForwardedHeaders = boost::get<bool>(vars.at("addXForwardedHeaders"));
+ }
+#else /* HAVE_NGHTTP2 */
+ throw std::runtime_error("Outgoing DNS over HTTPS support requested (via 'dohPath' on newServer()) but nghttp2 support is not available");
+#endif /* HAVE_NGHTTP2 */
+ }
+ else {
+ setupDoTProtocolNegotiation(ret->d_tlsCtx);
+ }
+ }
+
+ if (!ret->isTCPOnly() && !(client || configCheck)) {
+ if (!IsAnyAddress(ret->remote)) {
+ ret->connectUDPSockets(numberOfSockets);
+ }
+ }
+
+ /* this needs to be done _AFTER_ the order has been set,
+ since the server are kept ordered inside the pool */
+ auto localPools = g_pools.getCopy();
+ if (vars.count("pool")) {
+ if (auto* pool = boost::get<string>(&vars["pool"])) {
+ ret->pools.insert(*pool);
+ }
+ else {
+ auto pools = boost::get<vector<pair<int, string>>>(vars["pool"]);
+ for (auto& p : pools) {
+ ret->pools.insert(p.second);
+ }
+ }
+ for (const auto& poolName : ret->pools) {
+ addServerToPool(localPools, poolName, ret);
+ }
+ }
+ else {
+ addServerToPool(localPools, "", ret);
+ }
+ g_pools.setState(localPools);
+
+ if (ret->connected) {
+ ret->threadStarted.test_and_set();
+
+ if (g_launchWork) {
+ g_launchWork->push_back([ret, cpus]() {
+ ret->tid = thread(responderThread, ret);
+ if (!cpus.empty()) {
+ mapThreadToCPUList(ret->tid.native_handle(), cpus);
+ }
+ });
+ }
+ else {
+ ret->tid = thread(responderThread, ret);
+ if (!cpus.empty()) {
+ mapThreadToCPUList(ret->tid.native_handle(), cpus);
+ }
+ }
+ }
+
+ auto states = g_dstates.getCopy();
+ states.push_back(ret);
+ std::stable_sort(states.begin(), states.end(), [](const decltype(ret)& a, const decltype(ret)& b) {
+ return a->order < b->order;
+ });
+ g_dstates.setState(states);
+ return ret;
+ });
+
+ luaCtx.writeFunction("rmServer",
+ [](boost::variant<std::shared_ptr<DownstreamState>, int, std::string> var) {
+ setLuaSideEffect();
+ shared_ptr<DownstreamState> server = nullptr;
+ auto states = g_dstates.getCopy();
+ if (auto* rem = boost::get<shared_ptr<DownstreamState>>(&var)) {
+ server = *rem;
+ }
+ else if (auto str = boost::get<std::string>(&var)) {
+ const auto uuid = getUniqueID(*str);
+ for (auto& state : states) {
+ if (state->id == uuid) {
+ server = state;
+ }
+ }
+ }
+ else {
+ int idx = boost::get<int>(var);
+ server = states.at(idx);
+ }
+ if (!server) {
+ throw std::runtime_error("unable to locate the requested server");
+ }
+ auto localPools = g_pools.getCopy();
+ for (const string& poolName : server->pools) {
+ removeServerFromPool(localPools, poolName, server);
+ }
+ /* the server might also be in the default pool */
+ removeServerFromPool(localPools, "", server);
+ g_pools.setState(localPools);
+ states.erase(remove(states.begin(), states.end(), server), states.end());
+ g_dstates.setState(states);
+ server->stop();
+ });
+
+ luaCtx.writeFunction("truncateTC", [](bool tc) { setLuaSideEffect(); g_truncateTC=tc; });
+ luaCtx.writeFunction("fixupCase", [](bool fu) { setLuaSideEffect(); g_fixupCase=fu; });
+
+ luaCtx.writeFunction("addACL", [](const std::string& domain) {
+ setLuaSideEffect();
+ g_ACL.modify([domain](NetmaskGroup& nmg) { nmg.addMask(domain); });
+ });
+
+ luaCtx.writeFunction("rmACL", [](const std::string& netmask) {
+ setLuaSideEffect();
+ g_ACL.modify([netmask](NetmaskGroup& nmg) { nmg.deleteMask(netmask); });
+ });
+
+ luaCtx.writeFunction("setLocal", [client](const std::string& addr, boost::optional<localbind_t> vars) {
+ setLuaSideEffect();
+ if (client)
+ return;
+ if (g_configurationDone) {
+ g_outputBuffer = "setLocal cannot be used at runtime!\n";
+ return;
+ }
+ bool reusePort = false;
+ int tcpFastOpenQueueSize = 0;
+ int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
+ size_t tcpMaxConcurrentConnections = 0;
+ std::string interface;
+ std::set<int> cpus;
+
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn, tcpMaxConcurrentConnections);
+
+ try {
+ ComboAddress loc(addr, 53);
+ for (auto it = g_frontends.begin(); it != g_frontends.end();) {
+ /* DoH, DoT and DNSCrypt frontends are separate */
+ if ((*it)->tlsFrontend == nullptr && (*it)->dnscryptCtx == nullptr && (*it)->dohFrontend == nullptr) {
+ it = g_frontends.erase(it);
+ }
+ else {
+ ++it;
+ }
+ }
+
+ // only works pre-startup, so no sync necessary
+ g_frontends.push_back(std::make_unique<ClientState>(loc, false, reusePort, tcpFastOpenQueueSize, interface, cpus));
+ auto tcpCS = std::make_unique<ClientState>(loc, true, reusePort, tcpFastOpenQueueSize, interface, cpus);
+ if (tcpListenQueueSize > 0) {
+ tcpCS->tcpListenQueueSize = tcpListenQueueSize;
+ }
+ if (maxInFlightQueriesPerConn > 0) {
+ tcpCS->d_maxInFlightQueriesPerConn = maxInFlightQueriesPerConn;
+ }
+ if (tcpMaxConcurrentConnections > 0) {
+ tcpCS->d_tcpConcurrentConnectionsLimit = tcpMaxConcurrentConnections;
+ }
+
+ g_frontends.push_back(std::move(tcpCS));
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = "Error: " + string(e.what()) + "\n";
+ }
+ });
+
+ luaCtx.writeFunction("addLocal", [client](const std::string& addr, boost::optional<localbind_t> vars) {
+ setLuaSideEffect();
+ if (client)
+ return;
+ if (g_configurationDone) {
+ g_outputBuffer = "addLocal cannot be used at runtime!\n";
+ return;
+ }
+ bool reusePort = false;
+ int tcpFastOpenQueueSize = 0;
+ int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
+ size_t tcpMaxConcurrentConnections = 0;
+ std::string interface;
+ std::set<int> cpus;
+
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn, tcpMaxConcurrentConnections);
+
+ try {
+ ComboAddress loc(addr, 53);
+ // only works pre-startup, so no sync necessary
+ g_frontends.push_back(std::make_unique<ClientState>(loc, false, reusePort, tcpFastOpenQueueSize, interface, cpus));
+ auto tcpCS = std::make_unique<ClientState>(loc, true, reusePort, tcpFastOpenQueueSize, interface, cpus);
+ if (tcpListenQueueSize > 0) {
+ tcpCS->tcpListenQueueSize = tcpListenQueueSize;
+ }
+ if (maxInFlightQueriesPerConn > 0) {
+ tcpCS->d_maxInFlightQueriesPerConn = maxInFlightQueriesPerConn;
+ }
+ if (tcpMaxConcurrentConnections > 0) {
+ tcpCS->d_tcpConcurrentConnectionsLimit = tcpMaxConcurrentConnections;
+ }
+ g_frontends.push_back(std::move(tcpCS));
+ }
+ catch (std::exception& e) {
+ g_outputBuffer = "Error: " + string(e.what()) + "\n";
+ errlog("Error while trying to listen on %s: %s\n", addr, string(e.what()));
+ }
+ });
+
+ luaCtx.writeFunction("setACL", [](boost::variant<string, vector<pair<int, string>>> inp) {
+ setLuaSideEffect();
+ NetmaskGroup nmg;
+ if (auto str = boost::get<string>(&inp)) {
+ nmg.addMask(*str);
+ }
+ else
+ for (const auto& p : boost::get<vector<pair<int, string>>>(inp)) {
+ nmg.addMask(p.second);
+ }
+ g_ACL.setState(nmg);
+ });
+
+ luaCtx.writeFunction("setACLFromFile", [](const std::string& file) {
+ setLuaSideEffect();
+ NetmaskGroup nmg;
+
+ ifstream ifs(file);
+ if (!ifs) {
+ throw std::runtime_error("Could not open '" + file + "': " + stringerror());
+ }
+
+ string::size_type pos;
+ string line;
+ while (getline(ifs, line)) {
+ pos = line.find('#');
+ if (pos != string::npos)
+ line.resize(pos);
+ boost::trim(line);
+ if (line.empty())
+ continue;
+
+ nmg.addMask(line);
+ }
+
+ g_ACL.setState(nmg);
+ });
+
+ luaCtx.writeFunction("showACL", []() {
+ setLuaNoSideEffect();
+ vector<string> vec;
+
+ g_ACL.getLocal()->toStringVector(&vec);
+
+ for (const auto& s : vec)
+ g_outputBuffer += s + "\n";
+ });
+
+ luaCtx.writeFunction("shutdown", []() {
+#ifdef HAVE_SYSTEMD
+ sd_notify(0, "STOPPING=1");
+#endif /* HAVE_SYSTEMD */
+#if 0
+ // Useful for debugging leaks, but might lead to race under load
+ // since other threads are still running.
+ for(auto& frontend : g_tlslocals) {
+ frontend->cleanup();
+ }
+ g_tlslocals.clear();
+ g_rings.clear();
+#endif /* 0 */
+ _exit(0);
+ });
+
+ typedef std::unordered_map<std::string, boost::variant<bool, std::string>> showserversopts_t;
+
+ luaCtx.writeFunction("showServers", [](boost::optional<showserversopts_t> vars) {
+ setLuaNoSideEffect();
+ bool showUUIDs = false;
+ if (vars) {
+ if (vars->count("showUUIDs")) {
+ showUUIDs = boost::get<bool>((*vars)["showUUIDs"]);
+ }
+ }
+ try {
+ ostringstream ret;
+ boost::format fmt;
+ if (showUUIDs) {
+ fmt = boost::format("%1$-3d %15$-36s %2$-20.20s %|62t|%3% %|92t|%4$5s %|88t|%5$7.1f %|103t|%6$7d %|106t|%7$3d %|115t|%8$2d %|117t|%9$10d %|123t|%10$7d %|128t|%11$5.1f %|146t|%12$5.1f %|152t|%13$11d %14%");
+ // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ ret << (fmt % "#" % "Name" % "Address" % "State" % "Qps" % "Qlim" % "Ord" % "Wt" % "Queries" % "Drops" % "Drate" % "Lat" % "Outstanding" % "Pools" % "UUID") << endl;
+ }
+ else {
+ fmt = boost::format("%1$-3d %2$-20.20s %|25t|%3% %|55t|%4$5s %|51t|%5$7.1f %|66t|%6$7d %|69t|%7$3d %|78t|%8$2d %|80t|%9$10d %|86t|%10$7d %|91t|%11$5.1f %|109t|%12$5.1f %|115t|%13$11d %14%");
+ ret << (fmt % "#" % "Name" % "Address" % "State" % "Qps" % "Qlim" % "Ord" % "Wt" % "Queries" % "Drops" % "Drate" % "Lat" % "Outstanding" % "Pools") << endl;
+ }
+
+ uint64_t totQPS{0}, totQueries{0}, totDrops{0};
+ int counter = 0;
+ auto states = g_dstates.getLocal();
+ for (const auto& s : *states) {
+ string status = s->getStatus();
+ string pools;
+ for (auto& p : s->pools) {
+ if (!pools.empty())
+ pools += " ";
+ pools += p;
+ }
+ if (showUUIDs) {
+ ret << (fmt % counter % s->getName() % s->remote.toStringWithPort() % status % s->queryLoad % s->qps.getRate() % s->order % s->weight % s->queries.load() % s->reuseds.load() % (s->dropRate) % (s->latencyUsec / 1000.0) % s->outstanding.load() % pools % s->id) << endl;
+ }
+ else {
+ ret << (fmt % counter % s->getName() % s->remote.toStringWithPort() % status % s->queryLoad % s->qps.getRate() % s->order % s->weight % s->queries.load() % s->reuseds.load() % (s->dropRate) % (s->latencyUsec / 1000.0) % s->outstanding.load() % pools) << endl;
+ }
+ totQPS += s->queryLoad;
+ totQueries += s->queries.load();
+ totDrops += s->reuseds.load();
+ ++counter;
+ }
+ if (showUUIDs) {
+ ret << (fmt % "All" % "" % "" % ""
+ % (double)totQPS % "" % "" % "" % totQueries % totDrops % "" % "" % "" % "" % "")
+ << endl;
+ }
+ else {
+ ret << (fmt % "All" % "" % "" % ""
+ % (double)totQPS % "" % "" % "" % totQueries % totDrops % "" % "" % "" % "")
+ << endl;
+ }
+
+ g_outputBuffer = ret.str();
+ }
+ catch (std::exception& e) {
+ g_outputBuffer = e.what();
+ throw;
+ }
+ });
+
+ luaCtx.writeFunction("getServers", []() {
+ setLuaNoSideEffect();
+ vector<pair<int, std::shared_ptr<DownstreamState>>> ret;
+ int count = 1;
+ for (const auto& s : g_dstates.getCopy()) {
+ ret.push_back(make_pair(count++, s));
+ }
+ return ret;
+ });
+
+ luaCtx.writeFunction("getPoolServers", [](string pool) {
+ const auto poolServers = getDownstreamCandidates(g_pools.getCopy(), pool);
+ return *poolServers;
+ });
+
+ luaCtx.writeFunction("getServer", [client](boost::variant<unsigned int, std::string> i) {
+ if (client) {
+ return std::make_shared<DownstreamState>(ComboAddress());
+ }
+ auto states = g_dstates.getCopy();
+ if (auto str = boost::get<std::string>(&i)) {
+ const auto uuid = getUniqueID(*str);
+ for (auto& state : states) {
+ if (state->id == uuid) {
+ return state;
+ }
+ }
+ }
+ else if (auto pos = boost::get<unsigned int>(&i)) {
+ return states.at(*pos);
+ }
+
+ g_outputBuffer = "Error: no rule matched\n";
+ return std::shared_ptr<DownstreamState>(nullptr);
+ });
+
+ luaCtx.writeFunction("carbonServer", [](const std::string& address, boost::optional<string> ourName, boost::optional<unsigned int> interval, boost::optional<string> namespace_name, boost::optional<string> instance_name) {
+ setLuaSideEffect();
+ auto ours = g_carbon.getCopy();
+ ours.push_back({ComboAddress(address, 2003),
+ (namespace_name && !namespace_name->empty()) ? *namespace_name : "dnsdist",
+ ourName ? *ourName : "",
+ (instance_name && !instance_name->empty()) ? *instance_name : "main",
+ interval ? *interval : 30});
+ g_carbon.setState(ours);
+ });
+
+ luaCtx.writeFunction("webserver", [client, configCheck](const std::string& address, boost::optional<std::string> password, boost::optional<std::string> apiKey, const boost::optional<std::map<std::string, std::string>> customHeaders, const boost::optional<std::string> acl) {
+ setLuaSideEffect();
+ ComboAddress local;
+ try {
+ local = ComboAddress(address);
+ }
+ catch (const PDNSException& e) {
+ throw std::runtime_error(std::string("Error parsing the bind address for the webserver: ") + e.reason);
+ }
+
+ if (client || configCheck) {
+ return;
+ }
+
+ if (password || apiKey || customHeaders || acl) {
+ warnlog("Passing additional parameters to 'webserver()' is deprecated, please use 'setWebserverConfig()' instead.");
+ }
+
+ try {
+ int sock = SSocket(local.sin4.sin_family, SOCK_STREAM, 0);
+ SSetsockopt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
+ SBind(sock, local);
+ SListen(sock, 5);
+ auto launch = [sock, local, password, apiKey, customHeaders, acl]() {
+ if (password) {
+ auto holder = make_unique<CredentialsHolder>(std::string(*password), false);
+ if (!holder->wasHashed() && holder->isHashingAvailable()) {
+ infolog("Passing a plain-text password to 'webserver()' is deprecated, please use 'setWebserverConfig()' instead and consider generating a hashed password using 'hashPassword()'.");
+ }
+
+ setWebserverPassword(std::move(holder));
+ }
+
+ if (apiKey) {
+ auto holder = make_unique<CredentialsHolder>(std::string(*apiKey), false);
+ setWebserverAPIKey(std::move(holder));
+ }
+
+ if (customHeaders) {
+ setWebserverCustomHeaders(customHeaders);
+ }
+
+ if (acl) {
+ setWebserverACL(*acl);
+ }
+ thread t(dnsdistWebserverThread, sock, local);
+ t.detach();
+ };
+ if (g_launchWork) {
+ g_launchWork->push_back(launch);
+ }
+ else {
+ launch();
+ }
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = "Unable to bind to webserver socket on " + local.toStringWithPort() + ": " + e.what();
+ errlog("Unable to bind to webserver socket on %s: %s", local.toStringWithPort(), e.what());
+ }
+ });
+
+ typedef std::unordered_map<std::string, boost::variant<bool, std::string, std::map<std::string, std::string>>> webserveropts_t;
+
+ luaCtx.writeFunction("setWebserverConfig", [](boost::optional<webserveropts_t> vars) {
+ setLuaSideEffect();
+
+ if (!vars) {
+ return;
+ }
+
+ bool hashPlaintextCredentials = false;
+ if (vars->count("hashPlaintextCredentials")) {
+ hashPlaintextCredentials = boost::get<bool>(vars->at("hashPlaintextCredentials"));
+ }
+
+ if (vars->count("password")) {
+ std::string password = boost::get<std::string>(vars->at("password"));
+ auto holder = make_unique<CredentialsHolder>(std::move(password), hashPlaintextCredentials);
+ if (!holder->wasHashed() && holder->isHashingAvailable()) {
+ infolog("Passing a plain-text password via the 'password' parameter to 'setWebserverConfig()' is not advised, please consider generating a hashed one using 'hashPassword()' instead.");
+ }
+
+ setWebserverPassword(std::move(holder));
+ }
+
+ if (vars->count("apiKey")) {
+ std::string apiKey = boost::get<std::string>(vars->at("apiKey"));
+ auto holder = make_unique<CredentialsHolder>(std::move(apiKey), hashPlaintextCredentials);
+ if (!holder->wasHashed() && holder->isHashingAvailable()) {
+ infolog("Passing a plain-text API key via the 'apiKey' parameter to 'setWebserverConfig()' is not advised, please consider generating a hashed one using 'hashPassword()' instead.");
+ }
+
+ setWebserverAPIKey(std::move(holder));
+ }
+
+ if (vars->count("acl")) {
+ const std::string acl = boost::get<std::string>(vars->at("acl"));
+
+ setWebserverACL(acl);
+ }
+
+ if (vars->count("customHeaders")) {
+ const boost::optional<std::map<std::string, std::string>> headers = boost::get<std::map<std::string, std::string>>(vars->at("customHeaders"));
+
+ setWebserverCustomHeaders(headers);
+ }
+
+ if (vars->count("statsRequireAuthentication")) {
+ setWebserverStatsRequireAuthentication(boost::get<bool>(vars->at("statsRequireAuthentication")));
+ }
+
+ if (vars->count("maxConcurrentConnections")) {
+ setWebserverMaxConcurrentConnections(std::stoi(boost::get<std::string>(vars->at("maxConcurrentConnections"))));
+ }
+ });
+
+ luaCtx.writeFunction("showWebserverConfig", []() {
+ setLuaNoSideEffect();
+ return getWebserverConfig();
+ });
+
+ luaCtx.writeFunction("hashPassword", [](const std::string& password, boost::optional<uint64_t> workFactor) {
+ if (workFactor) {
+ return hashPassword(password, *workFactor, CredentialsHolder::s_defaultParallelFactor, CredentialsHolder::s_defaultBlockSize);
+ }
+ return hashPassword(password);
+ });
+
+ luaCtx.writeFunction("controlSocket", [client, configCheck](const std::string& str) {
+ setLuaSideEffect();
+ ComboAddress local(str, 5199);
+
+ if (client || configCheck) {
+ g_serverControl = local;
+ return;
+ }
+
+ g_consoleEnabled = true;
+#ifdef HAVE_LIBSODIUM
+ if (g_configurationDone && g_consoleKey.empty()) {
+ warnlog("Warning, the console has been enabled via 'controlSocket()' but no key has been set with 'setKey()' so all connections will fail until a key has been set");
+ }
+#endif
+
+ try {
+ int sock = SSocket(local.sin4.sin_family, SOCK_STREAM, 0);
+ SSetsockopt(sock, SOL_SOCKET, SO_REUSEADDR, 1);
+ SBind(sock, local);
+ SListen(sock, 5);
+ auto launch = [sock, local]() {
+ thread t(controlThread, sock, local);
+ t.detach();
+ };
+ if (g_launchWork) {
+ g_launchWork->push_back(launch);
+ }
+ else {
+ launch();
+ }
+ }
+ catch (std::exception& e) {
+ g_outputBuffer = "Unable to bind to control socket on " + local.toStringWithPort() + ": " + e.what();
+ errlog("Unable to bind to control socket on %s: %s", local.toStringWithPort(), e.what());
+ }
+ });
+
+ luaCtx.writeFunction("addConsoleACL", [](const std::string& netmask) {
+ setLuaSideEffect();
+#ifndef HAVE_LIBSODIUM
+ warnlog("Allowing remote access to the console while libsodium support has not been enabled is not secure, and will result in cleartext communications");
+#endif
+
+ g_consoleACL.modify([netmask](NetmaskGroup& nmg) { nmg.addMask(netmask); });
+ });
+
+ luaCtx.writeFunction("setConsoleACL", [](boost::variant<string, vector<pair<int, string>>> inp) {
+ setLuaSideEffect();
+
+#ifndef HAVE_LIBSODIUM
+ warnlog("Allowing remote access to the console while libsodium support has not been enabled is not secure, and will result in cleartext communications");
+#endif
+
+ NetmaskGroup nmg;
+ if (auto str = boost::get<string>(&inp)) {
+ nmg.addMask(*str);
+ }
+ else
+ for (const auto& p : boost::get<vector<pair<int, string>>>(inp)) {
+ nmg.addMask(p.second);
+ }
+ g_consoleACL.setState(nmg);
+ });
+
+ luaCtx.writeFunction("showConsoleACL", []() {
+ setLuaNoSideEffect();
+
+#ifndef HAVE_LIBSODIUM
+ warnlog("Allowing remote access to the console while libsodium support has not been enabled is not secure, and will result in cleartext communications");
+#endif
+
+ vector<string> vec;
+ g_consoleACL.getLocal()->toStringVector(&vec);
+
+ for (const auto& s : vec) {
+ g_outputBuffer += s + "\n";
+ }
+ });
+
+ luaCtx.writeFunction("setConsoleMaximumConcurrentConnections", [](size_t max) {
+ setLuaSideEffect();
+ setConsoleMaximumConcurrentConnections(max);
+ });
+
+ luaCtx.writeFunction("clearQueryCounters", []() {
+ unsigned int size{0};
+ {
+ auto records = g_qcount.records.write_lock();
+ size = records->size();
+ records->clear();
+ }
+
+ boost::format fmt("%d records cleared from query counter buffer\n");
+ g_outputBuffer = (fmt % size).str();
+ });
+
+ luaCtx.writeFunction("getQueryCounters", [](boost::optional<unsigned int> optMax) {
+ setLuaNoSideEffect();
+ auto records = g_qcount.records.read_lock();
+ g_outputBuffer = "query counting is currently: ";
+ g_outputBuffer += g_qcount.enabled ? "enabled" : "disabled";
+ g_outputBuffer += (boost::format(" (%d records in buffer)\n") % records->size()).str();
+
+ boost::format fmt("%-3d %s: %d request(s)\n");
+ unsigned int max = optMax ? *optMax : 10;
+ unsigned int index{1};
+ for (auto it = records->begin(); it != records->end() && index <= max; ++it, ++index) {
+ g_outputBuffer += (fmt % index % it->first % it->second).str();
+ }
+ });
+
+ luaCtx.writeFunction("setQueryCount", [](bool enabled) { g_qcount.enabled = enabled; });
+
+ luaCtx.writeFunction("setQueryCountFilter", [](QueryCountFilter func) {
+ g_qcount.filter = func;
+ });
+
+ luaCtx.writeFunction("makeKey", []() {
+ setLuaNoSideEffect();
+ g_outputBuffer = "setKey(" + newKey() + ")\n";
+ });
+
+ luaCtx.writeFunction("setKey", [](const std::string& key) {
+ if (!g_configurationDone && !g_consoleKey.empty()) { // this makes sure the commandline -k key prevails over dnsdist.conf
+ return; // but later setKeys() trump the -k value again
+ }
+#ifndef HAVE_LIBSODIUM
+ warnlog("Calling setKey() while libsodium support has not been enabled is not secure, and will result in cleartext communications");
+#endif
+
+ setLuaSideEffect();
+ string newkey;
+ if (B64Decode(key, newkey) < 0) {
+ g_outputBuffer = string("Unable to decode ") + key + " as Base64";
+ errlog("%s", g_outputBuffer);
+ }
+ else
+ g_consoleKey = newkey;
+ });
+
+ luaCtx.writeFunction("clearConsoleHistory", []() {
+ clearConsoleHistory();
+ });
+
+ luaCtx.writeFunction("testCrypto", [](boost::optional<string> optTestMsg) {
+ setLuaNoSideEffect();
+#ifdef HAVE_LIBSODIUM
+ try {
+ string testmsg;
+
+ if (optTestMsg) {
+ testmsg = *optTestMsg;
+ }
+ else {
+ testmsg = "testStringForCryptoTests";
+ }
+
+ SodiumNonce sn, sn2;
+ sn.init();
+ sn2 = sn;
+ string encrypted = sodEncryptSym(testmsg, g_consoleKey, sn);
+ string decrypted = sodDecryptSym(encrypted, g_consoleKey, sn2);
+
+ sn.increment();
+ sn2.increment();
+
+ encrypted = sodEncryptSym(testmsg, g_consoleKey, sn);
+ decrypted = sodDecryptSym(encrypted, g_consoleKey, sn2);
+
+ if (testmsg == decrypted)
+ g_outputBuffer = "Everything is ok!\n";
+ else
+ g_outputBuffer = "Crypto failed.. (the decoded value does not match the cleartext one)\n";
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = "Crypto failed: " + std::string(e.what()) + "\n";
+ }
+ catch (...) {
+ g_outputBuffer = "Crypto failed..\n";
+ }
+#else
+ g_outputBuffer = "Crypto not available.\n";
+#endif
+ });
+
+ luaCtx.writeFunction("setTCPRecvTimeout", [](int timeout) { g_tcpRecvTimeout = timeout; });
+
+ luaCtx.writeFunction("setTCPSendTimeout", [](int timeout) { g_tcpSendTimeout = timeout; });
+
+ luaCtx.writeFunction("setUDPTimeout", [](int timeout) { g_udpTimeout = timeout; });
+
+ luaCtx.writeFunction("setMaxUDPOutstanding", [](uint64_t max) {
+ if (!g_configurationDone) {
+ checkParameterBound("setMaxUDPOutstanding", max);
+ g_maxOutstanding = max;
+ }
+ else {
+ g_outputBuffer = "Max UDP outstanding cannot be altered at runtime!\n";
+ }
+ });
+
+ luaCtx.writeFunction("setMaxTCPClientThreads", [](uint64_t max) {
+ if (!g_configurationDone) {
+ g_maxTCPClientThreads = max;
+ }
+ else {
+ g_outputBuffer = "Maximum TCP client threads count cannot be altered at runtime!\n";
+ }
+ });
+
+ luaCtx.writeFunction("setMaxTCPQueuedConnections", [](uint64_t max) {
+ if (!g_configurationDone) {
+ g_maxTCPQueuedConnections = max;
+ }
+ else {
+ g_outputBuffer = "The maximum number of queued TCP connections cannot be altered at runtime!\n";
+ }
+ });
+
+ luaCtx.writeFunction("setMaxTCPQueriesPerConnection", [](size_t max) {
+ if (!g_configurationDone) {
+ g_maxTCPQueriesPerConn = max;
+ }
+ else {
+ g_outputBuffer = "The maximum number of queries per TCP connection cannot be altered at runtime!\n";
+ }
+ });
+
+ luaCtx.writeFunction("setMaxTCPConnectionsPerClient", [](size_t max) {
+ if (!g_configurationDone) {
+ g_maxTCPConnectionsPerClient = max;
+ }
+ else {
+ g_outputBuffer = "The maximum number of TCP connection per client cannot be altered at runtime!\n";
+ }
+ });
+
+ luaCtx.writeFunction("setMaxTCPConnectionDuration", [](size_t max) {
+ if (!g_configurationDone) {
+ g_maxTCPConnectionDuration = max;
+ }
+ else {
+ g_outputBuffer = "The maximum duration of a TCP connection cannot be altered at runtime!\n";
+ }
+ });
+
+ luaCtx.writeFunction("setMaxCachedTCPConnectionsPerDownstream", [](size_t max) {
+ DownstreamTCPConnectionsManager::setMaxIdleConnectionsPerDownstream(max);
+ });
+
+ luaCtx.writeFunction("setMaxIdleDoHConnectionsPerDownstream", [](size_t max) {
+ setDoHDownstreamMaxIdleConnectionsPerBackend(max);
+ });
+
+ luaCtx.writeFunction("setOutgoingDoHWorkerThreads", [](uint64_t workers) {
+ if (!g_configurationDone) {
+ g_outgoingDoHWorkerThreads = workers;
+ }
+ else {
+ g_outputBuffer = "The amount of outgoing DoH worker threads cannot be altered at runtime!\n";
+ }
+ });
+
+ luaCtx.writeFunction("setOutgoingTLSSessionsCacheMaxTicketsPerBackend", [](uint64_t max) {
+ if (g_configurationDone) {
+ g_outputBuffer = "setOutgoingTLSSessionsCacheMaxTicketsPerBackend() cannot be called at runtime!\n";
+ return;
+ }
+ TLSSessionCache::setMaxTicketsPerBackend(max);
+ });
+
+ luaCtx.writeFunction("setOutgoingTLSSessionsCacheCleanupDelay", [](time_t delay) {
+ if (g_configurationDone) {
+ g_outputBuffer = "setOutgoingTLSSessionsCacheCleanupDelay() cannot be called at runtime!\n";
+ return;
+ }
+ TLSSessionCache::setCleanupDelay(delay);
+ });
+
+ luaCtx.writeFunction("setOutgoingTLSSessionsCacheMaxTicketValidity", [](time_t validity) {
+ if (g_configurationDone) {
+ g_outputBuffer = "setOutgoingTLSSessionsCacheMaxTicketValidity() cannot be called at runtime!\n";
+ return;
+ }
+ TLSSessionCache::setSessionValidity(validity);
+ });
+
+ luaCtx.writeFunction("getOutgoingTLSSessionCacheSize", []() {
+ setLuaNoSideEffect();
+ return g_sessionCache.getSize();
+ });
+
+ luaCtx.writeFunction("setCacheCleaningDelay", [](uint64_t delay) {
+ checkParameterBound("setCacheCleaningDelay", delay, std::numeric_limits<uint32_t>::max());
+ g_cacheCleaningDelay = delay;
+ });
+
+ luaCtx.writeFunction("setCacheCleaningPercentage", [](uint16_t percentage) { if (percentage < 100) g_cacheCleaningPercentage = percentage; else g_cacheCleaningPercentage = 100; });
+
+ luaCtx.writeFunction("setECSSourcePrefixV4", [](uint16_t prefix) { g_ECSSourcePrefixV4 = prefix; });
+
+ luaCtx.writeFunction("setECSSourcePrefixV6", [](uint16_t prefix) { g_ECSSourcePrefixV6 = prefix; });
+
+ luaCtx.writeFunction("setECSOverride", [](bool override) { g_ECSOverride = override; });
+
+ luaCtx.writeFunction("showDynBlocks", []() {
+ setLuaNoSideEffect();
+ auto slow = g_dynblockNMG.getCopy();
+ struct timespec now;
+ gettime(&now);
+ boost::format fmt("%-24s %8d %8d %-10s %-20s %s\n");
+ g_outputBuffer = (fmt % "What" % "Seconds" % "Blocks" % "Warning" % "Action" % "Reason").str();
+ for (const auto& e : slow) {
+ if (now < e.second.until) {
+ uint64_t counter = e.second.blocks;
+ if (g_defaultBPFFilter && e.second.bpf) {
+ counter += g_defaultBPFFilter->getHits(e.first.getNetwork());
+ }
+ g_outputBuffer += (fmt % e.first.toString() % (e.second.until.tv_sec - now.tv_sec) % counter % (e.second.warning ? "true" : "false") % DNSAction::typeToString(e.second.action != DNSAction::Action::None ? e.second.action : g_dynBlockAction) % e.second.reason).str();
+ }
+ }
+ auto slow2 = g_dynblockSMT.getCopy();
+ slow2.visit([&now, &fmt](const SuffixMatchTree<DynBlock>& node) {
+ if (now < node.d_value.until) {
+ string dom("empty");
+ if (!node.d_value.domain.empty())
+ dom = node.d_value.domain.toString();
+ g_outputBuffer += (fmt % dom % (node.d_value.until.tv_sec - now.tv_sec) % node.d_value.blocks % (node.d_value.warning ? "true" : "false") % DNSAction::typeToString(node.d_value.action != DNSAction::Action::None ? node.d_value.action : g_dynBlockAction) % node.d_value.reason).str();
+ }
+ });
+ });
+
+ luaCtx.writeFunction("clearDynBlocks", []() {
+ setLuaSideEffect();
+ nmts_t nmg;
+ g_dynblockNMG.setState(nmg);
+ SuffixMatchTree<DynBlock> smt;
+ g_dynblockSMT.setState(smt);
+ });
+
+ luaCtx.writeFunction("addDynBlocks",
+ [](const std::unordered_map<ComboAddress, unsigned int, ComboAddress::addressOnlyHash, ComboAddress::addressOnlyEqual>& m, const std::string& msg, boost::optional<int> seconds, boost::optional<DNSAction::Action> action) {
+ if (m.empty()) {
+ return;
+ }
+ setLuaSideEffect();
+ auto slow = g_dynblockNMG.getCopy();
+ struct timespec until, now;
+ gettime(&now);
+ until = now;
+ int actualSeconds = seconds ? *seconds : 10;
+ until.tv_sec += actualSeconds;
+ for (const auto& capair : m) {
+ unsigned int count = 0;
+ /* this legacy interface does not support ranges or ports, use DynBlockRulesGroup instead */
+ AddressAndPortRange requestor(capair.first, capair.first.isIPv4() ? 32 : 128, 0);
+ auto got = slow.lookup(requestor);
+ bool expired = false;
+ if (got) {
+ if (until < got->second.until) {
+ // had a longer policy
+ continue;
+ }
+ if (now < got->second.until) {
+ // only inherit count on fresh query we are extending
+ count = got->second.blocks;
+ }
+ else {
+ expired = true;
+ }
+ }
+ DynBlock db{msg, until, DNSName(), (action ? *action : DNSAction::Action::None)};
+ db.blocks = count;
+ if (!got || expired) {
+ warnlog("Inserting dynamic block for %s for %d seconds: %s", capair.first.toString(), actualSeconds, msg);
+ }
+ slow.insert(requestor).second = db;
+ }
+ g_dynblockNMG.setState(slow);
+ });
+
+ luaCtx.writeFunction("addDynBlockSMT",
+ [](const vector<pair<unsigned int, string>>& names, const std::string& msg, boost::optional<int> seconds, boost::optional<DNSAction::Action> action) {
+ if (names.empty()) {
+ return;
+ }
+ setLuaSideEffect();
+ auto slow = g_dynblockSMT.getCopy();
+ struct timespec until, now;
+ gettime(&now);
+ until = now;
+ int actualSeconds = seconds ? *seconds : 10;
+ until.tv_sec += actualSeconds;
+
+ for (const auto& capair : names) {
+ unsigned int count = 0;
+ DNSName domain(capair.second);
+ domain.makeUsLowerCase();
+ auto got = slow.lookup(domain);
+ bool expired = false;
+ if (got) {
+ if (until < got->until) // had a longer policy
+ continue;
+ if (now < got->until) // only inherit count on fresh query we are extending
+ count = got->blocks;
+ else
+ expired = true;
+ }
+
+ DynBlock db{msg, until, domain, (action ? *action : DNSAction::Action::None)};
+ db.blocks = count;
+ if (!got || expired)
+ warnlog("Inserting dynamic block for %s for %d seconds: %s", domain, actualSeconds, msg);
+ slow.add(domain, std::move(db));
+ }
+ g_dynblockSMT.setState(slow);
+ });
+
+ luaCtx.writeFunction("setDynBlocksAction", [](DNSAction::Action action) {
+ if (!g_configurationDone) {
+ if (action == DNSAction::Action::Drop || action == DNSAction::Action::NoOp || action == DNSAction::Action::Nxdomain || action == DNSAction::Action::Refused || action == DNSAction::Action::Truncate || action == DNSAction::Action::NoRecurse) {
+ g_dynBlockAction = action;
+ }
+ else {
+ errlog("Dynamic blocks action can only be Drop, NoOp, NXDomain, Refused, Truncate or NoRecurse!");
+ g_outputBuffer = "Dynamic blocks action can only be Drop, NoOp, NXDomain, Refused, Truncate or NoRecurse!\n";
+ }
+ }
+ else {
+ g_outputBuffer = "Dynamic blocks action cannot be altered at runtime!\n";
+ }
+ });
+
+ luaCtx.writeFunction("setDynBlocksPurgeInterval", [](unsigned int interval) {
+ DynBlockMaintenance::s_expiredDynBlocksPurgeInterval = interval;
+ });
+
+ luaCtx.writeFunction("addDNSCryptBind", [](const std::string& addr, const std::string& providerName, boost::variant<std::string, std::vector<std::pair<int, std::string>>> certFiles, boost::variant<std::string, std::vector<std::pair<int, std::string>>> keyFiles, boost::optional<localbind_t> vars) {
+ if (g_configurationDone) {
+ g_outputBuffer = "addDNSCryptBind cannot be used at runtime!\n";
+ return;
+ }
+#ifdef HAVE_DNSCRYPT
+ bool reusePort = false;
+ int tcpFastOpenQueueSize = 0;
+ int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
+ size_t tcpMaxConcurrentConnections = 0;
+ std::string interface;
+ std::set<int> cpus;
+ std::vector<DNSCryptContext::CertKeyPaths> certKeys;
+
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn, tcpMaxConcurrentConnections);
+
+ if (certFiles.type() == typeid(std::string) && keyFiles.type() == typeid(std::string)) {
+ auto certFile = boost::get<std::string>(certFiles);
+ auto keyFile = boost::get<std::string>(keyFiles);
+ certKeys.push_back({certFile, keyFile});
+ }
+ else if (certFiles.type() == typeid(std::vector<std::pair<int, std::string>>) && keyFiles.type() == typeid(std::vector<std::pair<int, std::string>>)) {
+ auto certFilesVect = boost::get<std::vector<std::pair<int, std::string>>>(certFiles);
+ auto keyFilesVect = boost::get<std::vector<std::pair<int, std::string>>>(keyFiles);
+ if (certFilesVect.size() == keyFilesVect.size()) {
+ for (size_t idx = 0; idx < certFilesVect.size(); idx++) {
+ certKeys.push_back({certFilesVect.at(idx).second, keyFilesVect.at(idx).second});
+ }
+ }
+ else {
+ errlog("Error, mismatching number of certificates and keys in call to addDNSCryptBind!");
+ g_outputBuffer = "Error, mismatching number of certificates and keys in call to addDNSCryptBind()!";
+ return;
+ }
+ }
+ else {
+ errlog("Error, mismatching number of certificates and keys in call to addDNSCryptBind()!");
+ g_outputBuffer = "Error, mismatching number of certificates and keys in call to addDNSCryptBind()!";
+ return;
+ }
+
+ try {
+ auto ctx = std::make_shared<DNSCryptContext>(providerName, certKeys);
+
+ /* UDP */
+ auto cs = std::make_unique<ClientState>(ComboAddress(addr, 443), false, reusePort, tcpFastOpenQueueSize, interface, cpus);
+ cs->dnscryptCtx = ctx;
+ g_dnsCryptLocals.push_back(ctx);
+ g_frontends.push_back(std::move(cs));
+
+ /* TCP */
+ cs = std::make_unique<ClientState>(ComboAddress(addr, 443), true, reusePort, tcpFastOpenQueueSize, interface, cpus);
+ cs->dnscryptCtx = ctx;
+ if (tcpListenQueueSize > 0) {
+ cs->tcpListenQueueSize = tcpListenQueueSize;
+ }
+ if (maxInFlightQueriesPerConn > 0) {
+ cs->d_maxInFlightQueriesPerConn = maxInFlightQueriesPerConn;
+ }
+ if (tcpMaxConcurrentConnections > 0) {
+ cs->d_tcpConcurrentConnectionsLimit = tcpMaxConcurrentConnections;
+ }
+
+ g_frontends.push_back(std::move(cs));
+ }
+ catch (std::exception& e) {
+ errlog(e.what());
+ g_outputBuffer = "Error: " + string(e.what()) + "\n";
+ }
+#else
+ g_outputBuffer = "Error: DNSCrypt support is not enabled.\n";
+#endif
+ });
+
+ luaCtx.writeFunction("showDNSCryptBinds", []() {
+ setLuaNoSideEffect();
+#ifdef HAVE_DNSCRYPT
+ ostringstream ret;
+ boost::format fmt("%1$-3d %2% %|25t|%3$-20.20s");
+ ret << (fmt % "#" % "Address" % "Provider Name") << endl;
+ size_t idx = 0;
+
+ std::unordered_set<std::shared_ptr<DNSCryptContext>> contexts;
+ for (const auto& frontend : g_frontends) {
+ const std::shared_ptr<DNSCryptContext> ctx = frontend->dnscryptCtx;
+ if (!ctx || contexts.count(ctx) != 0) {
+ continue;
+ }
+ contexts.insert(ctx);
+ ret << (fmt % idx % frontend->local.toStringWithPort() % ctx->getProviderName()) << endl;
+ idx++;
+ }
+
+ g_outputBuffer = ret.str();
+#else
+ g_outputBuffer = "Error: DNSCrypt support is not enabled.\n";
+#endif
+ });
+
+ luaCtx.writeFunction("getDNSCryptBind", [](size_t idx) {
+ setLuaNoSideEffect();
+#ifdef HAVE_DNSCRYPT
+ std::shared_ptr<DNSCryptContext> ret = nullptr;
+ if (idx < g_dnsCryptLocals.size()) {
+ ret = g_dnsCryptLocals.at(idx);
+ }
+ return ret;
+#else
+ g_outputBuffer = "Error: DNSCrypt support is not enabled.\n";
+#endif
+ });
+
+ luaCtx.writeFunction("getDNSCryptBindCount", []() {
+ setLuaNoSideEffect();
+ return g_dnsCryptLocals.size();
+ });
+
+ luaCtx.writeFunction("generateDNSCryptProviderKeys", [client](const std::string& publicKeyFile, const std::string privateKeyFile) {
+ setLuaNoSideEffect();
+#ifdef HAVE_DNSCRYPT
+ if (client) {
+ return;
+ }
+ unsigned char publicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+ unsigned char privateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE];
+ sodium_mlock(privateKey, sizeof(privateKey));
+
+ try {
+ DNSCryptContext::generateProviderKeys(publicKey, privateKey);
+
+ ofstream pubKStream(publicKeyFile);
+ pubKStream.write((char*)publicKey, sizeof(publicKey));
+ pubKStream.close();
+
+ ofstream privKStream(privateKeyFile);
+ privKStream.write((char*)privateKey, sizeof(privateKey));
+ privKStream.close();
+
+ g_outputBuffer = "Provider fingerprint is: " + DNSCryptContext::getProviderFingerprint(publicKey) + "\n";
+ }
+ catch (std::exception& e) {
+ errlog(e.what());
+ g_outputBuffer = "Error: " + string(e.what()) + "\n";
+ }
+
+ sodium_memzero(privateKey, sizeof(privateKey));
+ sodium_munlock(privateKey, sizeof(privateKey));
+#else
+ g_outputBuffer = "Error: DNSCrypt support is not enabled.\n";
+#endif
+ });
+
+ luaCtx.writeFunction("printDNSCryptProviderFingerprint", [](const std::string& publicKeyFile) {
+ setLuaNoSideEffect();
+#ifdef HAVE_DNSCRYPT
+ unsigned char publicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+
+ try {
+ ifstream file(publicKeyFile);
+ file.read((char*)&publicKey, sizeof(publicKey));
+
+ if (file.fail())
+ throw std::runtime_error("Invalid dnscrypt provider public key file " + publicKeyFile);
+
+ file.close();
+ g_outputBuffer = "Provider fingerprint is: " + DNSCryptContext::getProviderFingerprint(publicKey) + "\n";
+ }
+ catch (std::exception& e) {
+ errlog(e.what());
+ g_outputBuffer = "Error: " + string(e.what()) + "\n";
+ }
+#else
+ g_outputBuffer = "Error: DNSCrypt support is not enabled.\n";
+#endif
+ });
+
+#ifdef HAVE_DNSCRYPT
+ luaCtx.writeFunction("generateDNSCryptCertificate", [client](const std::string& providerPrivateKeyFile, const std::string& certificateFile, const std::string privateKeyFile, uint32_t serial, time_t begin, time_t end, boost::optional<DNSCryptExchangeVersion> version) {
+ setLuaNoSideEffect();
+ if (client) {
+ return;
+ }
+ DNSCryptPrivateKey privateKey;
+ DNSCryptCert cert;
+
+ try {
+ if (generateDNSCryptCertificate(providerPrivateKeyFile, serial, begin, end, version ? *version : DNSCryptExchangeVersion::VERSION1, cert, privateKey)) {
+ privateKey.saveToFile(privateKeyFile);
+ DNSCryptContext::saveCertFromFile(cert, certificateFile);
+ }
+ }
+ catch (const std::exception& e) {
+ errlog(e.what());
+ g_outputBuffer = "Error: " + string(e.what()) + "\n";
+ }
+ });
+#endif
+
+ luaCtx.writeFunction("showPools", []() {
+ setLuaNoSideEffect();
+ try {
+ ostringstream ret;
+ boost::format fmt("%1$-20.20s %|25t|%2$20s %|25t|%3$20s %|50t|%4%");
+ // 1 2 3 4
+ ret << (fmt % "Name" % "Cache" % "ServerPolicy" % "Servers") << endl;
+
+ const auto localPools = g_pools.getCopy();
+ for (const auto& entry : localPools) {
+ const string& name = entry.first;
+ const std::shared_ptr<ServerPool> pool = entry.second;
+ string cache = pool->packetCache != nullptr ? pool->packetCache->toString() : "";
+ string policy = g_policy.getLocal()->getName();
+ if (pool->policy != nullptr) {
+ policy = pool->policy->getName();
+ }
+ string servers;
+
+ const auto poolServers = pool->getServers();
+ for (const auto& server : *poolServers) {
+ if (!servers.empty()) {
+ servers += ", ";
+ }
+ if (!server.second->getName().empty()) {
+ servers += server.second->getName();
+ servers += " ";
+ }
+ servers += server.second->remote.toStringWithPort();
+ }
+
+ ret << (fmt % name % cache % policy % servers) << endl;
+ }
+ g_outputBuffer = ret.str();
+ }
+ catch (std::exception& e) {
+ g_outputBuffer = e.what();
+ throw;
+ }
+ });
+
+ luaCtx.writeFunction("getPool", [client](const string& poolName) {
+ if (client) {
+ return std::make_shared<ServerPool>();
+ }
+ auto localPools = g_pools.getCopy();
+ std::shared_ptr<ServerPool> pool = createPoolIfNotExists(localPools, poolName);
+ g_pools.setState(localPools);
+ return pool;
+ });
+
+ luaCtx.writeFunction("setVerboseHealthChecks", [](bool verbose) { g_verboseHealthChecks = verbose; });
+ luaCtx.writeFunction("setStaleCacheEntriesTTL", [](uint64_t ttl) {
+ checkParameterBound("setStaleCacheEntriesTTL", ttl, std::numeric_limits<uint32_t>::max());
+ g_staleCacheEntriesTTL = ttl;
+ });
+
+ luaCtx.writeFunction("showBinds", []() {
+ setLuaNoSideEffect();
+ try {
+ ostringstream ret;
+ boost::format fmt("%1$-3d %2$-20.20s %|35t|%3$-20.20s %|57t|%4%");
+ // 1 2 3 4
+ ret << (fmt % "#" % "Address" % "Protocol" % "Queries") << endl;
+
+ size_t counter = 0;
+ for (const auto& front : g_frontends) {
+ ret << (fmt % counter % front->local.toStringWithPort() % front->getType() % front->queries) << endl;
+ counter++;
+ }
+ g_outputBuffer = ret.str();
+ }
+ catch (std::exception& e) {
+ g_outputBuffer = e.what();
+ throw;
+ }
+ });
+
+ luaCtx.writeFunction("getBind", [](size_t num) {
+ setLuaNoSideEffect();
+ ClientState* ret = nullptr;
+ if (num < g_frontends.size()) {
+ ret = g_frontends[num].get();
+ }
+ return ret;
+ });
+
+ luaCtx.writeFunction("getBindCount", []() {
+ setLuaNoSideEffect();
+ return g_frontends.size();
+ });
+
+ luaCtx.writeFunction("help", [](boost::optional<std::string> command) {
+ setLuaNoSideEffect();
+ g_outputBuffer = "";
+ for (const auto& keyword : g_consoleKeywords) {
+ if (!command) {
+ g_outputBuffer += keyword.toString() + "\n";
+ }
+ else if (keyword.name == command) {
+ g_outputBuffer = keyword.toString() + "\n";
+ return;
+ }
+ }
+ if (command) {
+ g_outputBuffer = "Nothing found for " + *command + "\n";
+ }
+ });
+
+ luaCtx.writeFunction("showVersion", []() {
+ setLuaNoSideEffect();
+ g_outputBuffer = "dnsdist " + std::string(VERSION) + "\n";
+ });
+
+ luaCtx.writeFunction("showSecurityStatus", []() {
+ setLuaNoSideEffect();
+ g_outputBuffer = std::to_string(g_stats.securityStatus) + "\n";
+ });
+
+#ifdef HAVE_EBPF
+ luaCtx.writeFunction("setDefaultBPFFilter", [](std::shared_ptr<BPFFilter> bpf) {
+ if (g_configurationDone) {
+ g_outputBuffer = "setDefaultBPFFilter() cannot be used at runtime!\n";
+ return;
+ }
+ g_defaultBPFFilter = bpf;
+ });
+
+ luaCtx.writeFunction("registerDynBPFFilter", [](std::shared_ptr<DynBPFFilter> dbpf) {
+ if (dbpf) {
+ g_dynBPFFilters.push_back(dbpf);
+ }
+ });
+
+ luaCtx.writeFunction("unregisterDynBPFFilter", [](std::shared_ptr<DynBPFFilter> dbpf) {
+ if (dbpf) {
+ for (auto it = g_dynBPFFilters.begin(); it != g_dynBPFFilters.end(); it++) {
+ if (*it == dbpf) {
+ g_dynBPFFilters.erase(it);
+ break;
+ }
+ }
+ }
+ });
+
+ luaCtx.writeFunction("addBPFFilterDynBlocks", [](const std::unordered_map<ComboAddress, unsigned int, ComboAddress::addressOnlyHash, ComboAddress::addressOnlyEqual>& m, std::shared_ptr<DynBPFFilter> dynbpf, boost::optional<int> seconds, boost::optional<std::string> msg) {
+ if (!dynbpf) {
+ return;
+ }
+ setLuaSideEffect();
+ struct timespec until, now;
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ until = now;
+ int actualSeconds = seconds ? *seconds : 10;
+ until.tv_sec += actualSeconds;
+ for (const auto& capair : m) {
+ if (dynbpf->block(capair.first, until)) {
+ warnlog("Inserting eBPF dynamic block for %s for %d seconds: %s", capair.first.toString(), actualSeconds, msg ? *msg : "");
+ }
+ }
+ });
+
+#endif /* HAVE_EBPF */
+
+ luaCtx.writeFunction<std::unordered_map<string, uint64_t>()>("getStatisticsCounters", []() {
+ setLuaNoSideEffect();
+ std::unordered_map<string, uint64_t> res;
+ for (const auto& entry : g_stats.entries) {
+ if (const auto& val = boost::get<pdns::stat_t*>(&entry.second))
+ res[entry.first] = (*val)->load();
+ }
+ return res;
+ });
+
+ luaCtx.writeFunction("includeDirectory", [&luaCtx](const std::string& dirname) {
+ if (g_configurationDone) {
+ errlog("includeDirectory() cannot be used at runtime!");
+ g_outputBuffer = "includeDirectory() cannot be used at runtime!\n";
+ return;
+ }
+
+ if (g_included) {
+ errlog("includeDirectory() cannot be used recursively!");
+ g_outputBuffer = "includeDirectory() cannot be used recursively!\n";
+ return;
+ }
+
+ struct stat st;
+ if (stat(dirname.c_str(), &st)) {
+ errlog("The included directory %s does not exist!", dirname.c_str());
+ g_outputBuffer = "The included directory " + dirname + " does not exist!";
+ return;
+ }
+
+ if (!S_ISDIR(st.st_mode)) {
+ errlog("The included directory %s is not a directory!", dirname.c_str());
+ g_outputBuffer = "The included directory " + dirname + " is not a directory!";
+ return;
+ }
+
+ DIR* dirp;
+ struct dirent* ent;
+ std::list<std::string> files;
+ if (!(dirp = opendir(dirname.c_str()))) {
+ errlog("Error opening the included directory %s!", dirname.c_str());
+ g_outputBuffer = "Error opening the included directory " + dirname + "!";
+ return;
+ }
+
+ while ((ent = readdir(dirp)) != NULL) {
+ if (ent->d_name[0] == '.') {
+ continue;
+ }
+
+ if (boost::ends_with(ent->d_name, ".conf")) {
+ std::ostringstream namebuf;
+ namebuf << dirname.c_str() << "/" << ent->d_name;
+
+ if (stat(namebuf.str().c_str(), &st) || !S_ISREG(st.st_mode)) {
+ continue;
+ }
+
+ files.push_back(namebuf.str());
+ }
+ }
+
+ closedir(dirp);
+ files.sort();
+
+ g_included = true;
+
+ for (auto file = files.begin(); file != files.end(); ++file) {
+ std::ifstream ifs(*file);
+ if (!ifs) {
+ warnlog("Unable to read configuration from '%s'", *file);
+ }
+ else {
+ vinfolog("Read configuration from '%s'", *file);
+ }
+
+ try {
+ luaCtx.executeCode(ifs);
+ }
+ catch (...) {
+ g_included = false;
+ throw;
+ }
+
+ luaCtx.executeCode(ifs);
+ }
+
+ g_included = false;
+ });
+
+ luaCtx.writeFunction("setAPIWritable", [](bool writable, boost::optional<std::string> apiConfigDir) {
+ setLuaSideEffect();
+ g_apiReadWrite = writable;
+ if (apiConfigDir) {
+ if (!(*apiConfigDir).empty()) {
+ g_apiConfigDirectory = *apiConfigDir;
+ }
+ else {
+ errlog("The API configuration directory value cannot be empty!");
+ g_outputBuffer = "The API configuration directory value cannot be empty!";
+ }
+ }
+ });
+
+ luaCtx.writeFunction("setServFailWhenNoServer", [](bool servfail) {
+ setLuaSideEffect();
+ g_servFailOnNoPolicy = servfail;
+ });
+
+ luaCtx.writeFunction("setRoundRobinFailOnNoServer", [](bool fail) {
+ setLuaSideEffect();
+ g_roundrobinFailOnNoServer = fail;
+ });
+
+ luaCtx.writeFunction("setConsistentHashingBalancingFactor", [](double factor) {
+ setLuaSideEffect();
+ if (factor >= 1.0) {
+ g_consistentHashBalancingFactor = factor;
+ }
+ else {
+ errlog("Invalid value passed to setConsistentHashingBalancingFactor()!");
+ g_outputBuffer = "Invalid value passed to setConsistentHashingBalancingFactor()!\n";
+ return;
+ }
+ });
+
+ luaCtx.writeFunction("setWeightedBalancingFactor", [](double factor) {
+ setLuaSideEffect();
+ if (factor >= 1.0) {
+ g_weightedBalancingFactor = factor;
+ }
+ else {
+ errlog("Invalid value passed to setWeightedBalancingFactor()!");
+ g_outputBuffer = "Invalid value passed to setWeightedBalancingFactor()!\n";
+ return;
+ }
+ });
+
+ luaCtx.writeFunction("setRingBuffersSize", [client](size_t capacity, boost::optional<size_t> numberOfShards) {
+ setLuaSideEffect();
+ if (g_configurationDone) {
+ errlog("setRingBuffersSize() cannot be used at runtime!");
+ g_outputBuffer = "setRingBuffersSize() cannot be used at runtime!\n";
+ return;
+ }
+ if (!client) {
+ g_rings.setCapacity(capacity, numberOfShards ? *numberOfShards : 10);
+ }
+ else {
+ g_rings.setCapacity(0, 1);
+ }
+ });
+
+ luaCtx.writeFunction("setRingBuffersLockRetries", [](size_t retries) {
+ setLuaSideEffect();
+ g_rings.setNumberOfLockRetries(retries);
+ });
+
+ luaCtx.writeFunction("setWHashedPertubation", [](uint64_t perturb) {
+ setLuaSideEffect();
+ checkParameterBound("setWHashedPertubation", perturb, std::numeric_limits<uint32_t>::max());
+ g_hashperturb = perturb;
+ });
+
+ luaCtx.writeFunction("setTCPInternalPipeBufferSize", [](size_t size) { g_tcpInternalPipeBufferSize = size; });
+
+ luaCtx.writeFunction("snmpAgent", [client, configCheck](bool enableTraps, boost::optional<std::string> daemonSocket) {
+ if (client || configCheck)
+ return;
+#ifdef HAVE_NET_SNMP
+ if (g_configurationDone) {
+ errlog("snmpAgent() cannot be used at runtime!");
+ g_outputBuffer = "snmpAgent() cannot be used at runtime!\n";
+ return;
+ }
+
+ if (g_snmpEnabled) {
+ errlog("snmpAgent() cannot be used twice!");
+ g_outputBuffer = "snmpAgent() cannot be used twice!\n";
+ return;
+ }
+
+ g_snmpEnabled = true;
+ g_snmpTrapsEnabled = enableTraps;
+ g_snmpAgent = new DNSDistSNMPAgent("dnsdist", daemonSocket ? *daemonSocket : std::string());
+#else
+ errlog("NET SNMP support is required to use snmpAgent()");
+ g_outputBuffer = "NET SNMP support is required to use snmpAgent()\n";
+#endif /* HAVE_NET_SNMP */
+ });
+
+ luaCtx.writeFunction("sendCustomTrap", [](const std::string& str) {
+ if (g_snmpAgent && g_snmpTrapsEnabled) {
+ g_snmpAgent->sendCustomTrap(str);
+ }
+ });
+
+ luaCtx.writeFunction("setServerPolicy", [](const ServerPolicy& policy) {
+ setLuaSideEffect();
+ g_policy.setState(policy);
+ });
+
+ luaCtx.writeFunction("setServerPolicyLua", [](string name, ServerPolicy::policyfunc_t policy) {
+ setLuaSideEffect();
+ g_policy.setState(ServerPolicy{name, policy, true});
+ });
+
+ luaCtx.writeFunction("setServerPolicyLuaFFI", [](string name, ServerPolicy::ffipolicyfunc_t policy) {
+ setLuaSideEffect();
+ auto pol = ServerPolicy(name, policy);
+ g_policy.setState(std::move(pol));
+ });
+
+ luaCtx.writeFunction("setServerPolicyLuaFFIPerThread", [](string name, const std::string& policyCode) {
+ setLuaSideEffect();
+ auto pol = ServerPolicy(name, policyCode);
+ g_policy.setState(std::move(pol));
+ });
+
+ luaCtx.writeFunction("showServerPolicy", []() {
+ setLuaSideEffect();
+ g_outputBuffer = g_policy.getLocal()->getName() + "\n";
+ });
+
+ luaCtx.writeFunction("setPoolServerPolicy", [](ServerPolicy policy, string pool) {
+ setLuaSideEffect();
+ auto localPools = g_pools.getCopy();
+ setPoolPolicy(localPools, pool, std::make_shared<ServerPolicy>(policy));
+ g_pools.setState(localPools);
+ });
+
+ luaCtx.writeFunction("setPoolServerPolicyLua", [](string name, ServerPolicy::policyfunc_t policy, string pool) {
+ setLuaSideEffect();
+ auto localPools = g_pools.getCopy();
+ setPoolPolicy(localPools, pool, std::make_shared<ServerPolicy>(ServerPolicy{name, policy, true}));
+ g_pools.setState(localPools);
+ });
+
+ luaCtx.writeFunction("setPoolServerPolicyLuaFFI", [](string name, ServerPolicy::ffipolicyfunc_t policy, string pool) {
+ setLuaSideEffect();
+ auto localPools = g_pools.getCopy();
+ setPoolPolicy(localPools, pool, std::make_shared<ServerPolicy>(ServerPolicy{name, policy}));
+ g_pools.setState(localPools);
+ });
+
+ luaCtx.writeFunction("setPoolServerPolicyLuaFFIPerThread", [](string name, const std::string& policyCode, string pool) {
+ setLuaSideEffect();
+ auto localPools = g_pools.getCopy();
+ setPoolPolicy(localPools, pool, std::make_shared<ServerPolicy>(ServerPolicy{name, policyCode}));
+ g_pools.setState(localPools);
+ });
+
+ luaCtx.writeFunction("showPoolServerPolicy", [](string pool) {
+ setLuaSideEffect();
+ auto localPools = g_pools.getCopy();
+ auto poolObj = getPool(localPools, pool);
+ if (poolObj->policy == nullptr) {
+ g_outputBuffer = g_policy.getLocal()->getName() + "\n";
+ }
+ else {
+ g_outputBuffer = poolObj->policy->getName() + "\n";
+ }
+ });
+
+ luaCtx.writeFunction("setTCPDownstreamCleanupInterval", [](uint64_t interval) {
+ setLuaSideEffect();
+ checkParameterBound("setTCPDownstreamCleanupInterval", interval);
+ DownstreamTCPConnectionsManager::setCleanupInterval(interval);
+ });
+
+ luaCtx.writeFunction("setDoHDownstreamCleanupInterval", [](uint64_t interval) {
+ setLuaSideEffect();
+ checkParameterBound("setDoHDownstreamCleanupInterval", interval);
+ setDoHDownstreamCleanupInterval(interval);
+ });
+
+ luaCtx.writeFunction("setTCPDownstreamMaxIdleTime", [](uint64_t max) {
+ setLuaSideEffect();
+ checkParameterBound("setTCPDownstreamMaxIdleTime", max);
+ DownstreamTCPConnectionsManager::setMaxIdleTime(max);
+ });
+
+ luaCtx.writeFunction("setDoHDownstreamMaxIdleTime", [](uint64_t max) {
+ setLuaSideEffect();
+ checkParameterBound("setDoHDownstreamMaxIdleTime", max);
+ setDoHDownstreamMaxIdleTime(max);
+ });
+
+ luaCtx.writeFunction("setConsoleConnectionsLogging", [](bool enabled) {
+ g_logConsoleConnections = enabled;
+ });
+
+ luaCtx.writeFunction("setConsoleOutputMaxMsgSize", [](uint64_t size) {
+ checkParameterBound("setConsoleOutputMaxMsgSize", size, std::numeric_limits<uint32_t>::max());
+ g_consoleOutputMsgMaxSize = size;
+ });
+
+ luaCtx.writeFunction("setProxyProtocolACL", [](boost::variant<string, vector<pair<int, string>>> inp) {
+ if (g_configurationDone) {
+ errlog("setProxyProtocolACL() cannot be used at runtime!");
+ g_outputBuffer = "setProxyProtocolACL() cannot be used at runtime!\n";
+ return;
+ }
+ setLuaSideEffect();
+ NetmaskGroup nmg;
+ if (auto str = boost::get<string>(&inp)) {
+ nmg.addMask(*str);
+ }
+ else {
+ for (const auto& p : boost::get<vector<pair<int, string>>>(inp)) {
+ nmg.addMask(p.second);
+ }
+ }
+ g_proxyProtocolACL = std::move(nmg);
+ });
+
+ luaCtx.writeFunction("setProxyProtocolApplyACLToProxiedClients", [](bool apply) {
+ if (g_configurationDone) {
+ errlog("setProxyProtocolApplyACLToProxiedClients() cannot be used at runtime!");
+ g_outputBuffer = "setProxyProtocolApplyACLToProxiedClients() cannot be used at runtime!\n";
+ return;
+ }
+ setLuaSideEffect();
+ g_applyACLToProxiedClients = apply;
+ });
+
+ luaCtx.writeFunction("setProxyProtocolMaximumPayloadSize", [](size_t size) {
+ if (g_configurationDone) {
+ errlog("setProxyProtocolMaximumPayloadSize() cannot be used at runtime!");
+ g_outputBuffer = "setProxyProtocolMaximumPayloadSize() cannot be used at runtime!\n";
+ return;
+ }
+ setLuaSideEffect();
+ g_proxyProtocolMaximumSize = std::max(static_cast<size_t>(16), size);
+ });
+
+ luaCtx.writeFunction("setUDPMultipleMessagesVectorSize", [](size_t vSize) {
+ if (g_configurationDone) {
+ errlog("setUDPMultipleMessagesVectorSize() cannot be used at runtime!");
+ g_outputBuffer = "setUDPMultipleMessagesVectorSize() cannot be used at runtime!\n";
+ return;
+ }
+#if defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE)
+ setLuaSideEffect();
+ g_udpVectorSize = vSize;
+#else
+ errlog("recvmmsg() support is not available!");
+ g_outputBuffer = "recvmmsg support is not available!\n";
+#endif
+ });
+
+ luaCtx.writeFunction("setAddEDNSToSelfGeneratedResponses", [](bool add) {
+ g_addEDNSToSelfGeneratedResponses = add;
+ });
+
+ luaCtx.writeFunction("setPayloadSizeOnSelfGeneratedAnswers", [](uint16_t payloadSize) {
+ if (payloadSize < 512) {
+ warnlog("setPayloadSizeOnSelfGeneratedAnswers() is set too low, using 512 instead!");
+ g_outputBuffer = "setPayloadSizeOnSelfGeneratedAnswers() is set too low, using 512 instead!";
+ payloadSize = 512;
+ }
+ if (payloadSize > s_udpIncomingBufferSize) {
+ warnlog("setPayloadSizeOnSelfGeneratedAnswers() is set too high, capping to %d instead!", s_udpIncomingBufferSize);
+ g_outputBuffer = "setPayloadSizeOnSelfGeneratedAnswers() is set too high, capping to " + std::to_string(s_udpIncomingBufferSize) + " instead";
+ payloadSize = s_udpIncomingBufferSize;
+ }
+ g_PayloadSizeSelfGenAnswers = payloadSize;
+ });
+
+ luaCtx.writeFunction("setSecurityPollSuffix", [](const std::string& suffix) {
+ if (g_configurationDone) {
+ g_outputBuffer = "setSecurityPollSuffix() cannot be used at runtime!\n";
+ return;
+ }
+
+ g_secPollSuffix = suffix;
+ });
+
+ luaCtx.writeFunction("setSecurityPollInterval", [](time_t newInterval) {
+ if (newInterval <= 0) {
+ warnlog("setSecurityPollInterval() should be > 0, skipping");
+ g_outputBuffer = "setSecurityPollInterval() should be > 0, skipping";
+ }
+
+ g_secPollInterval = newInterval;
+ });
+
+ luaCtx.writeFunction("setSyslogFacility", [](boost::variant<int, std::string> facility) {
+ setLuaSideEffect();
+ if (g_configurationDone) {
+ g_outputBuffer = "setSyslogFacility cannot be used at runtime!\n";
+ return;
+ }
+ if (facility.type() == typeid(std::string)) {
+ static std::map<std::string, int> const facilities = {
+ {"local0", LOG_LOCAL0},
+ {"log_local0", LOG_LOCAL0},
+ {"local1", LOG_LOCAL1},
+ {"log_local1", LOG_LOCAL1},
+ {"local2", LOG_LOCAL2},
+ {"log_local2", LOG_LOCAL2},
+ {"local3", LOG_LOCAL3},
+ {"log_local3", LOG_LOCAL3},
+ {"local4", LOG_LOCAL4},
+ {"log_local4", LOG_LOCAL4},
+ {"local5", LOG_LOCAL5},
+ {"log_local5", LOG_LOCAL5},
+ {"local6", LOG_LOCAL6},
+ {"log_local6", LOG_LOCAL6},
+ {"local7", LOG_LOCAL7},
+ {"log_local7", LOG_LOCAL7},
+ /* most of these likely make very little sense
+ for dnsdist, but why not? */
+ {"kern", LOG_KERN},
+ {"log_kern", LOG_KERN},
+ {"user", LOG_USER},
+ {"log_user", LOG_USER},
+ {"mail", LOG_MAIL},
+ {"log_mail", LOG_MAIL},
+ {"daemon", LOG_DAEMON},
+ {"log_daemon", LOG_DAEMON},
+ {"auth", LOG_AUTH},
+ {"log_auth", LOG_AUTH},
+ {"syslog", LOG_SYSLOG},
+ {"log_syslog", LOG_SYSLOG},
+ {"lpr", LOG_LPR},
+ {"log_lpr", LOG_LPR},
+ {"news", LOG_NEWS},
+ {"log_news", LOG_NEWS},
+ {"uucp", LOG_UUCP},
+ {"log_uucp", LOG_UUCP},
+ {"cron", LOG_CRON},
+ {"log_cron", LOG_CRON},
+ {"authpriv", LOG_AUTHPRIV},
+ {"log_authpriv", LOG_AUTHPRIV},
+ {"ftp", LOG_FTP},
+ {"log_ftp", LOG_FTP}};
+ auto facilityStr = boost::get<std::string>(facility);
+ toLowerInPlace(facilityStr);
+ auto it = facilities.find(facilityStr);
+ if (it == facilities.end()) {
+ g_outputBuffer = "Unknown facility '" + facilityStr + "' passed to setSyslogFacility()!\n";
+ return;
+ }
+ setSyslogFacility(it->second);
+ }
+ else {
+ setSyslogFacility(boost::get<int>(facility));
+ }
+ });
+
+ luaCtx.writeFunction("addDOHLocal", [client](const std::string& addr, boost::optional<boost::variant<std::string, std::vector<std::pair<int, std::string>>>> certFiles, boost::optional<boost::variant<std::string, std::vector<std::pair<int, std::string>>>> keyFiles, boost::optional<boost::variant<std::string, vector<pair<int, std::string>>>> urls, boost::optional<localbind_t> vars) {
+ if (client) {
+ return;
+ }
+#ifdef HAVE_DNS_OVER_HTTPS
+ setLuaSideEffect();
+ if (g_configurationDone) {
+ g_outputBuffer = "addDOHLocal cannot be used at runtime!\n";
+ return;
+ }
+ auto frontend = std::make_shared<DOHFrontend>();
+
+ if (certFiles && !certFiles->empty() && keyFiles && !keyFiles->empty()) {
+ if (!loadTLSCertificateAndKeys("addDOHLocal", frontend->d_tlsConfig.d_certKeyPairs, *certFiles, *keyFiles)) {
+ return;
+ }
+
+ frontend->d_local = ComboAddress(addr, 443);
+ }
+ else {
+ frontend->d_local = ComboAddress(addr, 80);
+ infolog("No certificate provided for DoH endpoint %s, running in DNS over HTTP mode instead of DNS over HTTPS", frontend->d_local.toStringWithPort());
+ }
+
+ if (urls) {
+ if (urls->type() == typeid(std::string)) {
+ frontend->d_urls.push_back(boost::get<std::string>(*urls));
+ }
+ else if (urls->type() == typeid(std::vector<std::pair<int, std::string>>)) {
+ auto urlsVect = boost::get<std::vector<std::pair<int, std::string>>>(*urls);
+ for (const auto& p : urlsVect) {
+ frontend->d_urls.push_back(p.second);
+ }
+ }
+ }
+ else {
+ frontend->d_urls = {"/dns-query"};
+ }
+
+ bool reusePort = false;
+ int tcpFastOpenQueueSize = 0;
+ int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
+ size_t tcpMaxConcurrentConnections = 0;
+ std::string interface;
+ std::set<int> cpus;
+
+ if (vars) {
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn, tcpMaxConcurrentConnections);
+
+ if (vars->count("idleTimeout")) {
+ frontend->d_idleTimeout = boost::get<int>((*vars)["idleTimeout"]);
+ }
+
+ if (vars->count("serverTokens")) {
+ frontend->d_serverTokens = boost::get<const string>((*vars)["serverTokens"]);
+ }
+
+ if (vars->count("customResponseHeaders")) {
+ for (auto const& headerMap : boost::get<std::map<std::string, std::string>>((*vars).at("customResponseHeaders"))) {
+ frontend->d_customResponseHeaders.emplace_back(boost::to_lower_copy(headerMap.first), headerMap.second);
+ }
+ }
+
+ if (vars->count("sendCacheControlHeaders")) {
+ frontend->d_sendCacheControlHeaders = boost::get<bool>((*vars)["sendCacheControlHeaders"]);
+ }
+
+ if (vars->count("trustForwardedForHeader")) {
+ frontend->d_trustForwardedForHeader = boost::get<bool>((*vars)["trustForwardedForHeader"]);
+ }
+
+ if (vars->count("internalPipeBufferSize")) {
+ frontend->d_internalPipeBufferSize = boost::get<int>((*vars)["internalPipeBufferSize"]);
+ }
+
+ if (vars->count("exactPathMatching")) {
+ frontend->d_exactPathMatching = boost::get<bool>((*vars)["exactPathMatching"]);
+ }
+
+ parseTLSConfig(frontend->d_tlsConfig, "addDOHLocal", vars);
+ }
+ g_dohlocals.push_back(frontend);
+ auto cs = std::make_unique<ClientState>(frontend->d_local, true, reusePort, tcpFastOpenQueueSize, interface, cpus);
+ cs->dohFrontend = frontend;
+ if (tcpListenQueueSize > 0) {
+ cs->tcpListenQueueSize = tcpListenQueueSize;
+ }
+ if (tcpMaxConcurrentConnections > 0) {
+ cs->d_tcpConcurrentConnectionsLimit = tcpMaxConcurrentConnections;
+ }
+ g_frontends.push_back(std::move(cs));
+#else
+ throw std::runtime_error("addDOHLocal() called but DNS over HTTPS support is not present!");
+#endif
+ });
+
+ luaCtx.writeFunction("showDOHFrontends", []() {
+#ifdef HAVE_DNS_OVER_HTTPS
+ setLuaNoSideEffect();
+ try {
+ ostringstream ret;
+ boost::format fmt("%-3d %-20.20s %-15d %-15d %-15d %-15d %-15d %-15d %-15d %-15d %-15d %-15d %-15d %-15d");
+ ret << (fmt % "#" % "Address" % "HTTP" % "HTTP/1" % "HTTP/2" % "GET" % "POST" % "Bad" % "Errors" % "Redirects" % "Valid" % "# ticket keys" % "Rotation delay" % "Next rotation") << endl;
+ size_t counter = 0;
+ for (const auto& ctx : g_dohlocals) {
+ ret << (fmt % counter % ctx->d_local.toStringWithPort() % ctx->d_httpconnects % ctx->d_http1Stats.d_nbQueries % ctx->d_http2Stats.d_nbQueries % ctx->d_getqueries % ctx->d_postqueries % ctx->d_badrequests % ctx->d_errorresponses % ctx->d_redirectresponses % ctx->d_validresponses % ctx->getTicketsKeysCount() % ctx->getTicketsKeyRotationDelay() % ctx->getNextTicketsKeyRotation()) << endl;
+ counter++;
+ }
+ g_outputBuffer = ret.str();
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = e.what();
+ throw;
+ }
+#else
+ g_outputBuffer = "DNS over HTTPS support is not present!\n";
+#endif
+ });
+
+ luaCtx.writeFunction("showDOHResponseCodes", []() {
+#ifdef HAVE_DNS_OVER_HTTPS
+ setLuaNoSideEffect();
+ try {
+ ostringstream ret;
+ boost::format fmt("%-3d %-20.20s %-15d %-15d %-15d %-15d %-15d %-15d");
+ g_outputBuffer = "\n- HTTP/1:\n\n";
+ ret << (fmt % "#" % "Address" % "200" % "400" % "403" % "500" % "502" % "Others") << endl;
+ size_t counter = 0;
+ for (const auto& ctx : g_dohlocals) {
+ ret << (fmt % counter % ctx->d_local.toStringWithPort() % ctx->d_http1Stats.d_nb200Responses % ctx->d_http1Stats.d_nb400Responses % ctx->d_http1Stats.d_nb403Responses % ctx->d_http1Stats.d_nb500Responses % ctx->d_http1Stats.d_nb502Responses % ctx->d_http1Stats.d_nbOtherResponses) << endl;
+ counter++;
+ }
+ g_outputBuffer += ret.str();
+ ret.str("");
+
+ g_outputBuffer += "\n- HTTP/2:\n\n";
+ ret << (fmt % "#" % "Address" % "200" % "400" % "403" % "500" % "502" % "Others") << endl;
+ counter = 0;
+ for (const auto& ctx : g_dohlocals) {
+ ret << (fmt % counter % ctx->d_local.toStringWithPort() % ctx->d_http2Stats.d_nb200Responses % ctx->d_http2Stats.d_nb400Responses % ctx->d_http2Stats.d_nb403Responses % ctx->d_http2Stats.d_nb500Responses % ctx->d_http2Stats.d_nb502Responses % ctx->d_http2Stats.d_nbOtherResponses) << endl;
+ counter++;
+ }
+ g_outputBuffer += ret.str();
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = e.what();
+ throw;
+ }
+#else
+ g_outputBuffer = "DNS over HTTPS support is not present!\n";
+#endif
+ });
+
+ luaCtx.writeFunction("getDOHFrontend", [client](size_t index) {
+ std::shared_ptr<DOHFrontend> result = nullptr;
+ if (client) {
+ return result;
+ }
+#ifdef HAVE_DNS_OVER_HTTPS
+ setLuaNoSideEffect();
+ try {
+ if (index < g_dohlocals.size()) {
+ result = g_dohlocals.at(index);
+ }
+ else {
+ errlog("Error: trying to get DOH frontend with index %zu but we only have %zu frontend(s)\n", index, g_dohlocals.size());
+ g_outputBuffer = "Error: trying to get DOH frontend with index " + std::to_string(index) + " but we only have " + std::to_string(g_dohlocals.size()) + " frontend(s)\n";
+ }
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = "Error while trying to get DOH frontend with index " + std::to_string(index) + ": " + string(e.what()) + "\n";
+ errlog("Error while trying to get DOH frontend with index %zu: %s\n", index, string(e.what()));
+ }
+#else
+ g_outputBuffer="DNS over HTTPS support is not present!\n";
+#endif
+ return result;
+ });
+
+ luaCtx.writeFunction("getDOHFrontendCount", []() {
+ setLuaNoSideEffect();
+ return g_dohlocals.size();
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<DOHFrontend>::*)()>("reloadCertificates", [](std::shared_ptr<DOHFrontend> frontend) {
+ if (frontend != nullptr) {
+ frontend->reloadCertificates();
+ }
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<DOHFrontend>::*)(boost::variant<std::string, std::vector<std::pair<int, std::string>>> certFiles, boost::variant<std::string, std::vector<std::pair<int, std::string>>> keyFiles)>("loadNewCertificatesAndKeys", [](std::shared_ptr<DOHFrontend> frontend, boost::variant<std::string, std::vector<std::pair<int, std::string>>> certFiles, boost::variant<std::string, std ::vector<std::pair<int, std::string>>> keyFiles) {
+#ifdef HAVE_DNS_OVER_HTTPS
+ if (frontend != nullptr) {
+ if (loadTLSCertificateAndKeys("DOHFrontend::loadNewCertificatesAndKeys", frontend->d_tlsConfig.d_certKeyPairs, certFiles, keyFiles)) {
+ frontend->reloadCertificates();
+ }
+ }
+#endif
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<DOHFrontend>::*)()>("rotateTicketsKey", [](std::shared_ptr<DOHFrontend> frontend) {
+ if (frontend != nullptr) {
+ frontend->rotateTicketsKey(time(nullptr));
+ }
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<DOHFrontend>::*)(const std::string&)>("loadTicketsKeys", [](std::shared_ptr<DOHFrontend> frontend, const std::string& file) {
+ if (frontend != nullptr) {
+ frontend->loadTicketsKeys(file);
+ }
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<DOHFrontend>::*)(const std::map<int, std::shared_ptr<DOHResponseMapEntry>>&)>("setResponsesMap", [](std::shared_ptr<DOHFrontend> frontend, const std::map<int, std::shared_ptr<DOHResponseMapEntry>>& map) {
+ if (frontend != nullptr) {
+ auto newMap = std::make_shared<std::vector<std::shared_ptr<DOHResponseMapEntry>>>();
+ newMap->reserve(map.size());
+
+ for (const auto& entry : map) {
+ newMap->push_back(entry.second);
+ }
+
+ frontend->d_responsesMap = std::move(newMap);
+ }
+ });
+
+ luaCtx.registerFunction<std::string (std::shared_ptr<DOHFrontend>::*)() const>("getAddressAndPort", [](const std::shared_ptr<DOHFrontend>& frontend) {
+ if (frontend == nullptr) {
+ return std::string();
+ }
+ return frontend->d_local.toStringWithPort();
+ });
+
+ luaCtx.writeFunction("addTLSLocal", [client](const std::string& addr, boost::variant<std::string, std::vector<std::pair<int, std::string>>> certFiles, boost::variant<std::string, std::vector<std::pair<int, std::string>>> keyFiles, boost::optional<localbind_t> vars) {
+ if (client) {
+ return;
+ }
+#ifdef HAVE_DNS_OVER_TLS
+ setLuaSideEffect();
+ if (g_configurationDone) {
+ g_outputBuffer = "addTLSLocal cannot be used at runtime!\n";
+ return;
+ }
+ shared_ptr<TLSFrontend> frontend = std::make_shared<TLSFrontend>();
+
+ if (!loadTLSCertificateAndKeys("addTLSLocal", frontend->d_tlsConfig.d_certKeyPairs, certFiles, keyFiles)) {
+ return;
+ }
+
+ bool reusePort = false;
+ int tcpFastOpenQueueSize = 0;
+ int tcpListenQueueSize = 0;
+ size_t maxInFlightQueriesPerConn = 0;
+ size_t tcpMaxConcurrentConns = 0;
+ std::string interface;
+ std::set<int> cpus;
+
+ if (vars) {
+ parseLocalBindVars(vars, reusePort, tcpFastOpenQueueSize, interface, cpus, tcpListenQueueSize, maxInFlightQueriesPerConn, tcpMaxConcurrentConns);
+
+ if (vars->count("provider")) {
+ frontend->d_provider = boost::get<const string>((*vars)["provider"]);
+ boost::algorithm::to_lower(frontend->d_provider);
+ }
+
+ parseTLSConfig(frontend->d_tlsConfig, "addTLSLocal", vars);
+ }
+
+ try {
+ frontend->d_addr = ComboAddress(addr, 853);
+ if (!frontend->d_provider.empty()) {
+ vinfolog("Loading TLS provider '%s'", frontend->d_provider);
+ }
+ else {
+#ifdef HAVE_LIBSSL
+ vinfolog("Loading default TLS provider 'openssl'");
+#else
+ vinfolog("Loading default TLS provider 'gnutls'");
+#endif
+ }
+ // only works pre-startup, so no sync necessary
+ auto cs = std::make_unique<ClientState>(frontend->d_addr, true, reusePort, tcpFastOpenQueueSize, interface, cpus);
+ cs->tlsFrontend = frontend;
+ if (tcpListenQueueSize > 0) {
+ cs->tcpListenQueueSize = tcpListenQueueSize;
+ }
+ if (maxInFlightQueriesPerConn > 0) {
+ cs->d_maxInFlightQueriesPerConn = maxInFlightQueriesPerConn;
+ }
+ if (tcpMaxConcurrentConns > 0) {
+ cs->d_tcpConcurrentConnectionsLimit = tcpMaxConcurrentConns;
+ }
+
+ g_tlslocals.push_back(cs->tlsFrontend);
+ g_frontends.push_back(std::move(cs));
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = "Error: " + string(e.what()) + "\n";
+ }
+#else
+ throw std::runtime_error("addTLSLocal() called but DNS over TLS support is not present!");
+#endif
+ });
+
+ luaCtx.writeFunction("showTLSContexts", []() {
+#ifdef HAVE_DNS_OVER_TLS
+ setLuaNoSideEffect();
+ try {
+ ostringstream ret;
+ boost::format fmt("%1$-3d %2$-20.20s %|25t|%3$-14d %|40t|%4$-14d %|54t|%5$-21.21s");
+ // 1 2 3 4 5
+ ret << (fmt % "#" % "Address" % "# ticket keys" % "Rotation delay" % "Next rotation") << endl;
+ size_t counter = 0;
+ for (const auto& ctx : g_tlslocals) {
+ ret << (fmt % counter % ctx->d_addr.toStringWithPort() % ctx->getTicketsKeysCount() % ctx->getTicketsKeyRotationDelay() % ctx->getNextTicketsKeyRotation()) << endl;
+ counter++;
+ }
+ g_outputBuffer = ret.str();
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = e.what();
+ throw;
+ }
+#else
+ g_outputBuffer = "DNS over TLS support is not present!\n";
+#endif
+ });
+
+ luaCtx.writeFunction("getTLSContext", [](size_t index) {
+ std::shared_ptr<TLSCtx> result = nullptr;
+#ifdef HAVE_DNS_OVER_TLS
+ setLuaNoSideEffect();
+ try {
+ if (index < g_tlslocals.size()) {
+ result = g_tlslocals.at(index)->getContext();
+ }
+ else {
+ errlog("Error: trying to get TLS context with index %zu but we only have %zu context(s)\n", index, g_tlslocals.size());
+ g_outputBuffer = "Error: trying to get TLS context with index " + std::to_string(index) + " but we only have " + std::to_string(g_tlslocals.size()) + " context(s)\n";
+ }
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = "Error while trying to get TLS context with index " + std::to_string(index) + ": " + string(e.what()) + "\n";
+ errlog("Error while trying to get TLS context with index %zu: %s\n", index, string(e.what()));
+ }
+#else
+ g_outputBuffer="DNS over TLS support is not present!\n";
+#endif
+ return result;
+ });
+
+ luaCtx.writeFunction("getTLSFrontend", [](size_t index) {
+ std::shared_ptr<TLSFrontend> result = nullptr;
+#ifdef HAVE_DNS_OVER_TLS
+ setLuaNoSideEffect();
+ try {
+ if (index < g_tlslocals.size()) {
+ result = g_tlslocals.at(index);
+ }
+ else {
+ errlog("Error: trying to get TLS frontend with index %zu but we only have %zu frontends\n", index, g_tlslocals.size());
+ g_outputBuffer = "Error: trying to get TLS frontend with index " + std::to_string(index) + " but we only have " + std::to_string(g_tlslocals.size()) + " frontend(s)\n";
+ }
+ }
+ catch (const std::exception& e) {
+ g_outputBuffer = "Error while trying to get TLS frontend with index " + std::to_string(index) + ": " + string(e.what()) + "\n";
+ errlog("Error while trying to get TLS frontend with index %zu: %s\n", index, string(e.what()));
+ }
+#else
+ g_outputBuffer="DNS over TLS support is not present!\n";
+#endif
+ return result;
+ });
+
+ luaCtx.writeFunction("getTLSFrontendCount", []() {
+ setLuaNoSideEffect();
+ return g_tlslocals.size();
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<TLSCtx>::*)()>("rotateTicketsKey", [](std::shared_ptr<TLSCtx>& ctx) {
+ if (ctx != nullptr) {
+ ctx->rotateTicketsKey(time(nullptr));
+ }
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<TLSCtx>::*)(const std::string&)>("loadTicketsKeys", [](std::shared_ptr<TLSCtx>& ctx, const std::string& file) {
+ if (ctx != nullptr) {
+ ctx->loadTicketsKeys(file);
+ }
+ });
+
+ luaCtx.registerFunction<std::string (std::shared_ptr<TLSFrontend>::*)() const>("getAddressAndPort", [](const std::shared_ptr<TLSFrontend>& frontend) {
+ if (frontend == nullptr) {
+ return std::string();
+ }
+ return frontend->d_addr.toStringWithPort();
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<TLSFrontend>::*)()>("rotateTicketsKey", [](std::shared_ptr<TLSFrontend>& frontend) {
+ if (frontend == nullptr) {
+ return;
+ }
+ auto ctx = frontend->getContext();
+ if (ctx) {
+ ctx->rotateTicketsKey(time(nullptr));
+ }
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<TLSFrontend>::*)(const std::string&)>("loadTicketsKeys", [](std::shared_ptr<TLSFrontend>& frontend, const std::string& file) {
+ if (frontend == nullptr) {
+ return;
+ }
+ auto ctx = frontend->getContext();
+ if (ctx) {
+ ctx->loadTicketsKeys(file);
+ }
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<TLSFrontend>::*)()>("reloadCertificates", [](std::shared_ptr<TLSFrontend>& frontend) {
+ if (frontend == nullptr) {
+ return;
+ }
+ frontend->setupTLS();
+ });
+
+ luaCtx.registerFunction<void (std::shared_ptr<TLSFrontend>::*)(boost::variant<std::string, std::vector<std::pair<int, std::string>>> certFiles, boost::variant<std::string, std::vector<std::pair<int, std::string>>> keyFiles)>("loadNewCertificatesAndKeys", [](std::shared_ptr<TLSFrontend>& frontend, boost::variant<std::string, std::vector<std::pair<int, std::string>>> certFiles, boost::variant<std::string, std::vector<std::pair<int, std::string>>> keyFiles) {
+#ifdef HAVE_DNS_OVER_TLS
+ if (loadTLSCertificateAndKeys("TLSFrontend::loadNewCertificatesAndKeys", frontend->d_tlsConfig.d_certKeyPairs, certFiles, keyFiles)) {
+ frontend->setupTLS();
+ }
+#endif
+ });
+
+ luaCtx.writeFunction("reloadAllCertificates", []() {
+ for (auto& frontend : g_frontends) {
+ if (!frontend) {
+ continue;
+ }
+ try {
+#ifdef HAVE_DNSCRYPT
+ if (frontend->dnscryptCtx) {
+ frontend->dnscryptCtx->reloadCertificates();
+ }
+#endif /* HAVE_DNSCRYPT */
+#ifdef HAVE_DNS_OVER_TLS
+ if (frontend->tlsFrontend) {
+ frontend->tlsFrontend->setupTLS();
+ }
+#endif /* HAVE_DNS_OVER_TLS */
+#ifdef HAVE_DNS_OVER_HTTPS
+ if (frontend->dohFrontend) {
+ frontend->dohFrontend->reloadCertificates();
+ }
+#endif /* HAVE_DNS_OVER_HTTPS */
+ }
+ catch (const std::exception& e) {
+ errlog("Error reloading certificates for frontend %s: %s", frontend->local.toStringWithPort(), e.what());
+ }
+ }
+ });
+
+ luaCtx.writeFunction("setAllowEmptyResponse", [](bool allow) { g_allowEmptyResponse = allow; });
+ luaCtx.writeFunction("setDropEmptyQueries", [](bool drop) { extern bool g_dropEmptyQueries; g_dropEmptyQueries = drop; });
+
+#if defined(HAVE_LIBSSL) && defined(HAVE_OCSP_BASIC_SIGN)
+ luaCtx.writeFunction("generateOCSPResponse", [client](const std::string& certFile, const std::string& caCert, const std::string& caKey, const std::string& outFile, int ndays, int nmin) {
+ if (client) {
+ return;
+ }
+
+ libssl_generate_ocsp_response(certFile, caCert, caKey, outFile, ndays, nmin);
+ });
+#endif /* HAVE_LIBSSL && HAVE_OCSP_BASIC_SIGN*/
+
+ luaCtx.writeFunction("addCapabilitiesToRetain", [](boost::variant<std::string, std::map<int, std::string>> caps) {
+ setLuaSideEffect();
+ if (g_configurationDone) {
+ g_outputBuffer = "addCapabilitiesToRetain cannot be used at runtime!\n";
+ return;
+ }
+ if (caps.type() == typeid(std::string)) {
+ g_capabilitiesToRetain.insert(boost::get<std::string>(caps));
+ }
+ else if (caps.type() == typeid(std::map<int, std::string>)) {
+ for (const auto& cap : boost::get<std::map<int, std::string>>(caps)) {
+ g_capabilitiesToRetain.insert(cap.second);
+ }
+ }
+ });
+
+ luaCtx.writeFunction("setUDPSocketBufferSizes", [client](uint64_t recv, uint64_t snd) {
+ if (client) {
+ return;
+ }
+ checkParameterBound("setUDPSocketBufferSizes", recv, std::numeric_limits<uint32_t>::max());
+ checkParameterBound("setUDPSocketBufferSizes", snd, std::numeric_limits<uint32_t>::max());
+ setLuaSideEffect();
+
+ if (g_configurationDone) {
+ g_outputBuffer = "setUDPSocketBufferSizes cannot be used at runtime!\n";
+ return;
+ }
+
+ g_socketUDPSendBuffer = snd;
+ g_socketUDPRecvBuffer = recv;
+ });
+}
+
+vector<std::function<void(void)>> setupLua(LuaContext& luaCtx, bool client, bool configCheck, const std::string& config)
+{
+ // this needs to exist only during the parsing of the configuration
+ // and cannot be captured by lambdas
+ g_launchWork = std::vector<std::function<void(void)>>();
+
+ setupLuaActions(luaCtx);
+ setupLuaConfig(luaCtx, client, configCheck);
+ setupLuaBindings(luaCtx, client);
+ setupLuaBindingsDNSCrypt(luaCtx);
+ setupLuaBindingsDNSQuestion(luaCtx);
+ setupLuaBindingsKVS(luaCtx, client);
+ setupLuaBindingsPacketCache(luaCtx, client);
+ setupLuaBindingsProtoBuf(luaCtx, client, configCheck);
+ setupLuaInspection(luaCtx);
+ setupLuaRules(luaCtx);
+ setupLuaVars(luaCtx);
+ setupLuaWeb(luaCtx);
+
+#ifdef LUAJIT_VERSION
+ luaCtx.executeCode(getLuaFFIWrappers());
+#endif
+
+ std::ifstream ifs(config);
+ if (!ifs)
+ warnlog("Unable to read configuration from '%s'", config);
+ else
+ vinfolog("Read configuration from '%s'", config);
+
+ luaCtx.executeCode(ifs);
+
+ auto ret = *g_launchWork;
+ g_launchWork = boost::none;
+ return ret;
+}
diff --git a/dnsdist-lua.hh b/dnsdist-lua.hh
new file mode 100644
index 0000000..b8230eb
--- /dev/null
+++ b/dnsdist-lua.hh
@@ -0,0 +1,109 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <random>
+
+struct ResponseConfig
+{
+ boost::optional<bool> setAA{boost::none};
+ boost::optional<bool> setAD{boost::none};
+ boost::optional<bool> setRA{boost::none};
+ uint32_t ttl{60};
+};
+void setResponseHeadersFromConfig(dnsheader& dh, const ResponseConfig& config);
+
+class SpoofAction : public DNSAction
+{
+public:
+ SpoofAction(const vector<ComboAddress>& addrs): d_addrs(addrs)
+ {
+ for (const auto& addr : d_addrs) {
+ if (addr.isIPv4()) {
+ d_types.insert(QType::A);
+ }
+ else if (addr.isIPv6()) {
+ d_types.insert(QType::AAAA);
+ }
+ }
+
+ if (!d_addrs.empty()) {
+ d_types.insert(QType::ANY);
+ }
+ }
+
+ SpoofAction(const DNSName& cname): d_cname(cname)
+ {
+ }
+
+ SpoofAction(const vector<std::string>& raws): d_rawResponses(raws)
+ {
+ }
+
+ DNSAction::Action operator()(DNSQuestion* dq, string* ruleresult) const override;
+
+ string toString() const override
+ {
+ string ret = "spoof in ";
+ if (!d_cname.empty()) {
+ ret += d_cname.toString() + " ";
+ }
+ if (d_rawResponses.size() > 0) {
+ ret += "raw bytes ";
+ }
+ else {
+ for(const auto& a : d_addrs)
+ ret += a.toString()+" ";
+ }
+ return ret;
+ }
+
+
+ ResponseConfig d_responseConfig;
+private:
+ static thread_local std::default_random_engine t_randomEngine;
+ std::vector<ComboAddress> d_addrs;
+ std::set<uint16_t> d_types;
+ std::vector<std::string> d_rawResponses;
+ DNSName d_cname;
+};
+
+typedef boost::variant<string, vector<pair<int, string>>, std::shared_ptr<DNSRule>, DNSName, vector<pair<int, DNSName> > > luadnsrule_t;
+std::shared_ptr<DNSRule> makeRule(const luadnsrule_t& var);
+typedef std::unordered_map<std::string, boost::variant<std::string> > luaruleparams_t;
+void parseRuleParams(boost::optional<luaruleparams_t> params, boost::uuids::uuid& uuid, std::string& name, uint64_t& creationOrder);
+
+typedef NetmaskTree<DynBlock, AddressAndPortRange> nmts_t;
+
+vector<std::function<void(void)>> setupLua(LuaContext& luaCtx, bool client, bool configCheck, const std::string& config);
+void setupLuaActions(LuaContext& luaCtx);
+void setupLuaBindings(LuaContext& luaCtx, bool client);
+void setupLuaBindingsDNSCrypt(LuaContext& luaCtx);
+void setupLuaBindingsDNSQuestion(LuaContext& luaCtx);
+void setupLuaBindingsKVS(LuaContext& luaCtx, bool client);
+void setupLuaBindingsPacketCache(LuaContext& luaCtx, bool client);
+void setupLuaBindingsProtoBuf(LuaContext& luaCtx, bool client, bool configCheck);
+void setupLuaRules(LuaContext& luaCtx);
+void setupLuaInspection(LuaContext& luaCtx);
+void setupLuaVars(LuaContext& luaCtx);
+void setupLuaWeb(LuaContext& luaCtx);
+void setupLuaLoadBalancingContext(LuaContext& luaCtx);
diff --git a/dnsdist-nghttp2.cc b/dnsdist-nghttp2.cc
new file mode 100644
index 0000000..9d5781e
--- /dev/null
+++ b/dnsdist-nghttp2.cc
@@ -0,0 +1,1206 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#ifdef HAVE_NGHTTP2
+#include <nghttp2/nghttp2.h>
+#endif /* HAVE_NGHTTP2 */
+
+#include "dnsdist-nghttp2.hh"
+#include "dnsdist-tcp.hh"
+#include "dnsdist-tcp-downstream.hh"
+
+#include "dolog.hh"
+#include "iputils.hh"
+#include "libssl.hh"
+#include "noinitvector.hh"
+#include "tcpiohandler.hh"
+#include "threadname.hh"
+#include "sstuff.hh"
+
+std::atomic<uint64_t> g_dohStatesDumpRequested{0};
+std::unique_ptr<DoHClientCollection> g_dohClientThreads{nullptr};
+std::optional<uint16_t> g_outgoingDoHWorkerThreads{std::nullopt};
+
+#ifdef HAVE_NGHTTP2
+class DoHConnectionToBackend : public ConnectionToBackend
+{
+public:
+ DoHConnectionToBackend(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, const struct timeval& now, std::string&& proxyProtocolPayload);
+
+ void handleTimeout(const struct timeval& now, bool write) override;
+ void queueQuery(std::shared_ptr<TCPQuerySender>& sender, TCPQuery&& query) override;
+
+ std::string toString() const override
+ {
+ ostringstream o;
+ o << "DoH connection to backend " << (d_ds ? d_ds->getName() : "empty") << " over FD " << (d_handler ? std::to_string(d_handler->getDescriptor()) : "no socket") << ", " << getConcurrentStreamsCount() << " streams";
+ return o.str();
+ }
+
+ void setHealthCheck(bool h)
+ {
+ d_healthCheckQuery = h;
+ }
+
+ void stopIO() override;
+ bool reachedMaxConcurrentQueries() const override;
+ bool reachedMaxStreamID() const override;
+ bool isIdle() const override;
+ void release() override
+ {
+ }
+
+private:
+ static ssize_t send_callback(nghttp2_session* session, const uint8_t* data, size_t length, int flags, void* user_data);
+ static int on_frame_recv_callback(nghttp2_session* session, const nghttp2_frame* frame, void* user_data);
+ static int on_data_chunk_recv_callback(nghttp2_session* session, uint8_t flags, int32_t stream_id, const uint8_t* data, size_t len, void* user_data);
+ static int on_stream_close_callback(nghttp2_session* session, int32_t stream_id, uint32_t error_code, void* user_data);
+ static int on_header_callback(nghttp2_session* session, const nghttp2_frame* frame, const uint8_t* name, size_t namelen, const uint8_t* value, size_t valuelen, uint8_t flags, void* user_data);
+ static int on_error_callback(nghttp2_session* session, int lib_error_code, const char* msg, size_t len, void* user_data);
+ static void handleReadableIOCallback(int fd, FDMultiplexer::funcparam_t& param);
+ static void handleWritableIOCallback(int fd, FDMultiplexer::funcparam_t& param);
+
+ static void addStaticHeader(std::vector<nghttp2_nv>& headers, const std::string& nameKey, const std::string& valueKey);
+ static void addDynamicHeader(std::vector<nghttp2_nv>& headers, const std::string& nameKey, const std::string& value);
+
+ class PendingRequest
+ {
+ public:
+ std::shared_ptr<TCPQuerySender> d_sender{nullptr};
+ TCPQuery d_query;
+ PacketBuffer d_buffer;
+ size_t d_queryPos{0};
+ uint16_t d_responseCode{0};
+ bool d_finished{false};
+ };
+ void addToIOState(IOState state, FDMultiplexer::callbackfunc_t callback);
+ void updateIO(IOState newState, FDMultiplexer::callbackfunc_t callback, bool noTTD = false);
+ void watchForRemoteHostClosingConnection();
+ void handleResponse(PendingRequest&& request);
+ void handleResponseError(PendingRequest&& request, const struct timeval& now);
+ void handleIOError();
+ uint32_t getConcurrentStreamsCount() const;
+
+ size_t getUsageCount() const
+ {
+ auto ref = shared_from_this();
+ return ref.use_count();
+ }
+
+ static const std::unordered_map<std::string, std::string> s_constants;
+
+ std::unordered_map<int32_t, PendingRequest> d_currentStreams;
+ std::string d_proxyProtocolPayload;
+ PacketBuffer d_out;
+ PacketBuffer d_in;
+ std::unique_ptr<nghttp2_session, void (*)(nghttp2_session*)> d_session{nullptr, nghttp2_session_del};
+ size_t d_outPos{0};
+ size_t d_inPos{0};
+ bool d_healthCheckQuery{false};
+ bool d_firstWrite{true};
+};
+
+using DownstreamDoHConnectionsManager = DownstreamConnectionsManager<DoHConnectionToBackend>;
+thread_local DownstreamDoHConnectionsManager t_downstreamDoHConnectionsManager;
+
+uint32_t DoHConnectionToBackend::getConcurrentStreamsCount() const
+{
+ return d_currentStreams.size();
+}
+
+void DoHConnectionToBackend::handleResponse(PendingRequest&& request)
+{
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ try {
+ request.d_sender->handleResponse(now, TCPResponse(std::move(request.d_buffer), std::move(request.d_query.d_idstate), shared_from_this()));
+ }
+ catch (const std::exception& e) {
+ vinfolog("Got exception while handling response for cross-protocol DoH: %s", e.what());
+ }
+}
+
+void DoHConnectionToBackend::handleResponseError(PendingRequest&& request, const struct timeval& now)
+{
+ try {
+ request.d_sender->notifyIOError(std::move(request.d_query.d_idstate), now);
+ }
+ catch (const std::exception& e) {
+ vinfolog("Got exception while handling response for cross-protocol DoH: %s", e.what());
+ }
+}
+
+void DoHConnectionToBackend::handleIOError()
+{
+ d_connectionDied = true;
+ nghttp2_session_terminate_session(d_session.get(), NGHTTP2_PROTOCOL_ERROR);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ for (auto& request : d_currentStreams) {
+ handleResponseError(std::move(request.second), now);
+ }
+
+ d_currentStreams.clear();
+ stopIO();
+}
+
+void DoHConnectionToBackend::handleTimeout(const struct timeval& now, bool write)
+{
+ if (write) {
+ if (d_firstWrite) {
+ ++d_ds->tcpConnectTimeouts;
+ }
+ else {
+ ++d_ds->tcpWriteTimeouts;
+ }
+ }
+ else {
+ ++d_ds->tcpReadTimeouts;
+ }
+
+ handleIOError();
+}
+
+bool DoHConnectionToBackend::reachedMaxStreamID() const
+{
+ const uint32_t maximumStreamID = (static_cast<uint32_t>(1) << 31) - 1;
+ return d_highestStreamID == maximumStreamID;
+}
+
+bool DoHConnectionToBackend::reachedMaxConcurrentQueries() const
+{
+ //cerr<<"Got "<<getConcurrentStreamsCount()<<" concurrent streams, max is "<<nghttp2_session_get_remote_settings(d_session.get(), NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS)<<endl;
+ if (nghttp2_session_get_remote_settings(d_session.get(), NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS) <= getConcurrentStreamsCount()) {
+ return true;
+ }
+ return false;
+}
+
+bool DoHConnectionToBackend::isIdle() const
+{
+ return getConcurrentStreamsCount() == 0;
+}
+
+const std::unordered_map<std::string, std::string> DoHConnectionToBackend::s_constants = {
+ {"method-name", ":method"},
+ {"method-value", "POST"},
+ {"scheme-name", ":scheme"},
+ {"scheme-value", "https"},
+ {"accept-name", "accept"},
+ {"accept-value", "application/dns-message"},
+ {"content-type-name", "content-type"},
+ {"content-type-value", "application/dns-message"},
+ {"user-agent-name", "user-agent"},
+ {"user-agent-value", "nghttp2-" NGHTTP2_VERSION "/dnsdist"},
+ {"authority-name", ":authority"},
+ {"path-name", ":path"},
+ {"content-length-name", "content-length"},
+ {"x-forwarded-for-name", "x-forwarded-for"},
+ {"x-forwarded-port-name", "x-forwarded-port"},
+ {"x-forwarded-proto-name", "x-forwarded-proto"},
+ {"x-forwarded-proto-value-dns-over-udp", "dns-over-udp"},
+ {"x-forwarded-proto-value-dns-over-tcp", "dns-over-tcp"},
+ {"x-forwarded-proto-value-dns-over-tls", "dns-over-tls"},
+ {"x-forwarded-proto-value-dns-over-http", "dns-over-http"},
+ {"x-forwarded-proto-value-dns-over-https", "dns-over-https"},
+};
+
+void DoHConnectionToBackend::addStaticHeader(std::vector<nghttp2_nv>& headers, const std::string& nameKey, const std::string& valueKey)
+{
+ const auto& name = s_constants.at(nameKey);
+ const auto& value = s_constants.at(valueKey);
+
+ headers.push_back({const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(name.c_str())), const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(value.c_str())), name.size(), value.size(), NGHTTP2_NV_FLAG_NO_COPY_NAME | NGHTTP2_NV_FLAG_NO_COPY_VALUE});
+}
+
+void DoHConnectionToBackend::addDynamicHeader(std::vector<nghttp2_nv>& headers, const std::string& nameKey, const std::string& value)
+{
+ const auto& name = s_constants.at(nameKey);
+
+ headers.push_back({const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(name.c_str())), const_cast<uint8_t*>(reinterpret_cast<const uint8_t*>(value.c_str())), name.size(), value.size(), NGHTTP2_NV_FLAG_NO_COPY_NAME | NGHTTP2_NV_FLAG_NO_COPY_VALUE});
+}
+
+void DoHConnectionToBackend::queueQuery(std::shared_ptr<TCPQuerySender>& sender, TCPQuery&& query)
+{
+ auto payloadSize = std::to_string(query.d_buffer.size());
+
+ bool addXForwarded = d_ds->d_addXForwardedHeaders;
+
+ /* We use nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_NAME and nghttp2_nv_flag.NGHTTP2_NV_FLAG_NO_COPY_VALUE
+ to avoid a copy and lowercasing but we need to make sure that the data will outlive the request (nghttp2_on_frame_send_callback called), and that it is already lowercased. */
+ std::vector<nghttp2_nv> headers;
+ // these need to live until after the request headers have been processed
+ std::string remote;
+ std::string remotePort;
+ headers.reserve(8 + (addXForwarded ? 3 : 0));
+
+ /* Pseudo-headers need to come first (rfc7540 8.1.2.1) */
+ addStaticHeader(headers, "method-name", "method-value");
+ addStaticHeader(headers, "scheme-name", "scheme-value");
+ addDynamicHeader(headers, "authority-name", d_ds->d_tlsSubjectName);
+ addDynamicHeader(headers, "path-name", d_ds->d_dohPath);
+ addStaticHeader(headers, "accept-name", "accept-value");
+ addStaticHeader(headers, "content-type-name", "content-type-value");
+ addStaticHeader(headers, "user-agent-name", "user-agent-value");
+ addDynamicHeader(headers, "content-length-name", payloadSize);
+ /* no need to add these headers for health-check queries */
+ if (addXForwarded && query.d_idstate.origRemote.getPort() != 0) {
+ remote = query.d_idstate.origRemote.toString();
+ remotePort = std::to_string(query.d_idstate.origRemote.getPort());
+ addDynamicHeader(headers, "x-forwarded-for-name", remote);
+ addDynamicHeader(headers, "x-forwarded-port-name", remotePort);
+ if (query.d_idstate.cs != nullptr) {
+ if (query.d_idstate.cs->isUDP()) {
+ addStaticHeader(headers, "x-forwarded-proto-name", "x-forwarded-proto-value-dns-over-udp");
+ }
+ else if (query.d_idstate.cs->isDoH()) {
+ if (query.d_idstate.cs->hasTLS()) {
+ addStaticHeader(headers, "x-forwarded-proto-name", "x-forwarded-proto-value-dns-over-https");
+ }
+ else {
+ addStaticHeader(headers, "x-forwarded-proto-name", "x-forwarded-proto-value-dns-over-http");
+ }
+ }
+ else if (query.d_idstate.cs->hasTLS()) {
+ addStaticHeader(headers, "x-forwarded-proto-name", "x-forwarded-proto-value-dns-over-tls");
+ }
+ else {
+ addStaticHeader(headers, "x-forwarded-proto-name", "x-forwarded-proto-value-dns-over-tcp");
+ }
+ }
+ }
+
+ PendingRequest pending;
+ pending.d_query = std::move(query);
+ pending.d_sender = std::move(sender);
+
+ uint32_t streamId = nghttp2_session_get_next_stream_id(d_session.get());
+ auto insertPair = d_currentStreams.insert({streamId, std::move(pending)});
+ if (!insertPair.second) {
+ /* there is a stream ID collision, something is very wrong! */
+ d_connectionDied = true;
+ nghttp2_session_terminate_session(d_session.get(), NGHTTP2_NO_ERROR);
+ throw std::runtime_error("Stream ID collision");
+ }
+
+ /* if data_prd is not NULL, it provides data which will be sent in subsequent DATA frames. In this case, a method that allows request message bodies (https://tools.ietf.org/html/rfc7231#section-4) must be specified with :method key (e.g. POST). This function does not take ownership of the data_prd. The function copies the members of the data_prd. If data_prd is NULL, HEADERS have END_STREAM set.
+ */
+ nghttp2_data_provider data_provider;
+
+ /* we will not use this pointer */
+ data_provider.source.ptr = this;
+ data_provider.read_callback = [](nghttp2_session* session, int32_t stream_id, uint8_t* buf, size_t length, uint32_t* data_flags, nghttp2_data_source* source, void* user_data) -> ssize_t {
+ auto conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
+ auto& request = conn->d_currentStreams.at(stream_id);
+ size_t toCopy = 0;
+ if (request.d_queryPos < request.d_query.d_buffer.size()) {
+ size_t remaining = request.d_query.d_buffer.size() - request.d_queryPos;
+ toCopy = length > remaining ? remaining : length;
+ memcpy(buf, &request.d_query.d_buffer.at(request.d_queryPos), toCopy);
+ request.d_queryPos += toCopy;
+ }
+
+ if (request.d_queryPos >= request.d_query.d_buffer.size()) {
+ *data_flags |= NGHTTP2_DATA_FLAG_EOF;
+ }
+ return toCopy;
+ };
+
+ auto newStreamId = nghttp2_submit_request(d_session.get(), nullptr, headers.data(), headers.size(), &data_provider, this);
+ if (newStreamId < 0) {
+ d_connectionDied = true;
+ ++d_ds->tcpDiedSendingQuery;
+ d_currentStreams.erase(streamId);
+ throw std::runtime_error("Error submitting HTTP request:" + std::string(nghttp2_strerror(newStreamId)));
+ }
+
+ auto rv = nghttp2_session_send(d_session.get());
+ if (rv != 0) {
+ d_connectionDied = true;
+ ++d_ds->tcpDiedSendingQuery;
+ d_currentStreams.erase(streamId);
+ throw std::runtime_error("Error in nghttp2_session_send:" + std::to_string(rv));
+ }
+
+ d_highestStreamID = newStreamId;
+}
+
+class DoHClientThreadData
+{
+public:
+ DoHClientThreadData() :
+ mplexer(std::unique_ptr<FDMultiplexer>(FDMultiplexer::getMultiplexerSilent()))
+ {
+ }
+
+ std::unique_ptr<FDMultiplexer> mplexer{nullptr};
+};
+
+void DoHConnectionToBackend::handleReadableIOCallback(int fd, FDMultiplexer::funcparam_t& param)
+{
+ auto conn = boost::any_cast<std::shared_ptr<DoHConnectionToBackend>>(param);
+ if (fd != conn->getHandle()) {
+ throw std::runtime_error("Unexpected socket descriptor " + std::to_string(fd) + " received in " + std::string(__PRETTY_FUNCTION__) + ", expected " + std::to_string(conn->getHandle()));
+ }
+
+ IOStateGuard ioGuard(conn->d_ioState);
+ do {
+ conn->d_inPos = 0;
+ conn->d_in.resize(conn->d_in.size() + 512);
+ // cerr<<"trying to read "<<conn->d_in.size()<<endl;
+ try {
+ IOState newState = conn->d_handler->tryRead(conn->d_in, conn->d_inPos, conn->d_in.size(), true);
+ // cerr<<"got a "<<(int)newState<<" state and "<<conn->d_inPos<<" bytes"<<endl;
+ conn->d_in.resize(conn->d_inPos);
+
+ if (conn->d_inPos > 0) {
+ /* we got something */
+ auto readlen = nghttp2_session_mem_recv(conn->d_session.get(), conn->d_in.data(), conn->d_inPos);
+ // cerr<<"nghttp2_session_mem_recv returned "<<readlen<<endl;
+ /* as long as we don't require a pause by returning nghttp2_error.NGHTTP2_ERR_PAUSE from a CB,
+ all data should be consumed before returning */
+ if (readlen > 0 && static_cast<size_t>(readlen) < conn->d_inPos) {
+ throw std::runtime_error("Fatal error while passing received data to nghttp2: " + std::string(nghttp2_strerror((int)readlen)));
+ }
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ conn->d_lastDataReceivedTime = now;
+
+ // cerr<<"after read send"<<endl;
+ nghttp2_session_send(conn->d_session.get());
+ }
+
+ if (newState == IOState::Done) {
+ if (conn->isIdle()) {
+ conn->stopIO();
+ conn->watchForRemoteHostClosingConnection();
+ ioGuard.release();
+ break;
+ }
+ }
+ else {
+ if (newState == IOState::NeedWrite) {
+ // cerr<<"need write"<<endl;
+ conn->updateIO(IOState::NeedWrite, handleReadableIOCallback);
+ }
+ ioGuard.release();
+ break;
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Exception while trying to read from HTTP backend connection: %s", e.what());
+ ++conn->d_ds->tcpDiedReadingResponse;
+ conn->handleIOError();
+ break;
+ }
+ } while (conn->getConcurrentStreamsCount() > 0);
+}
+
+void DoHConnectionToBackend::handleWritableIOCallback(int fd, FDMultiplexer::funcparam_t& param)
+{
+ auto conn = boost::any_cast<std::shared_ptr<DoHConnectionToBackend>>(param);
+ if (fd != conn->getHandle()) {
+ throw std::runtime_error("Unexpected socket descriptor " + std::to_string(fd) + " received in " + std::string(__PRETTY_FUNCTION__) + ", expected " + std::to_string(conn->getHandle()));
+ }
+ IOStateGuard ioGuard(conn->d_ioState);
+
+ // cerr<<"in "<<__PRETTY_FUNCTION__<<" trying to write "<<conn->d_out.size()-conn->d_outPos<<endl;
+ try {
+ IOState newState = conn->d_handler->tryWrite(conn->d_out, conn->d_outPos, conn->d_out.size());
+ // cerr<<"got a "<<(int)newState<<" state, "<<conn->d_out.size()-conn->d_outPos<<" bytes remaining"<<endl;
+ if (newState == IOState::NeedRead) {
+ conn->updateIO(IOState::NeedRead, handleWritableIOCallback);
+ }
+ else if (newState == IOState::Done) {
+ // cerr<<"done, buffer size was "<<conn->d_out.size()<<", pos was "<<conn->d_outPos<<endl;
+ conn->d_firstWrite = false;
+ conn->d_out.clear();
+ conn->d_outPos = 0;
+ conn->stopIO();
+ if (!conn->isIdle()) {
+ conn->updateIO(IOState::NeedRead, handleReadableIOCallback);
+ }
+ else {
+ conn->watchForRemoteHostClosingConnection();
+ }
+ }
+ ioGuard.release();
+ }
+ catch (const std::exception& e) {
+ vinfolog("Exception while trying to write (ready) to HTTP backend connection: %s", e.what());
+ ++conn->d_ds->tcpDiedSendingQuery;
+ conn->handleIOError();
+ }
+}
+
+void DoHConnectionToBackend::stopIO()
+{
+ d_ioState->reset();
+
+ auto shared = std::dynamic_pointer_cast<DoHConnectionToBackend>(shared_from_this());
+ if (!willBeReusable(false)) {
+ /* remove ourselves from the connection cache, this might mean that our
+ reference count drops to zero after that, so we need to be careful */
+ t_downstreamDoHConnectionsManager.removeDownstreamConnection(shared);
+ }
+ else {
+ t_downstreamDoHConnectionsManager.moveToIdle(shared);
+ }
+}
+
+void DoHConnectionToBackend::updateIO(IOState newState, FDMultiplexer::callbackfunc_t callback, bool noTTD)
+{
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ boost::optional<struct timeval> ttd{boost::none};
+ if (!noTTD) {
+ if (d_healthCheckQuery) {
+ ttd = getBackendHealthCheckTTD(now);
+ }
+ else if (newState == IOState::NeedRead) {
+ ttd = getBackendReadTTD(now);
+ }
+ else if (isFresh() && d_firstWrite) {
+ /* first write just after the non-blocking connect */
+ ttd = getBackendConnectTTD(now);
+ }
+ else {
+ ttd = getBackendWriteTTD(now);
+ }
+ }
+
+ auto shared = std::dynamic_pointer_cast<DoHConnectionToBackend>(shared_from_this());
+ if (shared) {
+ if (newState == IOState::NeedRead) {
+ d_ioState->update(newState, callback, shared, ttd);
+ }
+ else if (newState == IOState::NeedWrite) {
+ d_ioState->update(newState, callback, shared, ttd);
+ }
+ }
+}
+
+void DoHConnectionToBackend::watchForRemoteHostClosingConnection()
+{
+ if (willBeReusable(false) && !d_healthCheckQuery) {
+ updateIO(IOState::NeedRead, handleReadableIOCallback, false);
+ }
+}
+
+void DoHConnectionToBackend::addToIOState(IOState state, FDMultiplexer::callbackfunc_t callback)
+{
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ boost::optional<struct timeval> ttd{boost::none};
+ if (state == IOState::NeedRead) {
+ ttd = getBackendReadTTD(now);
+ }
+ else if (isFresh() && d_firstWrite == 0) {
+ /* first write just after the non-blocking connect */
+ ttd = getBackendConnectTTD(now);
+ }
+ else {
+ ttd = getBackendWriteTTD(now);
+ }
+
+ auto shared = std::dynamic_pointer_cast<DoHConnectionToBackend>(shared_from_this());
+ if (shared) {
+ if (state == IOState::NeedRead) {
+ d_ioState->add(state, callback, shared, ttd);
+ }
+ else if (state == IOState::NeedWrite) {
+ d_ioState->add(state, callback, shared, ttd);
+ }
+ }
+}
+
+ssize_t DoHConnectionToBackend::send_callback(nghttp2_session* session, const uint8_t* data, size_t length, int flags, void* user_data)
+{
+ DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
+ bool bufferWasEmpty = conn->d_out.empty();
+ if (!conn->d_proxyProtocolPayloadSent && !conn->d_proxyProtocolPayload.empty()) {
+ conn->d_out.insert(conn->d_out.end(), conn->d_proxyProtocolPayload.begin(), conn->d_proxyProtocolPayload.end());
+ conn->d_proxyProtocolPayloadSent = true;
+ }
+
+ conn->d_out.insert(conn->d_out.end(), data, data + length);
+
+ if (bufferWasEmpty) {
+ try {
+ // cerr<<"in "<<__PRETTY_FUNCTION__<<" trying to write "<<conn->d_out.size()-conn->d_outPos<<endl;
+ auto state = conn->d_handler->tryWrite(conn->d_out, conn->d_outPos, conn->d_out.size());
+ // cerr<<"got a "<<(int)state<<" state, "<<conn->d_out.size()-conn->d_outPos<<" bytes remaining"<<endl;
+ if (state == IOState::Done) {
+ conn->d_firstWrite = false;
+ conn->d_out.clear();
+ conn->d_outPos = 0;
+ conn->stopIO();
+ if (!conn->isIdle()) {
+ conn->updateIO(IOState::NeedRead, handleReadableIOCallback);
+ }
+ else {
+ conn->watchForRemoteHostClosingConnection();
+ }
+ }
+ else {
+ conn->updateIO(state, handleWritableIOCallback);
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Exception while trying to write (send) to HTTP backend connection: %s", e.what());
+ conn->handleIOError();
+ ++conn->d_ds->tcpDiedSendingQuery;
+ }
+ }
+
+ return length;
+}
+
+int DoHConnectionToBackend::on_frame_recv_callback(nghttp2_session* session, const nghttp2_frame* frame, void* user_data)
+{
+ DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
+ // cerr<<"Frame type is "<<std::to_string(frame->hd.type)<<endl;
+#if 0
+ switch (frame->hd.type) {
+ case NGHTTP2_HEADERS:
+ cerr<<"got headers"<<endl;
+ if (frame->headers.cat == NGHTTP2_HCAT_RESPONSE) {
+ cerr<<"All headers received"<<endl;
+ }
+ break;
+ case NGHTTP2_WINDOW_UPDATE:
+ cerr<<"got window update"<<endl;
+ break;
+ case NGHTTP2_SETTINGS:
+ cerr<<"got settings"<<endl;
+ cerr<<frame->settings.niv<<endl;
+ for (size_t idx = 0; idx < frame->settings.niv; idx++) {
+ cerr<<"- "<<frame->settings.iv[idx].settings_id<<" "<<frame->settings.iv[idx].value<<endl;
+ }
+ break;
+ case NGHTTP2_DATA:
+ cerr<<"got data"<<endl;
+ break;
+ }
+#endif
+
+ if (frame->hd.type == NGHTTP2_GOAWAY) {
+ conn->d_connectionDied = true;
+ }
+
+ /* is this the last frame for this stream? */
+ else if ((frame->hd.type == NGHTTP2_HEADERS || frame->hd.type == NGHTTP2_DATA) && frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
+ auto stream = conn->d_currentStreams.find(frame->hd.stream_id);
+ if (stream != conn->d_currentStreams.end()) {
+ // cerr<<"Stream "<<frame->hd.stream_id<<" is now finished"<<endl;
+ stream->second.d_finished = true;
+ ++conn->d_queries;
+
+ auto request = std::move(stream->second);
+ conn->d_currentStreams.erase(stream->first);
+ if (request.d_responseCode == 200U) {
+ conn->handleResponse(std::move(request));
+ }
+ else {
+ vinfolog("HTTP response has a non-200 status code: %d", request.d_responseCode);
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ conn->handleResponseError(std::move(request), now);
+ }
+
+ if (conn->isIdle()) {
+ conn->stopIO();
+ conn->watchForRemoteHostClosingConnection();
+ }
+ }
+ else {
+ vinfolog("Stream %d NOT FOUND", frame->hd.stream_id);
+ conn->d_connectionDied = true;
+ ++conn->d_ds->tcpDiedReadingResponse;
+ return NGHTTP2_ERR_CALLBACK_FAILURE;
+ }
+ }
+
+ return 0;
+}
+
+int DoHConnectionToBackend::on_data_chunk_recv_callback(nghttp2_session* session, uint8_t flags, int32_t stream_id, const uint8_t* data, size_t len, void* user_data)
+{
+ DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
+ // cerr<<"Got data of size "<<len<<" for stream "<<stream_id<<endl;
+ auto stream = conn->d_currentStreams.find(stream_id);
+ if (stream == conn->d_currentStreams.end()) {
+ vinfolog("Unable to match the stream ID %d to a known one!", stream_id);
+ conn->d_connectionDied = true;
+ ++conn->d_ds->tcpDiedReadingResponse;
+ return NGHTTP2_ERR_CALLBACK_FAILURE;
+ }
+ if (len > std::numeric_limits<uint16_t>::max() || (std::numeric_limits<uint16_t>::max() - stream->second.d_buffer.size()) < len) {
+ vinfolog("Data frame of size %d is too large for a DNS response (we already have %d)", len, stream->second.d_buffer.size());
+ conn->d_connectionDied = true;
+ ++conn->d_ds->tcpDiedReadingResponse;
+ return NGHTTP2_ERR_CALLBACK_FAILURE;
+ }
+
+ stream->second.d_buffer.insert(stream->second.d_buffer.end(), data, data + len);
+ if (stream->second.d_finished) {
+ // cerr<<"we now have the full response!"<<endl;
+ // cerr<<std::string(reinterpret_cast<const char*>(data), len)<<endl;
+
+ auto request = std::move(stream->second);
+ conn->d_currentStreams.erase(stream->first);
+ if (request.d_responseCode == 200U) {
+ conn->handleResponse(std::move(request));
+ }
+ else {
+ vinfolog("HTTP response has a non-200 status code: %d", request.d_responseCode);
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ conn->handleResponseError(std::move(request), now);
+ }
+ if (conn->isIdle()) {
+ conn->stopIO();
+ conn->watchForRemoteHostClosingConnection();
+ }
+ }
+
+ return 0;
+}
+
+int DoHConnectionToBackend::on_stream_close_callback(nghttp2_session* session, int32_t stream_id, uint32_t error_code, void* user_data)
+{
+ DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
+
+ if (error_code == 0) {
+ return 0;
+ }
+
+ // cerr << "Stream " << stream_id << " closed with error_code=" << error_code << endl;
+ conn->d_connectionDied = true;
+ ++conn->d_ds->tcpDiedReadingResponse;
+
+ auto stream = conn->d_currentStreams.find(stream_id);
+ if (stream == conn->d_currentStreams.end()) {
+ /* we don't care, then */
+ return 0;
+ }
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ auto request = std::move(stream->second);
+ conn->d_currentStreams.erase(stream->first);
+
+ // cerr<<"Query has "<<request.d_query.d_downstreamFailures<<" failures, backend limit is "<<conn->d_ds->d_retries<<endl;
+ if (request.d_query.d_downstreamFailures < conn->d_ds->d_retries) {
+ // cerr<<"in "<<__PRETTY_FUNCTION__<<", looking for a connection to send a query of size "<<request.d_query.d_buffer.size()<<endl;
+ ++request.d_query.d_downstreamFailures;
+ auto downstream = t_downstreamDoHConnectionsManager.getConnectionToDownstream(conn->d_mplexer, conn->d_ds, now, std::string(conn->d_proxyProtocolPayload));
+ downstream->queueQuery(request.d_sender, std::move(request.d_query));
+ }
+ else {
+ conn->handleResponseError(std::move(request), now);
+ }
+
+ //cerr<<"we now have "<<conn->getConcurrentStreamsCount()<<" concurrent connections"<<endl;
+ if (conn->isIdle()) {
+ //cerr<<"stopping IO"<<endl;
+ conn->stopIO();
+ conn->watchForRemoteHostClosingConnection();
+ }
+
+ return 0;
+}
+
+int DoHConnectionToBackend::on_header_callback(nghttp2_session* session, const nghttp2_frame* frame, const uint8_t* name, size_t namelen, const uint8_t* value, size_t valuelen, uint8_t flags, void* user_data)
+{
+ DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
+
+ const std::string status(":status");
+ if (frame->hd.type == NGHTTP2_HEADERS && frame->headers.cat == NGHTTP2_HCAT_RESPONSE) {
+ //cerr<<"got header for "<<frame->hd.stream_id<<":"<<endl;
+ //cerr<<"- "<<std::string(reinterpret_cast<const char*>(name), namelen)<<endl;
+ //cerr<<"- "<<std::string(reinterpret_cast<const char*>(value), valuelen)<<endl;
+ if (namelen == status.size() && memcmp(status.data(), name, status.size()) == 0) {
+ auto stream = conn->d_currentStreams.find(frame->hd.stream_id);
+ if (stream == conn->d_currentStreams.end()) {
+ vinfolog("Unable to match the stream ID %d to a known one!", frame->hd.stream_id);
+ conn->d_connectionDied = true;
+ return NGHTTP2_ERR_CALLBACK_FAILURE;
+ }
+ try {
+ stream->second.d_responseCode = pdns_stou(std::string(reinterpret_cast<const char*>(value), valuelen));
+ }
+ catch (...) {
+ vinfolog("Error parsing the status header for stream ID %d", frame->hd.stream_id);
+ conn->d_connectionDied = true;
+ ++conn->d_ds->tcpDiedReadingResponse;
+ return NGHTTP2_ERR_CALLBACK_FAILURE;
+ }
+ }
+ }
+ return 0;
+}
+
+int DoHConnectionToBackend::on_error_callback(nghttp2_session* session, int lib_error_code, const char* msg, size_t len, void* user_data)
+{
+ vinfolog("Error in HTTP/2 connection: %s", std::string(msg, len));
+
+ DoHConnectionToBackend* conn = reinterpret_cast<DoHConnectionToBackend*>(user_data);
+ conn->d_connectionDied = true;
+ ++conn->d_ds->tcpDiedReadingResponse;
+
+ return 0;
+}
+
+DoHConnectionToBackend::DoHConnectionToBackend(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, const struct timeval& now, std::string&& proxyProtocolPayload) :
+ ConnectionToBackend(ds, mplexer, now), d_proxyProtocolPayload(std::move(proxyProtocolPayload))
+{
+ // inherit most of the stuff from the ConnectionToBackend()
+ d_ioState = make_unique<IOStateHandler>(*d_mplexer, d_handler->getDescriptor());
+
+ nghttp2_session_callbacks* cbs = nullptr;
+ if (nghttp2_session_callbacks_new(&cbs) != 0) {
+ d_connectionDied = true;
+ ++d_ds->tcpDiedSendingQuery;
+ vinfolog("Unable to create a callback object for a new HTTP/2 session");
+ return;
+ }
+ std::unique_ptr<nghttp2_session_callbacks, void (*)(nghttp2_session_callbacks*)> callbacks(cbs, nghttp2_session_callbacks_del);
+ cbs = nullptr;
+
+ nghttp2_session_callbacks_set_send_callback(callbacks.get(), send_callback);
+ nghttp2_session_callbacks_set_on_frame_recv_callback(callbacks.get(), on_frame_recv_callback);
+ nghttp2_session_callbacks_set_on_data_chunk_recv_callback(callbacks.get(), on_data_chunk_recv_callback);
+ nghttp2_session_callbacks_set_on_stream_close_callback(callbacks.get(), on_stream_close_callback);
+ nghttp2_session_callbacks_set_on_header_callback(callbacks.get(), on_header_callback);
+ nghttp2_session_callbacks_set_error_callback2(callbacks.get(), on_error_callback);
+
+ nghttp2_session* sess = nullptr;
+ if (nghttp2_session_client_new(&sess, callbacks.get(), this) != 0) {
+ d_connectionDied = true;
+ ++d_ds->tcpDiedSendingQuery;
+ vinfolog("Coult not allocate a new HTTP/2 session");
+ return;
+ }
+
+ d_session = std::unique_ptr<nghttp2_session, void (*)(nghttp2_session*)>(sess, nghttp2_session_del);
+ sess = nullptr;
+
+ callbacks.reset();
+
+ nghttp2_settings_entry iv[] = {
+ /* rfc7540 section-8.2.2:
+ "Advertising a SETTINGS_MAX_CONCURRENT_STREAMS value of zero disables
+ server push by preventing the server from creating the necessary
+ streams."
+ */
+ {NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 0},
+ {NGHTTP2_SETTINGS_ENABLE_PUSH, 0},
+ /* we might want to make the initial window size configurable, but 16M is a large enough default */
+ {NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE, 16 * 1024 * 1024}};
+ /* client 24 bytes magic string will be sent by nghttp2 library */
+ int rv = nghttp2_submit_settings(d_session.get(), NGHTTP2_FLAG_NONE, iv, sizeof(iv) / sizeof(*iv));
+ if (rv != 0) {
+ d_connectionDied = true;
+ ++d_ds->tcpDiedSendingQuery;
+ vinfolog("Could not submit SETTINGS: %s", nghttp2_strerror(rv));
+ return;
+ }
+}
+
+static void handleCrossProtocolQuery(int pipefd, FDMultiplexer::funcparam_t& param)
+{
+ auto threadData = boost::any_cast<DoHClientThreadData*>(param);
+ CrossProtocolQuery* tmp{nullptr};
+
+ ssize_t got = read(pipefd, &tmp, sizeof(tmp));
+ if (got == 0) {
+ throw std::runtime_error("EOF while reading from the DoH cross-protocol pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode");
+ }
+ else if (got == -1) {
+ if (errno == EAGAIN || errno == EINTR) {
+ return;
+ }
+ throw std::runtime_error("Error while reading from the DoH cross-protocol pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode:" + stringerror());
+ }
+ else if (got != sizeof(tmp)) {
+ throw std::runtime_error("Partial read while reading from the DoH cross-protocol pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode");
+ }
+
+ try {
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ std::shared_ptr<TCPQuerySender> tqs = tmp->getTCPQuerySender();
+ auto query = std::move(tmp->query);
+ auto downstreamServer = std::move(tmp->downstream);
+ delete tmp;
+ tmp = nullptr;
+
+ try {
+ auto downstream = t_downstreamDoHConnectionsManager.getConnectionToDownstream(threadData->mplexer, downstreamServer, now, std::move(query.d_proxyProtocolPayload));
+ downstream->queueQuery(tqs, std::move(query));
+ }
+ catch (...) {
+ tqs->notifyIOError(std::move(query.d_idstate), now);
+ }
+ }
+ catch (...) {
+ delete tmp;
+ tmp = nullptr;
+ }
+}
+
+static void dohClientThread(int crossProtocolPipeFD)
+{
+ setThreadName("dnsdist/dohClie");
+
+ try {
+ DoHClientThreadData data;
+ data.mplexer->addReadFD(crossProtocolPipeFD, handleCrossProtocolQuery, &data);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ time_t lastTimeoutScan = now.tv_sec;
+
+ for (;;) {
+ data.mplexer->run(&now);
+
+ if (now.tv_sec > lastTimeoutScan) {
+ lastTimeoutScan = now.tv_sec;
+
+ try {
+ t_downstreamDoHConnectionsManager.cleanupClosedConnections(now);
+ handleH2Timeouts(*data.mplexer, now);
+
+ if (g_dohStatesDumpRequested > 0) {
+ /* just to keep things clean in the output, debug only */
+ static std::mutex s_lock;
+ std::lock_guard<decltype(s_lock)> lck(s_lock);
+ if (g_dohStatesDumpRequested > 0) {
+ /* no race here, we took the lock so it can only be increased in the meantime */
+ --g_dohStatesDumpRequested;
+ errlog("Dumping the DoH client states, as requested:");
+ data.mplexer->runForAllWatchedFDs([](bool isRead, int fd, const FDMultiplexer::funcparam_t& param, struct timeval ttd) {
+ struct timeval lnow;
+ gettimeofday(&lnow, nullptr);
+ if (ttd.tv_sec > 0) {
+ errlog("- Descriptor %d is in %s state, TTD in %d", fd, (isRead ? "read" : "write"), (ttd.tv_sec - lnow.tv_sec));
+ }
+ else {
+ errlog("- Descriptor %d is in %s state, no TTD set", fd, (isRead ? "read" : "write"));
+ }
+
+ if (param.type() == typeid(std::shared_ptr<DoHConnectionToBackend>)) {
+ auto conn = boost::any_cast<std::shared_ptr<DoHConnectionToBackend>>(param);
+ errlog(" - %s", conn->toString());
+ }
+ else if (param.type() == typeid(DoHClientThreadData*)) {
+ errlog(" - Worker thread pipe");
+ }
+ });
+ errlog("The DoH client cache has %d active and %d idle outgoing connections cached", t_downstreamDoHConnectionsManager.getActiveCount(), t_downstreamDoHConnectionsManager.getIdleCount());
+ }
+ }
+ }
+ catch (const std::exception& e) {
+ errlog("Error in outgoing DoH thread: %s", e.what());
+ }
+ }
+ }
+ }
+ catch (const std::exception& e) {
+ errlog("Fatal error in outgoing DoH thread: %s", e.what());
+ }
+}
+
+static bool select_next_proto_callback(unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen)
+{
+ if (nghttp2_select_next_protocol(out, outlen, in, inlen) <= 0) {
+ vinfolog("The remote DoH backend did not advertise " NGHTTP2_PROTO_VERSION_ID);
+ return false;
+ }
+ return true;
+}
+
+#endif /* HAVE_NGHTTP2 */
+
+struct DoHClientCollection::DoHWorkerThread
+{
+ DoHWorkerThread()
+ {
+ }
+
+ DoHWorkerThread(int crossProtocolPipe) :
+ d_crossProtocolQueryPipe(crossProtocolPipe)
+ {
+ }
+
+ DoHWorkerThread(DoHWorkerThread&& rhs) :
+ d_crossProtocolQueryPipe(rhs.d_crossProtocolQueryPipe)
+ {
+ rhs.d_crossProtocolQueryPipe = -1;
+ }
+
+ DoHWorkerThread& operator=(DoHWorkerThread&& rhs)
+ {
+ if (d_crossProtocolQueryPipe != -1) {
+ close(d_crossProtocolQueryPipe);
+ }
+
+ d_crossProtocolQueryPipe = rhs.d_crossProtocolQueryPipe;
+ rhs.d_crossProtocolQueryPipe = -1;
+
+ return *this;
+ }
+
+ DoHWorkerThread(const DoHWorkerThread& rhs) = delete;
+ DoHWorkerThread& operator=(const DoHWorkerThread&) = delete;
+
+ ~DoHWorkerThread()
+ {
+ if (d_crossProtocolQueryPipe != -1) {
+ close(d_crossProtocolQueryPipe);
+ }
+ }
+
+ int d_crossProtocolQueryPipe{-1};
+};
+
+DoHClientCollection::DoHClientCollection(size_t numberOfThreads) :
+ d_clientThreads(numberOfThreads)
+{
+}
+
+bool DoHClientCollection::passCrossProtocolQueryToThread(std::unique_ptr<CrossProtocolQuery>&& cpq)
+{
+ if (d_numberOfThreads == 0) {
+ throw std::runtime_error("No DoH worker thread yet");
+ }
+
+ uint64_t pos = d_pos++;
+ auto pipe = d_clientThreads.at(pos % d_numberOfThreads).d_crossProtocolQueryPipe;
+ auto tmp = cpq.release();
+
+ if (write(pipe, &tmp, sizeof(tmp)) != sizeof(tmp)) {
+ delete tmp;
+ ++g_stats.outgoingDoHQueryPipeFull;
+ tmp = nullptr;
+ return false;
+ }
+
+ return true;
+}
+
+void DoHClientCollection::addThread()
+{
+#ifdef HAVE_NGHTTP2
+ auto preparePipe = [](int fds[2], const std::string& type) -> bool {
+ if (pipe(fds) < 0) {
+ errlog("Error creating the DoH thread %s pipe: %s", type, stringerror());
+ return false;
+ }
+
+ if (!setNonBlocking(fds[0])) {
+ int err = errno;
+ close(fds[0]);
+ close(fds[1]);
+ errlog("Error setting the DoH thread %s pipe non-blocking: %s", type, stringerror(err));
+ return false;
+ }
+
+ if (!setNonBlocking(fds[1])) {
+ int err = errno;
+ close(fds[0]);
+ close(fds[1]);
+ errlog("Error setting the DoH thread %s pipe non-blocking: %s", type, stringerror(err));
+ return false;
+ }
+
+ if (g_tcpInternalPipeBufferSize > 0 && getPipeBufferSize(fds[0]) < g_tcpInternalPipeBufferSize) {
+ setPipeBufferSize(fds[0], g_tcpInternalPipeBufferSize);
+ }
+
+ return true;
+ };
+
+ int crossProtocolFDs[2] = {-1, -1};
+ if (!preparePipe(crossProtocolFDs, "cross-protocol")) {
+ return;
+ }
+
+ vinfolog("Adding DoH Client thread");
+
+ {
+ std::lock_guard<std::mutex> lock(d_mutex);
+
+ if (d_numberOfThreads >= d_clientThreads.size()) {
+ vinfolog("Adding a new DoH client thread would exceed the vector size (%d/%d), skipping. Consider increasing the maximum amount of DoH client threads with setMaxDoHClientThreads() in the configuration.", d_numberOfThreads, d_clientThreads.size());
+ close(crossProtocolFDs[0]);
+ close(crossProtocolFDs[1]);
+ return;
+ }
+
+ /* from now on this side of the pipe will be managed by that object,
+ no need to worry about it */
+ DoHWorkerThread worker(crossProtocolFDs[1]);
+ try {
+ std::thread t1(dohClientThread, crossProtocolFDs[0]);
+ t1.detach();
+ }
+ catch (const std::runtime_error& e) {
+ /* the thread creation failed, don't leak */
+ errlog("Error creating a DoH thread: %s", e.what());
+ close(crossProtocolFDs[0]);
+ return;
+ }
+
+ d_clientThreads.at(d_numberOfThreads) = std::move(worker);
+ ++d_numberOfThreads;
+ }
+#else /* HAVE_NGHTTP2 */
+ throw std::runtime_error("DoHClientCollection::addThread() called but nghttp2 support is not available");
+#endif /* HAVE_NGHTTP2 */
+}
+
+bool initDoHWorkers()
+{
+#ifdef HAVE_NGHTTP2
+ if (!g_outgoingDoHWorkerThreads) {
+ /* Unless the value has been set to 0 explicitly, always start at least one outgoing DoH worker thread, in case a DoH backend
+ is added at a later time. */
+ g_outgoingDoHWorkerThreads = 1;
+ }
+
+ if (g_outgoingDoHWorkerThreads && *g_outgoingDoHWorkerThreads > 0) {
+ g_dohClientThreads = std::make_unique<DoHClientCollection>(*g_outgoingDoHWorkerThreads);
+ for (size_t idx = 0; idx < *g_outgoingDoHWorkerThreads; idx++) {
+ g_dohClientThreads->addThread();
+ }
+ }
+ return true;
+#else
+ return false;
+#endif /* HAVE_NGHTTP2 */
+}
+
+bool setupDoHClientProtocolNegotiation(std::shared_ptr<TLSCtx>& ctx)
+{
+ if (ctx == nullptr) {
+ return false;
+ }
+#ifdef HAVE_NGHTTP2
+ /* we want to set the ALPN to h2, if only to mitigate the ALPACA attack */
+ const std::vector<std::vector<uint8_t>> h2Alpns = {{'h', '2'}};
+ ctx->setALPNProtos(h2Alpns);
+ ctx->setNextProtocolSelectCallback(select_next_proto_callback);
+ return true;
+#else /* HAVE_NGHTTP2 */
+ return false;
+#endif /* HAVE_NGHTTP2 */
+}
+
+bool sendH2Query(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, std::shared_ptr<TCPQuerySender>& sender, InternalQuery&& query, bool healthCheck)
+{
+#ifdef HAVE_NGHTTP2
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ if (healthCheck) {
+ /* always do health-checks over a new connection */
+ auto newConnection = std::make_shared<DoHConnectionToBackend>(ds, mplexer, now, std::move(query.d_proxyProtocolPayload));
+ newConnection->setHealthCheck(healthCheck);
+ newConnection->queueQuery(sender, std::move(query));
+ }
+ else {
+ auto connection = t_downstreamDoHConnectionsManager.getConnectionToDownstream(mplexer, ds, now, std::move(query.d_proxyProtocolPayload));
+ connection->queueQuery(sender, std::move(query));
+ }
+
+ return true;
+#else /* HAVE_NGHTTP2 */
+ return false;
+#endif /* HAVE_NGHTTP2 */
+}
+
+size_t clearH2Connections()
+{
+ size_t cleared = 0;
+#ifdef HAVE_NGHTTP2
+ cleared = t_downstreamDoHConnectionsManager.clear();
+#endif /* HAVE_NGHTTP2 */
+ return cleared;
+}
+
+size_t handleH2Timeouts(FDMultiplexer& mplexer, const struct timeval& now)
+{
+ size_t got = 0;
+#ifdef HAVE_NGHTTP2
+ auto expiredReadConns = mplexer.getTimeouts(now, false);
+ for (const auto& cbData : expiredReadConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<DoHConnectionToBackend>)) {
+ auto conn = boost::any_cast<std::shared_ptr<DoHConnectionToBackend>>(cbData.second);
+ vinfolog("Timeout (read) from remote DoH backend %s", conn->getBackendName());
+ conn->handleTimeout(now, false);
+ ++got;
+ }
+ }
+
+ auto expiredWriteConns = mplexer.getTimeouts(now, true);
+ for (const auto& cbData : expiredWriteConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<DoHConnectionToBackend>)) {
+ auto conn = boost::any_cast<std::shared_ptr<DoHConnectionToBackend>>(cbData.second);
+ vinfolog("Timeout (write) from remote DoH backend %s", conn->getBackendName());
+ conn->handleTimeout(now, true);
+ ++got;
+ }
+ }
+#endif /* HAVE_NGHTTP2 */
+ return got;
+}
+
+void setDoHDownstreamCleanupInterval(uint16_t max)
+{
+#ifdef HAVE_NGHTTP2
+ DownstreamDoHConnectionsManager::setCleanupInterval(max);
+#endif /* HAVE_NGHTTP2 */
+}
+
+void setDoHDownstreamMaxIdleTime(uint16_t max)
+{
+#ifdef HAVE_NGHTTP2
+ DownstreamDoHConnectionsManager::setMaxIdleTime(max);
+#endif /* HAVE_NGHTTP2 */
+}
+
+void setDoHDownstreamMaxIdleConnectionsPerBackend(size_t max)
+{
+#ifdef HAVE_NGHTTP2
+ DownstreamDoHConnectionsManager::setMaxIdleConnectionsPerDownstream(max);
+#endif /* HAVE_NGHTTP2 */
+}
diff --git a/dnsdist-nghttp2.hh b/dnsdist-nghttp2.hh
new file mode 100644
index 0000000..6e38f28
--- /dev/null
+++ b/dnsdist-nghttp2.hh
@@ -0,0 +1,75 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <memory>
+#include <mutex>
+#include <vector>
+
+#include "dnsdist-tcp.hh"
+#include "stat_t.hh"
+
+struct CrossProtocolQuery;
+
+class DoHClientCollection
+{
+public:
+ DoHClientCollection(size_t numberOfThreads);
+
+ uint64_t getThreadsCount() const
+ {
+ return d_numberOfThreads;
+ }
+
+ bool passCrossProtocolQueryToThread(std::unique_ptr<CrossProtocolQuery>&& cpq);
+ void addThread();
+
+private:
+ struct DoHWorkerThread;
+
+ std::mutex d_mutex;
+ /* we only alter that vector at configuration time, and then
+ it is never modified at runtime, so we don't take a lock
+ after the configuration phase */
+ std::vector<DoHWorkerThread> d_clientThreads;
+ pdns::stat_t d_pos{0};
+ uint64_t d_numberOfThreads{0};
+};
+
+extern std::unique_ptr<DoHClientCollection> g_dohClientThreads;
+extern std::atomic<uint64_t> g_dohStatesDumpRequested;
+extern std::optional<uint16_t> g_outgoingDoHWorkerThreads;
+
+class TLSCtx;
+
+bool initDoHWorkers();
+bool setupDoHClientProtocolNegotiation(std::shared_ptr<TLSCtx>& ctx);
+
+/* opens a new HTTP/2 connection to the supplied backend (attached to the supplied multiplexer), sends the query,
+ waits for the response to come back or an error to occur then notifies the sender, closing the connection. */
+bool sendH2Query(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, std::shared_ptr<TCPQuerySender>& sender, InternalQuery&& query, bool healthCheck);
+size_t handleH2Timeouts(FDMultiplexer& mplexer, const struct timeval& now);
+size_t clearH2Connections();
+
+void setDoHDownstreamCleanupInterval(uint16_t max);
+void setDoHDownstreamMaxIdleTime(uint16_t max);
+void setDoHDownstreamMaxIdleConnectionsPerBackend(size_t max);
diff --git a/dnsdist-prometheus.hh b/dnsdist-prometheus.hh
new file mode 100644
index 0000000..a64b904
--- /dev/null
+++ b/dnsdist-prometheus.hh
@@ -0,0 +1,72 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+// Metric types for Prometheus
+enum class PrometheusMetricType: int {
+ counter = 1,
+ gauge = 2
+};
+
+// Keeps additional information about metrics
+struct MetricDefinition {
+ MetricDefinition(PrometheusMetricType _prometheusType, const std::string& _description): description(_description), prometheusType(_prometheusType) {
+ }
+
+ MetricDefinition() = default;
+
+ // Metric description
+ std::string description;
+ // Metric type for Prometheus
+ PrometheusMetricType prometheusType;
+};
+
+struct MetricDefinitionStorage {
+ // Return metric definition by name
+ bool getMetricDetails(const std::string& metricName, MetricDefinition& metric) const {
+ const auto& metricDetailsIter = metrics.find(metricName);
+
+ if (metricDetailsIter == metrics.end()) {
+ return false;
+ }
+
+ metric = metricDetailsIter->second;
+ return true;
+ };
+
+ // Return string representation of Prometheus metric type
+ std::string getPrometheusStringMetricType(PrometheusMetricType metricType) const {
+ switch (metricType) {
+ case PrometheusMetricType::counter:
+ return "counter";
+ break;
+ case PrometheusMetricType::gauge:
+ return "gauge";
+ break;
+ default:
+ return "";
+ break;
+ }
+ };
+
+ static const std::map<std::string, MetricDefinition> metrics;
+};
diff --git a/dnsdist-protobuf.cc b/dnsdist-protobuf.cc
new file mode 100644
index 0000000..df8cb3f
--- /dev/null
+++ b/dnsdist-protobuf.cc
@@ -0,0 +1,186 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "config.h"
+#include "dnsdist.hh"
+#include "dnsdist-protobuf.hh"
+#include "protozero.hh"
+
+DNSDistProtoBufMessage::DNSDistProtoBufMessage(const DNSQuestion& dq): d_dq(dq), d_type(pdns::ProtoZero::Message::MessageType::DNSQueryType)
+{
+}
+
+DNSDistProtoBufMessage::DNSDistProtoBufMessage(const DNSResponse& dr, bool includeCNAME): d_dq(dr), d_dr(&dr), d_type(pdns::ProtoZero::Message::MessageType::DNSResponseType), d_includeCNAME(includeCNAME)
+{
+}
+
+void DNSDistProtoBufMessage::setServerIdentity(const std::string& serverId)
+{
+ d_serverIdentity = serverId;
+}
+
+void DNSDistProtoBufMessage::setRequestor(const ComboAddress& requestor)
+{
+ d_requestor = requestor;
+}
+
+void DNSDistProtoBufMessage::setResponder(const ComboAddress& responder)
+{
+ d_responder = responder;
+}
+
+void DNSDistProtoBufMessage::setRequestorPort(uint16_t port)
+{
+ if (d_requestor) {
+ d_requestor->setPort(port);
+ }
+}
+
+void DNSDistProtoBufMessage::setResponderPort(uint16_t port)
+{
+ if (d_responder) {
+ d_responder->setPort(port);
+ }
+}
+
+void DNSDistProtoBufMessage::setResponseCode(uint8_t rcode)
+{
+ d_rcode = rcode;
+}
+
+void DNSDistProtoBufMessage::setType(pdns::ProtoZero::Message::MessageType type)
+{
+ d_type = type;
+}
+
+void DNSDistProtoBufMessage::setBytes(size_t bytes)
+{
+ d_bytes = bytes;
+}
+
+void DNSDistProtoBufMessage::setTime(time_t sec, uint32_t usec)
+{
+ d_time = std::pair(sec, usec);
+}
+
+void DNSDistProtoBufMessage::setQueryTime(time_t sec, uint32_t usec)
+{
+ d_queryTime = std::pair(sec, usec);
+}
+
+void DNSDistProtoBufMessage::setQuestion(const DNSName& name, uint16_t qtype, uint16_t qclass)
+{
+ d_question = DNSDistProtoBufMessage::PBQuestion(name, qtype, qclass);
+}
+
+void DNSDistProtoBufMessage::setEDNSSubnet(const Netmask& nm)
+{
+ d_ednsSubnet = nm;
+}
+
+void DNSDistProtoBufMessage::addTag(const std::string& strValue)
+{
+ d_additionalTags.push_back(strValue);
+}
+
+void DNSDistProtoBufMessage::addRR(DNSName&& qname, uint16_t uType, uint16_t uClass, uint32_t uTTL, const std::string& strBlob)
+{
+ d_additionalRRs.push_back({std::move(qname), strBlob, uTTL, uType, uClass});
+}
+
+void DNSDistProtoBufMessage::serialize(std::string& data) const
+{
+ if ((data.capacity() - data.size()) < 128) {
+ data.reserve(data.size() + 128);
+ }
+ pdns::ProtoZero::Message m{data};
+
+ m.setType(d_type);
+
+ if (d_time) {
+ m.setTime(d_time->first, d_time->second);
+ }
+ else {
+ struct timespec ts;
+ gettime(&ts, true);
+ m.setTime(ts.tv_sec, ts.tv_nsec / 1000);
+ }
+
+ const auto distProto = d_dq.getProtocol();
+ pdns::ProtoZero::Message::TransportProtocol protocol = pdns::ProtoZero::Message::TransportProtocol::UDP;
+
+ if (distProto == dnsdist::Protocol::DoTCP) {
+ protocol = pdns::ProtoZero::Message::TransportProtocol::TCP;
+ }
+ else if (distProto == dnsdist::Protocol::DoT) {
+ protocol = pdns::ProtoZero::Message::TransportProtocol::DoT;
+ }
+ else if (distProto == dnsdist::Protocol::DoH) {
+ protocol = pdns::ProtoZero::Message::TransportProtocol::DoH;
+ }
+ else if (distProto == dnsdist::Protocol::DNSCryptUDP) {
+ protocol = pdns::ProtoZero::Message::TransportProtocol::DNSCryptUDP;
+ }
+ else if (distProto == dnsdist::Protocol::DNSCryptTCP) {
+ protocol = pdns::ProtoZero::Message::TransportProtocol::DNSCryptTCP;
+ }
+
+ m.setRequest(d_dq.uniqueId ? *d_dq.uniqueId : getUniqueID(), d_requestor ? *d_requestor : *d_dq.remote, d_responder ? *d_responder : *d_dq.local, d_question ? d_question->d_name : *d_dq.qname, d_question ? d_question->d_type : d_dq.qtype, d_question ? d_question->d_class : d_dq.qclass, d_dq.getHeader()->id, protocol, d_bytes ? *d_bytes : d_dq.getData().size());
+
+ if (d_serverIdentity) {
+ m.setServerIdentity(*d_serverIdentity);
+ }
+ else if (d_ServerIdentityRef != nullptr) {
+ m.setServerIdentity(*d_ServerIdentityRef);
+ }
+
+ if (d_ednsSubnet) {
+ m.setEDNSSubnet(*d_ednsSubnet, 128);
+ }
+
+ m.startResponse();
+ if (d_queryTime) {
+ m.setQueryTime(d_queryTime->first, d_queryTime->second);
+ }
+ else {
+ m.setQueryTime(d_dq.queryTime->tv_sec, d_dq.queryTime->tv_nsec / 1000);
+ }
+
+ if (d_dr != nullptr) {
+ m.setResponseCode(d_rcode ? *d_rcode : d_dr->getHeader()->rcode);
+ m.addRRsFromPacket(reinterpret_cast<const char*>(d_dr->getData().data()), d_dr->getData().size(), d_includeCNAME);
+ }
+ else {
+ if (d_rcode) {
+ m.setResponseCode(*d_rcode);
+ }
+ }
+
+ for (const auto& rr : d_additionalRRs) {
+ m.addRR(rr.d_name, rr.d_type, rr.d_class, rr.d_ttl, rr.d_data);
+ }
+
+ for (const auto& tag : d_additionalTags) {
+ m.addPolicyTag(tag);
+ }
+
+ m.commitResponse();
+}
diff --git a/dnsdist-protobuf.hh b/dnsdist-protobuf.hh
new file mode 100644
index 0000000..82f308e
--- /dev/null
+++ b/dnsdist-protobuf.hh
@@ -0,0 +1,93 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "dnsdist.hh"
+#include "dnsname.hh"
+#include "protozero.hh"
+
+class DNSDistProtoBufMessage
+{
+public:
+ DNSDistProtoBufMessage(const DNSQuestion& dq);
+ DNSDistProtoBufMessage(const DNSResponse& dr, bool includeCNAME);
+
+ void setServerIdentity(const std::string& serverId);
+ void setRequestor(const ComboAddress& requestor);
+ void setResponder(const ComboAddress& responder);
+ void setRequestorPort(uint16_t port);
+ void setResponderPort(uint16_t port);
+ void setResponseCode(uint8_t rcode);
+ void setType(pdns::ProtoZero::Message::MessageType type);
+ void setBytes(size_t bytes);
+ void setTime(time_t sec, uint32_t usec);
+ void setQueryTime(time_t sec, uint32_t usec);
+ void setQuestion(const DNSName& name, uint16_t qtype, uint16_t qclass);
+ void setEDNSSubnet(const Netmask& nm);
+
+ void addTag(const std::string& strValue);
+ void addRR(DNSName&& qname, uint16_t uType, uint16_t uClass, uint32_t uTTL, const std::string& data);
+
+ void serialize(std::string& data) const;
+
+ std::string toDebugString() const;
+
+private:
+ struct PBRecord
+ {
+ DNSName d_name;
+ std::string d_data;
+ uint32_t d_ttl;
+ uint16_t d_type;
+ uint16_t d_class;
+ };
+ struct PBQuestion
+ {
+ PBQuestion(const DNSName& name, uint16_t type, uint16_t class_): d_name(name), d_type(type), d_class(class_)
+ {
+ }
+
+ DNSName d_name;
+ uint16_t d_type;
+ uint16_t d_class;
+ };
+
+ std::vector<PBRecord> d_additionalRRs;
+ std::vector<std::string> d_additionalTags;
+
+ const DNSQuestion& d_dq;
+ const DNSResponse* d_dr{nullptr};
+ const std::string* d_ServerIdentityRef{nullptr};
+
+ boost::optional<PBQuestion> d_question{boost::none};
+ boost::optional<std::string> d_serverIdentity{boost::none};
+ boost::optional<ComboAddress> d_requestor{boost::none};
+ boost::optional<ComboAddress> d_responder{boost::none};
+ boost::optional<Netmask> d_ednsSubnet{boost::none};
+ boost::optional<std::pair<time_t, uint32_t>> d_time{boost::none};
+ boost::optional<std::pair<time_t, uint32_t>> d_queryTime{boost::none};
+ boost::optional<size_t> d_bytes{boost::none};
+ boost::optional<uint8_t> d_rcode{boost::none};
+
+ pdns::ProtoZero::Message::MessageType d_type{pdns::ProtoZero::Message::MessageType::DNSQueryType};
+ bool d_includeCNAME{false};
+};
diff --git a/dnsdist-protocols.cc b/dnsdist-protocols.cc
new file mode 100644
index 0000000..89b65ec
--- /dev/null
+++ b/dnsdist-protocols.cc
@@ -0,0 +1,80 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <algorithm>
+#include <stdexcept>
+
+#include "dnsdist-protocols.hh"
+
+namespace dnsdist
+{
+static const std::vector<std::string> names = {
+ "DoUDP",
+ "DoTCP",
+ "DNSCryptUDP",
+ "DNSCryptTCP",
+ "DoT",
+ "DoH"};
+
+static const std::vector<std::string> prettyNames = {
+ "Do53 UDP",
+ "Do53 TCP",
+ "DNSCrypt UDP",
+ "DNSCrypt TCP",
+ "DNS over TLS",
+ "DNS over HTTPS"};
+
+Protocol::Protocol(Protocol::typeenum protocol) :
+ d_protocol(protocol)
+{
+ if (protocol >= names.size()) {
+ throw std::runtime_error("Unknown protocol: '" + std::to_string(protocol) + "'");
+ }
+}
+
+Protocol::Protocol(const std::string& s)
+{
+ const auto& it = std::find(names.begin(), names.end(), s);
+ if (it == names.end()) {
+ throw std::runtime_error("Unknown protocol name: '" + s + "'");
+ }
+
+ auto index = std::distance(names.begin(), it);
+ d_protocol = static_cast<Protocol::typeenum>(index);
+}
+
+bool Protocol::operator==(Protocol::typeenum type) const
+{
+ return d_protocol == type;
+}
+
+const std::string& Protocol::toString() const
+{
+ return names.at(static_cast<uint8_t>(d_protocol));
+}
+
+const std::string& Protocol::toPrettyString() const
+{
+ return prettyNames.at(static_cast<uint8_t>(d_protocol));
+}
+
+}
diff --git a/dnsdist-protocols.hh b/dnsdist-protocols.hh
new file mode 100644
index 0000000..a90e6e0
--- /dev/null
+++ b/dnsdist-protocols.hh
@@ -0,0 +1,53 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <vector>
+#include <string>
+
+namespace dnsdist
+{
+class Protocol
+{
+public:
+ enum typeenum : uint8_t
+ {
+ DoUDP,
+ DoTCP,
+ DNSCryptUDP,
+ DNSCryptTCP,
+ DoT,
+ DoH
+ };
+
+ Protocol(typeenum protocol = DoUDP);
+ explicit Protocol(const std::string& protocol);
+
+ bool operator==(typeenum) const;
+
+ const std::string& toString() const;
+ const std::string& toPrettyString() const;
+
+private:
+ typeenum d_protocol;
+};
+}
diff --git a/dnsdist-proxy-protocol.cc b/dnsdist-proxy-protocol.cc
new file mode 100644
index 0000000..6a3e978
--- /dev/null
+++ b/dnsdist-proxy-protocol.cc
@@ -0,0 +1,111 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "dnsdist-proxy-protocol.hh"
+#include "dolog.hh"
+
+NetmaskGroup g_proxyProtocolACL;
+size_t g_proxyProtocolMaximumSize = 512;
+bool g_applyACLToProxiedClients = false;
+
+std::string getProxyProtocolPayload(const DNSQuestion& dq)
+{
+ return makeProxyHeader(dq.overTCP(), *dq.remote, *dq.local, dq.proxyProtocolValues ? *dq.proxyProtocolValues : std::vector<ProxyProtocolValue>());
+}
+
+bool addProxyProtocol(DNSQuestion& dq, const std::string& payload)
+{
+ if (!dq.hasRoomFor(payload.size())) {
+ return false;
+ }
+
+ return addProxyProtocol(dq.getMutableData(), payload);
+}
+
+bool addProxyProtocol(DNSQuestion& dq, size_t* payloadSize)
+{
+ auto payload = getProxyProtocolPayload(dq);
+ if (payloadSize != nullptr) {
+ *payloadSize = payload.size();
+ }
+
+ return addProxyProtocol(dq, payload);
+}
+
+bool addProxyProtocol(PacketBuffer& buffer, const std::string& payload)
+{
+ auto previousSize = buffer.size();
+ if (payload.size() > (std::numeric_limits<size_t>::max() - previousSize)) {
+ return false;
+ }
+
+ buffer.insert(buffer.begin(), payload.begin(), payload.end());
+
+ return true;
+}
+
+bool addProxyProtocol(PacketBuffer& buffer, bool tcp, const ComboAddress& source, const ComboAddress& destination, const std::vector<ProxyProtocolValue>& values)
+{
+ auto payload = makeProxyHeader(tcp, source, destination, values);
+ return addProxyProtocol(buffer, payload);
+}
+
+bool expectProxyProtocolFrom(const ComboAddress& remote)
+{
+ return g_proxyProtocolACL.match(remote);
+}
+
+bool handleProxyProtocol(const ComboAddress& remote, bool isTCP, const NetmaskGroup& acl, PacketBuffer& query, ComboAddress& realRemote, ComboAddress& realDestination, std::vector<ProxyProtocolValue>& values)
+{
+ bool tcp;
+ bool proxyProto;
+
+ ssize_t used = parseProxyHeader(query, proxyProto, realRemote, realDestination, tcp, values);
+ if (used <= 0) {
+ ++g_stats.proxyProtocolInvalid;
+ vinfolog("Ignoring invalid proxy protocol (%d, %d) query over %s from %s", query.size(), used, (isTCP ? "TCP" : "UDP"), remote.toStringWithPort());
+ return false;
+ }
+ else if (static_cast<size_t>(used) > g_proxyProtocolMaximumSize) {
+ vinfolog("Proxy protocol header in %s packet from %s is larger than proxy-protocol-maximum-size (%d), dropping", (isTCP ? "TCP" : "UDP"), remote.toStringWithPort(), used);
+ ++g_stats.proxyProtocolInvalid;
+ return false;
+ }
+
+ query.erase(query.begin(), query.begin() + used);
+
+ /* on TCP we have not read the actual query yet */
+ if (!isTCP && query.size() < sizeof(struct dnsheader)) {
+ ++g_stats.nonCompliantQueries;
+ return false;
+ }
+
+ if (proxyProto && g_applyACLToProxiedClients) {
+ if (!acl.match(realRemote)) {
+ vinfolog("Query from %s dropped because of ACL", realRemote.toStringWithPort());
+ ++g_stats.aclDrops;
+ return false;
+ }
+ }
+
+ return true;
+}
diff --git a/dnsdist-proxy-protocol.hh b/dnsdist-proxy-protocol.hh
new file mode 100644
index 0000000..de7674a
--- /dev/null
+++ b/dnsdist-proxy-protocol.hh
@@ -0,0 +1,38 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "dnsdist.hh"
+
+extern NetmaskGroup g_proxyProtocolACL;
+extern size_t g_proxyProtocolMaximumSize;
+extern bool g_applyACLToProxiedClients;
+
+std::string getProxyProtocolPayload(const DNSQuestion& dq);
+
+bool addProxyProtocol(DNSQuestion& dq, size_t* proxyProtocolPayloadSize = nullptr);
+bool addProxyProtocol(DNSQuestion& dq, const std::string& payload);
+bool addProxyProtocol(PacketBuffer& buffer, const std::string& payload);
+bool addProxyProtocol(PacketBuffer& buffer, bool tcp, const ComboAddress& source, const ComboAddress& destination, const std::vector<ProxyProtocolValue>& values);
+
+bool expectProxyProtocolFrom(const ComboAddress& remote);
+bool handleProxyProtocol(const ComboAddress& remote, bool isTCP, const NetmaskGroup& acl, PacketBuffer& query, ComboAddress& realRemote, ComboAddress& realDestination, std::vector<ProxyProtocolValue>& values);
diff --git a/dnsdist-rings.cc b/dnsdist-rings.cc
new file mode 100644
index 0000000..f0c3caa
--- /dev/null
+++ b/dnsdist-rings.cc
@@ -0,0 +1,160 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <fstream>
+
+#include "dnsdist-rings.hh"
+
+size_t Rings::numDistinctRequestors()
+{
+ std::set<ComboAddress, ComboAddress::addressOnlyLessThan> s;
+ for (const auto& shard : d_shards) {
+ auto rl = shard->queryRing.lock();
+ for (const auto& q : *rl) {
+ s.insert(q.requestor);
+ }
+ }
+ return s.size();
+}
+
+std::unordered_map<int, vector<boost::variant<string,double>>> Rings::getTopBandwidth(unsigned int numentries)
+{
+ map<ComboAddress, unsigned int, ComboAddress::addressOnlyLessThan> counts;
+ uint64_t total=0;
+ for (const auto& shard : d_shards) {
+ {
+ auto rl = shard->queryRing.lock();
+ for(const auto& q : *rl) {
+ counts[q.requestor] += q.size;
+ total+=q.size;
+ }
+ }
+ {
+ auto rl = shard->respRing.lock();
+ for(const auto& r : *rl) {
+ counts[r.requestor] += r.size;
+ total+=r.size;
+ }
+ }
+ }
+
+ typedef vector<pair<unsigned int, ComboAddress>> ret_t;
+ ret_t rcounts;
+ rcounts.reserve(counts.size());
+ for(const auto& p : counts)
+ rcounts.push_back({p.second, p.first});
+ numentries = rcounts.size() < numentries ? rcounts.size() : numentries;
+ partial_sort(rcounts.begin(), rcounts.begin()+numentries, rcounts.end(), [](const ret_t::value_type&a, const ret_t::value_type&b)
+ {
+ return(b.first < a.first);
+ });
+ std::unordered_map<int, vector<boost::variant<string,double>>> ret;
+ uint64_t rest = 0;
+ unsigned int count = 1;
+ for(const auto& rc : rcounts) {
+ if(count==numentries+1) {
+ rest+=rc.first;
+ }
+ else {
+ ret.insert({count++, {rc.second.toString(), rc.first, 100.0*rc.first/total}});
+ }
+ }
+
+ if (total > 0) {
+ ret.insert({count, {"Rest", rest, 100.0*rest/total}});
+ }
+ else {
+ ret.insert({count, {"Rest", rest, 100.0 }});
+ }
+
+ return ret;
+}
+
+size_t Rings::loadFromFile(const std::string& filepath, const struct timespec& now)
+{
+ ifstream ifs(filepath);
+ if (!ifs) {
+ throw std::runtime_error("unable to open the file at " + filepath);
+ }
+
+ size_t inserted = 0;
+ string line;
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+
+ while (std::getline(ifs, line)) {
+ boost::trim_right_if(line, boost::is_any_of(" \r\n\x1a"));
+ boost::trim_left(line);
+ bool isResponse = false;
+ vector<string> parts;
+ stringtok(parts, line, " \t,");
+
+ if (parts.size() == 8) {
+ }
+ else if (parts.size() >= 11 && parts.size() <= 13) {
+ isResponse = true;
+ }
+ else {
+ cerr<<"skipping line with "<<parts.size()<<"parts: "<<line<<endl;
+ continue;
+ }
+
+ size_t idx = 0;
+ vector<string> timeStr;
+ stringtok(timeStr, parts.at(idx++), ".");
+ if (timeStr.size() != 2) {
+ cerr<<"skipping invalid time "<<parts.at(0)<<endl;
+ continue;
+ }
+
+ struct timespec when;
+ try {
+ when.tv_sec = now.tv_sec + std::stoi(timeStr.at(0));
+ when.tv_nsec = now.tv_nsec + std::stoi(timeStr.at(1)) * 100 * 1000 * 1000;
+ }
+ catch (const std::exception& e) {
+ cerr<<"error parsing time "<<parts.at(idx-1)<<" from line "<<line<<endl;
+ continue;
+ }
+
+ ComboAddress from(parts.at(idx++));
+ ComboAddress to;
+ dnsdist::Protocol protocol(parts.at(idx++));
+ if (isResponse) {
+ to = ComboAddress(parts.at(idx++));
+ }
+ /* skip ID */
+ idx++;
+ DNSName qname(parts.at(idx++));
+ QType qtype(QType::chartocode(parts.at(idx++).c_str()));
+
+ if (isResponse) {
+ insertResponse(when, from, qname, qtype.getCode(), 0, 0, dh, to, protocol);
+ }
+ else {
+ insertQuery(when, from, qname, qtype.getCode(), 0, dh, protocol);
+ }
+ ++inserted;
+ }
+
+ return inserted;
+}
diff --git a/dnsdist-rings.hh b/dnsdist-rings.hh
new file mode 100644
index 0000000..0ee4f22
--- /dev/null
+++ b/dnsdist-rings.hh
@@ -0,0 +1,229 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <time.h>
+#include <unordered_map>
+
+#include <boost/variant.hpp>
+
+#include "circular_buffer.hh"
+#include "dnsname.hh"
+#include "iputils.hh"
+#include "lock.hh"
+#include "stat_t.hh"
+#include "dnsdist-protocols.hh"
+
+struct Rings {
+ struct Query
+ {
+ ComboAddress requestor;
+ DNSName name;
+ struct timespec when;
+ struct dnsheader dh;
+ uint16_t size;
+ uint16_t qtype;
+ // incoming protocol
+ dnsdist::Protocol protocol;
+ };
+ struct Response
+ {
+ ComboAddress requestor;
+ ComboAddress ds; // who handled it
+ DNSName name;
+ struct timespec when;
+ struct dnsheader dh;
+ unsigned int usec;
+ unsigned int size;
+ uint16_t qtype;
+ // outgoing protocol
+ dnsdist::Protocol protocol;
+ };
+
+ struct Shard
+ {
+ LockGuarded<boost::circular_buffer<Query>> queryRing{boost::circular_buffer<Query>()};
+ LockGuarded<boost::circular_buffer<Response>> respRing{boost::circular_buffer<Response>()};
+ };
+
+ Rings(size_t capacity=10000, size_t numberOfShards=10, size_t nbLockTries=5, bool keepLockingStats=false): d_blockingQueryInserts(0), d_blockingResponseInserts(0), d_deferredQueryInserts(0), d_deferredResponseInserts(0), d_nbQueryEntries(0), d_nbResponseEntries(0), d_currentShardId(0), d_numberOfShards(numberOfShards), d_nbLockTries(nbLockTries), d_keepLockingStats(keepLockingStats)
+ {
+ setCapacity(capacity, numberOfShards);
+ }
+
+ std::unordered_map<int, vector<boost::variant<string,double> > > getTopBandwidth(unsigned int numentries);
+ size_t numDistinctRequestors();
+ /* This function should only be called at configuration time before any query or response has been inserted */
+ void setCapacity(size_t newCapacity, size_t numberOfShards)
+ {
+ if (numberOfShards <= 1) {
+ d_nbLockTries = 0;
+ }
+
+ d_shards.resize(numberOfShards);
+ d_numberOfShards = numberOfShards;
+
+ /* resize all the rings */
+ for (auto& shard : d_shards) {
+ shard = std::make_unique<Shard>();
+ shard->queryRing.lock()->set_capacity(newCapacity / numberOfShards);
+ shard->respRing.lock()->set_capacity(newCapacity / numberOfShards);
+ }
+
+ /* we just recreated the shards so they are now empty */
+ d_nbQueryEntries = 0;
+ d_nbResponseEntries = 0;
+ }
+
+ void setNumberOfLockRetries(size_t retries)
+ {
+ if (d_numberOfShards <= 1) {
+ d_nbLockTries = 0;
+ } else {
+ d_nbLockTries = retries;
+ }
+ }
+
+ size_t getNumberOfShards() const
+ {
+ return d_numberOfShards;
+ }
+
+ size_t getNumberOfQueryEntries() const
+ {
+ return d_nbQueryEntries;
+ }
+
+ size_t getNumberOfResponseEntries() const
+ {
+ return d_nbResponseEntries;
+ }
+
+ void insertQuery(const struct timespec& when, const ComboAddress& requestor, const DNSName& name, uint16_t qtype, uint16_t size, const struct dnsheader& dh, dnsdist::Protocol protocol)
+ {
+ for (size_t idx = 0; idx < d_nbLockTries; idx++) {
+ auto& shard = getOneShard();
+ auto lock = shard->queryRing.try_lock();
+ if (lock.owns_lock()) {
+ insertQueryLocked(*lock, when, requestor, name, qtype, size, dh, protocol);
+ return;
+ }
+ if (d_keepLockingStats) {
+ ++d_deferredQueryInserts;
+ }
+ }
+
+ /* out of luck, let's just wait */
+ if (d_keepLockingStats) {
+ ++d_blockingResponseInserts;
+ }
+ auto& shard = getOneShard();
+ auto lock = shard->queryRing.lock();
+ insertQueryLocked(*lock, when, requestor, name, qtype, size, dh, protocol);
+ }
+
+ void insertResponse(const struct timespec& when, const ComboAddress& requestor, const DNSName& name, uint16_t qtype, unsigned int usec, unsigned int size, const struct dnsheader& dh, const ComboAddress& backend, dnsdist::Protocol protocol)
+ {
+ for (size_t idx = 0; idx < d_nbLockTries; idx++) {
+ auto& shard = getOneShard();
+ auto lock = shard->respRing.try_lock();
+ if (lock.owns_lock()) {
+ insertResponseLocked(*lock, when, requestor, name, qtype, usec, size, dh, backend, protocol);
+ return;
+ }
+ if (d_keepLockingStats) {
+ ++d_deferredResponseInserts;
+ }
+ }
+
+ /* out of luck, let's just wait */
+ if (d_keepLockingStats) {
+ ++d_blockingResponseInserts;
+ }
+ auto& shard = getOneShard();
+ auto lock = shard->respRing.lock();
+ insertResponseLocked(*lock, when, requestor, name, qtype, usec, size, dh, backend, protocol);
+ }
+
+ void clear()
+ {
+ for (auto& shard : d_shards) {
+ shard->queryRing.lock()->clear();
+ shard->respRing.lock()->clear();
+ }
+
+ d_nbQueryEntries.store(0);
+ d_nbResponseEntries.store(0);
+ d_currentShardId.store(0);
+ d_blockingQueryInserts.store(0);
+ d_blockingResponseInserts.store(0);
+ d_deferredQueryInserts.store(0);
+ d_deferredResponseInserts.store(0);
+ }
+
+ /* load the content of the ring buffer from a file in the format emitted by grepq(),
+ only useful for debugging purposes */
+ size_t loadFromFile(const std::string& filepath, const struct timespec& now);
+
+ std::vector<std::unique_ptr<Shard> > d_shards;
+ pdns::stat_t d_blockingQueryInserts;
+ pdns::stat_t d_blockingResponseInserts;
+ pdns::stat_t d_deferredQueryInserts;
+ pdns::stat_t d_deferredResponseInserts;
+
+private:
+ size_t getShardId()
+ {
+ return (d_currentShardId++ % d_numberOfShards);
+ }
+
+ std::unique_ptr<Shard>& getOneShard()
+ {
+ return d_shards[getShardId()];
+ }
+
+ void insertQueryLocked(boost::circular_buffer<Query>& ring, const struct timespec& when, const ComboAddress& requestor, const DNSName& name, uint16_t qtype, uint16_t size, const struct dnsheader& dh, dnsdist::Protocol protocol)
+ {
+ if (!ring.full()) {
+ d_nbQueryEntries++;
+ }
+ ring.push_back({requestor, name, when, dh, size, qtype, protocol});
+ }
+
+ void insertResponseLocked(boost::circular_buffer<Response>& ring, const struct timespec& when, const ComboAddress& requestor, const DNSName& name, uint16_t qtype, unsigned int usec, unsigned int size, const struct dnsheader& dh, const ComboAddress& backend, dnsdist::Protocol protocol)
+ {
+ if (!ring.full()) {
+ d_nbResponseEntries++;
+ }
+ ring.push_back({requestor, backend, name, when, dh, usec, size, qtype, protocol});
+ }
+
+ std::atomic<size_t> d_nbQueryEntries;
+ std::atomic<size_t> d_nbResponseEntries;
+ std::atomic<size_t> d_currentShardId;
+
+ size_t d_numberOfShards;
+ size_t d_nbLockTries = 5;
+ bool d_keepLockingStats{false};
+};
+
+extern Rings g_rings;
diff --git a/dnsdist-rules.cc b/dnsdist-rules.cc
new file mode 100644
index 0000000..96666a2
--- /dev/null
+++ b/dnsdist-rules.cc
@@ -0,0 +1,26 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "dnsdist-rules.hh"
+
+std::atomic<uint64_t> LuaFFIPerThreadRule::s_functionsCounter = 0;
+thread_local std::map<uint64_t, LuaFFIPerThreadRule::PerThreadState> LuaFFIPerThreadRule::t_perThreadStates;
diff --git a/dnsdist-rules.hh b/dnsdist-rules.hh
new file mode 100644
index 0000000..dda702e
--- /dev/null
+++ b/dnsdist-rules.hh
@@ -0,0 +1,1312 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "cachecleaner.hh"
+#include "dnsdist.hh"
+#include "dnsdist-ecs.hh"
+#include "dnsdist-kvs.hh"
+#include "dnsdist-lua-ffi.hh"
+#include "dolog.hh"
+#include "dnsparser.hh"
+
+class MaxQPSIPRule : public DNSRule
+{
+public:
+ MaxQPSIPRule(unsigned int qps, unsigned int burst, unsigned int ipv4trunc=32, unsigned int ipv6trunc=64, unsigned int expiration=300, unsigned int cleanupDelay=60, unsigned int scanFraction=10):
+ d_qps(qps), d_burst(burst), d_ipv4trunc(ipv4trunc), d_ipv6trunc(ipv6trunc), d_cleanupDelay(cleanupDelay), d_expiration(expiration), d_scanFraction(scanFraction)
+ {
+ gettime(&d_lastCleanup, true);
+ }
+
+ void clear()
+ {
+ d_limits.lock()->clear();
+ }
+
+ size_t cleanup(const struct timespec& cutOff, size_t* scannedCount=nullptr) const
+ {
+ auto limits = d_limits.lock();
+ size_t toLook = limits->size() / d_scanFraction + 1;
+ size_t lookedAt = 0;
+
+ size_t removed = 0;
+ auto& sequence = limits->get<SequencedTag>();
+ for (auto entry = sequence.begin(); entry != sequence.end() && lookedAt < toLook; lookedAt++) {
+ if (entry->d_limiter.seenSince(cutOff)) {
+ /* entries are ordered from least recently seen to more recently
+ seen, as soon as we see one that has not expired yet, we are
+ done */
+ lookedAt++;
+ break;
+ }
+
+ entry = sequence.erase(entry);
+ removed++;
+ }
+
+ if (scannedCount != nullptr) {
+ *scannedCount = lookedAt;
+ }
+
+ return removed;
+ }
+
+ void cleanupIfNeeded(const struct timespec& now) const
+ {
+ if (d_cleanupDelay > 0) {
+ struct timespec cutOff = d_lastCleanup;
+ cutOff.tv_sec += d_cleanupDelay;
+
+ if (cutOff < now) {
+ /* the QPS Limiter doesn't use realtime, be careful! */
+ gettime(&cutOff, false);
+ cutOff.tv_sec -= d_expiration;
+
+ cleanup(cutOff);
+
+ d_lastCleanup = now;
+ }
+ }
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ cleanupIfNeeded(*dq->queryTime);
+
+ ComboAddress zeroport(*dq->remote);
+ zeroport.sin4.sin_port=0;
+ zeroport.truncate(zeroport.sin4.sin_family == AF_INET ? d_ipv4trunc : d_ipv6trunc);
+ {
+ auto limits = d_limits.lock();
+ auto iter = limits->find(zeroport);
+ if (iter == limits->end()) {
+ Entry e(zeroport, QPSLimiter(d_qps, d_burst));
+ iter = limits->insert(e).first;
+ }
+
+ moveCacheItemToBack<SequencedTag>(*limits, iter);
+ return !iter->d_limiter.check(d_qps, d_burst);
+ }
+ }
+
+ string toString() const override
+ {
+ return "IP (/"+std::to_string(d_ipv4trunc)+", /"+std::to_string(d_ipv6trunc)+") match for QPS over " + std::to_string(d_qps) + " burst "+ std::to_string(d_burst);
+ }
+
+ size_t getEntriesCount() const
+ {
+ return d_limits.lock()->size();
+ }
+
+private:
+ struct OrderedTag {};
+ struct SequencedTag {};
+ struct Entry
+ {
+ Entry(const ComboAddress& addr, BasicQPSLimiter&& limiter): d_limiter(limiter), d_addr(addr)
+ {
+ }
+ mutable BasicQPSLimiter d_limiter;
+ ComboAddress d_addr;
+ };
+
+ typedef multi_index_container<
+ Entry,
+ indexed_by <
+ ordered_unique<tag<OrderedTag>, member<Entry,ComboAddress,&Entry::d_addr>, ComboAddress::addressOnlyLessThan >,
+ sequenced<tag<SequencedTag> >
+ >
+ > qpsContainer_t;
+
+ mutable LockGuarded<qpsContainer_t> d_limits;
+ mutable struct timespec d_lastCleanup;
+ unsigned int d_qps, d_burst, d_ipv4trunc, d_ipv6trunc, d_cleanupDelay, d_expiration;
+ unsigned int d_scanFraction{10};
+};
+
+class MaxQPSRule : public DNSRule
+{
+public:
+ MaxQPSRule(unsigned int qps)
+ : d_qps(qps, qps)
+ {}
+
+ MaxQPSRule(unsigned int qps, unsigned int burst)
+ : d_qps(qps, burst)
+ {}
+
+
+ bool matches(const DNSQuestion* qd) const override
+ {
+ return d_qps.check();
+ }
+
+ string toString() const override
+ {
+ return "Max " + std::to_string(d_qps.getRate()) + " qps";
+ }
+
+
+private:
+ mutable QPSLimiter d_qps;
+};
+
+class NMGRule : public DNSRule
+{
+public:
+ NMGRule(const NetmaskGroup& nmg) : d_nmg(nmg) {}
+protected:
+ NetmaskGroup d_nmg;
+};
+
+class NetmaskGroupRule : public NMGRule
+{
+public:
+ NetmaskGroupRule(const NetmaskGroup& nmg, bool src, bool quiet = false) : NMGRule(nmg)
+ {
+ d_src = src;
+ d_quiet = quiet;
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ if(!d_src) {
+ return d_nmg.match(*dq->local);
+ }
+ return d_nmg.match(*dq->remote);
+ }
+
+ string toString() const override
+ {
+ string ret = "Src: ";
+ if(!d_src) {
+ ret = "Dst: ";
+ }
+ if (d_quiet) {
+ return ret + "in-group";
+ }
+ return ret + d_nmg.toString();
+ }
+private:
+ bool d_src;
+ bool d_quiet;
+};
+
+class TimedIPSetRule : public DNSRule, boost::noncopyable
+{
+private:
+ struct IPv6 {
+ IPv6(const ComboAddress& ca)
+ {
+ static_assert(sizeof(*this)==16, "IPv6 struct has wrong size");
+ memcpy((char*)this, ca.sin6.sin6_addr.s6_addr, 16);
+ }
+ bool operator==(const IPv6& rhs) const
+ {
+ return a==rhs.a && b==rhs.b;
+ }
+ uint64_t a, b;
+ };
+
+public:
+ TimedIPSetRule()
+ {
+ }
+ ~TimedIPSetRule()
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ if (dq->remote->sin4.sin_family == AF_INET) {
+ auto ip4s = d_ip4s.read_lock();
+ auto fnd = ip4s->find(dq->remote->sin4.sin_addr.s_addr);
+ if (fnd == ip4s->end()) {
+ return false;
+ }
+ return time(nullptr) < fnd->second;
+ } else {
+ auto ip6s = d_ip6s.read_lock();
+ auto fnd = ip6s->find({*dq->remote});
+ if (fnd == ip6s->end()) {
+ return false;
+ }
+ return time(nullptr) < fnd->second;
+ }
+ }
+
+ void add(const ComboAddress& ca, time_t ttd)
+ {
+ // think twice before adding templates here
+ if (ca.sin4.sin_family == AF_INET) {
+ auto res = d_ip4s.write_lock()->insert({ca.sin4.sin_addr.s_addr, ttd});
+ if (!res.second && (time_t)res.first->second < ttd) {
+ res.first->second = (uint32_t)ttd;
+ }
+ }
+ else {
+ auto res = d_ip6s.write_lock()->insert({{ca}, ttd});
+ if (!res.second && (time_t)res.first->second < ttd) {
+ res.first->second = (uint32_t)ttd;
+ }
+ }
+ }
+
+ void remove(const ComboAddress& ca)
+ {
+ if (ca.sin4.sin_family == AF_INET) {
+ d_ip4s.write_lock()->erase(ca.sin4.sin_addr.s_addr);
+ }
+ else {
+ d_ip6s.write_lock()->erase({ca});
+ }
+ }
+
+ void clear()
+ {
+ d_ip4s.write_lock()->clear();
+ d_ip6s.write_lock()->clear();
+ }
+
+ void cleanup()
+ {
+ time_t now = time(nullptr);
+ {
+ auto ip4s = d_ip4s.write_lock();
+ for (auto iter = ip4s->begin(); iter != ip4s->end(); ) {
+ if (iter->second < now) {
+ iter = ip4s->erase(iter);
+ }
+ else {
+ ++iter;
+ }
+ }
+ }
+
+ {
+ auto ip6s = d_ip6s.write_lock();
+ for (auto iter = ip6s->begin(); iter != ip6s->end(); ) {
+ if (iter->second < now) {
+ iter = ip6s->erase(iter);
+ }
+ else {
+ ++iter;
+ }
+ }
+
+ }
+
+ }
+
+ string toString() const override
+ {
+ time_t now = time(nullptr);
+ uint64_t count = 0;
+
+ for (const auto& ip : *(d_ip4s.read_lock())) {
+ if (now < ip.second) {
+ ++count;
+ }
+ }
+
+ for (const auto& ip : *(d_ip6s.read_lock())) {
+ if (now < ip.second) {
+ ++count;
+ }
+ }
+
+ return "Src: "+std::to_string(count)+" ips";
+ }
+private:
+ struct IPv6Hash
+ {
+ std::size_t operator()(const IPv6& ip) const
+ {
+ auto ah=std::hash<uint64_t>{}(ip.a);
+ auto bh=std::hash<uint64_t>{}(ip.b);
+ return ah & (bh<<1);
+ }
+ };
+ mutable SharedLockGuarded<std::unordered_map<IPv6, time_t, IPv6Hash>> d_ip6s;
+ mutable SharedLockGuarded<std::unordered_map<uint32_t, time_t>> d_ip4s;
+};
+
+
+class AllRule : public DNSRule
+{
+public:
+ AllRule() {}
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return true;
+ }
+
+ string toString() const override
+ {
+ return "All";
+ }
+
+};
+
+
+class DNSSECRule : public DNSRule
+{
+public:
+ DNSSECRule()
+ {
+
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return dq->getHeader()->cd || (getEDNSZ(*dq) & EDNS_HEADER_FLAG_DO); // turns out dig sets ad by default..
+ }
+
+ string toString() const override
+ {
+ return "DNSSEC";
+ }
+};
+
+class AndRule : public DNSRule
+{
+public:
+ AndRule(const vector<pair<int, shared_ptr<DNSRule> > >& rules)
+ {
+ for(const auto& r : rules)
+ d_rules.push_back(r.second);
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ auto iter = d_rules.begin();
+ for(; iter != d_rules.end(); ++iter)
+ if(!(*iter)->matches(dq))
+ break;
+ return iter == d_rules.end();
+ }
+
+ string toString() const override
+ {
+ string ret;
+ for(const auto& rule : d_rules) {
+ if(!ret.empty())
+ ret+= " && ";
+ ret += "("+ rule->toString()+")";
+ }
+ return ret;
+ }
+private:
+
+ vector<std::shared_ptr<DNSRule> > d_rules;
+
+};
+
+
+class OrRule : public DNSRule
+{
+public:
+ OrRule(const vector<pair<int, shared_ptr<DNSRule> > >& rules)
+ {
+ for(const auto& r : rules)
+ d_rules.push_back(r.second);
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ auto iter = d_rules.begin();
+ for(; iter != d_rules.end(); ++iter)
+ if((*iter)->matches(dq))
+ return true;
+ return false;
+ }
+
+ string toString() const override
+ {
+ string ret;
+ for(const auto& rule : d_rules) {
+ if(!ret.empty())
+ ret+= " || ";
+ ret += "("+ rule->toString()+")";
+ }
+ return ret;
+ }
+private:
+
+ vector<std::shared_ptr<DNSRule> > d_rules;
+
+};
+
+
+class RegexRule : public DNSRule
+{
+public:
+ RegexRule(const std::string& regex) : d_regex(regex), d_visual(regex)
+ {
+
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return d_regex.match(dq->qname->toStringNoDot());
+ }
+
+ string toString() const override
+ {
+ return "Regex: "+d_visual;
+ }
+private:
+ Regex d_regex;
+ string d_visual;
+};
+
+#ifdef HAVE_RE2
+#include <re2/re2.h>
+class RE2Rule : public DNSRule
+{
+public:
+ RE2Rule(const std::string& re2) : d_re2(re2, RE2::Latin1), d_visual(re2)
+ {
+
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return RE2::FullMatch(dq->qname->toStringNoDot(), d_re2);
+ }
+
+ string toString() const override
+ {
+ return "RE2 match: "+d_visual;
+ }
+private:
+ RE2 d_re2;
+ string d_visual;
+};
+#endif
+
+#ifdef HAVE_DNS_OVER_HTTPS
+class HTTPHeaderRule : public DNSRule
+{
+public:
+ HTTPHeaderRule(const std::string& header, const std::string& regex);
+ bool matches(const DNSQuestion* dq) const override;
+ string toString() const override;
+private:
+ string d_header;
+ Regex d_regex;
+ string d_visual;
+};
+
+class HTTPPathRule : public DNSRule
+{
+public:
+ HTTPPathRule(const std::string& path);
+ bool matches(const DNSQuestion* dq) const override;
+ string toString() const override;
+private:
+ string d_path;
+};
+
+class HTTPPathRegexRule : public DNSRule
+{
+public:
+ HTTPPathRegexRule(const std::string& regex);
+ bool matches(const DNSQuestion* dq) const override;
+ string toString() const override;
+private:
+ Regex d_regex;
+ std::string d_visual;
+};
+#endif
+
+class SNIRule : public DNSRule
+{
+public:
+ SNIRule(const std::string& name) : d_sni(name)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return dq->sni == d_sni;
+ }
+ string toString() const override
+ {
+ return "SNI == " + d_sni;
+ }
+private:
+ std::string d_sni;
+};
+
+class SuffixMatchNodeRule : public DNSRule
+{
+public:
+ SuffixMatchNodeRule(const SuffixMatchNode& smn, bool quiet=false) : d_smn(smn), d_quiet(quiet)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return d_smn.check(*dq->qname);
+ }
+ string toString() const override
+ {
+ if(d_quiet)
+ return "qname==in-set";
+ else
+ return "qname in "+d_smn.toString();
+ }
+private:
+ SuffixMatchNode d_smn;
+ bool d_quiet;
+};
+
+class QNameRule : public DNSRule
+{
+public:
+ QNameRule(const DNSName& qname) : d_qname(qname)
+ {
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return d_qname==*dq->qname;
+ }
+ string toString() const override
+ {
+ return "qname=="+d_qname.toString();
+ }
+private:
+ DNSName d_qname;
+};
+
+class QNameSetRule : public DNSRule {
+public:
+ QNameSetRule(const DNSNameSet& names) : qname_idx(names) {}
+
+ bool matches(const DNSQuestion* dq) const override {
+ return qname_idx.find(*dq->qname) != qname_idx.end();
+ }
+
+ string toString() const override {
+ std::stringstream ss;
+ ss << "qname in DNSNameSet(" << qname_idx.size() << " FQDNs)";
+ return ss.str();
+ }
+private:
+ DNSNameSet qname_idx;
+};
+
+class QTypeRule : public DNSRule
+{
+public:
+ QTypeRule(uint16_t qtype) : d_qtype(qtype)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return d_qtype == dq->qtype;
+ }
+ string toString() const override
+ {
+ QType qt(d_qtype);
+ return "qtype=="+qt.toString();
+ }
+private:
+ uint16_t d_qtype;
+};
+
+class QClassRule : public DNSRule
+{
+public:
+ QClassRule(uint16_t qclass) : d_qclass(qclass)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return d_qclass == dq->qclass;
+ }
+ string toString() const override
+ {
+ return "qclass=="+std::to_string(d_qclass);
+ }
+private:
+ uint16_t d_qclass;
+};
+
+class OpcodeRule : public DNSRule
+{
+public:
+ OpcodeRule(uint8_t opcode) : d_opcode(opcode)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return d_opcode == dq->getHeader()->opcode;
+ }
+ string toString() const override
+ {
+ return "opcode=="+std::to_string(d_opcode);
+ }
+private:
+ uint8_t d_opcode;
+};
+
+class DSTPortRule : public DNSRule
+{
+public:
+ DSTPortRule(uint16_t port) : d_port(port)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return htons(d_port) == dq->local->sin4.sin_port;
+ }
+ string toString() const override
+ {
+ return "dst port=="+std::to_string(d_port);
+ }
+private:
+ uint16_t d_port;
+};
+
+class TCPRule : public DNSRule
+{
+public:
+ TCPRule(bool tcp): d_tcp(tcp)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return dq->overTCP() == d_tcp;
+ }
+ string toString() const override
+ {
+ return (d_tcp ? "TCP" : "UDP");
+ }
+private:
+ bool d_tcp;
+};
+
+
+class NotRule : public DNSRule
+{
+public:
+ NotRule(shared_ptr<DNSRule>& rule): d_rule(rule)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return !d_rule->matches(dq);
+ }
+ string toString() const override
+ {
+ return "!("+ d_rule->toString()+")";
+ }
+private:
+ shared_ptr<DNSRule> d_rule;
+};
+
+class RecordsCountRule : public DNSRule
+{
+public:
+ RecordsCountRule(uint8_t section, uint16_t minCount, uint16_t maxCount): d_minCount(minCount), d_maxCount(maxCount), d_section(section)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ uint16_t count = 0;
+ switch(d_section) {
+ case 0:
+ count = ntohs(dq->getHeader()->qdcount);
+ break;
+ case 1:
+ count = ntohs(dq->getHeader()->ancount);
+ break;
+ case 2:
+ count = ntohs(dq->getHeader()->nscount);
+ break;
+ case 3:
+ count = ntohs(dq->getHeader()->arcount);
+ break;
+ }
+ return count >= d_minCount && count <= d_maxCount;
+ }
+ string toString() const override
+ {
+ string section;
+ switch(d_section) {
+ case 0:
+ section = "QD";
+ break;
+ case 1:
+ section = "AN";
+ break;
+ case 2:
+ section = "NS";
+ break;
+ case 3:
+ section = "AR";
+ break;
+ }
+ return std::to_string(d_minCount) + " <= records in " + section + " <= "+ std::to_string(d_maxCount);
+ }
+private:
+ uint16_t d_minCount;
+ uint16_t d_maxCount;
+ uint8_t d_section;
+};
+
+class RecordsTypeCountRule : public DNSRule
+{
+public:
+ RecordsTypeCountRule(uint8_t section, uint16_t type, uint16_t minCount, uint16_t maxCount): d_type(type), d_minCount(minCount), d_maxCount(maxCount), d_section(section)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ uint16_t count = 0;
+ switch(d_section) {
+ case 0:
+ count = ntohs(dq->getHeader()->qdcount);
+ break;
+ case 1:
+ count = ntohs(dq->getHeader()->ancount);
+ break;
+ case 2:
+ count = ntohs(dq->getHeader()->nscount);
+ break;
+ case 3:
+ count = ntohs(dq->getHeader()->arcount);
+ break;
+ }
+ if (count < d_minCount) {
+ return false;
+ }
+ count = getRecordsOfTypeCount(reinterpret_cast<const char*>(dq->getData().data()), dq->getData().size(), d_section, d_type);
+ return count >= d_minCount && count <= d_maxCount;
+ }
+ string toString() const override
+ {
+ string section;
+ switch(d_section) {
+ case 0:
+ section = "QD";
+ break;
+ case 1:
+ section = "AN";
+ break;
+ case 2:
+ section = "NS";
+ break;
+ case 3:
+ section = "AR";
+ break;
+ }
+ return std::to_string(d_minCount) + " <= " + QType(d_type).toString() + " records in " + section + " <= "+ std::to_string(d_maxCount);
+ }
+private:
+ uint16_t d_type;
+ uint16_t d_minCount;
+ uint16_t d_maxCount;
+ uint8_t d_section;
+};
+
+class TrailingDataRule : public DNSRule
+{
+public:
+ TrailingDataRule()
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ uint16_t length = getDNSPacketLength(reinterpret_cast<const char*>(dq->getData().data()), dq->getData().size());
+ return length < dq->getData().size();
+ }
+ string toString() const override
+ {
+ return "trailing data";
+ }
+};
+
+class QNameLabelsCountRule : public DNSRule
+{
+public:
+ QNameLabelsCountRule(unsigned int minLabelsCount, unsigned int maxLabelsCount): d_min(minLabelsCount), d_max(maxLabelsCount)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ unsigned int count = dq->qname->countLabels();
+ return count < d_min || count > d_max;
+ }
+ string toString() const override
+ {
+ return "labels count < " + std::to_string(d_min) + " || labels count > " + std::to_string(d_max);
+ }
+private:
+ unsigned int d_min;
+ unsigned int d_max;
+};
+
+class QNameWireLengthRule : public DNSRule
+{
+public:
+ QNameWireLengthRule(size_t min, size_t max): d_min(min), d_max(max)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ size_t const wirelength = dq->qname->wirelength();
+ return wirelength < d_min || wirelength > d_max;
+ }
+ string toString() const override
+ {
+ return "wire length < " + std::to_string(d_min) + " || wire length > " + std::to_string(d_max);
+ }
+private:
+ size_t d_min;
+ size_t d_max;
+};
+
+class RCodeRule : public DNSRule
+{
+public:
+ RCodeRule(uint8_t rcode) : d_rcode(rcode)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return d_rcode == dq->getHeader()->rcode;
+ }
+ string toString() const override
+ {
+ return "rcode=="+RCode::to_s(d_rcode);
+ }
+private:
+ uint8_t d_rcode;
+};
+
+class ERCodeRule : public DNSRule
+{
+public:
+ ERCodeRule(uint8_t rcode) : d_rcode(rcode & 0xF), d_extrcode(rcode >> 4)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ // avoid parsing EDNS OPT RR when not needed.
+ if (d_rcode != dq->getHeader()->rcode) {
+ return false;
+ }
+
+ EDNS0Record edns0;
+ if (!getEDNS0Record(*dq, edns0)) {
+ return false;
+ }
+
+ return d_extrcode == edns0.extRCode;
+ }
+ string toString() const override
+ {
+ return "ercode=="+ERCode::to_s(d_rcode | (d_extrcode << 4));
+ }
+private:
+ uint8_t d_rcode; // plain DNS Rcode
+ uint8_t d_extrcode; // upper bits in EDNS0 record
+};
+
+class EDNSVersionRule : public DNSRule
+{
+public:
+ EDNSVersionRule(uint8_t version) : d_version(version)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ EDNS0Record edns0;
+ if (!getEDNS0Record(*dq, edns0)) {
+ return false;
+ }
+
+ return d_version < edns0.version;
+ }
+ string toString() const override
+ {
+ return "ednsversion>"+std::to_string(d_version);
+ }
+private:
+ uint8_t d_version;
+};
+
+class EDNSOptionRule : public DNSRule
+{
+public:
+ EDNSOptionRule(uint16_t optcode) : d_optcode(optcode)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ uint16_t optStart;
+ size_t optLen = 0;
+ bool last = false;
+ int res = locateEDNSOptRR(dq->getData(), &optStart, &optLen, &last);
+ if (res != 0) {
+ // no EDNS OPT RR
+ return false;
+ }
+
+ if (optLen < optRecordMinimumSize) {
+ return false;
+ }
+
+ if (optStart < dq->getData().size() && dq->getData().at(optStart) != 0) {
+ // OPT RR Name != '.'
+ return false;
+ }
+
+ return isEDNSOptionInOpt(dq->getData(), optStart, optLen, d_optcode);
+ }
+ string toString() const override
+ {
+ return "ednsoptcode=="+std::to_string(d_optcode);
+ }
+private:
+ uint16_t d_optcode;
+};
+
+class RDRule : public DNSRule
+{
+public:
+ RDRule()
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return dq->getHeader()->rd == 1;
+ }
+ string toString() const override
+ {
+ return "rd==1";
+ }
+};
+
+class ProbaRule : public DNSRule
+{
+public:
+ ProbaRule(double proba) : d_proba(proba)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ if(d_proba == 1.0)
+ return true;
+ double rnd = 1.0*random() / RAND_MAX;
+ return rnd > (1.0 - d_proba);
+ }
+ string toString() const override
+ {
+ return "match with prob. " + (boost::format("%0.2f") % d_proba).str();
+ }
+private:
+ double d_proba;
+};
+
+class TagRule : public DNSRule
+{
+public:
+ TagRule(const std::string& tag, boost::optional<std::string> value) : d_value(value), d_tag(tag)
+ {
+ }
+ bool matches(const DNSQuestion* dq) const override
+ {
+ if (!dq->qTag) {
+ return false;
+ }
+
+ const auto it = dq->qTag->find(d_tag);
+ if (it == dq->qTag->cend()) {
+ return false;
+ }
+
+ if (!d_value) {
+ return true;
+ }
+
+ return it->second == *d_value;
+ }
+
+ string toString() const override
+ {
+ return "tag '" + d_tag + "' is set" + (d_value ? (" to '" + *d_value + "'") : "");
+ }
+
+private:
+ boost::optional<std::string> d_value;
+ std::string d_tag;
+};
+
+class PoolAvailableRule : public DNSRule
+{
+public:
+ PoolAvailableRule(const std::string& poolname) : d_pools(&g_pools), d_poolname(poolname)
+ {
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return (getPool(*d_pools, d_poolname)->countServers(true) > 0);
+ }
+
+ string toString() const override
+ {
+ return "pool '" + d_poolname + "' is available";
+ }
+private:
+ mutable LocalStateHolder<pools_t> d_pools;
+ std::string d_poolname;
+};
+
+class PoolOutstandingRule : public DNSRule
+{
+public:
+ PoolOutstandingRule(const std::string& poolname, const size_t limit) : d_pools(&g_pools), d_poolname(poolname), d_limit(limit)
+ {
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ return (getPool(*d_pools, d_poolname)->poolLoad()) > d_limit;
+ }
+
+ string toString() const override
+ {
+ return "pool '" + d_poolname + "' outstanding > " + std::to_string(d_limit);
+ }
+private:
+ mutable LocalStateHolder<pools_t> d_pools;
+ std::string d_poolname;
+ size_t d_limit;
+};
+
+class KeyValueStoreLookupRule: public DNSRule
+{
+public:
+ KeyValueStoreLookupRule(std::shared_ptr<KeyValueStore>& kvs, std::shared_ptr<KeyValueLookupKey>& lookupKey): d_kvs(kvs), d_key(lookupKey)
+ {
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ std::vector<std::string> keys = d_key->getKeys(*dq);
+ for (const auto& key : keys) {
+ if (d_kvs->keyExists(key) == true) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ string toString() const override
+ {
+ return "lookup key-value store based on '" + d_key->toString() + "'";
+ }
+
+private:
+ std::shared_ptr<KeyValueStore> d_kvs;
+ std::shared_ptr<KeyValueLookupKey> d_key;
+};
+
+class KeyValueStoreRangeLookupRule: public DNSRule
+{
+public:
+ KeyValueStoreRangeLookupRule(std::shared_ptr<KeyValueStore>& kvs, std::shared_ptr<KeyValueLookupKey>& lookupKey): d_kvs(kvs), d_key(lookupKey)
+ {
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ std::vector<std::string> keys = d_key->getKeys(*dq);
+ for (const auto& key : keys) {
+ std::string value;
+ if (d_kvs->getRangeValue(key, value) == true) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ string toString() const override
+ {
+ return "range-based lookup key-value store based on '" + d_key->toString() + "'";
+ }
+
+private:
+ std::shared_ptr<KeyValueStore> d_kvs;
+ std::shared_ptr<KeyValueLookupKey> d_key;
+};
+
+class LuaRule : public DNSRule
+{
+public:
+ typedef std::function<bool(const DNSQuestion* dq)> func_t;
+ LuaRule(const func_t& func): d_func(func)
+ {}
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ try {
+ auto lock = g_lua.lock();
+ return d_func(dq);
+ } catch (const std::exception &e) {
+ warnlog("LuaRule failed inside Lua: %s", e.what());
+ } catch (...) {
+ warnlog("LuaRule failed inside Lua: [unknown exception]");
+ }
+ return false;
+ }
+
+ string toString() const override
+ {
+ return "Lua script";
+ }
+private:
+ func_t d_func;
+};
+
+class LuaFFIRule : public DNSRule
+{
+public:
+ typedef std::function<bool(dnsdist_ffi_dnsquestion_t* dq)> func_t;
+ LuaFFIRule(const func_t& func): d_func(func)
+ {}
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ dnsdist_ffi_dnsquestion_t dqffi(const_cast<DNSQuestion*>(dq));
+ try {
+ auto lock = g_lua.lock();
+ return d_func(&dqffi);
+ } catch (const std::exception &e) {
+ warnlog("LuaFFIRule failed inside Lua: %s", e.what());
+ } catch (...) {
+ warnlog("LuaFFIRule failed inside Lua: [unknown exception]");
+ }
+ return false;
+ }
+
+ string toString() const override
+ {
+ return "Lua FFI script";
+ }
+private:
+ func_t d_func;
+};
+
+class LuaFFIPerThreadRule : public DNSRule
+{
+public:
+ typedef std::function<bool(dnsdist_ffi_dnsquestion_t* dq)> func_t;
+
+ LuaFFIPerThreadRule(const std::string& code): d_functionCode(code), d_functionID(s_functionsCounter++)
+ {
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ try {
+ auto& state = t_perThreadStates[d_functionID];
+ if (!state.d_initialized) {
+ setupLuaFFIPerThreadContext(state.d_luaContext);
+ /* mark the state as initialized first so if there is a syntax error
+ we only try to execute the code once */
+ state.d_initialized = true;
+ state.d_func = state.d_luaContext.executeCode<func_t>(d_functionCode);
+ }
+
+ if (!state.d_func) {
+ /* the function was not properly initialized */
+ return false;
+ }
+
+ dnsdist_ffi_dnsquestion_t dqffi(const_cast<DNSQuestion*>(dq));
+ return state.d_func(&dqffi);
+ }
+ catch (const std::exception &e) {
+ warnlog("LuaFFIPerthreadRule failed inside Lua: %s", e.what());
+ }
+ catch (...) {
+ warnlog("LuaFFIPerThreadRule failed inside Lua: [unknown exception]");
+ }
+ return false;
+ }
+
+ string toString() const override
+ {
+ return "Lua FFI per-thread script";
+ }
+private:
+ struct PerThreadState
+ {
+ LuaContext d_luaContext;
+ func_t d_func;
+ bool d_initialized{false};
+ };
+
+ static std::atomic<uint64_t> s_functionsCounter;
+ static thread_local std::map<uint64_t, PerThreadState> t_perThreadStates;
+ const std::string d_functionCode;
+ const uint64_t d_functionID;
+};
+
+class ProxyProtocolValueRule : public DNSRule
+{
+public:
+ ProxyProtocolValueRule(uint8_t type, boost::optional<std::string> value): d_value(value), d_type(type)
+ {
+ }
+
+ bool matches(const DNSQuestion* dq) const override
+ {
+ if (!dq->proxyProtocolValues) {
+ return false;
+ }
+
+ for (const auto& entry : *dq->proxyProtocolValues) {
+ if (entry.type == d_type && (!d_value || entry.content == *d_value)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ string toString() const override
+ {
+ if (d_value) {
+ return "proxy protocol value of type " + std::to_string(d_type) + " matches";
+ }
+ return "proxy protocol value of type " + std::to_string(d_type) + " is present";
+ }
+
+private:
+ boost::optional<std::string> d_value;
+ uint8_t d_type;
+};
diff --git a/dnsdist-secpoll.cc b/dnsdist-secpoll.cc
new file mode 100644
index 0000000..79e3f69
--- /dev/null
+++ b/dnsdist-secpoll.cc
@@ -0,0 +1,246 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include <string>
+#include <vector>
+
+#ifdef HAVE_LIBSODIUM
+#include <sodium.h>
+#endif /* HAVE_LIBSODIUM */
+
+#include "dnsparser.hh"
+#include "dolog.hh"
+#include "iputils.hh"
+#include "misc.hh"
+#include "sstuff.hh"
+
+#include "dnsdist.hh"
+#include "dnsdist-secpoll.hh"
+
+#ifndef PACKAGEVERSION
+#define PACKAGEVERSION PACKAGE_VERSION
+#endif
+
+static std::string getFirstTXTAnswer(const std::string& answer)
+{
+ if (answer.size() <= sizeof(struct dnsheader)) {
+ throw std::runtime_error("Looking for a TXT record in an answer smaller than the DNS header");
+ }
+
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(answer.data());
+ PacketReader pr(answer);
+ uint16_t qdcount = ntohs(dh->qdcount);
+ uint16_t ancount = ntohs(dh->ancount);
+
+ DNSName rrname;
+ uint16_t rrtype;
+ uint16_t rrclass;
+
+ size_t idx = 0;
+ /* consume qd */
+ for(; idx < qdcount; idx++) {
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+ (void) rrtype;
+ (void) rrclass;
+ }
+
+ /* parse AN */
+ for (idx = 0; idx < ancount; idx++) {
+ string blob;
+ struct dnsrecordheader ah;
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ if (ah.d_type == QType::TXT) {
+ string txt;
+ pr.xfrText(txt);
+
+ return txt;
+ }
+ else {
+ pr.xfrBlob(blob);
+ }
+ }
+
+ throw std::runtime_error("No TXT record in answer");
+}
+
+static std::string getSecPollStatus(const std::string& queriedName, int timeout=2)
+{
+ const DNSName& sentName = DNSName(queriedName);
+ std::vector<uint8_t> packet;
+ DNSPacketWriter pw(packet, sentName, QType::TXT);
+ pw.getHeader()->id = getRandomDNSID();
+ pw.getHeader()->rd = 1;
+
+ const auto& resolversForStub = getResolvers("/etc/resolv.conf");
+
+ for(const auto& dest : resolversForStub) {
+ Socket sock(dest.sin4.sin_family, SOCK_DGRAM);
+ sock.setNonBlocking();
+ sock.connect(dest);
+ sock.send(string(packet.begin(), packet.end()));
+
+ string reply;
+ int ret = waitForData(sock.getHandle(), timeout, 0);
+ if (ret < 0) {
+ if (g_verbose) {
+ warnlog("Error while waiting for the secpoll response from stub resolver %s: %d", dest.toString(), ret);
+ }
+ continue;
+ }
+ else if (ret == 0) {
+ if (g_verbose) {
+ warnlog("Timeout while waiting for the secpoll response from stub resolver %s", dest.toString());
+ }
+ continue;
+ }
+
+ try {
+ sock.read(reply);
+ }
+ catch(const std::exception& e) {
+ if (g_verbose) {
+ warnlog("Error while reading for the secpoll response from stub resolver %s: %s", dest.toString(), e.what());
+ }
+ continue;
+ }
+
+ if (reply.size() <= sizeof(struct dnsheader)) {
+ if (g_verbose) {
+ warnlog("Too short answer of size %d received from the secpoll stub resolver %s", reply.size(), dest.toString());
+ }
+ continue;
+ }
+
+ struct dnsheader d;
+ memcpy(&d, reply.c_str(), sizeof(d));
+ if (d.id != pw.getHeader()->id) {
+ if (g_verbose) {
+ warnlog("Invalid ID (%d / %d) received from the secpoll stub resolver %s", d.id, pw.getHeader()->id, dest.toString());
+ }
+ continue;
+ }
+
+ if (d.rcode != RCode::NoError) {
+ if (g_verbose) {
+ warnlog("Response code '%s' received from the secpoll stub resolver %s for '%s'", RCode::to_s(d.rcode), dest.toString(), queriedName);
+ }
+
+ /* no need to try another resolver if the domain does not exist */
+ if (d.rcode == RCode::NXDomain) {
+ throw std::runtime_error("Unable to get a valid Security Status update");
+ }
+ continue;
+ }
+
+ if (ntohs(d.qdcount) != 1 || ntohs(d.ancount) != 1) {
+ if (g_verbose) {
+ warnlog("Invalid answer (qdcount %d / ancount %d) received from the secpoll stub resolver %s", ntohs(d.qdcount), ntohs(d.ancount), dest.toString());
+ }
+ continue;
+ }
+
+ uint16_t receivedType;
+ uint16_t receivedClass;
+ DNSName receivedName(reply.c_str(), reply.size(), sizeof(dnsheader), false, &receivedType, &receivedClass);
+
+ if (receivedName != sentName || receivedType != QType::TXT || receivedClass != QClass::IN) {
+ if (g_verbose) {
+ warnlog("Invalid answer, either the qname (%s / %s), qtype (%s / %s) or qclass (%s / %s) does not match, received from the secpoll stub resolver %s", receivedName, sentName, QType(receivedType).toString(), QType(QType::TXT).toString(), QClass(receivedClass).toString(), QClass::IN.toString(), dest.toString());
+ }
+ continue;
+ }
+
+ return getFirstTXTAnswer(reply);
+ }
+
+ throw std::runtime_error("Unable to get a valid Security Status update");
+}
+
+static bool g_secPollDone{false};
+std::string g_secPollSuffix{"secpoll.powerdns.com."};
+time_t g_secPollInterval{3600};
+
+void doSecPoll(const std::string& suffix)
+{
+ if (suffix.empty()) {
+ return;
+ }
+
+ const std::string pkgv(PACKAGEVERSION);
+ bool releaseVersion = std::count(pkgv.begin(), pkgv.end(), '.') == 2;
+ const std::string version = "dnsdist-" + pkgv;
+ std::string queriedName = version.substr(0, 63) + ".security-status." + suffix;
+
+ if (*queriedName.rbegin() != '.') {
+ queriedName += '.';
+ }
+
+ boost::replace_all(queriedName, "+", "_");
+ boost::replace_all(queriedName, "~", "_");
+
+ try {
+ std::string status = getSecPollStatus(queriedName);
+ pair<string, string> split = splitField(unquotify(status), ' ');
+
+ int securityStatus = std::stoi(split.first);
+ std::string securityMessage = split.second;
+
+ if(securityStatus == 1 && !g_secPollDone) {
+ warnlog("Polled security status of version %s at startup, no known issues reported: %s", std::string(VERSION), securityMessage);
+ }
+ if(securityStatus == 2) {
+ errlog("PowerDNS DNSDist Security Update Recommended: %s", securityMessage);
+ }
+ else if(securityStatus == 3) {
+ errlog("PowerDNS DNSDist Security Update Mandatory: %s", securityMessage);
+ }
+
+ g_stats.securityStatus = securityStatus;
+ g_secPollDone = true;
+ return;
+ }
+ catch(const std::exception& e) {
+ if (releaseVersion) {
+ warnlog("Error while retrieving the security update for version %s: %s", version, e.what());
+ }
+ else if (!g_secPollDone) {
+ infolog("Error while retrieving the security update for version %s: %s", version, e.what());
+ }
+ }
+
+ if (releaseVersion) {
+ warnlog("Failed to retrieve security status update for '%s' on %s", pkgv, queriedName);
+ }
+ else if (!g_secPollDone) {
+ infolog("Not validating response for security status update, this is a non-release version.");
+
+ /* for non-released versions, there is no use sending the same message several times,
+ let's just accept that there will be no security polling for this exact version */
+ g_secPollDone = true;
+ }
+}
diff --git a/dnsdist-secpoll.hh b/dnsdist-secpoll.hh
new file mode 100644
index 0000000..c7d8869
--- /dev/null
+++ b/dnsdist-secpoll.hh
@@ -0,0 +1,27 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+extern std::string g_secPollSuffix;
+extern time_t g_secPollInterval;
+
+void doSecPoll(const std::string& suffix);
diff --git a/dnsdist-session-cache.cc b/dnsdist-session-cache.cc
new file mode 100644
index 0000000..42ba272
--- /dev/null
+++ b/dnsdist-session-cache.cc
@@ -0,0 +1,90 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsdist-session-cache.hh"
+
+TLSSessionCache g_sessionCache;
+
+time_t TLSSessionCache::s_cleanupDelay{60};
+time_t TLSSessionCache::s_sessionValidity{600};
+uint16_t TLSSessionCache::s_maxSessionsPerBackend{20};
+
+void TLSSessionCache::cleanup(time_t now, LockGuardedHolder<TLSSessionCache::CacheData>& data)
+{
+ time_t cutOff = now + s_sessionValidity;
+
+ for (auto it = data->d_sessions.begin(); it != data->d_sessions.end();) {
+ if (it->second.d_lastUsed > cutOff || it->second.d_sessions.size() == 0) {
+ it = data->d_sessions.erase(it);
+ }
+ else {
+ ++it;
+ }
+ }
+
+ data->d_nextCleanup = now + s_cleanupDelay;
+}
+
+void TLSSessionCache::putSessions(const boost::uuids::uuid& backendID, time_t now, std::vector<std::unique_ptr<TLSSession>>&& sessions)
+{
+ auto data = d_data.lock();
+ if (data->d_nextCleanup == 0 || now > data->d_nextCleanup) {
+ cleanup(now, data);
+ }
+
+ for (auto& session : sessions) {
+ auto& entry = data->d_sessions[backendID];
+ if (entry.d_sessions.size() >= s_maxSessionsPerBackend) {
+ entry.d_sessions.pop_back();
+ }
+ entry.d_sessions.push_front(std::move(session));
+ }
+}
+
+std::unique_ptr<TLSSession> TLSSessionCache::getSession(const boost::uuids::uuid& backendID, time_t now)
+{
+ auto data = d_data.lock();
+ auto it = data->d_sessions.find(backendID);
+ if (it == data->d_sessions.end()) {
+ return nullptr;
+ }
+
+ auto& entry = it->second;
+ if (entry.d_sessions.size() == 0) {
+ return nullptr;
+ }
+
+ entry.d_lastUsed = now;
+ auto value = std::move(entry.d_sessions.front());
+ entry.d_sessions.pop_front();
+
+ return value;
+}
+
+size_t TLSSessionCache::getSize()
+{
+ size_t count = 0;
+ auto data = d_data.lock();
+ for (const auto& backend : data->d_sessions) {
+ count += backend.second.d_sessions.size();
+ }
+ return count;
+}
diff --git a/dnsdist-session-cache.hh b/dnsdist-session-cache.hh
new file mode 100644
index 0000000..1881fb1
--- /dev/null
+++ b/dnsdist-session-cache.hh
@@ -0,0 +1,80 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <deque>
+#include <map>
+
+#include "lock.hh"
+#include "tcpiohandler.hh"
+#include "uuid-utils.hh"
+
+class TLSSessionCache
+{
+public:
+ TLSSessionCache()
+ {
+ }
+
+ void putSessions(const boost::uuids::uuid& backendID, time_t now, std::vector<std::unique_ptr<TLSSession>>&& sessions);
+ std::unique_ptr<TLSSession> getSession(const boost::uuids::uuid& backendID, time_t now);
+
+ static void setCleanupDelay(time_t delay)
+ {
+ s_cleanupDelay = delay;
+ }
+
+ static void setSessionValidity(time_t validity)
+ {
+ s_sessionValidity = validity;
+ }
+
+ static void setMaxTicketsPerBackend(uint16_t max)
+ {
+ s_maxSessionsPerBackend = max;
+ }
+
+ size_t getSize();
+
+private:
+ static time_t s_cleanupDelay;
+ static time_t s_sessionValidity;
+ static uint16_t s_maxSessionsPerBackend;
+
+ struct BackendEntry
+ {
+ std::deque<std::unique_ptr<TLSSession>> d_sessions;
+ time_t d_lastUsed{0};
+ };
+
+ struct CacheData
+ {
+ // do we need to shard this?
+ std::map<boost::uuids::uuid, BackendEntry> d_sessions;
+ time_t d_nextCleanup{0};
+ };
+ LockGuarded<CacheData> d_data;
+
+ void cleanup(time_t now, LockGuardedHolder<CacheData>& data);
+};
+
+extern TLSSessionCache g_sessionCache;
diff --git a/dnsdist-snmp.cc b/dnsdist-snmp.cc
new file mode 100644
index 0000000..4da43ee
--- /dev/null
+++ b/dnsdist-snmp.cc
@@ -0,0 +1,614 @@
+
+#include "dnsdist-snmp.hh"
+#include "dolog.hh"
+
+bool g_snmpEnabled{false};
+bool g_snmpTrapsEnabled{false};
+DNSDistSNMPAgent* g_snmpAgent{nullptr};
+
+#ifdef HAVE_NET_SNMP
+
+#define DNSDIST_OID 1, 3, 6, 1, 4, 1, 43315, 3
+#define DNSDIST_STATS_OID DNSDIST_OID, 1
+#define DNSDIST_STATS_TABLE_OID DNSDIST_OID, 2
+#define DNSDIST_TRAPS_OID DNSDIST_OID, 10, 0
+#define DNSDIST_TRAP_OBJECTS_OID DNSDIST_OID, 11
+
+static const oid queriesOID[] = { DNSDIST_STATS_OID, 1 };
+static const oid responsesOID[] = { DNSDIST_STATS_OID, 2 };
+static const oid servfailResponsesOID[] = { DNSDIST_STATS_OID, 3 };
+static const oid aclDropsOID[] = { DNSDIST_STATS_OID, 4 };
+// 5 was BlockFilter, removed in 1.2.0
+static const oid ruleDropOID[] = { DNSDIST_STATS_OID, 6 };
+static const oid ruleNXDomainOID[] = { DNSDIST_STATS_OID, 7 };
+static const oid ruleRefusedOID[] = { DNSDIST_STATS_OID, 8 };
+static const oid selfAnsweredOID[] = { DNSDIST_STATS_OID, 9 };
+static const oid downstreamTimeoutsOID[] = { DNSDIST_STATS_OID, 10 };
+static const oid downstreamSendErrorsOID[] = { DNSDIST_STATS_OID, 11 };
+static const oid truncFailOID[] = { DNSDIST_STATS_OID, 12 };
+static const oid noPolicyOID[] = { DNSDIST_STATS_OID, 13 };
+static const oid latency0_1OID[] = { DNSDIST_STATS_OID, 14 };
+static const oid latency1_10OID[] = { DNSDIST_STATS_OID, 15 };
+static const oid latency10_50OID[] = { DNSDIST_STATS_OID, 16 };
+static const oid latency50_100OID[] = { DNSDIST_STATS_OID, 17 };
+static const oid latency100_1000OID[] = { DNSDIST_STATS_OID, 18 };
+static const oid latencySlowOID[] = { DNSDIST_STATS_OID, 19 };
+static const oid latencyAvg100OID[] = { DNSDIST_STATS_OID, 20 };
+static const oid latencyAvg1000OID[] = { DNSDIST_STATS_OID, 21 };
+static const oid latencyAvg10000OID[] = { DNSDIST_STATS_OID, 22 };
+static const oid latencyAvg1000000OID[] = { DNSDIST_STATS_OID, 23 };
+static const oid uptimeOID[] = { DNSDIST_STATS_OID, 24 };
+static const oid realMemoryUsageOID[] = { DNSDIST_STATS_OID, 25 };
+static const oid nonCompliantQueriesOID[] = { DNSDIST_STATS_OID, 26 };
+static const oid nonCompliantResponsesOID[] = { DNSDIST_STATS_OID, 27 };
+static const oid rdQueriesOID[] = { DNSDIST_STATS_OID, 28 };
+static const oid emptyQueriesOID[] = { DNSDIST_STATS_OID, 29 };
+static const oid cacheHitsOID[] = { DNSDIST_STATS_OID, 30 };
+static const oid cacheMissesOID[] = { DNSDIST_STATS_OID, 31 };
+static const oid cpuUserMSecOID[] = { DNSDIST_STATS_OID, 32 };
+static const oid cpuSysMSecOID[] = { DNSDIST_STATS_OID, 33 };
+static const oid fdUsageOID[] = { DNSDIST_STATS_OID, 34 };
+static const oid dynBlockedOID[] = { DNSDIST_STATS_OID, 35 };
+static const oid dynBlockedNMGSizeOID[] = { DNSDIST_STATS_OID, 36 };
+static const oid ruleServFailOID[] = { DNSDIST_STATS_OID, 37 };
+static const oid securityStatusOID[] = { DNSDIST_STATS_OID, 38 };
+static const oid specialMemoryUsageOID[] = { DNSDIST_STATS_OID, 39 };
+static const oid ruleTruncatedOID[] = { DNSDIST_STATS_OID, 40 };
+
+static std::unordered_map<oid, DNSDistStats::entry_t> s_statsMap;
+
+/* We are never called for a GETNEXT if it's registered as a
+ "instance", as it's "magically" handled for us. */
+/* a instance handler also only hands us one request at a time, so
+ we don't need to loop over a list of requests; we'll only get one. */
+
+static int handleCounter64Stats(netsnmp_mib_handler* handler,
+ netsnmp_handler_registration* reginfo,
+ netsnmp_agent_request_info* reqinfo,
+ netsnmp_request_info* requests)
+{
+ if (reqinfo->mode != MODE_GET) {
+ return SNMP_ERR_GENERR;
+ }
+
+ if (reginfo->rootoid_len != OID_LENGTH(queriesOID) + 1) {
+ return SNMP_ERR_GENERR;
+ }
+
+ const auto& it = s_statsMap.find(reginfo->rootoid[reginfo->rootoid_len - 2]);
+ if (it == s_statsMap.end()) {
+ return SNMP_ERR_GENERR;
+ }
+
+ if (const auto& val = boost::get<pdns::stat_t*>(&it->second)) {
+ return DNSDistSNMPAgent::setCounter64Value(requests, (*val)->load());
+ }
+
+ return SNMP_ERR_GENERR;
+}
+
+static void registerCounter64Stat(const char* name, const oid statOID[], size_t statOIDLength, pdns::stat_t* ptr)
+{
+ if (statOIDLength != OID_LENGTH(queriesOID)) {
+ errlog("Invalid OID for SNMP Counter64 statistic %s", name);
+ return;
+ }
+
+ if (s_statsMap.find(statOID[statOIDLength - 1]) != s_statsMap.end()) {
+ errlog("OID for SNMP Counter64 statistic %s has already been registered", name);
+ return;
+ }
+
+ s_statsMap[statOID[statOIDLength - 1]] = ptr;
+ netsnmp_register_scalar(netsnmp_create_handler_registration(name,
+ handleCounter64Stats,
+ statOID,
+ statOIDLength,
+ HANDLER_CAN_RONLY));
+}
+
+static int handleFloatStats(netsnmp_mib_handler* handler,
+ netsnmp_handler_registration* reginfo,
+ netsnmp_agent_request_info* reqinfo,
+ netsnmp_request_info* requests)
+{
+ if (reqinfo->mode != MODE_GET) {
+ return SNMP_ERR_GENERR;
+ }
+
+ if (reginfo->rootoid_len != OID_LENGTH(queriesOID) + 1) {
+ return SNMP_ERR_GENERR;
+ }
+
+ const auto& it = s_statsMap.find(reginfo->rootoid[reginfo->rootoid_len - 2]);
+ if (it == s_statsMap.end()) {
+ return SNMP_ERR_GENERR;
+ }
+
+ if (const auto& val = boost::get<double*>(&it->second)) {
+ std::string str(std::to_string(**val));
+ snmp_set_var_typed_value(requests->requestvb,
+ ASN_OCTET_STR,
+ str.c_str(),
+ str.size());
+ return SNMP_ERR_NOERROR;
+ }
+
+ return SNMP_ERR_GENERR;
+}
+
+static void registerFloatStat(const char* name, const oid statOID[], size_t statOIDLength, double* ptr)
+{
+ if (statOIDLength != OID_LENGTH(queriesOID)) {
+ errlog("Invalid OID for SNMP Float statistic %s", name);
+ return;
+ }
+
+ if (s_statsMap.find(statOID[statOIDLength - 1]) != s_statsMap.end()) {
+ errlog("OID for SNMP Float statistic %s has already been registered", name);
+ return;
+ }
+
+ s_statsMap[statOID[statOIDLength - 1]] = ptr;
+ netsnmp_register_scalar(netsnmp_create_handler_registration(name,
+ handleFloatStats,
+ statOID,
+ statOIDLength,
+ HANDLER_CAN_RONLY));
+}
+
+static int handleGauge64Stats(netsnmp_mib_handler* handler,
+ netsnmp_handler_registration* reginfo,
+ netsnmp_agent_request_info* reqinfo,
+ netsnmp_request_info* requests)
+{
+ if (reqinfo->mode != MODE_GET) {
+ return SNMP_ERR_GENERR;
+ }
+
+ if (reginfo->rootoid_len != OID_LENGTH(queriesOID) + 1) {
+ return SNMP_ERR_GENERR;
+ }
+
+ const auto& it = s_statsMap.find(reginfo->rootoid[reginfo->rootoid_len - 2]);
+ if (it == s_statsMap.end()) {
+ return SNMP_ERR_GENERR;
+ }
+
+ std::string str;
+ uint64_t value = (*boost::get<DNSDistStats::statfunction_t>(&it->second))(str);
+ return DNSDistSNMPAgent::setCounter64Value(requests, value);
+}
+
+static void registerGauge64Stat(const char* name, const oid statOID[], size_t statOIDLength, DNSDistStats::statfunction_t ptr)
+{
+ if (statOIDLength != OID_LENGTH(queriesOID)) {
+ errlog("Invalid OID for SNMP Gauge64 statistic %s", name);
+ return;
+ }
+
+ if (s_statsMap.find(statOID[statOIDLength - 1]) != s_statsMap.end()) {
+ errlog("OID for SNMP Gauge64 statistic %s has already been registered", name);
+ return;
+ }
+
+ s_statsMap[statOID[statOIDLength - 1]] = ptr;
+ netsnmp_register_scalar(netsnmp_create_handler_registration(name,
+ handleGauge64Stats,
+ statOID,
+ statOIDLength,
+ HANDLER_CAN_RONLY));
+}
+
+/* column number definitions for table backendStatTable */
+#define COLUMN_BACKENDID 1
+#define COLUMN_BACKENDNAME 2
+#define COLUMN_BACKENDLATENCY 3
+#define COLUMN_BACKENDWEIGHT 4
+#define COLUMN_BACKENDOUTSTANDING 5
+#define COLUMN_BACKENDQPSLIMIT 6
+#define COLUMN_BACKENDREUSED 7
+#define COLUMN_BACKENDSTATE 8
+#define COLUMN_BACKENDADDRESS 9
+#define COLUMN_BACKENDPOOLS 10
+#define COLUMN_BACKENDQPS 11
+#define COLUMN_BACKENDQUERIES 12
+#define COLUMN_BACKENDORDER 13
+
+static const oid backendStatTableOID[] = { DNSDIST_STATS_TABLE_OID };
+static const oid backendNameOID[] = { DNSDIST_STATS_TABLE_OID, 1, 2 };
+static const oid backendStateOID[] = { DNSDIST_STATS_TABLE_OID, 1, 8};
+static const oid backendAddressOID[] = { DNSDIST_STATS_TABLE_OID, 1, 9};
+
+static const oid socketFamilyOID[] = { DNSDIST_TRAP_OBJECTS_OID, 1, 0 };
+static const oid socketProtocolOID[] = { DNSDIST_TRAP_OBJECTS_OID, 2, 0 };
+static const oid fromAddressOID[] = { DNSDIST_TRAP_OBJECTS_OID, 3, 0 };
+static const oid toAddressOID[] = { DNSDIST_TRAP_OBJECTS_OID, 4, 0 };
+static const oid queryTypeOID[] = { DNSDIST_TRAP_OBJECTS_OID, 5, 0 };
+static const oid querySizeOID[] = { DNSDIST_TRAP_OBJECTS_OID, 6, 0 };
+static const oid queryIDOID[] = { DNSDIST_TRAP_OBJECTS_OID, 7, 0 };
+static const oid qNameOID[] = { DNSDIST_TRAP_OBJECTS_OID, 8, 0 };
+static const oid qClassOID[] = { DNSDIST_TRAP_OBJECTS_OID, 9, 0 };
+static const oid qTypeOID[] = { DNSDIST_TRAP_OBJECTS_OID, 10, 0 };
+static const oid trapReasonOID[] = { DNSDIST_TRAP_OBJECTS_OID, 11, 0 };
+
+static const oid backendStatusChangeTrapOID[] = { DNSDIST_TRAPS_OID, 1 };
+static const oid actionTrapOID[] = { DNSDIST_TRAPS_OID, 2 };
+static const oid customTrapOID[] = { DNSDIST_TRAPS_OID, 3 };
+
+static servers_t s_servers;
+static size_t s_currentServerIdx = 0;
+
+static netsnmp_variable_list* backendStatTable_get_next_data_point(void** loop_context,
+ void** my_data_context,
+ netsnmp_variable_list* put_index_data,
+ netsnmp_iterator_info* mydata)
+{
+ if (s_currentServerIdx >= s_servers.size()) {
+ return NULL;
+ }
+
+ *my_data_context = (void*) (s_servers[s_currentServerIdx]).get();
+ snmp_set_var_typed_integer(put_index_data, ASN_UNSIGNED, s_currentServerIdx);
+ s_currentServerIdx++;
+
+ return put_index_data;
+}
+
+static netsnmp_variable_list* backendStatTable_get_first_data_point(void** loop_context,
+ void** data_context,
+ netsnmp_variable_list* put_index_data,
+ netsnmp_iterator_info* data)
+{
+ s_currentServerIdx = 0;
+
+ /* get a copy of the shared_ptrs so they are not
+ destroyed while we process the request */
+ auto dstates = g_dstates.getLocal();
+ s_servers.clear();
+ s_servers.reserve(dstates->size());
+ for (const auto& server : *dstates) {
+ s_servers.push_back(server);
+ }
+
+ return backendStatTable_get_next_data_point(loop_context,
+ data_context,
+ put_index_data,
+ data);
+}
+
+static int backendStatTable_handler(netsnmp_mib_handler* handler,
+ netsnmp_handler_registration* reginfo,
+ netsnmp_agent_request_info* reqinfo,
+ netsnmp_request_info* requests)
+{
+ netsnmp_request_info* request;
+
+ switch (reqinfo->mode) {
+ case MODE_GET:
+ for (request = requests; request; request = request->next) {
+ netsnmp_table_request_info* table_info = netsnmp_extract_table_info(request);
+ const DownstreamState* server = (const DownstreamState*) netsnmp_extract_iterator_context(request);
+
+ if (!server) {
+ continue;
+ }
+
+ switch (table_info->colnum) {
+ case COLUMN_BACKENDNAME:
+ snmp_set_var_typed_value(request->requestvb,
+ ASN_OCTET_STR,
+ server->getName().c_str(),
+ server->getName().size());
+ break;
+ case COLUMN_BACKENDLATENCY:
+ DNSDistSNMPAgent::setCounter64Value(request,
+ server->latencyUsec/1000.0);
+ break;
+ case COLUMN_BACKENDWEIGHT:
+ DNSDistSNMPAgent::setCounter64Value(request,
+ server->weight);
+ break;
+ case COLUMN_BACKENDOUTSTANDING:
+ DNSDistSNMPAgent::setCounter64Value(request,
+ server->outstanding.load());
+ break;
+ case COLUMN_BACKENDQPSLIMIT:
+ DNSDistSNMPAgent::setCounter64Value(request,
+ server->qps.getRate());
+ break;
+ case COLUMN_BACKENDREUSED:
+ DNSDistSNMPAgent::setCounter64Value(request, server->reuseds.load());
+ break;
+ case COLUMN_BACKENDSTATE:
+ {
+ std::string state(server->getStatus());
+ snmp_set_var_typed_value(request->requestvb,
+ ASN_OCTET_STR,
+ state.c_str(),
+ state.size());
+ break;
+ }
+ case COLUMN_BACKENDADDRESS:
+ {
+ std::string addr(server->remote.toStringWithPort());
+ snmp_set_var_typed_value(request->requestvb,
+ ASN_OCTET_STR,
+ addr.c_str(),
+ addr.size());
+ break;
+ }
+ case COLUMN_BACKENDPOOLS:
+ {
+ std::string pools;
+ for(auto& p : server->pools) {
+ if(!pools.empty())
+ pools+=" ";
+ pools+=p;
+ }
+ snmp_set_var_typed_value(request->requestvb,
+ ASN_OCTET_STR,
+ pools.c_str(),
+ pools.size());
+ break;
+ }
+ case COLUMN_BACKENDQPS:
+ DNSDistSNMPAgent::setCounter64Value(request, server->queryLoad.load());
+ break;
+ case COLUMN_BACKENDQUERIES:
+ DNSDistSNMPAgent::setCounter64Value(request, server->queries.load());
+ break;
+ case COLUMN_BACKENDORDER:
+ DNSDistSNMPAgent::setCounter64Value(request, server->order);
+ break;
+ default:
+ netsnmp_set_request_error(reqinfo,
+ request,
+ SNMP_NOSUCHOBJECT);
+ break;
+ }
+ }
+ break;
+ }
+ return SNMP_ERR_NOERROR;
+}
+#endif /* HAVE_NET_SNMP */
+
+bool DNSDistSNMPAgent::sendBackendStatusChangeTrap(const std::shared_ptr<DownstreamState>& dss)
+{
+#ifdef HAVE_NET_SNMP
+ const string backendAddress = dss->remote.toStringWithPort();
+ const string backendStatus = dss->getStatus();
+ netsnmp_variable_list* varList = nullptr;
+
+ snmp_varlist_add_variable(&varList,
+ snmpTrapOID,
+ snmpTrapOIDLen,
+ ASN_OBJECT_ID,
+ backendStatusChangeTrapOID,
+ OID_LENGTH(backendStatusChangeTrapOID) * sizeof(oid));
+
+
+ snmp_varlist_add_variable(&varList,
+ backendNameOID,
+ OID_LENGTH(backendNameOID),
+ ASN_OCTET_STR,
+ dss->getName().c_str(),
+ dss->getName().size());
+
+ snmp_varlist_add_variable(&varList,
+ backendAddressOID,
+ OID_LENGTH(backendAddressOID),
+ ASN_OCTET_STR,
+ backendAddress.c_str(),
+ backendAddress.size());
+
+ snmp_varlist_add_variable(&varList,
+ backendStateOID,
+ OID_LENGTH(backendStateOID),
+ ASN_OCTET_STR,
+ backendStatus.c_str(),
+ backendStatus.size());
+
+ return sendTrap(d_trapPipe[1], varList);
+#else
+ return true;
+#endif /* HAVE_NET_SNMP */
+}
+
+bool DNSDistSNMPAgent::sendCustomTrap(const std::string& reason)
+{
+#ifdef HAVE_NET_SNMP
+ netsnmp_variable_list* varList = nullptr;
+
+ snmp_varlist_add_variable(&varList,
+ snmpTrapOID,
+ snmpTrapOIDLen,
+ ASN_OBJECT_ID,
+ customTrapOID,
+ OID_LENGTH(customTrapOID) * sizeof(oid));
+
+ snmp_varlist_add_variable(&varList,
+ trapReasonOID,
+ OID_LENGTH(trapReasonOID),
+ ASN_OCTET_STR,
+ reason.c_str(),
+ reason.size());
+
+ return sendTrap(d_trapPipe[1], varList);
+#else
+ return true;
+#endif /* HAVE_NET_SNMP */
+}
+
+bool DNSDistSNMPAgent::sendDNSTrap(const DNSQuestion& dq, const std::string& reason)
+{
+#ifdef HAVE_NET_SNMP
+ std::string local = dq.local->toString();
+ std::string remote = dq.remote->toString();
+ std::string qname = dq.qname->toStringNoDot();
+ const uint32_t socketFamily = dq.remote->isIPv4() ? 1 : 2;
+ const uint32_t socketProtocol = dq.overTCP() ? 2 : 1;
+ const uint32_t queryType = dq.getHeader()->qr ? 2 : 1;
+ const uint32_t querySize = (uint32_t) dq.getData().size();
+ const uint32_t queryID = (uint32_t) ntohs(dq.getHeader()->id);
+ const uint32_t qType = (uint32_t) dq.qtype;
+ const uint32_t qClass = (uint32_t) dq.qclass;
+
+ netsnmp_variable_list* varList = nullptr;
+
+ snmp_varlist_add_variable(&varList,
+ snmpTrapOID,
+ snmpTrapOIDLen,
+ ASN_OBJECT_ID,
+ actionTrapOID,
+ OID_LENGTH(actionTrapOID) * sizeof(oid));
+
+ snmp_varlist_add_variable(&varList,
+ socketFamilyOID,
+ OID_LENGTH(socketFamilyOID),
+ ASN_INTEGER,
+ reinterpret_cast<const u_char*>(&socketFamily),
+ sizeof(socketFamily));
+
+ snmp_varlist_add_variable(&varList,
+ socketProtocolOID,
+ OID_LENGTH(socketProtocolOID),
+ ASN_INTEGER,
+ reinterpret_cast<const u_char*>(&socketProtocol),
+ sizeof(socketProtocol));
+
+ snmp_varlist_add_variable(&varList,
+ fromAddressOID,
+ OID_LENGTH(fromAddressOID),
+ ASN_OCTET_STR,
+ remote.c_str(),
+ remote.size());
+
+ snmp_varlist_add_variable(&varList,
+ toAddressOID,
+ OID_LENGTH(toAddressOID),
+ ASN_OCTET_STR,
+ local.c_str(),
+ local.size());
+
+ snmp_varlist_add_variable(&varList,
+ queryTypeOID,
+ OID_LENGTH(queryTypeOID),
+ ASN_INTEGER,
+ reinterpret_cast<const u_char*>(&queryType),
+ sizeof(queryType));
+
+ snmp_varlist_add_variable(&varList,
+ querySizeOID,
+ OID_LENGTH(querySizeOID),
+ ASN_UNSIGNED,
+ reinterpret_cast<const u_char*>(&querySize),
+ sizeof(querySize));
+
+ snmp_varlist_add_variable(&varList,
+ queryIDOID,
+ OID_LENGTH(queryIDOID),
+ ASN_UNSIGNED,
+ reinterpret_cast<const u_char*>(&queryID),
+ sizeof(queryID));
+
+ snmp_varlist_add_variable(&varList,
+ qNameOID,
+ OID_LENGTH(qNameOID),
+ ASN_OCTET_STR,
+ qname.c_str(),
+ qname.size());
+
+ snmp_varlist_add_variable(&varList,
+ qClassOID,
+ OID_LENGTH(qClassOID),
+ ASN_UNSIGNED,
+ reinterpret_cast<const u_char*>(&qClass),
+ sizeof(qClass));
+
+ snmp_varlist_add_variable(&varList,
+ qTypeOID,
+ OID_LENGTH(qTypeOID),
+ ASN_UNSIGNED,
+ reinterpret_cast<const u_char*>(&qType),
+ sizeof(qType));
+
+ snmp_varlist_add_variable(&varList,
+ trapReasonOID,
+ OID_LENGTH(trapReasonOID),
+ ASN_OCTET_STR,
+ reason.c_str(),
+ reason.size());
+
+ return sendTrap(d_trapPipe[1], varList);
+#else
+ return true;
+#endif /* HAVE_NET_SNMP */
+}
+
+DNSDistSNMPAgent::DNSDistSNMPAgent(const std::string& name, const std::string& daemonSocket): SNMPAgent(name, daemonSocket)
+{
+#ifdef HAVE_NET_SNMP
+
+ registerCounter64Stat("queries", queriesOID, OID_LENGTH(queriesOID), &g_stats.queries);
+ registerCounter64Stat("responses", responsesOID, OID_LENGTH(responsesOID), &g_stats.responses);
+ registerCounter64Stat("servfailResponses", servfailResponsesOID, OID_LENGTH(servfailResponsesOID), &g_stats.servfailResponses);
+ registerCounter64Stat("aclDrops", aclDropsOID, OID_LENGTH(aclDropsOID), &g_stats.aclDrops);
+ registerCounter64Stat("ruleDrop", ruleDropOID, OID_LENGTH(ruleDropOID), &g_stats.ruleDrop);
+ registerCounter64Stat("ruleNXDomain", ruleNXDomainOID, OID_LENGTH(ruleNXDomainOID), &g_stats.ruleNXDomain);
+ registerCounter64Stat("ruleRefused", ruleRefusedOID, OID_LENGTH(ruleRefusedOID), &g_stats.ruleRefused);
+ registerCounter64Stat("ruleServFail", ruleServFailOID, OID_LENGTH(ruleServFailOID), &g_stats.ruleServFail);
+ registerCounter64Stat("ruleTruncated", ruleTruncatedOID, OID_LENGTH(ruleTruncatedOID), &g_stats.ruleTruncated);
+ registerCounter64Stat("selfAnswered", selfAnsweredOID, OID_LENGTH(selfAnsweredOID), &g_stats.selfAnswered);
+ registerCounter64Stat("downstreamTimeouts", downstreamTimeoutsOID, OID_LENGTH(downstreamTimeoutsOID), &g_stats.downstreamTimeouts);
+ registerCounter64Stat("downstreamSendErrors", downstreamSendErrorsOID, OID_LENGTH(downstreamSendErrorsOID), &g_stats.downstreamSendErrors);
+ registerCounter64Stat("truncFail", truncFailOID, OID_LENGTH(truncFailOID), &g_stats.truncFail);
+ registerCounter64Stat("noPolicy", noPolicyOID, OID_LENGTH(noPolicyOID), &g_stats.noPolicy);
+ registerCounter64Stat("latency0_1", latency0_1OID, OID_LENGTH(latency0_1OID), &g_stats.latency0_1);
+ registerCounter64Stat("latency1_10", latency1_10OID, OID_LENGTH(latency1_10OID), &g_stats.latency1_10);
+ registerCounter64Stat("latency10_50", latency10_50OID, OID_LENGTH(latency10_50OID), &g_stats.latency10_50);
+ registerCounter64Stat("latency50_100", latency50_100OID, OID_LENGTH(latency50_100OID), &g_stats.latency50_100);
+ registerCounter64Stat("latency100_1000", latency100_1000OID, OID_LENGTH(latency100_1000OID), &g_stats.latency100_1000);
+ registerCounter64Stat("latencySlow", latencySlowOID, OID_LENGTH(latencySlowOID), &g_stats.latencySlow);
+ registerCounter64Stat("nonCompliantQueries", nonCompliantQueriesOID, OID_LENGTH(nonCompliantQueriesOID), &g_stats.nonCompliantQueries);
+ registerCounter64Stat("nonCompliantResponses", nonCompliantResponsesOID, OID_LENGTH(nonCompliantResponsesOID), &g_stats.nonCompliantResponses);
+ registerCounter64Stat("rdQueries", rdQueriesOID, OID_LENGTH(rdQueriesOID), &g_stats.rdQueries);
+ registerCounter64Stat("emptyQueries", emptyQueriesOID, OID_LENGTH(emptyQueriesOID), &g_stats.emptyQueries);
+ registerCounter64Stat("cacheHits", cacheHitsOID, OID_LENGTH(cacheHitsOID), &g_stats.cacheHits);
+ registerCounter64Stat("cacheMisses", cacheMissesOID, OID_LENGTH(cacheMissesOID), &g_stats.cacheMisses);
+ registerCounter64Stat("dynBlocked", dynBlockedOID, OID_LENGTH(dynBlockedOID), &g_stats.dynBlocked);
+ registerFloatStat("latencyAvg100", latencyAvg100OID, OID_LENGTH(latencyAvg100OID), &g_stats.latencyAvg100);
+ registerFloatStat("latencyAvg1000", latencyAvg1000OID, OID_LENGTH(latencyAvg1000OID), &g_stats.latencyAvg1000);
+ registerFloatStat("latencyAvg10000", latencyAvg10000OID, OID_LENGTH(latencyAvg10000OID), &g_stats.latencyAvg10000);
+ registerFloatStat("latencyAvg1000000", latencyAvg1000000OID, OID_LENGTH(latencyAvg1000000OID), &g_stats.latencyAvg1000000);
+ registerGauge64Stat("uptime", uptimeOID, OID_LENGTH(uptimeOID), &uptimeOfProcess);
+ registerGauge64Stat("specialMemoryUsage", specialMemoryUsageOID, OID_LENGTH(specialMemoryUsageOID), &getSpecialMemoryUsage);
+ registerGauge64Stat("cpuUserMSec", cpuUserMSecOID, OID_LENGTH(cpuUserMSecOID), &getCPUTimeUser);
+ registerGauge64Stat("cpuSysMSec", cpuSysMSecOID, OID_LENGTH(cpuSysMSecOID), &getCPUTimeSystem);
+ registerGauge64Stat("fdUsage", fdUsageOID, OID_LENGTH(fdUsageOID), &getOpenFileDescriptors);
+ registerGauge64Stat("dynBlockedNMGSize", dynBlockedNMGSizeOID, OID_LENGTH(dynBlockedNMGSizeOID), [](const std::string&) { return g_dynblockNMG.getLocal()->size(); });
+ registerGauge64Stat("securityStatus", securityStatusOID, OID_LENGTH(securityStatusOID), [](const std::string&) { return g_stats.securityStatus.load(); });
+ registerGauge64Stat("realMemoryUsage", realMemoryUsageOID, OID_LENGTH(realMemoryUsageOID), &getRealMemoryUsage);
+
+
+ netsnmp_table_registration_info* table_info = SNMP_MALLOC_TYPEDEF(netsnmp_table_registration_info);
+ netsnmp_table_helper_add_indexes(table_info,
+ ASN_GAUGE, /* index: backendId */
+ 0);
+ table_info->min_column = COLUMN_BACKENDNAME;
+ table_info->max_column = COLUMN_BACKENDORDER;
+ netsnmp_iterator_info* iinfo = SNMP_MALLOC_TYPEDEF(netsnmp_iterator_info);
+ iinfo->get_first_data_point = backendStatTable_get_first_data_point;
+ iinfo->get_next_data_point = backendStatTable_get_next_data_point;
+ iinfo->table_reginfo = table_info;
+
+ netsnmp_register_table_iterator(netsnmp_create_handler_registration("backendStatTable",
+ backendStatTable_handler,
+ backendStatTableOID,
+ OID_LENGTH(backendStatTableOID),
+ HANDLER_CAN_RONLY),
+ iinfo);
+
+#endif /* HAVE_NET_SNMP */
+}
diff --git a/dnsdist-snmp.hh b/dnsdist-snmp.hh
new file mode 100644
index 0000000..3ccde78
--- /dev/null
+++ b/dnsdist-snmp.hh
@@ -0,0 +1,37 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "snmp-agent.hh"
+
+class DNSDistSNMPAgent;
+
+#include "dnsdist.hh"
+
+class DNSDistSNMPAgent: public SNMPAgent
+{
+public:
+ DNSDistSNMPAgent(const std::string& name, const std::string& daemonSocket);
+ bool sendBackendStatusChangeTrap(const std::shared_ptr<DownstreamState>&);
+ bool sendCustomTrap(const std::string& reason);
+ bool sendDNSTrap(const DNSQuestion&, const std::string& reason="");
+};
diff --git a/dnsdist-svc.cc b/dnsdist-svc.cc
new file mode 100644
index 0000000..ffd42fd
--- /dev/null
+++ b/dnsdist-svc.cc
@@ -0,0 +1,133 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsdist-svc.hh"
+#include "dnswriter.hh"
+#include "svc-records.hh"
+
+bool generateSVCPayload(std::vector<uint8_t>& payload, uint16_t priority, const DNSName& target, const std::set<uint16_t>& mandatoryParams, const std::vector<std::string>& alpns, bool noDefaultAlpn, std::optional<uint16_t> port, const std::string& ech, const std::vector<ComboAddress>& ipv4hints, const std::vector<ComboAddress>& ipv6hints, const std::vector<std::pair<uint16_t, std::string>>& additionalParams)
+{
+ // this is an _ordered_ set and the comparison operator is properly defined,
+ // so the parameters will be ordered as defined in the RFC
+ std::set<SvcParam> params;
+
+ if (!mandatoryParams.empty()) {
+ std::set<SvcParam::SvcParamKey> mandatoryKeys;
+ for (const auto& entry : mandatoryParams) {
+ mandatoryKeys.insert(static_cast<SvcParam::SvcParamKey>(entry));
+ }
+ params.insert({SvcParam::SvcParamKey::mandatory, std::move(mandatoryKeys)});
+ }
+
+ if (!alpns.empty()) {
+ params.insert({SvcParam::SvcParamKey::alpn, std::vector<std::string>(alpns)});
+ }
+
+ if (noDefaultAlpn) {
+ params.insert({SvcParam::SvcParamKey::no_default_alpn});
+ }
+
+ if (port) {
+ params.insert({SvcParam::SvcParamKey::port, *port});
+ }
+
+ if (!ipv4hints.empty()) {
+ params.insert({SvcParam::SvcParamKey::ipv4hint, std::vector<ComboAddress>(ipv4hints)});
+ }
+
+ if (!ech.empty()) {
+ params.insert({SvcParam::SvcParamKey::ech, ech});
+ }
+
+ if (!ipv6hints.empty()) {
+ params.insert({SvcParam::SvcParamKey::ipv6hint, std::vector<ComboAddress>(ipv6hints)});
+ }
+
+ for (const auto& param : additionalParams) {
+ params.insert({static_cast<SvcParam::SvcParamKey>(param.first), param.second});
+ }
+
+ if (priority == 0 && params.size() != 0) {
+ return false;
+ }
+
+ payload.clear();
+ /* we will remove the header, question and record header parts later */
+ DNSPacketWriter pw(payload, g_rootdnsname, QType::A, QClass::IN, 0);
+ pw.startRecord(g_rootdnsname, QType::A, 60, QClass::IN, DNSResourceRecord::ANSWER, false);
+ size_t offset = pw.size();
+ pw.xfr16BitInt(priority);
+ pw.xfrName(target, false, true);
+ pw.xfrSvcParamKeyVals(params);
+ pw.commit();
+
+ if (payload.size() <= offset) {
+ return false;
+ }
+
+ payload.erase(payload.begin(), payload.begin() + offset);
+ return true;
+}
+
+bool generateSVCPayload(std::vector<uint8_t>& payload, const SVCRecordParameters& parameters)
+{
+ return generateSVCPayload(payload, parameters.priority, parameters.target, parameters.mandatoryParams, parameters.alpns, parameters.noDefaultAlpn, parameters.port, parameters.ech, parameters.ipv4hints, parameters.ipv6hints, parameters.additionalParams);
+}
+
+struct SVCRecordParameters parseSVCParameters(const svcParamsLua_t& params)
+{
+ struct SVCRecordParameters parameters;
+ for (const auto& p : params) {
+ if (p.first == "mandatory") {
+ for (auto const& entry : boost::get<std::vector<std::pair<int, std::string>>>(p.second)) {
+ parameters.mandatoryParams.insert(SvcParam::keyFromString(entry.second));
+ }
+ }
+ else if (p.first == "alpn") {
+ for (auto const& entry : boost::get<std::vector<std::pair<int, std::string>>>(p.second)) {
+ parameters.alpns.push_back(entry.second);
+ }
+ }
+ else if (p.first == "noDefaultAlpn") {
+ parameters.noDefaultAlpn = boost::get<bool>(p.second);
+ }
+ else if (p.first == "port") {
+ parameters.port = boost::get<uint16_t>(p.second);
+ }
+ else if (p.first == "ipv4hint") {
+ for (auto const& entry : boost::get<std::vector<std::pair<int, std::string>>>(p.second)) {
+ parameters.ipv4hints.push_back(ComboAddress(entry.second));
+ }
+ }
+ else if (p.first == "ech") {
+ parameters.ech = boost::get<std::string>(p.second);
+ }
+ else if (p.first == "ipv6hint") {
+ for (auto const& entry : boost::get<std::vector<std::pair<int, std::string>>>(p.second)) {
+ parameters.ipv6hints.push_back(ComboAddress(entry.second));
+ }
+ }
+ else {
+ parameters.additionalParams.push_back({SvcParam::keyFromString(p.first), boost::get<std::string>(p.second)});
+ }
+ }
+ return parameters;
+}
diff --git a/dnsdist-svc.hh b/dnsdist-svc.hh
new file mode 100644
index 0000000..d0a1a8c
--- /dev/null
+++ b/dnsdist-svc.hh
@@ -0,0 +1,66 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <optional>
+#include <set>
+#include <string>
+#include <vector>
+#include <unordered_map>
+#include <boost/variant.hpp>
+
+#include "dnsname.hh"
+#include "iputils.hh"
+
+struct SVCRecordParameters
+{
+ SVCRecordParameters()
+ {
+ }
+
+ std::set<uint16_t> mandatoryParams;
+ std::vector<std::string> alpns;
+ std::vector<ComboAddress> ipv4hints;
+ std::vector<ComboAddress> ipv6hints;
+ std::vector<std::pair<uint16_t, std::string>> additionalParams;
+ std::string ech;
+ DNSName target;
+ std::optional<uint16_t> port{std::nullopt};
+ uint16_t priority{0};
+ bool noDefaultAlpn{false};
+};
+
+typedef std::unordered_map<
+ std::string,
+ boost::variant<
+ uint16_t,
+ bool,
+ std::string,
+ std::vector<std::pair<int, std::string>>,
+ std::vector<std::pair<int, ComboAddress>>>>
+ svcParamsLua_t;
+
+struct SVCRecordParameters parseSVCParameters(const svcParamsLua_t& params);
+
+bool generateSVCPayload(std::vector<uint8_t>& payload, uint16_t priority, const DNSName& target, const std::set<uint16_t>& mandatoryParams, const std::vector<std::string>& alpns, bool noDefaultAlpn, std::optional<uint16_t> port, const std::string& ech, const std::vector<ComboAddress>& ipv4hints, const std::vector<ComboAddress>& ipv6hints, const std::vector<std::pair<uint16_t, std::string>>& additionalParams);
+
+bool generateSVCPayload(std::vector<uint8_t>& payload, const SVCRecordParameters& parameters);
diff --git a/dnsdist-systemd.cc b/dnsdist-systemd.cc
new file mode 100644
index 0000000..6f9f890
--- /dev/null
+++ b/dnsdist-systemd.cc
@@ -0,0 +1,35 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "config.h"
+#include "dnsdist-systemd.hh"
+#include <cstdlib>
+
+bool running_in_service_mgr() {
+#ifdef HAVE_SYSTEMD
+ char *c;
+ c = getenv("NOTIFY_SOCKET"); // XXX Ideally we'd check for INVOCATION_ID (systemd.exec(5)), but that was introduced in systemd 232, and Debian Jessie has 215
+ if (c != nullptr) {
+ return true;
+ }
+#endif
+ return false;
+}
diff --git a/dnsdist-systemd.hh b/dnsdist-systemd.hh
new file mode 100644
index 0000000..046905c
--- /dev/null
+++ b/dnsdist-systemd.hh
@@ -0,0 +1,24 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+bool running_in_service_mgr();
diff --git a/dnsdist-tcp-downstream.cc b/dnsdist-tcp-downstream.cc
new file mode 100644
index 0000000..9b83cad
--- /dev/null
+++ b/dnsdist-tcp-downstream.cc
@@ -0,0 +1,778 @@
+
+#include "dnsdist-session-cache.hh"
+#include "dnsdist-tcp-downstream.hh"
+#include "dnsdist-tcp-upstream.hh"
+
+#include "dnsparser.hh"
+
+thread_local DownstreamTCPConnectionsManager t_downstreamTCPConnectionsManager;
+
+ConnectionToBackend::~ConnectionToBackend()
+{
+ if (d_ds && d_handler) {
+ --d_ds->tcpCurrentConnections;
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ if (d_handler->isTLS()) {
+ if (d_handler->hasTLSSessionBeenResumed()) {
+ ++d_ds->tlsResumptions;
+ }
+ try {
+ auto sessions = d_handler->getTLSSessions();
+ if (!sessions.empty()) {
+ g_sessionCache.putSessions(d_ds->getID(), now.tv_sec, std::move(sessions));
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Unable to get a TLS session: %s", e.what());
+ }
+ }
+ auto diff = now - d_connectionStartTime;
+ // cerr<<"connection to backend terminated after "<<d_queries<<" queries, "<<diff.tv_sec<<" seconds"<<endl;
+ d_ds->updateTCPMetrics(d_queries, diff.tv_sec * 1000 + diff.tv_usec / 1000);
+ }
+}
+
+bool ConnectionToBackend::reconnect()
+{
+ std::unique_ptr<TLSSession> tlsSession{nullptr};
+ if (d_handler) {
+ DEBUGLOG("closing socket "<<d_handler->getDescriptor());
+ if (d_handler->isTLS()) {
+ if (d_handler->hasTLSSessionBeenResumed()) {
+ ++d_ds->tlsResumptions;
+ }
+ try {
+ auto sessions = d_handler->getTLSSessions();
+ if (!sessions.empty()) {
+ tlsSession = std::move(sessions.back());
+ sessions.pop_back();
+ if (!sessions.empty()) {
+ g_sessionCache.putSessions(d_ds->getID(), time(nullptr), std::move(sessions));
+ }
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Unable to get a TLS session to resume: %s", e.what());
+ }
+ }
+ d_handler->close();
+ d_ioState.reset();
+ d_handler.reset();
+ --d_ds->tcpCurrentConnections;
+ }
+
+ d_fresh = true;
+ d_highestStreamID = 0;
+ d_proxyProtocolPayloadSent = false;
+
+ do {
+ vinfolog("TCP connecting to downstream %s (%d)", d_ds->getNameWithAddr(), d_downstreamFailures);
+ DEBUGLOG("Opening TCP connection to backend "<<d_ds->getNameWithAddr());
+ ++d_ds->tcpNewConnections;
+ try {
+ auto socket = std::make_unique<Socket>(d_ds->remote.sin4.sin_family, SOCK_STREAM, 0);
+ DEBUGLOG("result of socket() is "<<socket->getHandle());
+
+ if (!IsAnyAddress(d_ds->sourceAddr)) {
+ SSetsockopt(socket->getHandle(), SOL_SOCKET, SO_REUSEADDR, 1);
+#ifdef IP_BIND_ADDRESS_NO_PORT
+ if (d_ds->ipBindAddrNoPort) {
+ SSetsockopt(socket->getHandle(), SOL_IP, IP_BIND_ADDRESS_NO_PORT, 1);
+ }
+#endif
+#ifdef SO_BINDTODEVICE
+ if (!d_ds->sourceItfName.empty()) {
+ int res = setsockopt(socket->getHandle(), SOL_SOCKET, SO_BINDTODEVICE, d_ds->sourceItfName.c_str(), d_ds->sourceItfName.length());
+ if (res != 0) {
+ vinfolog("Error setting up the interface on backend TCP socket '%s': %s", d_ds->getNameWithAddr(), stringerror());
+ }
+ }
+#endif
+ socket->bind(d_ds->sourceAddr, false);
+ }
+ socket->setNonBlocking();
+
+ gettimeofday(&d_connectionStartTime, nullptr);
+ auto handler = std::make_unique<TCPIOHandler>(d_ds->d_tlsSubjectName, socket->releaseHandle(), timeval{0,0}, d_ds->d_tlsCtx, d_connectionStartTime.tv_sec);
+ if (!tlsSession && d_ds->d_tlsCtx) {
+ tlsSession = g_sessionCache.getSession(d_ds->getID(), d_connectionStartTime.tv_sec);
+ }
+ if (tlsSession) {
+ handler->setTLSSession(tlsSession);
+ }
+ handler->tryConnect(d_ds->tcpFastOpen && isFastOpenEnabled(), d_ds->remote);
+ d_queries = 0;
+
+ d_handler = std::move(handler);
+ d_ds->incCurrentConnectionsCount();
+ return true;
+ }
+ catch (const std::runtime_error& e) {
+ vinfolog("Connection to downstream server %s failed: %s", d_ds->getName(), e.what());
+ d_downstreamFailures++;
+ if (d_downstreamFailures >= d_ds->d_retries) {
+ throw;
+ }
+ }
+ }
+ while (d_downstreamFailures < d_ds->d_retries);
+
+ return false;
+}
+
+TCPConnectionToBackend::~TCPConnectionToBackend()
+{
+ if (d_ds && !d_pendingResponses.empty()) {
+ d_ds->outstanding -= d_pendingResponses.size();
+ }
+}
+
+void TCPConnectionToBackend::release()
+{
+ d_ds->outstanding -= d_pendingResponses.size();
+
+ d_pendingResponses.clear();
+ d_pendingQueries.clear();
+
+ if (d_ioState) {
+ d_ioState.reset();
+ }
+}
+
+static void editPayloadID(PacketBuffer& payload, uint16_t newId, size_t proxyProtocolPayloadSize, bool sizePrepended)
+{
+ /* we cannot do a direct cast as the alignment might be off (the size of the payload might have been prepended, which is bad enough,
+ but we might also have a proxy protocol payload */
+ size_t startOfHeaderOffset = (sizePrepended ? sizeof(uint16_t) : 0) + proxyProtocolPayloadSize;
+ if (payload.size() < startOfHeaderOffset + sizeof(dnsheader)) {
+ throw std::runtime_error("Invalid buffer for outgoing TCP query (size " + std::to_string(payload.size()));
+ }
+ uint16_t id = htons(newId);
+ memcpy(&payload.at(startOfHeaderOffset), &id, sizeof(id));
+}
+
+enum class QueryState : uint8_t {
+ hasSizePrepended,
+ noSize
+};
+
+enum class ConnectionState : uint8_t {
+ needProxy,
+ proxySent
+};
+
+static void prepareQueryForSending(TCPQuery& query, uint16_t id, QueryState queryState, ConnectionState connectionState)
+{
+ if (connectionState == ConnectionState::needProxy) {
+ if (query.d_proxyProtocolPayload.size() > 0 && !query.d_proxyProtocolPayloadAdded) {
+ query.d_buffer.insert(query.d_buffer.begin(), query.d_proxyProtocolPayload.begin(), query.d_proxyProtocolPayload.end());
+ query.d_proxyProtocolPayloadAdded = true;
+ query.d_proxyProtocolPayloadAddedSize = query.d_proxyProtocolPayload.size();
+ }
+ }
+ else if (connectionState == ConnectionState::proxySent) {
+ if (query.d_proxyProtocolPayloadAdded) {
+ if (query.d_buffer.size() < query.d_proxyProtocolPayloadAddedSize) {
+ throw std::runtime_error("Trying to remove a proxy protocol payload of size " + std::to_string(query.d_proxyProtocolPayload.size()) + " from a buffer of size " + std::to_string(query.d_buffer.size()));
+ }
+ query.d_buffer.erase(query.d_buffer.begin(), query.d_buffer.begin() + query.d_proxyProtocolPayloadAddedSize);
+ query.d_proxyProtocolPayloadAdded = false;
+ query.d_proxyProtocolPayloadAddedSize = 0;
+ }
+ }
+ editPayloadID(query.d_buffer, id, query.d_proxyProtocolPayloadAdded ? query.d_proxyProtocolPayloadAddedSize : 0, true);
+}
+
+IOState TCPConnectionToBackend::queueNextQuery(std::shared_ptr<TCPConnectionToBackend>& conn)
+{
+ conn->d_currentQuery = std::move(conn->d_pendingQueries.front());
+
+ uint16_t id = conn->d_highestStreamID;
+ prepareQueryForSending(conn->d_currentQuery.d_query, id, QueryState::hasSizePrepended, conn->needProxyProtocolPayload() ? ConnectionState::needProxy : ConnectionState::proxySent);
+
+ conn->d_pendingQueries.pop_front();
+ conn->d_state = State::sendingQueryToBackend;
+ conn->d_currentPos = 0;
+
+ return IOState::NeedWrite;
+}
+
+IOState TCPConnectionToBackend::sendQuery(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now)
+{
+ DEBUGLOG("sending query to backend "<<conn->getDS()->getName()<<" over FD "<<conn->d_handler->getDescriptor());
+
+ IOState state = conn->d_handler->tryWrite(conn->d_currentQuery.d_query.d_buffer, conn->d_currentPos, conn->d_currentQuery.d_query.d_buffer.size());
+
+ if (state != IOState::Done) {
+ return state;
+ }
+
+ DEBUGLOG("query sent to backend");
+ /* request sent ! */
+ if (conn->d_currentQuery.d_query.d_proxyProtocolPayloadAdded) {
+ conn->d_proxyProtocolPayloadSent = true;
+ }
+ ++conn->d_queries;
+ conn->d_currentPos = 0;
+
+ DEBUGLOG("adding a pending response for ID "<<conn->d_highestStreamID<<" and QNAME "<<conn->d_currentQuery.d_query.d_idstate.qname);
+ auto res = conn->d_pendingResponses.insert({conn->d_highestStreamID, std::move(conn->d_currentQuery)});
+ /* if there was already a pending response with that ID, we messed up and we don't expect more
+ than one response */
+ if (res.second) {
+ ++conn->d_ds->outstanding;
+ }
+ ++conn->d_highestStreamID;
+ conn->d_currentQuery.d_sender.reset();
+ conn->d_currentQuery.d_query.d_buffer.clear();
+
+ return state;
+}
+
+void TCPConnectionToBackend::handleIO(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now)
+{
+ if (conn->d_handler == nullptr) {
+ throw std::runtime_error("No downstream socket in " + std::string(__PRETTY_FUNCTION__) + "!");
+ }
+
+ bool connectionDied = false;
+ IOState iostate = IOState::Done;
+ IOStateGuard ioGuard(conn->d_ioState);
+ bool reconnected = false;
+
+ do {
+ reconnected = false;
+
+ try {
+ if (conn->d_state == State::sendingQueryToBackend) {
+ iostate = sendQuery(conn, now);
+
+ while (iostate == IOState::Done && !conn->d_pendingQueries.empty()) {
+ queueNextQuery(conn);
+ iostate = sendQuery(conn, now);
+ }
+
+ if (iostate == IOState::Done && conn->d_pendingQueries.empty()) {
+ conn->d_state = State::waitingForResponseFromBackend;
+ conn->d_currentPos = 0;
+ conn->d_responseBuffer.resize(sizeof(uint16_t));
+ iostate = IOState::NeedRead;
+ }
+ }
+
+ if (conn->d_state == State::waitingForResponseFromBackend ||
+ conn->d_state == State::readingResponseSizeFromBackend) {
+ DEBUGLOG("reading response size from backend");
+ // then we need to allocate a new buffer (new because we might need to re-send the query if the
+ // backend dies on us)
+ // We also might need to read and send to the client more than one response in case of XFR (yeah!)
+ conn->d_responseBuffer.resize(sizeof(uint16_t));
+ iostate = conn->d_handler->tryRead(conn->d_responseBuffer, conn->d_currentPos, sizeof(uint16_t));
+ if (iostate == IOState::Done) {
+ DEBUGLOG("got response size from backend");
+ conn->d_state = State::readingResponseFromBackend;
+ conn->d_responseSize = conn->d_responseBuffer.at(0) * 256 + conn->d_responseBuffer.at(1);
+ conn->d_responseBuffer.reserve(conn->d_responseSize + /* we will need to prepend the size later */ 2);
+ conn->d_responseBuffer.resize(conn->d_responseSize);
+ conn->d_currentPos = 0;
+ conn->d_lastDataReceivedTime = now;
+ }
+ else if (conn->d_state == State::waitingForResponseFromBackend && conn->d_currentPos > 0) {
+ conn->d_state = State::readingResponseSizeFromBackend;
+ }
+ }
+
+ if (conn->d_state == State::readingResponseFromBackend) {
+ DEBUGLOG("reading response from backend");
+ iostate = conn->d_handler->tryRead(conn->d_responseBuffer, conn->d_currentPos, conn->d_responseSize);
+ if (iostate == IOState::Done) {
+ DEBUGLOG("got response from backend");
+ try {
+ conn->d_lastDataReceivedTime = now;
+ iostate = conn->handleResponse(conn, now);
+ }
+ catch (const std::exception& e) {
+ vinfolog("Got an exception while handling TCP response from %s (client is %s): %s", conn->d_ds ? conn->d_ds->getName() : "unknown", conn->d_currentQuery.d_query.d_idstate.origRemote.toStringWithPort(), e.what());
+ ioGuard.release();
+ conn->release();
+ return;
+ }
+ }
+ }
+
+ if (conn->d_state != State::idle &&
+ conn->d_state != State::sendingQueryToBackend &&
+ conn->d_state != State::waitingForResponseFromBackend &&
+ conn->d_state != State::readingResponseSizeFromBackend &&
+ conn->d_state != State::readingResponseFromBackend) {
+ vinfolog("Unexpected state %d in TCPConnectionToBackend::handleIO", static_cast<int>(conn->d_state));
+ }
+ }
+ catch (const std::exception& e) {
+ /* most likely an EOF because the other end closed the connection,
+ but it might also be a real IO error or something else.
+ Let's just drop the connection
+ */
+ vinfolog("Got an exception while handling (%s backend) TCP query from %s: %s", (conn->d_state == State::sendingQueryToBackend ? "writing to" : "reading from"), conn->d_currentQuery.d_query.d_idstate.origRemote.toStringWithPort(), e.what());
+
+ if (conn->d_state == State::sendingQueryToBackend) {
+ ++conn->d_ds->tcpDiedSendingQuery;
+ }
+ else if (conn->d_state != State::idle) {
+ ++conn->d_ds->tcpDiedReadingResponse;
+ }
+
+ /* don't increase this counter when reusing connections */
+ if (conn->d_fresh) {
+ ++conn->d_downstreamFailures;
+ }
+
+ /* remove this FD from the IO multiplexer */
+ iostate = IOState::Done;
+ connectionDied = true;
+ }
+
+ if (connectionDied) {
+
+ DEBUGLOG("connection died, number of failures is "<<conn->d_downstreamFailures<<", retries is "<<conn->d_ds->d_retries);
+
+ if (conn->d_downstreamFailures < conn->d_ds->d_retries) {
+
+ conn->d_ioState.reset();
+ ioGuard.release();
+
+ try {
+ if (conn->reconnect()) {
+ conn->d_ioState = make_unique<IOStateHandler>(*conn->d_mplexer, conn->d_handler->getDescriptor());
+
+ /* we need to resend the queries that were in flight, if any */
+ if (conn->d_state == State::sendingQueryToBackend) {
+ /* we need to edit this query so it has the correct ID */
+ auto query = std::move(conn->d_currentQuery);
+ uint16_t id = conn->d_highestStreamID;
+ prepareQueryForSending(query.d_query, id, QueryState::hasSizePrepended, ConnectionState::needProxy);
+ conn->d_currentQuery = std::move(query);
+ }
+
+ /* if we notify the sender it might terminate us so we need to move these first */
+ auto pendingResponses = std::move(conn->d_pendingResponses);
+ conn->d_pendingResponses.clear();
+ for (auto& pending : pendingResponses) {
+ --conn->d_ds->outstanding;
+
+ if (pending.second.d_query.isXFR() && pending.second.d_query.d_xfrStarted) {
+ /* this one can't be restarted, sorry */
+ DEBUGLOG("A XFR for which a response has already been sent cannot be restarted");
+ try {
+ pending.second.d_sender->notifyIOError(std::move(pending.second.d_query.d_idstate), now);
+ }
+ catch (const std::exception& e) {
+ vinfolog("Got an exception while notifying: %s", e.what());
+ }
+ catch (...) {
+ vinfolog("Got exception while notifying");
+ }
+ }
+ else {
+ conn->d_pendingQueries.push_back(std::move(pending.second));
+ }
+ }
+ conn->d_currentPos = 0;
+
+ if (conn->d_state == State::sendingQueryToBackend) {
+ iostate = IOState::NeedWrite;
+ // resume sending query
+ }
+ else {
+ if (conn->d_pendingQueries.empty()) {
+ throw std::runtime_error("TCP connection to a backend in state " + std::to_string((int)conn->d_state) + " with no pending queries");
+ }
+
+ iostate = queueNextQuery(conn);
+ }
+
+ reconnected = true;
+ connectionDied = false;
+ }
+ }
+ catch (const std::exception& e) {
+ // reconnect might throw on failure, let's ignore that, we just need to know
+ // it failed
+ }
+ }
+
+ if (!reconnected) {
+ /* reconnect failed, we give up */
+ DEBUGLOG("reconnect failed, we give up");
+ ++conn->d_ds->tcpGaveUp;
+ conn->notifyAllQueriesFailed(now, FailureReason::gaveUp);
+ }
+ }
+
+ if (conn->d_ioState) {
+ if (iostate == IOState::Done) {
+ conn->d_ioState->update(iostate, handleIOCallback, conn);
+ }
+ else {
+ boost::optional<struct timeval> ttd{boost::none};
+ if (iostate == IOState::NeedRead) {
+ ttd = conn->getBackendReadTTD(now);
+ }
+ else if (conn->isFresh() && conn->d_queries == 0) {
+ /* first write just after the non-blocking connect */
+ ttd = conn->getBackendConnectTTD(now);
+ }
+ else {
+ ttd = conn->getBackendWriteTTD(now);
+ }
+
+ conn->d_ioState->update(iostate, handleIOCallback, conn, ttd);
+ }
+ }
+ }
+ while (reconnected);
+
+ ioGuard.release();
+}
+
+void TCPConnectionToBackend::handleIOCallback(int fd, FDMultiplexer::funcparam_t& param)
+{
+ auto conn = boost::any_cast<std::shared_ptr<TCPConnectionToBackend>>(param);
+ if (fd != conn->getHandle()) {
+ throw std::runtime_error("Unexpected socket descriptor " + std::to_string(fd) + " received in " + std::string(__PRETTY_FUNCTION__) + ", expected " + std::to_string(conn->getHandle()));
+ }
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ handleIO(conn, now);
+}
+
+void TCPConnectionToBackend::queueQuery(std::shared_ptr<TCPQuerySender>& sender, TCPQuery&& query)
+{
+ if (!d_ioState) {
+ d_ioState = make_unique<IOStateHandler>(*d_mplexer, d_handler->getDescriptor());
+ }
+
+ // if we are not already sending a query or in the middle of reading a response (so idle),
+ // start sending the query
+ if (d_state == State::idle || d_state == State::waitingForResponseFromBackend) {
+ DEBUGLOG("Sending new query to backend right away, with ID "<<d_highestStreamID);
+ d_state = State::sendingQueryToBackend;
+ d_currentPos = 0;
+
+ uint16_t id = d_highestStreamID;
+
+ d_currentQuery = PendingRequest({sender, std::move(query)});
+ prepareQueryForSending(d_currentQuery.d_query, id, QueryState::hasSizePrepended, needProxyProtocolPayload() ? ConnectionState::needProxy : ConnectionState::proxySent);
+
+ struct timeval now;
+ gettimeofday(&now, 0);
+
+ auto shared = std::dynamic_pointer_cast<TCPConnectionToBackend>(shared_from_this());
+ handleIO(shared, now);
+ }
+ else {
+ DEBUGLOG("Adding new query to the queue because we are in state "<<(int)d_state);
+ // store query in the list of queries to send
+ d_pendingQueries.push_back(PendingRequest({sender, std::move(query)}));
+ }
+}
+
+void TCPConnectionToBackend::handleTimeout(const struct timeval& now, bool write)
+{
+ /* in some cases we could retry, here, reconnecting and sending our pending responses again */
+ if (write) {
+ if (isFresh() && d_queries == 0) {
+ ++d_ds->tcpConnectTimeouts;
+ vinfolog("Timeout while connecting to TCP backend %s", d_ds->getName());
+ }
+ else {
+ ++d_ds->tcpWriteTimeouts;
+ vinfolog("Timeout while writing to TCP backend %s", d_ds->getName());
+ }
+ }
+ else {
+ ++d_ds->tcpReadTimeouts;
+ vinfolog("Timeout while reading from TCP backend %s", d_ds->getName());
+ }
+
+ try {
+ notifyAllQueriesFailed(now, FailureReason::timeout);
+ }
+ catch (const std::exception& e) {
+ vinfolog("Got an exception while notifying a timeout: %s", e.what());
+ }
+ catch (...) {
+ vinfolog("Got exception while notifying a timeout");
+ }
+
+ release();
+}
+
+void TCPConnectionToBackend::notifyAllQueriesFailed(const struct timeval& now, FailureReason reason)
+{
+ d_connectionDied = true;
+
+ /* we might be terminated while notifying a query sender */
+ d_ds->outstanding -= d_pendingResponses.size();
+ auto pendingQueries = std::move(d_pendingQueries);
+ d_pendingQueries.clear();
+ auto pendingResponses = std::move(d_pendingResponses);
+ d_pendingResponses.clear();
+
+ auto increaseCounters = [reason](std::shared_ptr<TCPQuerySender>& sender) {
+ if (reason == FailureReason::timeout) {
+ const ClientState* cs = sender->getClientState();
+ if (cs) {
+ ++cs->tcpDownstreamTimeouts;
+ }
+ }
+ else if (reason == FailureReason::gaveUp) {
+ const ClientState* cs = sender->getClientState();
+ if (cs) {
+ ++cs->tcpGaveUp;
+ }
+ }
+ };
+
+ try {
+ if (d_state == State::sendingQueryToBackend) {
+ auto sender = d_currentQuery.d_sender;
+ if (sender->active()) {
+ increaseCounters(sender);
+ sender->notifyIOError(std::move(d_currentQuery.d_query.d_idstate), now);
+ }
+ }
+
+ for (auto& query : pendingQueries) {
+ auto sender = query.d_sender;
+ if (sender->active()) {
+ increaseCounters(sender);
+ sender->notifyIOError(std::move(query.d_query.d_idstate), now);
+ }
+ }
+
+ for (auto& response : pendingResponses) {
+ auto sender = response.second.d_sender;
+ if (sender->active()) {
+ increaseCounters(sender);
+ sender->notifyIOError(std::move(response.second.d_query.d_idstate), now);
+ }
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Got an exception while notifying: %s", e.what());
+ }
+ catch (...) {
+ vinfolog("Got exception while notifying");
+ }
+
+ release();
+}
+
+static uint32_t getSerialFromRawSOAContent(const std::vector<uint8_t>& raw)
+{
+ /* minimal size for a SOA record, as defined by rfc1035:
+ MNAME (root): 1
+ RNAME (root): 1
+ SERIAL: 4
+ REFRESH: 4
+ RETRY: 4
+ EXPIRE: 4
+ MINIMUM: 4
+ = 22 bytes
+ */
+ if (raw.size() < 22) {
+ throw std::runtime_error("Invalid content of size " + std::to_string(raw.size()) + " for a SOA record");
+ }
+ /* As rfc1025 states that "all domain names in the RDATA section of these RRs may be compressed",
+ and we don't want to parse these names, start at the end */
+ uint32_t serial = 0;
+ memcpy(&serial, &raw.at(raw.size() - 20), sizeof(serial));
+ return ntohl(serial);
+}
+
+IOState TCPConnectionToBackend::handleResponse(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now)
+{
+ d_downstreamFailures = 0;
+
+ uint16_t queryId = 0;
+ try {
+ queryId = getQueryIdFromResponse();
+ }
+ catch (const std::exception& e) {
+ DEBUGLOG("Unable to get query ID");
+ notifyAllQueriesFailed(now, FailureReason::unexpectedQueryID);
+ throw;
+ }
+
+ auto it = d_pendingResponses.find(queryId);
+ if (it == d_pendingResponses.end()) {
+ DEBUGLOG("could not find any corresponding query for ID "<<queryId<<". This is likely a duplicated ID over the same TCP connection, giving up!");
+ notifyAllQueriesFailed(now, FailureReason::unexpectedQueryID);
+ return IOState::Done;
+ }
+
+ editPayloadID(d_responseBuffer, ntohs(it->second.d_query.d_idstate.origID), 0, false);
+
+ auto sender = it->second.d_sender;
+
+ if (sender->active() && it->second.d_query.isXFR()) {
+ DEBUGLOG("XFR!");
+ bool done = false;
+ TCPResponse response;
+ response.d_buffer = std::move(d_responseBuffer);
+ response.d_connection = conn;
+ /* we don't move the whole IDS because we will need for the responses to come */
+ response.d_idstate.qtype = it->second.d_query.d_idstate.qtype;
+ response.d_idstate.qname = it->second.d_query.d_idstate.qname;
+ DEBUGLOG("passing XFRresponse to client connection for "<<response.d_idstate.qname);
+
+ it->second.d_query.d_xfrStarted = true;
+ done = isXFRFinished(response, it->second.d_query);
+
+ if (done) {
+ d_pendingResponses.erase(it);
+ --conn->d_ds->outstanding;
+ /* marking as idle for now, so we can accept new queries if our queues are empty */
+ if (d_pendingQueries.empty() && d_pendingResponses.empty()) {
+ t_downstreamTCPConnectionsManager.moveToIdle(conn);
+ d_state = State::idle;
+ }
+ }
+
+ sender->handleXFRResponse(now, std::move(response));
+ if (done) {
+ t_downstreamTCPConnectionsManager.moveToIdle(conn);
+ d_state = State::idle;
+ return IOState::Done;
+ }
+
+ d_state = State::waitingForResponseFromBackend;
+ d_currentPos = 0;
+ d_responseBuffer.resize(sizeof(uint16_t));
+ // get ready to read the next packet, if any
+ return IOState::NeedRead;
+ }
+
+ --conn->d_ds->outstanding;
+ auto ids = std::move(it->second.d_query.d_idstate);
+ d_pendingResponses.erase(it);
+ /* marking as idle for now, so we can accept new queries if our queues are empty */
+ if (d_pendingQueries.empty() && d_pendingResponses.empty()) {
+ t_downstreamTCPConnectionsManager.moveToIdle(conn);
+ d_state = State::idle;
+ }
+
+ auto shared = conn;
+ if (sender->active()) {
+ DEBUGLOG("passing response to client connection for "<<ids.qname);
+ // make sure that we still exist after calling handleResponse()
+ sender->handleResponse(now, TCPResponse(std::move(d_responseBuffer), std::move(ids), conn));
+ }
+
+ if (!d_pendingQueries.empty()) {
+ DEBUGLOG("still have some queries to send");
+ return queueNextQuery(shared);
+ }
+ else if (!d_pendingResponses.empty()) {
+ DEBUGLOG("still have some responses to read");
+ d_state = State::waitingForResponseFromBackend;
+ d_currentPos = 0;
+ d_responseBuffer.resize(sizeof(uint16_t));
+ return IOState::NeedRead;
+ }
+ else {
+ DEBUGLOG("nothing to do, waiting for a new query");
+ t_downstreamTCPConnectionsManager.moveToIdle(conn);
+ d_state = State::idle;
+ return IOState::Done;
+ }
+}
+
+uint16_t TCPConnectionToBackend::getQueryIdFromResponse() const
+{
+ if (d_responseBuffer.size() < sizeof(dnsheader)) {
+ throw std::runtime_error("Unable to get query ID in a too small (" + std::to_string(d_responseBuffer.size()) + ") response from " + d_ds->getNameWithAddr());
+ }
+
+ uint16_t id;
+ memcpy(&id, &d_responseBuffer.at(0), sizeof(id));
+ return ntohs(id);
+}
+
+void TCPConnectionToBackend::setProxyProtocolValuesSent(std::unique_ptr<std::vector<ProxyProtocolValue>>&& proxyProtocolValuesSent)
+{
+ /* if we already have some values, we have already verified they match */
+ if (!d_proxyProtocolValuesSent) {
+ d_proxyProtocolValuesSent = std::move(proxyProtocolValuesSent);
+ }
+}
+
+bool TCPConnectionToBackend::matchesTLVs(const std::unique_ptr<std::vector<ProxyProtocolValue>>& tlvs) const
+{
+ if (tlvs == nullptr) {
+ if (d_proxyProtocolValuesSent == nullptr) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+
+ if (d_proxyProtocolValuesSent == nullptr) {
+ return false;
+ }
+
+ return *tlvs == *d_proxyProtocolValuesSent;
+}
+
+bool TCPConnectionToBackend::isXFRFinished(const TCPResponse& response, TCPQuery& query)
+{
+ bool done = false;
+ try {
+ MOADNSParser parser(true, reinterpret_cast<const char*>(response.d_buffer.data()), response.d_buffer.size());
+ if (parser.d_header.rcode != 0U) {
+ done = true;
+ }
+ else {
+ for (const auto& record : parser.d_answers) {
+ if (record.first.d_class != QClass::IN || record.first.d_type != QType::SOA) {
+ continue;
+ }
+
+ auto unknownContent = getRR<UnknownRecordContent>(record.first);
+ if (!unknownContent) {
+ continue;
+ }
+ auto raw = unknownContent->getRawContent();
+ auto serial = getSerialFromRawSOAContent(raw);
+ ++query.d_xfrSerialCount;
+ if (query.d_xfrMasterSerial == 0) {
+ // store the first SOA in our client's connection metadata
+ ++query.d_xfrMasterSerialCount;
+ query.d_xfrMasterSerial = serial;
+ }
+ else if (query.d_xfrMasterSerial == serial) {
+ ++query.d_xfrMasterSerialCount;
+ // figure out if it's end when receiving master's SOA again
+ if (query.d_xfrSerialCount == 2) {
+ // if there are only two SOA records marks a finished AXFR
+ done = true;
+ }
+ if (query.d_xfrMasterSerialCount == 3) {
+ // receiving master's SOA 3 times marks a finished IXFR
+ done = true;
+ }
+ }
+ }
+ }
+ }
+ catch (const MOADNSException& e) {
+ DEBUGLOG("Exception when parsing TCPResponse to DNS: " << e.what());
+ /* ponder what to do here, shall we close the connection? */
+ }
+ return done;
+}
diff --git a/dnsdist-tcp-downstream.hh b/dnsdist-tcp-downstream.hh
new file mode 100644
index 0000000..547d266
--- /dev/null
+++ b/dnsdist-tcp-downstream.hh
@@ -0,0 +1,590 @@
+#pragma once
+
+#include <queue>
+
+#include "sstuff.hh"
+#include "tcpiohandler-mplexer.hh"
+#include "dnsdist.hh"
+#include "dnsdist-tcp.hh"
+
+class ConnectionToBackend : public std::enable_shared_from_this<ConnectionToBackend>
+{
+public:
+ ConnectionToBackend(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, const struct timeval& now): d_connectionStartTime(now), d_lastDataReceivedTime(now), d_ds(ds), d_mplexer(mplexer), d_enableFastOpen(ds->tcpFastOpen)
+ {
+ reconnect();
+ }
+
+ virtual ~ConnectionToBackend();
+
+ int getHandle() const
+ {
+ if (!d_handler) {
+ throw std::runtime_error("Attempt to get the socket handle from a non-established TCP connection");
+ }
+
+ return d_handler->getDescriptor();
+ }
+
+ /* whether the underlying socket has been closed under our feet, basically */
+ bool isUsable() const
+ {
+ if (!d_handler) {
+ return false;
+ }
+
+ return d_handler->isUsable();
+ }
+
+ const std::shared_ptr<DownstreamState>& getDS() const
+ {
+ return d_ds;
+ }
+
+ const ComboAddress& getRemote() const
+ {
+ return d_ds->remote;
+ }
+
+ const std::string& getBackendName() const
+ {
+ return d_ds->getName();
+ }
+
+ bool isFresh() const
+ {
+ return d_fresh;
+ }
+
+ void setReused()
+ {
+ d_fresh = false;
+ }
+
+ void disableFastOpen()
+ {
+ d_enableFastOpen = false;
+ }
+
+ bool isFastOpenEnabled()
+ {
+ return d_enableFastOpen;
+ }
+
+ /* whether a connection can be used now */
+ bool canBeReused(bool sameClient = false) const
+ {
+ if (d_connectionDied) {
+ return false;
+ }
+
+ /* we can't reuse a connection where a proxy protocol payload has been sent,
+ since:
+ - it cannot be reused for a different client
+ - we might have different TLV values for each query
+ */
+ if (d_ds && d_ds->useProxyProtocol == true && !sameClient) {
+ return false;
+ }
+
+ if (reachedMaxStreamID()) {
+ return false;
+ }
+
+ if (reachedMaxConcurrentQueries()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /* full now but will become usable later */
+ bool willBeReusable(bool sameClient) const
+ {
+ if (d_connectionDied || reachedMaxStreamID()) {
+ return false;
+ }
+
+ if (d_ds && d_ds->useProxyProtocol == true) {
+ return sameClient;
+ }
+
+ return true;
+ }
+
+ virtual bool reachedMaxStreamID() const = 0;
+ virtual bool reachedMaxConcurrentQueries() const = 0;
+ virtual bool isIdle() const = 0;
+ virtual void release() = 0;
+ virtual void stopIO()
+ {
+ }
+
+ bool matches(const std::shared_ptr<DownstreamState>& ds) const
+ {
+ if (!ds || !d_ds) {
+ return false;
+ }
+ return ds == d_ds;
+ }
+
+ virtual void queueQuery(std::shared_ptr<TCPQuerySender>& sender, TCPQuery&& query) = 0;
+ virtual void handleTimeout(const struct timeval& now, bool write) = 0;
+
+ struct timeval getLastDataReceivedTime() const
+ {
+ return d_lastDataReceivedTime;
+ }
+
+ virtual std::string toString() const = 0;
+
+protected:
+ bool reconnect();
+
+ boost::optional<struct timeval> getBackendHealthCheckTTD(const struct timeval& now) const
+ {
+ if (d_ds == nullptr) {
+ throw std::runtime_error("getBackendReadTTD() without any backend selected");
+ }
+ if (d_ds->checkTimeout == 0) {
+ return boost::none;
+ }
+
+ struct timeval res = now;
+ res.tv_sec += d_ds->checkTimeout / 1000; /* ms to s */
+ res.tv_usec += (d_ds->checkTimeout % 1000) / 1000; /* remaining ms to µs */
+
+ return res;
+ }
+
+ boost::optional<struct timeval> getBackendReadTTD(const struct timeval& now) const
+ {
+ if (d_ds == nullptr) {
+ throw std::runtime_error("getBackendReadTTD() without any backend selected");
+ }
+ if (d_ds->tcpRecvTimeout == 0) {
+ return boost::none;
+ }
+
+ struct timeval res = now;
+ res.tv_sec += d_ds->tcpRecvTimeout;
+
+ return res;
+ }
+
+ boost::optional<struct timeval> getBackendWriteTTD(const struct timeval& now) const
+ {
+ if (d_ds == nullptr) {
+ throw std::runtime_error("getBackendWriteTTD() called without any backend selected");
+ }
+ if (d_ds->tcpSendTimeout == 0) {
+ return boost::none;
+ }
+
+ struct timeval res = now;
+ res.tv_sec += d_ds->tcpSendTimeout;
+
+ return res;
+ }
+
+ boost::optional<struct timeval> getBackendConnectTTD(const struct timeval& now) const
+ {
+ if (d_ds == nullptr) {
+ throw std::runtime_error("getBackendConnectTTD() called without any backend selected");
+ }
+ if (d_ds->tcpConnectTimeout == 0) {
+ return boost::none;
+ }
+
+ struct timeval res = now;
+ res.tv_sec += d_ds->tcpConnectTimeout;
+
+ return res;
+ }
+
+ struct timeval d_connectionStartTime;
+ struct timeval d_lastDataReceivedTime;
+ const std::shared_ptr<DownstreamState> d_ds{nullptr};
+ std::shared_ptr<TCPQuerySender> d_sender{nullptr};
+ std::unique_ptr<FDMultiplexer>& d_mplexer;
+ std::unique_ptr<TCPIOHandler> d_handler{nullptr};
+ std::unique_ptr<IOStateHandler> d_ioState{nullptr};
+ uint64_t d_queries{0};
+ uint32_t d_highestStreamID{0};
+ uint16_t d_downstreamFailures{0};
+ bool d_proxyProtocolPayloadSent{false};
+ bool d_enableFastOpen{false};
+ bool d_connectionDied{false};
+ bool d_fresh{true};
+};
+
+class TCPConnectionToBackend : public ConnectionToBackend
+{
+public:
+ TCPConnectionToBackend(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>& mplexer, const struct timeval& now, std::string&& /* proxyProtocolPayload*, unused but there to match the HTTP2 connections, so we can use the same templated connections manager class */): ConnectionToBackend(ds, mplexer, now), d_responseBuffer(s_maxPacketCacheEntrySize)
+ {
+ }
+
+ virtual ~TCPConnectionToBackend();
+
+ bool isIdle() const override
+ {
+ return d_state == State::idle && d_pendingQueries.size() == 0 && d_pendingResponses.size() == 0;
+ }
+
+ bool reachedMaxStreamID() const override
+ {
+ /* TCP/DoT has only 2^16 usable identifiers, DoH has 2^32 */
+ const uint32_t maximumStreamID = std::numeric_limits<uint16_t>::max() - 1;
+ return d_highestStreamID == maximumStreamID;
+ }
+
+ bool reachedMaxConcurrentQueries() const override
+ {
+ const size_t concurrent = d_pendingQueries.size() + d_pendingResponses.size();
+ if (concurrent > 0 && concurrent >= d_ds->d_maxInFlightQueriesPerConn) {
+ return true;
+ }
+ return false;
+ }
+ bool matchesTLVs(const std::unique_ptr<std::vector<ProxyProtocolValue>>& tlvs) const;
+
+ void queueQuery(std::shared_ptr<TCPQuerySender>& sender, TCPQuery&& query) override;
+ void handleTimeout(const struct timeval& now, bool write) override;
+ void release() override;
+
+ std::string toString() const override
+ {
+ ostringstream o;
+ o << "TCP connection to backend "<<(d_ds ? d_ds->getName() : "empty")<<" over FD "<<(d_handler ? std::to_string(d_handler->getDescriptor()) : "no socket")<<", state is "<<(int)d_state<<", io state is "<<(d_ioState ? d_ioState->getState() : "empty")<<", queries count is "<<d_queries<<", pending queries count is "<<d_pendingQueries.size()<<", "<<d_pendingResponses.size()<<" pending responses";
+ return o.str();
+ }
+
+ void setProxyProtocolValuesSent(std::unique_ptr<std::vector<ProxyProtocolValue>>&& proxyProtocolValuesSent);
+
+private:
+ /* waitingForResponseFromBackend is a state where we have not yet started reading the size,
+ so we can still switch to sending instead */
+ enum class State : uint8_t { idle, sendingQueryToBackend, waitingForResponseFromBackend, readingResponseSizeFromBackend, readingResponseFromBackend };
+ enum class FailureReason : uint8_t { /* too many attempts */ gaveUp, timeout, unexpectedQueryID };
+
+ static void handleIO(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now);
+ static void handleIOCallback(int fd, FDMultiplexer::funcparam_t& param);
+ static IOState queueNextQuery(std::shared_ptr<TCPConnectionToBackend>& conn);
+ static IOState sendQuery(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now);
+ static bool isXFRFinished(const TCPResponse& response, TCPQuery& query);
+
+ IOState handleResponse(std::shared_ptr<TCPConnectionToBackend>& conn, const struct timeval& now);
+ uint16_t getQueryIdFromResponse() const;
+ void notifyAllQueriesFailed(const struct timeval& now, FailureReason reason);
+ bool needProxyProtocolPayload() const
+ {
+ return !d_proxyProtocolPayloadSent && (d_ds && d_ds->useProxyProtocol);
+ }
+
+ class PendingRequest
+ {
+ public:
+ std::shared_ptr<TCPQuerySender> d_sender{nullptr};
+ TCPQuery d_query;
+ };
+
+ PacketBuffer d_responseBuffer;
+ std::deque<PendingRequest> d_pendingQueries;
+ std::unordered_map<uint16_t, PendingRequest> d_pendingResponses;
+ std::unique_ptr<std::vector<ProxyProtocolValue>> d_proxyProtocolValuesSent{nullptr};
+ PendingRequest d_currentQuery;
+ size_t d_currentPos{0};
+ uint16_t d_responseSize{0};
+ State d_state{State::idle};
+};
+
+template <class T> class DownstreamConnectionsManager
+{
+ struct SequencedTag {};
+ struct OrderedTag {};
+
+ typedef multi_index_container<
+ std::shared_ptr<T>,
+ indexed_by <
+ ordered_unique<tag<OrderedTag>,
+ identity<std::shared_ptr<T>>
+ >,
+ /* new elements are added to the front of the sequence */
+ sequenced<tag<SequencedTag> >
+ >
+ > list_t;
+ struct ConnectionLists
+ {
+ list_t d_actives;
+ list_t d_idles;
+ };
+
+public:
+ static void setMaxIdleConnectionsPerDownstream(size_t max)
+ {
+ s_maxIdleConnectionsPerDownstream = max;
+ }
+
+ static void setCleanupInterval(uint16_t interval)
+ {
+ s_cleanupInterval = interval;
+ }
+
+ static void setMaxIdleTime(uint16_t max)
+ {
+ s_maxIdleTime = max;
+ }
+
+ std::shared_ptr<T> getConnectionToDownstream(std::unique_ptr<FDMultiplexer>& mplexer, const std::shared_ptr<DownstreamState>& ds, const struct timeval& now, std::string&& proxyProtocolPayload)
+ {
+ struct timeval freshCutOff = now;
+ freshCutOff.tv_sec -= 1;
+
+ auto backendId = ds->getID();
+
+ cleanupClosedConnections(now);
+
+ const bool haveProxyProtocol = ds->useProxyProtocol || !proxyProtocolPayload.empty();
+ if (!haveProxyProtocol) {
+ const auto& it = d_downstreamConnections.find(backendId);
+ if (it != d_downstreamConnections.end()) {
+ /* first scan idle connections, more recent first */
+ auto entry = findUsableConnectionInList(now, freshCutOff, it->second.d_idles, true);
+ if (entry) {
+ ++ds->tcpReusedConnections;
+ it->second.d_actives.insert(entry);
+ return entry;
+ }
+
+ /* then scan actives ones, more recent first as well */
+ entry = findUsableConnectionInList(now, freshCutOff, it->second.d_actives, false);
+ if (entry) {
+ ++ds->tcpReusedConnections;
+ return entry;
+ }
+ }
+ }
+
+ auto newConnection = std::make_shared<T>(ds, mplexer, now, std::move(proxyProtocolPayload));
+ if (!haveProxyProtocol) {
+ auto& list = d_downstreamConnections[backendId].d_actives;
+ list.template get<SequencedTag>().push_front(newConnection);
+ }
+
+ return newConnection;
+ }
+
+ void cleanupClosedConnections(const struct timeval& now)
+ {
+ if (s_cleanupInterval == 0 || (d_nextCleanup != 0 && d_nextCleanup > now.tv_sec)) {
+ return;
+ }
+
+ d_nextCleanup = now.tv_sec + s_cleanupInterval;
+
+ struct timeval freshCutOff = now;
+ freshCutOff.tv_sec -= 1;
+ struct timeval idleCutOff = now;
+ idleCutOff.tv_sec -= s_maxIdleTime;
+
+ for (auto dsIt = d_downstreamConnections.begin(); dsIt != d_downstreamConnections.end(); ) {
+ cleanUpList(dsIt->second.d_idles, now, freshCutOff, idleCutOff);
+ cleanUpList(dsIt->second.d_actives, now, freshCutOff, idleCutOff);
+
+ if (dsIt->second.d_idles.empty() && dsIt->second.d_actives.empty()) {
+ dsIt = d_downstreamConnections.erase(dsIt);
+ }
+ else {
+ ++dsIt;
+ }
+ }
+ }
+
+ size_t clear()
+ {
+ size_t count = 0;
+ for (const auto& downstream : d_downstreamConnections) {
+ count += downstream.second.d_actives.size();
+ for (auto& conn : downstream.second.d_actives) {
+ conn->stopIO();
+ }
+ count += downstream.second.d_idles.size();
+ for (auto& conn : downstream.second.d_idles) {
+ conn->stopIO();
+ }
+ }
+
+ d_downstreamConnections.clear();
+ return count;
+ }
+
+ size_t count() const
+ {
+ return getActiveCount() + getIdleCount();
+ }
+
+ size_t getActiveCount() const
+ {
+ size_t count = 0;
+ for (const auto& downstream : d_downstreamConnections) {
+ count += downstream.second.d_actives.size();
+ }
+ return count;
+ }
+
+ size_t getIdleCount() const
+ {
+ size_t count = 0;
+ for (const auto& downstream : d_downstreamConnections) {
+ count += downstream.second.d_idles.size();
+ }
+ return count;
+ }
+
+ bool removeDownstreamConnection(std::shared_ptr<T>& conn)
+ {
+ auto backendIt = d_downstreamConnections.find(conn->getDS()->getID());
+ if (backendIt == d_downstreamConnections.end()) {
+ return false;
+ }
+
+ /* idle list first */
+ {
+ auto it = backendIt->second.d_idles.find(conn);
+ if (it != backendIt->second.d_idles.end()) {
+ backendIt->second.d_idles.erase(it);
+ return true;
+ }
+ }
+ /* then active */
+ {
+ auto it = backendIt->second.d_actives.find(conn);
+ if (it != backendIt->second.d_actives.end()) {
+ backendIt->second.d_actives.erase(it);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ bool moveToIdle(std::shared_ptr<T>& conn)
+ {
+ auto backendIt = d_downstreamConnections.find(conn->getDS()->getID());
+ if (backendIt == d_downstreamConnections.end()) {
+ return false;
+ }
+
+ auto it = backendIt->second.d_actives.find(conn);
+ if (it == backendIt->second.d_actives.end()) {
+ return false;
+ }
+
+ backendIt->second.d_actives.erase(it);
+
+ if (backendIt->second.d_idles.size() >= s_maxIdleConnectionsPerDownstream) {
+ backendIt->second.d_idles.template get<SequencedTag>().pop_back();
+ }
+
+ backendIt->second.d_idles.template get<SequencedTag>().push_front(conn);
+ return true;
+ }
+
+protected:
+
+ void cleanUpList(list_t& list, const struct timeval& now, const struct timeval& freshCutOff, const struct timeval& idleCutOff)
+ {
+ auto& sidx = list.template get<SequencedTag>();
+ for (auto connIt = sidx.begin(); connIt != sidx.end(); ) {
+ if (!(*connIt)) {
+ connIt = sidx.erase(connIt);
+ continue;
+ }
+
+ auto& entry = *connIt;
+
+ /* don't bother checking freshly used connections */
+ if (freshCutOff < entry->getLastDataReceivedTime()) {
+ ++connIt;
+ continue;
+ }
+
+ if (entry->isIdle() && entry->getLastDataReceivedTime() < idleCutOff) {
+ /* idle for too long */
+ connIt = sidx.erase(connIt);
+ continue;
+ }
+
+ if (entry->isUsable()) {
+ ++connIt;
+ continue;
+ }
+
+ connIt = sidx.erase(connIt);
+ }
+ }
+
+ std::shared_ptr<T> findUsableConnectionInList(const struct timeval& now, const struct timeval& freshCutOff, list_t& list, bool removeIfFound)
+ {
+ auto& sidx = list.template get<SequencedTag>();
+ for (auto listIt = sidx.begin(); listIt != sidx.end(); ) {
+ if (!(*listIt)) {
+ listIt = sidx.erase(listIt);
+ continue;
+ }
+
+ auto& entry = *listIt;
+ if (isConnectionUsable(entry, now, freshCutOff)) {
+ entry->setReused();
+ // make a copy since the iterator will be invalidated after erasing
+ auto result = entry;
+ if (removeIfFound) {
+ sidx.erase(listIt);
+ }
+ return result;
+ }
+
+ if (entry->willBeReusable(false)) {
+ ++listIt;
+ continue;
+ }
+
+ /* that connection will not be usable later, no need to keep it in that list */
+ listIt = sidx.erase(listIt);
+ }
+
+ return nullptr;
+ }
+
+ bool isConnectionUsable(const std::shared_ptr<T>& conn, const struct timeval& now, const struct timeval& freshCutOff)
+ {
+ if (!conn->canBeReused()) {
+ return false;
+ }
+
+ /* for connections that have not been used very recently,
+ check whether they have been closed in the meantime */
+ if (freshCutOff < conn->getLastDataReceivedTime()) {
+ /* used recently enough, skip the check */
+ return true;
+ }
+
+ return conn->isUsable();
+ }
+
+ static size_t s_maxIdleConnectionsPerDownstream;
+ static uint16_t s_cleanupInterval;
+ static uint16_t s_maxIdleTime;
+
+ std::map<boost::uuids::uuid, ConnectionLists> d_downstreamConnections;
+
+ time_t d_nextCleanup{0};
+};
+
+template <class T> size_t DownstreamConnectionsManager<T>::s_maxIdleConnectionsPerDownstream{10};
+template <class T> uint16_t DownstreamConnectionsManager<T>::s_cleanupInterval{60};
+template <class T> uint16_t DownstreamConnectionsManager<T>::s_maxIdleTime{300};
+
+using DownstreamTCPConnectionsManager = DownstreamConnectionsManager<TCPConnectionToBackend>;
+extern thread_local DownstreamTCPConnectionsManager t_downstreamTCPConnectionsManager;
diff --git a/dnsdist-tcp-upstream.hh b/dnsdist-tcp-upstream.hh
new file mode 100644
index 0000000..9ed8b6b
--- /dev/null
+++ b/dnsdist-tcp-upstream.hh
@@ -0,0 +1,177 @@
+#pragma once
+
+#include "dolog.hh"
+#include "dnsdist-tcp.hh"
+
+class TCPClientThreadData
+{
+public:
+ TCPClientThreadData(): localRespRuleActions(g_respruleactions.getLocal()), mplexer(std::unique_ptr<FDMultiplexer>(FDMultiplexer::getMultiplexerSilent()))
+ {
+ }
+
+ LocalHolders holders;
+ LocalStateHolder<vector<DNSDistResponseRuleAction> > localRespRuleActions;
+ std::unique_ptr<FDMultiplexer> mplexer{nullptr};
+ int crossProtocolResponsesPipe{-1};
+};
+
+class IncomingTCPConnectionState : public TCPQuerySender, public std::enable_shared_from_this<IncomingTCPConnectionState>
+{
+public:
+ IncomingTCPConnectionState(ConnectionInfo&& ci, TCPClientThreadData& threadData, const struct timeval& now): d_buffer(s_maxPacketCacheEntrySize), d_ci(std::move(ci)), d_handler(d_ci.fd, timeval{g_tcpRecvTimeout,0}, d_ci.cs->tlsFrontend ? d_ci.cs->tlsFrontend->getContext() : nullptr, now.tv_sec), d_connectionStartTime(now), d_ioState(make_unique<IOStateHandler>(*threadData.mplexer, d_ci.fd)), d_threadData(threadData)
+ {
+ d_origDest.reset();
+ d_origDest.sin4.sin_family = d_ci.remote.sin4.sin_family;
+ socklen_t socklen = d_origDest.getSocklen();
+ if (getsockname(d_ci.fd, reinterpret_cast<sockaddr*>(&d_origDest), &socklen)) {
+ d_origDest = d_ci.cs->local;
+ }
+ /* belongs to the handler now */
+ d_ci.fd = -1;
+ d_proxiedDestination = d_origDest;
+ d_proxiedRemote = d_ci.remote;
+
+ /* we manage the release of the downstream connection ourselves */
+ d_releaseConnection = false;
+ }
+
+ IncomingTCPConnectionState(const IncomingTCPConnectionState& rhs) = delete;
+ IncomingTCPConnectionState& operator=(const IncomingTCPConnectionState& rhs) = delete;
+
+ ~IncomingTCPConnectionState();
+
+ void resetForNewQuery();
+
+ boost::optional<struct timeval> getClientReadTTD(struct timeval now) const
+ {
+ if (g_maxTCPConnectionDuration == 0 && g_tcpRecvTimeout == 0) {
+ return boost::none;
+ }
+
+ if (g_maxTCPConnectionDuration > 0) {
+ auto elapsed = now.tv_sec - d_connectionStartTime.tv_sec;
+ if (elapsed < 0 || (static_cast<size_t>(elapsed) >= g_maxTCPConnectionDuration)) {
+ return now;
+ }
+ auto remaining = g_maxTCPConnectionDuration - elapsed;
+ if (g_tcpRecvTimeout == 0 || remaining <= static_cast<size_t>(g_tcpRecvTimeout)) {
+ now.tv_sec += remaining;
+ return now;
+ }
+ }
+
+ now.tv_sec += g_tcpRecvTimeout;
+ return now;
+ }
+
+ boost::optional<struct timeval> getClientWriteTTD(const struct timeval& now) const
+ {
+ if (g_maxTCPConnectionDuration == 0 && g_tcpSendTimeout == 0) {
+ return boost::none;
+ }
+
+ struct timeval res = now;
+
+ if (g_maxTCPConnectionDuration > 0) {
+ auto elapsed = res.tv_sec - d_connectionStartTime.tv_sec;
+ if (elapsed < 0 || static_cast<size_t>(elapsed) >= g_maxTCPConnectionDuration) {
+ return res;
+ }
+ auto remaining = g_maxTCPConnectionDuration - elapsed;
+ if (g_tcpSendTimeout == 0 || remaining <= static_cast<size_t>(g_tcpSendTimeout)) {
+ res.tv_sec += remaining;
+ return res;
+ }
+ }
+
+ res.tv_sec += g_tcpSendTimeout;
+ return res;
+ }
+
+ bool maxConnectionDurationReached(unsigned int maxConnectionDuration, const struct timeval& now)
+ {
+ if (maxConnectionDuration) {
+ time_t curtime = now.tv_sec;
+ unsigned int elapsed = 0;
+ if (curtime > d_connectionStartTime.tv_sec) { // To prevent issues when time goes backward
+ elapsed = curtime - d_connectionStartTime.tv_sec;
+ }
+ if (elapsed >= maxConnectionDuration) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ std::shared_ptr<TCPConnectionToBackend> getOwnedDownstreamConnection(const std::shared_ptr<DownstreamState>& ds, const std::unique_ptr<std::vector<ProxyProtocolValue>>& tlvs);
+ std::shared_ptr<TCPConnectionToBackend> getDownstreamConnection(std::shared_ptr<DownstreamState>& ds, const std::unique_ptr<std::vector<ProxyProtocolValue>>& tlvs, const struct timeval& now);
+ void registerOwnedDownstreamConnection(std::shared_ptr<TCPConnectionToBackend>& conn);
+
+ static size_t clearAllDownstreamConnections();
+
+ static void handleIO(std::shared_ptr<IncomingTCPConnectionState>& conn, const struct timeval& now);
+ static void handleIOCallback(int fd, FDMultiplexer::funcparam_t& param);
+
+ static IOState sendResponse(std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now, TCPResponse&& response);
+ static void queueResponse(std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now, TCPResponse&& response);
+static void handleTimeout(std::shared_ptr<IncomingTCPConnectionState>& state, bool write);
+
+ /* we take a copy of a shared pointer, not a reference, because the initial shared pointer might be released during the handling of the response */
+ void handleResponse(const struct timeval& now, TCPResponse&& response) override;
+ void handleXFRResponse(const struct timeval& now, TCPResponse&& response) override;
+ void notifyIOError(IDState&& query, const struct timeval& now) override;
+
+ void terminateClientConnection();
+ void queueQuery(TCPQuery&& query);
+
+ bool canAcceptNewQueries(const struct timeval& now);
+
+ bool active() const override
+ {
+ return d_ioState != nullptr;
+ }
+
+ const ClientState* getClientState() const override
+ {
+ return d_ci.cs;
+ }
+
+ std::string toString() const
+ {
+ ostringstream o;
+ o << "Incoming TCP connection from "<<d_ci.remote.toStringWithPort()<<" over FD "<<d_handler.getDescriptor()<<", state is "<<(int)d_state<<", io state is "<<(d_ioState ? d_ioState->getState() : "empty")<<", queries count is "<<d_queriesCount<<", current queries count is "<<d_currentQueriesCount<<", "<<d_queuedResponses.size()<<" queued responses, "<<d_ownedConnectionsToBackend.size()<<" owned connections to a backend";
+ return o.str();
+ }
+
+ enum class State : uint8_t { doingHandshake, readingProxyProtocolHeader, waitingForQuery, readingQuerySize, readingQuery, sendingResponse, idle /* in case of XFR, we stop processing queries */ };
+
+ TCPResponse d_currentResponse;
+ std::map<std::shared_ptr<DownstreamState>, std::deque<std::shared_ptr<TCPConnectionToBackend>>> d_ownedConnectionsToBackend;
+ std::deque<TCPResponse> d_queuedResponses;
+ PacketBuffer d_buffer;
+ ConnectionInfo d_ci;
+ ComboAddress d_origDest;
+ ComboAddress d_proxiedRemote;
+ ComboAddress d_proxiedDestination;
+ TCPIOHandler d_handler;
+ struct timeval d_connectionStartTime;
+ struct timeval d_handshakeDoneTime;
+ struct timeval d_firstQuerySizeReadTime;
+ struct timeval d_querySizeReadTime;
+ struct timeval d_queryReadTime;
+ std::unique_ptr<IOStateHandler> d_ioState{nullptr};
+ std::unique_ptr<std::vector<ProxyProtocolValue>> d_proxyProtocolValues{nullptr};
+ TCPClientThreadData& d_threadData;
+ size_t d_currentPos{0};
+ size_t d_proxyProtocolNeed{0};
+ size_t d_queriesCount{0};
+ size_t d_currentQueriesCount{0};
+ uint16_t d_querySize{0};
+ State d_state{State::doingHandshake};
+ bool d_isXFR{false};
+ bool d_proxyProtocolPayloadHasTLV{false};
+ bool d_lastIOBlocked{false};
+ bool d_hadErrors{false};
+};
diff --git a/dnsdist-tcp.cc b/dnsdist-tcp.cc
new file mode 100644
index 0000000..adeedb4
--- /dev/null
+++ b/dnsdist-tcp.cc
@@ -0,0 +1,1382 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <thread>
+#include <netinet/tcp.h>
+#include <queue>
+
+#include "dnsdist.hh"
+#include "dnsdist-ecs.hh"
+#include "dnsdist-proxy-protocol.hh"
+#include "dnsdist-rings.hh"
+#include "dnsdist-tcp.hh"
+#include "dnsdist-tcp-downstream.hh"
+#include "dnsdist-tcp-upstream.hh"
+#include "dnsdist-xpf.hh"
+#include "dnsparser.hh"
+#include "dolog.hh"
+#include "gettime.hh"
+#include "lock.hh"
+#include "sstuff.hh"
+#include "tcpiohandler.hh"
+#include "tcpiohandler-mplexer.hh"
+#include "threadname.hh"
+
+/* TCP: the grand design.
+ We forward 'messages' between clients and downstream servers. Messages are 65k bytes large, tops.
+ An answer might theoretically consist of multiple messages (for example, in the case of AXFR), initially
+ we will not go there.
+
+ In a sense there is a strong symmetry between UDP and TCP, once a connection to a downstream has been setup.
+ This symmetry is broken because of head-of-line blocking within TCP though, necessitating additional connections
+ to guarantee performance.
+
+ So the idea is to have a 'pool' of available downstream connections, and forward messages to/from them and never queue.
+ So whenever an answer comes in, we know where it needs to go.
+
+ Let's start naively.
+*/
+
+static LockGuarded<std::map<ComboAddress,size_t,ComboAddress::addressOnlyLessThan>> s_tcpClientsCount;
+
+size_t g_maxTCPQueriesPerConn{0};
+size_t g_maxTCPConnectionDuration{0};
+size_t g_maxTCPConnectionsPerClient{0};
+#ifdef __linux__
+// On Linux this gives us 128k pending queries (default is 8192 queries),
+// which should be enough to deal with huge spikes
+size_t g_tcpInternalPipeBufferSize{1024*1024};
+uint64_t g_maxTCPQueuedConnections{10000};
+#else
+size_t g_tcpInternalPipeBufferSize{0};
+uint64_t g_maxTCPQueuedConnections{1000};
+#endif
+
+int g_tcpRecvTimeout{2};
+int g_tcpSendTimeout{2};
+std::atomic<uint64_t> g_tcpStatesDumpRequested{0};
+
+static void decrementTCPClientCount(const ComboAddress& client)
+{
+ if (g_maxTCPConnectionsPerClient) {
+ auto tcpClientsCount = s_tcpClientsCount.lock();
+ tcpClientsCount->at(client)--;
+ if (tcpClientsCount->at(client) == 0) {
+ tcpClientsCount->erase(client);
+ }
+ }
+}
+
+IncomingTCPConnectionState::~IncomingTCPConnectionState()
+{
+ decrementTCPClientCount(d_ci.remote);
+
+ if (d_ci.cs != nullptr) {
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto diff = now - d_connectionStartTime;
+ d_ci.cs->updateTCPMetrics(d_queriesCount, diff.tv_sec * 1000.0 + diff.tv_usec / 1000.0);
+ }
+
+ // would have been done when the object is destroyed anyway,
+ // but that way we make sure it's done before the ConnectionInfo is destroyed,
+ // closing the descriptor, instead of relying on the declaration order of the objects in the class
+ d_handler.close();
+}
+
+size_t IncomingTCPConnectionState::clearAllDownstreamConnections()
+{
+ return t_downstreamTCPConnectionsManager.clear();
+}
+
+std::shared_ptr<TCPConnectionToBackend> IncomingTCPConnectionState::getDownstreamConnection(std::shared_ptr<DownstreamState>& ds, const std::unique_ptr<std::vector<ProxyProtocolValue>>& tlvs, const struct timeval& now)
+{
+ std::shared_ptr<TCPConnectionToBackend> downstream{nullptr};
+
+ downstream = getOwnedDownstreamConnection(ds, tlvs);
+
+ if (!downstream) {
+ /* we don't have a connection to this backend owned yet, let's get one (it might not be a fresh one, though) */
+ downstream = t_downstreamTCPConnectionsManager.getConnectionToDownstream(d_threadData.mplexer, ds, now, std::string());
+ if (ds->useProxyProtocol) {
+ registerOwnedDownstreamConnection(downstream);
+ }
+ }
+
+ return downstream;
+}
+
+static void tcpClientThread(int pipefd, int crossProtocolQueriesPipeFD, int crossProtocolResponsesListenPipeFD, int crossProtocolResponsesWritePipeFD);
+
+TCPClientCollection::TCPClientCollection(size_t maxThreads): d_tcpclientthreads(maxThreads), d_maxthreads(maxThreads)
+{
+ for (size_t idx = 0; idx < maxThreads; idx++) {
+ addTCPClientThread();
+ }
+}
+
+void TCPClientCollection::addTCPClientThread()
+{
+ auto preparePipe = [](int fds[2], const std::string& type) -> bool {
+ if (pipe(fds) < 0) {
+ errlog("Error creating the TCP thread %s pipe: %s", type, stringerror());
+ return false;
+ }
+
+ if (!setNonBlocking(fds[0])) {
+ int err = errno;
+ close(fds[0]);
+ close(fds[1]);
+ errlog("Error setting the TCP thread %s pipe non-blocking: %s", type, stringerror(err));
+ return false;
+ }
+
+ if (!setNonBlocking(fds[1])) {
+ int err = errno;
+ close(fds[0]);
+ close(fds[1]);
+ errlog("Error setting the TCP thread %s pipe non-blocking: %s", type, stringerror(err));
+ return false;
+ }
+
+ if (g_tcpInternalPipeBufferSize > 0 && getPipeBufferSize(fds[0]) < g_tcpInternalPipeBufferSize) {
+ setPipeBufferSize(fds[0], g_tcpInternalPipeBufferSize);
+ }
+
+ return true;
+ };
+
+ int pipefds[2] = { -1, -1};
+ if (!preparePipe(pipefds, "communication")) {
+ return;
+ }
+
+ int crossProtocolQueriesFDs[2] = { -1, -1};
+ if (!preparePipe(crossProtocolQueriesFDs, "cross-protocol queries")) {
+ return;
+ }
+
+ int crossProtocolResponsesFDs[2] = { -1, -1};
+ if (!preparePipe(crossProtocolResponsesFDs, "cross-protocol responses")) {
+ return;
+ }
+
+ vinfolog("Adding TCP Client thread");
+
+ {
+ if (d_numthreads >= d_tcpclientthreads.size()) {
+ vinfolog("Adding a new TCP client thread would exceed the vector size (%d/%d), skipping. Consider increasing the maximum amount of TCP client threads with setMaxTCPClientThreads() in the configuration.", d_numthreads.load(), d_tcpclientthreads.size());
+ close(crossProtocolQueriesFDs[0]);
+ close(crossProtocolQueriesFDs[1]);
+ close(crossProtocolResponsesFDs[0]);
+ close(crossProtocolResponsesFDs[1]);
+ close(pipefds[0]);
+ close(pipefds[1]);
+ return;
+ }
+
+ /* from now on this side of the pipe will be managed by that object,
+ no need to worry about it */
+ TCPWorkerThread worker(pipefds[1], crossProtocolQueriesFDs[1], crossProtocolResponsesFDs[1]);
+ try {
+ std::thread t1(tcpClientThread, pipefds[0], crossProtocolQueriesFDs[0], crossProtocolResponsesFDs[0], crossProtocolResponsesFDs[1]);
+ t1.detach();
+ }
+ catch (const std::runtime_error& e) {
+ /* the thread creation failed, don't leak */
+ errlog("Error creating a TCP thread: %s", e.what());
+ close(pipefds[0]);
+ close(crossProtocolQueriesFDs[0]);
+ close(crossProtocolResponsesFDs[0]);
+ return;
+ }
+
+ d_tcpclientthreads.at(d_numthreads) = std::move(worker);
+ ++d_numthreads;
+ }
+}
+
+std::unique_ptr<TCPClientCollection> g_tcpclientthreads;
+
+static IOState sendQueuedResponses(std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now)
+{
+ IOState result = IOState::Done;
+
+ while (state->active() && !state->d_queuedResponses.empty()) {
+ DEBUGLOG("queue size is "<<state->d_queuedResponses.size()<<", sending the next one");
+ TCPResponse resp = std::move(state->d_queuedResponses.front());
+ state->d_queuedResponses.pop_front();
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ result = state->sendResponse(state, now, std::move(resp));
+ if (result != IOState::Done) {
+ return result;
+ }
+ }
+
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ return IOState::Done;
+}
+
+static void updateTCPLatency(const std::shared_ptr<DownstreamState>& ds, double udiff)
+{
+ ds->latencyUsecTCP = (127.0 * ds->latencyUsecTCP / 128.0) + udiff/128.0;
+}
+
+static void handleResponseSent(std::shared_ptr<IncomingTCPConnectionState>& state, const TCPResponse& currentResponse)
+{
+ if (currentResponse.d_idstate.qtype == QType::AXFR || currentResponse.d_idstate.qtype == QType::IXFR) {
+ return;
+ }
+
+ --state->d_currentQueriesCount;
+
+ if (currentResponse.d_selfGenerated == false && currentResponse.d_connection && currentResponse.d_connection->getDS()) {
+ const auto& ds = currentResponse.d_connection->getDS();
+ const auto& ids = currentResponse.d_idstate;
+ double udiff = ids.sentTime.udiff();
+ vinfolog("Got answer from %s, relayed to %s (%s, %d bytes), took %f usec", ds->remote.toStringWithPort(), ids.origRemote.toStringWithPort(), (state->d_handler.isTLS() ? "DoT" : "TCP"), currentResponse.d_buffer.size(), udiff);
+
+ auto backendProtocol = ds->getProtocol();
+ if (backendProtocol == dnsdist::Protocol::DoUDP) {
+ backendProtocol = dnsdist::Protocol::DoTCP;
+ }
+ ::handleResponseSent(ids, udiff, state->d_ci.remote, ds->remote, static_cast<unsigned int>(currentResponse.d_buffer.size()), currentResponse.d_cleartextDH, backendProtocol);
+
+ updateTCPLatency(ds, udiff);
+ }
+}
+
+static void prependSizeToTCPQuery(PacketBuffer& buffer, size_t proxyProtocolPayloadSize)
+{
+ if (buffer.size() <= proxyProtocolPayloadSize) {
+ throw std::runtime_error("The payload size is smaller or equal to the buffer size");
+ }
+
+ uint16_t queryLen = proxyProtocolPayloadSize > 0 ? (buffer.size() - proxyProtocolPayloadSize) : buffer.size();
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(queryLen / 256), static_cast<uint8_t>(queryLen % 256) };
+ /* prepend the size. Yes, this is not the most efficient way but it prevents mistakes
+ that could occur if we had to deal with the size during the processing,
+ especially alignment issues */
+ buffer.insert(buffer.begin() + proxyProtocolPayloadSize, sizeBytes, sizeBytes + 2);
+}
+
+bool IncomingTCPConnectionState::canAcceptNewQueries(const struct timeval& now)
+{
+ if (d_hadErrors) {
+ DEBUGLOG("not accepting new queries because we encountered some error during the processing already");
+ return false;
+ }
+
+ if (d_currentQueriesCount >= d_ci.cs->d_maxInFlightQueriesPerConn) {
+ DEBUGLOG("not accepting new queries because we already have "<<d_currentQueriesCount<<" out of "<<d_ci.cs->d_maxInFlightQueriesPerConn);
+ return false;
+ }
+
+ if (g_maxTCPQueriesPerConn && d_queriesCount > g_maxTCPQueriesPerConn) {
+ vinfolog("not accepting new queries from %s because it reached the maximum number of queries per conn (%d / %d)", d_ci.remote.toStringWithPort(), d_queriesCount, g_maxTCPQueriesPerConn);
+ return false;
+ }
+
+ if (maxConnectionDurationReached(g_maxTCPConnectionDuration, now)) {
+ vinfolog("not accepting new queries from %s because it reached the maximum TCP connection duration", d_ci.remote.toStringWithPort());
+ return false;
+ }
+
+ return true;
+}
+
+void IncomingTCPConnectionState::resetForNewQuery()
+{
+ d_buffer.resize(sizeof(uint16_t));
+ d_currentPos = 0;
+ d_querySize = 0;
+ d_state = State::waitingForQuery;
+}
+
+std::shared_ptr<TCPConnectionToBackend> IncomingTCPConnectionState::getOwnedDownstreamConnection(const std::shared_ptr<DownstreamState>& ds, const std::unique_ptr<std::vector<ProxyProtocolValue>>& tlvs)
+{
+ auto it = d_ownedConnectionsToBackend.find(ds);
+ if (it == d_ownedConnectionsToBackend.end()) {
+ DEBUGLOG("no owned connection found for "<<ds->getName());
+ return nullptr;
+ }
+
+ for (auto& conn : it->second) {
+ if (conn->canBeReused(true) && conn->matchesTLVs(tlvs)) {
+ DEBUGLOG("Got one owned connection accepting more for "<<ds->getName());
+ conn->setReused();
+ return conn;
+ }
+ DEBUGLOG("not accepting more for "<<ds->getName());
+ }
+
+ return nullptr;
+}
+
+void IncomingTCPConnectionState::registerOwnedDownstreamConnection(std::shared_ptr<TCPConnectionToBackend>& conn)
+{
+ d_ownedConnectionsToBackend[conn->getDS()].push_front(conn);
+}
+
+/* called when the buffer has been set and the rules have been processed, and only from handleIO (sometimes indirectly via handleQuery) */
+IOState IncomingTCPConnectionState::sendResponse(std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now, TCPResponse&& response)
+{
+ state->d_state = IncomingTCPConnectionState::State::sendingResponse;
+
+ uint16_t responseSize = static_cast<uint16_t>(response.d_buffer.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ /* prepend the size. Yes, this is not the most efficient way but it prevents mistakes
+ that could occur if we had to deal with the size during the processing,
+ especially alignment issues */
+ response.d_buffer.insert(response.d_buffer.begin(), sizeBytes, sizeBytes + 2);
+ state->d_currentPos = 0;
+ state->d_currentResponse = std::move(response);
+
+ try {
+ auto iostate = state->d_handler.tryWrite(state->d_currentResponse.d_buffer, state->d_currentPos, state->d_currentResponse.d_buffer.size());
+ if (iostate == IOState::Done) {
+ DEBUGLOG("response sent from "<<__PRETTY_FUNCTION__);
+ handleResponseSent(state, state->d_currentResponse);
+ return iostate;
+ } else {
+ state->d_lastIOBlocked = true;
+ DEBUGLOG("partial write");
+ return iostate;
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Closing TCP client connection with %s: %s", state->d_ci.remote.toStringWithPort(), e.what());
+ DEBUGLOG("Closing TCP client connection: "<<e.what());
+ ++state->d_ci.cs->tcpDiedSendingResponse;
+
+ state->terminateClientConnection();
+
+ return IOState::Done;
+ }
+}
+
+void IncomingTCPConnectionState::terminateClientConnection()
+{
+ DEBUGLOG("terminating client connection");
+ d_queuedResponses.clear();
+ /* we have already released idle connections that could be reused,
+ we don't care about the ones still waiting for responses */
+ for (auto& backend : d_ownedConnectionsToBackend) {
+ for (auto& conn : backend.second) {
+ conn->release();
+ }
+ }
+ d_ownedConnectionsToBackend.clear();
+ /* meaning we will no longer be 'active' when the backend
+ response or timeout comes in */
+ d_ioState.reset();
+ d_handler.close();
+}
+
+void IncomingTCPConnectionState::queueResponse(std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now, TCPResponse&& response)
+{
+ // queue response
+ state->d_queuedResponses.push_back(std::move(response));
+ DEBUGLOG("queueing response, state is "<<(int)state->d_state<<", queue size is now "<<state->d_queuedResponses.size());
+
+ // when the response comes from a backend, there is a real possibility that we are currently
+ // idle, and thus not trying to send the response right away would make our ref count go to 0.
+ // Even if we are waiting for a query, we will not wake up before the new query arrives or a
+ // timeout occurs
+ if (state->d_state == IncomingTCPConnectionState::State::idle ||
+ state->d_state == IncomingTCPConnectionState::State::waitingForQuery) {
+ auto iostate = sendQueuedResponses(state, now);
+
+ if (iostate == IOState::Done && state->active()) {
+ if (state->canAcceptNewQueries(now)) {
+ state->resetForNewQuery();
+ state->d_state = IncomingTCPConnectionState::State::waitingForQuery;
+ iostate = IOState::NeedRead;
+ }
+ else {
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ }
+ }
+
+ // for the same reason we need to update the state right away, nobody will do that for us
+ if (state->active()) {
+ state->d_ioState->update(iostate, handleIOCallback, state, iostate == IOState::NeedWrite ? state->getClientWriteTTD(now) : state->getClientReadTTD(now));
+ }
+ }
+}
+
+/* called from the backend code when a new response has been received */
+void IncomingTCPConnectionState::handleResponse(const struct timeval& now, TCPResponse&& response)
+{
+ std::shared_ptr<IncomingTCPConnectionState> state = shared_from_this();
+
+ if (response.d_connection && response.d_connection->getDS() && response.d_connection->getDS()->useProxyProtocol) {
+ // if we have added a TCP Proxy Protocol payload to a connection, don't release it to the general pool as no one else will be able to use it anyway
+ if (!response.d_connection->willBeReusable(true)) {
+ // if it can't be reused even by us, well
+ const auto connIt = state->d_ownedConnectionsToBackend.find(response.d_connection->getDS());
+ if (connIt != state->d_ownedConnectionsToBackend.end()) {
+ auto& list = connIt->second;
+
+ for (auto it = list.begin(); it != list.end(); ++it) {
+ if (*it == response.d_connection) {
+ try {
+ response.d_connection->release();
+ }
+ catch (const std::exception& e) {
+ vinfolog("Error releasing connection: %s", e.what());
+ }
+ list.erase(it);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ if (response.d_buffer.size() < sizeof(dnsheader)) {
+ state->terminateClientConnection();
+ return;
+ }
+
+ try {
+ auto& ids = response.d_idstate;
+ unsigned int qnameWireLength;
+ if (!responseContentMatches(response.d_buffer, ids.qname, ids.qtype, ids.qclass, response.d_connection->getRemote(), qnameWireLength)) {
+ state->terminateClientConnection();
+ return;
+ }
+
+ if (response.d_connection->getDS()) {
+ ++response.d_connection->getDS()->responses;
+ }
+
+ DNSResponse dr = makeDNSResponseFromIDState(ids, response.d_buffer);
+
+ memcpy(&response.d_cleartextDH, dr.getHeader(), sizeof(response.d_cleartextDH));
+
+ if (!processResponse(response.d_buffer, state->d_threadData.localRespRuleActions, dr, false, false)) {
+ state->terminateClientConnection();
+ return;
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Unexpected exception while handling response from backend: %s", e.what());
+ state->terminateClientConnection();
+ return;
+ }
+
+ ++g_stats.responses;
+ ++state->d_ci.cs->responses;
+
+ queueResponse(state, now, std::move(response));
+}
+
+struct TCPCrossProtocolResponse
+{
+ TCPCrossProtocolResponse(TCPResponse&& response, std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now): d_response(std::move(response)), d_state(state), d_now(now)
+ {
+ }
+
+ TCPResponse d_response;
+ std::shared_ptr<IncomingTCPConnectionState> d_state;
+ struct timeval d_now;
+};
+
+class TCPCrossProtocolQuerySender : public TCPQuerySender
+{
+public:
+ TCPCrossProtocolQuerySender(std::shared_ptr<IncomingTCPConnectionState>& state, int responseDescriptor): d_state(state), d_responseDesc(responseDescriptor)
+ {
+ }
+
+ bool active() const override
+ {
+ return d_state->active();
+ }
+
+ const ClientState* getClientState() const override
+ {
+ return d_state->getClientState();
+ }
+
+ void handleResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ if (d_responseDesc == -1) {
+ throw std::runtime_error("Invalid pipe descriptor in TCP Cross Protocol Query Sender");
+ }
+
+ auto ptr = new TCPCrossProtocolResponse(std::move(response), d_state, now);
+ static_assert(sizeof(ptr) <= PIPE_BUF, "Writes up to PIPE_BUF are guaranteed not to be interleaved and to either fully succeed or fail");
+ ssize_t sent = write(d_responseDesc, &ptr, sizeof(ptr));
+ if (sent != sizeof(ptr)) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ ++g_stats.tcpCrossProtocolResponsePipeFull;
+ vinfolog("Unable to pass a cross-protocol response to the TCP worker thread because the pipe is full");
+ }
+ else {
+ vinfolog("Unable to pass a cross-protocol response to the TCP worker thread because we couldn't write to the pipe: %s", stringerror());
+ }
+ delete ptr;
+ }
+ }
+
+ void handleXFRResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ handleResponse(now, std::move(response));
+ }
+
+ void notifyIOError(IDState&& query, const struct timeval& now) override
+ {
+ TCPResponse response(PacketBuffer(), std::move(query), nullptr);
+ handleResponse(now, std::move(response));
+ }
+
+private:
+ std::shared_ptr<IncomingTCPConnectionState> d_state;
+ int d_responseDesc{-1};
+};
+
+class TCPCrossProtocolQuery : public CrossProtocolQuery
+{
+public:
+ TCPCrossProtocolQuery(PacketBuffer&& buffer, IDState&& ids, std::shared_ptr<DownstreamState>& ds, std::shared_ptr<TCPCrossProtocolQuerySender>& sender): d_sender(sender)
+ {
+ query = InternalQuery(std::move(buffer), std::move(ids));
+ downstream = ds;
+ proxyProtocolPayloadSize = 0;
+ }
+
+ ~TCPCrossProtocolQuery()
+ {
+ }
+
+ std::shared_ptr<TCPQuerySender> getTCPQuerySender() override
+ {
+ return d_sender;
+ }
+
+private:
+ std::shared_ptr<TCPCrossProtocolQuerySender> d_sender;
+};
+
+static void handleQuery(std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now)
+{
+ if (state->d_querySize < sizeof(dnsheader)) {
+ ++g_stats.nonCompliantQueries;
+ state->terminateClientConnection();
+ return;
+ }
+
+ ++state->d_queriesCount;
+ ++state->d_ci.cs->queries;
+ ++g_stats.queries;
+
+ if (state->d_handler.isTLS()) {
+ auto tlsVersion = state->d_handler.getTLSVersion();
+ switch (tlsVersion) {
+ case LibsslTLSVersion::TLS10:
+ ++state->d_ci.cs->tls10queries;
+ break;
+ case LibsslTLSVersion::TLS11:
+ ++state->d_ci.cs->tls11queries;
+ break;
+ case LibsslTLSVersion::TLS12:
+ ++state->d_ci.cs->tls12queries;
+ break;
+ case LibsslTLSVersion::TLS13:
+ ++state->d_ci.cs->tls13queries;
+ break;
+ default:
+ ++state->d_ci.cs->tlsUnknownqueries;
+ }
+ }
+
+ /* we need an accurate ("real") value for the response and
+ to store into the IDS, but not for insertion into the
+ rings for example */
+ struct timespec queryRealTime;
+ gettime(&queryRealTime, true);
+
+ std::unique_ptr<DNSCryptQuery> dnsCryptQuery{nullptr};
+ auto dnsCryptResponse = checkDNSCryptQuery(*state->d_ci.cs, state->d_buffer, dnsCryptQuery, queryRealTime.tv_sec, true);
+ if (dnsCryptResponse) {
+ TCPResponse response;
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ ++state->d_currentQueriesCount;
+ state->queueResponse(state, now, std::move(response));
+ return;
+ }
+
+ {
+ /* this pointer will be invalidated the second the buffer is resized, don't hold onto it! */
+ auto* dh = reinterpret_cast<dnsheader*>(state->d_buffer.data());
+ if (!checkQueryHeaders(dh)) {
+ state->terminateClientConnection();
+ return;
+ }
+
+ if (dh->qdcount == 0) {
+ TCPResponse response;
+ dh->rcode = RCode::NotImp;
+ dh->qr = true;
+ response.d_selfGenerated = true;
+ response.d_buffer = std::move(state->d_buffer);
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ ++state->d_currentQueriesCount;
+ state->queueResponse(state, now, std::move(response));
+ return;
+ }
+ }
+
+ uint16_t qtype, qclass;
+ unsigned int qnameWireLength = 0;
+ DNSName qname(reinterpret_cast<const char*>(state->d_buffer.data()), state->d_buffer.size(), sizeof(dnsheader), false, &qtype, &qclass, &qnameWireLength);
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoTCP;
+ if (dnsCryptQuery) {
+ protocol = dnsdist::Protocol::DNSCryptTCP;
+ }
+ else if (state->d_handler.isTLS()) {
+ protocol = dnsdist::Protocol::DoT;
+ }
+
+ DNSQuestion dq(&qname, qtype, qclass, &state->d_proxiedDestination, &state->d_proxiedRemote, state->d_buffer, protocol, &queryRealTime);
+ dq.dnsCryptQuery = std::move(dnsCryptQuery);
+ dq.sni = state->d_handler.getServerNameIndication();
+ if (state->d_proxyProtocolValues) {
+ /* we need to copy them, because the next queries received on that connection will
+ need to get the _unaltered_ values */
+ dq.proxyProtocolValues = make_unique<std::vector<ProxyProtocolValue>>(*state->d_proxyProtocolValues);
+ }
+
+ if (dq.qtype == QType::AXFR || dq.qtype == QType::IXFR) {
+ dq.skipCache = true;
+ }
+
+ std::shared_ptr<DownstreamState> ds;
+ auto result = processQuery(dq, *state->d_ci.cs, state->d_threadData.holders, ds);
+
+ if (result == ProcessQueryResult::Drop) {
+ state->terminateClientConnection();
+ return;
+ }
+
+ // the buffer might have been invalidated by now
+ const dnsheader* dh = dq.getHeader();
+ if (result == ProcessQueryResult::SendAnswer) {
+ TCPResponse response;
+ response.d_selfGenerated = true;
+ response.d_buffer = std::move(state->d_buffer);
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ ++state->d_currentQueriesCount;
+ state->queueResponse(state, now, std::move(response));
+ return;
+ }
+
+ if (result != ProcessQueryResult::PassToBackend || ds == nullptr) {
+ state->terminateClientConnection();
+ return;
+ }
+
+ IDState ids;
+ setIDStateFromDNSQuestion(ids, dq, std::move(qname));
+ ids.origID = dh->id;
+ ids.cs = state->d_ci.cs;
+
+ ++state->d_currentQueriesCount;
+
+ std::string proxyProtocolPayload;
+ if (ds->isDoH()) {
+ vinfolog("Got query for %s|%s from %s (%s, %d bytes), relayed to %s", ids.qname.toLogString(), QType(ids.qtype).toString(), state->d_proxiedRemote.toStringWithPort(), (state->d_handler.isTLS() ? "DoT" : "TCP"), state->d_buffer.size(), ds->getName());
+
+ /* we need to do this _before_ creating the cross protocol query because
+ after that the buffer will have been moved */
+ if (ds->useProxyProtocol) {
+ proxyProtocolPayload = getProxyProtocolPayload(dq);
+ }
+
+ auto incoming = std::make_shared<TCPCrossProtocolQuerySender>(state, state->d_threadData.crossProtocolResponsesPipe);
+ auto cpq = std::make_unique<TCPCrossProtocolQuery>(std::move(state->d_buffer), std::move(ids), ds, incoming);
+ cpq->query.d_proxyProtocolPayload = std::move(proxyProtocolPayload);
+
+ ds->passCrossProtocolQuery(std::move(cpq));
+ return;
+ }
+
+ prependSizeToTCPQuery(state->d_buffer, 0);
+
+ auto downstreamConnection = state->getDownstreamConnection(ds, dq.proxyProtocolValues, now);
+
+ if (ds->useProxyProtocol) {
+ /* if we ever sent a TLV over a connection, we can never go back */
+ if (!state->d_proxyProtocolPayloadHasTLV) {
+ state->d_proxyProtocolPayloadHasTLV = dq.proxyProtocolValues && !dq.proxyProtocolValues->empty();
+ }
+
+ proxyProtocolPayload = getProxyProtocolPayload(dq);
+ }
+
+ if (dq.proxyProtocolValues) {
+ downstreamConnection->setProxyProtocolValuesSent(std::move(dq.proxyProtocolValues));
+ }
+
+ TCPQuery query(std::move(state->d_buffer), std::move(ids));
+ query.d_proxyProtocolPayload = std::move(proxyProtocolPayload);
+
+ vinfolog("Got query for %s|%s from %s (%s, %d bytes), relayed to %s", query.d_idstate.qname.toLogString(), QType(query.d_idstate.qtype).toString(), state->d_proxiedRemote.toStringWithPort(), (state->d_handler.isTLS() ? "DoT" : "TCP"), query.d_buffer.size(), ds->getName());
+ std::shared_ptr<TCPQuerySender> incoming = state;
+ downstreamConnection->queueQuery(incoming, std::move(query));
+}
+
+void IncomingTCPConnectionState::handleIOCallback(int fd, FDMultiplexer::funcparam_t& param)
+{
+ auto conn = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(param);
+ if (fd != conn->d_handler.getDescriptor()) {
+ throw std::runtime_error("Unexpected socket descriptor " + std::to_string(fd) + " received in " + std::string(__PRETTY_FUNCTION__) + ", expected " + std::to_string(conn->d_handler.getDescriptor()));
+ }
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ handleIO(conn, now);
+}
+
+void IncomingTCPConnectionState::handleIO(std::shared_ptr<IncomingTCPConnectionState>& state, const struct timeval& now)
+{
+ // why do we loop? Because the TLS layer does buffering, and thus can have data ready to read
+ // even though the underlying socket is not ready, so we need to actually ask for the data first
+ IOState iostate = IOState::Done;
+ do {
+ iostate = IOState::Done;
+ IOStateGuard ioGuard(state->d_ioState);
+
+ if (state->maxConnectionDurationReached(g_maxTCPConnectionDuration, now)) {
+ vinfolog("Terminating TCP connection from %s because it reached the maximum TCP connection duration", state->d_ci.remote.toStringWithPort());
+ // will be handled by the ioGuard
+ //handleNewIOState(state, IOState::Done, fd, handleIOCallback);
+ return;
+ }
+
+ state->d_lastIOBlocked = false;
+
+ try {
+ if (state->d_state == IncomingTCPConnectionState::State::doingHandshake) {
+ DEBUGLOG("doing handshake");
+ iostate = state->d_handler.tryHandshake();
+ if (iostate == IOState::Done) {
+ DEBUGLOG("handshake done");
+ if (state->d_handler.isTLS()) {
+ if (!state->d_handler.hasTLSSessionBeenResumed()) {
+ ++state->d_ci.cs->tlsNewSessions;
+ }
+ else {
+ ++state->d_ci.cs->tlsResumptions;
+ }
+ if (state->d_handler.getResumedFromInactiveTicketKey()) {
+ ++state->d_ci.cs->tlsInactiveTicketKey;
+ }
+ if (state->d_handler.getUnknownTicketKey()) {
+ ++state->d_ci.cs->tlsUnknownTicketKey;
+ }
+ }
+
+ state->d_handshakeDoneTime = now;
+ if (expectProxyProtocolFrom(state->d_ci.remote)) {
+ state->d_state = IncomingTCPConnectionState::State::readingProxyProtocolHeader;
+ state->d_buffer.resize(s_proxyProtocolMinimumHeaderSize);
+ state->d_proxyProtocolNeed = s_proxyProtocolMinimumHeaderSize;
+ }
+ else {
+ state->d_state = IncomingTCPConnectionState::State::readingQuerySize;
+ }
+ }
+ else {
+ state->d_lastIOBlocked = true;
+ }
+ }
+
+ if (!state->d_lastIOBlocked && state->d_state == IncomingTCPConnectionState::State::readingProxyProtocolHeader) {
+ do {
+ DEBUGLOG("reading proxy protocol header");
+ iostate = state->d_handler.tryRead(state->d_buffer, state->d_currentPos, state->d_proxyProtocolNeed);
+ if (iostate == IOState::Done) {
+ state->d_buffer.resize(state->d_currentPos);
+ ssize_t remaining = isProxyHeaderComplete(state->d_buffer);
+ if (remaining == 0) {
+ vinfolog("Unable to consume proxy protocol header in packet from TCP client %s", state->d_ci.remote.toStringWithPort());
+ ++g_stats.proxyProtocolInvalid;
+ break;
+ }
+ else if (remaining < 0) {
+ state->d_proxyProtocolNeed += -remaining;
+ state->d_buffer.resize(state->d_currentPos + state->d_proxyProtocolNeed);
+ /* we need to keep reading, since we might have buffered data */
+ iostate = IOState::NeedRead;
+ }
+ else {
+ /* proxy header received */
+ std::vector<ProxyProtocolValue> proxyProtocolValues;
+ if (!handleProxyProtocol(state->d_ci.remote, true, *state->d_threadData.holders.acl, state->d_buffer, state->d_proxiedRemote, state->d_proxiedDestination, proxyProtocolValues)) {
+ vinfolog("Error handling the Proxy Protocol received from TCP client %s", state->d_ci.remote.toStringWithPort());
+ break;
+ }
+
+ if (!proxyProtocolValues.empty()) {
+ state->d_proxyProtocolValues = make_unique<std::vector<ProxyProtocolValue>>(std::move(proxyProtocolValues));
+ }
+
+ state->d_state = IncomingTCPConnectionState::State::readingQuerySize;
+ state->d_buffer.resize(sizeof(uint16_t));
+ state->d_currentPos = 0;
+ state->d_proxyProtocolNeed = 0;
+ break;
+ }
+ }
+ else {
+ state->d_lastIOBlocked = true;
+ }
+ }
+ while (state->active() && !state->d_lastIOBlocked);
+ }
+
+ if (!state->d_lastIOBlocked && (state->d_state == IncomingTCPConnectionState::State::waitingForQuery ||
+ state->d_state == IncomingTCPConnectionState::State::readingQuerySize)) {
+ DEBUGLOG("reading query size");
+ iostate = state->d_handler.tryRead(state->d_buffer, state->d_currentPos, sizeof(uint16_t));
+ if (state->d_currentPos > 0) {
+ /* if we got at least one byte, we can't go around sending responses */
+ state->d_state = IncomingTCPConnectionState::State::readingQuerySize;
+ }
+
+ if (iostate == IOState::Done) {
+ DEBUGLOG("query size received");
+ state->d_state = IncomingTCPConnectionState::State::readingQuery;
+ state->d_querySizeReadTime = now;
+ if (state->d_queriesCount == 0) {
+ state->d_firstQuerySizeReadTime = now;
+ }
+ state->d_querySize = state->d_buffer.at(0) * 256 + state->d_buffer.at(1);
+ if (state->d_querySize < sizeof(dnsheader)) {
+ /* go away */
+ state->terminateClientConnection();
+ return;
+ }
+
+ /* allocate a bit more memory to be able to spoof the content, get an answer from the cache
+ or to add ECS without allocating a new buffer */
+ state->d_buffer.resize(std::max(state->d_querySize + static_cast<size_t>(512), s_maxPacketCacheEntrySize));
+ state->d_currentPos = 0;
+ }
+ else {
+ state->d_lastIOBlocked = true;
+ }
+ }
+
+ if (!state->d_lastIOBlocked && state->d_state == IncomingTCPConnectionState::State::readingQuery) {
+ DEBUGLOG("reading query");
+ iostate = state->d_handler.tryRead(state->d_buffer, state->d_currentPos, state->d_querySize);
+ if (iostate == IOState::Done) {
+ DEBUGLOG("query received");
+ state->d_buffer.resize(state->d_querySize);
+
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ handleQuery(state, now);
+ /* the state might have been updated in the meantime, we don't want to override it
+ in that case */
+ if (state->active() && state->d_state != IncomingTCPConnectionState::State::idle) {
+ if (state->d_ioState->isWaitingForRead()) {
+ iostate = IOState::NeedRead;
+ }
+ else if (state->d_ioState->isWaitingForWrite()) {
+ iostate = IOState::NeedWrite;
+ }
+ else {
+ iostate = IOState::Done;
+ }
+ }
+ }
+ else {
+ state->d_lastIOBlocked = true;
+ }
+ }
+
+ if (!state->d_lastIOBlocked && state->d_state == IncomingTCPConnectionState::State::sendingResponse) {
+ DEBUGLOG("sending response");
+ iostate = state->d_handler.tryWrite(state->d_currentResponse.d_buffer, state->d_currentPos, state->d_currentResponse.d_buffer.size());
+ if (iostate == IOState::Done) {
+ DEBUGLOG("response sent from "<<__PRETTY_FUNCTION__);
+ handleResponseSent(state, state->d_currentResponse);
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ }
+ else {
+ state->d_lastIOBlocked = true;
+ }
+ }
+
+ if (state->active() &&
+ !state->d_lastIOBlocked &&
+ iostate == IOState::Done &&
+ (state->d_state == IncomingTCPConnectionState::State::idle ||
+ state->d_state == IncomingTCPConnectionState::State::waitingForQuery))
+ {
+ // try sending queued responses
+ DEBUGLOG("send responses, if any");
+ iostate = sendQueuedResponses(state, now);
+
+ if (!state->d_lastIOBlocked && state->active() && iostate == IOState::Done) {
+ // if the query has been passed to a backend, or dropped, and the responses have been sent,
+ // we can start reading again
+ if (state->canAcceptNewQueries(now)) {
+ state->resetForNewQuery();
+ iostate = IOState::NeedRead;
+ }
+ else {
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ iostate = IOState::Done;
+ }
+ }
+ }
+
+ if (state->d_state != IncomingTCPConnectionState::State::idle &&
+ state->d_state != IncomingTCPConnectionState::State::doingHandshake &&
+ state->d_state != IncomingTCPConnectionState::State::readingProxyProtocolHeader &&
+ state->d_state != IncomingTCPConnectionState::State::waitingForQuery &&
+ state->d_state != IncomingTCPConnectionState::State::readingQuerySize &&
+ state->d_state != IncomingTCPConnectionState::State::readingQuery &&
+ state->d_state != IncomingTCPConnectionState::State::sendingResponse) {
+ vinfolog("Unexpected state %d in handleIOCallback", static_cast<int>(state->d_state));
+ }
+ }
+ catch (const std::exception& e) {
+ /* most likely an EOF because the other end closed the connection,
+ but it might also be a real IO error or something else.
+ Let's just drop the connection
+ */
+ if (state->d_state == IncomingTCPConnectionState::State::idle ||
+ state->d_state == IncomingTCPConnectionState::State::waitingForQuery) {
+ /* no need to increase any counters in that case, the client is simply done with us */
+ }
+ else if (state->d_state == IncomingTCPConnectionState::State::doingHandshake ||
+ state->d_state != IncomingTCPConnectionState::State::readingProxyProtocolHeader ||
+ state->d_state == IncomingTCPConnectionState::State::waitingForQuery ||
+ state->d_state == IncomingTCPConnectionState::State::readingQuerySize ||
+ state->d_state == IncomingTCPConnectionState::State::readingQuery) {
+ ++state->d_ci.cs->tcpDiedReadingQuery;
+ }
+ else if (state->d_state == IncomingTCPConnectionState::State::sendingResponse) {
+ /* unlikely to happen here, the exception should be handled in sendResponse() */
+ ++state->d_ci.cs->tcpDiedSendingResponse;
+ }
+
+ if (state->d_ioState->isWaitingForWrite() || state->d_queriesCount == 0) {
+ DEBUGLOG("Got an exception while handling TCP query: "<<e.what());
+ vinfolog("Got an exception while handling (%s) TCP query from %s: %s", (state->d_ioState->isWaitingForRead() ? "reading" : "writing"), state->d_ci.remote.toStringWithPort(), e.what());
+ }
+ else {
+ vinfolog("Closing TCP client connection with %s: %s", state->d_ci.remote.toStringWithPort(), e.what());
+ DEBUGLOG("Closing TCP client connection: "<<e.what());
+ }
+ /* remove this FD from the IO multiplexer */
+ state->terminateClientConnection();
+ }
+
+ if (!state->active()) {
+ DEBUGLOG("state is no longer active");
+ return;
+ }
+
+ if (iostate == IOState::Done) {
+ state->d_ioState->update(iostate, handleIOCallback, state);
+ }
+ else {
+ state->d_ioState->update(iostate, handleIOCallback, state, iostate == IOState::NeedRead ? state->getClientReadTTD(now) : state->getClientWriteTTD(now));
+ }
+ ioGuard.release();
+ }
+ while ((iostate == IOState::NeedRead || iostate == IOState::NeedWrite) && !state->d_lastIOBlocked);
+}
+
+void IncomingTCPConnectionState::notifyIOError(IDState&& query, const struct timeval& now)
+{
+ std::shared_ptr<IncomingTCPConnectionState> state = shared_from_this();
+
+ --state->d_currentQueriesCount;
+ state->d_hadErrors = true;
+
+ if (state->d_state == State::sendingResponse) {
+ /* if we have responses to send, let's do that first */
+ }
+ else if (!state->d_queuedResponses.empty()) {
+ /* stop reading and send what we have */
+ try {
+ auto iostate = sendQueuedResponses(state, now);
+
+ if (state->active() && iostate != IOState::Done) {
+ // we need to update the state right away, nobody will do that for us
+ state->d_ioState->update(iostate, handleIOCallback, state, iostate == IOState::NeedWrite ? state->getClientWriteTTD(now) : state->getClientReadTTD(now));
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Exception in notifyIOError: %s", e.what());
+ }
+ }
+ else {
+ // the backend code already tried to reconnect if it was possible
+ state->terminateClientConnection();
+ }
+}
+
+void IncomingTCPConnectionState::handleXFRResponse(const struct timeval& now, TCPResponse&& response)
+{
+ std::shared_ptr<IncomingTCPConnectionState> state = shared_from_this();
+ queueResponse(state, now, std::move(response));
+}
+
+void IncomingTCPConnectionState::handleTimeout(std::shared_ptr<IncomingTCPConnectionState>& state, bool write)
+{
+ vinfolog("Timeout while %s TCP client %s", (write ? "writing to" : "reading from"), state->d_ci.remote.toStringWithPort());
+ DEBUGLOG("client timeout");
+ DEBUGLOG("Processed "<<state->d_queriesCount<<" queries, current count is "<<state->d_currentQueriesCount<<", "<<state->d_ownedConnectionsToBackend.size()<<" owned connections, "<<state->d_queuedResponses.size()<<" response queued");
+
+ if (write || state->d_currentQueriesCount == 0) {
+ ++state->d_ci.cs->tcpClientTimeouts;
+ state->d_ioState.reset();
+ }
+ else {
+ DEBUGLOG("Going idle");
+ /* we still have some queries in flight, let's just stop reading for now */
+ state->d_state = IncomingTCPConnectionState::State::idle;
+ state->d_ioState->update(IOState::Done, handleIOCallback, state);
+ }
+}
+
+static void handleIncomingTCPQuery(int pipefd, FDMultiplexer::funcparam_t& param)
+{
+ auto threadData = boost::any_cast<TCPClientThreadData*>(param);
+
+ ConnectionInfo* citmp{nullptr};
+
+ ssize_t got = read(pipefd, &citmp, sizeof(citmp));
+ if (got == 0) {
+ throw std::runtime_error("EOF while reading from the TCP acceptor pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode");
+ }
+ else if (got == -1) {
+ if (errno == EAGAIN || errno == EINTR) {
+ return;
+ }
+ throw std::runtime_error("Error while reading from the TCP acceptor pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode:" + stringerror());
+ }
+ else if (got != sizeof(citmp)) {
+ throw std::runtime_error("Partial read while reading from the TCP acceptor pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode");
+ }
+
+ try {
+ g_tcpclientthreads->decrementQueuedCount();
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ auto state = std::make_shared<IncomingTCPConnectionState>(std::move(*citmp), *threadData, now);
+ delete citmp;
+ citmp = nullptr;
+
+ IncomingTCPConnectionState::handleIO(state, now);
+ }
+ catch (...) {
+ delete citmp;
+ citmp = nullptr;
+ throw;
+ }
+}
+
+static void handleCrossProtocolQuery(int pipefd, FDMultiplexer::funcparam_t& param)
+{
+ auto threadData = boost::any_cast<TCPClientThreadData*>(param);
+ CrossProtocolQuery* tmp{nullptr};
+
+ ssize_t got = read(pipefd, &tmp, sizeof(tmp));
+ if (got == 0) {
+ throw std::runtime_error("EOF while reading from the TCP cross-protocol pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode");
+ }
+ else if (got == -1) {
+ if (errno == EAGAIN || errno == EINTR) {
+ return;
+ }
+ throw std::runtime_error("Error while reading from the TCP cross-protocol pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode:" + stringerror());
+ }
+ else if (got != sizeof(tmp)) {
+ throw std::runtime_error("Partial read while reading from the TCP cross-protocol pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode");
+ }
+
+ try {
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ std::shared_ptr<TCPQuerySender> tqs = tmp->getTCPQuerySender();
+ auto query = std::move(tmp->query);
+ auto downstreamServer = std::move(tmp->downstream);
+ auto proxyProtocolPayloadSize = tmp->proxyProtocolPayloadSize;
+ delete tmp;
+ tmp = nullptr;
+
+ try {
+ auto downstream = t_downstreamTCPConnectionsManager.getConnectionToDownstream(threadData->mplexer, downstreamServer, now, std::string());
+
+ prependSizeToTCPQuery(query.d_buffer, proxyProtocolPayloadSize);
+ query.d_proxyProtocolPayloadAddedSize = proxyProtocolPayloadSize;
+ downstream->queueQuery(tqs, std::move(query));
+ }
+ catch (...) {
+ tqs->notifyIOError(std::move(query.d_idstate), now);
+ }
+ }
+ catch (...) {
+ delete tmp;
+ tmp = nullptr;
+ }
+}
+
+static void handleCrossProtocolResponse(int pipefd, FDMultiplexer::funcparam_t& param)
+{
+ TCPCrossProtocolResponse* tmp{nullptr};
+
+ ssize_t got = read(pipefd, &tmp, sizeof(tmp));
+ if (got == 0) {
+ throw std::runtime_error("EOF while reading from the TCP cross-protocol response pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode");
+ }
+ else if (got == -1) {
+ if (errno == EAGAIN || errno == EINTR) {
+ return;
+ }
+ throw std::runtime_error("Error while reading from the TCP cross-protocol response pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode:" + stringerror());
+ }
+ else if (got != sizeof(tmp)) {
+ throw std::runtime_error("Partial read while reading from the TCP cross-protocol response pipe (" + std::to_string(pipefd) + ") in " + std::string(isNonBlocking(pipefd) ? "non-blocking" : "blocking") + " mode");
+ }
+
+ auto response = std::move(*tmp);
+ delete tmp;
+ tmp = nullptr;
+
+ try {
+ if (response.d_response.d_buffer.empty()) {
+ response.d_state->notifyIOError(std::move(response.d_response.d_idstate), response.d_now);
+ }
+ else if (response.d_response.d_idstate.qtype == QType::AXFR || response.d_response.d_idstate.qtype == QType::IXFR) {
+ response.d_state->handleXFRResponse(response.d_now, std::move(response.d_response));
+ }
+ else {
+ response.d_state->handleResponse(response.d_now, std::move(response.d_response));
+ }
+ }
+ catch (...) {
+ /* no point bubbling up from there */
+ }
+}
+
+static void tcpClientThread(int pipefd, int crossProtocolQueriesPipeFD, int crossProtocolResponsesListenPipeFD, int crossProtocolResponsesWritePipeFD)
+{
+ /* we get launched with a pipe on which we receive file descriptors from clients that we own
+ from that point on */
+
+ setThreadName("dnsdist/tcpClie");
+
+ try {
+ TCPClientThreadData data;
+ /* this is the writing end! */
+ data.crossProtocolResponsesPipe = crossProtocolResponsesWritePipeFD;
+ data.mplexer->addReadFD(pipefd, handleIncomingTCPQuery, &data);
+ data.mplexer->addReadFD(crossProtocolQueriesPipeFD, handleCrossProtocolQuery, &data);
+ data.mplexer->addReadFD(crossProtocolResponsesListenPipeFD, handleCrossProtocolResponse, &data);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ time_t lastTimeoutScan = now.tv_sec;
+
+ for (;;) {
+ data.mplexer->run(&now);
+
+ try {
+ t_downstreamTCPConnectionsManager.cleanupClosedConnections(now);
+
+ if (now.tv_sec > lastTimeoutScan) {
+ lastTimeoutScan = now.tv_sec;
+ auto expiredReadConns = data.mplexer->getTimeouts(now, false);
+ for (const auto& cbData : expiredReadConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto state = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(cbData.second);
+ if (cbData.first == state->d_handler.getDescriptor()) {
+ vinfolog("Timeout (read) from remote TCP client %s", state->d_ci.remote.toStringWithPort());
+ state->handleTimeout(state, false);
+ }
+ }
+ else if (cbData.second.type() == typeid(std::shared_ptr<TCPConnectionToBackend>)) {
+ auto conn = boost::any_cast<std::shared_ptr<TCPConnectionToBackend>>(cbData.second);
+ vinfolog("Timeout (read) from remote backend %s", conn->getBackendName());
+ conn->handleTimeout(now, false);
+ }
+ }
+
+ auto expiredWriteConns = data.mplexer->getTimeouts(now, true);
+ for (const auto& cbData : expiredWriteConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto state = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(cbData.second);
+ if (cbData.first == state->d_handler.getDescriptor()) {
+ vinfolog("Timeout (write) from remote TCP client %s", state->d_ci.remote.toStringWithPort());
+ state->handleTimeout(state, true);
+ }
+ }
+ else if (cbData.second.type() == typeid(std::shared_ptr<TCPConnectionToBackend>)) {
+ auto conn = boost::any_cast<std::shared_ptr<TCPConnectionToBackend>>(cbData.second);
+ vinfolog("Timeout (write) from remote backend %s", conn->getBackendName());
+ conn->handleTimeout(now, true);
+ }
+ }
+
+ if (g_tcpStatesDumpRequested > 0) {
+ /* just to keep things clean in the output, debug only */
+ static std::mutex s_lock;
+ std::lock_guard<decltype(s_lock)> lck(s_lock);
+ if (g_tcpStatesDumpRequested > 0) {
+ /* no race here, we took the lock so it can only be increased in the meantime */
+ --g_tcpStatesDumpRequested;
+ errlog("Dumping the TCP states, as requested:");
+ data.mplexer->runForAllWatchedFDs([](bool isRead, int fd, const FDMultiplexer::funcparam_t& param, struct timeval ttd)
+ {
+ struct timeval lnow;
+ gettimeofday(&lnow, nullptr);
+ if (ttd.tv_sec > 0) {
+ errlog("- Descriptor %d is in %s state, TTD in %d", fd, (isRead ? "read" : "write"), (ttd.tv_sec-lnow.tv_sec));
+ }
+ else {
+ errlog("- Descriptor %d is in %s state, no TTD set", fd, (isRead ? "read" : "write"));
+ }
+
+ if (param.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto state = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(param);
+ errlog(" - %s", state->toString());
+ }
+ else if (param.type() == typeid(std::shared_ptr<TCPConnectionToBackend>)) {
+ auto conn = boost::any_cast<std::shared_ptr<TCPConnectionToBackend>>(param);
+ errlog(" - %s", conn->toString());
+ }
+ else if (param.type() == typeid(TCPClientThreadData*)) {
+ errlog(" - Worker thread pipe");
+ }
+ });
+ errlog("The TCP/DoT client cache has %d active and %d idle outgoing connections cached", t_downstreamTCPConnectionsManager.getActiveCount(), t_downstreamTCPConnectionsManager.getIdleCount());
+ }
+ }
+ }
+ }
+ catch (const std::exception& e) {
+ errlog("Error in TCP worker thread: %s", e.what());
+ }
+ }
+ }
+ catch (const std::exception& e) {
+ errlog("Fatal error in TCP worker thread: %s", e.what());
+ }
+}
+
+/* spawn as many of these as required, they call Accept on a socket on which they will accept queries, and
+ they will hand off to worker threads & spawn more of them if required
+*/
+void tcpAcceptorThread(ClientState* cs)
+{
+ setThreadName("dnsdist/tcpAcce");
+
+ bool tcpClientCountIncremented = false;
+ ComboAddress remote;
+ remote.sin4.sin_family = cs->local.sin4.sin_family;
+
+ auto acl = g_ACL.getLocal();
+ for(;;) {
+ std::unique_ptr<ConnectionInfo> ci;
+ tcpClientCountIncremented = false;
+ try {
+ socklen_t remlen = remote.getSocklen();
+ ci = std::make_unique<ConnectionInfo>(cs);
+#ifdef HAVE_ACCEPT4
+ ci->fd = accept4(cs->tcpFD, reinterpret_cast<struct sockaddr*>(&remote), &remlen, SOCK_NONBLOCK);
+#else
+ ci->fd = accept(cs->tcpFD, reinterpret_cast<struct sockaddr*>(&remote), &remlen);
+#endif
+ // will be decremented when the ConnectionInfo object is destroyed, no matter the reason
+ auto concurrentConnections = ++cs->tcpCurrentConnections;
+ if (cs->d_tcpConcurrentConnectionsLimit > 0 && concurrentConnections > cs->d_tcpConcurrentConnectionsLimit) {
+ continue;
+ }
+
+ if (concurrentConnections > cs->tcpMaxConcurrentConnections.load()) {
+ cs->tcpMaxConcurrentConnections.store(concurrentConnections);
+ }
+
+ if (ci->fd < 0) {
+ throw std::runtime_error((boost::format("accepting new connection on socket: %s") % stringerror()).str());
+ }
+
+ if (!acl->match(remote)) {
+ ++g_stats.aclDrops;
+ vinfolog("Dropped TCP connection from %s because of ACL", remote.toStringWithPort());
+ continue;
+ }
+
+#ifndef HAVE_ACCEPT4
+ if (!setNonBlocking(ci->fd)) {
+ continue;
+ }
+#endif
+ setTCPNoDelay(ci->fd); // disable NAGLE
+ if (g_maxTCPQueuedConnections > 0 && g_tcpclientthreads->getQueuedCount() >= g_maxTCPQueuedConnections) {
+ vinfolog("Dropping TCP connection from %s because we have too many queued already", remote.toStringWithPort());
+ continue;
+ }
+
+ if (g_maxTCPConnectionsPerClient) {
+ auto tcpClientsCount = s_tcpClientsCount.lock();
+
+ if ((*tcpClientsCount)[remote] >= g_maxTCPConnectionsPerClient) {
+ vinfolog("Dropping TCP connection from %s because we have too many from this client already", remote.toStringWithPort());
+ continue;
+ }
+ (*tcpClientsCount)[remote]++;
+ tcpClientCountIncremented = true;
+ }
+
+ vinfolog("Got TCP connection from %s", remote.toStringWithPort());
+
+ ci->remote = remote;
+ if (!g_tcpclientthreads->passConnectionToThread(std::move(ci))) {
+ if (tcpClientCountIncremented) {
+ decrementTCPClientCount(remote);
+ }
+ }
+ }
+ catch (const std::exception& e) {
+ errlog("While reading a TCP question: %s", e.what());
+ if (tcpClientCountIncremented) {
+ decrementTCPClientCount(remote);
+ }
+ }
+ catch (...){}
+ }
+}
diff --git a/dnsdist-tcp.hh b/dnsdist-tcp.hh
new file mode 100644
index 0000000..1e896b4
--- /dev/null
+++ b/dnsdist-tcp.hh
@@ -0,0 +1,282 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <unistd.h>
+#include "iputils.hh"
+#include "dnsdist.hh"
+
+struct ConnectionInfo
+{
+ ConnectionInfo(ClientState* cs_) :
+ cs(cs_), fd(-1)
+ {
+ }
+ ConnectionInfo(ClientState* cs_, const ComboAddress remote_) :
+ remote(remote_), cs(cs_), fd(-1)
+ {
+ }
+ ConnectionInfo(ConnectionInfo&& rhs) :
+ remote(rhs.remote), cs(rhs.cs), fd(rhs.fd)
+ {
+ rhs.cs = nullptr;
+ rhs.fd = -1;
+ }
+
+ ConnectionInfo(const ConnectionInfo& rhs) = delete;
+ ConnectionInfo& operator=(const ConnectionInfo& rhs) = delete;
+
+ ConnectionInfo& operator=(ConnectionInfo&& rhs)
+ {
+ remote = rhs.remote;
+ cs = rhs.cs;
+ rhs.cs = nullptr;
+ fd = rhs.fd;
+ rhs.fd = -1;
+ return *this;
+ }
+
+ ~ConnectionInfo()
+ {
+ if (fd != -1) {
+ close(fd);
+ fd = -1;
+ }
+
+ if (cs) {
+ --cs->tcpCurrentConnections;
+ }
+ }
+
+ ComboAddress remote;
+ ClientState* cs{nullptr};
+ int fd{-1};
+};
+
+struct InternalQuery
+{
+ InternalQuery()
+ {
+ }
+
+ InternalQuery(PacketBuffer&& buffer, IDState&& state) :
+ d_idstate(std::move(state)), d_buffer(std::move(buffer))
+ {
+ }
+
+ InternalQuery(InternalQuery&& rhs) = default;
+ InternalQuery& operator=(InternalQuery&& rhs) = default;
+
+ InternalQuery(const InternalQuery& rhs) = delete;
+ InternalQuery& operator=(const InternalQuery& rhs) = delete;
+
+ bool isXFR() const
+ {
+ return d_idstate.qtype == QType::AXFR || d_idstate.qtype == QType::IXFR;
+ }
+
+ IDState d_idstate;
+ std::string d_proxyProtocolPayload;
+ PacketBuffer d_buffer;
+ uint32_t d_proxyProtocolPayloadAddedSize{0};
+ uint32_t d_xfrMasterSerial{0};
+ uint32_t d_xfrSerialCount{0};
+ uint32_t d_downstreamFailures{0};
+ uint8_t d_xfrMasterSerialCount{0};
+ bool d_xfrStarted{false};
+ bool d_proxyProtocolPayloadAdded{false};
+};
+
+using TCPQuery = InternalQuery;
+
+class ConnectionToBackend;
+
+struct TCPResponse : public TCPQuery
+{
+ TCPResponse()
+ {
+ /* let's make Coverity happy */
+ memset(&d_cleartextDH, 0, sizeof(d_cleartextDH));
+ }
+
+ TCPResponse(PacketBuffer&& buffer, IDState&& state, std::shared_ptr<ConnectionToBackend> conn) :
+ TCPQuery(std::move(buffer), std::move(state)), d_connection(conn)
+ {
+ memset(&d_cleartextDH, 0, sizeof(d_cleartextDH));
+ }
+
+ std::shared_ptr<ConnectionToBackend> d_connection{nullptr};
+ dnsheader d_cleartextDH;
+ bool d_selfGenerated{false};
+};
+
+class TCPQuerySender
+{
+public:
+ virtual ~TCPQuerySender()
+ {
+ }
+
+ virtual bool active() const = 0;
+ virtual const ClientState* getClientState() const = 0;
+ virtual void handleResponse(const struct timeval& now, TCPResponse&& response) = 0;
+ virtual void handleXFRResponse(const struct timeval& now, TCPResponse&& response) = 0;
+ virtual void notifyIOError(IDState&& query, const struct timeval& now) = 0;
+
+ /* whether the connection should be automatically released to the pool after handleResponse()
+ has been called */
+ bool releaseConnection() const
+ {
+ return d_releaseConnection;
+ }
+
+protected:
+ bool d_releaseConnection{true};
+};
+
+struct CrossProtocolQuery
+{
+ CrossProtocolQuery()
+ {
+ }
+
+ CrossProtocolQuery(CrossProtocolQuery&& rhs) = delete;
+ virtual ~CrossProtocolQuery()
+ {
+ }
+
+ virtual std::shared_ptr<TCPQuerySender> getTCPQuerySender() = 0;
+
+ InternalQuery query;
+ std::shared_ptr<DownstreamState> downstream{nullptr};
+ size_t proxyProtocolPayloadSize{0};
+ bool isXFR{false};
+};
+
+class TCPClientCollection
+{
+public:
+ TCPClientCollection(size_t maxThreads);
+
+ int getThread()
+ {
+ if (d_numthreads == 0) {
+ throw std::runtime_error("No TCP worker thread yet");
+ }
+
+ uint64_t pos = d_pos++;
+ ++d_queued;
+ return d_tcpclientthreads.at(pos % d_numthreads).d_newConnectionPipe.getHandle();
+ }
+
+ bool passConnectionToThread(std::unique_ptr<ConnectionInfo>&& conn)
+ {
+ if (d_numthreads == 0) {
+ throw std::runtime_error("No TCP worker thread yet");
+ }
+
+ uint64_t pos = d_pos++;
+ auto pipe = d_tcpclientthreads.at(pos % d_numthreads).d_newConnectionPipe.getHandle();
+ auto tmp = conn.release();
+
+ if (write(pipe, &tmp, sizeof(tmp)) != sizeof(tmp)) {
+ ++g_stats.tcpQueryPipeFull;
+ delete tmp;
+ tmp = nullptr;
+ return false;
+ }
+ ++d_queued;
+ return true;
+ }
+
+ bool passCrossProtocolQueryToThread(std::unique_ptr<CrossProtocolQuery>&& cpq)
+ {
+ if (d_numthreads == 0) {
+ throw std::runtime_error("No TCP worker thread yet");
+ }
+
+ uint64_t pos = d_pos++;
+ auto pipe = d_tcpclientthreads.at(pos % d_numthreads).d_crossProtocolQueriesPipe.getHandle();
+ auto tmp = cpq.release();
+
+ if (write(pipe, &tmp, sizeof(tmp)) != sizeof(tmp)) {
+ ++g_stats.tcpCrossProtocolQueryPipeFull;
+ delete tmp;
+ tmp = nullptr;
+ return false;
+ }
+
+ return true;
+ }
+
+ bool hasReachedMaxThreads() const
+ {
+ return d_numthreads >= d_maxthreads;
+ }
+
+ uint64_t getThreadsCount() const
+ {
+ return d_numthreads;
+ }
+
+ uint64_t getQueuedCount() const
+ {
+ return d_queued;
+ }
+
+ void decrementQueuedCount()
+ {
+ --d_queued;
+ }
+
+private:
+ void addTCPClientThread();
+
+ struct TCPWorkerThread
+ {
+ TCPWorkerThread()
+ {
+ }
+
+ TCPWorkerThread(int newConnPipe, int crossProtocolQueriesPipe, int crossProtocolResponsesPipe) :
+ d_newConnectionPipe(newConnPipe), d_crossProtocolQueriesPipe(crossProtocolQueriesPipe), d_crossProtocolResponsesPipe(crossProtocolResponsesPipe)
+ {
+ }
+
+ TCPWorkerThread(TCPWorkerThread&& rhs) = default;
+ TCPWorkerThread& operator=(TCPWorkerThread&& rhs) = default;
+ TCPWorkerThread(const TCPWorkerThread& rhs) = delete;
+ TCPWorkerThread& operator=(const TCPWorkerThread&) = delete;
+
+ FDWrapper d_newConnectionPipe;
+ FDWrapper d_crossProtocolQueriesPipe;
+ FDWrapper d_crossProtocolResponsesPipe;
+ };
+
+ std::vector<TCPWorkerThread> d_tcpclientthreads;
+ stat_t d_numthreads{0};
+ stat_t d_pos{0};
+ stat_t d_queued{0};
+ const uint64_t d_maxthreads{0};
+};
+
+extern std::unique_ptr<TCPClientCollection> g_tcpclientthreads;
diff --git a/dnsdist-web.cc b/dnsdist-web.cc
new file mode 100644
index 0000000..8a25058
--- /dev/null
+++ b/dnsdist-web.cc
@@ -0,0 +1,1577 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <boost/format.hpp>
+#include <sstream>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <thread>
+
+#include "ext/json11/json11.hpp"
+#include <yahttp/yahttp.hpp>
+
+#include "base64.hh"
+#include "connection-management.hh"
+#include "dnsdist.hh"
+#include "dnsdist-dynblocks.hh"
+#include "dnsdist-healthchecks.hh"
+#include "dnsdist-prometheus.hh"
+#include "dnsdist-web.hh"
+#include "dolog.hh"
+#include "gettime.hh"
+#include "htmlfiles.h"
+#include "threadname.hh"
+#include "sodcrypto.hh"
+#include "sstuff.hh"
+
+struct WebserverConfig
+{
+ WebserverConfig()
+ {
+ acl.toMasks("127.0.0.1, ::1");
+ }
+
+ NetmaskGroup acl;
+ std::unique_ptr<CredentialsHolder> password;
+ std::unique_ptr<CredentialsHolder> apiKey;
+ boost::optional<std::map<std::string, std::string> > customHeaders;
+ bool statsRequireAuthentication{true};
+};
+
+bool g_apiReadWrite{false};
+LockGuarded<WebserverConfig> g_webserverConfig;
+std::string g_apiConfigDirectory;
+static const MetricDefinitionStorage s_metricDefinitions;
+
+static ConcurrentConnectionManager s_connManager(100);
+
+std::string getWebserverConfig()
+{
+ ostringstream out;
+
+ {
+ auto config = g_webserverConfig.lock();
+ out << "Current web server configuration:" << endl;
+ out << "ACL: " << config->acl.toString() << endl;
+ out << "Custom headers: ";
+ if (config->customHeaders) {
+ out << endl;
+ for (const auto& header : *config->customHeaders) {
+ out << " - " << header.first << ": " << header.second << endl;
+ }
+ }
+ else {
+ out << "None" << endl;
+ }
+ out << "Statistics require authentication: " << (config->statsRequireAuthentication ? "yes" : "no") << endl;
+ out << "Password: " << (config->password ? "set" : "unset") << endl;
+ out << "API key: " << (config->apiKey ? "set" : "unset") << endl;
+ }
+ out << "API writable: " << (g_apiReadWrite ? "yes" : "no") << endl;
+ out << "API configuration directory: " << g_apiConfigDirectory << endl;
+ out << "Maximum concurrent connections: " << s_connManager.getMaxConcurrentConnections() << endl;
+
+ return out.str();
+}
+
+class WebClientConnection
+{
+public:
+ WebClientConnection(const ComboAddress& client, int fd): d_client(client), d_socket(fd)
+ {
+ if (!s_connManager.registerConnection()) {
+ throw std::runtime_error("Too many concurrent web client connections");
+ }
+ }
+ WebClientConnection(WebClientConnection&& rhs): d_client(rhs.d_client), d_socket(std::move(rhs.d_socket))
+ {
+ }
+
+ WebClientConnection(const WebClientConnection&) = delete;
+ WebClientConnection& operator=(const WebClientConnection&) = delete;
+
+ ~WebClientConnection()
+ {
+ if (d_socket.getHandle() != -1) {
+ s_connManager.releaseConnection();
+ }
+ }
+
+ const Socket& getSocket() const
+ {
+ return d_socket;
+ }
+
+ const ComboAddress& getClient() const
+ {
+ return d_client;
+ }
+
+private:
+ ComboAddress d_client;
+ Socket d_socket;
+};
+
+const std::map<std::string, MetricDefinition> MetricDefinitionStorage::metrics{
+ { "responses", MetricDefinition(PrometheusMetricType::counter, "Number of responses received from backends") },
+ { "servfail-responses", MetricDefinition(PrometheusMetricType::counter, "Number of SERVFAIL answers received from backends") },
+ { "queries", MetricDefinition(PrometheusMetricType::counter, "Number of received queries")},
+ { "frontend-nxdomain", MetricDefinition(PrometheusMetricType::counter, "Number of NXDomain answers sent to clients")},
+ { "frontend-servfail", MetricDefinition(PrometheusMetricType::counter, "Number of SERVFAIL answers sent to clients")},
+ { "frontend-noerror", MetricDefinition(PrometheusMetricType::counter, "Number of NoError answers sent to clients")},
+ { "acl-drops", MetricDefinition(PrometheusMetricType::counter, "Number of packets dropped because of the ACL")},
+ { "rule-drop", MetricDefinition(PrometheusMetricType::counter, "Number of queries dropped because of a rule")},
+ { "rule-nxdomain", MetricDefinition(PrometheusMetricType::counter, "Number of NXDomain answers returned because of a rule")},
+ { "rule-refused", MetricDefinition(PrometheusMetricType::counter, "Number of Refused answers returned because of a rule")},
+ { "rule-servfail", MetricDefinition(PrometheusMetricType::counter, "Number of SERVFAIL answers received because of a rule")},
+ { "rule-truncated", MetricDefinition(PrometheusMetricType::counter, "Number of truncated answers returned because of a rule")},
+ { "self-answered", MetricDefinition(PrometheusMetricType::counter, "Number of self-answered responses")},
+ { "downstream-timeouts", MetricDefinition(PrometheusMetricType::counter, "Number of queries not answered in time by a backend")},
+ { "downstream-send-errors", MetricDefinition(PrometheusMetricType::counter, "Number of errors when sending a query to a backend")},
+ { "trunc-failures", MetricDefinition(PrometheusMetricType::counter, "Number of errors encountered while truncating an answer")},
+ { "no-policy", MetricDefinition(PrometheusMetricType::counter, "Number of queries dropped because no server was available")},
+ { "latency0-1", MetricDefinition(PrometheusMetricType::counter, "Number of queries answered in less than 1ms")},
+ { "latency1-10", MetricDefinition(PrometheusMetricType::counter, "Number of queries answered in 1-10 ms")},
+ { "latency10-50", MetricDefinition(PrometheusMetricType::counter, "Number of queries answered in 10-50 ms")},
+ { "latency50-100", MetricDefinition(PrometheusMetricType::counter, "Number of queries answered in 50-100 ms")},
+ { "latency100-1000", MetricDefinition(PrometheusMetricType::counter, "Number of queries answered in 100-1000 ms")},
+ { "latency-slow", MetricDefinition(PrometheusMetricType::counter, "Number of queries answered in more than 1 second")},
+ { "latency-avg100", MetricDefinition(PrometheusMetricType::gauge, "Average response latency in microseconds of the last 100 packets")},
+ { "latency-avg1000", MetricDefinition(PrometheusMetricType::gauge, "Average response latency in microseconds of the last 1000 packets")},
+ { "latency-avg10000", MetricDefinition(PrometheusMetricType::gauge, "Average response latency in microseconds of the last 10000 packets")},
+ { "latency-avg1000000", MetricDefinition(PrometheusMetricType::gauge, "Average response latency in microseconds of the last 1000000 packets")},
+ { "uptime", MetricDefinition(PrometheusMetricType::gauge, "Uptime of the dnsdist process in seconds")},
+ { "real-memory-usage", MetricDefinition(PrometheusMetricType::gauge, "Current memory usage in bytes")},
+ { "noncompliant-queries", MetricDefinition(PrometheusMetricType::counter, "Number of queries dropped as non-compliant")},
+ { "noncompliant-responses", MetricDefinition(PrometheusMetricType::counter, "Number of answers from a backend dropped as non-compliant")},
+ { "rdqueries", MetricDefinition(PrometheusMetricType::counter, "Number of received queries with the recursion desired bit set")},
+ { "empty-queries", MetricDefinition(PrometheusMetricType::counter, "Number of empty queries received from clients")},
+ { "cache-hits", MetricDefinition(PrometheusMetricType::counter, "Number of times an answer was retrieved from cache")},
+ { "cache-misses", MetricDefinition(PrometheusMetricType::counter, "Number of times an answer not found in the cache")},
+ { "cpu-iowait", MetricDefinition(PrometheusMetricType::counter, "Time waiting for I/O to complete by the whole system, in units of USER_HZ")},
+ { "cpu-user-msec", MetricDefinition(PrometheusMetricType::counter, "Milliseconds spent by dnsdist in the user state")},
+ { "cpu-steal", MetricDefinition(PrometheusMetricType::counter, "Stolen time, which is the time spent by the whole system in other operating systems when running in a virtualized environment, in units of USER_HZ")},
+ { "cpu-sys-msec", MetricDefinition(PrometheusMetricType::counter, "Milliseconds spent by dnsdist in the system state")},
+ { "fd-usage", MetricDefinition(PrometheusMetricType::gauge, "Number of currently used file descriptors")},
+ { "dyn-blocked", MetricDefinition(PrometheusMetricType::counter, "Number of queries dropped because of a dynamic block")},
+ { "dyn-block-nmg-size", MetricDefinition(PrometheusMetricType::gauge, "Number of dynamic blocks entries") },
+ { "security-status", MetricDefinition(PrometheusMetricType::gauge, "Security status of this software. 0=unknown, 1=OK, 2=upgrade recommended, 3=upgrade mandatory") },
+ { "doh-query-pipe-full", MetricDefinition(PrometheusMetricType::counter, "Number of DoH queries dropped because the internal pipe used to distribute queries was full") },
+ { "doh-response-pipe-full", MetricDefinition(PrometheusMetricType::counter, "Number of DoH responses dropped because the internal pipe used to distribute responses was full") },
+ { "outgoing-doh-query-pipe-full", MetricDefinition(PrometheusMetricType::counter, "Number of outgoing DoH queries dropped because the internal pipe used to distribute queries was full") },
+ { "tcp-query-pipe-full", MetricDefinition(PrometheusMetricType::counter, "Number of TCP queries dropped because the internal pipe used to distribute queries was full") },
+ { "tcp-cross-protocol-query-pipe-full", MetricDefinition(PrometheusMetricType::counter, "Number of TCP cross-protocol queries dropped because the internal pipe used to distribute queries was full") },
+ { "tcp-cross-protocol-response-pipe-full", MetricDefinition(PrometheusMetricType::counter, "Number of TCP cross-protocol responses dropped because the internal pipe used to distribute queries was full") },
+ { "udp-in-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp InErrors") },
+ { "udp-noport-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp NoPorts") },
+ { "udp-recvbuf-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp RcvbufErrors") },
+ { "udp-sndbuf-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp SndbufErrors") },
+ { "udp-in-csum-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp InCsumErrors") },
+ { "udp6-in-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp6 Udp6InErrors") },
+ { "udp6-recvbuf-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp6 Udp6RcvbufErrors") },
+ { "udp6-sndbuf-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp6 Udp6SndbufErrors") },
+ { "udp6-noport-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp6 Udp6NoPorts") },
+ { "udp6-in-csum-errors", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/snmp6 Udp6InCsumErrors") },
+ { "tcp-listen-overflows", MetricDefinition(PrometheusMetricType::counter, "From /proc/net/netstat ListenOverflows") },
+ { "proxy-protocol-invalid", MetricDefinition(PrometheusMetricType::counter, "Number of queries dropped because of an invalid Proxy Protocol header") },
+};
+
+static bool apiWriteConfigFile(const string& filebasename, const string& content)
+{
+ if (!g_apiReadWrite) {
+ errlog("Not writing content to %s since the API is read-only", filebasename);
+ return false;
+ }
+
+ if (g_apiConfigDirectory.empty()) {
+ vinfolog("Not writing content to %s since the API configuration directory is not set", filebasename);
+ return false;
+ }
+
+ string filename = g_apiConfigDirectory + "/" + filebasename + ".conf";
+ ofstream ofconf(filename.c_str());
+ if (!ofconf) {
+ errlog("Could not open configuration fragment file '%s' for writing: %s", filename, stringerror());
+ return false;
+ }
+ ofconf << "-- Generated by the REST API, DO NOT EDIT" << endl;
+ ofconf << content << endl;
+ ofconf.close();
+ return true;
+}
+
+static void apiSaveACL(const NetmaskGroup& nmg)
+{
+ vector<string> vec;
+ nmg.toStringVector(&vec);
+
+ string acl;
+ for(const auto& s : vec) {
+ if (!acl.empty()) {
+ acl += ", ";
+ }
+ acl += "\"" + s + "\"";
+ }
+
+ string content = "setACL({" + acl + "})";
+ apiWriteConfigFile("acl", content);
+}
+
+static bool checkAPIKey(const YaHTTP::Request& req, const std::unique_ptr<CredentialsHolder>& apiKey)
+{
+ if (!apiKey) {
+ return false;
+ }
+
+ const auto header = req.headers.find("x-api-key");
+ if (header != req.headers.end()) {
+ return apiKey->matches(header->second);
+ }
+
+ return false;
+}
+
+static bool checkWebPassword(const YaHTTP::Request& req, const std::unique_ptr<CredentialsHolder>& password)
+{
+ static const char basicStr[] = "basic ";
+
+ const auto header = req.headers.find("authorization");
+
+ if (header != req.headers.end() && toLower(header->second).find(basicStr) == 0) {
+ string cookie = header->second.substr(sizeof(basicStr) - 1);
+
+ string plain;
+ B64Decode(cookie, plain);
+
+ vector<string> cparts;
+ stringtok(cparts, plain, ":");
+
+ if (cparts.size() == 2) {
+ if (password) {
+ return password->matches(cparts.at(1));
+ }
+ return true;
+ }
+ }
+
+ return false;
+}
+
+static bool isAnAPIRequest(const YaHTTP::Request& req)
+{
+ return req.url.path.find("/api/") == 0;
+}
+
+static bool isAnAPIRequestAllowedWithWebAuth(const YaHTTP::Request& req)
+{
+ return req.url.path == "/api/v1/servers/localhost";
+}
+
+static bool isAStatsRequest(const YaHTTP::Request& req)
+{
+ return req.url.path == "/jsonstat" || req.url.path == "/metrics";
+}
+
+static bool handleAuthorization(const YaHTTP::Request& req)
+{
+ auto config = g_webserverConfig.lock();
+
+ if (isAStatsRequest(req)) {
+ if (config->statsRequireAuthentication) {
+ /* Access to the stats is allowed for both API and Web users */
+ return checkAPIKey(req, config->apiKey) || checkWebPassword(req, config->password);
+ }
+ return true;
+ }
+
+ if (isAnAPIRequest(req)) {
+ /* Access to the API requires a valid API key */
+ if (checkAPIKey(req, config->apiKey)) {
+ return true;
+ }
+
+ return isAnAPIRequestAllowedWithWebAuth(req) && checkWebPassword(req, config->password);
+ }
+
+ return checkWebPassword(req, config->password);
+}
+
+static bool isMethodAllowed(const YaHTTP::Request& req)
+{
+ if (req.method == "GET") {
+ return true;
+ }
+ if (req.method == "PUT" && g_apiReadWrite) {
+ if (req.url.path == "/api/v1/servers/localhost/config/allow-from") {
+ return true;
+ }
+ }
+ return false;
+}
+
+static bool isClientAllowedByACL(const ComboAddress& remote)
+{
+ return g_webserverConfig.lock()->acl.match(remote);
+}
+
+static void handleCORS(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ const auto origin = req.headers.find("Origin");
+ if (origin != req.headers.end()) {
+ if (req.method == "OPTIONS") {
+ /* Pre-flight request */
+ if (g_apiReadWrite) {
+ resp.headers["Access-Control-Allow-Methods"] = "GET, PUT";
+ }
+ else {
+ resp.headers["Access-Control-Allow-Methods"] = "GET";
+ }
+ resp.headers["Access-Control-Allow-Headers"] = "Authorization, X-API-Key";
+ }
+
+ resp.headers["Access-Control-Allow-Origin"] = origin->second;
+
+ if (isAStatsRequest(req) || isAnAPIRequestAllowedWithWebAuth(req)) {
+ resp.headers["Access-Control-Allow-Credentials"] = "true";
+ }
+ }
+}
+
+static void addSecurityHeaders(YaHTTP::Response& resp, const boost::optional<std::map<std::string, std::string> >& customHeaders)
+{
+ static const std::vector<std::pair<std::string, std::string> > headers = {
+ { "X-Content-Type-Options", "nosniff" },
+ { "X-Frame-Options", "deny" },
+ { "X-Permitted-Cross-Domain-Policies", "none" },
+ { "X-XSS-Protection", "1; mode=block" },
+ { "Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'" },
+ };
+
+ for (const auto& h : headers) {
+ if (customHeaders) {
+ const auto& custom = customHeaders->find(h.first);
+ if (custom != customHeaders->end()) {
+ continue;
+ }
+ }
+ resp.headers[h.first] = h.second;
+ }
+}
+
+static void addCustomHeaders(YaHTTP::Response& resp, const boost::optional<std::map<std::string, std::string> >& customHeaders)
+{
+ if (!customHeaders)
+ return;
+
+ for (const auto& c : *customHeaders) {
+ if (!c.second.empty()) {
+ resp.headers[c.first] = c.second;
+ }
+ }
+}
+
+template<typename T>
+static json11::Json::array someResponseRulesToJson(GlobalStateHolder<vector<T>>* someResponseRules)
+{
+ using namespace json11;
+ Json::array responseRules;
+ int num=0;
+ auto localResponseRules = someResponseRules->getLocal();
+ for(const auto& a : *localResponseRules) {
+ Json::object rule{
+ {"id", num++},
+ {"creationOrder", (double)a.d_creationOrder},
+ {"uuid", boost::uuids::to_string(a.d_id)},
+ {"name", a.d_name},
+ {"matches", (double)a.d_rule->d_matches},
+ {"rule", a.d_rule->toString()},
+ {"action", a.d_action->toString()},
+ };
+ responseRules.push_back(rule);
+ }
+ return responseRules;
+}
+
+template<typename T>
+static void addRulesToPrometheusOutput(std::ostringstream& output, GlobalStateHolder<vector<T> >& rules)
+{
+ auto localRules = rules.getLocal();
+ for (const auto& entry : *localRules) {
+ std::string id = !entry.d_name.empty() ? entry.d_name : boost::uuids::to_string(entry.d_id);
+ output << "dnsdist_rule_hits{id=\"" << id << "\"} " << entry.d_rule->d_matches << "\n";
+ }
+}
+
+static void handlePrometheus(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ handleCORS(req, resp);
+ resp.status = 200;
+
+ std::ostringstream output;
+ static const std::set<std::string> metricBlacklist = { "latency-count", "latency-sum" };
+ for (const auto& e : g_stats.entries) {
+ if (e.first == "special-memory-usage")
+ continue; // Too expensive for get-all
+ std::string metricName = std::get<0>(e);
+
+ // Prometheus suggest using '_' instead of '-'
+ std::string prometheusMetricName = "dnsdist_" + boost::replace_all_copy(metricName, "-", "_");
+ if (metricBlacklist.count(metricName) != 0) {
+ continue;
+ }
+
+ MetricDefinition metricDetails;
+ if (!s_metricDefinitions.getMetricDetails(metricName, metricDetails)) {
+ vinfolog("Do not have metric details for %s", metricName);
+ continue;
+ }
+
+ std::string prometheusTypeName = s_metricDefinitions.getPrometheusStringMetricType(metricDetails.prometheusType);
+
+ if (prometheusTypeName == "") {
+ vinfolog("Unknown Prometheus type for %s", metricName);
+ continue;
+ }
+
+ // for these we have the help and types encoded in the sources:
+ output << "# HELP " << prometheusMetricName << " " << metricDetails.description << "\n";
+ output << "# TYPE " << prometheusMetricName << " " << prometheusTypeName << "\n";
+ output << prometheusMetricName << " ";
+
+ if (const auto& val = boost::get<pdns::stat_t*>(&std::get<1>(e)))
+ output << (*val)->load();
+ else if (const auto& dval = boost::get<double*>(&std::get<1>(e)))
+ output << **dval;
+ else
+ output << (*boost::get<DNSDistStats::statfunction_t>(&std::get<1>(e)))(std::get<0>(e));
+
+ output << "\n";
+ }
+
+ // Latency histogram buckets
+ output << "# HELP dnsdist_latency Histogram of responses by latency (in milliseconds)\n";
+ output << "# TYPE dnsdist_latency histogram\n";
+ uint64_t latency_amounts = g_stats.latency0_1;
+ output << "dnsdist_latency_bucket{le=\"1\"} " << latency_amounts << "\n";
+ latency_amounts += g_stats.latency1_10;
+ output << "dnsdist_latency_bucket{le=\"10\"} " << latency_amounts << "\n";
+ latency_amounts += g_stats.latency10_50;
+ output << "dnsdist_latency_bucket{le=\"50\"} " << latency_amounts << "\n";
+ latency_amounts += g_stats.latency50_100;
+ output << "dnsdist_latency_bucket{le=\"100\"} " << latency_amounts << "\n";
+ latency_amounts += g_stats.latency100_1000;
+ output << "dnsdist_latency_bucket{le=\"1000\"} " << latency_amounts << "\n";
+ latency_amounts += g_stats.latencySlow; // Should be the same as latency_count
+ output << "dnsdist_latency_bucket{le=\"+Inf\"} " << latency_amounts << "\n";
+ output << "dnsdist_latency_sum " << g_stats.latencySum << "\n";
+ output << "dnsdist_latency_count " << g_stats.latencyCount << "\n";
+
+ auto states = g_dstates.getLocal();
+ const string statesbase = "dnsdist_server_";
+
+ output << "# HELP " << statesbase << "status " << "Whether this backend is up (1) or down (0)" << "\n";
+ output << "# TYPE " << statesbase << "status " << "gauge" << "\n";
+ output << "# HELP " << statesbase << "queries " << "Amount of queries relayed to server" << "\n";
+ output << "# TYPE " << statesbase << "queries " << "counter" << "\n";
+ output << "# HELP " << statesbase << "responses " << "Amount of responses received from this server" << "\n";
+ output << "# TYPE " << statesbase << "responses " << "counter" << "\n";
+ output << "# HELP " << statesbase << "drops " << "Amount of queries not answered by server" << "\n";
+ output << "# TYPE " << statesbase << "drops " << "counter" << "\n";
+ output << "# HELP " << statesbase << "latency " << "Server's latency when answering questions in milliseconds" << "\n";
+ output << "# TYPE " << statesbase << "latency " << "gauge" << "\n";
+ output << "# HELP " << statesbase << "senderrors " << "Total number of OS send errors while relaying queries" << "\n";
+ output << "# TYPE " << statesbase << "senderrors " << "counter" << "\n";
+ output << "# HELP " << statesbase << "outstanding " << "Current number of queries that are waiting for a backend response" << "\n";
+ output << "# TYPE " << statesbase << "outstanding " << "gauge" << "\n";
+ output << "# HELP " << statesbase << "order " << "The order in which this server is picked" << "\n";
+ output << "# TYPE " << statesbase << "order " << "gauge" << "\n";
+ output << "# HELP " << statesbase << "weight " << "The weight within the order in which this server is picked" << "\n";
+ output << "# TYPE " << statesbase << "weight " << "gauge" << "\n";
+ output << "# HELP " << statesbase << "tcpdiedsendingquery " << "The number of TCP I/O errors while sending the query" << "\n";
+ output << "# TYPE " << statesbase << "tcpdiedsendingquery " << "counter" << "\n";
+ output << "# HELP " << statesbase << "tcpdiedreadingresponse " << "The number of TCP I/O errors while reading the response" << "\n";
+ output << "# TYPE " << statesbase << "tcpdiedreadingresponse " << "counter" << "\n";
+ output << "# HELP " << statesbase << "tcpgaveup " << "The number of TCP connections failing after too many attempts" << "\n";
+ output << "# TYPE " << statesbase << "tcpgaveup " << "counter" << "\n";
+ output << "# HELP " << statesbase << "tcpconnecttimeouts " << "The number of TCP connect timeouts" << "\n";
+ output << "# TYPE " << statesbase << "tcpconnecttimeouts " << "counter" << "\n";
+ output << "# HELP " << statesbase << "tcpreadtimeouts " << "The number of TCP read timeouts" << "\n";
+ output << "# TYPE " << statesbase << "tcpreadtimeouts " << "counter" << "\n";
+ output << "# HELP " << statesbase << "tcpwritetimeouts " << "The number of TCP write timeouts" << "\n";
+ output << "# TYPE " << statesbase << "tcpwritetimeouts " << "counter" << "\n";
+ output << "# HELP " << statesbase << "tcpcurrentconnections " << "The number of current TCP connections" << "\n";
+ output << "# TYPE " << statesbase << "tcpcurrentconnections " << "gauge" << "\n";
+ output << "# HELP " << statesbase << "tcpmaxconcurrentconnections " << "The maximum number of concurrent TCP connections" << "\n";
+ output << "# TYPE " << statesbase << "tcpmaxconcurrentconnections " << "counter" << "\n";
+ output << "# HELP " << statesbase << "tcpnewconnections " << "The number of established TCP connections in total" << "\n";
+ output << "# TYPE " << statesbase << "tcpnewconnections " << "counter" << "\n";
+ output << "# HELP " << statesbase << "tcpreusedconnections " << "The number of times a TCP connection has been reused" << "\n";
+ output << "# TYPE " << statesbase << "tcpreusedconnections " << "counter" << "\n";
+ output << "# HELP " << statesbase << "tcpavgqueriesperconn " << "The average number of queries per TCP connection" << "\n";
+ output << "# TYPE " << statesbase << "tcpavgqueriesperconn " << "gauge" << "\n";
+ output << "# HELP " << statesbase << "tcpavgconnduration " << "The average duration of a TCP connection (ms)" << "\n";
+ output << "# TYPE " << statesbase << "tcpavgconnduration " << "gauge" << "\n";
+ output << "# HELP " << statesbase << "tlsresumptions " << "The number of times a TLS session has been resumed" << "\n";
+ output << "# TYPE " << statesbase << "tlsersumptions " << "counter" << "\n";
+
+ for (const auto& state : *states) {
+ string serverName;
+
+ if (state->getName().empty())
+ serverName = state->remote.toStringWithPort();
+ else
+ serverName = state->getName();
+
+ boost::replace_all(serverName, ".", "_");
+
+ const std::string label = boost::str(boost::format("{server=\"%1%\",address=\"%2%\"}")
+ % serverName % state->remote.toStringWithPort());
+
+ output << statesbase << "status" << label << " " << (state->isUp() ? "1" : "0") << "\n";
+ output << statesbase << "queries" << label << " " << state->queries.load() << "\n";
+ output << statesbase << "responses" << label << " " << state->responses.load() << "\n";
+ output << statesbase << "drops" << label << " " << state->reuseds.load() << "\n";
+ if (state->isUp())
+ output << statesbase << "latency" << label << " " << state->latencyUsec/1000.0 << "\n";
+ output << statesbase << "senderrors" << label << " " << state->sendErrors.load() << "\n";
+ output << statesbase << "outstanding" << label << " " << state->outstanding.load() << "\n";
+ output << statesbase << "order" << label << " " << state->order << "\n";
+ output << statesbase << "weight" << label << " " << state->weight << "\n";
+ output << statesbase << "tcpdiedsendingquery" << label << " " << state->tcpDiedSendingQuery << "\n";
+ output << statesbase << "tcpdiedreadingresponse" << label << " " << state->tcpDiedReadingResponse << "\n";
+ output << statesbase << "tcpgaveup" << label << " " << state->tcpGaveUp << "\n";
+ output << statesbase << "tcpreadtimeouts" << label << " " << state->tcpReadTimeouts << "\n";
+ output << statesbase << "tcpwritetimeouts" << label << " " << state->tcpWriteTimeouts << "\n";
+ output << statesbase << "tcpconnecttimeouts" << label << " " << state->tcpConnectTimeouts << "\n";
+ output << statesbase << "tcpcurrentconnections" << label << " " << state->tcpCurrentConnections << "\n";
+ output << statesbase << "tcpmaxconcurrentconnections" << label << " " << state->tcpMaxConcurrentConnections << "\n";
+ output << statesbase << "tcpnewconnections" << label << " " << state->tcpNewConnections << "\n";
+ output << statesbase << "tcpreusedconnections" << label << " " << state->tcpReusedConnections << "\n";
+ output << statesbase << "tcpavgqueriesperconn" << label << " " << state->tcpAvgQueriesPerConnection << "\n";
+ output << statesbase << "tcpavgconnduration" << label << " " << state->tcpAvgConnectionDuration << "\n";
+ output << statesbase << "tlsresumptions" << label << " " << state->tlsResumptions << "\n";
+ }
+
+ const string frontsbase = "dnsdist_frontend_";
+ output << "# HELP " << frontsbase << "queries " << "Amount of queries received by this frontend" << "\n";
+ output << "# TYPE " << frontsbase << "queries " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "responses " << "Amount of responses sent by this frontend" << "\n";
+ output << "# TYPE " << frontsbase << "responses " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tcpdiedreadingquery " << "Amount of TCP connections terminated while reading the query from the client" << "\n";
+ output << "# TYPE " << frontsbase << "tcpdiedreadingquery " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tcpdiedsendingresponse " << "Amount of TCP connections terminated while sending a response to the client" << "\n";
+ output << "# TYPE " << frontsbase << "tcpdiedsendingresponse " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tcpgaveup " << "Amount of TCP connections terminated after too many attempts to get a connection to the backend" << "\n";
+ output << "# TYPE " << frontsbase << "tcpgaveup " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tcpclientimeouts " << "Amount of TCP connections terminated by a timeout while reading from the client" << "\n";
+ output << "# TYPE " << frontsbase << "tcpclientimeouts " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tcpdownstreamtimeouts " << "Amount of TCP connections terminated by a timeout while reading from the backend" << "\n";
+ output << "# TYPE " << frontsbase << "tcpdownstreamtimeouts " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tcpcurrentconnections " << "Amount of current incoming TCP connections from clients" << "\n";
+ output << "# TYPE " << frontsbase << "tcpcurrentconnections " << "gauge" << "\n";
+ output << "# HELP " << frontsbase << "tcpmaxconcurrentconnections " << "Maximum number of concurrent incoming TCP connections from clients" << "\n";
+ output << "# TYPE " << frontsbase << "tcpmaxconcurrentconnections " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tcpavgqueriesperconnection " << "The average number of queries per TCP connection" << "\n";
+ output << "# TYPE " << frontsbase << "tcpavgqueriesperconnection " << "gauge" << "\n";
+ output << "# HELP " << frontsbase << "tcpavgconnectionduration " << "The average duration of a TCP connection (ms)" << "\n";
+ output << "# TYPE " << frontsbase << "tcpavgconnectionduration " << "gauge" << "\n";
+ output << "# HELP " << frontsbase << "tlsqueries " << "Number of queries received by dnsdist over TLS, by TLS version" << "\n";
+ output << "# TYPE " << frontsbase << "tlsqueries " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tlsnewsessions " << "Amount of new TLS sessions negotiated" << "\n";
+ output << "# TYPE " << frontsbase << "tlsnewsessions " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tlsresumptions " << "Amount of TLS sessions resumed" << "\n";
+ output << "# TYPE " << frontsbase << "tlsresumptions " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tlsunknownticketkeys " << "Amount of attempts to resume TLS session from an unknown key (possibly expired)" << "\n";
+ output << "# TYPE " << frontsbase << "tlsunknownticketkeys " << "counter" << "\n";
+ output << "# HELP " << frontsbase << "tlsinactiveticketkeys " << "Amount of TLS sessions resumed from an inactive key" << "\n";
+ output << "# TYPE " << frontsbase << "tlsinactiveticketkeys " << "counter" << "\n";
+
+ output << "# HELP " << frontsbase << "tlshandshakefailures " << "Amount of TLS handshake failures" << "\n";
+ output << "# TYPE " << frontsbase << "tlshandshakefailures " << "counter" << "\n";
+
+ std::map<std::string,uint64_t> frontendDuplicates;
+ for (const auto& front : g_frontends) {
+ if (front->udpFD == -1 && front->tcpFD == -1)
+ continue;
+
+ const string frontName = front->local.toStringWithPort();
+ const string proto = front->getType();
+ const string fullName = frontName + "_" + proto;
+ uint64_t threadNumber = 0;
+ auto dupPair = frontendDuplicates.insert({fullName, 1});
+ if (!dupPair.second) {
+ threadNumber = dupPair.first->second;
+ ++(dupPair.first->second);
+ }
+ const std::string label = boost::str(boost::format("{frontend=\"%1%\",proto=\"%2%\",thread=\"%3%\"} ")
+ % frontName % proto % threadNumber);
+
+ output << frontsbase << "queries" << label << front->queries.load() << "\n";
+ output << frontsbase << "responses" << label << front->responses.load() << "\n";
+ if (front->isTCP()) {
+ output << frontsbase << "tcpdiedreadingquery" << label << front->tcpDiedReadingQuery.load() << "\n";
+ output << frontsbase << "tcpdiedsendingresponse" << label << front->tcpDiedSendingResponse.load() << "\n";
+ output << frontsbase << "tcpgaveup" << label << front->tcpGaveUp.load() << "\n";
+ output << frontsbase << "tcpclientimeouts" << label << front->tcpClientTimeouts.load() << "\n";
+ output << frontsbase << "tcpdownstreamtimeouts" << label << front->tcpDownstreamTimeouts.load() << "\n";
+ output << frontsbase << "tcpcurrentconnections" << label << front->tcpCurrentConnections.load() << "\n";
+ output << frontsbase << "tcpmaxconcurrentconnections" << label << front->tcpMaxConcurrentConnections.load() << "\n";
+ output << frontsbase << "tcpavgqueriesperconnection" << label << front->tcpAvgQueriesPerConnection.load() << "\n";
+ output << frontsbase << "tcpavgconnectionduration" << label << front->tcpAvgConnectionDuration.load() << "\n";
+ if (front->hasTLS()) {
+ output << frontsbase << "tlsnewsessions" << label << front->tlsNewSessions.load() << "\n";
+ output << frontsbase << "tlsresumptions" << label << front->tlsResumptions.load() << "\n";
+ output << frontsbase << "tlsunknownticketkeys" << label << front->tlsUnknownTicketKey.load() << "\n";
+ output << frontsbase << "tlsinactiveticketkeys" << label << front->tlsInactiveTicketKey.load() << "\n";
+
+ output << frontsbase << "tlsqueries{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",tls=\"tls10\"} " << front->tls10queries.load() << "\n";
+ output << frontsbase << "tlsqueries{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",tls=\"tls11\"} " << front->tls11queries.load() << "\n";
+ output << frontsbase << "tlsqueries{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",tls=\"tls12\"} " << front->tls12queries.load() << "\n";
+ output << frontsbase << "tlsqueries{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",tls=\"tls13\"} " << front->tls13queries.load() << "\n";
+ output << frontsbase << "tlsqueries{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",tls=\"unknown\"} " << front->tlsUnknownqueries.load() << "\n";
+
+ const TLSErrorCounters* errorCounters = nullptr;
+ if (front->tlsFrontend != nullptr) {
+ errorCounters = &front->tlsFrontend->d_tlsCounters;
+ }
+ else if (front->dohFrontend != nullptr) {
+ errorCounters = &front->dohFrontend->d_tlsCounters;
+ }
+
+ if (errorCounters != nullptr) {
+ output << frontsbase << "tlshandshakefailures{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",error=\"dhKeyTooSmall\"} " << errorCounters->d_dhKeyTooSmall << "\n";
+ output << frontsbase << "tlshandshakefailures{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",error=\"inappropriateFallBack\"} " << errorCounters->d_inappropriateFallBack << "\n";
+ output << frontsbase << "tlshandshakefailures{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",error=\"noSharedCipher\"} " << errorCounters->d_noSharedCipher << "\n";
+ output << frontsbase << "tlshandshakefailures{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",error=\"unknownCipherType\"} " << errorCounters->d_unknownCipherType << "\n";
+ output << frontsbase << "tlshandshakefailures{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",error=\"unknownKeyExchangeType\"} " << errorCounters->d_unknownKeyExchangeType << "\n";
+ output << frontsbase << "tlshandshakefailures{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",error=\"unknownProtocol\"} " << errorCounters->d_unknownProtocol << "\n";
+ output << frontsbase << "tlshandshakefailures{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",error=\"unsupportedEC\"} " << errorCounters->d_unsupportedEC << "\n";
+ output << frontsbase << "tlshandshakefailures{frontend=\"" << frontName << "\",proto=\"" << proto << "\",thread=\"" << threadNumber << "\",error=\"unsupportedProtocol\"} " << errorCounters->d_unsupportedProtocol << "\n";
+ }
+ }
+ }
+ }
+
+ output << "# HELP " << frontsbase << "http_connects " << "Number of DoH TCP connections established to this frontend" << "\n";
+ output << "# TYPE " << frontsbase << "http_connects " << "counter" << "\n";
+
+ output << "# HELP " << frontsbase << "doh_http_method_queries " << "Number of DoH queries received by dnsdist, by HTTP method" << "\n";
+ output << "# TYPE " << frontsbase << "doh_http_method_queries " << "counter" << "\n";
+
+ output << "# HELP " << frontsbase << "doh_http_version_queries " << "Number of DoH queries received by dnsdist, by HTTP version" << "\n";
+ output << "# TYPE " << frontsbase << "doh_http_version_queries " << "counter" << "\n";
+
+ output << "# HELP " << frontsbase << "doh_bad_requests " << "Number of requests that could not be converted to a DNS query" << "\n";
+ output << "# TYPE " << frontsbase << "doh_bad_requests " << "counter" << "\n";
+
+ output << "# HELP " << frontsbase << "doh_responses " << "Number of responses sent, by type" << "\n";
+ output << "# TYPE " << frontsbase << "doh_responses " << "counter" << "\n";
+
+ output << "# HELP " << frontsbase << "doh_version_status_responses " << "Number of requests that could not be converted to a DNS query" << "\n";
+ output << "# TYPE " << frontsbase << "doh_version_status_responses " << "counter" << "\n";
+
+#ifdef HAVE_DNS_OVER_HTTPS
+ std::map<std::string,uint64_t> dohFrontendDuplicates;
+ for(const auto& doh : g_dohlocals) {
+ const string frontName = doh->d_local.toStringWithPort();
+ uint64_t threadNumber = 0;
+ auto dupPair = frontendDuplicates.insert({frontName, 1});
+ if (!dupPair.second) {
+ threadNumber = dupPair.first->second;
+ ++(dupPair.first->second);
+ }
+ const std::string addrlabel = boost::str(boost::format("frontend=\"%1%\",thread=\"%2%\"") % frontName % threadNumber);
+ const std::string label = "{" + addrlabel + "} ";
+
+ output << frontsbase << "http_connects" << label << doh->d_httpconnects << "\n";
+ output << frontsbase << "doh_http_method_queries{method=\"get\"," << addrlabel << "} " << doh->d_getqueries << "\n";
+ output << frontsbase << "doh_http_method_queries{method=\"post\"," << addrlabel << "} " << doh->d_postqueries << "\n";
+
+ output << frontsbase << "doh_http_version_queries{version=\"1\"," << addrlabel << "} " << doh->d_http1Stats.d_nbQueries << "\n";
+ output << frontsbase << "doh_http_version_queries{version=\"2\"," << addrlabel << "} " << doh->d_http2Stats.d_nbQueries << "\n";
+
+ output << frontsbase << "doh_bad_requests{" << addrlabel << "} " << doh->d_badrequests << "\n";
+
+ output << frontsbase << "doh_responses{type=\"error\"," << addrlabel << "} " << doh->d_errorresponses << "\n";
+ output << frontsbase << "doh_responses{type=\"redirect\"," << addrlabel << "} " << doh->d_redirectresponses << "\n";
+ output << frontsbase << "doh_responses{type=\"valid\"," << addrlabel << "} " << doh->d_validresponses << "\n";
+
+ output << frontsbase << "doh_version_status_responses{httpversion=\"1\",status=\"200\"," << addrlabel << "} " << doh->d_http1Stats.d_nb200Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"1\",status=\"400\"," << addrlabel << "} " << doh->d_http1Stats.d_nb400Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"1\",status=\"403\"," << addrlabel << "} " << doh->d_http1Stats.d_nb403Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"1\",status=\"500\"," << addrlabel << "} " << doh->d_http1Stats.d_nb500Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"1\",status=\"502\"," << addrlabel << "} " << doh->d_http1Stats.d_nb502Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"1\",status=\"other\"," << addrlabel << "} " << doh->d_http1Stats.d_nbOtherResponses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"2\",status=\"200\"," << addrlabel << "} " << doh->d_http2Stats.d_nb200Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"2\",status=\"400\"," << addrlabel << "} " << doh->d_http2Stats.d_nb400Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"2\",status=\"403\"," << addrlabel << "} " << doh->d_http2Stats.d_nb403Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"2\",status=\"500\"," << addrlabel << "} " << doh->d_http2Stats.d_nb500Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"2\",status=\"502\"," << addrlabel << "} " << doh->d_http2Stats.d_nb502Responses << "\n";
+ output << frontsbase << "doh_version_status_responses{httpversion=\"2\",status=\"other\"," << addrlabel << "} " << doh->d_http2Stats.d_nbOtherResponses << "\n";
+ }
+#endif /* HAVE_DNS_OVER_HTTPS */
+
+ auto localPools = g_pools.getLocal();
+ const string cachebase = "dnsdist_pool_";
+ output << "# HELP dnsdist_pool_servers " << "Number of servers in that pool" << "\n";
+ output << "# TYPE dnsdist_pool_servers " << "gauge" << "\n";
+ output << "# HELP dnsdist_pool_active_servers " << "Number of available servers in that pool" << "\n";
+ output << "# TYPE dnsdist_pool_active_servers " << "gauge" << "\n";
+
+ output << "# HELP dnsdist_pool_cache_size " << "Maximum number of entries that this cache can hold" << "\n";
+ output << "# TYPE dnsdist_pool_cache_size " << "gauge" << "\n";
+ output << "# HELP dnsdist_pool_cache_entries " << "Number of entries currently present in that cache" << "\n";
+ output << "# TYPE dnsdist_pool_cache_entries " << "gauge" << "\n";
+ output << "# HELP dnsdist_pool_cache_hits " << "Number of hits from that cache" << "\n";
+ output << "# TYPE dnsdist_pool_cache_hits " << "counter" << "\n";
+ output << "# HELP dnsdist_pool_cache_misses " << "Number of misses from that cache" << "\n";
+ output << "# TYPE dnsdist_pool_cache_misses " << "counter" << "\n";
+ output << "# HELP dnsdist_pool_cache_deferred_inserts " << "Number of insertions into that cache skipped because it was already locked" << "\n";
+ output << "# TYPE dnsdist_pool_cache_deferred_inserts " << "counter" << "\n";
+ output << "# HELP dnsdist_pool_cache_deferred_lookups " << "Number of lookups into that cache skipped because it was already locked" << "\n";
+ output << "# TYPE dnsdist_pool_cache_deferred_lookups " << "counter" << "\n";
+ output << "# HELP dnsdist_pool_cache_lookup_collisions " << "Number of lookups into that cache that triggered a collision (same hash but different entry)" << "\n";
+ output << "# TYPE dnsdist_pool_cache_lookup_collisions " << "counter" << "\n";
+ output << "# HELP dnsdist_pool_cache_insert_collisions " << "Number of insertions into that cache that triggered a collision (same hash but different entry)" << "\n";
+ output << "# TYPE dnsdist_pool_cache_insert_collisions " << "counter" << "\n";
+ output << "# HELP dnsdist_pool_cache_ttl_too_shorts " << "Number of insertions into that cache skipped because the TTL of the answer was not long enough" << "\n";
+ output << "# TYPE dnsdist_pool_cache_ttl_too_shorts " << "counter" << "\n";
+
+ for (const auto& entry : *localPools) {
+ string poolName = entry.first;
+
+ if (poolName.empty()) {
+ poolName = "_default_";
+ }
+ const string label = "{pool=\"" + poolName + "\"}";
+ const std::shared_ptr<ServerPool> pool = entry.second;
+ output << "dnsdist_pool_servers" << label << " " << pool->countServers(false) << "\n";
+ output << "dnsdist_pool_active_servers" << label << " " << pool->countServers(true) << "\n";
+
+ if (pool->packetCache != nullptr) {
+ const auto& cache = pool->packetCache;
+
+ output << cachebase << "cache_size" <<label << " " << cache->getMaxEntries() << "\n";
+ output << cachebase << "cache_entries" <<label << " " << cache->getEntriesCount() << "\n";
+ output << cachebase << "cache_hits" <<label << " " << cache->getHits() << "\n";
+ output << cachebase << "cache_misses" <<label << " " << cache->getMisses() << "\n";
+ output << cachebase << "cache_deferred_inserts" <<label << " " << cache->getDeferredInserts() << "\n";
+ output << cachebase << "cache_deferred_lookups" <<label << " " << cache->getDeferredLookups() << "\n";
+ output << cachebase << "cache_lookup_collisions" <<label << " " << cache->getLookupCollisions() << "\n";
+ output << cachebase << "cache_insert_collisions" <<label << " " << cache->getInsertCollisions() << "\n";
+ output << cachebase << "cache_ttl_too_shorts" <<label << " " << cache->getTTLTooShorts() << "\n";
+ }
+ }
+
+ output << "# HELP dnsdist_rule_hits " << "Number of hits of that rule" << "\n";
+ output << "# TYPE dnsdist_rule_hits " << "counter" << "\n";
+ addRulesToPrometheusOutput(output, g_ruleactions);
+ addRulesToPrometheusOutput(output, g_respruleactions);
+ addRulesToPrometheusOutput(output, g_cachehitrespruleactions);
+ addRulesToPrometheusOutput(output, g_selfansweredrespruleactions);
+
+ output << "# HELP dnsdist_dynblocks_nmg_top_offenders_hits_per_second " << "Number of hits per second blocked by Dynamic Blocks (netmasks) for the top offenders, averaged over the last 60s" << "\n";
+ output << "# TYPE dnsdist_dynblocks_nmg_top_offenders_hits_per_second " << "gauge" << "\n";
+ auto topNetmasksByReason = DynBlockMaintenance::getHitsForTopNetmasks();
+ for (const auto& entry : topNetmasksByReason) {
+ for (const auto& netmask : entry.second) {
+ output << "dnsdist_dynblocks_nmg_top_offenders_hits_per_second{reason=\"" << entry.first << "\",netmask=\"" << netmask.first.toString() << "\"} " << netmask.second << "\n";
+ }
+ }
+
+ output << "# HELP dnsdist_dynblocks_smt_top_offenders_hits_per_second " << "Number of this per second blocked by Dynamic Blocks (suffixes) for the top offenders, averaged over the last 60s" << "\n";
+ output << "# TYPE dnsdist_dynblocks_smt_top_offenders_hits_per_second " << "gauge" << "\n";
+ auto topSuffixesByReason = DynBlockMaintenance::getHitsForTopSuffixes();
+ for (const auto& entry : topSuffixesByReason) {
+ for (const auto& suffix : entry.second) {
+ output << "dnsdist_dynblocks_smt_top_offenders_hits_per_second{reason=\"" << entry.first << "\",suffix=\"" << suffix.first.toString() << "\"} " << suffix.second << "\n";
+ }
+ }
+
+ output << "# HELP dnsdist_info " << "Info from dnsdist, value is always 1" << "\n";
+ output << "# TYPE dnsdist_info " << "gauge" << "\n";
+ output << "dnsdist_info{version=\"" << VERSION << "\"} " << "1" << "\n";
+
+ resp.body = output.str();
+ resp.headers["Content-Type"] = "text/plain";
+}
+
+using namespace json11;
+
+static void handleJSONStats(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ handleCORS(req, resp);
+ resp.status = 200;
+
+ if (req.getvars.count("command") == 0) {
+ resp.status = 404;
+ return;
+ }
+
+ const string& command = req.getvars.at("command");
+
+ if (command == "stats") {
+ auto obj=Json::object {
+ { "packetcache-hits", 0},
+ { "packetcache-misses", 0},
+ { "over-capacity-drops", 0 },
+ { "too-old-drops", 0 },
+ { "server-policy", g_policy.getLocal()->getName()}
+ };
+
+ for (const auto& e : g_stats.entries) {
+ if (e.first == "special-memory-usage")
+ continue; // Too expensive for get-all
+ if(const auto& val = boost::get<pdns::stat_t*>(&e.second))
+ obj.insert({e.first, (double)(*val)->load()});
+ else if (const auto& dval = boost::get<double*>(&e.second))
+ obj.insert({e.first, (**dval)});
+ else
+ obj.insert({e.first, (double)(*boost::get<DNSDistStats::statfunction_t>(&e.second))(e.first)});
+ }
+ Json my_json = obj;
+ resp.body = my_json.dump();
+ resp.headers["Content-Type"] = "application/json";
+ }
+ else if (command == "dynblocklist") {
+ Json::object obj;
+ auto nmg = g_dynblockNMG.getLocal();
+ struct timespec now;
+ gettime(&now);
+ for (const auto& e: *nmg) {
+ if(now < e.second.until ) {
+ Json::object thing{
+ {"reason", e.second.reason},
+ {"seconds", (double)(e.second.until.tv_sec - now.tv_sec)},
+ {"blocks", (double)e.second.blocks},
+ {"action", DNSAction::typeToString(e.second.action != DNSAction::Action::None ? e.second.action : g_dynBlockAction) },
+ {"warning", e.second.warning }
+ };
+ obj.insert({e.first.toString(), thing});
+ }
+ }
+
+ auto smt = g_dynblockSMT.getLocal();
+ smt->visit([&now,&obj](const SuffixMatchTree<DynBlock>& node) {
+ if(now <node.d_value.until) {
+ string dom("empty");
+ if(!node.d_value.domain.empty())
+ dom = node.d_value.domain.toString();
+ Json::object thing{
+ {"reason", node.d_value.reason},
+ {"seconds", (double)(node.d_value.until.tv_sec - now.tv_sec)},
+ {"blocks", (double)node.d_value.blocks},
+ {"action", DNSAction::typeToString(node.d_value.action != DNSAction::Action::None ? node.d_value.action : g_dynBlockAction) }
+ };
+ obj.insert({dom, thing});
+ }
+ });
+
+ Json my_json = obj;
+ resp.body = my_json.dump();
+ resp.headers["Content-Type"] = "application/json";
+ }
+ else if (command == "ebpfblocklist") {
+ Json::object obj;
+#ifdef HAVE_EBPF
+ struct timespec now;
+ gettime(&now);
+ for (const auto& dynbpf : g_dynBPFFilters) {
+ std::vector<std::tuple<ComboAddress, uint64_t, struct timespec> > addrStats = dynbpf->getAddrStats();
+ for (const auto& entry : addrStats) {
+ Json::object thing
+ {
+ {"seconds", (double)(std::get<2>(entry).tv_sec - now.tv_sec)},
+ {"blocks", (double)(std::get<1>(entry))}
+ };
+ obj.insert({std::get<0>(entry).toString(), thing });
+ }
+ }
+#endif /* HAVE_EBPF */
+ Json my_json = obj;
+ resp.body = my_json.dump();
+ resp.headers["Content-Type"] = "application/json";
+ }
+ else {
+ resp.status = 404;
+ }
+}
+
+static void addServerToJSON(Json::array& servers, int id, const std::shared_ptr<DownstreamState>& a)
+{
+ string status;
+ if (a->availability == DownstreamState::Availability::Up) {
+ status = "UP";
+ }
+ else if (a->availability == DownstreamState::Availability::Down) {
+ status = "DOWN";
+ }
+ else {
+ status = (a->upStatus ? "up" : "down");
+ }
+
+ Json::array pools;
+ for(const auto& p: a->pools) {
+ pools.push_back(p);
+ }
+
+ Json::object server {
+ {"id", id},
+ {"name", a->getName()},
+ {"address", a->remote.toStringWithPort()},
+ {"state", status},
+ {"qps", (double)a->queryLoad},
+ {"qpsLimit", (double)a->qps.getRate()},
+ {"outstanding", (double)a->outstanding},
+ {"reuseds", (double)a->reuseds},
+ {"weight", (double)a->weight},
+ {"order", (double)a->order},
+ {"pools", pools},
+ {"latency", (double)(a->latencyUsec/1000.0)},
+ {"queries", (double)a->queries},
+ {"responses", (double)a->responses},
+ {"sendErrors", (double)a->sendErrors},
+ {"tcpDiedSendingQuery", (double)a->tcpDiedSendingQuery},
+ {"tcpDiedReadingResponse", (double)a->tcpDiedReadingResponse},
+ {"tcpGaveUp", (double)a->tcpGaveUp},
+ {"tcpConnectTimeouts", (double)a->tcpConnectTimeouts},
+ {"tcpReadTimeouts", (double)a->tcpReadTimeouts},
+ {"tcpWriteTimeouts", (double)a->tcpWriteTimeouts},
+ {"tcpCurrentConnections", (double)a->tcpCurrentConnections},
+ {"tcpMaxConcurrentConnections", (double)a->tcpMaxConcurrentConnections},
+ {"tcpNewConnections", (double)a->tcpNewConnections},
+ {"tcpReusedConnections", (double)a->tcpReusedConnections},
+ {"tcpAvgQueriesPerConnection", (double)a->tcpAvgQueriesPerConnection},
+ {"tcpAvgConnectionDuration", (double)a->tcpAvgConnectionDuration},
+ {"tlsResumptions", (double)a->tlsResumptions},
+ {"dropRate", (double)a->dropRate}
+ };
+
+ /* sending a latency for a DOWN server doesn't make sense */
+ if (a->availability == DownstreamState::Availability::Down) {
+ server["latency"] = nullptr;
+ }
+
+ servers.push_back(std::move(server));
+}
+
+static void handleStats(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ handleCORS(req, resp);
+ resp.status = 200;
+
+ Json::array servers;
+ auto localServers = g_dstates.getLocal();
+ int num = 0;
+ for (const auto& a : *localServers) {
+ addServerToJSON(servers, num++, a);
+ }
+
+ Json::array frontends;
+ num = 0;
+ for(const auto& front : g_frontends) {
+ if (front->udpFD == -1 && front->tcpFD == -1)
+ continue;
+ Json::object frontend{
+ { "id", num++ },
+ { "address", front->local.toStringWithPort() },
+ { "udp", front->udpFD >= 0 },
+ { "tcp", front->tcpFD >= 0 },
+ { "type", front->getType() },
+ { "queries", (double) front->queries.load() },
+ { "responses", (double) front->responses.load() },
+ { "tcpDiedReadingQuery", (double) front->tcpDiedReadingQuery.load() },
+ { "tcpDiedSendingResponse", (double) front->tcpDiedSendingResponse.load() },
+ { "tcpGaveUp", (double) front->tcpGaveUp.load() },
+ { "tcpClientTimeouts", (double) front->tcpClientTimeouts },
+ { "tcpDownstreamTimeouts", (double) front->tcpDownstreamTimeouts },
+ { "tcpCurrentConnections", (double) front->tcpCurrentConnections },
+ { "tcpMaxConcurrentConnections", (double) front->tcpMaxConcurrentConnections },
+ { "tcpAvgQueriesPerConnection", (double) front->tcpAvgQueriesPerConnection },
+ { "tcpAvgConnectionDuration", (double) front->tcpAvgConnectionDuration },
+ { "tlsNewSessions", (double) front->tlsNewSessions },
+ { "tlsResumptions", (double) front->tlsResumptions },
+ { "tlsUnknownTicketKey", (double) front->tlsUnknownTicketKey },
+ { "tlsInactiveTicketKey", (double) front->tlsInactiveTicketKey },
+ { "tls10Queries", (double) front->tls10queries },
+ { "tls11Queries", (double) front->tls11queries },
+ { "tls12Queries", (double) front->tls12queries },
+ { "tls13Queries", (double) front->tls13queries },
+ { "tlsUnknownQueries", (double) front->tlsUnknownqueries },
+ };
+ const TLSErrorCounters* errorCounters = nullptr;
+ if (front->tlsFrontend != nullptr) {
+ errorCounters = &front->tlsFrontend->d_tlsCounters;
+ }
+ else if (front->dohFrontend != nullptr) {
+ errorCounters = &front->dohFrontend->d_tlsCounters;
+ }
+ if (errorCounters != nullptr) {
+ frontend["tlsHandshakeFailuresDHKeyTooSmall"] = (double)errorCounters->d_dhKeyTooSmall;
+ frontend["tlsHandshakeFailuresInappropriateFallBack"] = (double)errorCounters->d_inappropriateFallBack;
+ frontend["tlsHandshakeFailuresNoSharedCipher"] = (double)errorCounters->d_noSharedCipher;
+ frontend["tlsHandshakeFailuresUnknownCipher"] = (double)errorCounters->d_unknownCipherType;
+ frontend["tlsHandshakeFailuresUnknownKeyExchangeType"] = (double)errorCounters->d_unknownKeyExchangeType;
+ frontend["tlsHandshakeFailuresUnknownProtocol"] = (double)errorCounters->d_unknownProtocol;
+ frontend["tlsHandshakeFailuresUnsupportedEC"] = (double)errorCounters->d_unsupportedEC;
+ frontend["tlsHandshakeFailuresUnsupportedProtocol"] = (double)errorCounters->d_unsupportedProtocol;
+ }
+ frontends.push_back(frontend);
+ }
+
+ Json::array dohs;
+#ifdef HAVE_DNS_OVER_HTTPS
+ {
+ num = 0;
+ for(const auto& doh : g_dohlocals) {
+ Json::object obj{
+ { "id", num++ },
+ { "address", doh->d_local.toStringWithPort() },
+ { "http-connects", (double) doh->d_httpconnects },
+ { "http1-queries", (double) doh->d_http1Stats.d_nbQueries },
+ { "http2-queries", (double) doh->d_http2Stats.d_nbQueries },
+ { "http1-200-responses", (double) doh->d_http1Stats.d_nb200Responses },
+ { "http2-200-responses", (double) doh->d_http2Stats.d_nb200Responses },
+ { "http1-400-responses", (double) doh->d_http1Stats.d_nb400Responses },
+ { "http2-400-responses", (double) doh->d_http2Stats.d_nb400Responses },
+ { "http1-403-responses", (double) doh->d_http1Stats.d_nb403Responses },
+ { "http2-403-responses", (double) doh->d_http2Stats.d_nb403Responses },
+ { "http1-500-responses", (double) doh->d_http1Stats.d_nb500Responses },
+ { "http2-500-responses", (double) doh->d_http2Stats.d_nb500Responses },
+ { "http1-502-responses", (double) doh->d_http1Stats.d_nb502Responses },
+ { "http2-502-responses", (double) doh->d_http2Stats.d_nb502Responses },
+ { "http1-other-responses", (double) doh->d_http1Stats.d_nbOtherResponses },
+ { "http2-other-responses", (double) doh->d_http2Stats.d_nbOtherResponses },
+ { "get-queries", (double) doh->d_getqueries },
+ { "post-queries", (double) doh->d_postqueries },
+ { "bad-requests", (double) doh->d_badrequests },
+ { "error-responses", (double) doh->d_errorresponses },
+ { "redirect-responses", (double) doh->d_redirectresponses },
+ { "valid-responses", (double) doh->d_validresponses }
+ };
+ dohs.push_back(obj);
+ }
+ }
+#endif /* HAVE_DNS_OVER_HTTPS */
+
+ Json::array pools;
+ auto localPools = g_pools.getLocal();
+ num = 0;
+ for(const auto& pool : *localPools) {
+ const auto& cache = pool.second->packetCache;
+ Json::object entry {
+ { "id", num++ },
+ { "name", pool.first },
+ { "serversCount", (double) pool.second->countServers(false) },
+ { "cacheSize", (double) (cache ? cache->getMaxEntries() : 0) },
+ { "cacheEntries", (double) (cache ? cache->getEntriesCount() : 0) },
+ { "cacheHits", (double) (cache ? cache->getHits() : 0) },
+ { "cacheMisses", (double) (cache ? cache->getMisses() : 0) },
+ { "cacheDeferredInserts", (double) (cache ? cache->getDeferredInserts() : 0) },
+ { "cacheDeferredLookups", (double) (cache ? cache->getDeferredLookups() : 0) },
+ { "cacheLookupCollisions", (double) (cache ? cache->getLookupCollisions() : 0) },
+ { "cacheInsertCollisions", (double) (cache ? cache->getInsertCollisions() : 0) },
+ { "cacheTTLTooShorts", (double) (cache ? cache->getTTLTooShorts() : 0) }
+ };
+ pools.push_back(entry);
+ }
+
+ Json::array rules;
+ /* unfortunately DNSActions have getStats(),
+ and DNSResponseActions do not. */
+ auto localRules = g_ruleactions.getLocal();
+ num = 0;
+ for (const auto& a : *localRules) {
+ Json::object rule{
+ {"id", num++},
+ {"creationOrder", (double)a.d_creationOrder},
+ {"uuid", boost::uuids::to_string(a.d_id)},
+ {"matches", (double)a.d_rule->d_matches},
+ {"rule", a.d_rule->toString()},
+ {"action", a.d_action->toString()},
+ {"action-stats", a.d_action->getStats()}
+ };
+ rules.push_back(rule);
+ }
+
+ auto responseRules = someResponseRulesToJson(&g_respruleactions);
+ auto cacheHitResponseRules = someResponseRulesToJson(&g_cachehitrespruleactions);
+ auto selfAnsweredResponseRules = someResponseRulesToJson(&g_selfansweredrespruleactions);
+
+ string acl;
+
+ vector<string> vec;
+ g_ACL.getLocal()->toStringVector(&vec);
+
+ for(const auto& s : vec) {
+ if(!acl.empty()) acl += ", ";
+ acl+=s;
+ }
+ string localaddressesStr;
+ std::set<std::string> localaddresses;
+ for(const auto& front : g_frontends) {
+ localaddresses.insert(front->local.toStringWithPort());
+ }
+ for (const auto& addr : localaddresses) {
+ if (!localaddressesStr.empty()) {
+ localaddressesStr += ", ";
+ }
+ localaddressesStr += addr;
+ }
+
+ Json my_json = Json::object {
+ { "daemon_type", "dnsdist" },
+ { "version", VERSION},
+ { "servers", servers},
+ { "frontends", frontends },
+ { "pools", pools },
+ { "rules", rules},
+ { "response-rules", responseRules},
+ { "cache-hit-response-rules", cacheHitResponseRules},
+ { "self-answered-response-rules", selfAnsweredResponseRules},
+ { "acl", acl},
+ { "local", localaddressesStr},
+ { "dohFrontends", dohs }
+ };
+ resp.headers["Content-Type"] = "application/json";
+ resp.body = my_json.dump();
+}
+
+static void handlePoolStats(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ handleCORS(req, resp);
+ const auto poolName = req.getvars.find("name");
+ if (poolName == req.getvars.end()) {
+ resp.status = 400;
+ return;
+ }
+
+ resp.status = 200;
+ Json::array doc;
+
+ auto localPools = g_pools.getLocal();
+ const auto poolIt = localPools->find(poolName->second);
+ if (poolIt == localPools->end()) {
+ resp.status = 404;
+ return;
+ }
+
+ const auto& pool = poolIt->second;
+ const auto& cache = pool->packetCache;
+ Json::object entry {
+ { "name", poolName->second },
+ { "serversCount", (double) pool->countServers(false) },
+ { "cacheSize", (double) (cache ? cache->getMaxEntries() : 0) },
+ { "cacheEntries", (double) (cache ? cache->getEntriesCount() : 0) },
+ { "cacheHits", (double) (cache ? cache->getHits() : 0) },
+ { "cacheMisses", (double) (cache ? cache->getMisses() : 0) },
+ { "cacheDeferredInserts", (double) (cache ? cache->getDeferredInserts() : 0) },
+ { "cacheDeferredLookups", (double) (cache ? cache->getDeferredLookups() : 0) },
+ { "cacheLookupCollisions", (double) (cache ? cache->getLookupCollisions() : 0) },
+ { "cacheInsertCollisions", (double) (cache ? cache->getInsertCollisions() : 0) },
+ { "cacheTTLTooShorts", (double) (cache ? cache->getTTLTooShorts() : 0) }
+ };
+
+ Json::array servers;
+ int num = 0;
+ for (const auto& a : *pool->getServers()) {
+ addServerToJSON(servers, num, a.second);
+ num++;
+ }
+
+ resp.headers["Content-Type"] = "application/json";
+ Json my_json = Json::object {
+ { "stats", entry },
+ { "servers", servers }
+ };
+
+ resp.body = my_json.dump();
+}
+
+static void handleStatsOnly(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ handleCORS(req, resp);
+ resp.status = 200;
+
+ Json::array doc;
+ for(const auto& item : g_stats.entries) {
+ if (item.first == "special-memory-usage")
+ continue; // Too expensive for get-all
+
+ if(const auto& val = boost::get<pdns::stat_t*>(&item.second)) {
+ doc.push_back(Json::object {
+ { "type", "StatisticItem" },
+ { "name", item.first },
+ { "value", (double)(*val)->load() }
+ });
+ }
+ else if (const auto& dval = boost::get<double*>(&item.second)) {
+ doc.push_back(Json::object {
+ { "type", "StatisticItem" },
+ { "name", item.first },
+ { "value", (**dval) }
+ });
+ }
+ else {
+ doc.push_back(Json::object {
+ { "type", "StatisticItem" },
+ { "name", item.first },
+ { "value", (double)(*boost::get<DNSDistStats::statfunction_t>(&item.second))(item.first) }
+ });
+ }
+ }
+ Json my_json = doc;
+ resp.body = my_json.dump();
+ resp.headers["Content-Type"] = "application/json";
+}
+
+static void handleConfigDump(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ handleCORS(req, resp);
+ resp.status = 200;
+
+ Json::array doc;
+ typedef boost::variant<bool, double, std::string> configentry_t;
+ std::vector<std::pair<std::string, configentry_t> > configEntries {
+ { "acl", g_ACL.getLocal()->toString() },
+ { "allow-empty-response", g_allowEmptyResponse },
+ { "control-socket", g_serverControl.toStringWithPort() },
+ { "ecs-override", g_ECSOverride },
+ { "ecs-source-prefix-v4", (double) g_ECSSourcePrefixV4 },
+ { "ecs-source-prefix-v6", (double) g_ECSSourcePrefixV6 },
+ { "fixup-case", g_fixupCase },
+ { "max-outstanding", (double) g_maxOutstanding },
+ { "server-policy", g_policy.getLocal()->getName() },
+ { "stale-cache-entries-ttl", (double) g_staleCacheEntriesTTL },
+ { "tcp-recv-timeout", (double) g_tcpRecvTimeout },
+ { "tcp-send-timeout", (double) g_tcpSendTimeout },
+ { "truncate-tc", g_truncateTC },
+ { "verbose", g_verbose },
+ { "verbose-health-checks", g_verboseHealthChecks }
+ };
+ for(const auto& item : configEntries) {
+ if (const auto& bval = boost::get<bool>(&item.second)) {
+ doc.push_back(Json::object {
+ { "type", "ConfigSetting" },
+ { "name", item.first },
+ { "value", *bval }
+ });
+ }
+ else if (const auto& sval = boost::get<string>(&item.second)) {
+ doc.push_back(Json::object {
+ { "type", "ConfigSetting" },
+ { "name", item.first },
+ { "value", *sval }
+ });
+ }
+ else if (const auto& dval = boost::get<double>(&item.second)) {
+ doc.push_back(Json::object {
+ { "type", "ConfigSetting" },
+ { "name", item.first },
+ { "value", *dval }
+ });
+ }
+ }
+ Json my_json = doc;
+ resp.body = my_json.dump();
+ resp.headers["Content-Type"] = "application/json";
+}
+
+static void handleAllowFrom(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ handleCORS(req, resp);
+
+ resp.headers["Content-Type"] = "application/json";
+ resp.status = 200;
+
+ if (req.method == "PUT") {
+ std::string err;
+ Json doc = Json::parse(req.body, err);
+
+ if (!doc.is_null()) {
+ NetmaskGroup nmg;
+ auto aclList = doc["value"];
+ if (aclList.is_array()) {
+
+ for (auto value : aclList.array_items()) {
+ try {
+ nmg.addMask(value.string_value());
+ } catch (NetmaskException &e) {
+ resp.status = 400;
+ break;
+ }
+ }
+
+ if (resp.status == 200) {
+ infolog("Updating the ACL via the API to %s", nmg.toString());
+ g_ACL.setState(nmg);
+ apiSaveACL(nmg);
+ }
+ }
+ else {
+ resp.status = 400;
+ }
+ }
+ else {
+ resp.status = 400;
+ }
+ }
+ if (resp.status == 200) {
+ Json::array acl;
+ vector<string> vec;
+ g_ACL.getLocal()->toStringVector(&vec);
+
+ for(const auto& s : vec) {
+ acl.push_back(s);
+ }
+
+ Json::object obj{
+ { "type", "ConfigSetting" },
+ { "name", "allow-from" },
+ { "value", acl }
+ };
+ Json my_json = obj;
+ resp.body = my_json.dump();
+ }
+}
+
+static std::unordered_map<std::string, std::function<void(const YaHTTP::Request&, YaHTTP::Response&)>> s_webHandlers;
+
+void registerWebHandler(const std::string& endpoint, std::function<void(const YaHTTP::Request&, YaHTTP::Response&)> handler);
+
+void registerWebHandler(const std::string& endpoint, std::function<void(const YaHTTP::Request&, YaHTTP::Response&)> handler)
+{
+ s_webHandlers[endpoint] = handler;
+}
+
+void clearWebHandlers()
+{
+ s_webHandlers.clear();
+}
+
+static void redirectToIndex(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ const string charset = "; charset=utf-8";
+ resp.body.assign(s_urlmap.at("index.html"));
+ resp.headers["Content-Type"] = "text/html" + charset;
+ resp.status = 200;
+}
+
+static void handleBuiltInFiles(const YaHTTP::Request& req, YaHTTP::Response& resp)
+{
+ if (req.url.path.empty() || !s_urlmap.count(req.url.path.c_str()+1)) {
+ resp.status = 404;
+ return;
+ }
+
+ resp.body.assign(s_urlmap.at(req.url.path.c_str()+1));
+
+ vector<string> parts;
+ stringtok(parts, req.url.path, ".");
+ static const std::unordered_map<std::string, std::string> contentTypeMap = {
+ { "html", "text/html" },
+ { "css", "text/css" },
+ { "js", "application/javascript" },
+ { "png", "image/png" },
+ };
+
+ const auto& it = contentTypeMap.find(parts.back());
+ if (it != contentTypeMap.end()) {
+ const string charset = "; charset=utf-8";
+ resp.headers["Content-Type"] = it->second + charset;
+ }
+
+ resp.status = 200;
+}
+
+void registerBuiltInWebHandlers()
+{
+ registerWebHandler("/jsonstat", handleJSONStats);
+ registerWebHandler("/metrics", handlePrometheus);
+ registerWebHandler("/api/v1/servers/localhost", handleStats);
+ registerWebHandler("/api/v1/servers/localhost/pool", handlePoolStats);
+ registerWebHandler("/api/v1/servers/localhost/statistics", handleStatsOnly);
+ registerWebHandler("/api/v1/servers/localhost/config", handleConfigDump);
+ registerWebHandler("/api/v1/servers/localhost/config/allow-from", handleAllowFrom);
+ registerWebHandler("/", redirectToIndex);
+
+ for (const auto& path : s_urlmap) {
+ registerWebHandler("/" + path.first, handleBuiltInFiles);
+ }
+}
+
+static void connectionThread(WebClientConnection&& conn)
+{
+ setThreadName("dnsdist/webConn");
+
+ vinfolog("Webserver handling connection from %s", conn.getClient().toStringWithPort());
+
+ try {
+ YaHTTP::AsyncRequestLoader yarl;
+ YaHTTP::Request req;
+ bool finished = false;
+
+ yarl.initialize(&req);
+ while (!finished) {
+ int bytes;
+ char buf[1024];
+ bytes = read(conn.getSocket().getHandle(), buf, sizeof(buf));
+ if (bytes > 0) {
+ string data = string(buf, bytes);
+ finished = yarl.feed(data);
+ } else {
+ // read error OR EOF
+ break;
+ }
+ }
+ yarl.finalize();
+
+ req.getvars.erase("_"); // jQuery cache buster
+
+ YaHTTP::Response resp;
+ resp.version = req.version;
+
+ {
+ auto config = g_webserverConfig.lock();
+
+ addCustomHeaders(resp, config->customHeaders);
+ addSecurityHeaders(resp, config->customHeaders);
+ }
+ /* indicate that the connection will be closed after completion of the response */
+ resp.headers["Connection"] = "close";
+
+ /* no need to send back the API key if any */
+ resp.headers.erase("X-API-Key");
+
+ if (req.method == "OPTIONS") {
+ /* the OPTIONS method should not require auth, otherwise it breaks CORS */
+ handleCORS(req, resp);
+ resp.status = 200;
+ }
+ else if (!handleAuthorization(req)) {
+ YaHTTP::strstr_map_t::iterator header = req.headers.find("authorization");
+ if (header != req.headers.end()) {
+ errlog("HTTP Request \"%s\" from %s: Web Authentication failed", req.url.path, conn.getClient().toStringWithPort());
+ }
+ resp.status = 401;
+ resp.body = "<h1>Unauthorized</h1>";
+ resp.headers["WWW-Authenticate"] = "basic realm=\"PowerDNS\"";
+ }
+ else if (!isMethodAllowed(req)) {
+ resp.status = 405;
+ }
+ else {
+ const auto it = s_webHandlers.find(req.url.path);
+ if (it != s_webHandlers.end()) {
+ it->second(req, resp);
+ }
+ else {
+ resp.status = 404;
+ }
+ }
+
+ std::ostringstream ofs;
+ ofs << resp;
+ string done = ofs.str();
+ writen2(conn.getSocket().getHandle(), done.c_str(), done.size());
+ }
+ catch (const YaHTTP::ParseError& e) {
+ vinfolog("Webserver thread died with parse error exception while processing a request from %s: %s", conn.getClient().toStringWithPort(), e.what());
+ }
+ catch (const std::exception& e) {
+ errlog("Webserver thread died with exception while processing a request from %s: %s", conn.getClient().toStringWithPort(), e.what());
+ }
+ catch (...) {
+ errlog("Webserver thread died with exception while processing a request from %s", conn.getClient().toStringWithPort());
+ }
+}
+
+void setWebserverAPIKey(std::unique_ptr<CredentialsHolder>&& apiKey)
+{
+ auto config = g_webserverConfig.lock();
+
+ if (apiKey) {
+ config->apiKey = std::move(apiKey);
+ } else {
+ config->apiKey.reset();
+ }
+}
+
+void setWebserverPassword(std::unique_ptr<CredentialsHolder>&& password)
+{
+ g_webserverConfig.lock()->password = std::move(password);
+}
+
+void setWebserverACL(const std::string& acl)
+{
+ NetmaskGroup newACL;
+ newACL.toMasks(acl);
+
+ g_webserverConfig.lock()->acl = std::move(newACL);
+}
+
+void setWebserverCustomHeaders(const boost::optional<std::map<std::string, std::string> > customHeaders)
+{
+ g_webserverConfig.lock()->customHeaders = customHeaders;
+}
+
+void setWebserverStatsRequireAuthentication(bool require)
+{
+ g_webserverConfig.lock()->statsRequireAuthentication = require;
+}
+
+void setWebserverMaxConcurrentConnections(size_t max)
+{
+ s_connManager.setMaxConcurrentConnections(max);
+}
+
+void dnsdistWebserverThread(int sock, const ComboAddress& local)
+{
+ setThreadName("dnsdist/webserv");
+ warnlog("Webserver launched on %s", local.toStringWithPort());
+
+ if (!g_webserverConfig.lock()->password) {
+ warnlog("Webserver launched on %s without a password set!", local.toStringWithPort());
+ }
+
+ for(;;) {
+ try {
+ ComboAddress remote(local);
+ int fd = SAccept(sock, remote);
+
+ if (!isClientAllowedByACL(remote)) {
+ vinfolog("Connection to webserver from client %s is not allowed, closing", remote.toStringWithPort());
+ close(fd);
+ continue;
+ }
+
+ WebClientConnection conn(remote, fd);
+ vinfolog("Got a connection to the webserver from %s", remote.toStringWithPort());
+
+ std::thread t(connectionThread, std::move(conn));
+ t.detach();
+ }
+ catch (const std::exception& e) {
+ errlog("Had an error accepting new webserver connection: %s", e.what());
+ }
+ }
+}
diff --git a/dnsdist-web.hh b/dnsdist-web.hh
new file mode 100644
index 0000000..c119eee
--- /dev/null
+++ b/dnsdist-web.hh
@@ -0,0 +1,17 @@
+#pragma once
+
+#include "credentials.hh"
+
+void setWebserverAPIKey(std::unique_ptr<CredentialsHolder>&& apiKey);
+void setWebserverPassword(std::unique_ptr<CredentialsHolder>&& password);
+void setWebserverACL(const std::string& acl);
+void setWebserverCustomHeaders(const boost::optional<std::map<std::string, std::string> > customHeaders);
+void setWebserverStatsRequireAuthentication(bool);
+void setWebserverMaxConcurrentConnections(size_t);
+
+void dnsdistWebserverThread(int sock, const ComboAddress& local);
+
+void registerBuiltInWebHandlers();
+void clearWebHandlers();
+
+std::string getWebserverConfig();
diff --git a/dnsdist-xpf.cc b/dnsdist-xpf.cc
new file mode 100644
index 0000000..b02ad62
--- /dev/null
+++ b/dnsdist-xpf.cc
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "dnsdist-xpf.hh"
+
+#include "dnsparser.hh"
+#include "xpf.hh"
+
+bool addXPF(DNSQuestion& dq, uint16_t optionCode)
+{
+ std::string payload = generateXPFPayload(dq.overTCP(), *dq.remote, *dq.local);
+ uint8_t root = '\0';
+ dnsrecordheader drh;
+ drh.d_type = htons(optionCode);
+ drh.d_class = htons(QClass::IN);
+ drh.d_ttl = 0;
+ drh.d_clen = htons(payload.size());
+ size_t recordHeaderLen = sizeof(root) + sizeof(drh);
+
+ if (!dq.hasRoomFor(payload.size() + recordHeaderLen)) {
+ return false;
+ }
+
+ size_t xpfSize = sizeof(root) + sizeof(drh) + payload.size();
+ auto& data = dq.getMutableData();
+ uint32_t realPacketLen = getDNSPacketLength(reinterpret_cast<const char*>(data.data()), data.size());
+ data.resize(realPacketLen + xpfSize);
+
+ size_t pos = realPacketLen;
+ memcpy(reinterpret_cast<char*>(&data.at(pos)), &root, sizeof(root));
+ pos += sizeof(root);
+ memcpy(reinterpret_cast<char*>(&data.at(pos)), &drh, sizeof(drh));
+ pos += sizeof(drh);
+ memcpy(reinterpret_cast<char*>(&data.at(pos)), payload.data(), payload.size());
+ pos += payload.size();
+ (void) pos;
+
+ dq.getHeader()->arcount = htons(ntohs(dq.getHeader()->arcount) + 1);
+
+ return true;
+}
diff --git a/dnsdist-xpf.hh b/dnsdist-xpf.hh
new file mode 100644
index 0000000..2e66f65
--- /dev/null
+++ b/dnsdist-xpf.hh
@@ -0,0 +1,27 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include "dnsdist.hh"
+
+bool addXPF(DNSQuestion& dq, uint16_t optionCode);
+
diff --git a/dnsdist.1 b/dnsdist.1
new file mode 100644
index 0000000..069bff7
--- /dev/null
+++ b/dnsdist.1
@@ -0,0 +1,143 @@
+.\" Man page generated from reStructuredText.
+.
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.TH "DNSDIST" "1" "Nov 01, 2022" "" "dnsdist"
+.SH NAME
+dnsdist \- A DNS and DoS aware, scriptable loadbalancer
+.SH SYNOPSIS
+.sp
+dnsdist [<option>...] [address]...
+.SH DESCRIPTION
+.sp
+\fBdnsdist\fP receives DNS queries and relays them to one or more
+downstream servers. It subsequently sends back responses to the original
+requestor.
+.sp
+\fBdnsdist\fP operates over TCP and UDP, and strives to deliver very high
+performance over both.
+.sp
+Currently, queries are sent to the downstream server with the least
+outstanding queries. This effectively implies load balancing, making
+sure that slower servers get less queries.
+.sp
+If a reply has not come in after a few seconds, it is removed from the
+queue, but in the short term, timeouts do cause a server to get less
+traffic.
+.sp
+IPv4 and IPv6 operation can be mixed and matched, in other words,
+queries coming in over IPv6 could be forwarded to IPv4 and vice versa.
+.sp
+\fBdnsdist\fP is scriptable in Lua, see the dnsdist documentation for more
+information on this.
+.SH SCOPE
+.sp
+\fBdnsdist\fP does not \(aqthink\(aq about DNS queries, it restricts itself to
+measuring response times and error codes and routing questions
+accordingly. It comes with a very high performance packet\-cache.
+.sp
+The goal for dnsdist is to remain simple. If more powerful loadbalancing
+is required, dedicated hardware or software is recommended. Linux
+Virtual Server for example is often mentioned.
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.BI \-a \ <netmask>\fR,\fB \ \-\-acl \ <netmask>
+Add \fInetmask\fP to the ACL.
+.TP
+.BI \-C \ <file>\fR,\fB \ \-\-config \ <file>
+Load configuration from \fIfile\fP\&.
+.TP
+.B \-\-check\-config
+Test the configuration file (which may be set with \fB\-\-config\fP or \fB\-C\fP)
+for errors. dnsdist will show the errors and exit with a non\-zero
+exit\-code when errors are found.
+.TP
+.BI \-c \ <address>\fR,\fB \ \-\-client \ <address>
+Operate as a client, connect to dnsdist. This will read the dnsdist
+configuration for the \fBcontrolSocket\fP statement and connect to it.
+When \fIaddress\fP (with an optional port number) is set, dnsdist will connect
+to that instead.
+.TP
+.BI \-k \ <key>\fR,\fB \ \-\-setkey \ <key>
+When operating as a client(\fB\-c\fP, \fB\-\-client\fP), use \fIkey\fP as
+shared secret to connect to dnsdist. This should be the same key
+that is used on the server (set with \fBsetKey()\fP). Note that this
+will leak the key into your shell\(aqs history and into the systems
+running process list. Only available when dnsdist is compiled with
+libsodium support.
+.TP
+.BI \-e\fP,\fB \-\-execute \ <command>
+Connect to dnsdist and execute \fIcommand\fP\&.
+.TP
+.B \-h\fP,\fB \-\-help
+Display a helpful message and exit.
+.TP
+.BI \-l\fP,\fB \-\-local \ <address>
+Bind to \fIaddress\fP, Supply as many addresses (using multiple
+\fB\-\-local\fP statements) to listen on as required. Specify IPv4 as
+0.0.0.0:53 and IPv6 as [::]:53.
+.TP
+.B \-\-supervised
+Run in foreground, but do not spawn a console. Use this switch to
+run dnsdist inside a supervisor (use with e.g. systemd and
+daemontools).
+.TP
+.B \-\-disable\-syslog
+Disable logging to syslog. Use this when running inside a supervisor
+that handles logging (like systemd).
+.TP
+.BI \-u\fP,\fB \-\-uid \ <uid>
+Change the process user to \fIuid\fP after binding sockets. \fIuid\fP can be
+a name or number.
+.TP
+.BI \-g\fP,\fB \-\-gid \ <gid>
+Change the process group to \fIgid\fP after binding sockets. \fIgid\fP Can
+be a name or number.
+.TP
+.B \-V\fP,\fB \-\-version
+Show the dnsdist version and exit.
+.TP
+.B \-v\fP,\fB \-\-verbose
+Be verbose.
+.UNINDENT
+.sp
+\fBaddress\fP are any number of downstream DNS servers, in the same syntax as used
+with \fB\-\-local\fP\&. If the port is not specified, 53 is used.
+.SH BUGS
+.sp
+Right now, the TCP support has some rather arbitrary limits.
+.SH RESOURCES
+.sp
+Website: \fI\%https://dnsdist.org\fP
+.SH AUTHOR
+PowerDNS.COM BV and its contributors
+.SH COPYRIGHT
+2015-2022, PowerDNS.COM BV and its contributors
+.\" Generated by docutils manpage writer.
+.
diff --git a/dnsdist.cc b/dnsdist.cc
new file mode 100644
index 0000000..062b03b
--- /dev/null
+++ b/dnsdist.cc
@@ -0,0 +1,2752 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "config.h"
+
+#include <fstream>
+#include <getopt.h>
+#include <grp.h>
+#include <limits>
+#include <netinet/tcp.h>
+#include <pwd.h>
+#include <sys/resource.h>
+#include <unistd.h>
+
+#if defined (__OpenBSD__) || defined(__NetBSD__)
+// If this is not undeffed, __attribute__ wil be redefined by /usr/include/readline/rlstdc.h
+#undef __STRICT_ANSI__
+#include <readline/readline.h>
+#else
+#include <editline/readline.h>
+#endif
+
+#include "dnsdist-systemd.hh"
+#ifdef HAVE_SYSTEMD
+#include <systemd/sd-daemon.h>
+#endif
+
+#include "dnsdist.hh"
+#include "dnsdist-cache.hh"
+#include "dnsdist-console.hh"
+#include "dnsdist-dynblocks.hh"
+#include "dnsdist-ecs.hh"
+#include "dnsdist-healthchecks.hh"
+#include "dnsdist-lua.hh"
+#include "dnsdist-nghttp2.hh"
+#include "dnsdist-proxy-protocol.hh"
+#include "dnsdist-rings.hh"
+#include "dnsdist-secpoll.hh"
+#include "dnsdist-tcp.hh"
+#include "dnsdist-web.hh"
+#include "dnsdist-xpf.hh"
+
+#include "base64.hh"
+#include "delaypipe.hh"
+#include "dolog.hh"
+#include "dnsname.hh"
+#include "dnsparser.hh"
+#include "ednsoptions.hh"
+#include "gettime.hh"
+#include "lock.hh"
+#include "misc.hh"
+#include "sodcrypto.hh"
+#include "sstuff.hh"
+#include "threadname.hh"
+
+/* Known sins:
+
+ Receiver is currently single threaded
+ not *that* bad actually, but now that we are thread safe, might want to scale
+*/
+
+/* the RuleAction plan
+ Set of Rules, if one matches, it leads to an Action
+ Both rules and actions could conceivably be Lua based.
+ On the C++ side, both could be inherited from a class Rule and a class Action,
+ on the Lua side we can't do that. */
+
+using std::thread;
+bool g_verbose;
+
+struct DNSDistStats g_stats;
+
+uint16_t g_maxOutstanding{std::numeric_limits<uint16_t>::max()};
+uint32_t g_staleCacheEntriesTTL{0};
+bool g_syslog{true};
+bool g_allowEmptyResponse{false};
+
+GlobalStateHolder<NetmaskGroup> g_ACL;
+string g_outputBuffer;
+
+std::vector<std::shared_ptr<TLSFrontend>> g_tlslocals;
+std::vector<std::shared_ptr<DOHFrontend>> g_dohlocals;
+std::vector<std::shared_ptr<DNSCryptContext>> g_dnsCryptLocals;
+
+shared_ptr<BPFFilter> g_defaultBPFFilter{nullptr};
+std::vector<std::shared_ptr<DynBPFFilter> > g_dynBPFFilters;
+
+std::vector<std::unique_ptr<ClientState>> g_frontends;
+GlobalStateHolder<pools_t> g_pools;
+size_t g_udpVectorSize{1};
+
+/* UDP: the grand design. Per socket we listen on for incoming queries there is one thread.
+ Then we have a bunch of connected sockets for talking to downstream servers.
+ We send directly to those sockets.
+
+ For the return path, per downstream server we have a thread that listens to responses.
+
+ Per socket there is an array of 2^16 states, when we send out a packet downstream, we note
+ there the original requestor and the original id. The new ID is the offset in the array.
+
+ When an answer comes in on a socket, we look up the offset by the id, and lob it to the
+ original requestor.
+
+ IDs are assigned by atomic increments of the socket offset.
+ */
+
+GlobalStateHolder<vector<DNSDistRuleAction> > g_ruleactions;
+GlobalStateHolder<vector<DNSDistResponseRuleAction> > g_respruleactions;
+GlobalStateHolder<vector<DNSDistResponseRuleAction> > g_cachehitrespruleactions;
+GlobalStateHolder<vector<DNSDistResponseRuleAction> > g_selfansweredrespruleactions;
+
+Rings g_rings;
+QueryCount g_qcount;
+
+GlobalStateHolder<servers_t> g_dstates;
+int g_udpTimeout{2};
+bool g_servFailOnNoPolicy{false};
+bool g_truncateTC{false};
+bool g_fixupCase{false};
+bool g_dropEmptyQueries{false};
+uint32_t g_socketUDPSendBuffer{0};
+uint32_t g_socketUDPRecvBuffer{0};
+
+std::set<std::string> g_capabilitiesToRetain;
+
+static size_t const s_initialUDPPacketBufferSize = s_maxPacketCacheEntrySize + DNSCRYPT_MAX_RESPONSE_PADDING_AND_MAC_SIZE;
+static_assert(s_initialUDPPacketBufferSize <= UINT16_MAX, "Packet size should fit in a uint16_t");
+
+static void truncateTC(PacketBuffer& packet, size_t maximumSize, unsigned int qnameWireLength)
+{
+ try
+ {
+ bool hadEDNS = false;
+ uint16_t payloadSize = 0;
+ uint16_t z = 0;
+
+ if (g_addEDNSToSelfGeneratedResponses) {
+ hadEDNS = getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(packet.data()), packet.size(), &payloadSize, &z);
+ }
+
+ packet.resize(static_cast<uint16_t>(sizeof(dnsheader)+qnameWireLength+DNS_TYPE_SIZE+DNS_CLASS_SIZE));
+ struct dnsheader* dh = reinterpret_cast<struct dnsheader*>(packet.data());
+ dh->ancount = dh->arcount = dh->nscount = 0;
+
+ if (hadEDNS) {
+ addEDNS(packet, maximumSize, z & EDNS_HEADER_FLAG_DO, payloadSize, 0);
+ }
+ }
+ catch(...)
+ {
+ ++g_stats.truncFail;
+ }
+}
+
+struct DelayedPacket
+{
+ int fd;
+ PacketBuffer packet;
+ ComboAddress destination;
+ ComboAddress origDest;
+ void operator()()
+ {
+ ssize_t res;
+ if(origDest.sin4.sin_family == 0) {
+ res = sendto(fd, packet.data(), packet.size(), 0, (struct sockaddr*)&destination, destination.getSocklen());
+ }
+ else {
+ res = sendfromto(fd, packet.data(), packet.size(), 0, origDest, destination);
+ }
+ if (res == -1) {
+ int err = errno;
+ vinfolog("Error sending delayed response to %s: %s", destination.toStringWithPort(), strerror(err));
+ }
+ }
+};
+
+DelayPipe<DelayedPacket>* g_delay = nullptr;
+
+std::string DNSQuestion::getTrailingData() const
+{
+ const char* message = reinterpret_cast<const char*>(this->getHeader());
+ const uint16_t messageLen = getDNSPacketLength(message, this->data.size());
+ return std::string(message + messageLen, this->getData().size() - messageLen);
+}
+
+bool DNSQuestion::setTrailingData(const std::string& tail)
+{
+ const char* message = reinterpret_cast<const char*>(this->data.data());
+ const uint16_t messageLen = getDNSPacketLength(message, this->data.size());
+ this->data.resize(messageLen);
+ if (tail.size() > 0) {
+ if (!hasRoomFor(tail.size())) {
+ return false;
+ }
+ this->data.insert(this->data.end(), tail.begin(), tail.end());
+ }
+ return true;
+}
+
+void doLatencyStats(double udiff)
+{
+ if(udiff < 1000) ++g_stats.latency0_1;
+ else if(udiff < 10000) ++g_stats.latency1_10;
+ else if(udiff < 50000) ++g_stats.latency10_50;
+ else if(udiff < 100000) ++g_stats.latency50_100;
+ else if(udiff < 1000000) ++g_stats.latency100_1000;
+ else ++g_stats.latencySlow;
+ g_stats.latencySum += udiff / 1000;
+ ++g_stats.latencyCount;
+
+ auto doAvg = [](double& var, double n, double weight) {
+ var = (weight -1) * var/weight + n/weight;
+ };
+
+ doAvg(g_stats.latencyAvg100, udiff, 100);
+ doAvg(g_stats.latencyAvg1000, udiff, 1000);
+ doAvg(g_stats.latencyAvg10000, udiff, 10000);
+ doAvg(g_stats.latencyAvg1000000, udiff, 1000000);
+}
+
+bool responseContentMatches(const PacketBuffer& response, const DNSName& qname, const uint16_t qtype, const uint16_t qclass, const ComboAddress& remote, unsigned int& qnameWireLength)
+{
+ if (response.size() < sizeof(dnsheader)) {
+ return false;
+ }
+
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(response.data());
+ if (dh->qr == 0) {
+ ++g_stats.nonCompliantResponses;
+ return false;
+ }
+
+ if (dh->qdcount == 0) {
+ if ((dh->rcode != RCode::NoError && dh->rcode != RCode::NXDomain) || g_allowEmptyResponse) {
+ return true;
+ }
+ else {
+ ++g_stats.nonCompliantResponses;
+ return false;
+ }
+ }
+
+ uint16_t rqtype, rqclass;
+ DNSName rqname;
+ try {
+ rqname = DNSName(reinterpret_cast<const char*>(response.data()), response.size(), sizeof(dnsheader), false, &rqtype, &rqclass, &qnameWireLength);
+ }
+ catch (const std::exception& e) {
+ if(response.size() > 0 && static_cast<size_t>(response.size()) > sizeof(dnsheader)) {
+ infolog("Backend %s sent us a response with id %d that did not parse: %s", remote.toStringWithPort(), ntohs(dh->id), e.what());
+ }
+ ++g_stats.nonCompliantResponses;
+ return false;
+ }
+
+ if (rqtype != qtype || rqclass != qclass || rqname != qname) {
+ return false;
+ }
+
+ return true;
+}
+
+static void restoreFlags(struct dnsheader* dh, uint16_t origFlags)
+{
+ static const uint16_t rdMask = 1 << FLAGS_RD_OFFSET;
+ static const uint16_t cdMask = 1 << FLAGS_CD_OFFSET;
+ static const uint16_t restoreFlagsMask = UINT16_MAX & ~(rdMask | cdMask);
+ uint16_t* flags = getFlagsFromDNSHeader(dh);
+ /* clear the flags we are about to restore */
+ *flags &= restoreFlagsMask;
+ /* only keep the flags we want to restore */
+ origFlags &= ~restoreFlagsMask;
+ /* set the saved flags as they were */
+ *flags |= origFlags;
+}
+
+static bool fixUpQueryTurnedResponse(DNSQuestion& dq, const uint16_t origFlags)
+{
+ restoreFlags(dq.getHeader(), origFlags);
+
+ return addEDNSToQueryTurnedResponse(dq);
+}
+
+static bool fixUpResponse(PacketBuffer& response, const DNSName& qname, uint16_t origFlags, bool ednsAdded, bool ecsAdded, bool* zeroScope)
+{
+ if (response.size() < sizeof(dnsheader)) {
+ return false;
+ }
+
+ struct dnsheader* dh = reinterpret_cast<struct dnsheader*>(response.data());
+ restoreFlags(dh, origFlags);
+
+ if (response.size() == sizeof(dnsheader)) {
+ return true;
+ }
+
+ if (g_fixupCase) {
+ const auto& realname = qname.getStorage();
+ if (response.size() >= (sizeof(dnsheader) + realname.length())) {
+ memcpy(&response.at(sizeof(dnsheader)), realname.c_str(), realname.length());
+ }
+ }
+
+ if (ednsAdded || ecsAdded) {
+ uint16_t optStart;
+ size_t optLen = 0;
+ bool last = false;
+
+ int res = locateEDNSOptRR(response, &optStart, &optLen, &last);
+
+ if (res == 0) {
+ if (zeroScope) { // this finds if an EDNS Client Subnet scope was set, and if it is 0
+ size_t optContentStart = 0;
+ uint16_t optContentLen = 0;
+ /* we need at least 4 bytes after the option length (family: 2, source prefix-length: 1, scope prefix-length: 1) */
+ if (isEDNSOptionInOpt(response, optStart, optLen, EDNSOptionCode::ECS, &optContentStart, &optContentLen) && optContentLen >= 4) {
+ /* see if the EDNS Client Subnet SCOPE PREFIX-LENGTH byte in position 3 is set to 0, which is the only thing
+ we care about. */
+ *zeroScope = response.at(optContentStart + 3) == 0;
+ }
+ }
+
+ if (ednsAdded) {
+ /* we added the entire OPT RR,
+ therefore we need to remove it entirely */
+ if (last) {
+ /* simply remove the last AR */
+ response.resize(response.size() - optLen);
+ dh = reinterpret_cast<struct dnsheader*>(response.data());
+ uint16_t arcount = ntohs(dh->arcount);
+ arcount--;
+ dh->arcount = htons(arcount);
+ }
+ else {
+ /* Removing an intermediary RR could lead to compression error */
+ PacketBuffer rewrittenResponse;
+ if (rewriteResponseWithoutEDNS(response, rewrittenResponse) == 0) {
+ response = std::move(rewrittenResponse);
+ }
+ else {
+ warnlog("Error rewriting content");
+ }
+ }
+ }
+ else {
+ /* the OPT RR was already present, but without ECS,
+ we need to remove the ECS option if any */
+ if (last) {
+ /* nothing after the OPT RR, we can simply remove the
+ ECS option */
+ size_t existingOptLen = optLen;
+ removeEDNSOptionFromOPT(reinterpret_cast<char*>(&response.at(optStart)), &optLen, EDNSOptionCode::ECS);
+ response.resize(response.size() - (existingOptLen - optLen));
+ }
+ else {
+ PacketBuffer rewrittenResponse;
+ /* Removing an intermediary RR could lead to compression error */
+ if (rewriteResponseWithoutEDNSOption(response, EDNSOptionCode::ECS, rewrittenResponse) == 0) {
+ response = std::move(rewrittenResponse);
+ }
+ else {
+ warnlog("Error rewriting content");
+ }
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+#ifdef HAVE_DNSCRYPT
+static bool encryptResponse(PacketBuffer& response, size_t maximumSize, bool tcp, std::unique_ptr<DNSCryptQuery>& dnsCryptQuery)
+{
+ if (dnsCryptQuery) {
+ int res = dnsCryptQuery->encryptResponse(response, maximumSize, tcp);
+ if (res != 0) {
+ /* dropping response */
+ vinfolog("Error encrypting the response, dropping.");
+ return false;
+ }
+ }
+ return true;
+}
+#endif /* HAVE_DNSCRYPT */
+
+static bool applyRulesToResponse(LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr)
+{
+ DNSResponseAction::Action action=DNSResponseAction::Action::None;
+ std::string ruleresult;
+ for(const auto& lr : *localRespRuleActions) {
+ if(lr.d_rule->matches(&dr)) {
+ lr.d_rule->d_matches++;
+ action=(*lr.d_action)(&dr, &ruleresult);
+ switch(action) {
+ case DNSResponseAction::Action::Allow:
+ return true;
+ break;
+ case DNSResponseAction::Action::Drop:
+ return false;
+ break;
+ case DNSResponseAction::Action::HeaderModify:
+ return true;
+ break;
+ case DNSResponseAction::Action::ServFail:
+ dr.getHeader()->rcode = RCode::ServFail;
+ return true;
+ break;
+ /* non-terminal actions follow */
+ case DNSResponseAction::Action::Delay:
+ dr.delayMsec = static_cast<int>(pdns_stou(ruleresult)); // sorry
+ break;
+ case DNSResponseAction::Action::None:
+ break;
+ }
+ }
+ }
+
+ return true;
+}
+
+// whether the query was received over TCP or not (for rules, dnstap, protobuf, ...) will be taken from the DNSResponse, but receivedOverUDP is used to insert into the cache,
+// so that answers received over UDP for DoH are still cached with UDP answers.
+bool processResponse(PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted, bool receivedOverUDP)
+{
+ if (!applyRulesToResponse(localRespRuleActions, dr)) {
+ return false;
+ }
+
+ bool zeroScope = false;
+ if (!fixUpResponse(response, *dr.qname, dr.origFlags, dr.ednsAdded, dr.ecsAdded, dr.useZeroScope ? &zeroScope : nullptr)) {
+ return false;
+ }
+
+ if (dr.packetCache && !dr.skipCache && response.size() <= s_maxPacketCacheEntrySize) {
+ if (!dr.useZeroScope) {
+ /* if the query was not suitable for zero-scope, for
+ example because it had an existing ECS entry so the hash is
+ not really 'no ECS', so just insert it for the existing subnet
+ since:
+ - we don't have the correct hash for a non-ECS query
+ - inserting with hash computed before the ECS replacement but with
+ the subnet extracted _after_ the replacement would not work.
+ */
+ zeroScope = false;
+ }
+ uint32_t cacheKey = dr.cacheKey;
+ if (dr.protocol == dnsdist::Protocol::DoH && receivedOverUDP) {
+ cacheKey = dr.cacheKeyUDP;
+ }
+ else if (zeroScope) {
+ // if zeroScope, pass the pre-ECS hash-key and do not pass the subnet to the cache
+ cacheKey = dr.cacheKeyNoECS;
+ }
+
+ dr.packetCache->insert(cacheKey, zeroScope ? boost::none : dr.subnet, dr.cacheFlags, dr.dnssecOK, *dr.qname, dr.qtype, dr.qclass, response, receivedOverUDP, dr.getHeader()->rcode, dr.tempFailureTTL);
+ }
+
+#ifdef HAVE_DNSCRYPT
+ if (!muted) {
+ if (!encryptResponse(response, dr.getMaximumSize(), dr.overTCP(), dr.dnsCryptQuery)) {
+ return false;
+ }
+ }
+#endif /* HAVE_DNSCRYPT */
+
+ return true;
+}
+
+static size_t getInitialUDPPacketBufferSize()
+{
+ static_assert(s_udpIncomingBufferSize <= s_initialUDPPacketBufferSize, "The incoming buffer size should not be larger than s_initialUDPPacketBufferSize");
+
+ if (g_proxyProtocolACL.empty()) {
+ return s_initialUDPPacketBufferSize;
+ }
+
+ return s_initialUDPPacketBufferSize + g_proxyProtocolMaximumSize;
+}
+
+static size_t getMaximumIncomingPacketSize(const ClientState& cs)
+{
+ if (cs.dnscryptCtx) {
+ return getInitialUDPPacketBufferSize();
+ }
+
+ if (g_proxyProtocolACL.empty()) {
+ return s_udpIncomingBufferSize;
+ }
+
+ return s_udpIncomingBufferSize + g_proxyProtocolMaximumSize;
+}
+
+static bool sendUDPResponse(int origFD, const PacketBuffer& response, const int delayMsec, const ComboAddress& origDest, const ComboAddress& origRemote)
+{
+ if(delayMsec && g_delay) {
+ DelayedPacket dp{origFD, response, origRemote, origDest};
+ g_delay->submit(dp, delayMsec);
+ }
+ else {
+ ssize_t res;
+ if (origDest.sin4.sin_family == 0) {
+ res = sendto(origFD, response.data(), response.size(), 0, reinterpret_cast<const struct sockaddr*>(&origRemote), origRemote.getSocklen());
+ }
+ else {
+ res = sendfromto(origFD, response.data(), response.size(), 0, origDest, origRemote);
+ }
+ if (res == -1) {
+ int err = errno;
+ vinfolog("Error sending response to %s: %s", origRemote.toStringWithPort(), stringerror(err));
+ }
+ }
+
+ return true;
+}
+
+int pickBackendSocketForSending(std::shared_ptr<DownstreamState>& state)
+{
+ return state->sockets[state->socketsOffset++ % state->sockets.size()];
+}
+
+static void pickBackendSocketsReadyForReceiving(const std::shared_ptr<DownstreamState>& state, std::vector<int>& ready)
+{
+ ready.clear();
+
+ if (state->sockets.size() == 1) {
+ ready.push_back(state->sockets[0]);
+ return ;
+ }
+
+ (*state->mplexer.lock())->getAvailableFDs(ready, 1000);
+}
+
+void handleResponseSent(const IDState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol protocol)
+{
+ struct timespec ts;
+ gettime(&ts);
+ g_rings.insertResponse(ts, client, ids.qname, ids.qtype, static_cast<unsigned int>(udiff), size, cleartextDH, backend, protocol);
+
+ switch (cleartextDH.rcode) {
+ case RCode::NXDomain:
+ ++g_stats.frontendNXDomain;
+ break;
+ case RCode::ServFail:
+ ++g_stats.servfailResponses;
+ ++g_stats.frontendServFail;
+ break;
+ case RCode::NoError:
+ ++g_stats.frontendNoError;
+ break;
+ }
+}
+
+// listens on a dedicated socket, lobs answers from downstream servers to original requestors
+void responderThread(std::shared_ptr<DownstreamState> dss)
+{
+ try {
+ setThreadName("dnsdist/respond");
+ auto localRespRuleActions = g_respruleactions.getLocal();
+ const size_t initialBufferSize = getInitialUDPPacketBufferSize();
+ PacketBuffer response(initialBufferSize);
+
+ /* when the answer is encrypted in place, we need to get a copy
+ of the original header before encryption to fill the ring buffer */
+ dnsheader cleartextDH;
+ uint16_t queryId = 0;
+ std::vector<int> sockets;
+ sockets.reserve(dss->sockets.size());
+
+ for(;;) {
+ try {
+ pickBackendSocketsReadyForReceiving(dss, sockets);
+ if (dss->isStopped()) {
+ break;
+ }
+
+ for (const auto& fd : sockets) {
+ response.resize(initialBufferSize);
+ ssize_t got = recv(fd, response.data(), response.size(), 0);
+
+ if (got == 0 && dss->isStopped()) {
+ break;
+ }
+
+ if (got < 0 || static_cast<size_t>(got) < sizeof(dnsheader)) {
+ continue;
+ }
+
+ response.resize(static_cast<size_t>(got));
+ dnsheader* dh = reinterpret_cast<struct dnsheader*>(response.data());
+ queryId = dh->id;
+
+ if (queryId >= dss->idStates.size()) {
+ continue;
+ }
+
+ IDState* ids = &dss->idStates[queryId];
+ int64_t usageIndicator = ids->usageIndicator;
+
+ if (!IDState::isInUse(usageIndicator)) {
+ /* the corresponding state is marked as not in use, meaning that:
+ - it was already cleaned up by another thread and the state is gone ;
+ - we already got a response for this query and this one is a duplicate.
+ Either way, we don't touch it.
+ */
+ continue;
+ }
+
+ /* read the potential DOHUnit state as soon as possible, but don't use it
+ until we have confirmed that we own this state by updating usageIndicator */
+ auto du = DOHUnitUniquePtr(ids->du, DOHUnit::release);
+ /* setting age to 0 to prevent the maintainer thread from
+ cleaning this IDS while we process the response.
+ */
+ ids->age = 0;
+ int origFD = ids->origFD;
+
+ unsigned int qnameWireLength = 0;
+ if (!responseContentMatches(response, ids->qname, ids->qtype, ids->qclass, dss->remote, qnameWireLength)) {
+ continue;
+ }
+
+ /* atomically mark the state as available, but only if it has not been altered
+ in the meantime */
+ if (ids->tryMarkUnused(usageIndicator)) {
+ /* clear the potential DOHUnit asap, it's ours now
+ and since we just marked the state as unused,
+ someone could overwrite it. */
+ ids->du = nullptr;
+ /* we only decrement the outstanding counter if the value was not
+ altered in the meantime, which would mean that the state has been actively reused
+ and the other thread has not incremented the outstanding counter, so we don't
+ want it to be decremented twice. */
+ --dss->outstanding; // you'd think an attacker could game this, but we're using connected socket
+ } else {
+ /* someone updated the state in the meantime, we can't touch the existing pointer */
+ du.release();
+ /* since the state has been updated, we can't safely access it so let's just drop
+ this response */
+ continue;
+ }
+
+ dh->id = ids->origID;
+ ++dss->responses;
+
+ /* don't call processResponse for DOH */
+ if (du) {
+#ifdef HAVE_DNS_OVER_HTTPS
+ // DoH query, we cannot touch du after that
+ handleUDPResponseForDoH(std::move(du), std::move(response), std::move(*ids));
+#endif
+ continue;
+ }
+
+ DNSResponse dr = makeDNSResponseFromIDState(*ids, response);
+ if (dh->tc && g_truncateTC) {
+ truncateTC(response, dr.getMaximumSize(), qnameWireLength);
+ }
+ memcpy(&cleartextDH, dr.getHeader(), sizeof(cleartextDH));
+
+ if (!processResponse(response, localRespRuleActions, dr, ids->cs && ids->cs->muted, true)) {
+ continue;
+ }
+
+ ++g_stats.responses;
+ if (ids->cs) {
+ ++ids->cs->responses;
+ }
+
+ if (ids->cs && !ids->cs->muted) {
+ ComboAddress empty;
+ empty.sin4.sin_family = 0;
+ sendUDPResponse(origFD, response, dr.delayMsec, ids->hopLocal, ids->hopRemote);
+ }
+
+ double udiff = ids->sentTime.udiff();
+ vinfolog("Got answer from %s, relayed to %s, took %f usec", dss->remote.toStringWithPort(), ids->origRemote.toStringWithPort(), udiff);
+
+ handleResponseSent(*ids, udiff, *dr.remote, dss->remote, static_cast<unsigned int>(got), cleartextDH, dss->getProtocol());
+
+ dss->latencyUsec = (127.0 * dss->latencyUsec / 128.0) + udiff/128.0;
+
+ doLatencyStats(udiff);
+ }
+ }
+ catch (const std::exception& e){
+ vinfolog("Got an error in UDP responder thread while parsing a response from %s, id %d: %s", dss->remote.toStringWithPort(), queryId, e.what());
+ }
+ }
+}
+catch (const std::exception& e)
+{
+ errlog("UDP responder thread died because of exception: %s", e.what());
+}
+catch (const PDNSException& e)
+{
+ errlog("UDP responder thread died because of PowerDNS exception: %s", e.reason);
+}
+catch (...)
+{
+ errlog("UDP responder thread died because of an exception: %s", "unknown");
+}
+}
+
+LockGuarded<LuaContext> g_lua{LuaContext()};
+ComboAddress g_serverControl{"127.0.0.1:5199"};
+
+
+static void spoofResponseFromString(DNSQuestion& dq, const string& spoofContent, bool raw)
+{
+ string result;
+
+ if (raw) {
+ std::vector<std::string> raws;
+ stringtok(raws, spoofContent, ",");
+ SpoofAction sa(raws);
+ sa(&dq, &result);
+ }
+ else {
+ std::vector<std::string> addrs;
+ stringtok(addrs, spoofContent, " ,");
+
+ if (addrs.size() == 1) {
+ try {
+ ComboAddress spoofAddr(spoofContent);
+ SpoofAction sa({spoofAddr});
+ sa(&dq, &result);
+ }
+ catch(const PDNSException &e) {
+ DNSName cname(spoofContent);
+ SpoofAction sa(cname); // CNAME then
+ sa(&dq, &result);
+ }
+ } else {
+ std::vector<ComboAddress> cas;
+ for (const auto& addr : addrs) {
+ try {
+ cas.push_back(ComboAddress(addr));
+ }
+ catch (...) {
+ }
+ }
+ SpoofAction sa(cas);
+ sa(&dq, &result);
+ }
+ }
+}
+
+bool processRulesResult(const DNSAction::Action& action, DNSQuestion& dq, std::string& ruleresult, bool& drop)
+{
+ switch(action) {
+ case DNSAction::Action::Allow:
+ return true;
+ break;
+ case DNSAction::Action::Drop:
+ ++g_stats.ruleDrop;
+ drop = true;
+ return true;
+ break;
+ case DNSAction::Action::Nxdomain:
+ dq.getHeader()->rcode = RCode::NXDomain;
+ dq.getHeader()->qr=true;
+ ++g_stats.ruleNXDomain;
+ return true;
+ break;
+ case DNSAction::Action::Refused:
+ dq.getHeader()->rcode = RCode::Refused;
+ dq.getHeader()->qr=true;
+ ++g_stats.ruleRefused;
+ return true;
+ break;
+ case DNSAction::Action::ServFail:
+ dq.getHeader()->rcode = RCode::ServFail;
+ dq.getHeader()->qr=true;
+ ++g_stats.ruleServFail;
+ return true;
+ break;
+ case DNSAction::Action::Spoof:
+ spoofResponseFromString(dq, ruleresult, false);
+ return true;
+ break;
+ case DNSAction::Action::SpoofRaw:
+ spoofResponseFromString(dq, ruleresult, true);
+ return true;
+ break;
+ case DNSAction::Action::Truncate:
+ if (!dq.overTCP()) {
+ dq.getHeader()->tc = true;
+ dq.getHeader()->qr = true;
+ dq.getHeader()->ra = dq.getHeader()->rd;
+ dq.getHeader()->aa = false;
+ dq.getHeader()->ad = false;
+ ++g_stats.ruleTruncated;
+ return true;
+ }
+ break;
+ case DNSAction::Action::HeaderModify:
+ return true;
+ break;
+ case DNSAction::Action::Pool:
+ dq.poolname=ruleresult;
+ return true;
+ break;
+ case DNSAction::Action::NoRecurse:
+ dq.getHeader()->rd = false;
+ return true;
+ break;
+ /* non-terminal actions follow */
+ case DNSAction::Action::Delay:
+ dq.delayMsec = static_cast<int>(pdns_stou(ruleresult)); // sorry
+ break;
+ case DNSAction::Action::None:
+ /* fall-through */
+ case DNSAction::Action::NoOp:
+ break;
+ }
+
+ /* false means that we don't stop the processing */
+ return false;
+}
+
+
+static bool applyRulesToQuery(LocalHolders& holders, DNSQuestion& dq, const struct timespec& now)
+{
+ g_rings.insertQuery(now, *dq.remote, *dq.qname, dq.qtype, dq.getData().size(), *dq.getHeader(), dq.getProtocol());
+
+ if (g_qcount.enabled) {
+ string qname = (*dq.qname).toLogString();
+ bool countQuery{true};
+ if (g_qcount.filter) {
+ auto lock = g_lua.lock();
+ std::tie (countQuery, qname) = g_qcount.filter(&dq);
+ }
+
+ if (countQuery) {
+ auto records = g_qcount.records.write_lock();
+ if (!records->count(qname)) {
+ (*records)[qname] = 0;
+ }
+ (*records)[qname]++;
+ }
+ }
+
+ /* the Dynamic Block mechanism supports address and port ranges, so we need to pass the full address and port */
+ if (auto got = holders.dynNMGBlock->lookup(AddressAndPortRange(*dq.remote, dq.remote->isIPv4() ? 32 : 128, 16))) {
+ auto updateBlockStats = [&got]() {
+ ++g_stats.dynBlocked;
+ got->second.blocks++;
+ };
+
+ if (now < got->second.until) {
+ DNSAction::Action action = got->second.action;
+ if (action == DNSAction::Action::None) {
+ action = g_dynBlockAction;
+ }
+ switch (action) {
+ case DNSAction::Action::NoOp:
+ /* do nothing */
+ break;
+
+ case DNSAction::Action::Nxdomain:
+ vinfolog("Query from %s turned into NXDomain because of dynamic block", dq.remote->toStringWithPort());
+ updateBlockStats();
+
+ dq.getHeader()->rcode = RCode::NXDomain;
+ dq.getHeader()->qr=true;
+ return true;
+
+ case DNSAction::Action::Refused:
+ vinfolog("Query from %s refused because of dynamic block", dq.remote->toStringWithPort());
+ updateBlockStats();
+
+ dq.getHeader()->rcode = RCode::Refused;
+ dq.getHeader()->qr = true;
+ return true;
+
+ case DNSAction::Action::Truncate:
+ if (!dq.overTCP()) {
+ updateBlockStats();
+ vinfolog("Query from %s truncated because of dynamic block", dq.remote->toStringWithPort());
+ dq.getHeader()->tc = true;
+ dq.getHeader()->qr = true;
+ dq.getHeader()->ra = dq.getHeader()->rd;
+ dq.getHeader()->aa = false;
+ dq.getHeader()->ad = false;
+ return true;
+ }
+ else {
+ vinfolog("Query from %s for %s over TCP *not* truncated because of dynamic block", dq.remote->toStringWithPort(), dq.qname->toLogString());
+ }
+ break;
+ case DNSAction::Action::NoRecurse:
+ updateBlockStats();
+ vinfolog("Query from %s setting rd=0 because of dynamic block", dq.remote->toStringWithPort());
+ dq.getHeader()->rd = false;
+ return true;
+ default:
+ updateBlockStats();
+ vinfolog("Query from %s dropped because of dynamic block", dq.remote->toStringWithPort());
+ return false;
+ }
+ }
+ }
+
+ if (auto got = holders.dynSMTBlock->lookup(*dq.qname)) {
+ auto updateBlockStats = [&got]() {
+ ++g_stats.dynBlocked;
+ got->blocks++;
+ };
+
+ if (now < got->until) {
+ DNSAction::Action action = got->action;
+ if (action == DNSAction::Action::None) {
+ action = g_dynBlockAction;
+ }
+ switch (action) {
+ case DNSAction::Action::NoOp:
+ /* do nothing */
+ break;
+ case DNSAction::Action::Nxdomain:
+ vinfolog("Query from %s for %s turned into NXDomain because of dynamic block", dq.remote->toStringWithPort(), dq.qname->toLogString());
+ updateBlockStats();
+
+ dq.getHeader()->rcode = RCode::NXDomain;
+ dq.getHeader()->qr=true;
+ return true;
+ case DNSAction::Action::Refused:
+ vinfolog("Query from %s for %s refused because of dynamic block", dq.remote->toStringWithPort(), dq.qname->toLogString());
+ updateBlockStats();
+
+ dq.getHeader()->rcode = RCode::Refused;
+ dq.getHeader()->qr=true;
+ return true;
+ case DNSAction::Action::Truncate:
+ if (!dq.overTCP()) {
+ updateBlockStats();
+
+ vinfolog("Query from %s for %s truncated because of dynamic block", dq.remote->toStringWithPort(), dq.qname->toLogString());
+ dq.getHeader()->tc = true;
+ dq.getHeader()->qr = true;
+ dq.getHeader()->ra = dq.getHeader()->rd;
+ dq.getHeader()->aa = false;
+ dq.getHeader()->ad = false;
+ return true;
+ }
+ else {
+ vinfolog("Query from %s for %s over TCP *not* truncated because of dynamic block", dq.remote->toStringWithPort(), dq.qname->toLogString());
+ }
+ break;
+ case DNSAction::Action::NoRecurse:
+ updateBlockStats();
+ vinfolog("Query from %s setting rd=0 because of dynamic block", dq.remote->toStringWithPort());
+ dq.getHeader()->rd = false;
+ return true;
+ default:
+ updateBlockStats();
+ vinfolog("Query from %s for %s dropped because of dynamic block", dq.remote->toStringWithPort(), dq.qname->toLogString());
+ return false;
+ }
+ }
+ }
+
+ DNSAction::Action action=DNSAction::Action::None;
+ string ruleresult;
+ bool drop = false;
+ for(const auto& lr : *holders.ruleactions) {
+ if(lr.d_rule->matches(&dq)) {
+ lr.d_rule->d_matches++;
+ action=(*lr.d_action)(&dq, &ruleresult);
+ if (processRulesResult(action, dq, ruleresult, drop)) {
+ break;
+ }
+ }
+ }
+
+ if (drop) {
+ return false;
+ }
+
+ return true;
+}
+
+ssize_t udpClientSendRequestToBackend(const std::shared_ptr<DownstreamState>& ss, const int sd, const PacketBuffer& request, bool healthCheck)
+{
+ ssize_t result;
+
+ if (ss->sourceItf == 0) {
+ result = send(sd, request.data(), request.size(), 0);
+ }
+ else {
+ struct msghdr msgh;
+ struct iovec iov;
+ cmsgbuf_aligned cbuf;
+ ComboAddress remote(ss->remote);
+ fillMSGHdr(&msgh, &iov, &cbuf, sizeof(cbuf), const_cast<char*>(reinterpret_cast<const char *>(request.data())), request.size(), &remote);
+ addCMsgSrcAddr(&msgh, &cbuf, &ss->sourceAddr, ss->sourceItf);
+ result = sendmsg(sd, &msgh, 0);
+ }
+
+ if (result == -1) {
+ int savederrno = errno;
+ vinfolog("Error sending request to backend %s: %d", ss->remote.toStringWithPort(), savederrno);
+
+ /* This might sound silly, but on Linux send() might fail with EINVAL
+ if the interface the socket was bound to doesn't exist anymore.
+ We don't want to reconnect the real socket if the healthcheck failed,
+ because it's not using the same socket.
+ */
+ if (!healthCheck && (savederrno == EINVAL || savederrno == ENODEV)) {
+ ss->reconnect();
+ }
+ }
+
+ return result;
+}
+
+static bool isUDPQueryAcceptable(ClientState& cs, LocalHolders& holders, const struct msghdr* msgh, const ComboAddress& remote, ComboAddress& dest, bool& expectProxyProtocol)
+{
+ if (msgh->msg_flags & MSG_TRUNC) {
+ /* message was too large for our buffer */
+ vinfolog("Dropping message too large for our buffer");
+ ++g_stats.nonCompliantQueries;
+ return false;
+ }
+
+ expectProxyProtocol = expectProxyProtocolFrom(remote);
+ if (!holders.acl->match(remote) && !expectProxyProtocol) {
+ vinfolog("Query from %s dropped because of ACL", remote.toStringWithPort());
+ ++g_stats.aclDrops;
+ return false;
+ }
+
+ if (HarvestDestinationAddress(msgh, &dest)) {
+ /* we don't get the port, only the address */
+ dest.sin4.sin_port = cs.local.sin4.sin_port;
+ }
+ else {
+ dest.sin4.sin_family = 0;
+ }
+
+ cs.queries++;
+ ++g_stats.queries;
+
+ return true;
+}
+
+bool checkDNSCryptQuery(const ClientState& cs, PacketBuffer& query, std::unique_ptr<DNSCryptQuery>& dnsCryptQuery, time_t now, bool tcp)
+{
+ if (cs.dnscryptCtx) {
+#ifdef HAVE_DNSCRYPT
+ PacketBuffer response;
+ dnsCryptQuery = std::make_unique<DNSCryptQuery>(cs.dnscryptCtx);
+
+ bool decrypted = handleDNSCryptQuery(query, *dnsCryptQuery, tcp, now, response);
+
+ if (!decrypted) {
+ if (response.size() > 0) {
+ query = std::move(response);
+ return true;
+ }
+ throw std::runtime_error("Unable to decrypt DNSCrypt query, dropping.");
+ }
+#endif /* HAVE_DNSCRYPT */
+ }
+ return false;
+}
+
+bool checkQueryHeaders(const struct dnsheader* dh)
+{
+ if (dh->qr) { // don't respond to responses
+ ++g_stats.nonCompliantQueries;
+ return false;
+ }
+
+ if (dh->qdcount == 0) {
+ ++g_stats.emptyQueries;
+ if (g_dropEmptyQueries) {
+ return false;
+ }
+ }
+
+ if (dh->rd) {
+ ++g_stats.rdQueries;
+ }
+
+ return true;
+}
+
+#if defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE)
+static void queueResponse(const ClientState& cs, const PacketBuffer& response, const ComboAddress& dest, const ComboAddress& remote, struct mmsghdr& outMsg, struct iovec* iov, cmsgbuf_aligned* cbuf)
+{
+ outMsg.msg_len = 0;
+ fillMSGHdr(&outMsg.msg_hdr, iov, nullptr, 0, const_cast<char*>(reinterpret_cast<const char *>(&response.at(0))), response.size(), const_cast<ComboAddress*>(&remote));
+
+ if (dest.sin4.sin_family == 0) {
+ outMsg.msg_hdr.msg_control = nullptr;
+ }
+ else {
+ addCMsgSrcAddr(&outMsg.msg_hdr, cbuf, &dest, 0);
+ }
+}
+#endif /* defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE) */
+
+/* self-generated responses or cache hits */
+static bool prepareOutgoingResponse(LocalHolders& holders, ClientState& cs, DNSQuestion& dq, bool cacheHit)
+{
+ DNSResponse dr(dq.qname, dq.qtype, dq.qclass, dq.local, dq.remote, dq.getMutableData(), dq.protocol, dq.queryTime);
+
+ dr.uniqueId = dq.uniqueId;
+ dr.qTag = std::move(dq.qTag);
+ dr.delayMsec = dq.delayMsec;
+
+ if (!applyRulesToResponse(cacheHit ? holders.cacheHitRespRuleactions : holders.selfAnsweredRespRuleactions, dr)) {
+ return false;
+ }
+
+ /* in case a rule changed it */
+ dq.delayMsec = dr.delayMsec;
+
+#ifdef HAVE_DNSCRYPT
+ if (!cs.muted) {
+ if (!encryptResponse(dq.getMutableData(), dq.getMaximumSize(), dq.overTCP(), dq.dnsCryptQuery)) {
+ return false;
+ }
+ }
+#endif /* HAVE_DNSCRYPT */
+
+ if (cacheHit) {
+ ++g_stats.cacheHits;
+ }
+
+ switch (dr.getHeader()->rcode) {
+ case RCode::NXDomain:
+ ++g_stats.frontendNXDomain;
+ break;
+ case RCode::ServFail:
+ ++g_stats.frontendServFail;
+ break;
+ case RCode::NoError:
+ ++g_stats.frontendNoError;
+ break;
+ }
+
+ doLatencyStats(0); // we're not going to measure this
+ return true;
+}
+
+ProcessQueryResult processQuery(DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend)
+{
+ const uint16_t queryId = ntohs(dq.getHeader()->id);
+
+ try {
+ /* we need an accurate ("real") value for the response and
+ to store into the IDS, but not for insertion into the
+ rings for example */
+ struct timespec now;
+ gettime(&now);
+
+ if (!applyRulesToQuery(holders, dq, now)) {
+ return ProcessQueryResult::Drop;
+ }
+
+ if (dq.getHeader()->qr) { // something turned it into a response
+ fixUpQueryTurnedResponse(dq, dq.origFlags);
+
+ if (!prepareOutgoingResponse(holders, cs, dq, false)) {
+ return ProcessQueryResult::Drop;
+ }
+
+ ++g_stats.selfAnswered;
+ ++cs.responses;
+ return ProcessQueryResult::SendAnswer;
+ }
+
+ std::shared_ptr<ServerPool> serverPool = getPool(*holders.pools, dq.poolname);
+ std::shared_ptr<ServerPolicy> poolPolicy = serverPool->policy;
+ dq.packetCache = serverPool->packetCache;
+ const auto& policy = poolPolicy != nullptr ? *poolPolicy : *(holders.policy);
+ const auto servers = serverPool->getServers();
+ selectedBackend = policy.getSelectedBackend(*servers, dq);
+
+ uint32_t allowExpired = selectedBackend ? 0 : g_staleCacheEntriesTTL;
+
+ if (dq.packetCache && !dq.skipCache) {
+ dq.dnssecOK = (getEDNSZ(dq) & EDNS_HEADER_FLAG_DO);
+ }
+
+ if (dq.useECS && ((selectedBackend && selectedBackend->useECS) || (!selectedBackend && serverPool->getECS()))) {
+ // we special case our cache in case a downstream explicitly gave us a universally valid response with a 0 scope
+ // we need ECS parsing (parseECS) to be true so we can be sure that the initial incoming query did not have an existing
+ // ECS option, which would make it unsuitable for the zero-scope feature.
+ if (dq.packetCache && !dq.skipCache && (!selectedBackend || !selectedBackend->disableZeroScope) && dq.packetCache->isECSParsingEnabled()) {
+ if (dq.packetCache->get(dq, dq.getHeader()->id, &dq.cacheKeyNoECS, dq.subnet, dq.dnssecOK, !dq.overTCP(), allowExpired)) {
+
+ if (!prepareOutgoingResponse(holders, cs, dq, true)) {
+ return ProcessQueryResult::Drop;
+ }
+
+ return ProcessQueryResult::SendAnswer;
+ }
+
+ if (!dq.subnet) {
+ /* there was no existing ECS on the query, enable the zero-scope feature */
+ dq.useZeroScope = true;
+ }
+ }
+
+ if (!handleEDNSClientSubnet(dq, dq.ednsAdded, dq.ecsAdded)) {
+ vinfolog("Dropping query from %s because we couldn't insert the ECS value", dq.remote->toStringWithPort());
+ return ProcessQueryResult::Drop;
+ }
+ }
+
+ if (dq.packetCache && !dq.skipCache) {
+ if (dq.packetCache->get(dq, dq.getHeader()->id, &dq.cacheKey, dq.subnet, dq.dnssecOK, !dq.overTCP(), allowExpired)) {
+
+ restoreFlags(dq.getHeader(), dq.origFlags);
+
+ if (!prepareOutgoingResponse(holders, cs, dq, true)) {
+ return ProcessQueryResult::Drop;
+ }
+
+ return ProcessQueryResult::SendAnswer;
+ }
+ else if (dq.protocol == dnsdist::Protocol::DoH) {
+ /* do a second-lookup for UDP responses */
+ /* we need to do a copy to be able to restore the query on a TC=1 cached answer */
+ PacketBuffer initialQuery(dq.getData());
+ if (dq.packetCache->get(dq, dq.getHeader()->id, &dq.cacheKeyUDP, dq.subnet, dq.dnssecOK, true, allowExpired)) {
+ if (dq.getHeader()->tc == 0) {
+ if (!prepareOutgoingResponse(holders, cs, dq, true)) {
+ return ProcessQueryResult::Drop;
+ }
+
+ return ProcessQueryResult::SendAnswer;
+ }
+ dq.getMutableData() = std::move(initialQuery);
+ }
+ }
+
+ ++g_stats.cacheMisses;
+ }
+
+ if (!selectedBackend) {
+ ++g_stats.noPolicy;
+
+ vinfolog("%s query for %s|%s from %s, no policy applied", g_servFailOnNoPolicy ? "ServFailed" : "Dropped", dq.qname->toLogString(), QType(dq.qtype).toString(), dq.remote->toStringWithPort());
+ if (g_servFailOnNoPolicy) {
+ dq.getHeader()->rcode = RCode::ServFail;
+ dq.getHeader()->qr = true;
+
+ fixUpQueryTurnedResponse(dq, dq.origFlags);
+
+ if (!prepareOutgoingResponse(holders, cs, dq, false)) {
+ return ProcessQueryResult::Drop;
+ }
+ // no response-only statistics counter to update.
+ return ProcessQueryResult::SendAnswer;
+ }
+
+ return ProcessQueryResult::Drop;
+ }
+
+ /* save the DNS flags as sent to the backend so we can cache the answer with the right flags later */
+ dq.cacheFlags = *getFlagsFromDNSHeader(dq.getHeader());
+
+ if (dq.addXPF && selectedBackend->xpfRRCode != 0) {
+ addXPF(dq, selectedBackend->xpfRRCode);
+ }
+
+ selectedBackend->incQueriesCount();
+ return ProcessQueryResult::PassToBackend;
+ }
+ catch (const std::exception& e){
+ vinfolog("Got an error while parsing a %s query from %s, id %d: %s", (dq.overTCP() ? "TCP" : "UDP"), dq.remote->toStringWithPort(), queryId, e.what());
+ }
+ return ProcessQueryResult::Drop;
+}
+
+class UDPTCPCrossQuerySender : public TCPQuerySender
+{
+public:
+ UDPTCPCrossQuerySender(const ClientState& cs, std::shared_ptr<DownstreamState>& ds, uint16_t payloadSize): d_cs(cs), d_ds(ds), d_payloadSize(payloadSize)
+ {
+ }
+
+ ~UDPTCPCrossQuerySender()
+ {
+ }
+
+ bool active() const override
+ {
+ return true;
+ }
+
+ const ClientState* getClientState() const override
+ {
+ return &d_cs;
+ }
+
+ void handleResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ if (!d_ds) {
+ throw std::runtime_error("Passing a cross-protocol answer originated from UDP without a valid downstream");
+ }
+
+ auto& ids = response.d_idstate;
+
+ static thread_local LocalStateHolder<vector<DNSDistResponseRuleAction>> localRespRuleActions = g_respruleactions.getLocal();
+ DNSResponse dr = makeDNSResponseFromIDState(ids, response.d_buffer);
+ if (response.d_buffer.size() > d_payloadSize) {
+ vinfolog("Got a response of size %d over TCP, while the initial UDP payload size was %d, truncating", response.d_buffer.size(), d_payloadSize);
+ truncateTC(dr.getMutableData(), dr.getMaximumSize(), dr.qname->wirelength());
+ dr.getHeader()->tc = true;
+ }
+
+ dnsheader cleartextDH;
+ memcpy(&cleartextDH, dr.getHeader(), sizeof(cleartextDH));
+
+ if (!processResponse(response.d_buffer, localRespRuleActions, dr, false, true)) {
+ return;
+ }
+
+ ++g_stats.responses;
+ if (ids.cs) {
+ ++ids.cs->responses;
+ }
+
+ if (ids.cs && !ids.cs->muted) {
+ ComboAddress empty;
+ empty.sin4.sin_family = 0;
+ sendUDPResponse(ids.origFD, response.d_buffer, dr.delayMsec, ids.hopLocal, ids.hopRemote);
+ }
+
+ double udiff = ids.sentTime.udiff();
+ vinfolog("Got answer from %s, relayed to %s (UDP), took %f usec", d_ds->remote.toStringWithPort(), ids.origRemote.toStringWithPort(), udiff);
+
+ handleResponseSent(ids, udiff, *dr.remote, d_ds->remote, response.d_buffer.size(), cleartextDH, d_ds->getProtocol());
+
+ d_ds->latencyUsec = (127.0 * d_ds->latencyUsec / 128.0) + udiff/128.0;
+
+ doLatencyStats(udiff);
+ }
+
+ void handleXFRResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ return handleResponse(now, std::move(response));
+ }
+
+ void notifyIOError(IDState&& query, const struct timeval& now) override
+ {
+ // nothing to do
+ }
+private:
+ const ClientState& d_cs;
+ std::shared_ptr<DownstreamState> d_ds{nullptr};
+ uint16_t d_payloadSize{0};
+};
+
+class UDPCrossProtocolQuery : public CrossProtocolQuery
+{
+public:
+ UDPCrossProtocolQuery(PacketBuffer&& buffer, IDState&& ids, std::shared_ptr<DownstreamState>& ds): d_cs(*ids.cs)
+ {
+ uint16_t z = 0;
+ getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(buffer.data()), buffer.size(), &d_payloadSize, &z);
+ if (d_payloadSize < 512) {
+ d_payloadSize = 512;
+ }
+ query = InternalQuery(std::move(buffer), std::move(ids));
+ downstream = ds;
+ proxyProtocolPayloadSize = 0;
+ }
+
+ ~UDPCrossProtocolQuery()
+ {
+ }
+
+ std::shared_ptr<TCPQuerySender> getTCPQuerySender() override
+ {
+ auto sender = std::make_shared<UDPTCPCrossQuerySender>(d_cs, downstream, d_payloadSize);
+ return sender;
+ }
+
+private:
+ const ClientState& d_cs;
+ uint16_t d_payloadSize{0};
+};
+
+static void processUDPQuery(ClientState& cs, LocalHolders& holders, const struct msghdr* msgh, const ComboAddress& remote, ComboAddress& dest, PacketBuffer& query, struct mmsghdr* responsesVect, unsigned int* queuedResponses, struct iovec* respIOV, cmsgbuf_aligned* respCBuf)
+{
+ assert(responsesVect == nullptr || (queuedResponses != nullptr && respIOV != nullptr && respCBuf != nullptr));
+ uint16_t queryId = 0;
+ ComboAddress proxiedRemote = remote;
+ ComboAddress proxiedDestination = dest;
+
+ try {
+ bool expectProxyProtocol = false;
+ if (!isUDPQueryAcceptable(cs, holders, msgh, remote, dest, expectProxyProtocol)) {
+ return;
+ }
+ /* dest might have been updated, if we managed to harvest the destination address */
+ proxiedDestination = dest;
+
+ std::vector<ProxyProtocolValue> proxyProtocolValues;
+ if (expectProxyProtocol && !handleProxyProtocol(remote, false, *holders.acl, query, proxiedRemote, proxiedDestination, proxyProtocolValues)) {
+ return;
+ }
+
+ /* we need an accurate ("real") value for the response and
+ to store into the IDS, but not for insertion into the
+ rings for example */
+ struct timespec queryRealTime;
+ gettime(&queryRealTime, true);
+
+ std::unique_ptr<DNSCryptQuery> dnsCryptQuery = nullptr;
+ auto dnsCryptResponse = checkDNSCryptQuery(cs, query, dnsCryptQuery, queryRealTime.tv_sec, false);
+ if (dnsCryptResponse) {
+ sendUDPResponse(cs.udpFD, query, 0, dest, remote);
+ return;
+ }
+
+ {
+ /* this pointer will be invalidated the second the buffer is resized, don't hold onto it! */
+ struct dnsheader* dh = reinterpret_cast<struct dnsheader*>(query.data());
+ queryId = ntohs(dh->id);
+
+ if (!checkQueryHeaders(dh)) {
+ return;
+ }
+
+ if (dh->qdcount == 0) {
+ dh->rcode = RCode::NotImp;
+ dh->qr = true;
+ sendUDPResponse(cs.udpFD, query, 0, dest, remote);
+ return;
+ }
+ }
+
+ uint16_t qtype, qclass;
+ unsigned int qnameWireLength = 0;
+ DNSName qname(reinterpret_cast<const char*>(query.data()), query.size(), sizeof(dnsheader), false, &qtype, &qclass, &qnameWireLength);
+ DNSQuestion dq(&qname, qtype, qclass, proxiedDestination.sin4.sin_family != 0 ? &proxiedDestination : &cs.local, &proxiedRemote, query, dnsCryptQuery ? dnsdist::Protocol::DNSCryptUDP : dnsdist::Protocol::DoUDP, &queryRealTime);
+ dq.dnsCryptQuery = std::move(dnsCryptQuery);
+ if (!proxyProtocolValues.empty()) {
+ dq.proxyProtocolValues = make_unique<std::vector<ProxyProtocolValue>>(std::move(proxyProtocolValues));
+ }
+ dq.hopRemote = &remote;
+ dq.hopLocal = &dest;
+ std::shared_ptr<DownstreamState> ss{nullptr};
+ auto result = processQuery(dq, cs, holders, ss);
+
+ if (result == ProcessQueryResult::Drop) {
+ return;
+ }
+
+ // the buffer might have been invalidated by now (resized)
+ struct dnsheader* dh = dq.getHeader();
+ if (result == ProcessQueryResult::SendAnswer) {
+#if defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE)
+ if (dq.delayMsec == 0 && responsesVect != nullptr) {
+ queueResponse(cs, query, dest, remote, responsesVect[*queuedResponses], respIOV, respCBuf);
+ (*queuedResponses)++;
+ return;
+ }
+#endif /* defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE) */
+ /* we use dest, always, because we don't want to use the listening address to send a response since it could be 0.0.0.0 */
+ sendUDPResponse(cs.udpFD, query, dq.delayMsec, dest, remote);
+ return;
+ }
+
+ if (result != ProcessQueryResult::PassToBackend || ss == nullptr) {
+ return;
+ }
+
+ if (ss->isTCPOnly()) {
+ std::string proxyProtocolPayload;
+ /* we need to do this _before_ creating the cross protocol query because
+ after that the buffer will have been moved */
+ if (ss->useProxyProtocol) {
+ proxyProtocolPayload = getProxyProtocolPayload(dq);
+ }
+
+ IDState ids;
+ ids.cs = &cs;
+ ids.origFD = cs.udpFD;
+ ids.origID = dh->id;
+ setIDStateFromDNSQuestion(ids, dq, std::move(qname));
+ if (dest.sin4.sin_family != 0) {
+ ids.origDest = dest;
+ }
+ else {
+ ids.origDest = cs.local;
+ }
+ auto cpq = std::make_unique<UDPCrossProtocolQuery>(std::move(query), std::move(ids), ss);
+ cpq->query.d_proxyProtocolPayload = std::move(proxyProtocolPayload);
+
+ ss->passCrossProtocolQuery(std::move(cpq));
+ return;
+ }
+
+ unsigned int idOffset = (ss->idOffset++) % ss->idStates.size();
+ IDState* ids = &ss->idStates[idOffset];
+ ids->age = 0;
+ DOHUnitUniquePtr du(nullptr, DOHUnit::release);
+
+ /* that means that the state was in use, possibly with an allocated
+ DOHUnit that we will need to handle, but we can't touch it before
+ confirming that we now own this state */
+ if (ids->isInUse()) {
+ du = DOHUnitUniquePtr(ids->du, DOHUnit::release);
+ }
+
+ /* we atomically replace the value, we now own this state */
+ if (!ids->markAsUsed()) {
+ /* the state was not in use.
+ we reset 'du' because it might have still been in use when we read it. */
+ du.release();
+ ++ss->outstanding;
+ }
+ else {
+ /* we are reusing a state, no change in outstanding but if there was an existing DOHUnit we need
+ to handle it because it's about to be overwritten. */
+ ids->du = nullptr;
+ ++ss->reuseds;
+ ++g_stats.downstreamTimeouts;
+ handleDOHTimeout(std::move(du));
+ }
+
+ ids->cs = &cs;
+ ids->origFD = cs.udpFD;
+ ids->origID = dh->id;
+ setIDStateFromDNSQuestion(*ids, dq, std::move(qname));
+
+ if (dest.sin4.sin_family != 0) {
+ ids->origDest = dest;
+ }
+ else {
+ ids->origDest = cs.local;
+ }
+
+ dh = dq.getHeader();
+ dh->id = idOffset;
+
+ if (ss->useProxyProtocol) {
+ addProxyProtocol(dq);
+ }
+
+ int fd = pickBackendSocketForSending(ss);
+ ssize_t ret = udpClientSendRequestToBackend(ss, fd, query);
+
+ if(ret < 0) {
+ ++ss->sendErrors;
+ ++g_stats.downstreamSendErrors;
+ }
+
+ vinfolog("Got query for %s|%s from %s, relayed to %s", ids->qname.toLogString(), QType(ids->qtype).toString(), proxiedRemote.toStringWithPort(), ss->getName());
+ }
+ catch(const std::exception& e){
+ vinfolog("Got an error in UDP question thread while parsing a query from %s, id %d: %s", proxiedRemote.toStringWithPort(), queryId, e.what());
+ }
+}
+
+#if defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE)
+static void MultipleMessagesUDPClientThread(ClientState* cs, LocalHolders& holders)
+{
+ struct MMReceiver
+ {
+ PacketBuffer packet;
+ ComboAddress remote;
+ ComboAddress dest;
+ struct iovec iov;
+ /* used by HarvestDestinationAddress */
+ cmsgbuf_aligned cbuf;
+ };
+ const size_t vectSize = g_udpVectorSize;
+
+ auto recvData = std::make_unique<MMReceiver[]>(vectSize);
+ auto msgVec = std::make_unique<struct mmsghdr[]>(vectSize);
+ auto outMsgVec = std::make_unique<struct mmsghdr[]>(vectSize);
+
+ /* the actual buffer is larger because:
+ - we may have to add EDNS and/or ECS
+ - we use it for self-generated responses (from rule or cache)
+ but we only accept incoming payloads up to that size
+ */
+ const size_t initialBufferSize = getInitialUDPPacketBufferSize();
+ const size_t maxIncomingPacketSize = getMaximumIncomingPacketSize(*cs);
+
+ /* initialize the structures needed to receive our messages */
+ for (size_t idx = 0; idx < vectSize; idx++) {
+ recvData[idx].remote.sin4.sin_family = cs->local.sin4.sin_family;
+ recvData[idx].packet.resize(initialBufferSize);
+ fillMSGHdr(&msgVec[idx].msg_hdr, &recvData[idx].iov, &recvData[idx].cbuf, sizeof(recvData[idx].cbuf), reinterpret_cast<char*>(&recvData[idx].packet.at(0)), maxIncomingPacketSize, &recvData[idx].remote);
+ }
+
+ /* go now */
+ for(;;) {
+
+ /* reset the IO vector, since it's also used to send the vector of responses
+ to avoid having to copy the data around */
+ for (size_t idx = 0; idx < vectSize; idx++) {
+ recvData[idx].packet.resize(initialBufferSize);
+ recvData[idx].iov.iov_base = &recvData[idx].packet.at(0);
+ recvData[idx].iov.iov_len = recvData[idx].packet.size();
+ }
+
+ /* block until we have at least one message ready, but return
+ as many as possible to save the syscall costs */
+ int msgsGot = recvmmsg(cs->udpFD, msgVec.get(), vectSize, MSG_WAITFORONE | MSG_TRUNC, nullptr);
+
+ if (msgsGot <= 0) {
+ vinfolog("Getting UDP messages via recvmmsg() failed with: %s", stringerror());
+ continue;
+ }
+
+ unsigned int msgsToSend = 0;
+
+ /* process the received messages */
+ for (int msgIdx = 0; msgIdx < msgsGot; msgIdx++) {
+ const struct msghdr* msgh = &msgVec[msgIdx].msg_hdr;
+ unsigned int got = msgVec[msgIdx].msg_len;
+ const ComboAddress& remote = recvData[msgIdx].remote;
+
+ if (static_cast<size_t>(got) < sizeof(struct dnsheader)) {
+ ++g_stats.nonCompliantQueries;
+ continue;
+ }
+
+ recvData[msgIdx].packet.resize(got);
+ processUDPQuery(*cs, holders, msgh, remote, recvData[msgIdx].dest, recvData[msgIdx].packet, outMsgVec.get(), &msgsToSend, &recvData[msgIdx].iov, &recvData[msgIdx].cbuf);
+ }
+
+ /* immediate (not delayed or sent to a backend) responses (mostly from a rule, dynamic block
+ or the cache) can be sent in batch too */
+
+ if (msgsToSend > 0 && msgsToSend <= static_cast<unsigned int>(msgsGot)) {
+ int sent = sendmmsg(cs->udpFD, outMsgVec.get(), msgsToSend, 0);
+
+ if (sent < 0 || static_cast<unsigned int>(sent) != msgsToSend) {
+ vinfolog("Error sending responses with sendmmsg() (%d on %u): %s", sent, msgsToSend, stringerror());
+ }
+ }
+
+ }
+}
+#endif /* defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE) */
+
+// listens to incoming queries, sends out to downstream servers, noting the intended return path
+static void udpClientThread(ClientState* cs)
+{
+ try {
+ setThreadName("dnsdist/udpClie");
+ LocalHolders holders;
+
+#if defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE)
+ if (g_udpVectorSize > 1) {
+ MultipleMessagesUDPClientThread(cs, holders);
+ }
+ else
+#endif /* defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE) */
+ {
+ /* the actual buffer is larger because:
+ - we may have to add EDNS and/or ECS
+ - we use it for self-generated responses (from rule or cache)
+ but we only accept incoming payloads up to that size
+ */
+ const size_t initialBufferSize = getInitialUDPPacketBufferSize();
+ const size_t maxIncomingPacketSize = getMaximumIncomingPacketSize(*cs);
+ PacketBuffer packet(initialBufferSize);
+
+ struct msghdr msgh;
+ struct iovec iov;
+ /* used by HarvestDestinationAddress */
+ cmsgbuf_aligned cbuf;
+
+ ComboAddress remote;
+ ComboAddress dest;
+ remote.sin4.sin_family = cs->local.sin4.sin_family;
+ fillMSGHdr(&msgh, &iov, &cbuf, sizeof(cbuf), reinterpret_cast<char*>(&packet.at(0)), maxIncomingPacketSize, &remote);
+
+ for(;;) {
+ packet.resize(initialBufferSize);
+ iov.iov_base = &packet.at(0);
+ iov.iov_len = packet.size();
+
+ ssize_t got = recvmsg(cs->udpFD, &msgh, 0);
+
+ if (got < 0 || static_cast<size_t>(got) < sizeof(struct dnsheader)) {
+ ++g_stats.nonCompliantQueries;
+ continue;
+ }
+
+ packet.resize(static_cast<size_t>(got));
+
+ processUDPQuery(*cs, holders, &msgh, remote, dest, packet, nullptr, nullptr, nullptr, nullptr);
+ }
+ }
+ }
+ catch(const std::exception &e)
+ {
+ errlog("UDP client thread died because of exception: %s", e.what());
+ }
+ catch(const PDNSException &e)
+ {
+ errlog("UDP client thread died because of PowerDNS exception: %s", e.reason);
+ }
+ catch(...)
+ {
+ errlog("UDP client thread died because of an exception: %s", "unknown");
+ }
+}
+
+
+uint16_t getRandomDNSID()
+{
+#ifdef HAVE_LIBSODIUM
+ return randombytes_uniform(65536);
+#else
+ return (random() % 65536);
+#endif
+}
+
+boost::optional<uint64_t> g_maxTCPClientThreads{boost::none};
+pdns::stat16_t g_cacheCleaningDelay{60};
+pdns::stat16_t g_cacheCleaningPercentage{100};
+
+static void maintThread()
+{
+ setThreadName("dnsdist/main");
+ int interval = 1;
+ size_t counter = 0;
+ int32_t secondsToWaitLog = 0;
+
+ for (;;) {
+ sleep(interval);
+
+ {
+ auto lua = g_lua.lock();
+ auto f = lua->readVariable<boost::optional<std::function<void()> > >("maintenance");
+ if (f) {
+ try {
+ (*f)();
+ secondsToWaitLog = 0;
+ }
+ catch(const std::exception &e) {
+ if (secondsToWaitLog <= 0) {
+ infolog("Error during execution of maintenance function: %s", e.what());
+ secondsToWaitLog = 61;
+ }
+ secondsToWaitLog -= interval;
+ }
+ }
+ }
+
+ counter++;
+ if (counter >= g_cacheCleaningDelay) {
+ /* keep track, for each cache, of whether we should keep
+ expired entries */
+ std::map<std::shared_ptr<DNSDistPacketCache>, bool> caches;
+
+ /* gather all caches actually used by at least one pool, and see
+ if something prevents us from cleaning the expired entries */
+ auto localPools = g_pools.getLocal();
+ for (const auto& entry : *localPools) {
+ auto& pool = entry.second;
+
+ auto packetCache = pool->packetCache;
+ if (!packetCache) {
+ continue;
+ }
+
+ auto pair = caches.insert({packetCache, false});
+ auto& iter = pair.first;
+ /* if we need to keep stale data for this cache (ie, not clear
+ expired entries when at least one pool using this cache
+ has all its backends down) */
+ if (packetCache->keepStaleData() && iter->second == false) {
+ /* so far all pools had at least one backend up */
+ if (pool->countServers(true) == 0) {
+ iter->second = true;
+ }
+ }
+ }
+
+ const time_t now = time(nullptr);
+ for (auto pair : caches) {
+ /* shall we keep expired entries ? */
+ if (pair.second == true) {
+ continue;
+ }
+ auto& packetCache = pair.first;
+ size_t upTo = (packetCache->getMaxEntries()* (100 - g_cacheCleaningPercentage)) / 100;
+ packetCache->purgeExpired(upTo, now);
+ }
+ counter = 0;
+ }
+ }
+}
+
+static void dynBlockMaintenanceThread()
+{
+ setThreadName("dnsdist/dynBloc");
+
+ DynBlockMaintenance::run();
+}
+
+static void secPollThread()
+{
+ setThreadName("dnsdist/secpoll");
+
+ for (;;) {
+ try {
+ doSecPoll(g_secPollSuffix);
+ }
+ catch(...) {
+ }
+ sleep(g_secPollInterval);
+ }
+}
+
+static void healthChecksThread()
+{
+ setThreadName("dnsdist/healthC");
+
+ static const int interval = 1;
+
+ for(;;) {
+ sleep(interval);
+
+ std::unique_ptr<FDMultiplexer> mplexer{nullptr};
+
+ auto states = g_dstates.getLocal(); // this points to the actual shared_ptrs!
+ for (auto& dss : *states) {
+
+ auto delta = dss->sw.udiffAndSet()/1000000.0;
+ dss->queryLoad.store(1.0*(dss->queries.load() - dss->prev.queries.load())/delta);
+ dss->dropRate.store(1.0*(dss->reuseds.load() - dss->prev.reuseds.load())/delta);
+ dss->prev.queries.store(dss->queries.load());
+ dss->prev.reuseds.store(dss->reuseds.load());
+
+ if (dss->outstanding.load() > 0) {
+ for (IDState& ids : dss->idStates) { // timeouts
+ int64_t usageIndicator = ids.usageIndicator;
+ if(IDState::isInUse(usageIndicator) && ids.age++ > g_udpTimeout) {
+ /* We mark the state as unused as soon as possible
+ to limit the risk of racing with the
+ responder thread.
+ */
+ auto oldDU = ids.du;
+
+ if (!ids.tryMarkUnused(usageIndicator)) {
+ /* this state has been altered in the meantime,
+ don't go anywhere near it */
+ continue;
+ }
+ ids.du = nullptr;
+ handleDOHTimeout(DOHUnitUniquePtr(oldDU, DOHUnit::release));
+ oldDU = nullptr;
+ ids.age = 0;
+ dss->reuseds++;
+ --dss->outstanding;
+ ++g_stats.downstreamTimeouts; // this is an 'actively' discovered timeout
+ vinfolog("Had a downstream timeout from %s (%s) for query for %s|%s from %s",
+ dss->remote.toStringWithPort(), dss->getName(),
+ ids.qname.toLogString(), QType(ids.qtype).toString(), ids.origRemote.toStringWithPort());
+
+ struct timespec ts;
+ gettime(&ts);
+
+ struct dnsheader fake;
+ memset(&fake, 0, sizeof(fake));
+ fake.id = ids.origID;
+
+ g_rings.insertResponse(ts, ids.origRemote, ids.qname, ids.qtype, std::numeric_limits<unsigned int>::max(), 0, fake, dss->remote, dss->getProtocol());
+ }
+ }
+ }
+
+ if (++dss->lastCheck < dss->checkInterval) {
+ continue;
+ }
+
+ dss->lastCheck = 0;
+
+ if (dss->availability == DownstreamState::Availability::Auto) {
+ if (!mplexer) {
+ mplexer = std::unique_ptr<FDMultiplexer>(FDMultiplexer::getMultiplexerSilent());
+ }
+
+ if (!queueHealthCheck(mplexer, dss)) {
+ updateHealthCheckResult(dss, false, false);
+ }
+ }
+ }
+
+ if (mplexer) {
+ handleQueuedHealthChecks(*mplexer);
+ }
+ }
+}
+
+static void bindAny(int af, int sock)
+{
+ __attribute__((unused)) int one = 1;
+
+#ifdef IP_FREEBIND
+ if (setsockopt(sock, IPPROTO_IP, IP_FREEBIND, &one, sizeof(one)) < 0)
+ warnlog("Warning: IP_FREEBIND setsockopt failed: %s", stringerror());
+#endif
+
+#ifdef IP_BINDANY
+ if (af == AF_INET)
+ if (setsockopt(sock, IPPROTO_IP, IP_BINDANY, &one, sizeof(one)) < 0)
+ warnlog("Warning: IP_BINDANY setsockopt failed: %s", stringerror());
+#endif
+#ifdef IPV6_BINDANY
+ if (af == AF_INET6)
+ if (setsockopt(sock, IPPROTO_IPV6, IPV6_BINDANY, &one, sizeof(one)) < 0)
+ warnlog("Warning: IPV6_BINDANY setsockopt failed: %s", stringerror());
+#endif
+#ifdef SO_BINDANY
+ if (setsockopt(sock, SOL_SOCKET, SO_BINDANY, &one, sizeof(one)) < 0)
+ warnlog("Warning: SO_BINDANY setsockopt failed: %s", stringerror());
+#endif
+}
+
+static void dropGroupPrivs(gid_t gid)
+{
+ if (gid) {
+ if (setgid(gid) == 0) {
+ if (setgroups(0, NULL) < 0) {
+ warnlog("Warning: Unable to drop supplementary gids: %s", stringerror());
+ }
+ }
+ else {
+ warnlog("Warning: Unable to set group ID to %d: %s", gid, stringerror());
+ }
+ }
+}
+
+static void dropUserPrivs(uid_t uid)
+{
+ if(uid) {
+ if(setuid(uid) < 0) {
+ warnlog("Warning: Unable to set user ID to %d: %s", uid, stringerror());
+ }
+ }
+}
+
+static void checkFileDescriptorsLimits(size_t udpBindsCount, size_t tcpBindsCount)
+{
+ /* stdin, stdout, stderr */
+ size_t requiredFDsCount = 3;
+ auto backends = g_dstates.getLocal();
+ /* UDP sockets to backends */
+ size_t backendUDPSocketsCount = 0;
+ for (const auto& backend : *backends) {
+ backendUDPSocketsCount += backend->sockets.size();
+ }
+ requiredFDsCount += backendUDPSocketsCount;
+ /* TCP sockets to backends */
+ if (g_maxTCPClientThreads) {
+ requiredFDsCount += (backends->size() * (*g_maxTCPClientThreads));
+ }
+ /* listening sockets */
+ requiredFDsCount += udpBindsCount;
+ requiredFDsCount += tcpBindsCount;
+ /* number of TCP connections currently served, assuming 1 connection per worker thread which is of course not right */
+ if (g_maxTCPClientThreads) {
+ requiredFDsCount += *g_maxTCPClientThreads;
+ /* max pipes for communicating between TCP acceptors and client threads */
+ requiredFDsCount += (*g_maxTCPClientThreads * 2);
+ }
+ /* max TCP queued connections */
+ requiredFDsCount += g_maxTCPQueuedConnections;
+ /* DelayPipe pipe */
+ requiredFDsCount += 2;
+ /* syslog socket */
+ requiredFDsCount++;
+ /* webserver main socket */
+ requiredFDsCount++;
+ /* console main socket */
+ requiredFDsCount++;
+ /* carbon export */
+ requiredFDsCount++;
+ /* history file */
+ requiredFDsCount++;
+ struct rlimit rl;
+ getrlimit(RLIMIT_NOFILE, &rl);
+ if (rl.rlim_cur <= requiredFDsCount) {
+ warnlog("Warning, this configuration can use more than %d file descriptors, web server and console connections not included, and the current limit is %d.", std::to_string(requiredFDsCount), std::to_string(rl.rlim_cur));
+#ifdef HAVE_SYSTEMD
+ warnlog("You can increase this value by using LimitNOFILE= in the systemd unit file or ulimit.");
+#else
+ warnlog("You can increase this value by using ulimit.");
+#endif
+ }
+}
+
+static bool g_warned_ipv6_recvpktinfo = false;
+
+static void setUpLocalBind(std::unique_ptr<ClientState>& cs)
+{
+ /* skip some warnings if there is an identical UDP context */
+ bool warn = cs->tcp == false || cs->tlsFrontend != nullptr || cs->dohFrontend != nullptr;
+ int& fd = cs->tcp == false ? cs->udpFD : cs->tcpFD;
+ (void) warn;
+
+ fd = SSocket(cs->local.sin4.sin_family, cs->tcp == false ? SOCK_DGRAM : SOCK_STREAM, 0);
+
+ if (cs->tcp) {
+ SSetsockopt(fd, SOL_SOCKET, SO_REUSEADDR, 1);
+#ifdef TCP_DEFER_ACCEPT
+ SSetsockopt(fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, 1);
+#endif
+ if (cs->fastOpenQueueSize > 0) {
+#ifdef TCP_FASTOPEN
+ SSetsockopt(fd, IPPROTO_TCP, TCP_FASTOPEN, cs->fastOpenQueueSize);
+#else
+ if (warn) {
+ warnlog("TCP Fast Open has been configured on local address '%s' but is not supported", cs->local.toStringWithPort());
+ }
+#endif
+ }
+ }
+
+ if(cs->local.sin4.sin_family == AF_INET6) {
+ SSetsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, 1);
+ }
+
+ bindAny(cs->local.sin4.sin_family, fd);
+
+ if(!cs->tcp && IsAnyAddress(cs->local)) {
+ int one=1;
+ (void)setsockopt(fd, IPPROTO_IP, GEN_IP_PKTINFO, &one, sizeof(one)); // linux supports this, so why not - might fail on other systems
+#ifdef IPV6_RECVPKTINFO
+ if (cs->local.isIPv6() && setsockopt(fd, IPPROTO_IPV6, IPV6_RECVPKTINFO, &one, sizeof(one)) < 0 &&
+ !g_warned_ipv6_recvpktinfo) {
+ warnlog("Warning: IPV6_RECVPKTINFO setsockopt failed: %s", stringerror());
+ g_warned_ipv6_recvpktinfo = true;
+ }
+#endif
+ }
+
+ if (cs->reuseport) {
+ if (!setReusePort(fd)) {
+ if (warn) {
+ /* no need to warn again if configured but support is not available, we already did for UDP */
+ warnlog("SO_REUSEPORT has been configured on local address '%s' but is not supported", cs->local.toStringWithPort());
+ }
+ }
+ }
+
+ /* Only set this on IPv4 UDP sockets.
+ Don't set it for DNSCrypt binds. DNSCrypt pads queries for privacy
+ purposes, so we do receive large, sometimes fragmented datagrams. */
+ if (!cs->tcp && !cs->dnscryptCtx) {
+ try {
+ setSocketIgnorePMTU(cs->udpFD, cs->local.sin4.sin_family);
+ }
+ catch(const std::exception& e) {
+ warnlog("Failed to set IP_MTU_DISCOVER on UDP server socket for local address '%s': %s", cs->local.toStringWithPort(), e.what());
+ }
+ }
+
+ if (!cs->tcp) {
+ if (g_socketUDPSendBuffer > 0) {
+ try {
+ setSocketSendBuffer(cs->udpFD, g_socketUDPSendBuffer);
+ }
+ catch (const std::exception& e) {
+ warnlog(e.what());
+ }
+ }
+
+ if (g_socketUDPRecvBuffer > 0) {
+ try {
+ setSocketReceiveBuffer(cs->udpFD, g_socketUDPRecvBuffer);
+ }
+ catch (const std::exception& e) {
+ warnlog(e.what());
+ }
+ }
+ }
+
+ const std::string& itf = cs->interface;
+ if (!itf.empty()) {
+#ifdef SO_BINDTODEVICE
+ int res = setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, itf.c_str(), itf.length());
+ if (res != 0) {
+ warnlog("Error setting up the interface on local address '%s': %s", cs->local.toStringWithPort(), stringerror());
+ }
+#else
+ if (warn) {
+ warnlog("An interface has been configured on local address '%s' but SO_BINDTODEVICE is not supported", cs->local.toStringWithPort());
+ }
+#endif
+ }
+
+#ifdef HAVE_EBPF
+ if (g_defaultBPFFilter && !g_defaultBPFFilter->isExternal()) {
+ cs->attachFilter(g_defaultBPFFilter);
+ vinfolog("Attaching default BPF Filter to %s frontend %s", (!cs->tcp ? "UDP" : "TCP"), cs->local.toStringWithPort());
+ }
+#endif /* HAVE_EBPF */
+
+ if (cs->tlsFrontend != nullptr) {
+ if (!cs->tlsFrontend->setupTLS()) {
+ errlog("Error while setting up TLS on local address '%s', exiting", cs->local.toStringWithPort());
+ _exit(EXIT_FAILURE);
+ }
+ }
+
+ if (cs->dohFrontend != nullptr) {
+ cs->dohFrontend->setup();
+ }
+
+ SBind(fd, cs->local);
+
+ if (cs->tcp) {
+ SListen(cs->tcpFD, cs->tcpListenQueueSize);
+
+ if (cs->tlsFrontend != nullptr) {
+ warnlog("Listening on %s for TLS", cs->local.toStringWithPort());
+ }
+ else if (cs->dohFrontend != nullptr) {
+ warnlog("Listening on %s for DoH", cs->local.toStringWithPort());
+ }
+ else if (cs->dnscryptCtx != nullptr) {
+ warnlog("Listening on %s for DNSCrypt", cs->local.toStringWithPort());
+ }
+ else {
+ warnlog("Listening on %s", cs->local.toStringWithPort());
+ }
+ }
+
+ cs->ready = true;
+}
+
+struct
+{
+ vector<string> locals;
+ vector<string> remotes;
+ bool checkConfig{false};
+ bool beClient{false};
+ bool beSupervised{false};
+ string command;
+ string config;
+ string uid;
+ string gid;
+} g_cmdLine;
+
+std::atomic<bool> g_configurationDone{false};
+
+static void usage()
+{
+ cout<<endl;
+ cout<<"Syntax: dnsdist [-C,--config file] [-c,--client [IP[:PORT]]]\n";
+ cout<<"[-e,--execute cmd] [-h,--help] [-l,--local addr]\n";
+ cout<<"[-v,--verbose] [--check-config] [--version]\n";
+ cout<<"\n";
+ cout<<"-a,--acl netmask Add this netmask to the ACL\n";
+ cout<<"-C,--config file Load configuration from 'file'\n";
+ cout<<"-c,--client Operate as a client, connect to dnsdist. This reads\n";
+ cout<<" controlSocket from your configuration file, but also\n";
+ cout<<" accepts an IP:PORT argument\n";
+#ifdef HAVE_LIBSODIUM
+ cout<<"-k,--setkey KEY Use KEY for encrypted communication to dnsdist. This\n";
+ cout<<" is similar to setting setKey in the configuration file.\n";
+ cout<<" NOTE: this will leak this key in your shell's history\n";
+ cout<<" and in the systems running process list.\n";
+#endif
+ cout<<"--check-config Validate the configuration file and exit. The exit-code\n";
+ cout<<" reflects the validation, 0 is OK, 1 means an error.\n";
+ cout<<" Any errors are printed as well.\n";
+ cout<<"-e,--execute cmd Connect to dnsdist and execute 'cmd'\n";
+ cout<<"-g,--gid gid Change the process group ID after binding sockets\n";
+ cout<<"-h,--help Display this helpful message\n";
+ cout<<"-l,--local address Listen on this local address\n";
+ cout<<"--supervised Don't open a console, I'm supervised\n";
+ cout<<" (use with e.g. systemd and daemontools)\n";
+ cout<<"--disable-syslog Don't log to syslog, only to stdout\n";
+ cout<<" (use with e.g. systemd)\n";
+ cout<<"-u,--uid uid Change the process user ID after binding sockets\n";
+ cout<<"-v,--verbose Enable verbose mode\n";
+ cout<<"-V,--version Show dnsdist version information and exit\n";
+}
+
+#ifdef COVERAGE
+static void cleanupLuaObjects()
+{
+ /* when our coverage mode is enabled, we need to make
+ that the Lua objects destroyed before the Lua contexts. */
+ g_ruleactions.setState({});
+ g_respruleactions.setState({});
+ g_cachehitrespruleactions.setState({});
+ g_selfansweredrespruleactions.setState({});
+ g_dstates.setState({});
+ g_policy.setState(ServerPolicy());
+ clearWebHandlers();
+}
+
+static void sighandler(int sig)
+{
+ cleanupLuaObjects();
+ exit(EXIT_SUCCESS);
+}
+#endif
+
+int main(int argc, char** argv)
+{
+ try {
+ size_t udpBindsCount = 0;
+ size_t tcpBindsCount = 0;
+ rl_attempted_completion_function = my_completion;
+ rl_completion_append_character = 0;
+
+ signal(SIGPIPE, SIG_IGN);
+ signal(SIGCHLD, SIG_IGN);
+#ifdef COVERAGE
+ signal(SIGTERM, sighandler);
+#endif
+
+ openlog("dnsdist", LOG_PID|LOG_NDELAY, LOG_DAEMON);
+
+#ifdef HAVE_LIBSODIUM
+ if (sodium_init() == -1) {
+ cerr<<"Unable to initialize crypto library"<<endl;
+ exit(EXIT_FAILURE);
+ }
+ g_hashperturb=randombytes_uniform(0xffffffff);
+ srandom(randombytes_uniform(0xffffffff));
+#else
+ {
+ struct timeval tv;
+ gettimeofday(&tv, 0);
+ srandom(tv.tv_sec ^ tv.tv_usec ^ getpid());
+ g_hashperturb=random();
+ }
+
+#endif
+ ComboAddress clientAddress = ComboAddress();
+ g_cmdLine.config=SYSCONFDIR "/dnsdist.conf";
+ struct option longopts[]={
+ {"acl", required_argument, 0, 'a'},
+ {"check-config", no_argument, 0, 1},
+ {"client", no_argument, 0, 'c'},
+ {"config", required_argument, 0, 'C'},
+ {"disable-syslog", no_argument, 0, 2},
+ {"execute", required_argument, 0, 'e'},
+ {"gid", required_argument, 0, 'g'},
+ {"help", no_argument, 0, 'h'},
+ {"local", required_argument, 0, 'l'},
+ {"setkey", required_argument, 0, 'k'},
+ {"supervised", no_argument, 0, 3},
+ {"uid", required_argument, 0, 'u'},
+ {"verbose", no_argument, 0, 'v'},
+ {"version", no_argument, 0, 'V'},
+ {0,0,0,0}
+ };
+ int longindex=0;
+ string optstring;
+ for(;;) {
+ int c=getopt_long(argc, argv, "a:cC:e:g:hk:l:u:vV", longopts, &longindex);
+ if(c==-1)
+ break;
+ switch(c) {
+ case 1:
+ g_cmdLine.checkConfig=true;
+ break;
+ case 2:
+ g_syslog=false;
+ break;
+ case 3:
+ g_cmdLine.beSupervised=true;
+ break;
+ case 'C':
+ g_cmdLine.config=optarg;
+ break;
+ case 'c':
+ g_cmdLine.beClient=true;
+ break;
+ case 'e':
+ g_cmdLine.command=optarg;
+ break;
+ case 'g':
+ g_cmdLine.gid=optarg;
+ break;
+ case 'h':
+ cout<<"dnsdist "<<VERSION<<endl;
+ usage();
+ cout<<"\n";
+ exit(EXIT_SUCCESS);
+ break;
+ case 'a':
+ optstring=optarg;
+ g_ACL.modify([optstring](NetmaskGroup& nmg) { nmg.addMask(optstring); });
+ break;
+ case 'k':
+#ifdef HAVE_LIBSODIUM
+ if (B64Decode(string(optarg), g_consoleKey) < 0) {
+ cerr<<"Unable to decode key '"<<optarg<<"'."<<endl;
+ exit(EXIT_FAILURE);
+ }
+#else
+ cerr<<"dnsdist has been built without libsodium, -k/--setkey is unsupported."<<endl;
+ exit(EXIT_FAILURE);
+#endif
+ break;
+ case 'l':
+ g_cmdLine.locals.push_back(boost::trim_copy(string(optarg)));
+ break;
+ case 'u':
+ g_cmdLine.uid=optarg;
+ break;
+ case 'v':
+ g_verbose=true;
+ break;
+ case 'V':
+#ifdef LUAJIT_VERSION
+ cout<<"dnsdist "<<VERSION<<" ("<<LUA_RELEASE<<" ["<<LUAJIT_VERSION<<"])"<<endl;
+#else
+ cout<<"dnsdist "<<VERSION<<" ("<<LUA_RELEASE<<")"<<endl;
+#endif
+ cout<<"Enabled features: ";
+#ifdef HAVE_CDB
+ cout<<"cdb ";
+#endif
+#ifdef HAVE_DNS_OVER_TLS
+ cout<<"dns-over-tls(";
+#ifdef HAVE_GNUTLS
+ cout<<"gnutls";
+#ifdef HAVE_LIBSSL
+ cout<<" ";
+#endif
+#endif
+#ifdef HAVE_LIBSSL
+ cout<<"openssl";
+#endif
+ cout<<") ";
+#endif
+#ifdef HAVE_DNS_OVER_HTTPS
+ cout<<"dns-over-https(DOH) ";
+#endif
+#ifdef HAVE_DNSCRYPT
+ cout<<"dnscrypt ";
+#endif
+#ifdef HAVE_EBPF
+ cout<<"ebpf ";
+#endif
+#ifdef HAVE_FSTRM
+ cout<<"fstrm ";
+#endif
+#ifdef HAVE_LIBCRYPTO
+ cout<<"ipcipher ";
+#endif
+#ifdef HAVE_LIBSODIUM
+ cout<<"libsodium ";
+#endif
+#ifdef HAVE_LMDB
+ cout<<"lmdb ";
+#endif
+#ifdef HAVE_NGHTTP2
+ cout<<"outgoing-dns-over-https(nghttp2) ";
+#endif
+ cout<<"protobuf ";
+#ifdef HAVE_RE2
+ cout<<"re2 ";
+#endif
+#if defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE)
+ cout<<"recvmmsg/sendmmsg ";
+#endif
+#ifdef HAVE_NET_SNMP
+ cout<<"snmp ";
+#endif
+#ifdef HAVE_SYSTEMD
+ cout<<"systemd";
+#endif
+ cout<<endl;
+ exit(EXIT_SUCCESS);
+ break;
+ case '?':
+ //getopt_long printed an error message.
+ usage();
+ exit(EXIT_FAILURE);
+ break;
+ }
+ }
+
+ argc -= optind;
+ argv += optind;
+ (void) argc;
+
+ for(auto p = argv; *p; ++p) {
+ if(g_cmdLine.beClient) {
+ clientAddress = ComboAddress(*p, 5199);
+ } else {
+ g_cmdLine.remotes.push_back(*p);
+ }
+ }
+
+ ServerPolicy leastOutstandingPol{"leastOutstanding", leastOutstanding, false};
+
+ g_policy.setState(leastOutstandingPol);
+ if(g_cmdLine.beClient || !g_cmdLine.command.empty()) {
+ setupLua(*(g_lua.lock()), true, false, g_cmdLine.config);
+ if (clientAddress != ComboAddress())
+ g_serverControl = clientAddress;
+ doClient(g_serverControl, g_cmdLine.command);
+#ifdef COVERAGE
+ exit(EXIT_SUCCESS);
+#else
+ _exit(EXIT_SUCCESS);
+#endif
+ }
+
+ auto acl = g_ACL.getCopy();
+ if(acl.empty()) {
+ for(auto& addr : {"127.0.0.0/8", "10.0.0.0/8", "100.64.0.0/10", "169.254.0.0/16", "192.168.0.0/16", "172.16.0.0/12", "::1/128", "fc00::/7", "fe80::/10"})
+ acl.addMask(addr);
+ g_ACL.setState(acl);
+ }
+
+ auto consoleACL = g_consoleACL.getCopy();
+ for (const auto& mask : { "127.0.0.1/8", "::1/128" }) {
+ consoleACL.addMask(mask);
+ }
+ g_consoleACL.setState(consoleACL);
+ registerBuiltInWebHandlers();
+
+ if (g_cmdLine.checkConfig) {
+ setupLua(*(g_lua.lock()), false, true, g_cmdLine.config);
+ // No exception was thrown
+ infolog("Configuration '%s' OK!", g_cmdLine.config);
+#ifdef COVERAGE
+ cleanupLuaObjects();
+ exit(EXIT_SUCCESS);
+#else
+ _exit(EXIT_SUCCESS);
+#endif
+ }
+
+ auto todo = setupLua(*(g_lua.lock()), false, false, g_cmdLine.config);
+
+ auto localPools = g_pools.getCopy();
+ {
+ bool precompute = false;
+ if (g_policy.getLocal()->getName() == "chashed") {
+ precompute = true;
+ } else {
+ for (const auto& entry: localPools) {
+ if (entry.second->policy != nullptr && entry.second->policy->getName() == "chashed") {
+ precompute = true;
+ break ;
+ }
+ }
+ }
+ if (precompute) {
+ vinfolog("Pre-computing hashes for consistent hash load-balancing policy");
+ // pre compute hashes
+ auto backends = g_dstates.getLocal();
+ for (auto& backend: *backends) {
+ if (backend->weight < 100) {
+ vinfolog("Warning, the backend '%s' has a very low weight (%d), which will not yield a good distribution of queries with the 'chashed' policy. Please consider raising it to at least '100'.", backend->getName(), backend->weight);
+ }
+
+ backend->hash();
+ }
+ }
+ }
+
+ if (!g_cmdLine.locals.empty()) {
+ for (auto it = g_frontends.begin(); it != g_frontends.end(); ) {
+ /* DoH, DoT and DNSCrypt frontends are separate */
+ if ((*it)->dohFrontend == nullptr && (*it)->tlsFrontend == nullptr && (*it)->dnscryptCtx == nullptr) {
+ it = g_frontends.erase(it);
+ }
+ else {
+ ++it;
+ }
+ }
+
+ for(const auto& loc : g_cmdLine.locals) {
+ /* UDP */
+ g_frontends.push_back(std::unique_ptr<ClientState>(new ClientState(ComboAddress(loc, 53), false, false, 0, "", {})));
+ /* TCP */
+ g_frontends.push_back(std::unique_ptr<ClientState>(new ClientState(ComboAddress(loc, 53), true, false, 0, "", {})));
+ }
+ }
+
+ if (g_frontends.empty()) {
+ /* UDP */
+ g_frontends.push_back(std::unique_ptr<ClientState>(new ClientState(ComboAddress("127.0.0.1", 53), false, false, 0, "", {})));
+ /* TCP */
+ g_frontends.push_back(std::unique_ptr<ClientState>(new ClientState(ComboAddress("127.0.0.1", 53), true, false, 0, "", {})));
+ }
+
+ g_configurationDone = true;
+
+ for(auto& frontend : g_frontends) {
+ setUpLocalBind(frontend);
+
+ if (frontend->tcp == false) {
+ ++udpBindsCount;
+ }
+ else {
+ ++tcpBindsCount;
+ }
+ }
+
+ warnlog("dnsdist %s comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2", VERSION);
+
+ vector<string> vec;
+ std::string acls;
+ g_ACL.getLocal()->toStringVector(&vec);
+ for(const auto& s : vec) {
+ if (!acls.empty())
+ acls += ", ";
+ acls += s;
+ }
+ infolog("ACL allowing queries from: %s", acls.c_str());
+ vec.clear();
+ acls.clear();
+ g_consoleACL.getLocal()->toStringVector(&vec);
+ for (const auto& entry : vec) {
+ if (!acls.empty()) {
+ acls += ", ";
+ }
+ acls += entry;
+ }
+ infolog("Console ACL allowing connections from: %s", acls.c_str());
+
+#ifdef HAVE_LIBSODIUM
+ if (g_consoleEnabled && g_consoleKey.empty()) {
+ warnlog("Warning, the console has been enabled via 'controlSocket()' but no key has been set with 'setKey()' so all connections will fail until a key has been set");
+ }
+#endif
+
+ uid_t newgid=getegid();
+ gid_t newuid=geteuid();
+
+ if(!g_cmdLine.gid.empty())
+ newgid = strToGID(g_cmdLine.gid.c_str());
+
+ if(!g_cmdLine.uid.empty())
+ newuid = strToUID(g_cmdLine.uid.c_str());
+
+ if (getegid() != newgid) {
+ if (running_in_service_mgr()) {
+ errlog("--gid/-g set on command-line, but dnsdist was started as a systemd service. Use the 'Group' setting in the systemd unit file to set the group to run as");
+ _exit(EXIT_FAILURE);
+ }
+ dropGroupPrivs(newgid);
+ }
+
+ if (geteuid() != newuid) {
+ if (running_in_service_mgr()) {
+ errlog("--uid/-u set on command-line, but dnsdist was started as a systemd service. Use the 'User' setting in the systemd unit file to set the user to run as");
+ _exit(EXIT_FAILURE);
+ }
+ dropUserPrivs(newuid);
+ }
+
+ try {
+ /* we might still have capabilities remaining,
+ for example if we have been started as root
+ without --uid or --gid (please don't do that)
+ or as an unprivileged user with ambient
+ capabilities like CAP_NET_BIND_SERVICE.
+ */
+ dropCapabilities(g_capabilitiesToRetain);
+ }
+ catch (const std::exception& e) {
+ warnlog("%s", e.what());
+ }
+
+ /* this need to be done _after_ dropping privileges */
+ g_delay = new DelayPipe<DelayedPacket>();
+
+ if (g_snmpAgent) {
+ g_snmpAgent->run();
+ }
+
+ if (!g_maxTCPClientThreads) {
+ g_maxTCPClientThreads = static_cast<size_t>(10);
+ }
+ else if (*g_maxTCPClientThreads == 0 && tcpBindsCount > 0) {
+ warnlog("setMaxTCPClientThreads() has been set to 0 while we are accepting TCP connections, raising to 1");
+ g_maxTCPClientThreads = 1;
+ }
+
+ /* we need to create the TCP worker threads before the
+ acceptor ones, otherwise we might crash when processing
+ the first TCP query */
+ g_tcpclientthreads = std::make_unique<TCPClientCollection>(*g_maxTCPClientThreads);
+
+ initDoHWorkers();
+
+ for (auto& t : todo) {
+ t();
+ }
+
+ localPools = g_pools.getCopy();
+ /* create the default pool no matter what */
+ createPoolIfNotExists(localPools, "");
+ if (g_cmdLine.remotes.size()) {
+ for (const auto& address : g_cmdLine.remotes) {
+ auto ret = std::make_shared<DownstreamState>(ComboAddress(address, 53));
+ ret->connectUDPSockets(1);
+ addServerToPool(localPools, "", ret);
+ if (ret->connected && !ret->threadStarted.test_and_set()) {
+ ret->tid = thread(responderThread, ret);
+ }
+ g_dstates.modify([ret](servers_t& servers) { servers.push_back(ret); });
+ }
+ }
+ g_pools.setState(localPools);
+
+ if (g_dstates.getLocal()->empty()) {
+ errlog("No downstream servers defined: all packets will get dropped");
+ // you might define them later, but you need to know
+ }
+
+ checkFileDescriptorsLimits(udpBindsCount, tcpBindsCount);
+
+ auto mplexer = std::unique_ptr<FDMultiplexer>(FDMultiplexer::getMultiplexerSilent());
+ for(auto& dss : g_dstates.getCopy()) { // it is a copy, but the internal shared_ptrs are the real deal
+ if (dss->availability == DownstreamState::Availability::Auto) {
+ if (!queueHealthCheck(mplexer, dss, true)) {
+ dss->setUpStatus(false);
+ warnlog("Marking downstream %s as 'down'", dss->getNameWithAddr());
+ }
+ }
+ }
+ handleQueuedHealthChecks(*mplexer, true);
+
+ for(auto& cs : g_frontends) {
+ if (cs->dohFrontend != nullptr) {
+#ifdef HAVE_DNS_OVER_HTTPS
+ std::thread t1(dohThread, cs.get());
+ if (!cs->cpus.empty()) {
+ mapThreadToCPUList(t1.native_handle(), cs->cpus);
+ }
+ t1.detach();
+#endif /* HAVE_DNS_OVER_HTTPS */
+ continue;
+ }
+ if (cs->udpFD >= 0) {
+ thread t1(udpClientThread, cs.get());
+ if (!cs->cpus.empty()) {
+ mapThreadToCPUList(t1.native_handle(), cs->cpus);
+ }
+ t1.detach();
+ }
+ else if (cs->tcpFD >= 0) {
+ thread t1(tcpAcceptorThread, cs.get());
+ if (!cs->cpus.empty()) {
+ mapThreadToCPUList(t1.native_handle(), cs->cpus);
+ }
+ t1.detach();
+ }
+ }
+
+ thread carbonthread(carbonDumpThread);
+ carbonthread.detach();
+
+ thread stattid(maintThread);
+ stattid.detach();
+
+ thread healththread(healthChecksThread);
+
+ thread dynBlockMaintThread(dynBlockMaintenanceThread);
+ dynBlockMaintThread.detach();
+
+ if (!g_secPollSuffix.empty()) {
+ thread secpollthread(secPollThread);
+ secpollthread.detach();
+ }
+
+ if(g_cmdLine.beSupervised) {
+#ifdef HAVE_SYSTEMD
+ sd_notify(0, "READY=1");
+#endif
+ healththread.join();
+ }
+ else {
+ healththread.detach();
+ doConsole();
+ }
+#ifdef COVERAGE
+ cleanupLuaObjects();
+ exit(EXIT_SUCCESS);
+#else
+ _exit(EXIT_SUCCESS);
+#endif
+ }
+ catch (const LuaContext::ExecutionErrorException& e) {
+ try {
+ errlog("Fatal Lua error: %s", e.what());
+ std::rethrow_if_nested(e);
+ } catch(const std::exception& ne) {
+ errlog("Details: %s", ne.what());
+ }
+ catch (const PDNSException &ae)
+ {
+ errlog("Fatal pdns error: %s", ae.reason);
+ }
+#ifdef COVERAGE
+ exit(EXIT_FAILURE);
+#else
+ _exit(EXIT_FAILURE);
+#endif
+ }
+ catch (const std::exception &e)
+ {
+ errlog("Fatal error: %s", e.what());
+#ifdef COVERAGE
+ exit(EXIT_FAILURE);
+#else
+ _exit(EXIT_FAILURE);
+#endif
+ }
+ catch (const PDNSException &ae)
+ {
+ errlog("Fatal pdns error: %s", ae.reason);
+#ifdef COVERAGE
+ exit(EXIT_FAILURE);
+#else
+ _exit(EXIT_FAILURE);
+#endif
+ }
+}
diff --git a/dnsdist.hh b/dnsdist.hh
new file mode 100644
index 0000000..f18750a
--- /dev/null
+++ b/dnsdist.hh
@@ -0,0 +1,1086 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "config.h"
+#include "ext/luawrapper/include/LuaContext.hpp"
+
+#include <mutex>
+#include <string>
+#include <thread>
+#include <time.h>
+#include <unistd.h>
+#include <unordered_map>
+
+#include <boost/variant.hpp>
+
+#include "capabilities.hh"
+#include "circular_buffer.hh"
+#include "dnscrypt.hh"
+#include "dnsdist-cache.hh"
+#include "dnsdist-dynbpf.hh"
+#include "dnsdist-lbpolicies.hh"
+#include "dnsdist-protocols.hh"
+#include "dnsname.hh"
+#include "doh.hh"
+#include "ednsoptions.hh"
+#include "iputils.hh"
+#include "misc.hh"
+#include "mplexer.hh"
+#include "noinitvector.hh"
+#include "sholder.hh"
+#include "tcpiohandler.hh"
+#include "uuid-utils.hh"
+#include "proxy-protocol.hh"
+#include "stat_t.hh"
+
+uint64_t uptimeOfProcess(const std::string& str);
+
+extern uint16_t g_ECSSourcePrefixV4;
+extern uint16_t g_ECSSourcePrefixV6;
+extern bool g_ECSOverride;
+
+using QTag = std::unordered_map<string, string>;
+
+struct DNSQuestion
+{
+ DNSQuestion(const DNSName* name, uint16_t type, uint16_t class_, const ComboAddress* lc, const ComboAddress* rem, PacketBuffer& data_, dnsdist::Protocol proto, const struct timespec* queryTime_):
+ data(data_), qname(name), local(lc), remote(rem), queryTime(queryTime_), tempFailureTTL(boost::none), qtype(type), qclass(class_), ecsPrefixLength(rem->sin4.sin_family == AF_INET ? g_ECSSourcePrefixV4 : g_ECSSourcePrefixV6), protocol(proto), ecsOverride(g_ECSOverride) {
+ const uint16_t* flags = getFlagsFromDNSHeader(getHeader());
+ origFlags = *flags;
+ }
+ DNSQuestion(const DNSQuestion&) = delete;
+ DNSQuestion& operator=(const DNSQuestion&) = delete;
+ DNSQuestion(DNSQuestion&&) = default;
+
+ std::string getTrailingData() const;
+ bool setTrailingData(const std::string&);
+ const PacketBuffer& getData() const
+ {
+ return data;
+ }
+ PacketBuffer& getMutableData()
+ {
+ return data;
+ }
+
+ dnsheader* getHeader()
+ {
+ if (data.size() < sizeof(dnsheader)) {
+ throw std::runtime_error("Trying to access the dnsheader of a too small (" + std::to_string(data.size()) + ") DNSQuestion buffer");
+ }
+ return reinterpret_cast<dnsheader*>(&data.at(0));
+ }
+
+ const dnsheader* getHeader() const
+ {
+ if (data.size() < sizeof(dnsheader)) {
+ throw std::runtime_error("Trying to access the dnsheader of a too small (" + std::to_string(data.size()) + ") DNSQuestion buffer");
+ }
+ return reinterpret_cast<const dnsheader*>(&data.at(0));
+ }
+
+ bool hasRoomFor(size_t more) const
+ {
+ return data.size() <= getMaximumSize() && (getMaximumSize() - data.size()) >= more;
+ }
+
+ size_t getMaximumSize() const
+ {
+ if (overTCP()) {
+ return std::numeric_limits<uint16_t>::max();
+ }
+ return 4096;
+ }
+
+ dnsdist::Protocol getProtocol() const
+ {
+ return protocol;
+ }
+
+ bool overTCP() const
+ {
+ return !(protocol == dnsdist::Protocol::DoUDP || protocol == dnsdist::Protocol::DNSCryptUDP);
+ }
+
+ void setTag(const std::string& key, std::string&& value) {
+ if (!qTag) {
+ qTag = std::make_unique<QTag>();
+ }
+ qTag->insert_or_assign(key, std::move(value));
+ }
+
+ void setTag(const std::string& key, const std::string& value) {
+ if (!qTag) {
+ qTag = std::make_unique<QTag>();
+ }
+ qTag->insert_or_assign(key, value);
+ }
+
+protected:
+ PacketBuffer& data;
+
+public:
+ boost::optional<boost::uuids::uuid> uniqueId;
+ Netmask ecs;
+ boost::optional<Netmask> subnet;
+ std::string sni; /* Server Name Indication, if any (DoT or DoH) */
+ std::string poolname;
+ mutable std::shared_ptr<std::map<uint16_t, EDNSOptionView> > ednsOptions;
+ std::shared_ptr<DNSDistPacketCache> packetCache{nullptr};
+ const DNSName* qname{nullptr};
+ const ComboAddress* local{nullptr};
+ const ComboAddress* remote{nullptr};
+ /* this is the address dnsdist received the packet on,
+ which might not match local when support for incoming proxy protocol
+ is enabled */
+ const ComboAddress* hopLocal{nullptr}; /* the address dnsdist received the packet from, see above */
+ const ComboAddress* hopRemote{nullptr};
+ std::unique_ptr<QTag> qTag{nullptr};
+ std::unique_ptr<std::vector<ProxyProtocolValue>> proxyProtocolValues{nullptr};
+ std::unique_ptr<DNSCryptQuery> dnsCryptQuery{nullptr};
+ const struct timespec* queryTime{nullptr};
+ struct DOHUnit* du{nullptr};
+ int delayMsec{0};
+ boost::optional<uint32_t> tempFailureTTL;
+ uint32_t cacheKeyNoECS{0};
+ uint32_t cacheKey{0};
+ /* for DoH */
+ uint32_t cacheKeyUDP{0};
+ const uint16_t qtype;
+ const uint16_t qclass;
+ uint16_t ecsPrefixLength;
+ uint16_t origFlags;
+ uint16_t cacheFlags{0}; /* DNS flags as sent to the backend */
+ const dnsdist::Protocol protocol;
+ uint8_t ednsRCode{0};
+ bool skipCache{false};
+ bool ecsOverride;
+ bool useECS{true};
+ bool addXPF{true};
+ bool ecsSet{false};
+ bool ecsAdded{false};
+ bool ednsAdded{false};
+ bool useZeroScope{false};
+ bool dnssecOK{false};
+};
+
+struct DNSResponse : DNSQuestion
+{
+ DNSResponse(const DNSName* name, uint16_t type, uint16_t class_, const ComboAddress* lc, const ComboAddress* rem, PacketBuffer& data_, dnsdist::Protocol proto, const struct timespec* queryTime_):
+ DNSQuestion(name, type, class_, lc, rem, data_, proto, queryTime_) { }
+ DNSResponse(const DNSResponse&) = delete;
+ DNSResponse& operator=(const DNSResponse&) = delete;
+ DNSResponse(DNSResponse&&) = default;
+};
+
+/* so what could you do:
+ drop,
+ fake up nxdomain,
+ provide actual answer,
+ allow & and stop processing,
+ continue processing,
+ modify header: (servfail|refused|notimp), set TC=1,
+ send to pool */
+
+class DNSAction
+{
+public:
+ enum class Action : uint8_t { Drop, Nxdomain, Refused, Spoof, Allow, HeaderModify, Pool, Delay, Truncate, ServFail, None, NoOp, NoRecurse, SpoofRaw };
+ static std::string typeToString(const Action& action)
+ {
+ switch(action) {
+ case Action::Drop:
+ return "Drop";
+ case Action::Nxdomain:
+ return "Send NXDomain";
+ case Action::Refused:
+ return "Send Refused";
+ case Action::Spoof:
+ return "Spoof an answer";
+ case Action::SpoofRaw:
+ return "Spoof an answer from raw bytes";
+ case Action::Allow:
+ return "Allow";
+ case Action::HeaderModify:
+ return "Modify the header";
+ case Action::Pool:
+ return "Route to a pool";
+ case Action::Delay:
+ return "Delay";
+ case Action::Truncate:
+ return "Truncate over UDP";
+ case Action::ServFail:
+ return "Send ServFail";
+ case Action::None:
+ case Action::NoOp:
+ return "Do nothing";
+ case Action::NoRecurse:
+ return "Set rd=0";
+ }
+
+ return "Unknown";
+ }
+
+ virtual Action operator()(DNSQuestion*, string* ruleresult) const =0;
+ virtual ~DNSAction()
+ {
+ }
+ virtual string toString() const = 0;
+ virtual std::map<string, double> getStats() const
+ {
+ return {{}};
+ }
+ virtual void reload()
+ {
+ }
+};
+
+class DNSResponseAction
+{
+public:
+ enum class Action : uint8_t { Allow, Delay, Drop, HeaderModify, ServFail, None };
+ virtual Action operator()(DNSResponse*, string* ruleresult) const =0;
+ virtual ~DNSResponseAction()
+ {
+ }
+ virtual string toString() const = 0;
+ virtual void reload()
+ {
+ }
+};
+
+struct DynBlock
+{
+ DynBlock(): action(DNSAction::Action::None), warning(false)
+ {
+ until.tv_sec = 0;
+ until.tv_nsec = 0;
+ }
+
+ DynBlock(const std::string& reason_, const struct timespec& until_, const DNSName& domain_, DNSAction::Action action_): reason(reason_), domain(domain_), until(until_), action(action_), warning(false)
+ {
+ }
+
+ DynBlock(const DynBlock& rhs): reason(rhs.reason), domain(rhs.domain), until(rhs.until), action(rhs.action), warning(rhs.warning), bpf(rhs.bpf)
+ {
+ blocks.store(rhs.blocks);
+ }
+
+ DynBlock(DynBlock&& rhs): reason(std::move(rhs.reason)), domain(std::move(rhs.domain)), until(rhs.until), action(rhs.action), warning(rhs.warning), bpf(rhs.bpf)
+ {
+ blocks.store(rhs.blocks);
+ }
+
+ DynBlock& operator=(const DynBlock& rhs)
+ {
+ reason = rhs.reason;
+ until = rhs.until;
+ domain = rhs.domain;
+ action = rhs.action;
+ blocks.store(rhs.blocks);
+ warning = rhs.warning;
+ bpf = rhs.bpf;
+ return *this;
+ }
+
+ DynBlock& operator=(DynBlock&& rhs)
+ {
+ reason = std::move(rhs.reason);
+ until = rhs.until;
+ domain = std::move(rhs.domain);
+ action = rhs.action;
+ blocks.store(rhs.blocks);
+ warning = rhs.warning;
+ bpf = rhs.bpf;
+ return *this;
+ }
+
+ string reason;
+ DNSName domain;
+ struct timespec until;
+ mutable std::atomic<unsigned int> blocks;
+ DNSAction::Action action{DNSAction::Action::None};
+ bool warning{false};
+ bool bpf{false};
+};
+
+extern GlobalStateHolder<NetmaskTree<DynBlock, AddressAndPortRange>> g_dynblockNMG;
+
+extern vector<pair<struct timeval, std::string> > g_confDelta;
+
+using pdns::stat_t;
+
+struct DNSDistStats
+{
+ stat_t responses{0};
+ stat_t servfailResponses{0};
+ stat_t queries{0};
+ stat_t frontendNXDomain{0};
+ stat_t frontendServFail{0};
+ stat_t frontendNoError{0};
+ stat_t nonCompliantQueries{0};
+ stat_t nonCompliantResponses{0};
+ stat_t rdQueries{0};
+ stat_t emptyQueries{0};
+ stat_t aclDrops{0};
+ stat_t dynBlocked{0};
+ stat_t ruleDrop{0};
+ stat_t ruleNXDomain{0};
+ stat_t ruleRefused{0};
+ stat_t ruleServFail{0};
+ stat_t ruleTruncated{0};
+ stat_t selfAnswered{0};
+ stat_t downstreamTimeouts{0};
+ stat_t downstreamSendErrors{0};
+ stat_t truncFail{0};
+ stat_t noPolicy{0};
+ stat_t cacheHits{0};
+ stat_t cacheMisses{0};
+ stat_t latency0_1{0}, latency1_10{0}, latency10_50{0}, latency50_100{0}, latency100_1000{0}, latencySlow{0}, latencySum{0}, latencyCount{0};
+ stat_t securityStatus{0};
+ stat_t dohQueryPipeFull{0};
+ stat_t dohResponsePipeFull{0};
+ stat_t outgoingDoHQueryPipeFull{0};
+ stat_t proxyProtocolInvalid{0};
+ stat_t tcpQueryPipeFull{0};
+ stat_t tcpCrossProtocolQueryPipeFull{0};
+ stat_t tcpCrossProtocolResponsePipeFull{0};
+
+ double latencyAvg100{0}, latencyAvg1000{0}, latencyAvg10000{0}, latencyAvg1000000{0};
+ typedef std::function<uint64_t(const std::string&)> statfunction_t;
+ typedef boost::variant<stat_t*, double*, statfunction_t> entry_t;
+ std::vector<std::pair<std::string, entry_t>> entries{
+ {"responses", &responses},
+ {"servfail-responses", &servfailResponses},
+ {"queries", &queries},
+ {"frontend-nxdomain", &frontendNXDomain},
+ {"frontend-servfail", &frontendServFail},
+ {"frontend-noerror", &frontendNoError},
+ {"acl-drops", &aclDrops},
+ {"rule-drop", &ruleDrop},
+ {"rule-nxdomain", &ruleNXDomain},
+ {"rule-refused", &ruleRefused},
+ {"rule-servfail", &ruleServFail},
+ {"rule-truncated", &ruleTruncated},
+ {"self-answered", &selfAnswered},
+ {"downstream-timeouts", &downstreamTimeouts},
+ {"downstream-send-errors", &downstreamSendErrors},
+ {"trunc-failures", &truncFail},
+ {"no-policy", &noPolicy},
+ {"latency0-1", &latency0_1},
+ {"latency1-10", &latency1_10},
+ {"latency10-50", &latency10_50},
+ {"latency50-100", &latency50_100},
+ {"latency100-1000", &latency100_1000},
+ {"latency-slow", &latencySlow},
+ {"latency-avg100", &latencyAvg100},
+ {"latency-avg1000", &latencyAvg1000},
+ {"latency-avg10000", &latencyAvg10000},
+ {"latency-avg1000000", &latencyAvg1000000},
+ {"uptime", uptimeOfProcess},
+ {"real-memory-usage", getRealMemoryUsage},
+ {"special-memory-usage", getSpecialMemoryUsage},
+ {"udp-in-errors", std::bind(udpErrorStats, "udp-in-errors")},
+ {"udp-noport-errors", std::bind(udpErrorStats, "udp-noport-errors")},
+ {"udp-recvbuf-errors", std::bind(udpErrorStats, "udp-recvbuf-errors")},
+ {"udp-sndbuf-errors", std::bind(udpErrorStats, "udp-sndbuf-errors")},
+ {"udp-in-csum-errors", std::bind(udpErrorStats, "udp-in-csum-errors")},
+ {"udp6-in-errors", std::bind(udp6ErrorStats, "udp6-in-errors")},
+ {"udp6-recvbuf-errors", std::bind(udp6ErrorStats, "udp6-recvbuf-errors")},
+ {"udp6-sndbuf-errors", std::bind(udp6ErrorStats, "udp6-sndbuf-errors")},
+ {"udp6-noport-errors", std::bind(udp6ErrorStats, "udp6-noport-errors")},
+ {"udp6-in-csum-errors", std::bind(udp6ErrorStats, "udp6-in-csum-errors")},
+ {"tcp-listen-overflows", std::bind(tcpErrorStats, "ListenOverflows")},
+ {"noncompliant-queries", &nonCompliantQueries},
+ {"noncompliant-responses", &nonCompliantResponses},
+ {"proxy-protocol-invalid", &proxyProtocolInvalid},
+ {"rdqueries", &rdQueries},
+ {"empty-queries", &emptyQueries},
+ {"cache-hits", &cacheHits},
+ {"cache-misses", &cacheMisses},
+ {"cpu-iowait", getCPUIOWait},
+ {"cpu-steal", getCPUSteal},
+ {"cpu-sys-msec", getCPUTimeSystem},
+ {"cpu-user-msec", getCPUTimeUser},
+ {"fd-usage", getOpenFileDescriptors},
+ {"dyn-blocked", &dynBlocked},
+ {"dyn-block-nmg-size", [](const std::string&) { return g_dynblockNMG.getLocal()->size(); }},
+ {"security-status", &securityStatus},
+ {"doh-query-pipe-full", &dohQueryPipeFull},
+ {"doh-response-pipe-full", &dohResponsePipeFull},
+ {"outgoing-doh-query-pipe-full", &outgoingDoHQueryPipeFull},
+ {"tcp-query-pipe-full", &tcpQueryPipeFull},
+ {"tcp-cross-protocol-query-pipe-full", &tcpCrossProtocolQueryPipeFull},
+ {"tcp-cross-protocol-response-pipe-full", &tcpCrossProtocolResponsePipeFull},
+ // Latency histogram
+ {"latency-sum", &latencySum},
+ {"latency-count", &latencyCount},
+ };
+};
+
+extern struct DNSDistStats g_stats;
+void doLatencyStats(double udiff);
+
+#include "dnsdist-idstate.hh"
+
+class BasicQPSLimiter
+{
+public:
+ BasicQPSLimiter()
+ {
+ }
+
+ BasicQPSLimiter(unsigned int burst): d_tokens(burst)
+ {
+ d_prev.start();
+ }
+
+ virtual ~BasicQPSLimiter()
+ {
+ }
+
+ bool check(unsigned int rate, unsigned int burst) const // this is not quite fair
+ {
+ if (checkOnly(rate, burst)) {
+ addHit();
+ return true;
+ }
+
+ return false;
+ }
+
+ bool checkOnly(unsigned int rate, unsigned int burst) const // this is not quite fair
+ {
+ auto delta = d_prev.udiffAndSet();
+
+ if (delta > 0.0) { // time, frequently, does go backwards..
+ d_tokens += 1.0 * rate * (delta/1000000.0);
+ }
+
+ if (d_tokens > burst) {
+ d_tokens = burst;
+ }
+
+ bool ret = false;
+ if (d_tokens >= 1.0) { // we need this because burst=1 is weird otherwise
+ ret = true;
+ }
+
+ return ret;
+ }
+
+ virtual void addHit() const
+ {
+ --d_tokens;
+ }
+
+ bool seenSince(const struct timespec& cutOff) const
+ {
+ return cutOff < d_prev.d_start;
+ }
+
+protected:
+ mutable StopWatch d_prev;
+ mutable double d_tokens{0.0};
+};
+
+class QPSLimiter : public BasicQPSLimiter
+{
+public:
+ QPSLimiter(): BasicQPSLimiter()
+ {
+ }
+
+ QPSLimiter(unsigned int rate, unsigned int burst): BasicQPSLimiter(burst), d_rate(rate), d_burst(burst), d_passthrough(false)
+ {
+ d_prev.start();
+ }
+
+ unsigned int getRate() const
+ {
+ return d_passthrough ? 0 : d_rate;
+ }
+
+ bool check() const // this is not quite fair
+ {
+ if (d_passthrough) {
+ return true;
+ }
+
+ return BasicQPSLimiter::check(d_rate, d_burst);
+ }
+
+ bool checkOnly() const
+ {
+ if (d_passthrough) {
+ return true;
+ }
+
+ return BasicQPSLimiter::checkOnly(d_rate, d_burst);
+ }
+
+ void addHit() const override
+ {
+ if (!d_passthrough) {
+ --d_tokens;
+ }
+ }
+
+private:
+ unsigned int d_rate{0};
+ unsigned int d_burst{0};
+ bool d_passthrough{true};
+};
+
+typedef std::unordered_map<string, unsigned int> QueryCountRecords;
+typedef std::function<std::tuple<bool, string>(const DNSQuestion* dq)> QueryCountFilter;
+struct QueryCount {
+ QueryCount()
+ {
+ }
+ ~QueryCount()
+ {
+ }
+ SharedLockGuarded<QueryCountRecords> records;
+ QueryCountFilter filter;
+ bool enabled{false};
+};
+
+extern QueryCount g_qcount;
+
+struct ClientState
+{
+ ClientState(const ComboAddress& local_, bool isTCP_, bool doReusePort, int fastOpenQueue, const std::string& itfName, const std::set<int>& cpus_): cpus(cpus_), interface(itfName), local(local_), fastOpenQueueSize(fastOpenQueue), tcp(isTCP_), reuseport(doReusePort)
+ {
+ }
+
+ stat_t queries{0};
+ mutable stat_t responses{0};
+ mutable stat_t tcpDiedReadingQuery{0};
+ mutable stat_t tcpDiedSendingResponse{0};
+ mutable stat_t tcpGaveUp{0};
+ mutable stat_t tcpClientTimeouts{0};
+ mutable stat_t tcpDownstreamTimeouts{0};
+ /* current number of connections to this frontend */
+ mutable stat_t tcpCurrentConnections{0};
+ /* maximum number of concurrent connections to this frontend reached */
+ mutable stat_t tcpMaxConcurrentConnections{0};
+ stat_t tlsNewSessions{0}; // A new TLS session has been negotiated, no resumption
+ stat_t tlsResumptions{0}; // A TLS session has been resumed, either via session id or via a TLS ticket
+ stat_t tlsUnknownTicketKey{0}; // A TLS ticket has been presented but we don't have the associated key (might have expired)
+ stat_t tlsInactiveTicketKey{0}; // A TLS ticket has been successfully resumed but the key is no longer active, we should issue a new one
+ stat_t tls10queries{0}; // valid DNS queries received via TLSv1.0
+ stat_t tls11queries{0}; // valid DNS queries received via TLSv1.1
+ stat_t tls12queries{0}; // valid DNS queries received via TLSv1.2
+ stat_t tls13queries{0}; // valid DNS queries received via TLSv1.3
+ stat_t tlsUnknownqueries{0}; // valid DNS queries received via unknown TLS version
+ pdns::stat_t_trait<double> tcpAvgQueriesPerConnection{0.0};
+ /* in ms */
+ pdns::stat_t_trait<double> tcpAvgConnectionDuration{0.0};
+ std::set<int> cpus;
+ std::string interface;
+ ComboAddress local;
+ std::shared_ptr<DNSCryptContext> dnscryptCtx{nullptr};
+ std::shared_ptr<TLSFrontend> tlsFrontend{nullptr};
+ std::shared_ptr<DOHFrontend> dohFrontend{nullptr};
+ std::shared_ptr<BPFFilter> d_filter{nullptr};
+ size_t d_maxInFlightQueriesPerConn{1};
+ size_t d_tcpConcurrentConnectionsLimit{0};
+ int udpFD{-1};
+ int tcpFD{-1};
+ int tcpListenQueueSize{SOMAXCONN};
+ int fastOpenQueueSize{0};
+ bool muted{false};
+ bool tcp;
+ bool reuseport;
+ bool ready{false};
+
+ int getSocket() const
+ {
+ return udpFD != -1 ? udpFD : tcpFD;
+ }
+
+ bool isUDP() const
+ {
+ return udpFD != -1;
+ }
+
+ bool isTCP() const
+ {
+ return udpFD == -1;
+ }
+
+ bool isDoH() const
+ {
+ return dohFrontend != nullptr;
+ }
+
+ bool hasTLS() const
+ {
+ return tlsFrontend != nullptr || (dohFrontend != nullptr && dohFrontend->isHTTPS());
+ }
+
+ std::string getType() const
+ {
+ std::string result = udpFD != -1 ? "UDP" : "TCP";
+
+ if (dohFrontend) {
+ if (dohFrontend->isHTTPS()) {
+ result += " (DNS over HTTPS)";
+ }
+ else {
+ result += " (DNS over HTTP)";
+ }
+ }
+ else if (tlsFrontend) {
+ result += " (DNS over TLS)";
+ }
+ else if (dnscryptCtx) {
+ result += " (DNSCrypt)";
+ }
+
+ return result;
+ }
+
+ void detachFilter()
+ {
+ if (d_filter) {
+ d_filter->removeSocket(getSocket());
+ d_filter = nullptr;
+ }
+ }
+
+ void attachFilter(shared_ptr<BPFFilter> bpf)
+ {
+ detachFilter();
+
+ bpf->addSocket(getSocket());
+ d_filter = bpf;
+ }
+
+ void updateTCPMetrics(size_t nbQueries, uint64_t durationMs)
+ {
+ tcpAvgQueriesPerConnection = (99.0 * tcpAvgQueriesPerConnection / 100.0) + (nbQueries / 100.0);
+ tcpAvgConnectionDuration = (99.0 * tcpAvgConnectionDuration / 100.0) + (durationMs / 100.0);
+ }
+};
+
+struct CrossProtocolQuery;
+
+struct DownstreamState
+{
+ typedef std::function<std::tuple<DNSName, uint16_t, uint16_t>(const DNSName&, uint16_t, uint16_t, dnsheader*)> checkfunc_t;
+
+ DownstreamState(const ComboAddress& remote_, const ComboAddress& sourceAddr_, unsigned int sourceItf, const std::string& sourceItfName);
+ DownstreamState(const ComboAddress& remote_): DownstreamState(remote_, ComboAddress(), 0, std::string()) {}
+ ~DownstreamState();
+ void connectUDPSockets(size_t numberOfSockets);
+
+ stat_t sendErrors{0};
+ stat_t outstanding{0};
+ stat_t reuseds{0};
+ stat_t queries{0};
+ stat_t responses{0};
+ struct {
+ stat_t sendErrors{0};
+ stat_t reuseds{0};
+ stat_t queries{0};
+ } prev;
+ stat_t tcpDiedSendingQuery{0};
+ stat_t tcpDiedReadingResponse{0};
+ stat_t tcpGaveUp{0};
+ stat_t tcpReadTimeouts{0};
+ stat_t tcpWriteTimeouts{0};
+ stat_t tcpConnectTimeouts{0};
+ /* current number of connections to this backend */
+ stat_t tcpCurrentConnections{0};
+ /* maximum number of concurrent connections to this backend reached */
+ stat_t tcpMaxConcurrentConnections{0};
+ stat_t tcpReusedConnections{0};
+ stat_t tcpNewConnections{0};
+ stat_t tlsResumptions{0};
+ pdns::stat_t_trait<double> tcpAvgQueriesPerConnection{0.0};
+ /* in ms */
+ pdns::stat_t_trait<double> tcpAvgConnectionDuration{0.0};
+ pdns::stat_t_trait<double> queryLoad{0.0};
+ pdns::stat_t_trait<double> dropRate{0.0};
+ boost::uuids::uuid id;
+ const ComboAddress remote;
+ const ComboAddress sourceAddr;
+ SharedLockGuarded<std::vector<unsigned int>> hashes;
+ LockGuarded<std::unique_ptr<FDMultiplexer>> mplexer{nullptr};
+ const std::string sourceItfName;
+ std::string d_tlsSubjectName;
+ std::string d_dohPath;
+private:
+ std::string name;
+ std::string nameWithAddr;
+public:
+ std::shared_ptr<TLSCtx> d_tlsCtx{nullptr};
+ std::vector<int> sockets;
+ vector<IDState> idStates;
+ set<string> pools;
+ std::mutex connectLock;
+ std::thread tid;
+ checkfunc_t checkFunction;
+ DNSName checkName{"a.root-servers.net."};
+ StopWatch sw;
+ QPSLimiter qps;
+ std::atomic<uint64_t> idOffset{0};
+ size_t socketsOffset{0};
+ size_t d_maxInFlightQueriesPerConn{1};
+ size_t d_tcpConcurrentConnectionsLimit{0};
+ double latencyUsec{0.0};
+ double latencyUsecTCP{0.0};
+ int order{1};
+ int weight{1};
+ int tcpConnectTimeout{5};
+ int tcpRecvTimeout{30};
+ int tcpSendTimeout{30};
+ unsigned int checkInterval{1};
+ unsigned int lastCheck{0};
+ const unsigned int sourceItf{0};
+ QType checkType{QType::A};
+ uint16_t checkClass{QClass::IN};
+ uint16_t d_retries{5};
+ uint16_t xpfRRCode{0};
+ uint16_t checkTimeout{1000}; /* in milliseconds */
+ uint8_t currentCheckFailures{0};
+ uint8_t consecutiveSuccessfulChecks{0};
+ uint8_t maxCheckFailures{1};
+ uint8_t minRiseSuccesses{1};
+ enum class Availability : uint8_t { Up, Down, Auto} availability{Availability::Auto};
+private:
+ bool d_stopped{false};
+public:
+ std::atomic<bool> hashesComputed{false};
+ bool mustResolve{false};
+ bool upStatus{false};
+ bool useECS{false};
+ bool useProxyProtocol{false};
+ bool setCD{false};
+ bool disableZeroScope{false};
+ std::atomic<bool> connected{false};
+ std::atomic_flag threadStarted;
+ bool tcpFastOpen{false};
+ bool ipBindAddrNoPort{true};
+ bool reconnectOnUp{false};
+ bool d_tcpCheck{false};
+ bool d_tcpOnly{false};
+ bool d_addXForwardedHeaders{false}; // for DoH backends
+
+ bool isUp() const
+ {
+ if(availability == Availability::Down)
+ return false;
+ if(availability == Availability::Up)
+ return true;
+ return upStatus;
+ }
+ void setUp() { availability = Availability::Up; }
+ void setUpStatus(bool newStatus)
+ {
+ upStatus = newStatus;
+ if (!upStatus)
+ latencyUsec = 0.0;
+ }
+ void setDown()
+ {
+ availability = Availability::Down;
+ latencyUsec = 0.0;
+ }
+ void setAuto() { availability = Availability::Auto; }
+ const string& getName() const {
+ return name;
+ }
+ const string& getNameWithAddr() const {
+ return nameWithAddr;
+ }
+ void setName(const std::string& newName)
+ {
+ name = newName;
+ nameWithAddr = newName.empty() ? remote.toStringWithPort() : (name + " (" + remote.toStringWithPort()+ ")");
+ }
+
+ string getStatus() const
+ {
+ string status;
+ if(availability == DownstreamState::Availability::Up)
+ status = "UP";
+ else if(availability == DownstreamState::Availability::Down)
+ status = "DOWN";
+ else
+ status = (upStatus ? "up" : "down");
+ return status;
+ }
+ bool reconnect();
+ void hash();
+ void setId(const boost::uuids::uuid& newId);
+ void setWeight(int newWeight);
+ void stop();
+ bool isStopped() const
+ {
+ return d_stopped;
+ }
+ const boost::uuids::uuid& getID() const
+ {
+ return id;
+ }
+
+ void updateTCPMetrics(size_t nbQueries, uint64_t durationMs)
+ {
+ tcpAvgQueriesPerConnection = (99.0 * tcpAvgQueriesPerConnection / 100.0) + (nbQueries / 100.0);
+ tcpAvgConnectionDuration = (99.0 * tcpAvgConnectionDuration / 100.0) + (durationMs / 100.0);
+ }
+
+ void incQueriesCount()
+ {
+ ++queries;
+ qps.addHit();
+ }
+
+ void incCurrentConnectionsCount();
+
+ bool doHealthcheckOverTCP() const
+ {
+ return d_tcpOnly || d_tcpCheck || d_tlsCtx != nullptr;
+ }
+
+ bool isTCPOnly() const
+ {
+ return d_tcpOnly || d_tlsCtx != nullptr;
+ }
+
+ bool isDoH() const
+ {
+ return !d_dohPath.empty();
+ }
+
+ bool passCrossProtocolQuery(std::unique_ptr<CrossProtocolQuery>&& cpq);
+ dnsdist::Protocol getProtocol() const
+ {
+ if (isDoH()) {
+ return dnsdist::Protocol::DoH;
+ }
+ if (d_tlsCtx != nullptr) {
+ return dnsdist::Protocol::DoT;
+ }
+ if (isTCPOnly()) {
+ return dnsdist::Protocol::DoTCP;
+ }
+ return dnsdist::Protocol::DoUDP;
+ }
+};
+using servers_t =vector<std::shared_ptr<DownstreamState>>;
+
+void responderThread(std::shared_ptr<DownstreamState> state);
+extern LockGuarded<LuaContext> g_lua;
+extern std::string g_outputBuffer; // locking for this is ok, as locked by g_luamutex
+
+class DNSRule
+{
+public:
+ virtual ~DNSRule ()
+ {
+ }
+ virtual bool matches(const DNSQuestion* dq) const =0;
+ virtual string toString() const = 0;
+ mutable stat_t d_matches{0};
+};
+
+struct ServerPool
+{
+ ServerPool(): d_servers(std::make_shared<ServerPolicy::NumberedServerVector>())
+ {
+ }
+
+ ~ServerPool()
+ {
+ }
+
+ const std::shared_ptr<DNSDistPacketCache> getCache() const { return packetCache; };
+
+ bool getECS() const
+ {
+ return d_useECS;
+ }
+
+ void setECS(bool useECS)
+ {
+ d_useECS = useECS;
+ }
+
+ std::shared_ptr<DNSDistPacketCache> packetCache{nullptr};
+ std::shared_ptr<ServerPolicy> policy{nullptr};
+
+ size_t poolLoad();
+ size_t countServers(bool upOnly);
+ const std::shared_ptr<ServerPolicy::NumberedServerVector> getServers();
+ void addServer(shared_ptr<DownstreamState>& server);
+ void removeServer(shared_ptr<DownstreamState>& server);
+
+private:
+ SharedLockGuarded<std::shared_ptr<ServerPolicy::NumberedServerVector>> d_servers;
+ bool d_useECS{false};
+};
+
+struct CarbonConfig
+{
+ ComboAddress server;
+ std::string namespace_name;
+ std::string ourname;
+ std::string instance_name;
+ unsigned int interval;
+};
+
+enum ednsHeaderFlags {
+ EDNS_HEADER_FLAG_NONE = 0,
+ EDNS_HEADER_FLAG_DO = 32768
+};
+
+struct DNSDistRuleAction
+{
+ std::shared_ptr<DNSRule> d_rule;
+ std::shared_ptr<DNSAction> d_action;
+ std::string d_name;
+ boost::uuids::uuid d_id;
+ uint64_t d_creationOrder;
+};
+
+struct DNSDistResponseRuleAction
+{
+ std::shared_ptr<DNSRule> d_rule;
+ std::shared_ptr<DNSResponseAction> d_action;
+ std::string d_name;
+ boost::uuids::uuid d_id;
+ uint64_t d_creationOrder;
+};
+
+extern GlobalStateHolder<SuffixMatchTree<DynBlock>> g_dynblockSMT;
+extern DNSAction::Action g_dynBlockAction;
+
+extern GlobalStateHolder<vector<CarbonConfig> > g_carbon;
+extern GlobalStateHolder<ServerPolicy> g_policy;
+extern GlobalStateHolder<servers_t> g_dstates;
+extern GlobalStateHolder<pools_t> g_pools;
+extern GlobalStateHolder<vector<DNSDistRuleAction> > g_ruleactions;
+extern GlobalStateHolder<vector<DNSDistResponseRuleAction> > g_respruleactions;
+extern GlobalStateHolder<vector<DNSDistResponseRuleAction> > g_cachehitrespruleactions;
+extern GlobalStateHolder<vector<DNSDistResponseRuleAction> > g_selfansweredrespruleactions;
+extern GlobalStateHolder<NetmaskGroup> g_ACL;
+
+extern ComboAddress g_serverControl; // not changed during runtime
+
+extern std::vector<shared_ptr<TLSFrontend>> g_tlslocals;
+extern std::vector<shared_ptr<DOHFrontend>> g_dohlocals;
+extern std::vector<std::unique_ptr<ClientState>> g_frontends;
+extern bool g_truncateTC;
+extern bool g_fixupCase;
+extern int g_tcpRecvTimeout;
+extern int g_tcpSendTimeout;
+extern int g_udpTimeout;
+extern uint16_t g_maxOutstanding;
+extern std::atomic<bool> g_configurationDone;
+extern boost::optional<uint64_t> g_maxTCPClientThreads;
+extern uint64_t g_maxTCPQueuedConnections;
+extern size_t g_maxTCPQueriesPerConn;
+extern size_t g_maxTCPConnectionDuration;
+extern size_t g_maxTCPConnectionsPerClient;
+extern size_t g_tcpInternalPipeBufferSize;
+extern pdns::stat16_t g_cacheCleaningDelay;
+extern pdns::stat16_t g_cacheCleaningPercentage;
+extern uint32_t g_staleCacheEntriesTTL;
+extern bool g_apiReadWrite;
+extern std::string g_apiConfigDirectory;
+extern bool g_servFailOnNoPolicy;
+extern size_t g_udpVectorSize;
+extern bool g_allowEmptyResponse;
+extern uint32_t g_socketUDPSendBuffer;
+extern uint32_t g_socketUDPRecvBuffer;
+
+extern shared_ptr<BPFFilter> g_defaultBPFFilter;
+extern std::vector<std::shared_ptr<DynBPFFilter> > g_dynBPFFilters;
+
+struct LocalHolders
+{
+ LocalHolders(): acl(g_ACL.getLocal()), policy(g_policy.getLocal()), ruleactions(g_ruleactions.getLocal()), cacheHitRespRuleactions(g_cachehitrespruleactions.getLocal()), selfAnsweredRespRuleactions(g_selfansweredrespruleactions.getLocal()), servers(g_dstates.getLocal()), dynNMGBlock(g_dynblockNMG.getLocal()), dynSMTBlock(g_dynblockSMT.getLocal()), pools(g_pools.getLocal())
+ {
+ }
+
+ LocalStateHolder<NetmaskGroup> acl;
+ LocalStateHolder<ServerPolicy> policy;
+ LocalStateHolder<vector<DNSDistRuleAction> > ruleactions;
+ LocalStateHolder<vector<DNSDistResponseRuleAction> > cacheHitRespRuleactions;
+ LocalStateHolder<vector<DNSDistResponseRuleAction> > selfAnsweredRespRuleactions;
+ LocalStateHolder<servers_t> servers;
+ LocalStateHolder<NetmaskTree<DynBlock, AddressAndPortRange> > dynNMGBlock;
+ LocalStateHolder<SuffixMatchTree<DynBlock> > dynSMTBlock;
+ LocalStateHolder<pools_t> pools;
+};
+
+vector<std::function<void(void)>> setupLua(bool client, const std::string& config);
+
+void tcpAcceptorThread(ClientState* p);
+
+#ifdef HAVE_DNS_OVER_HTTPS
+void dohThread(ClientState* cs);
+#endif /* HAVE_DNS_OVER_HTTPS */
+
+void setLuaNoSideEffect(); // if nothing has been declared, set that there are no side effects
+void setLuaSideEffect(); // set to report a side effect, cancelling all _no_ side effect calls
+bool getLuaNoSideEffect(); // set if there were only explicit declarations of _no_ side effect
+void resetLuaSideEffect(); // reset to indeterminate state
+
+bool responseContentMatches(const PacketBuffer& response, const DNSName& qname, const uint16_t qtype, const uint16_t qclass, const ComboAddress& remote, unsigned int& qnameWireLength);
+bool processResponse(PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted, bool receivedOverUDP);
+bool processRulesResult(const DNSAction::Action& action, DNSQuestion& dq, std::string& ruleresult, bool& drop);
+
+bool checkQueryHeaders(const struct dnsheader* dh);
+
+extern std::vector<std::shared_ptr<DNSCryptContext>> g_dnsCryptLocals;
+int handleDNSCryptQuery(PacketBuffer& packet, DNSCryptQuery& query, bool tcp, time_t now, PacketBuffer& response);
+bool checkDNSCryptQuery(const ClientState& cs, PacketBuffer& query, std::unique_ptr<DNSCryptQuery>& dnsCryptQuery, time_t now, bool tcp);
+
+uint16_t getRandomDNSID();
+
+#include "dnsdist-snmp.hh"
+
+extern bool g_snmpEnabled;
+extern bool g_snmpTrapsEnabled;
+extern DNSDistSNMPAgent* g_snmpAgent;
+extern bool g_addEDNSToSelfGeneratedResponses;
+
+extern std::set<std::string> g_capabilitiesToRetain;
+static const uint16_t s_udpIncomingBufferSize{1500}; // don't accept UDP queries larger than this value
+static const size_t s_maxPacketCacheEntrySize{4096}; // don't cache responses larger than this value
+
+enum class ProcessQueryResult : uint8_t { Drop, SendAnswer, PassToBackend };
+ProcessQueryResult processQuery(DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend);
+
+DNSResponse makeDNSResponseFromIDState(IDState& ids, PacketBuffer& data);
+void setIDStateFromDNSQuestion(IDState& ids, DNSQuestion& dq, DNSName&& qname);
+
+int pickBackendSocketForSending(std::shared_ptr<DownstreamState>& state);
+ssize_t udpClientSendRequestToBackend(const std::shared_ptr<DownstreamState>& ss, const int sd, const PacketBuffer& request, bool healthCheck = false);
+void handleResponseSent(const IDState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol protocol);
+
+void carbonDumpThread();
diff --git a/dnsdist.service.in b/dnsdist.service.in
new file mode 100644
index 0000000..bb11a26
--- /dev/null
+++ b/dnsdist.service.in
@@ -0,0 +1,53 @@
+[Unit]
+Description=DNS Loadbalancer
+Documentation=man:dnsdist(1)
+Documentation=https://dnsdist.org
+Wants=network-online.target
+After=network-online.target
+
+[Service]
+ExecStartPre=@bindir@/dnsdist --check-config
+# Note: when editing the ExecStart command, keep --supervised and --disable-syslog
+ExecStart=@bindir@/dnsdist --supervised --disable-syslog
+User=@service_user@
+Group=@service_group@
+SyslogIdentifier=dnsdist
+Type=notify
+Restart=on-failure
+RestartSec=2
+TimeoutStopSec=5
+StartLimitInterval=0
+
+# Tuning
+TasksMax=8192
+LimitNOFILE=16384
+# Note: increasing the amount of lockable memory is required to use eBPF support
+# LimitMEMLOCK=infinity
+
+# Sandboxing
+# Note: adding CAP_SYS_ADMIN (or CAP_BPF for Linux >= 5.8) is required to use eBPF support,
+# and CAP_NET_RAW to be able to set the source interface to contact a backend
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+LockPersonality=true
+NoNewPrivileges=true
+PrivateDevices=true
+PrivateTmp=true
+# Setting PrivateUsers=true prevents us from opening our sockets
+ProtectClock=true
+ProtectControlGroups=true
+ProtectHome=true
+ProtectHostname=true
+ProtectKernelLogs=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+ProtectSystem=full
+RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
+RestrictNamespaces=true
+RestrictRealtime=true
+RestrictSUIDSGID=true
+SystemCallArchitectures=native
+SystemCallFilter=~ @clock @debug @module @mount @raw-io @reboot @swap @cpu-emulation @obsolete
+
+[Install]
+WantedBy=multi-user.target
diff --git a/dnsdistconf.lua b/dnsdistconf.lua
new file mode 100644
index 0000000..2b218d5
--- /dev/null
+++ b/dnsdistconf.lua
@@ -0,0 +1,113 @@
+-- == Generic Configuration ==
+
+-- only accept queries (Do53, DNSCrypt, DoT or DoH) from a few subnets
+-- see https://dnsdist.org/advanced/acl.html for more details
+-- please be careful when dnsdist is deployed in front of a server
+-- server granting access based on the source IP, as all queries will
+-- seem to originate from dnsdist, which might be especially relevant for
+-- AXFR, IXFR, NOTIFY and UPDATE
+-- https://dnsdist.org/advanced/axfr.html
+-- setACL({'192.0.2.0/28', '2001:DB8:1::/56'})
+
+-- listen for console connection with the given secret key
+-- https://dnsdist.org/guides/console.html
+-- controlSocket("127.0.0.1:5900")
+-- setKey("please generate a fresh private key with makeKey()")
+
+-- start the web server on port 8083, using password 'set a random password here'
+-- https://dnsdist.org/guides/webserver.html
+-- webserver("127.0.0.1:8083", "set a random password here")
+
+-- send statistics to PowerDNS metronome server https://metronome1.powerdns.com/
+-- https://dnsdist.org/guides/carbon.html
+-- carbonServer("37.252.122.50", 'unique-name')
+
+-- accept plain DNS (Do53) queries on UDP/5200 and TCP/5200
+-- addLocal("127.0.0.1:5200")
+
+-- accept DNSCrypt queries on UDP/8443 and TCP/8443
+-- https://dnsdist.org/guides/dnscrypt.html
+-- addDNSCryptBind("127.0.0.1:8443", "2.provider.name", "DNSCryptResolver.cert", "DNSCryptResolver.key")
+
+-- accept DNS over TLS (DoT) queries on TCP/9443
+-- https://dnsdist.org/guides/dns-over-tls.html
+-- addTLSLocal("127.0.0.1:9443", {"server.crt"}, {"server.key"}, { provider="openssl" })
+
+-- accept DNS over HTTPS (DoH) queries on TCP/443
+-- https://dnsdist.org/guides/dns-over-https.html
+-- addDOHLocal("127.0.0.1:443", {"server.crt"}, {"server.key"})
+
+-- define downstream servers, aka backends
+-- https://dnsdist.org/guides/downstreams.html
+-- https://dnsdist.org/guides/serverpools.html
+-- https://dnsdist.org/guides/serverselection.html
+-- newServer("192.0.2.1")
+-- newServer({address="192.0.2.1:5300", pool="abuse"})
+
+-- == Tuning ==
+
+-- Increase the in-memory rings size (the default, 10000, is only one second at 10k qps) used by
+-- live-traffic inspection features like grepq, and use 100 shards to improve performance
+-- setRingBuffersSize(1000000, 100)
+
+-- increase the number of TCP workers, each one being capable of handling a large number
+-- of TCP connections since 1.4.0
+-- setMaxTCPClientThreads(20)
+
+-- == Sample Actions ==
+
+-- https://dnsdist.org/rules-actions.html
+
+-- send the queries for selected domain suffixes to the servers
+-- in the 'abuse' pool
+-- addAction({"abuse.example.org.", "xxx."}, PoolAction("abuse"))
+
+-- drop queries for this exact qname
+-- addAction(QNameRule("drop-me.example.org."), DropAction())
+
+-- send the queries from a selected subnet to the
+-- abuse pool
+-- addAction("192.0.2.0/24", PoolAction("abuse"))
+
+-- Refuse incoming AXFR, IXFR, NOTIFY and UPDATE
+-- Add trusted sources (slaves, masters) explicitely in front of this rule
+-- addAction(OrRule({OpcodeRule(DNSOpcode.Notify), OpcodeRule(DNSOpcode.Update), QTypeRule(DNSQType.AXFR), QTypeRule(DNSQType.IXFR)}), RCodeAction(DNSRCode.REFUSED))
+
+-- == Dynamic Blocks ==
+
+-- define a dynamic block rules group object, set a few limits and apply it
+-- see https://dnsdist.org/guides/dynblocks.html for more details
+
+-- local dbr = dynBlockRulesGroup()
+-- dbr:setQueryRate(30, 10, "Exceeded query rate", 60)
+-- dbr:setRCodeRate(dnsdist.NXDOMAIN, 20, 10, "Exceeded NXD rate", 60)
+-- dbr:setRCodeRate(dnsdist.SERVFAIL, 20, 10, "Exceeded ServFail rate", 60)
+-- dbr:setQTypeRate(dnsdist.ANY, 5, 10, "Exceeded ANY rate", 60)
+-- dbr:setResponseByteRate(10000, 10, "Exceeded resp BW rate", 60)
+-- function maintenance()
+-- dbr:apply()
+-- end
+
+-- == Logging ==
+
+-- connect to a remote protobuf logger and export queries and responses
+-- https://dnsdist.org/reference/protobuf.html
+-- rl = newRemoteLogger('127.0.0.1:4242')
+-- addAction(AllRule(), RemoteLogAction(rl))
+-- addResponseAction(AllRule(), RemoteLogResponseAction(rl))
+
+-- DNSTAP is also supported
+-- https://dnsdist.org/reference/dnstap.html
+-- fstr = newFrameStreamUnixLogger(/path/to/unix/socket)
+-- or
+-- fstr = newFrameStreamTcpLogger('192.0.2.1:4242')
+-- addAction(AllRule(), DnstapLogAction(fstr))
+-- addResponseAction(AllRule(), DnstapLogResponseAction(fstr))
+
+-- == Caching ==
+
+-- https://dnsdist.org/guides/cache.html
+-- create a packet cache of at most 100k entries,
+-- and apply it to the default pool
+-- pc = newPacketCache(100000)
+-- getPool(""):setCache(pc)
diff --git a/dnslabeltext.cc b/dnslabeltext.cc
new file mode 100644
index 0000000..696200c
--- /dev/null
+++ b/dnslabeltext.cc
@@ -0,0 +1,964 @@
+
+#line 1 "dnslabeltext.rl"
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string>
+#include "dnsname.hh"
+#include "namespaces.hh"
+#include "dnswriter.hh"
+#include "misc.hh"
+
+namespace {
+void appendSplit(vector<string>& ret, string& segment, char c)
+{
+ if(segment.size()>254) {
+ ret.push_back(segment);
+ segment.clear();
+ }
+ segment.append(1, c);
+}
+
+}
+
+vector<string> segmentDNSText(const string& input )
+{
+ // cerr<<"segmentDNSText("<<input<<")"<<endl;
+
+#line 30 "dnslabeltext.cc"
+static const char _dnstext_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 2, 0, 1,
+ 2, 4, 5
+};
+
+static const char _dnstext_key_offsets[] = {
+ 0, 0, 1, 3, 5, 7, 9, 11,
+ 15
+};
+
+static const unsigned char _dnstext_trans_keys[] = {
+ 34u, 34u, 92u, 48u, 57u, 48u, 57u, 48u,
+ 57u, 34u, 92u, 32u, 34u, 9u, 13u, 34u,
+ 0
+};
+
+static const char _dnstext_single_lengths[] = {
+ 0, 1, 2, 0, 0, 0, 2, 2,
+ 1
+};
+
+static const char _dnstext_range_lengths[] = {
+ 0, 0, 0, 1, 1, 1, 0, 1,
+ 0
+};
+
+static const char _dnstext_index_offsets[] = {
+ 0, 0, 2, 5, 7, 9, 11, 14,
+ 18
+};
+
+static const char _dnstext_trans_targs[] = {
+ 2, 0, 7, 3, 2, 4, 2, 5,
+ 0, 6, 0, 7, 3, 2, 8, 2,
+ 8, 0, 2, 0, 0
+};
+
+static const char _dnstext_trans_actions[] = {
+ 3, 0, 0, 0, 11, 7, 5, 7,
+ 0, 7, 0, 9, 9, 16, 0, 13,
+ 0, 0, 13, 0, 0
+};
+
+static const char _dnstext_eof_actions[] = {
+ 0, 0, 0, 0, 0, 0, 0, 1,
+ 1
+};
+
+static const int dnstext_start = 1;
+static const int dnstext_first_final = 7;
+static const int dnstext_error = 0;
+
+static const int dnstext_en_main = 1;
+
+
+#line 30 "dnslabeltext.rl"
+
+ (void)dnstext_error; // silence warnings
+ (void)dnstext_en_main;
+ const char *p = input.c_str(), *pe = input.c_str() + input.length();
+ const char* eof = pe;
+ int cs;
+ char val = 0;
+
+ string segment;
+ vector<string> ret;
+
+
+#line 100 "dnslabeltext.cc"
+ {
+ cs = dnstext_start;
+ }
+
+#line 105 "dnslabeltext.cc"
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const unsigned char *_keys;
+
+ if ( p == pe )
+ goto _test_eof;
+ if ( cs == 0 )
+ goto _out;
+_resume:
+ _keys = _dnstext_trans_keys + _dnstext_key_offsets[cs];
+ _trans = _dnstext_index_offsets[cs];
+
+ _klen = _dnstext_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const unsigned char *_lower = _keys;
+ const unsigned char *_mid;
+ const unsigned char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower )
+ break;
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid )
+ _upper = _mid - 1;
+ else if ( (*p) > *_mid )
+ _lower = _mid + 1;
+ else {
+ _trans += (unsigned int)(_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _dnstext_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const unsigned char *_lower = _keys;
+ const unsigned char *_mid;
+ const unsigned char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower )
+ break;
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] )
+ _upper = _mid - 2;
+ else if ( (*p) > _mid[1] )
+ _lower = _mid + 2;
+ else {
+ _trans += (unsigned int)((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
+
+_match:
+ cs = _dnstext_trans_targs[_trans];
+
+ if ( _dnstext_trans_actions[_trans] == 0 )
+ goto _again;
+
+ _acts = _dnstext_actions + _dnstext_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 )
+ {
+ switch ( *_acts++ )
+ {
+ case 0:
+#line 42 "dnslabeltext.rl"
+ {
+ ret.push_back(segment);
+ segment.clear();
+ }
+ break;
+ case 1:
+#line 46 "dnslabeltext.rl"
+ {
+ segment.clear();
+ }
+ break;
+ case 2:
+#line 50 "dnslabeltext.rl"
+ {
+ char c = *p;
+ appendSplit(ret, segment, c);
+ }
+ break;
+ case 3:
+#line 54 "dnslabeltext.rl"
+ {
+ char c = *p;
+ val *= 10;
+ val += c-'0';
+
+ }
+ break;
+ case 4:
+#line 60 "dnslabeltext.rl"
+ {
+ appendSplit(ret, segment, val);
+ val=0;
+ }
+ break;
+ case 5:
+#line 65 "dnslabeltext.rl"
+ {
+ appendSplit(ret, segment, *(p));
+ }
+ break;
+#line 220 "dnslabeltext.cc"
+ }
+ }
+
+_again:
+ if ( cs == 0 )
+ goto _out;
+ if ( ++p != pe )
+ goto _resume;
+ _test_eof: {}
+ if ( p == eof )
+ {
+ const char *__acts = _dnstext_actions + _dnstext_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+#line 42 "dnslabeltext.rl"
+ {
+ ret.push_back(segment);
+ segment.clear();
+ }
+ break;
+#line 243 "dnslabeltext.cc"
+ }
+ }
+ }
+
+ _out: {}
+ }
+
+#line 78 "dnslabeltext.rl"
+
+
+ if ( cs < dnstext_first_final ) {
+ throw runtime_error("Unable to parse DNS TXT '"+input+"'");
+ }
+
+ return ret;
+};
+
+
+DNSName::string_t segmentDNSNameRaw(const char* realinput, size_t inputlen)
+{
+
+#line 265 "dnslabeltext.cc"
+static const char _dnsnameraw_actions[] = {
+ 0, 1, 0, 1, 1, 1, 2, 1,
+ 3, 1, 4, 1, 5, 2, 1, 5,
+ 2, 4, 0, 2, 4, 5
+};
+
+static const char _dnsnameraw_key_offsets[] = {
+ 0, 0, 2, 4, 6, 8, 10, 12
+};
+
+static const unsigned char _dnsnameraw_trans_keys[] = {
+ 46u, 92u, 48u, 57u, 48u, 57u, 48u, 57u,
+ 46u, 92u, 46u, 92u, 46u, 92u, 0
+};
+
+static const char _dnsnameraw_single_lengths[] = {
+ 0, 2, 0, 0, 0, 2, 2, 2
+};
+
+static const char _dnsnameraw_range_lengths[] = {
+ 0, 0, 1, 1, 1, 0, 0, 0
+};
+
+static const char _dnsnameraw_index_offsets[] = {
+ 0, 0, 3, 5, 7, 9, 12, 15
+};
+
+static const char _dnsnameraw_trans_targs[] = {
+ 0, 2, 5, 3, 5, 4, 0, 7,
+ 0, 6, 2, 5, 0, 2, 5, 6,
+ 2, 5, 0
+};
+
+static const char _dnsnameraw_trans_actions[] = {
+ 0, 3, 13, 7, 5, 7, 0, 7,
+ 0, 1, 0, 11, 0, 3, 13, 16,
+ 9, 19, 0
+};
+
+static const char _dnsnameraw_eof_actions[] = {
+ 0, 0, 0, 0, 0, 1, 0, 16
+};
+
+static const int dnsnameraw_start = 1;
+static const int dnsnameraw_first_final = 5;
+static const int dnsnameraw_error = 0;
+
+static const int dnsnameraw_en_main = 1;
+
+
+#line 94 "dnslabeltext.rl"
+
+ (void)dnsnameraw_error; // silence warnings
+ (void)dnsnameraw_en_main;
+
+ DNSName::string_t ret;
+
+ if(!*realinput || *realinput == '.') {
+ ret.append(1, (char)0);
+ return ret;
+ }
+
+ ret.reserve(inputlen+1);
+
+ const char *p = realinput, *pe = realinput + inputlen;
+ const char* eof = pe;
+ int cs;
+ char val = 0;
+ char labellen=0;
+ unsigned int lenpos=0;
+
+#line 337 "dnslabeltext.cc"
+ {
+ cs = dnsnameraw_start;
+ }
+
+#line 342 "dnslabeltext.cc"
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const unsigned char *_keys;
+
+ if ( p == pe )
+ goto _test_eof;
+ if ( cs == 0 )
+ goto _out;
+_resume:
+ _keys = _dnsnameraw_trans_keys + _dnsnameraw_key_offsets[cs];
+ _trans = _dnsnameraw_index_offsets[cs];
+
+ _klen = _dnsnameraw_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const unsigned char *_lower = _keys;
+ const unsigned char *_mid;
+ const unsigned char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower )
+ break;
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid )
+ _upper = _mid - 1;
+ else if ( (*p) > *_mid )
+ _lower = _mid + 1;
+ else {
+ _trans += (unsigned int)(_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _dnsnameraw_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const unsigned char *_lower = _keys;
+ const unsigned char *_mid;
+ const unsigned char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower )
+ break;
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] )
+ _upper = _mid - 2;
+ else if ( (*p) > _mid[1] )
+ _lower = _mid + 2;
+ else {
+ _trans += (unsigned int)((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
+
+_match:
+ cs = _dnsnameraw_trans_targs[_trans];
+
+ if ( _dnsnameraw_trans_actions[_trans] == 0 )
+ goto _again;
+
+ _acts = _dnsnameraw_actions + _dnsnameraw_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 )
+ {
+ switch ( *_acts++ )
+ {
+ case 0:
+#line 114 "dnslabeltext.rl"
+ {
+ if (labellen < 0 || labellen > 63) {
+ throw runtime_error("Unable to parse DNS name '"+string(realinput)+"': invalid label length "+std::to_string(labellen));
+ }
+ ret[lenpos]=labellen;
+ labellen=0;
+ }
+ break;
+ case 1:
+#line 121 "dnslabeltext.rl"
+ {
+ lenpos=ret.size();
+ ret.append(1, (char)0);
+ labellen=0;
+ }
+ break;
+ case 2:
+#line 127 "dnslabeltext.rl"
+ {
+ char c = *p;
+ ret.append(1, c);
+ labellen++;
+ }
+ break;
+ case 3:
+#line 132 "dnslabeltext.rl"
+ {
+ char c = *p;
+ val *= 10;
+ val += c-'0';
+ }
+ break;
+ case 4:
+#line 137 "dnslabeltext.rl"
+ {
+ ret.append(1, val);
+ labellen++;
+ val=0;
+ }
+ break;
+ case 5:
+#line 143 "dnslabeltext.rl"
+ {
+ ret.append(1, *(p));
+ labellen++;
+ }
+ break;
+#line 464 "dnslabeltext.cc"
+ }
+ }
+
+_again:
+ if ( cs == 0 )
+ goto _out;
+ if ( ++p != pe )
+ goto _resume;
+ _test_eof: {}
+ if ( p == eof )
+ {
+ const char *__acts = _dnsnameraw_actions + _dnsnameraw_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 0:
+#line 114 "dnslabeltext.rl"
+ {
+ if (labellen < 0 || labellen > 63) {
+ throw runtime_error("Unable to parse DNS name '"+string(realinput)+"': invalid label length "+std::to_string(labellen));
+ }
+ ret[lenpos]=labellen;
+ labellen=0;
+ }
+ break;
+ case 4:
+#line 137 "dnslabeltext.rl"
+ {
+ ret.append(1, val);
+ labellen++;
+ val=0;
+ }
+ break;
+#line 498 "dnslabeltext.cc"
+ }
+ }
+ }
+
+ _out: {}
+ }
+
+#line 164 "dnslabeltext.rl"
+
+
+ if ( cs < dnsnameraw_first_final ) {
+ throw runtime_error("Unable to parse DNS name '"+string(realinput)+"': cs="+std::to_string(cs));
+ }
+ ret.append(1, (char)0);
+ return ret;
+};
+
+// Reads an RFC 1035 character string from 'in', puts the resulting bytes in 'out'.
+// Returns the amount of bytes read from 'in'
+size_t parseRFC1035CharString(const std::string &in, std::string &val) {
+
+ val.clear();
+ val.reserve(in.size());
+ const char *p = in.c_str();
+ const char *pe = p + in.size();
+ int cs = 0;
+ uint8_t escaped_octet = 0;
+ // Keeps track of how many chars we read from the source string
+ size_t counter=0;
+
+/* This parses an RFC 1035 char-string.
+ * It was created from the ABNF in draft-ietf-dnsop-svcb-https-02 with
+ * https://github.com/zinid/abnfc and modified to put all the characters in the
+ * right place.
+ */
+
+#line 535 "dnslabeltext.cc"
+static const char _dns_text_to_string_actions[] = {
+ 0, 1, 0, 1, 2, 1, 3, 2,
+ 0, 1
+};
+
+static const char _dns_text_to_string_key_offsets[] = {
+ 0, 0, 8, 15, 17, 19, 22, 24,
+ 33, 41, 43, 45, 48, 50, 58
+};
+
+static const char _dns_text_to_string_trans_keys[] = {
+ 34, 92, 33, 39, 42, 58, 60, 126,
+ 50, 33, 47, 48, 49, 58, 126, 48,
+ 57, 48, 57, 53, 48, 52, 48, 53,
+ 9, 34, 92, 32, 39, 42, 58, 60,
+ 126, 9, 50, 32, 47, 48, 49, 58,
+ 126, 48, 57, 48, 57, 53, 48, 52,
+ 48, 53, 33, 92, 35, 39, 42, 58,
+ 60, 126, 0
+};
+
+static const char _dns_text_to_string_single_lengths[] = {
+ 0, 2, 1, 0, 0, 1, 0, 3,
+ 2, 0, 0, 1, 0, 2, 0
+};
+
+static const char _dns_text_to_string_range_lengths[] = {
+ 0, 3, 3, 1, 1, 1, 1, 3,
+ 3, 1, 1, 1, 1, 3, 0
+};
+
+static const char _dns_text_to_string_index_offsets[] = {
+ 0, 0, 6, 11, 13, 15, 18, 20,
+ 27, 33, 35, 37, 40, 42, 48
+};
+
+static const char _dns_text_to_string_indicies[] = {
+ 2, 3, 0, 0, 0, 1, 5, 0,
+ 4, 0, 1, 6, 1, 7, 1, 8,
+ 6, 1, 7, 1, 9, 10, 11, 9,
+ 9, 9, 1, 9, 13, 9, 12, 9,
+ 1, 14, 1, 15, 1, 16, 14, 1,
+ 15, 1, 0, 3, 0, 0, 0, 1,
+ 1, 0
+};
+
+static const char _dns_text_to_string_trans_targs[] = {
+ 13, 0, 7, 2, 3, 5, 4, 13,
+ 6, 7, 14, 8, 9, 11, 10, 7,
+ 12
+};
+
+static const char _dns_text_to_string_trans_actions[] = {
+ 3, 0, 5, 5, 1, 1, 1, 7,
+ 1, 3, 5, 5, 1, 1, 1, 7,
+ 1
+};
+
+static const int dns_text_to_string_start = 1;
+static const int dns_text_to_string_first_final = 13;
+static const int dns_text_to_string_error = 0;
+
+static const int dns_text_to_string_en_main = 1;
+
+
+#line 601 "dnslabeltext.cc"
+ {
+ cs = dns_text_to_string_start;
+ }
+
+#line 232 "dnslabeltext.rl"
+
+
+ // silence warnings
+ (void) dns_text_to_string_first_final;
+ (void) dns_text_to_string_error;
+ (void) dns_text_to_string_en_main;
+
+#line 614 "dnslabeltext.cc"
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const char *_keys;
+
+ if ( p == pe )
+ goto _test_eof;
+ if ( cs == 0 )
+ goto _out;
+_resume:
+ _keys = _dns_text_to_string_trans_keys + _dns_text_to_string_key_offsets[cs];
+ _trans = _dns_text_to_string_index_offsets[cs];
+
+ _klen = _dns_text_to_string_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower )
+ break;
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid )
+ _upper = _mid - 1;
+ else if ( (*p) > *_mid )
+ _lower = _mid + 1;
+ else {
+ _trans += (unsigned int)(_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _dns_text_to_string_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const char *_lower = _keys;
+ const char *_mid;
+ const char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower )
+ break;
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] )
+ _upper = _mid - 2;
+ else if ( (*p) > _mid[1] )
+ _lower = _mid + 2;
+ else {
+ _trans += (unsigned int)((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
+
+_match:
+ _trans = _dns_text_to_string_indicies[_trans];
+ cs = _dns_text_to_string_trans_targs[_trans];
+
+ if ( _dns_text_to_string_trans_actions[_trans] == 0 )
+ goto _again;
+
+ _acts = _dns_text_to_string_actions + _dns_text_to_string_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 )
+ {
+ switch ( *_acts++ )
+ {
+ case 0:
+#line 194 "dnslabeltext.rl"
+ {
+ escaped_octet *= 10;
+ escaped_octet += (*p)-'0';
+ counter++;
+ }
+ break;
+ case 1:
+#line 200 "dnslabeltext.rl"
+ {
+ val += escaped_octet;
+ escaped_octet = 0;
+ }
+ break;
+ case 2:
+#line 205 "dnslabeltext.rl"
+ {
+ val += (*p);
+ counter++;
+ }
+ break;
+ case 3:
+#line 210 "dnslabeltext.rl"
+ {
+ counter++;
+ }
+ break;
+#line 716 "dnslabeltext.cc"
+ }
+ }
+
+_again:
+ if ( cs == 0 )
+ goto _out;
+ if ( ++p != pe )
+ goto _resume;
+ _test_eof: {}
+ _out: {}
+ }
+
+#line 239 "dnslabeltext.rl"
+
+ return counter;
+}
+
+size_t parseSVCBValueListFromParsedRFC1035CharString(const std::string &in, std::vector<std::string> &val) {
+ val.clear();
+ const char *p = in.c_str();
+ const char *pe = p + in.size();
+ int cs = 0;
+ const char* eof = pe;
+ // Keeps track of how many chars we read from the source string
+ size_t counter=0;
+
+ // Here we store the parsed value until we hit a comma or are done
+ std::string tmp;
+
+
+#line 747 "dnslabeltext.cc"
+static const char _dns_text_to_value_list_actions[] = {
+ 0, 1, 0, 1, 2, 1, 3, 2,
+ 2, 3, 2, 3, 1
+};
+
+static const char _dns_text_to_value_list_key_offsets[] = {
+ 0, 0, 2, 4, 6
+};
+
+static const unsigned char _dns_text_to_value_list_trans_keys[] = {
+ 44u, 92u, 44u, 92u, 44u, 92u, 44u, 92u,
+ 0
+};
+
+static const char _dns_text_to_value_list_single_lengths[] = {
+ 0, 2, 2, 2, 2
+};
+
+static const char _dns_text_to_value_list_range_lengths[] = {
+ 0, 0, 0, 0, 0
+};
+
+static const char _dns_text_to_value_list_index_offsets[] = {
+ 0, 0, 3, 6, 9
+};
+
+static const char _dns_text_to_value_list_indicies[] = {
+ 1, 2, 0, 3, 3, 1, 1, 2,
+ 0, 4, 2, 0, 0
+};
+
+static const char _dns_text_to_value_list_trans_targs[] = {
+ 4, 0, 2, 4, 1
+};
+
+static const char _dns_text_to_value_list_trans_actions[] = {
+ 1, 0, 5, 10, 7
+};
+
+static const char _dns_text_to_value_list_eof_actions[] = {
+ 0, 0, 0, 0, 3
+};
+
+static const int dns_text_to_value_list_start = 3;
+static const int dns_text_to_value_list_first_final = 3;
+static const int dns_text_to_value_list_error = 0;
+
+static const int dns_text_to_value_list_en_main = 3;
+
+
+#line 798 "dnslabeltext.cc"
+ {
+ cs = dns_text_to_value_list_start;
+ }
+
+#line 288 "dnslabeltext.rl"
+
+
+ // silence warnings
+ (void) dns_text_to_value_list_first_final;
+ (void) dns_text_to_value_list_error;
+ (void) dns_text_to_value_list_en_main;
+
+#line 811 "dnslabeltext.cc"
+ {
+ int _klen;
+ unsigned int _trans;
+ const char *_acts;
+ unsigned int _nacts;
+ const unsigned char *_keys;
+
+ if ( p == pe )
+ goto _test_eof;
+ if ( cs == 0 )
+ goto _out;
+_resume:
+ _keys = _dns_text_to_value_list_trans_keys + _dns_text_to_value_list_key_offsets[cs];
+ _trans = _dns_text_to_value_list_index_offsets[cs];
+
+ _klen = _dns_text_to_value_list_single_lengths[cs];
+ if ( _klen > 0 ) {
+ const unsigned char *_lower = _keys;
+ const unsigned char *_mid;
+ const unsigned char *_upper = _keys + _klen - 1;
+ while (1) {
+ if ( _upper < _lower )
+ break;
+
+ _mid = _lower + ((_upper-_lower) >> 1);
+ if ( (*p) < *_mid )
+ _upper = _mid - 1;
+ else if ( (*p) > *_mid )
+ _lower = _mid + 1;
+ else {
+ _trans += (unsigned int)(_mid - _keys);
+ goto _match;
+ }
+ }
+ _keys += _klen;
+ _trans += _klen;
+ }
+
+ _klen = _dns_text_to_value_list_range_lengths[cs];
+ if ( _klen > 0 ) {
+ const unsigned char *_lower = _keys;
+ const unsigned char *_mid;
+ const unsigned char *_upper = _keys + (_klen<<1) - 2;
+ while (1) {
+ if ( _upper < _lower )
+ break;
+
+ _mid = _lower + (((_upper-_lower) >> 1) & ~1);
+ if ( (*p) < _mid[0] )
+ _upper = _mid - 2;
+ else if ( (*p) > _mid[1] )
+ _lower = _mid + 2;
+ else {
+ _trans += (unsigned int)((_mid - _keys)>>1);
+ goto _match;
+ }
+ }
+ _trans += _klen;
+ }
+
+_match:
+ _trans = _dns_text_to_value_list_indicies[_trans];
+ cs = _dns_text_to_value_list_trans_targs[_trans];
+
+ if ( _dns_text_to_value_list_trans_actions[_trans] == 0 )
+ goto _again;
+
+ _acts = _dns_text_to_value_list_actions + _dns_text_to_value_list_trans_actions[_trans];
+ _nacts = (unsigned int) *_acts++;
+ while ( _nacts-- > 0 )
+ {
+ switch ( *_acts++ )
+ {
+ case 0:
+#line 259 "dnslabeltext.rl"
+ {
+ tmp += (*p);
+ counter++;
+ }
+ break;
+ case 1:
+#line 264 "dnslabeltext.rl"
+ {
+ tmp += (*p);
+ }
+ break;
+ case 2:
+#line 268 "dnslabeltext.rl"
+ {
+ val.push_back(tmp);
+ tmp.clear();
+ counter++;
+ }
+ break;
+ case 3:
+#line 274 "dnslabeltext.rl"
+ {
+ counter++;
+ }
+ break;
+#line 912 "dnslabeltext.cc"
+ }
+ }
+
+_again:
+ if ( cs == 0 )
+ goto _out;
+ if ( ++p != pe )
+ goto _resume;
+ _test_eof: {}
+ if ( p == eof )
+ {
+ const char *__acts = _dns_text_to_value_list_actions + _dns_text_to_value_list_eof_actions[cs];
+ unsigned int __nacts = (unsigned int) *__acts++;
+ while ( __nacts-- > 0 ) {
+ switch ( *__acts++ ) {
+ case 2:
+#line 268 "dnslabeltext.rl"
+ {
+ val.push_back(tmp);
+ tmp.clear();
+ counter++;
+ }
+ break;
+#line 936 "dnslabeltext.cc"
+ }
+ }
+ }
+
+ _out: {}
+ }
+
+#line 295 "dnslabeltext.rl"
+
+ if ( cs < dns_text_to_value_list_first_final ) {
+ throw runtime_error("Unable to parse DNS SVCB value list '"+in+"'");
+ }
+
+ return counter;
+}
+
+
+#if 0
+int main()
+{
+ //char blah[]="\"blah\" \"bleh\" \"bloeh\\\"bleh\" \"\\97enzo\"";
+ char blah[]="\"v=spf1 ip4:67.106.74.128/25 ip4:63.138.42.224/28 ip4:65.204.46.224/27 \\013\\010ip4:66.104.217.176/28 \\013\\010ip4:209.48.147.0/27 ~all\"";
+ //char blah[]="\"abc \\097\\098 def\"";
+ printf("Input: '%s'\n", blah);
+ vector<string> res=dnstext(blah);
+ cerr<<res.size()<<" segments"<<endl;
+ cerr<<res[0]<<endl;
+}
+#endif
diff --git a/dnslabeltext.rl b/dnslabeltext.rl
new file mode 100644
index 0000000..87a5799
--- /dev/null
+++ b/dnslabeltext.rl
@@ -0,0 +1,315 @@
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string>
+#include "dnsname.hh"
+#include "namespaces.hh"
+#include "dnswriter.hh"
+#include "misc.hh"
+
+namespace {
+void appendSplit(vector<string>& ret, string& segment, char c)
+{
+ if(segment.size()>254) {
+ ret.push_back(segment);
+ segment.clear();
+ }
+ segment.append(1, c);
+}
+
+}
+
+vector<string> segmentDNSText(const string& input )
+{
+ // cerr<<"segmentDNSText("<<input<<")"<<endl;
+%%{
+ machine dnstext;
+ write data;
+ alphtype unsigned char;
+}%%
+ (void)dnstext_error; // silence warnings
+ (void)dnstext_en_main;
+ const char *p = input.c_str(), *pe = input.c_str() + input.length();
+ const char* eof = pe;
+ int cs;
+ char val = 0;
+
+ string segment;
+ vector<string> ret;
+
+ %%{
+ action segmentEnd {
+ ret.push_back(segment);
+ segment.clear();
+ }
+ action segmentBegin {
+ segment.clear();
+ }
+
+ action reportEscaped {
+ char c = *fpc;
+ appendSplit(ret, segment, c);
+ }
+ action reportEscapedNumber {
+ char c = *fpc;
+ val *= 10;
+ val += c-'0';
+
+ }
+ action doneEscapedNumber {
+ appendSplit(ret, segment, val);
+ val=0;
+ }
+
+ action reportPlain {
+ appendSplit(ret, segment, *(fpc));
+ }
+
+ escaped = '\\' (([^0-9]@reportEscaped) | ([0-9]{3}$reportEscapedNumber%doneEscapedNumber));
+ plain = ((extend-'\\'-'"')|'\n'|'\t') $ reportPlain;
+ txtElement = escaped | plain;
+
+ main := (('"' txtElement* '"' space?) >segmentBegin %segmentEnd)+;
+
+ # Initialize and execute.
+ write init;
+ write exec;
+ }%%
+
+ if ( cs < dnstext_first_final ) {
+ throw runtime_error("Unable to parse DNS TXT '"+input+"'");
+ }
+
+ return ret;
+};
+
+
+DNSName::string_t segmentDNSNameRaw(const char* realinput, size_t inputlen)
+{
+%%{
+ machine dnsnameraw;
+ write data;
+ alphtype unsigned char;
+}%%
+ (void)dnsnameraw_error; // silence warnings
+ (void)dnsnameraw_en_main;
+
+ DNSName::string_t ret;
+
+ if(!*realinput || *realinput == '.') {
+ ret.append(1, (char)0);
+ return ret;
+ }
+
+ ret.reserve(inputlen+1);
+
+ const char *p = realinput, *pe = realinput + inputlen;
+ const char* eof = pe;
+ int cs;
+ char val = 0;
+ char labellen=0;
+ unsigned int lenpos=0;
+ %%{
+ action labelEnd {
+ if (labellen < 0 || labellen > 63) {
+ throw runtime_error("Unable to parse DNS name '"+string(realinput)+"': invalid label length "+std::to_string(labellen));
+ }
+ ret[lenpos]=labellen;
+ labellen=0;
+ }
+ action labelBegin {
+ lenpos=ret.size();
+ ret.append(1, (char)0);
+ labellen=0;
+ }
+
+ action reportEscaped {
+ char c = *fpc;
+ ret.append(1, c);
+ labellen++;
+ }
+ action reportEscapedNumber {
+ char c = *fpc;
+ val *= 10;
+ val += c-'0';
+ }
+ action doneEscapedNumber {
+ ret.append(1, val);
+ labellen++;
+ val=0;
+ }
+
+ action reportPlain {
+ ret.append(1, *(fpc));
+ labellen++;
+ }
+
+ escaped = '\\' (([^0-9]@reportEscaped) | ([0-9]{3}$reportEscapedNumber%doneEscapedNumber));
+ plain = (extend-'\\'-'.') $ reportPlain;
+ labelElement = escaped | plain;
+
+ label = labelElement+ >labelBegin %labelEnd;
+
+ main:= label ('.' label )* '.'?;
+
+ #main := labelElement((labelElement+ '.') >labelBegin %labelEnd)+;
+
+ # label = (plain | escaped | escdecb)+ >label_init %label_fin;
+ # dnsname := '.'? label ('.' label >label_sep)* '.'?;
+
+ # Initialize and execute.
+ write init;
+ write exec;
+ }%%
+
+ if ( cs < dnsnameraw_first_final ) {
+ throw runtime_error("Unable to parse DNS name '"+string(realinput)+"': cs="+std::to_string(cs));
+ }
+ ret.append(1, (char)0);
+ return ret;
+};
+
+// Reads an RFC 1035 character string from 'in', puts the resulting bytes in 'out'.
+// Returns the amount of bytes read from 'in'
+size_t parseRFC1035CharString(const std::string &in, std::string &val) {
+
+ val.clear();
+ val.reserve(in.size());
+ const char *p = in.c_str();
+ const char *pe = p + in.size();
+ int cs = 0;
+ uint8_t escaped_octet = 0;
+ // Keeps track of how many chars we read from the source string
+ size_t counter=0;
+
+/* This parses an RFC 1035 char-string.
+ * It was created from the ABNF in draft-ietf-dnsop-svcb-https-02 with
+ * https://github.com/zinid/abnfc and modified to put all the characters in the
+ * right place.
+ */
+%%{
+ machine dns_text_to_string;
+
+ action doEscapedNumber {
+ escaped_octet *= 10;
+ escaped_octet += fc-'0';
+ counter++;
+ }
+
+ action doneEscapedNumber {
+ val += escaped_octet;
+ escaped_octet = 0;
+ }
+
+ action addToVal {
+ val += fc;
+ counter++;
+ }
+
+ action incrementCounter {
+ counter++;
+ }
+
+ # generated rules, define required actions
+ DIGIT = 0x30..0x39;
+ DQUOTE = "\"";
+ HTAB = "\t";
+ SP = " ";
+ WSP = (SP | HTAB)@addToVal;
+ non_special = "!" | 0x23..0x27 | 0x2a..0x3a | 0x3c..0x5b | 0x5d..0x7e;
+ non_digit = 0x21..0x2f | 0x3a..0x7e;
+ dec_octet = ( ( "0" | "1" ) DIGIT{2} ) | ( "2" ( ( 0x30..0x34 DIGIT ) | ( "5" 0x30..0x35 ) ) );
+ escaped = '\\'@incrementCounter ( non_digit$addToVal | dec_octet$doEscapedNumber@doneEscapedNumber );
+ contiguous = ( non_special$addToVal | escaped )+;
+ quoted = DQUOTE@incrementCounter ( contiguous | ( '\\'? WSP ) )* DQUOTE@incrementCounter;
+ char_string = (contiguous | quoted);
+
+ # instantiate machine rules
+ main := char_string;
+ write data;
+ write init;
+}%%
+
+ // silence warnings
+ (void) dns_text_to_string_first_final;
+ (void) dns_text_to_string_error;
+ (void) dns_text_to_string_en_main;
+ %% write exec;
+
+ return counter;
+}
+
+size_t parseSVCBValueListFromParsedRFC1035CharString(const std::string &in, std::vector<std::string> &val) {
+ val.clear();
+ const char *p = in.c_str();
+ const char *pe = p + in.size();
+ int cs = 0;
+ const char* eof = pe;
+ // Keeps track of how many chars we read from the source string
+ size_t counter=0;
+
+ // Here we store the parsed value until we hit a comma or are done
+ std::string tmp;
+
+%%{
+ machine dns_text_to_value_list;
+ alphtype unsigned char;
+
+ action addToVal {
+ tmp += fc;
+ counter++;
+ }
+
+ action addToValNoIncrement {
+ tmp += fc;
+ }
+
+ action addToVector {
+ val.push_back(tmp);
+ tmp.clear();
+ counter++;
+ }
+
+ action incrementCounter {
+ counter++;
+ }
+
+ # generated rules, define required actions
+ OCTET = 0x00..0xff;
+ item_allowed = 0x00..0x2b | 0x2d..0x5b | 0x5d..0xff;
+ escaped_item = ( item_allowed$addToVal | '\\,'$incrementCounter@addToValNoIncrement | '\\\\'$incrementCounter@addToValNoIncrement )+;
+ comma_separated = ( escaped_item%addToVector ( ","@incrementCounter escaped_item%addToVector )* )?;
+
+ # instantiate machine rules
+ main := comma_separated;
+ write data;
+ write init;
+}%%
+
+ // silence warnings
+ (void) dns_text_to_value_list_first_final;
+ (void) dns_text_to_value_list_error;
+ (void) dns_text_to_value_list_en_main;
+ %% write exec;
+
+ if ( cs < dns_text_to_value_list_first_final ) {
+ throw runtime_error("Unable to parse DNS SVCB value list '"+in+"'");
+ }
+
+ return counter;
+}
+
+
+#if 0
+int main()
+{
+ //char blah[]="\"blah\" \"bleh\" \"bloeh\\\"bleh\" \"\\97enzo\"";
+ char blah[]="\"v=spf1 ip4:67.106.74.128/25 ip4:63.138.42.224/28 ip4:65.204.46.224/27 \\013\\010ip4:66.104.217.176/28 \\013\\010ip4:209.48.147.0/27 ~all\"";
+ //char blah[]="\"abc \\097\\098 def\"";
+ printf("Input: '%s'\n", blah);
+ vector<string> res=dnstext(blah);
+ cerr<<res.size()<<" segments"<<endl;
+ cerr<<res[0]<<endl;
+}
+#endif
diff --git a/dnsmessage.proto b/dnsmessage.proto
new file mode 100644
index 0000000..ef6b774
--- /dev/null
+++ b/dnsmessage.proto
@@ -0,0 +1,183 @@
+/*
+ * This file describes the message format used by the protobuf logging feature in PowerDNS and dnsdist.
+ *
+ * MIT License
+ *
+ * Copyright (c) 2016-now PowerDNS.COM B.V. and its contributors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+syntax = "proto2";
+
+message PBDNSMessage {
+ enum Type {
+ DNSQueryType = 1; // Query received by the service
+ DNSResponseType = 2; // Response returned by the service
+ DNSOutgoingQueryType = 3; // Query sent out by the service to a remote server
+ DNSIncomingResponseType = 4; // Response returned by the remote server
+ }
+ enum SocketFamily {
+ INET = 1; // IPv4 (RFC 791)
+ INET6 = 2; // IPv6 (RFC 2460)
+ }
+ enum SocketProtocol {
+ UDP = 1; // User Datagram Protocol (RFC 768)
+ TCP = 2; // Transmission Control Protocol (RFC 793)
+ DOT = 3; // DNS over TLS (RFC 7858)
+ DOH = 4; // DNS over HTTPS (RFC 8484)
+ DNSCryptUDP = 5; // DNSCrypt over UDP (https://dnscrypt.info/protocol)
+ DNSCryptTCP = 6; // DNSCrypt over TCP (https://dnscrypt.info/protocol)
+ }
+ enum PolicyType {
+ UNKNOWN = 1; // No RPZ policy applied, or unknown type
+ QNAME = 2; // Policy matched on the QName
+ CLIENTIP = 3; // Policy matched on the client IP
+ RESPONSEIP = 4; // Policy matched on one of the IPs contained in the answer
+ NSDNAME = 5; // Policy matched on the name of one nameserver involved
+ NSIP = 6; // Policy matched on the IP of one nameserver involved
+ }
+ enum PolicyKind {
+ NoAction = 1; // No action taken
+ Drop = 2; // https://tools.ietf.org/html/draft-vixie-dns-rpz-04 3.4
+ NXDOMAIN = 3; // https://tools.ietf.org/html/draft-vixie-dns-rpz-04 3.1
+ NODATA = 4; // https://tools.ietf.org/html/draft-vixie-dns-rpz-04 3.2
+ Truncate= 5; // https://tools.ietf.org/html/draft-vixie-dns-rpz-04 3.5
+ Custom = 6; // https://tools.ietf.org/html/draft-vixie-dns-rpz-04 3.6
+ }
+ enum VState {
+ Indeterminate = 1;
+ Insecure = 2;
+ Secure = 3;
+ BogusNoValidDNSKEY = 4;
+ BogusInvalidDenial = 5;
+ BogusUnableToGetDSs = 6;
+ BogusUnableToGetDNSKEYs = 7;
+ BogusSelfSignedDS = 8;
+ BogusNoRRSIG = 9;
+ BogusNoValidRRSIG = 10;
+ BogusMissingNegativeIndication = 11;
+ BogusSignatureNotYetValid = 12;
+ BogusSignatureExpired = 13;
+ BogusUnsupportedDNSKEYAlgo = 14;
+ BogusUnsupportedDSDigestType = 15;
+ BogusNoZoneKeyBitSet = 16;
+ BogusRevokedDNSKEY = 17;
+ BogusInvalidDNSKEYProtocol = 18;
+ }
+ required Type type = 1; // Type of event
+ optional bytes messageId = 2; // UUID, shared by the query and the response
+ optional bytes serverIdentity = 3; // ID of the server emitting the protobuf message
+ optional SocketFamily socketFamily = 4;
+ optional SocketProtocol socketProtocol = 5;
+ optional bytes from = 6; // DNS requestor (client) as 4 (IPv4) or 16 (IPv6) raw bytes in network byte order
+ optional bytes to = 7; // DNS responder (server) as 4 (IPv4) or 16 (IPv6) raw bytes in network byte order
+ optional uint64 inBytes = 8; // Size of the query or response on the wire
+ optional uint32 timeSec = 9; // Time of message reception (seconds since epoch)
+ optional uint32 timeUsec = 10; // Time of message reception (additional micro-seconds)
+ optional uint32 id = 11; // ID of the query/response as found in the DNS header
+
+ message DNSQuestion {
+ optional string qName = 1; // Fully qualified DNS name (with trailing dot)
+ optional uint32 qType = 2; // https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
+ optional uint32 qClass = 3; // Typically 1 (IN), see https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-2
+ }
+ optional DNSQuestion question = 12; // DNS query received from client
+
+ message DNSResponse {
+ // See exportTypes in https://docs.powerdns.com/recursor/lua-config/protobuf.html#protobufServer
+ // for the list of supported resource record types.
+ message DNSRR {
+ optional string name = 1; // Fully qualified DNS name (with trailing dot)
+ optional uint32 type = 2; // https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
+ optional uint32 class = 3; // Typically 1 (IN), see https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-2
+ optional uint32 ttl = 4; // TTL in seconds
+ optional bytes rdata = 5; // raw address bytes in network byte order for A & AAAA; text representation for others, with fully qualified (trailing dot) domain names
+ optional bool udr = 6; // True if this is the first time this RR has been seen for this question
+ }
+ optional uint32 rcode = 1; // DNS Response code, or 65536 for a network error including a timeout
+ repeated DNSRR rrs = 2; // DNS resource records in response
+ optional string appliedPolicy = 3; // Filtering policy (RPZ or Lua) applied
+ repeated string tags = 4; // Additional tags applied
+ optional uint32 queryTimeSec = 5; // Time of the corresponding query reception (seconds since epoch)
+ optional uint32 queryTimeUsec = 6; // Time of the corresponding query reception (additional micro-seconds)
+ optional PolicyType appliedPolicyType = 7; // Type of the filtering policy (RPZ or Lua) applied
+ optional string appliedPolicyTrigger = 8; // The RPZ trigger
+ optional string appliedPolicyHit = 9; // The value (qname or IP) that caused the hit
+ optional PolicyKind appliedPolicyKind = 10; // The Kind (RPZ action) applied by the hit
+ optional VState validationState = 11; // The DNSSEC Validation State
+ }
+
+ optional DNSResponse response = 13;
+ optional bytes originalRequestorSubnet = 14; // EDNS Client Subnet value (4 or 16 raw bytes in network byte order)
+ optional string requestorId = 15; // Username of the requestor
+ optional bytes initialRequestId = 16; // UUID of the incoming query that initiated this outgoing query or incoming response
+ optional bytes deviceId = 17; // Device ID of the requestor (could be mac address IP address or e.g. IMEI, format implementation dependent)
+ optional bool newlyObservedDomain = 18; // True if the domain has not been seen before
+ optional string deviceName = 19; // Device name of the requestor
+ optional uint32 fromPort = 20; // Source port of the DNS query (client)
+ optional uint32 toPort = 21; // Destination port of the DNS query (server)
+
+ message MetaValue {
+ repeated string stringVal = 1;
+ repeated int64 intVal = 2;
+ }
+
+ message Meta {
+ required string key = 1; // MUST be unique, so if you have multiple values they must be aggregated into on Meta
+ required MetaValue value = 2;
+ }
+ repeated Meta meta = 22; // Arbitrary meta-data - to be used in future rather than adding new fields all the time
+
+ // The well known EventTrace event numbers
+ enum EventType {
+ // Range 0..99: Generic events
+ CustomEvent = 0; // A custom event
+ ReqRecv = 1; // A request was received
+ PCacheCheck = 2; // A packet cache check was initiated or completed; value: bool cacheHit
+ AnswerSent = 3; // An answer was sent to the client
+
+ // Range 100: Recursor events
+ SyncRes = 100; // Recursor Syncres main function has started or completed; value: int rcode
+ LuaGetTag = 101; // Events below mark start or end of Lua hook calls; value: return value of hook
+ LuaGetTagFFI = 102;
+ LuaIPFilter = 103;
+ LuaPreRPZ = 104;
+ LuaPreResolve = 105;
+ LuaPreOutQuery = 106;
+ LuaPostResolve = 107;
+ LuaNoData = 108;
+ LuaNXDomain = 109;
+ }
+
+ message Event {
+ required int64 ts = 1; // Timestamp in ns relative to time of creation of event trace data structure
+ required EventType event = 2; // Type of event
+ required bool start = 3; // true for "start" events, false for "completed" events
+ optional bool boolVal = 4; // Below are optional values associated with events
+ optional int64 intVal = 5;
+ optional string stringVal = 6;
+ optional bytes bytesVal = 7;
+ optional string custom = 8; // The name of the event for custom events
+ }
+ repeated Event trace = 23;
+}
+
+message PBDNSMessageList {
+ repeated PBDNSMessage msg = 1;
+}
diff --git a/dnsname.cc b/dnsname.cc
new file mode 100644
index 0000000..8343785
--- /dev/null
+++ b/dnsname.cc
@@ -0,0 +1,493 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsname.hh"
+#include <boost/format.hpp>
+#include <string>
+#include <cinttypes>
+
+#include "dnswriter.hh"
+#include "misc.hh"
+
+#include <boost/functional/hash.hpp>
+
+const DNSName g_rootdnsname("."), g_wildcarddnsname("*");
+
+/* raw storage
+ in DNS label format, with trailing 0. W/o trailing 0, we are 'empty'
+ www.powerdns.com = 3www8powerdns3com0
+*/
+
+std::ostream & operator<<(std::ostream &os, const DNSName& d)
+{
+ return os <<d.toLogString();
+}
+
+DNSName::DNSName(const char* p, size_t length)
+{
+ if(p[0]==0 || (p[0]=='.' && p[1]==0)) {
+ d_storage.assign(1, (char)0);
+ } else {
+ if(!strchr(p, '\\')) {
+ unsigned char lenpos=0;
+ unsigned char labellen=0;
+ size_t plen=length;
+ const char* const pbegin=p, *pend=p+plen;
+ d_storage.reserve(plen+1);
+ for(auto iter = pbegin; iter != pend; ) {
+ lenpos = d_storage.size();
+ if(*iter=='.')
+ throw std::runtime_error("Found . in wrong position in DNSName "+string(p));
+ d_storage.append(1, (char)0);
+ labellen=0;
+ auto begiter=iter;
+ for(; iter != pend && *iter!='.'; ++iter) {
+ labellen++;
+ }
+ d_storage.append(begiter,iter);
+ if(iter != pend)
+ ++iter;
+ if(labellen > 63)
+ throw std::range_error("label too long to append");
+
+ if(iter-pbegin > 254) // reserve two bytes, one for length and one for the root label
+ throw std::range_error("name too long to append");
+
+ d_storage[lenpos]=labellen;
+ }
+ d_storage.append(1, (char)0);
+ }
+ else {
+ d_storage=segmentDNSNameRaw(p, length);
+ if(d_storage.size() > 255) {
+ throw std::range_error("name too long");
+ }
+ }
+ }
+}
+
+
+DNSName::DNSName(const char* pos, int len, int offset, bool uncompress, uint16_t* qtype, uint16_t* qclass, unsigned int* consumed, uint16_t minOffset)
+{
+ if (offset >= len)
+ throw std::range_error("Trying to read past the end of the buffer ("+std::to_string(offset)+ " >= "+std::to_string(len)+")");
+
+ if(!uncompress) {
+ if(const void * fnd=memchr(pos+offset, 0, len-offset)) {
+ d_storage.reserve(2+(const char*)fnd-(pos+offset));
+ }
+ }
+
+ packetParser(pos, len, offset, uncompress, qtype, qclass, consumed, 0, minOffset);
+}
+
+// this should be the __only__ dns name parser in PowerDNS.
+void DNSName::packetParser(const char* qpos, int len, int offset, bool uncompress, uint16_t* qtype, uint16_t* qclass, unsigned int* consumed, int depth, uint16_t minOffset)
+{
+ const unsigned char* pos=(const unsigned char*)qpos;
+ unsigned char labellen;
+ const unsigned char *opos = pos;
+
+ if (offset >= len)
+ throw std::range_error("Trying to read past the end of the buffer ("+std::to_string(offset)+ " >= "+std::to_string(len)+")");
+ if (offset < (int) minOffset)
+ throw std::range_error("Trying to read before the beginning of the buffer ("+std::to_string(offset)+ " < "+std::to_string(minOffset)+")");
+
+ const unsigned char* end = pos + len;
+ pos += offset;
+ while((labellen=*pos++) && pos < end) { // "scan and copy"
+ if(labellen >= 0xc0) {
+ if(!uncompress)
+ throw std::range_error("Found compressed label, instructed not to follow");
+
+ labellen &= (~0xc0);
+ int newpos = (labellen << 8) + *(const unsigned char*)pos;
+
+ if(newpos < offset) {
+ if(newpos < (int) minOffset)
+ throw std::range_error("Invalid label position during decompression ("+std::to_string(newpos)+ " < "+std::to_string(minOffset)+")");
+ if (++depth > 100)
+ throw std::range_error("Abort label decompression after 100 redirects");
+ packetParser((const char*)opos, len, newpos, true, nullptr, nullptr, nullptr, depth, minOffset);
+ } else
+ throw std::range_error("Found a forward reference during label decompression");
+ pos++;
+ break;
+ } else if(labellen & 0xc0) {
+ throw std::range_error("Found an invalid label length in qname (only one of the first two bits is set)");
+ }
+ if (pos + labellen < end) {
+ appendRawLabel((const char*)pos, labellen);
+ }
+ else
+ throw std::range_error("Found an invalid label length in qname");
+ pos+=labellen;
+ }
+ if(d_storage.empty())
+ d_storage.append(1, (char)0); // we just parsed the root
+ if(consumed)
+ *consumed = pos - opos - offset;
+ if(qtype) {
+ if (pos + 2 > end) {
+ throw std::range_error("Trying to read qtype past the end of the buffer ("+std::to_string((pos - opos) + 2)+ " > "+std::to_string(len)+")");
+ }
+ *qtype=(*(const unsigned char*)pos)*256 + *((const unsigned char*)pos+1);
+ }
+ pos+=2;
+ if(qclass) {
+ if (pos + 2 > end) {
+ throw std::range_error("Trying to read qclass past the end of the buffer ("+std::to_string((pos - opos) + 2)+ " > "+std::to_string(len)+")");
+ }
+ *qclass=(*(const unsigned char*)pos)*256 + *((const unsigned char*)pos+1);
+ }
+}
+
+std::string DNSName::toString(const std::string& separator, const bool trailing) const
+{
+ std::string ret;
+ toString(ret, separator, trailing);
+ return ret;
+}
+
+void DNSName::toString(std::string& output, const std::string& separator, const bool trailing) const
+{
+ if (empty()) {
+ throw std::out_of_range("Attempt to print an unset dnsname");
+ }
+
+ if (isRoot()) {
+ output += (trailing ? separator : "");
+ return;
+ }
+
+ if (output.capacity() < (output.size() + d_storage.size())) {
+ output.reserve(output.size() + d_storage.size());
+ }
+
+ {
+ // iterate over the raw labels
+ const char* p = d_storage.c_str();
+ const char* end = p + d_storage.size();
+
+ while (p < end && *p) {
+ appendEscapedLabel(output, p + 1, static_cast<size_t>(*p));
+ output += separator;
+ p += *p + 1;
+ }
+ }
+
+ if (!trailing) {
+ output.resize(output.size() - separator.size());
+ }
+}
+
+std::string DNSName::toLogString() const
+{
+ if (empty()) {
+ return "(empty)";
+ }
+
+ return toStringRootDot();
+}
+
+std::string DNSName::toDNSString() const
+{
+ if (empty())
+ throw std::out_of_range("Attempt to DNSString an unset dnsname");
+
+ return std::string(d_storage.c_str(), d_storage.length());
+}
+
+std::string DNSName::toDNSStringLC() const
+{
+ auto result = toDNSString();
+ toLowerInPlace(result); // label lengths are always < 'A'
+ return result;
+}
+
+/**
+ * Get the length of the DNSName on the wire
+ *
+ * @return the total wirelength of the DNSName
+ */
+size_t DNSName::wirelength() const {
+ return d_storage.length();
+}
+
+// Are WE part of parent
+bool DNSName::isPartOf(const DNSName& parent) const
+{
+ if(parent.empty() || empty())
+ throw std::out_of_range("empty dnsnames aren't part of anything");
+
+ if(parent.d_storage.size() > d_storage.size())
+ return false;
+
+ // this is slightly complicated since we can't start from the end, since we can't see where a label begins/ends then
+ for(auto us=d_storage.cbegin(); us<d_storage.cend(); us+=*us+1) {
+ auto distance = std::distance(us,d_storage.cend());
+ if (distance < 0 || static_cast<size_t>(distance) < parent.d_storage.size()) {
+ break;
+ }
+ if (static_cast<size_t>(distance) == parent.d_storage.size()) {
+ auto p = parent.d_storage.cbegin();
+ for(; us != d_storage.cend(); ++us, ++p) {
+ if(dns_tolower(*p) != dns_tolower(*us))
+ return false;
+ }
+ return true;
+ }
+ if (*us < 0) {
+ throw std::out_of_range("negative label length in dnsname");
+ }
+ }
+ return false;
+}
+
+DNSName DNSName::makeRelative(const DNSName& zone) const
+{
+ DNSName ret(*this);
+ ret.makeUsRelative(zone);
+ return ret;
+}
+
+void DNSName::makeUsRelative(const DNSName& zone)
+{
+ if (isPartOf(zone)) {
+ d_storage.erase(d_storage.size()-zone.d_storage.size());
+ d_storage.append(1, (char)0); // put back the trailing 0
+ }
+ else
+ clear();
+}
+
+DNSName DNSName::getCommonLabels(const DNSName& other) const
+{
+ DNSName result;
+
+ const std::vector<std::string> ours = getRawLabels();
+ const std::vector<std::string> others = other.getRawLabels();
+
+ for (size_t pos = 0; ours.size() > pos && others.size() > pos; pos++) {
+ const std::string& ourLabel = ours.at(ours.size() - pos - 1);
+ const std::string& otherLabel = others.at(others.size() - pos - 1);
+
+ if (!pdns_iequals(ourLabel, otherLabel)) {
+ break;
+ }
+
+ result.prependRawLabel(ourLabel);
+ }
+
+ return result;
+}
+
+DNSName DNSName::labelReverse() const
+{
+ DNSName ret;
+
+ if(isRoot())
+ return *this; // we don't create the root automatically below
+
+ if (!empty()) {
+ vector<string> l=getRawLabels();
+ while(!l.empty()) {
+ ret.appendRawLabel(l.back());
+ l.pop_back();
+ }
+ }
+ return ret;
+}
+
+void DNSName::appendRawLabel(const std::string& label)
+{
+ appendRawLabel(label.c_str(), label.length());
+}
+
+void DNSName::appendRawLabel(const char* start, unsigned int length)
+{
+ if(length==0)
+ throw std::range_error("no such thing as an empty label to append");
+ if(length > 63)
+ throw std::range_error("label too long to append");
+ if(d_storage.size() + length > 254) // reserve one byte for the label length
+ throw std::range_error("name too long to append");
+
+ if(d_storage.empty()) {
+ d_storage.append(1, (char)length);
+ }
+ else {
+ *d_storage.rbegin()=(char)length;
+ }
+ d_storage.append(start, length);
+ d_storage.append(1, (char)0);
+}
+
+void DNSName::prependRawLabel(const std::string& label)
+{
+ if(label.empty())
+ throw std::range_error("no such thing as an empty label to prepend");
+ if(label.size() > 63)
+ throw std::range_error("label too long to prepend");
+ if(d_storage.size() + label.size() > 254) // reserve one byte for the label length
+ throw std::range_error("name too long to prepend");
+
+ if(d_storage.empty())
+ d_storage.append(1, (char)0);
+
+ string_t prep(1, (char)label.size());
+ prep.append(label.c_str(), label.size());
+ d_storage = prep+d_storage;
+}
+
+bool DNSName::slowCanonCompare(const DNSName& rhs) const
+{
+ auto ours=getRawLabels(), rhsLabels = rhs.getRawLabels();
+ return std::lexicographical_compare(ours.rbegin(), ours.rend(), rhsLabels.rbegin(), rhsLabels.rend(), CIStringCompare());
+}
+
+vector<std::string> DNSName::getRawLabels() const
+{
+ vector<std::string> ret;
+ ret.reserve(countLabels());
+ // 3www4ds9a2nl0
+ for(const unsigned char* p = (const unsigned char*) d_storage.c_str(); p < ((const unsigned char*) d_storage.c_str()) + d_storage.size() && *p; p+=*p+1) {
+ ret.push_back({(const char*)p+1, (size_t)*p}); // XXX FIXME
+ }
+ return ret;
+}
+
+std::string DNSName::getRawLabel(unsigned int pos) const
+{
+ unsigned int currentPos = 0;
+ for(const unsigned char* p = (const unsigned char*) d_storage.c_str(); p < ((const unsigned char*) d_storage.c_str()) + d_storage.size() && *p; p+=*p+1, currentPos++) {
+ if (currentPos == pos) {
+ return std::string((const char*)p+1, (size_t)*p);
+ }
+ }
+
+ throw std::out_of_range("trying to get label at position "+std::to_string(pos)+" of a DNSName that only has "+std::to_string(currentPos)+" labels");
+}
+
+DNSName DNSName::getLastLabel() const
+{
+ DNSName ret(*this);
+ ret.trimToLabels(1);
+ return ret;
+}
+
+bool DNSName::chopOff()
+{
+ if(d_storage.empty() || d_storage[0]==0)
+ return false;
+ d_storage.erase(0, (unsigned int)d_storage[0]+1);
+ return true;
+}
+
+bool DNSName::isWildcard() const
+{
+ if(d_storage.size() < 2)
+ return false;
+ auto p = d_storage.begin();
+ return (*p == 0x01 && *++p == '*');
+}
+
+/*
+ * Returns true if the DNSName is a valid RFC 1123 hostname, this function uses
+ * a regex on the string, so it is probably best not used when speed is essential.
+ */
+bool DNSName::isHostname() const
+{
+ static Regex hostNameRegex = Regex("^(([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?)\\.)+$");
+ return hostNameRegex.match(this->toString());
+}
+
+unsigned int DNSName::countLabels() const
+{
+ unsigned int count=0;
+ const unsigned char* p = reinterpret_cast<const unsigned char*>(d_storage.c_str());
+ const unsigned char* end = reinterpret_cast<const unsigned char*>(p + d_storage.size());
+
+ while (p < end && *p) {
+ ++count;
+ p += *p + 1;
+ }
+ return count;
+}
+
+void DNSName::trimToLabels(unsigned int to)
+{
+ while(countLabels() > to && chopOff())
+ ;
+}
+
+
+size_t hash_value(DNSName const& d)
+{
+ return d.hash();
+}
+
+void DNSName::appendEscapedLabel(std::string& appendTo, const char* orig, size_t len)
+{
+ size_t pos = 0;
+
+ while (pos < len) {
+ auto p = static_cast<uint8_t>(orig[pos]);
+ if(p=='.')
+ appendTo+="\\.";
+ else if(p=='\\')
+ appendTo+="\\\\";
+ else if(p > 0x20 && p < 0x7f)
+ appendTo.append(1, (char)p);
+ else {
+ char buf[] = "000";
+ auto got = snprintf(buf, sizeof(buf), "%03" PRIu8, p);
+ if (got < 0 || static_cast<size_t>(got) >= sizeof(buf)) {
+ throw std::runtime_error("Error, snprintf returned " + std::to_string(got) + " while escaping label " + std::string(orig, len));
+ }
+ appendTo.append(1, '\\');
+ appendTo += buf;
+ }
+ ++pos;
+ }
+}
+
+bool DNSName::has8bitBytes() const
+{
+ const auto& s = d_storage;
+ string::size_type pos = 0;
+ uint8_t length = s.at(pos);
+ while (length > 0) {
+ for (size_t idx = 0; idx < length; idx++) {
+ ++pos;
+ char c = s.at(pos);
+ if(!((c >= 'a' && c <= 'z') ||
+ (c >= 'A' && c <= 'Z') ||
+ (c >= '0' && c <= '9') ||
+ c =='-' || c == '_' || c=='*' || c=='.' || c=='/' || c=='@' || c==' ' || c=='\\' || c==':'))
+ return true;
+ }
+ ++pos;
+ length = s.at(pos);
+ }
+
+ return false;
+}
diff --git a/dnsname.hh b/dnsname.hh
new file mode 100644
index 0000000..868eb96
--- /dev/null
+++ b/dnsname.hh
@@ -0,0 +1,533 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <cstring>
+#include <string>
+#include <vector>
+#include <set>
+#include <deque>
+#include <strings.h>
+#include <stdexcept>
+#include <sstream>
+#include <iterator>
+#include <unordered_set>
+
+#include <boost/version.hpp>
+
+#if BOOST_VERSION >= 105300
+#include <boost/container/string.hpp>
+#endif
+
+#include "ascii.hh"
+
+uint32_t burtleCI(const unsigned char* k, uint32_t length, uint32_t init);
+
+// #include "dns.hh"
+// #include "logger.hh"
+
+//#include <ext/vstring.h>
+
+/* Quest in life:
+ accept escaped ascii presentations of DNS names and store them "natively"
+ accept a DNS packet with an offset, and extract a DNS name from it
+ build up DNSNames with prepend and append of 'raw' unescaped labels
+
+ Be able to turn them into ASCII and "DNS name in a packet" again on request
+
+ Provide some common operators for comparison, detection of being part of another domain
+
+ NOTE: For now, everything MUST be . terminated, otherwise it is an error
+*/
+
+class DNSName
+{
+public:
+ DNSName() {} //!< Constructs an *empty* DNSName, NOT the root!
+ // Work around assertion in some boost versions that do not like self-assignment of boost::container::string
+ DNSName& operator=(const DNSName& rhs)
+ {
+ if (this != &rhs) {
+ d_storage = rhs.d_storage;
+ }
+ return *this;
+ }
+ DNSName& operator=(DNSName&& rhs)
+ {
+ if (this != &rhs) {
+ d_storage = std::move(rhs.d_storage);
+ }
+ return *this;
+ }
+ DNSName(const DNSName& a) = default;
+ DNSName(DNSName&& a) = default;
+ explicit DNSName(const char* p): DNSName(p, std::strlen(p)) {} //!< Constructs from a human formatted, escaped presentation
+ explicit DNSName(const char* p, size_t len); //!< Constructs from a human formatted, escaped presentation
+ explicit DNSName(const std::string& str) : DNSName(str.c_str(), str.length()) {}; //!< Constructs from a human formatted, escaped presentation
+ DNSName(const char* p, int len, int offset, bool uncompress, uint16_t* qtype=nullptr, uint16_t* qclass=nullptr, unsigned int* consumed=nullptr, uint16_t minOffset=0); //!< Construct from a DNS Packet, taking the first question if offset=12. If supplied, consumed is set to the number of bytes consumed from the packet, which will not be equal to the wire length of the resulting name in case of compression.
+
+ bool isPartOf(const DNSName& rhs) const; //!< Are we part of the rhs name? Note that name.isPartOf(name).
+ inline bool operator==(const DNSName& rhs) const; //!< DNS-native comparison (case insensitive) - empty compares to empty
+ bool operator!=(const DNSName& other) const { return !(*this == other); }
+
+ std::string toString(const std::string& separator=".", const bool trailing=true) const; //!< Our human-friendly, escaped, representation
+ void toString(std::string& output, const std::string& separator=".", const bool trailing=true) const;
+ std::string toLogString() const; //!< like plain toString, but returns (empty) on empty names
+ std::string toStringNoDot() const { return toString(".", false); }
+ std::string toStringRootDot() const { if(isRoot()) return "."; else return toString(".", false); }
+ std::string toDNSString() const; //!< Our representation in DNS native format
+ std::string toDNSStringLC() const; //!< Our representation in DNS native format, lower cased
+ void appendRawLabel(const std::string& str); //!< Append this unescaped label
+ void appendRawLabel(const char* start, unsigned int length); //!< Append this unescaped label
+ void prependRawLabel(const std::string& str); //!< Prepend this unescaped label
+ std::vector<std::string> getRawLabels() const; //!< Individual raw unescaped labels
+ std::string getRawLabel(unsigned int pos) const; //!< Get the specified raw unescaped label
+ DNSName getLastLabel() const; //!< Get the DNSName of the last label
+ bool chopOff(); //!< Turn www.powerdns.com. into powerdns.com., returns false for .
+ DNSName makeRelative(const DNSName& zone) const;
+ DNSName makeLowerCase() const
+ {
+ DNSName ret(*this);
+ ret.makeUsLowerCase();
+ return ret;
+ }
+ void makeUsLowerCase()
+ {
+ for(auto & c : d_storage) {
+ c=dns_tolower(c);
+ }
+ }
+ void makeUsRelative(const DNSName& zone);
+ DNSName getCommonLabels(const DNSName& other) const; //!< Return the list of common labels from the top, for example 'c.d' for 'a.b.c.d' and 'x.y.c.d'
+ DNSName labelReverse() const;
+ bool isWildcard() const;
+ bool isHostname() const;
+ unsigned int countLabels() const;
+ size_t wirelength() const; //!< Number of total bytes in the name
+ bool empty() const { return d_storage.empty(); }
+ bool isRoot() const { return d_storage.size()==1 && d_storage[0]==0; }
+ void clear() { d_storage.clear(); }
+ void trimToLabels(unsigned int);
+ size_t hash(size_t init=0) const
+ {
+ return burtleCI((const unsigned char*)d_storage.c_str(), d_storage.size(), init);
+ }
+ DNSName& operator+=(const DNSName& rhs)
+ {
+ if(d_storage.size() + rhs.d_storage.size() > 256) // one extra byte for the second root label
+ throw std::range_error("name too long");
+ if(rhs.empty())
+ return *this;
+
+ if(d_storage.empty())
+ d_storage+=rhs.d_storage;
+ else
+ d_storage.replace(d_storage.length()-1, rhs.d_storage.length(), rhs.d_storage);
+
+ return *this;
+ }
+
+ bool operator<(const DNSName& rhs) const // this delivers _some_ kind of ordering, but not one useful in a DNS context. Really fast though.
+ {
+ return std::lexicographical_compare(d_storage.rbegin(), d_storage.rend(),
+ rhs.d_storage.rbegin(), rhs.d_storage.rend(),
+ [](const unsigned char& a, const unsigned char& b) {
+ return dns_tolower(a) < dns_tolower(b);
+ }); // note that this is case insensitive, including on the label lengths
+ }
+
+ inline bool canonCompare(const DNSName& rhs) const;
+ bool slowCanonCompare(const DNSName& rhs) const;
+
+#if BOOST_VERSION >= 105300
+ typedef boost::container::string string_t;
+#else
+ typedef std::string string_t;
+#endif
+ const string_t& getStorage() const {
+ return d_storage;
+ }
+
+ bool has8bitBytes() const; /* returns true if at least one byte of the labels forming the name is not included in [A-Za-z0-9_*./@ \\:-] */
+
+private:
+ string_t d_storage;
+
+ void packetParser(const char* p, int len, int offset, bool uncompress, uint16_t* qtype, uint16_t* qclass, unsigned int* consumed, int depth, uint16_t minOffset);
+ static void appendEscapedLabel(std::string& appendTo, const char* orig, size_t len);
+ static std::string unescapeLabel(const std::string& orig);
+};
+
+size_t hash_value(DNSName const& d);
+
+
+inline bool DNSName::canonCompare(const DNSName& rhs) const
+{
+ // 01234567890abcd
+ // us: 1a3www4ds9a2nl
+ // rhs: 3www6online3com
+ // to compare, we start at the back, is nl < com? no -> done
+ //
+ // 0,2,6,a
+ // 0,4,a
+
+ uint8_t ourpos[64], rhspos[64];
+ uint8_t ourcount=0, rhscount=0;
+ //cout<<"Asked to compare "<<toString()<<" to "<<rhs.toString()<<endl;
+ for(const unsigned char* p = (const unsigned char*)d_storage.c_str(); p < (const unsigned char*)d_storage.c_str() + d_storage.size() && *p && ourcount < sizeof(ourpos); p+=*p+1)
+ ourpos[ourcount++]=(p-(const unsigned char*)d_storage.c_str());
+ for(const unsigned char* p = (const unsigned char*)rhs.d_storage.c_str(); p < (const unsigned char*)rhs.d_storage.c_str() + rhs.d_storage.size() && *p && rhscount < sizeof(rhspos); p+=*p+1)
+ rhspos[rhscount++]=(p-(const unsigned char*)rhs.d_storage.c_str());
+
+ if(ourcount == sizeof(ourpos) || rhscount==sizeof(rhspos)) {
+ return slowCanonCompare(rhs);
+ }
+
+ for(;;) {
+ if(ourcount == 0 && rhscount != 0)
+ return true;
+ if(rhscount == 0)
+ return false;
+ ourcount--;
+ rhscount--;
+
+ bool res=std::lexicographical_compare(
+ d_storage.c_str() + ourpos[ourcount] + 1,
+ d_storage.c_str() + ourpos[ourcount] + 1 + *(d_storage.c_str() + ourpos[ourcount]),
+ rhs.d_storage.c_str() + rhspos[rhscount] + 1,
+ rhs.d_storage.c_str() + rhspos[rhscount] + 1 + *(rhs.d_storage.c_str() + rhspos[rhscount]),
+ [](const unsigned char& a, const unsigned char& b) {
+ return dns_tolower(a) < dns_tolower(b);
+ });
+
+ // cout<<"Forward: "<<res<<endl;
+ if(res)
+ return true;
+
+ res=std::lexicographical_compare( rhs.d_storage.c_str() + rhspos[rhscount] + 1,
+ rhs.d_storage.c_str() + rhspos[rhscount] + 1 + *(rhs.d_storage.c_str() + rhspos[rhscount]),
+ d_storage.c_str() + ourpos[ourcount] + 1,
+ d_storage.c_str() + ourpos[ourcount] + 1 + *(d_storage.c_str() + ourpos[ourcount]),
+ [](const unsigned char& a, const unsigned char& b) {
+ return dns_tolower(a) < dns_tolower(b);
+ });
+ // cout<<"Reverse: "<<res<<endl;
+ if(res)
+ return false;
+ }
+ return false;
+}
+
+
+struct CanonDNSNameCompare
+{
+ bool operator()(const DNSName&a, const DNSName& b) const
+ {
+ return a.canonCompare(b);
+ }
+};
+
+inline DNSName operator+(const DNSName& lhs, const DNSName& rhs)
+{
+ DNSName ret=lhs;
+ ret += rhs;
+ return ret;
+}
+
+template<typename T>
+struct SuffixMatchTree
+{
+ SuffixMatchTree(const std::string& name="", bool endNode_=false) : d_name(name), endNode(endNode_)
+ {}
+
+ SuffixMatchTree(const SuffixMatchTree& rhs): d_name(rhs.d_name), children(rhs.children), endNode(rhs.endNode)
+ {
+ if (endNode) {
+ d_value = rhs.d_value;
+ }
+ }
+ SuffixMatchTree & operator=(const SuffixMatchTree &rhs)
+ {
+ d_name = rhs.d_name;
+ children = rhs.children;
+ endNode = rhs.endNode;
+ if (endNode) {
+ d_value = rhs.d_value;
+ }
+ return *this;
+ }
+
+ std::string d_name;
+ mutable std::set<SuffixMatchTree> children;
+ mutable bool endNode;
+ mutable T d_value;
+ bool operator<(const SuffixMatchTree& rhs) const
+ {
+ return strcasecmp(d_name.c_str(), rhs.d_name.c_str()) < 0;
+ }
+ typedef SuffixMatchTree value_type;
+
+ template<typename V>
+ void visit(const V& v) const {
+ for(const auto& c : children) {
+ c.visit(v);
+ }
+
+ if (endNode) {
+ v(*this);
+ }
+ }
+
+ void add(const DNSName& name, T&& t)
+ {
+ auto labels = name.getRawLabels();
+ add(labels, std::move(t));
+ }
+
+ void add(std::vector<std::string>& labels, T&& value) const
+ {
+ if (labels.empty()) { // this allows insertion of the root
+ endNode = true;
+ d_value = std::move(value);
+ }
+ else if(labels.size()==1) {
+ auto res = children.emplace(*labels.begin(), true);
+ if (!res.second) {
+ // we might already have had the node as an
+ // intermediary one, but it's now an end node
+ if (!res.first->endNode) {
+ res.first->endNode = true;
+ }
+ }
+ res.first->d_value = std::move(value);
+ }
+ else {
+ auto res = children.emplace(*labels.rbegin(), false);
+ labels.pop_back();
+ res.first->add(labels, std::move(value));
+ }
+ }
+
+ void remove(const DNSName &name, bool subtree=false) const
+ {
+ auto labels = name.getRawLabels();
+ remove(labels, subtree);
+ }
+
+ /* Removes the node at `labels`, also make sure that no empty
+ * children will be left behind in memory
+ */
+ void remove(std::vector<std::string>& labels, bool subtree = false) const
+ {
+ if (labels.empty()) { // this allows removal of the root
+ endNode = false;
+ if (subtree) {
+ children.clear();
+ }
+ return;
+ }
+
+ SuffixMatchTree smt(*labels.rbegin());
+ auto child = children.find(smt);
+ if (child == children.end()) {
+ // No subnode found, we're done
+ return;
+ }
+
+ // We have found a child
+ labels.pop_back();
+ if (labels.empty()) {
+ // The child is no longer an endnode
+ child->endNode = false;
+
+ if (subtree) {
+ child->children.clear();
+ }
+
+ // If the child has no further children, just remove it from the set.
+ if (child->children.empty()) {
+ children.erase(child);
+ }
+ return;
+ }
+
+ // We are not at the end, let the child figure out what to do
+ child->remove(labels);
+ }
+
+ T* lookup(const DNSName& name) const
+ {
+ if (children.empty()) { // speed up empty set
+ if (endNode) {
+ return &d_value;
+ }
+ return nullptr;
+ }
+
+ auto labels = name.getRawLabels();
+ return lookup(labels);
+ }
+
+ T* lookup(std::vector<std::string>& labels) const
+ {
+ if (labels.empty()) { // optimization
+ if (endNode) {
+ return &d_value;
+ }
+ return nullptr;
+ }
+
+ SuffixMatchTree smn(*labels.rbegin());
+ auto child = children.find(smn);
+ if (child == children.end()) {
+ if(endNode) {
+ return &d_value;
+ }
+ return nullptr;
+ }
+ labels.pop_back();
+ auto result = child->lookup(labels);
+ if (result) {
+ return result;
+ }
+ return endNode ? &d_value : nullptr;
+ }
+
+ // Returns all end-nodes, fully qualified (not as separate labels)
+ std::vector<DNSName> getNodes() const {
+ std::vector<DNSName> ret;
+ if (endNode) {
+ ret.push_back(DNSName(d_name));
+ }
+ for (const auto& child : children) {
+ auto nodes = child.getNodes();
+ ret.reserve(ret.size() + nodes.size());
+ for (const auto &node: nodes) {
+ ret.push_back(node + DNSName(d_name));
+ }
+ }
+ return ret;
+ }
+};
+
+/* Quest in life: serve as a rapid block list. If you add a DNSName to a root SuffixMatchNode,
+ anything part of that domain will return 'true' in check */
+struct SuffixMatchNode
+{
+ public:
+ SuffixMatchNode()
+ {}
+ SuffixMatchTree<bool> d_tree;
+
+ void add(const DNSName& dnsname)
+ {
+ d_tree.add(dnsname, true);
+ d_nodes.insert(dnsname);
+ }
+
+ void add(const std::string& name)
+ {
+ add(DNSName(name));
+ }
+
+ void add(std::vector<std::string> labels)
+ {
+ d_tree.add(labels, true);
+ DNSName tmp;
+ while (!labels.empty()) {
+ tmp.appendRawLabel(labels.back());
+ labels.pop_back(); // This is safe because we have a copy of labels
+ }
+ d_nodes.insert(tmp);
+ }
+
+ void remove(const DNSName& name)
+ {
+ d_tree.remove(name);
+ d_nodes.erase(name);
+ }
+
+ void remove(std::vector<std::string> labels)
+ {
+ d_tree.remove(labels);
+ DNSName tmp;
+ while (!labels.empty()) {
+ tmp.appendRawLabel(labels.back());
+ labels.pop_back(); // This is safe because we have a copy of labels
+ }
+ d_nodes.erase(tmp);
+ }
+
+ bool check(const DNSName& dnsname) const
+ {
+ return d_tree.lookup(dnsname) != nullptr;
+ }
+
+ std::string toString() const
+ {
+ std::string ret;
+ bool first = true;
+ for (const auto& n : d_nodes) {
+ if (!first) {
+ ret += ", ";
+ }
+ first = false;
+ ret += n.toString();
+ }
+ return ret;
+ }
+
+ private:
+ mutable std::set<DNSName> d_nodes; // Only used for string generation
+};
+
+std::ostream & operator<<(std::ostream &os, const DNSName& d);
+namespace std {
+ template <>
+ struct hash<DNSName> {
+ size_t operator () (const DNSName& dn) const { return dn.hash(0); }
+ };
+}
+
+DNSName::string_t segmentDNSNameRaw(const char* input, size_t inputlen); // from ragel
+bool DNSName::operator==(const DNSName& rhs) const
+{
+ if(rhs.empty() != empty() || rhs.d_storage.size() != d_storage.size())
+ return false;
+
+ auto us = d_storage.cbegin();
+ auto p = rhs.d_storage.cbegin();
+ for(; us != d_storage.cend() && p != rhs.d_storage.cend(); ++us, ++p) {
+ if(dns_tolower(*p) != dns_tolower(*us))
+ return false;
+ }
+ return true;
+}
+
+extern const DNSName g_rootdnsname, g_wildcarddnsname;
+
+struct DNSNameSet: public std::unordered_set<DNSName> {
+ std::string toString() const {
+ std::ostringstream oss;
+ std::copy(begin(), end(), std::ostream_iterator<DNSName>(oss, "\n"));
+ return oss.str();
+ }
+};
diff --git a/dnsparser.cc b/dnsparser.cc
new file mode 100644
index 0000000..5726721
--- /dev/null
+++ b/dnsparser.cc
@@ -0,0 +1,1002 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dnsparser.hh"
+#include "dnswriter.hh"
+#include <boost/algorithm/string.hpp>
+#include <boost/format.hpp>
+
+#include "namespaces.hh"
+
+UnknownRecordContent::UnknownRecordContent(const string& zone)
+{
+ // parse the input
+ vector<string> parts;
+ stringtok(parts, zone);
+ // we need exactly 3 parts, except if the length field is set to 0 then we only need 2
+ if (parts.size() != 3 && !(parts.size() == 2 && boost::equals(parts.at(1), "0"))) {
+ throw MOADNSException("Unknown record was stored incorrectly, need 3 fields, got " + std::to_string(parts.size()) + ": " + zone);
+ }
+
+ if (parts.at(0) != "\\#") {
+ throw MOADNSException("Unknown record was stored incorrectly, first part should be '\\#', got '" + parts.at(0) + "'");
+ }
+
+ const string& relevant = (parts.size() > 2) ? parts.at(2) : "";
+ unsigned int total = pdns_stou(parts.at(1));
+ if (relevant.size() % 2 || (relevant.size() / 2) != total) {
+ throw MOADNSException((boost::format("invalid unknown record length: size not equal to length field (%d != 2 * %d)") % relevant.size() % total).str());
+ }
+
+ string out;
+ out.reserve(total + 1);
+
+ for (unsigned int n = 0; n < total; ++n) {
+ int c;
+ if (sscanf(&relevant.at(2*n), "%02x", &c) != 1) {
+ throw MOADNSException("unable to read data at position " + std::to_string(2 * n) + " from unknown record of size " + std::to_string(relevant.size()));
+ }
+ out.append(1, (char)c);
+ }
+
+ d_record.insert(d_record.end(), out.begin(), out.end());
+}
+
+string UnknownRecordContent::getZoneRepresentation(bool noDot) const
+{
+ ostringstream str;
+ str<<"\\# "<<(unsigned int)d_record.size()<<" ";
+ char hex[4];
+ for (unsigned char n : d_record) {
+ snprintf(hex, sizeof(hex), "%02x", n);
+ str << hex;
+ }
+ return str.str();
+}
+
+void UnknownRecordContent::toPacket(DNSPacketWriter& pw)
+{
+ pw.xfrBlob(string(d_record.begin(),d_record.end()));
+}
+
+shared_ptr<DNSRecordContent> DNSRecordContent::deserialize(const DNSName& qname, uint16_t qtype, const string& serialized)
+{
+ dnsheader dnsheader;
+ memset(&dnsheader, 0, sizeof(dnsheader));
+ dnsheader.qdcount=htons(1);
+ dnsheader.ancount=htons(1);
+
+ vector<uint8_t> packet; // build pseudo packet
+
+ /* will look like: dnsheader, 5 bytes, encoded qname, dns record header, serialized data */
+
+ const auto& encoded = qname.getStorage();
+
+ packet.resize(sizeof(dnsheader) + 5 + encoded.size() + sizeof(struct dnsrecordheader) + serialized.size());
+
+ uint16_t pos=0;
+
+ memcpy(&packet[0], &dnsheader, sizeof(dnsheader)); pos+=sizeof(dnsheader);
+
+ char tmp[6]="\x0" "\x0\x1" "\x0\x1"; // root question for ns_t_a
+ memcpy(&packet[pos], &tmp, 5); pos+=5;
+
+ memcpy(&packet[pos], encoded.c_str(), encoded.size()); pos+=(uint16_t)encoded.size();
+
+ struct dnsrecordheader drh;
+ drh.d_type=htons(qtype);
+ drh.d_class=htons(QClass::IN);
+ drh.d_ttl=0;
+ drh.d_clen=htons(serialized.size());
+
+ memcpy(&packet[pos], &drh, sizeof(drh)); pos+=sizeof(drh);
+ if (serialized.size() > 0) {
+ memcpy(&packet[pos], serialized.c_str(), serialized.size());
+ pos += (uint16_t) serialized.size();
+ (void) pos;
+ }
+
+ MOADNSParser mdp(false, (char*)&*packet.begin(), (unsigned int)packet.size());
+ shared_ptr<DNSRecordContent> ret= mdp.d_answers.begin()->first.d_content;
+ return ret;
+}
+
+std::shared_ptr<DNSRecordContent> DNSRecordContent::mastermake(const DNSRecord &dr,
+ PacketReader& pr)
+{
+ uint16_t searchclass = (dr.d_type == QType::OPT) ? 1 : dr.d_class; // class is invalid for OPT
+
+ auto i = getTypemap().find(pair(searchclass, dr.d_type));
+ if(i==getTypemap().end() || !i->second) {
+ return std::make_shared<UnknownRecordContent>(dr, pr);
+ }
+
+ return i->second(dr, pr);
+}
+
+std::shared_ptr<DNSRecordContent> DNSRecordContent::mastermake(uint16_t qtype, uint16_t qclass,
+ const string& content)
+{
+ auto i = getZmakermap().find(pair(qclass, qtype));
+ if(i==getZmakermap().end()) {
+ return std::make_shared<UnknownRecordContent>(content);
+ }
+
+ return i->second(content);
+}
+
+std::shared_ptr<DNSRecordContent> DNSRecordContent::mastermake(const DNSRecord &dr, PacketReader& pr, uint16_t oc) {
+ // For opcode UPDATE and where the DNSRecord is an answer record, we don't care about content, because this is
+ // not used within the prerequisite section of RFC2136, so - we can simply use unknownrecordcontent.
+ // For section 3.2.3, we do need content so we need to get it properly. But only for the correct QClasses.
+ if (oc == Opcode::Update && dr.d_place == DNSResourceRecord::ANSWER && dr.d_class != 1)
+ return std::make_shared<UnknownRecordContent>(dr, pr);
+
+ uint16_t searchclass = (dr.d_type == QType::OPT) ? 1 : dr.d_class; // class is invalid for OPT
+
+ auto i = getTypemap().find(pair(searchclass, dr.d_type));
+ if(i==getTypemap().end() || !i->second) {
+ return std::make_shared<UnknownRecordContent>(dr, pr);
+ }
+
+ return i->second(dr, pr);
+}
+
+string DNSRecordContent::upgradeContent(const DNSName& qname, const QType& qtype, const string& content) {
+ // seamless upgrade for previously unsupported but now implemented types.
+ UnknownRecordContent unknown_content(content);
+ shared_ptr<DNSRecordContent> rc = DNSRecordContent::deserialize(qname, qtype.getCode(), unknown_content.serialize(qname));
+ return rc->getZoneRepresentation();
+}
+
+DNSRecordContent::typemap_t& DNSRecordContent::getTypemap()
+{
+ static DNSRecordContent::typemap_t typemap;
+ return typemap;
+}
+
+DNSRecordContent::n2typemap_t& DNSRecordContent::getN2Typemap()
+{
+ static DNSRecordContent::n2typemap_t n2typemap;
+ return n2typemap;
+}
+
+DNSRecordContent::t2namemap_t& DNSRecordContent::getT2Namemap()
+{
+ static DNSRecordContent::t2namemap_t t2namemap;
+ return t2namemap;
+}
+
+DNSRecordContent::zmakermap_t& DNSRecordContent::getZmakermap()
+{
+ static DNSRecordContent::zmakermap_t zmakermap;
+ return zmakermap;
+}
+
+DNSRecord::DNSRecord(const DNSResourceRecord& rr): d_name(rr.qname)
+{
+ d_type = rr.qtype.getCode();
+ d_ttl = rr.ttl;
+ d_class = rr.qclass;
+ d_place = DNSResourceRecord::ANSWER;
+ d_clen = 0;
+ d_content = DNSRecordContent::mastermake(d_type, rr.qclass, rr.content);
+}
+
+// If you call this and you are not parsing a packet coming from a socket, you are doing it wrong.
+DNSResourceRecord DNSResourceRecord::fromWire(const DNSRecord& d) {
+ DNSResourceRecord rr;
+ rr.qname = d.d_name;
+ rr.qtype = QType(d.d_type);
+ rr.ttl = d.d_ttl;
+ rr.content = d.d_content->getZoneRepresentation(true);
+ rr.auth = false;
+ rr.qclass = d.d_class;
+ return rr;
+}
+
+void MOADNSParser::init(bool query, const pdns_string_view& packet)
+{
+ if (packet.size() < sizeof(dnsheader))
+ throw MOADNSException("Packet shorter than minimal header");
+
+ memcpy(&d_header, packet.data(), sizeof(dnsheader));
+
+ if(d_header.opcode != Opcode::Query && d_header.opcode != Opcode::Notify && d_header.opcode != Opcode::Update)
+ throw MOADNSException("Can't parse non-query packet with opcode="+ std::to_string(d_header.opcode));
+
+ d_header.qdcount=ntohs(d_header.qdcount);
+ d_header.ancount=ntohs(d_header.ancount);
+ d_header.nscount=ntohs(d_header.nscount);
+ d_header.arcount=ntohs(d_header.arcount);
+
+ if (query && (d_header.qdcount > 1))
+ throw MOADNSException("Query with QD > 1 ("+std::to_string(d_header.qdcount)+")");
+
+ unsigned int n=0;
+
+ PacketReader pr(packet);
+ bool validPacket=false;
+ try {
+ d_qtype = d_qclass = 0; // sometimes replies come in with no question, don't present garbage then
+
+ for(n=0;n < d_header.qdcount; ++n) {
+ d_qname=pr.getName();
+ d_qtype=pr.get16BitInt();
+ d_qclass=pr.get16BitInt();
+ }
+
+ struct dnsrecordheader ah;
+ vector<unsigned char> record;
+ bool seenTSIG = false;
+ validPacket=true;
+ d_answers.reserve((unsigned int)(d_header.ancount + d_header.nscount + d_header.arcount));
+ for(n=0;n < (unsigned int)(d_header.ancount + d_header.nscount + d_header.arcount); ++n) {
+ DNSRecord dr;
+
+ if(n < d_header.ancount)
+ dr.d_place=DNSResourceRecord::ANSWER;
+ else if(n < d_header.ancount + d_header.nscount)
+ dr.d_place=DNSResourceRecord::AUTHORITY;
+ else
+ dr.d_place=DNSResourceRecord::ADDITIONAL;
+
+ unsigned int recordStartPos=pr.getPosition();
+
+ DNSName name=pr.getName();
+
+ pr.getDnsrecordheader(ah);
+ dr.d_ttl=ah.d_ttl;
+ dr.d_type=ah.d_type;
+ dr.d_class=ah.d_class;
+
+ dr.d_name=name;
+ dr.d_clen=ah.d_clen;
+
+ if (query &&
+ !(d_qtype == QType::IXFR && dr.d_place == DNSResourceRecord::AUTHORITY && dr.d_type == QType::SOA) && // IXFR queries have a SOA in their AUTHORITY section
+ (dr.d_place == DNSResourceRecord::ANSWER || dr.d_place == DNSResourceRecord::AUTHORITY || (dr.d_type != QType::OPT && dr.d_type != QType::TSIG && dr.d_type != QType::SIG && dr.d_type != QType::TKEY) || ((dr.d_type == QType::TSIG || dr.d_type == QType::SIG || dr.d_type == QType::TKEY) && dr.d_class != QClass::ANY))) {
+// cerr<<"discarding RR, query is "<<query<<", place is "<<dr.d_place<<", type is "<<dr.d_type<<", class is "<<dr.d_class<<endl;
+ dr.d_content=std::make_shared<UnknownRecordContent>(dr, pr);
+ }
+ else {
+// cerr<<"parsing RR, query is "<<query<<", place is "<<dr.d_place<<", type is "<<dr.d_type<<", class is "<<dr.d_class<<endl;
+ dr.d_content=DNSRecordContent::mastermake(dr, pr, d_header.opcode);
+ }
+
+ /* XXX: XPF records should be allowed after TSIG as soon as the actual XPF option code has been assigned:
+ if (dr.d_place == DNSResourceRecord::ADDITIONAL && seenTSIG && dr.d_type != QType::XPF)
+ */
+ if (dr.d_place == DNSResourceRecord::ADDITIONAL && seenTSIG) {
+ /* only XPF records are allowed after a TSIG */
+ throw MOADNSException("Packet ("+d_qname.toString()+"|#"+std::to_string(d_qtype)+") has an unexpected record ("+std::to_string(dr.d_type)+") after a TSIG one.");
+ }
+
+ if(dr.d_type == QType::TSIG && dr.d_class == QClass::ANY) {
+ if(seenTSIG || dr.d_place != DNSResourceRecord::ADDITIONAL) {
+ throw MOADNSException("Packet ("+d_qname.toLogString()+"|#"+std::to_string(d_qtype)+") has a TSIG record in an invalid position.");
+ }
+ seenTSIG = true;
+ d_tsigPos = recordStartPos;
+ }
+
+ d_answers.emplace_back(std::move(dr), pr.getPosition() - sizeof(dnsheader));
+ }
+
+#if 0
+ if(pr.getPosition()!=packet.size()) {
+ throw MOADNSException("Packet ("+d_qname+"|#"+std::to_string(d_qtype)+") has trailing garbage ("+ std::to_string(pr.getPosition()) + " < " +
+ std::to_string(packet.size()) + ")");
+ }
+#endif
+ }
+ catch(const std::out_of_range &re) {
+ if(validPacket && d_header.tc) { // don't sweat it over truncated packets, but do adjust an, ns and arcount
+ if(n < d_header.ancount) {
+ d_header.ancount=n; d_header.nscount = d_header.arcount = 0;
+ }
+ else if(n < d_header.ancount + d_header.nscount) {
+ d_header.nscount = n - d_header.ancount; d_header.arcount=0;
+ }
+ else {
+ d_header.arcount = n - d_header.ancount - d_header.nscount;
+ }
+ }
+ else {
+ throw MOADNSException("Error parsing packet of "+std::to_string(packet.size())+" bytes (rd="+
+ std::to_string(d_header.rd)+
+ "), out of bounds: "+string(re.what()));
+ }
+ }
+}
+
+bool MOADNSParser::hasEDNS() const
+{
+ if (d_header.arcount == 0 || d_answers.empty()) {
+ return false;
+ }
+
+ for (const auto& record : d_answers) {
+ if (record.first.d_place == DNSResourceRecord::ADDITIONAL && record.first.d_type == QType::OPT) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void PacketReader::getDnsrecordheader(struct dnsrecordheader &ah)
+{
+ unsigned int n;
+ unsigned char *p=reinterpret_cast<unsigned char*>(&ah);
+
+ for(n=0; n < sizeof(dnsrecordheader); ++n)
+ p[n]=d_content.at(d_pos++);
+
+ ah.d_type=ntohs(ah.d_type);
+ ah.d_class=ntohs(ah.d_class);
+ ah.d_clen=ntohs(ah.d_clen);
+ ah.d_ttl=ntohl(ah.d_ttl);
+
+ d_startrecordpos=d_pos; // needed for getBlob later on
+ d_recordlen=ah.d_clen;
+}
+
+
+void PacketReader::copyRecord(vector<unsigned char>& dest, uint16_t len)
+{
+ dest.resize(len);
+ if(!len)
+ return;
+
+ for(uint16_t n=0;n<len;++n) {
+ dest.at(n)=d_content.at(d_pos++);
+ }
+}
+
+void PacketReader::copyRecord(unsigned char* dest, uint16_t len)
+{
+ if(d_pos + len > d_content.size())
+ throw std::out_of_range("Attempt to copy outside of packet");
+
+ memcpy(dest, &d_content.at(d_pos), len);
+ d_pos+=len;
+}
+
+void PacketReader::xfrNodeOrLocatorID(NodeOrLocatorID& ret)
+{
+ if (d_pos + sizeof(ret) > d_content.size()) {
+ throw std::out_of_range("Attempt to read 64 bit value outside of packet");
+ }
+ memcpy(&ret.content, &d_content.at(d_pos), sizeof(ret.content));
+ d_pos += sizeof(ret);
+}
+
+void PacketReader::xfr48BitInt(uint64_t& ret)
+{
+ ret=0;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+ ret<<=8;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+ ret<<=8;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+ ret<<=8;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+ ret<<=8;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+ ret<<=8;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+}
+
+uint32_t PacketReader::get32BitInt()
+{
+ uint32_t ret=0;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+ ret<<=8;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+ ret<<=8;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+ ret<<=8;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+
+ return ret;
+}
+
+
+uint16_t PacketReader::get16BitInt()
+{
+ uint16_t ret=0;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+ ret<<=8;
+ ret+=static_cast<uint8_t>(d_content.at(d_pos++));
+
+ return ret;
+}
+
+uint8_t PacketReader::get8BitInt()
+{
+ return d_content.at(d_pos++);
+}
+
+DNSName PacketReader::getName()
+{
+ unsigned int consumed;
+ try {
+ DNSName dn((const char*) d_content.data(), d_content.size(), d_pos, true /* uncompress */, nullptr /* qtype */, nullptr /* qclass */, &consumed, sizeof(dnsheader));
+
+ d_pos+=consumed;
+ return dn;
+ }
+ catch(const std::range_error& re) {
+ throw std::out_of_range(string("dnsname issue: ")+re.what());
+ }
+ catch(...) {
+ throw std::out_of_range("dnsname issue");
+ }
+ throw PDNSException("PacketReader::getName(): name is empty");
+}
+
+static string txtEscape(const string &name)
+{
+ string ret;
+ char ebuf[5];
+
+ for(char i : name) {
+ if((unsigned char) i >= 127 || (unsigned char) i < 32) {
+ snprintf(ebuf, sizeof(ebuf), "\\%03u", (unsigned char)i);
+ ret += ebuf;
+ }
+ else if(i=='"' || i=='\\'){
+ ret += '\\';
+ ret += i;
+ }
+ else
+ ret += i;
+ }
+ return ret;
+}
+
+// exceptions thrown here do not result in logging in the main pdns auth server - just so you know!
+string PacketReader::getText(bool multi, bool lenField)
+{
+ string ret;
+ ret.reserve(40);
+ while(d_pos < d_startrecordpos + d_recordlen ) {
+ if(!ret.empty()) {
+ ret.append(1,' ');
+ }
+ uint16_t labellen;
+ if(lenField)
+ labellen=static_cast<uint8_t>(d_content.at(d_pos++));
+ else
+ labellen=d_recordlen - (d_pos - d_startrecordpos);
+
+ ret.append(1,'"');
+ if(labellen) { // no need to do anything for an empty string
+ string val(&d_content.at(d_pos), &d_content.at(d_pos+labellen-1)+1);
+ ret.append(txtEscape(val)); // the end is one beyond the packet
+ }
+ ret.append(1,'"');
+ d_pos+=labellen;
+ if(!multi)
+ break;
+ }
+
+ return ret;
+}
+
+string PacketReader::getUnquotedText(bool lenField)
+{
+ uint16_t stop_at;
+ if(lenField)
+ stop_at = static_cast<uint8_t>(d_content.at(d_pos)) + d_pos + 1;
+ else
+ stop_at = d_recordlen;
+
+ /* think unsigned overflow */
+ if (stop_at < d_pos) {
+ throw std::out_of_range("getUnquotedText out of record range");
+ }
+
+ if(stop_at == d_pos)
+ return "";
+
+ d_pos++;
+ string ret(&d_content.at(d_pos), &d_content.at(stop_at));
+ d_pos = stop_at;
+ return ret;
+}
+
+void PacketReader::xfrBlob(string& blob)
+{
+ try {
+ if(d_recordlen && !(d_pos == (d_startrecordpos + d_recordlen))) {
+ if (d_pos > (d_startrecordpos + d_recordlen)) {
+ throw std::out_of_range("xfrBlob out of record range");
+ }
+ blob.assign(&d_content.at(d_pos), &d_content.at(d_startrecordpos + d_recordlen - 1 ) + 1);
+ }
+ else {
+ blob.clear();
+ }
+
+ d_pos = d_startrecordpos + d_recordlen;
+ }
+ catch(...)
+ {
+ throw std::out_of_range("xfrBlob out of range");
+ }
+}
+
+void PacketReader::xfrBlobNoSpaces(string& blob, int length) {
+ xfrBlob(blob, length);
+}
+
+void PacketReader::xfrBlob(string& blob, int length)
+{
+ if(length) {
+ if (length < 0) {
+ throw std::out_of_range("xfrBlob out of range (negative length)");
+ }
+
+ blob.assign(&d_content.at(d_pos), &d_content.at(d_pos + length - 1 ) + 1 );
+
+ d_pos += length;
+ }
+ else {
+ blob.clear();
+ }
+}
+
+void PacketReader::xfrSvcParamKeyVals(set<SvcParam> &kvs) {
+ while (d_pos < (d_startrecordpos + d_recordlen)) {
+ if (d_pos + 2 > (d_startrecordpos + d_recordlen)) {
+ throw std::out_of_range("incomplete key");
+ }
+ uint16_t keyInt;
+ xfr16BitInt(keyInt);
+ auto key = static_cast<SvcParam::SvcParamKey>(keyInt);
+ uint16_t len;
+ xfr16BitInt(len);
+
+ if (d_pos + len > (d_startrecordpos + d_recordlen)) {
+ throw std::out_of_range("record is shorter than SVCB lengthfield implies");
+ }
+
+ switch (key)
+ {
+ case SvcParam::mandatory: {
+ if (len % 2 != 0) {
+ throw std::out_of_range("mandatory SvcParam has invalid length");
+ }
+ if (len == 0) {
+ throw std::out_of_range("empty 'mandatory' values");
+ }
+ std::set<SvcParam::SvcParamKey> paramKeys;
+ size_t stop = d_pos + len;
+ while (d_pos < stop) {
+ uint16_t keyval;
+ xfr16BitInt(keyval);
+ paramKeys.insert(static_cast<SvcParam::SvcParamKey>(keyval));
+ }
+ kvs.insert(SvcParam(key, std::move(paramKeys)));
+ break;
+ }
+ case SvcParam::alpn: {
+ size_t stop = d_pos + len;
+ std::vector<string> alpns;
+ while (d_pos < stop) {
+ string alpn;
+ uint8_t alpnLen = 0;
+ xfr8BitInt(alpnLen);
+ if (alpnLen == 0) {
+ throw std::out_of_range("alpn length of 0");
+ }
+ xfrBlob(alpn, alpnLen);
+ alpns.push_back(alpn);
+ }
+ kvs.insert(SvcParam(key, std::move(alpns)));
+ break;
+ }
+ case SvcParam::no_default_alpn: {
+ if (len != 0) {
+ throw std::out_of_range("invalid length for no-default-alpn");
+ }
+ kvs.insert(SvcParam(key));
+ break;
+ }
+ case SvcParam::port: {
+ if (len != 2) {
+ throw std::out_of_range("invalid length for port");
+ }
+ uint16_t port;
+ xfr16BitInt(port);
+ kvs.insert(SvcParam(key, port));
+ break;
+ }
+ case SvcParam::ipv4hint: /* fall-through */
+ case SvcParam::ipv6hint: {
+ size_t addrLen = (key == SvcParam::ipv4hint ? 4 : 16);
+ if (len % addrLen != 0) {
+ throw std::out_of_range("invalid length for " + SvcParam::keyToString(key));
+ }
+ vector<ComboAddress> addresses;
+ auto stop = d_pos + len;
+ while (d_pos < stop)
+ {
+ ComboAddress addr;
+ xfrCAWithoutPort(key, addr);
+ addresses.push_back(addr);
+ }
+ kvs.insert(SvcParam(key, std::move(addresses)));
+ break;
+ }
+ case SvcParam::ech: {
+ std::string blob;
+ blob.reserve(len);
+ xfrBlobNoSpaces(blob, len);
+ kvs.insert(SvcParam(key, blob));
+ break;
+ }
+ default: {
+ std::string blob;
+ blob.reserve(len);
+ xfrBlob(blob, len);
+ kvs.insert(SvcParam(key, blob));
+ break;
+ }
+ }
+ }
+}
+
+
+void PacketReader::xfrHexBlob(string& blob, bool keepReading)
+{
+ xfrBlob(blob);
+}
+
+//FIXME400 remove this method completely
+string simpleCompress(const string& elabel, const string& root)
+{
+ string label=elabel;
+ // FIXME400: this relies on the semi-canonical escaped output from getName
+ if(strchr(label.c_str(), '\\')) {
+ boost::replace_all(label, "\\.", ".");
+ boost::replace_all(label, "\\032", " ");
+ boost::replace_all(label, "\\\\", "\\");
+ }
+ typedef vector<pair<unsigned int, unsigned int> > parts_t;
+ parts_t parts;
+ vstringtok(parts, label, ".");
+ string ret;
+ ret.reserve(label.size()+4);
+ for(const auto & part : parts) {
+ if(!root.empty() && !strncasecmp(root.c_str(), label.c_str() + part.first, 1 + label.length() - part.first)) { // also match trailing 0, hence '1 +'
+ const unsigned char rootptr[2]={0xc0,0x11};
+ ret.append((const char *) rootptr, 2);
+ return ret;
+ }
+ ret.append(1, (char)(part.second - part.first));
+ ret.append(label.c_str() + part.first, part.second - part.first);
+ }
+ ret.append(1, (char)0);
+ return ret;
+}
+
+// method of operation: silently fail if it doesn't work - we're only trying to be nice, don't fall over on it
+void editDNSPacketTTL(char* packet, size_t length, const std::function<uint32_t(uint8_t, uint16_t, uint16_t, uint32_t)>& visitor)
+{
+ if(length < sizeof(dnsheader))
+ return;
+ try
+ {
+ dnsheader dh;
+ memcpy((void*)&dh, (const dnsheader*)packet, sizeof(dh));
+ uint64_t numrecords = ntohs(dh.ancount) + ntohs(dh.nscount) + ntohs(dh.arcount);
+ DNSPacketMangler dpm(packet, length);
+
+ uint64_t n;
+ for(n=0; n < ntohs(dh.qdcount) ; ++n) {
+ dpm.skipDomainName();
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+
+ for(n=0; n < numrecords; ++n) {
+ dpm.skipDomainName();
+
+ uint8_t section = n < ntohs(dh.ancount) ? 1 : (n < (ntohs(dh.ancount) + ntohs(dh.nscount)) ? 2 : 3);
+ uint16_t dnstype = dpm.get16BitInt();
+ uint16_t dnsclass = dpm.get16BitInt();
+
+ if(dnstype == QType::OPT) // not getting near that one with a stick
+ break;
+
+ uint32_t dnsttl = dpm.get32BitInt();
+ uint32_t newttl = visitor(section, dnsclass, dnstype, dnsttl);
+ if (newttl) {
+ dpm.rewindBytes(sizeof(newttl));
+ dpm.setAndSkip32BitInt(newttl);
+ }
+ dpm.skipRData();
+ }
+ }
+ catch(...)
+ {
+ return;
+ }
+}
+
+// method of operation: silently fail if it doesn't work - we're only trying to be nice, don't fall over on it
+void ageDNSPacket(char* packet, size_t length, uint32_t seconds)
+{
+ if(length < sizeof(dnsheader))
+ return;
+ try
+ {
+ const dnsheader* dh = reinterpret_cast<const dnsheader*>(packet);
+ const uint64_t dqcount = ntohs(dh->qdcount);
+ const uint64_t numrecords = ntohs(dh->ancount) + ntohs(dh->nscount) + ntohs(dh->arcount);
+ DNSPacketMangler dpm(packet, length);
+
+ uint64_t n;
+ for(n=0; n < dqcount; ++n) {
+ dpm.skipDomainName();
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+ // cerr<<"Skipped "<<n<<" questions, now parsing "<<numrecords<<" records"<<endl;
+ for(n=0; n < numrecords; ++n) {
+ dpm.skipDomainName();
+
+ uint16_t dnstype = dpm.get16BitInt();
+ /* class */
+ dpm.skipBytes(2);
+
+ if(dnstype == QType::OPT) // not aging that one with a stick
+ break;
+
+ dpm.decreaseAndSkip32BitInt(seconds);
+ dpm.skipRData();
+ }
+ }
+ catch(...)
+ {
+ return;
+ }
+}
+
+void ageDNSPacket(std::string& packet, uint32_t seconds)
+{
+ ageDNSPacket((char*)packet.c_str(), packet.length(), seconds);
+}
+
+uint32_t getDNSPacketMinTTL(const char* packet, size_t length, bool* seenAuthSOA)
+{
+ uint32_t result = std::numeric_limits<uint32_t>::max();
+ if(length < sizeof(dnsheader)) {
+ return result;
+ }
+ try
+ {
+ const dnsheader* dh = (const dnsheader*) packet;
+ DNSPacketMangler dpm(const_cast<char*>(packet), length);
+
+ const uint16_t qdcount = ntohs(dh->qdcount);
+ for(size_t n = 0; n < qdcount; ++n) {
+ dpm.skipDomainName();
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+ const size_t numrecords = ntohs(dh->ancount) + ntohs(dh->nscount) + ntohs(dh->arcount);
+ for(size_t n = 0; n < numrecords; ++n) {
+ dpm.skipDomainName();
+ const uint16_t dnstype = dpm.get16BitInt();
+ /* class */
+ const uint16_t dnsclass = dpm.get16BitInt();
+
+ if(dnstype == QType::OPT) {
+ break;
+ }
+
+ /* report it if we see a SOA record in the AUTHORITY section */
+ if(dnstype == QType::SOA && dnsclass == QClass::IN && seenAuthSOA != nullptr && n >= ntohs(dh->ancount) && n < (ntohs(dh->ancount) + ntohs(dh->nscount))) {
+ *seenAuthSOA = true;
+ }
+
+ const uint32_t ttl = dpm.get32BitInt();
+ if (result > ttl) {
+ result = ttl;
+ }
+
+ dpm.skipRData();
+ }
+ }
+ catch(...)
+ {
+ }
+ return result;
+}
+
+uint32_t getDNSPacketLength(const char* packet, size_t length)
+{
+ uint32_t result = length;
+ if(length < sizeof(dnsheader)) {
+ return result;
+ }
+ try
+ {
+ const dnsheader* dh = reinterpret_cast<const dnsheader*>(packet);
+ DNSPacketMangler dpm(const_cast<char*>(packet), length);
+
+ const uint16_t qdcount = ntohs(dh->qdcount);
+ for(size_t n = 0; n < qdcount; ++n) {
+ dpm.skipDomainName();
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+ const size_t numrecords = ntohs(dh->ancount) + ntohs(dh->nscount) + ntohs(dh->arcount);
+ for(size_t n = 0; n < numrecords; ++n) {
+ dpm.skipDomainName();
+ /* type (2), class (2) and ttl (4) */
+ dpm.skipBytes(8);
+ dpm.skipRData();
+ }
+ result = dpm.getOffset();
+ }
+ catch(...)
+ {
+ }
+ return result;
+}
+
+uint16_t getRecordsOfTypeCount(const char* packet, size_t length, uint8_t section, uint16_t type)
+{
+ uint16_t result = 0;
+ if(length < sizeof(dnsheader)) {
+ return result;
+ }
+ try
+ {
+ const dnsheader* dh = (const dnsheader*) packet;
+ DNSPacketMangler dpm(const_cast<char*>(packet), length);
+
+ const uint16_t qdcount = ntohs(dh->qdcount);
+ for(size_t n = 0; n < qdcount; ++n) {
+ dpm.skipDomainName();
+ if (section == 0) {
+ uint16_t dnstype = dpm.get16BitInt();
+ if (dnstype == type) {
+ result++;
+ }
+ /* class */
+ dpm.skipBytes(2);
+ } else {
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+ }
+ const uint16_t ancount = ntohs(dh->ancount);
+ for(size_t n = 0; n < ancount; ++n) {
+ dpm.skipDomainName();
+ if (section == 1) {
+ uint16_t dnstype = dpm.get16BitInt();
+ if (dnstype == type) {
+ result++;
+ }
+ /* class */
+ dpm.skipBytes(2);
+ } else {
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+ /* ttl */
+ dpm.skipBytes(4);
+ dpm.skipRData();
+ }
+ const uint16_t nscount = ntohs(dh->nscount);
+ for(size_t n = 0; n < nscount; ++n) {
+ dpm.skipDomainName();
+ if (section == 2) {
+ uint16_t dnstype = dpm.get16BitInt();
+ if (dnstype == type) {
+ result++;
+ }
+ /* class */
+ dpm.skipBytes(2);
+ } else {
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+ /* ttl */
+ dpm.skipBytes(4);
+ dpm.skipRData();
+ }
+ const uint16_t arcount = ntohs(dh->arcount);
+ for(size_t n = 0; n < arcount; ++n) {
+ dpm.skipDomainName();
+ if (section == 3) {
+ uint16_t dnstype = dpm.get16BitInt();
+ if (dnstype == type) {
+ result++;
+ }
+ /* class */
+ dpm.skipBytes(2);
+ } else {
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+ /* ttl */
+ dpm.skipBytes(4);
+ dpm.skipRData();
+ }
+ }
+ catch(...)
+ {
+ }
+ return result;
+}
+
+bool getEDNSUDPPayloadSizeAndZ(const char* packet, size_t length, uint16_t* payloadSize, uint16_t* z)
+{
+ if (length < sizeof(dnsheader)) {
+ return false;
+ }
+
+ *payloadSize = 0;
+ *z = 0;
+
+ try
+ {
+ const dnsheader* dh = (const dnsheader*) packet;
+ DNSPacketMangler dpm(const_cast<char*>(packet), length);
+
+ const uint16_t qdcount = ntohs(dh->qdcount);
+ for(size_t n = 0; n < qdcount; ++n) {
+ dpm.skipDomainName();
+ /* type and class */
+ dpm.skipBytes(4);
+ }
+ const size_t numrecords = ntohs(dh->ancount) + ntohs(dh->nscount) + ntohs(dh->arcount);
+ for(size_t n = 0; n < numrecords; ++n) {
+ dpm.skipDomainName();
+ const uint16_t dnstype = dpm.get16BitInt();
+ const uint16_t dnsclass = dpm.get16BitInt();
+
+ if(dnstype == QType::OPT) {
+ /* skip extended rcode and version */
+ dpm.skipBytes(2);
+ *z = dpm.get16BitInt();
+ *payloadSize = dnsclass;
+ return true;
+ }
+
+ /* TTL */
+ dpm.skipBytes(4);
+ dpm.skipRData();
+ }
+ }
+ catch(...)
+ {
+ }
+
+ return false;
+}
diff --git a/dnsparser.hh b/dnsparser.hh
new file mode 100644
index 0000000..9cbe5a4
--- /dev/null
+++ b/dnsparser.hh
@@ -0,0 +1,569 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <map>
+#include <sstream>
+#include <stdexcept>
+#include <iostream>
+#include <vector>
+#include <errno.h>
+// #include <netinet/in.h>
+#include "misc.hh"
+
+#include <boost/tuple/tuple.hpp>
+#include <boost/tuple/tuple_comparison.hpp>
+#include "dns.hh"
+#include "dnswriter.hh"
+#include "dnsname.hh"
+#include "pdnsexception.hh"
+#include "iputils.hh"
+#include "svc-records.hh"
+
+/** DNS records have three representations:
+ 1) in the packet
+ 2) parsed in a class, ready for use
+ 3) in the zone
+
+ We should implement bidirectional transitions between 1&2 and 2&3.
+ Currently we have: 1 -> 2
+ 2 -> 3
+
+ We can add: 2 -> 1 easily by reversing the packetwriter
+ And we might be able to reverse 2 -> 3 as well
+*/
+
+#include "namespaces.hh"
+
+class MOADNSException : public runtime_error
+{
+public:
+ MOADNSException(const string& str) : runtime_error(str)
+ {}
+};
+
+
+class MOADNSParser;
+
+class PacketReader
+{
+public:
+ PacketReader(const pdns_string_view& content, uint16_t initialPos=sizeof(dnsheader))
+ : d_pos(initialPos), d_startrecordpos(initialPos), d_content(content)
+ {
+ if(content.size() > std::numeric_limits<uint16_t>::max())
+ throw std::out_of_range("packet too large");
+
+ d_recordlen = (uint16_t) content.size();
+ not_used = 0;
+ }
+
+ uint32_t get32BitInt();
+ uint16_t get16BitInt();
+ uint8_t get8BitInt();
+
+ void xfrNodeOrLocatorID(NodeOrLocatorID& val);
+ void xfr48BitInt(uint64_t& val);
+
+ void xfr32BitInt(uint32_t& val)
+ {
+ val=get32BitInt();
+ }
+
+ void xfrIP(uint32_t& val)
+ {
+ xfr32BitInt(val);
+ val=htonl(val);
+ }
+
+ void xfrIP6(std::string &val) {
+ xfrBlob(val, 16);
+ }
+
+ void xfrCAWithoutPort(uint8_t version, ComboAddress &val) {
+ string blob;
+ if (version == 4) xfrBlob(blob, 4);
+ else if (version == 6) xfrBlob(blob, 16);
+ else throw runtime_error("invalid IP protocol");
+ val = makeComboAddressFromRaw(version, blob);
+ }
+
+ void xfrCAPort(ComboAddress &val) {
+ uint16_t port;
+ xfr16BitInt(port);
+ val.sin4.sin_port = port;
+ }
+
+ void xfrTime(uint32_t& val)
+ {
+ xfr32BitInt(val);
+ }
+
+
+ void xfr16BitInt(uint16_t& val)
+ {
+ val=get16BitInt();
+ }
+
+ void xfrType(uint16_t& val)
+ {
+ xfr16BitInt(val);
+ }
+
+
+ void xfr8BitInt(uint8_t& val)
+ {
+ val=get8BitInt();
+ }
+
+
+ void xfrName(DNSName &name, bool compress=false, bool noDot=false)
+ {
+ name=getName();
+ }
+
+ void xfrText(string &text, bool multi=false, bool lenField=true)
+ {
+ text=getText(multi, lenField);
+ }
+
+ void xfrUnquotedText(string &text, bool lenField){
+ text=getUnquotedText(lenField);
+ }
+
+ void xfrBlob(string& blob);
+ void xfrBlobNoSpaces(string& blob, int len);
+ void xfrBlob(string& blob, int length);
+ void xfrHexBlob(string& blob, bool keepReading=false);
+ void xfrSvcParamKeyVals(set<SvcParam> &kvs);
+
+ void getDnsrecordheader(struct dnsrecordheader &ah);
+ void copyRecord(vector<unsigned char>& dest, uint16_t len);
+ void copyRecord(unsigned char* dest, uint16_t len);
+
+ DNSName getName();
+ string getText(bool multi, bool lenField);
+ string getUnquotedText(bool lenField);
+
+
+ bool eof() { return true; };
+ const string getRemaining() const {
+ return "";
+ };
+
+ uint16_t getPosition() const
+ {
+ return d_pos;
+ }
+
+ void skip(uint16_t n)
+ {
+ d_pos += n;
+ }
+
+private:
+ uint16_t d_pos;
+ uint16_t d_startrecordpos; // needed for getBlob later on
+ uint16_t d_recordlen; // ditto
+ uint16_t not_used; // Aligns the whole class on 8-byte boundaries
+ const pdns_string_view d_content;
+};
+
+struct DNSRecord;
+
+class DNSRecordContent
+{
+public:
+ static std::shared_ptr<DNSRecordContent> mastermake(const DNSRecord &dr, PacketReader& pr);
+ static std::shared_ptr<DNSRecordContent> mastermake(const DNSRecord &dr, PacketReader& pr, uint16_t opcode);
+ static std::shared_ptr<DNSRecordContent> mastermake(uint16_t qtype, uint16_t qclass, const string& zone);
+ static string upgradeContent(const DNSName& qname, const QType& qtype, const string& content);
+
+ virtual std::string getZoneRepresentation(bool noDot=false) const = 0;
+ virtual ~DNSRecordContent() {}
+ virtual void toPacket(DNSPacketWriter& pw)=0;
+ virtual string serialize(const DNSName& qname, bool canonic=false, bool lowerCase=false) // it would rock if this were const, but it is too hard
+ {
+ vector<uint8_t> packet;
+ DNSPacketWriter pw(packet, g_rootdnsname, 1);
+ if(canonic)
+ pw.setCanonic(true);
+
+ if(lowerCase)
+ pw.setLowercase(true);
+
+ pw.startRecord(qname, this->getType());
+ this->toPacket(pw);
+
+ string record;
+ pw.getRecordPayload(record); // needs to be called before commit()
+ return record;
+ }
+
+ virtual bool operator==(const DNSRecordContent& rhs) const
+ {
+ return typeid(*this)==typeid(rhs) && this->getZoneRepresentation() == rhs.getZoneRepresentation();
+ }
+
+ static shared_ptr<DNSRecordContent> deserialize(const DNSName& qname, uint16_t qtype, const string& serialized);
+
+ void doRecordCheck(const struct DNSRecord&){}
+
+ typedef std::shared_ptr<DNSRecordContent> makerfunc_t(const struct DNSRecord& dr, PacketReader& pr);
+ typedef std::shared_ptr<DNSRecordContent> zmakerfunc_t(const string& str);
+
+ static void regist(uint16_t cl, uint16_t ty, makerfunc_t* f, zmakerfunc_t* z, const char* name)
+ {
+ if(f)
+ getTypemap()[pair(cl,ty)]=f;
+ if(z)
+ getZmakermap()[pair(cl,ty)]=z;
+
+ getT2Namemap().emplace(pair(cl, ty), name);
+ getN2Typemap().emplace(name, pair(cl, ty));
+ }
+
+ static void unregist(uint16_t cl, uint16_t ty)
+ {
+ auto key = pair(cl, ty);
+ getTypemap().erase(key);
+ getZmakermap().erase(key);
+ }
+
+ static bool isUnknownType(const string& name)
+ {
+ return boost::starts_with(name, "TYPE") || boost::starts_with(name, "type");
+ }
+
+ static uint16_t TypeToNumber(const string& name)
+ {
+ n2typemap_t::const_iterator iter = getN2Typemap().find(toUpper(name));
+ if(iter != getN2Typemap().end())
+ return iter->second.second;
+
+ if (isUnknownType(name))
+ return (uint16_t) pdns_stou(name.substr(4));
+
+ throw runtime_error("Unknown DNS type '"+name+"'");
+ }
+
+ static const string NumberToType(uint16_t num, uint16_t classnum=1)
+ {
+ auto iter = getT2Namemap().find(pair(classnum, num));
+ if(iter == getT2Namemap().end())
+ return "TYPE" + std::to_string(num);
+ // throw runtime_error("Unknown DNS type with numerical id "+std::to_string(num));
+ return iter->second;
+ }
+
+ virtual uint16_t getType() const = 0;
+
+protected:
+ typedef std::map<std::pair<uint16_t, uint16_t>, makerfunc_t* > typemap_t;
+ typedef std::map<std::pair<uint16_t, uint16_t>, zmakerfunc_t* > zmakermap_t;
+ typedef std::map<std::pair<uint16_t, uint16_t>, string > t2namemap_t;
+ typedef std::map<string, std::pair<uint16_t, uint16_t> > n2typemap_t;
+ static typemap_t& getTypemap();
+ static t2namemap_t& getT2Namemap();
+ static n2typemap_t& getN2Typemap();
+ static zmakermap_t& getZmakermap();
+};
+
+struct DNSRecord
+{
+ DNSRecord() : d_type(0), d_class(QClass::IN), d_ttl(0), d_clen(0), d_place(DNSResourceRecord::ANSWER)
+ {}
+ explicit DNSRecord(const DNSResourceRecord& rr);
+ DNSName d_name;
+ std::shared_ptr<DNSRecordContent> d_content;
+ uint16_t d_type;
+ uint16_t d_class;
+ uint32_t d_ttl;
+ uint16_t d_clen;
+ DNSResourceRecord::Place d_place;
+
+ bool operator<(const DNSRecord& rhs) const
+ {
+ if(tie(d_name, d_type, d_class, d_ttl) < tie(rhs.d_name, rhs.d_type, rhs.d_class, rhs.d_ttl))
+ return true;
+
+ if(tie(d_name, d_type, d_class, d_ttl) != tie(rhs.d_name, rhs.d_type, rhs.d_class, rhs.d_ttl))
+ return false;
+
+ string lzrp, rzrp;
+ if(d_content)
+ lzrp=toLower(d_content->getZoneRepresentation());
+ if(rhs.d_content)
+ rzrp=toLower(rhs.d_content->getZoneRepresentation());
+
+ return lzrp < rzrp;
+ }
+
+ // this orders in canonical order and keeps the SOA record on top
+ static bool prettyCompare(const DNSRecord& a, const DNSRecord& b)
+ {
+ auto aType = (a.d_type == QType::SOA) ? 0 : a.d_type;
+ auto bType = (b.d_type == QType::SOA) ? 0 : b.d_type;
+
+ if(a.d_name.canonCompare(b.d_name))
+ return true;
+ if(b.d_name.canonCompare(a.d_name))
+ return false;
+
+ if(tie(aType, a.d_class, a.d_ttl) < tie(bType, b.d_class, b.d_ttl))
+ return true;
+
+ if(tie(aType, a.d_class, a.d_ttl) != tie(bType, b.d_class, b.d_ttl))
+ return false;
+
+ string lzrp, rzrp;
+ if(a.d_content)
+ lzrp=toLower(a.d_content->getZoneRepresentation());
+ if(b.d_content)
+ rzrp=toLower(b.d_content->getZoneRepresentation());
+
+ return lzrp < rzrp;
+ }
+
+
+ bool operator==(const DNSRecord& rhs) const
+ {
+ if(d_type != rhs.d_type || d_class != rhs.d_class || d_name != rhs.d_name)
+ return false;
+
+ return *d_content == *rhs.d_content;
+ }
+};
+
+struct DNSZoneRecord
+{
+ int domain_id{-1};
+ uint8_t scopeMask{0};
+ int signttl{0};
+ DNSName wildcardname;
+ bool auth{true};
+ bool disabled{false};
+ DNSRecord dr;
+};
+
+class UnknownRecordContent : public DNSRecordContent
+{
+public:
+ UnknownRecordContent(const DNSRecord& dr, PacketReader& pr)
+ : d_dr(dr)
+ {
+ pr.copyRecord(d_record, dr.d_clen);
+ }
+
+ UnknownRecordContent(const string& zone);
+
+ string getZoneRepresentation(bool noDot) const override;
+ void toPacket(DNSPacketWriter& pw) override;
+ uint16_t getType() const override
+ {
+ return d_dr.d_type;
+ }
+
+ const vector<uint8_t>& getRawContent() const
+ {
+ return d_record;
+ }
+
+private:
+ DNSRecord d_dr;
+ vector<uint8_t> d_record;
+};
+
+//! This class can be used to parse incoming packets, and is copyable
+class MOADNSParser : public boost::noncopyable
+{
+public:
+ //! Parse from a string
+ MOADNSParser(bool query, const string& buffer): d_tsigPos(0)
+ {
+ init(query, buffer);
+ }
+
+ //! Parse from a pointer and length
+ MOADNSParser(bool query, const char *packet, unsigned int len) : d_tsigPos(0)
+ {
+ init(query, pdns_string_view(packet, len));
+ }
+
+ DNSName d_qname;
+ uint16_t d_qclass, d_qtype;
+ //uint8_t d_rcode;
+ dnsheader d_header;
+
+ typedef vector<pair<DNSRecord, uint16_t > > answers_t;
+
+ //! All answers contained in this packet (everything *but* the question section)
+ answers_t d_answers;
+
+ uint16_t getTSIGPos() const
+ {
+ return d_tsigPos;
+ }
+
+ bool hasEDNS() const;
+
+private:
+ void init(bool query, const pdns_string_view& packet);
+ uint16_t d_tsigPos;
+};
+
+string simpleCompress(const string& label, const string& root="");
+void ageDNSPacket(char* packet, size_t length, uint32_t seconds);
+void ageDNSPacket(std::string& packet, uint32_t seconds);
+void editDNSPacketTTL(char* packet, size_t length, const std::function<uint32_t(uint8_t, uint16_t, uint16_t, uint32_t)>& visitor);
+uint32_t getDNSPacketMinTTL(const char* packet, size_t length, bool* seenAuthSOA=nullptr);
+uint32_t getDNSPacketLength(const char* packet, size_t length);
+uint16_t getRecordsOfTypeCount(const char* packet, size_t length, uint8_t section, uint16_t type);
+bool getEDNSUDPPayloadSizeAndZ(const char* packet, size_t length, uint16_t* payloadSize, uint16_t* z);
+
+template<typename T>
+std::shared_ptr<T> getRR(const DNSRecord& dr)
+{
+ return std::dynamic_pointer_cast<T>(dr.d_content);
+}
+
+/** Simple DNSPacketMangler. Ritual is: get a pointer into the packet and moveOffset() to beyond your needs
+ * If you survive that, feel free to read from the pointer */
+class DNSPacketMangler
+{
+public:
+ explicit DNSPacketMangler(std::string& packet)
+ : d_packet(packet.data()), d_length(packet.length()), d_notyouroffset(12), d_offset(d_notyouroffset)
+ {}
+ DNSPacketMangler(char* packet, size_t length)
+ : d_packet(packet), d_length(length), d_notyouroffset(12), d_offset(d_notyouroffset)
+ {}
+
+ /*! Advances past a wire-format domain name
+ * The name is not checked for adherence to length restrictions.
+ * Compression pointers are not followed.
+ */
+ void skipDomainName()
+ {
+ uint8_t len;
+ while((len=get8BitInt())) {
+ if(len >= 0xc0) { // extended label
+ get8BitInt();
+ return;
+ }
+ skipBytes(len);
+ }
+ }
+
+ void skipBytes(uint16_t bytes)
+ {
+ moveOffset(bytes);
+ }
+ void rewindBytes(uint16_t by)
+ {
+ rewindOffset(by);
+ }
+ uint32_t get32BitInt()
+ {
+ const char* p = d_packet + d_offset;
+ moveOffset(4);
+ uint32_t ret;
+ memcpy(&ret, p, sizeof(ret));
+ return ntohl(ret);
+ }
+ uint16_t get16BitInt()
+ {
+ const char* p = d_packet + d_offset;
+ moveOffset(2);
+ uint16_t ret;
+ memcpy(&ret, p, sizeof(ret));
+ return ntohs(ret);
+ }
+
+ uint8_t get8BitInt()
+ {
+ const char* p = d_packet + d_offset;
+ moveOffset(1);
+ return *p;
+ }
+
+ void skipRData()
+ {
+ int toskip = get16BitInt();
+ moveOffset(toskip);
+ }
+
+ void decreaseAndSkip32BitInt(uint32_t decrease)
+ {
+ const char *p = d_packet + d_offset;
+ moveOffset(4);
+
+ uint32_t tmp;
+ memcpy(&tmp, p, sizeof(tmp));
+ tmp = ntohl(tmp);
+ if (tmp > decrease) {
+ tmp -= decrease;
+ } else {
+ tmp = 0;
+ }
+ tmp = htonl(tmp);
+ memcpy(d_packet + d_offset-4, (const char*)&tmp, sizeof(tmp));
+ }
+
+ void setAndSkip32BitInt(uint32_t value)
+ {
+ moveOffset(4);
+
+ value = htonl(value);
+ memcpy(d_packet + d_offset-4, (const char*)&value, sizeof(value));
+ }
+
+ uint32_t getOffset() const
+ {
+ return d_offset;
+ }
+
+private:
+ void moveOffset(uint16_t by)
+ {
+ d_notyouroffset += by;
+ if(d_notyouroffset > d_length)
+ throw std::out_of_range("dns packet out of range: "+std::to_string(d_notyouroffset) +" > "
+ + std::to_string(d_length) );
+ }
+
+ void rewindOffset(uint16_t by)
+ {
+ if(d_notyouroffset < by)
+ throw std::out_of_range("Rewinding dns packet out of range: "+std::to_string(d_notyouroffset) +" < "
+ + std::to_string(by));
+ d_notyouroffset -= by;
+ if(d_notyouroffset < 12)
+ throw std::out_of_range("Rewinding dns packet out of range: "+std::to_string(d_notyouroffset) +" < "
+ + std::to_string(12));
+ }
+
+ char* d_packet;
+ size_t d_length;
+
+ uint32_t d_notyouroffset; // only 'moveOffset' can touch this
+ const uint32_t& d_offset; // look.. but don't touch
+};
diff --git a/dnstap.cc b/dnstap.cc
new file mode 100644
index 0000000..86f933a
--- /dev/null
+++ b/dnstap.cc
@@ -0,0 +1,92 @@
+#include <boost/uuid/uuid.hpp>
+#include "config.h"
+#include "gettime.hh"
+#include "dnstap.hh"
+
+#include <protozero/pbf_writer.hpp>
+
+namespace DnstapBaseFields {
+ enum : protozero::pbf_tag_type { identity = 1, version = 2, extra = 3, message = 14, type = 15 };
+}
+
+namespace DnstapMessageTypes {
+ enum : protozero::pbf_tag_type { message = 1 };
+}
+
+namespace DnstapSocketFamilyTypes {
+ enum : protozero::pbf_tag_type { inet = 1, inet6 = 2 };
+}
+
+namespace DnstapMessageFields {
+ enum : protozero::pbf_tag_type { type = 1, socket_family = 2, socket_protocol = 3, query_address = 4, response_address = 5, query_port = 6, response_port = 7, query_time_sec = 8, query_time_nsec = 9, query_message = 10, query_zone = 11, response_time_sec = 12, response_time_nsec = 13, response_message = 14 };
+}
+
+DnstapMessage::DnstapMessage(std::string& buffer, DnstapMessage::MessageType type, const std::string& identity, const ComboAddress* requestor, const ComboAddress* responder, DnstapMessage::ProtocolType protocol, const char* packet, const size_t len, const struct timespec* queryTime, const struct timespec* responseTime, boost::optional<const DNSName&> auth): d_buffer(buffer)
+{
+ protozero::pbf_writer pbf{d_buffer};
+
+ pbf.add_bytes(DnstapBaseFields::identity, identity);
+ pbf.add_bytes(DnstapBaseFields::version, PACKAGE_STRING);
+ pbf.add_enum(DnstapBaseFields::type, DnstapMessageTypes::message);
+
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(packet);
+ protozero::pbf_writer pbf_message{pbf, DnstapBaseFields::message};
+
+ pbf_message.add_enum(DnstapMessageFields::type, static_cast<protozero::pbf_tag_type>(type));
+ pbf_message.add_enum(DnstapMessageFields::socket_protocol, static_cast<protozero::pbf_tag_type>(protocol));
+
+ if (requestor != nullptr) {
+ pbf_message.add_enum(DnstapMessageFields::socket_family, requestor->sin4.sin_family == AF_INET ? DnstapSocketFamilyTypes::inet : DnstapSocketFamilyTypes::inet6);
+ }
+ else if (responder != nullptr) {
+ pbf_message.add_enum(DnstapMessageFields::socket_family, responder->sin4.sin_family == AF_INET ? DnstapSocketFamilyTypes::inet : DnstapSocketFamilyTypes::inet6);
+ }
+
+ if (requestor != nullptr) {
+ if (requestor->sin4.sin_family == AF_INET) {
+ pbf_message.add_bytes(DnstapMessageFields::query_address, reinterpret_cast<const char*>(&requestor->sin4.sin_addr.s_addr), sizeof(requestor->sin4.sin_addr.s_addr));
+ }
+ else if (requestor->sin4.sin_family == AF_INET6) {
+ pbf_message.add_bytes(DnstapMessageFields::query_address, reinterpret_cast<const char*>(&requestor->sin6.sin6_addr.s6_addr), sizeof(requestor->sin6.sin6_addr.s6_addr));
+ }
+ pbf_message.add_uint32(DnstapMessageFields::query_port, ntohs(requestor->sin4.sin_port));
+ }
+
+ if (responder != nullptr) {
+ if (responder->sin4.sin_family == AF_INET) {
+ pbf_message.add_bytes(DnstapMessageFields::response_address, reinterpret_cast<const char*>(&responder->sin4.sin_addr.s_addr), sizeof(responder->sin4.sin_addr.s_addr));
+ }
+ else if (responder->sin4.sin_family == AF_INET6) {
+ pbf_message.add_bytes(DnstapMessageFields::response_address, reinterpret_cast<const char*>(&responder->sin6.sin6_addr.s6_addr), sizeof(responder->sin6.sin6_addr.s6_addr));
+ }
+ pbf_message.add_uint32(DnstapMessageFields::response_port, ntohs(responder->sin4.sin_port));
+ }
+
+ if (queryTime != nullptr) {
+ pbf_message.add_uint64(DnstapMessageFields::query_time_sec, queryTime->tv_sec);
+ pbf_message.add_fixed32(DnstapMessageFields::query_time_nsec, queryTime->tv_nsec);
+ }
+
+ if (responseTime != nullptr) {
+ pbf_message.add_uint64(DnstapMessageFields::response_time_sec, responseTime->tv_sec);
+ pbf_message.add_fixed32(DnstapMessageFields::response_time_nsec, responseTime->tv_nsec);
+ }
+
+ if (!dh->qr) {
+ pbf_message.add_bytes(DnstapMessageFields::query_message, packet, len);
+ } else {
+ pbf_message.add_bytes(DnstapMessageFields::response_message, packet, len);
+ }
+
+ if (auth) {
+ pbf_message.add_bytes(DnstapMessageFields::query_zone, auth->toDNSString());
+ }
+
+ pbf_message.commit();
+}
+
+void DnstapMessage::setExtra(const std::string& extra)
+{
+ protozero::pbf_writer pbf{d_buffer};
+ pbf.add_bytes(DnstapBaseFields::extra, extra);
+}
diff --git a/dnstap.hh b/dnstap.hh
new file mode 100644
index 0000000..798e867
--- /dev/null
+++ b/dnstap.hh
@@ -0,0 +1,45 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <cstddef>
+#include <string>
+
+#include "config.h"
+
+#include "dnsname.hh"
+#include "iputils.hh"
+#include "protozero.hh"
+
+class DnstapMessage
+{
+public:
+ enum class MessageType : uint32_t { auth_query = 1, auth_response = 2, resolver_query = 3, resolver_response = 4, client_query = 5, client_response = 6, forwarder_query = 7, forwarded_response = 8, stub_query = 9, stub_response = 10, tool_query = 11, tool_response = 12 };
+ enum class ProtocolType : uint32_t { DoUDP = 1, DoTCP = 2, DoT = 3, DoH = 4, DNSCryptUDP = 5, DNSCryptTCP = 6 };
+
+ DnstapMessage(std::string& buffer, MessageType type, const std::string& identity, const ComboAddress* requestor, const ComboAddress* responder, ProtocolType protocol, const char* packet, const size_t len, const struct timespec* queryTime, const struct timespec* responseTime, boost::optional<const DNSName&> auth=boost::none);
+
+ void setExtra(const std::string& extra);
+
+protected:
+ std::string& d_buffer;
+};
diff --git a/dnstap.proto b/dnstap.proto
new file mode 100644
index 0000000..3780c49
--- /dev/null
+++ b/dnstap.proto
@@ -0,0 +1,330 @@
+// dnstap: flexible, structured event replication format for DNS software
+//
+// This file contains the protobuf schemas for the "dnstap" structured event
+// replication format for DNS software.
+
+// Written in 2013-2014 by Farsight Security, Inc.
+//
+// To the extent possible under law, the author(s) have dedicated all
+// copyright and related and neighboring rights to this file to the public
+// domain worldwide. This file is distributed without any warranty.
+//
+// You should have received a copy of the CC0 Public Domain Dedication along
+// with this file. If not, see:
+//
+// <http://creativecommons.org/publicdomain/zero/1.0/>.
+
+syntax = "proto2";
+package dnstap;
+
+// "Dnstap": this is the top-level dnstap type, which is a "union" type that
+// contains other kinds of dnstap payloads, although currently only one type
+// of dnstap payload is defined.
+// See: https://developers.google.com/protocol-buffers/docs/techniques#union
+message Dnstap {
+ // DNS server identity.
+ // If enabled, this is the identity string of the DNS server which generated
+ // this message. Typically this would be the same string as returned by an
+ // "NSID" (RFC 5001) query.
+ optional bytes identity = 1;
+
+ // DNS server version.
+ // If enabled, this is the version string of the DNS server which generated
+ // this message. Typically this would be the same string as returned by a
+ // "version.bind" query.
+ optional bytes version = 2;
+
+ // Extra data for this payload.
+ // This field can be used for adding an arbitrary byte-string annotation to
+ // the payload. No encoding or interpretation is applied or enforced.
+ optional bytes extra = 3;
+
+ // Identifies which field below is filled in.
+ enum Type {
+ MESSAGE = 1;
+ }
+ required Type type = 15;
+
+ // One of the following will be filled in.
+ optional Message message = 14;
+}
+
+// SocketFamily: the network protocol family of a socket. This specifies how
+// to interpret "network address" fields.
+enum SocketFamily {
+ INET = 1; // IPv4 (RFC 791)
+ INET6 = 2; // IPv6 (RFC 2460)
+}
+
+// SocketProtocol: the protocol used to transport a DNS message.
+enum SocketProtocol {
+ UDP = 1; // DNS over UDP transport (RFC 1035 section 4.2.1)
+ TCP = 2; // DNS over TCP transport (RFC 1035 section 4.2.2)
+ DOT = 3; // DNS over TLS (RFC 7858)
+ DOH = 4; // DNS over HTTPS (RFC 8484)
+ DNSCryptUDP = 5; // DNSCrypt over UDP (https://dnscrypt.info/protocol)
+ DNSCryptTCP = 6; // DNSCrypt over TCP (https://dnscrypt.info/protocol)
+}
+
+// Policy: information about any name server operator policy
+// applied to the processing of a DNS message.
+message Policy {
+
+ // Match: what aspect of the message or message exchange
+ // triggered the application of the Policy.
+ enum Match {
+ QNAME = 1; // Name in question section of query
+ CLIENT_IP = 2; // Client IP address
+ RESPONSE_IP = 3; // Address in A/AAAA RRSet
+ NS_NAME = 4; // Authoritative name server, by name
+ NS_IP = 5; // Authoritative name server, by IP address
+ }
+
+ // The Action taken to implement the Policy.
+ enum Action {
+ NXDOMAIN = 1; // Respond with NXDOMAIN
+ NODATA = 2; // Respond with empty answer section
+ PASS = 3; // Do not alter the response (passthrough)
+ DROP = 4; // Do not respond.
+ TRUNCATE = 5; // Truncate UDP response, forcing TCP retry
+ LOCAL_DATA = 6; // Respond with local data from policy
+ }
+
+ // type: the type of policy applied, e.g. "RPZ" for a
+ // policy from a Response Policy Zone.
+ optional string type = 1;
+
+ // rule: the rule matched by the message.
+ //
+ // In a RPZ context, this is the owner name of the rule in
+ // the Reponse Policy Zone in wire format.
+ optional bytes rule = 2;
+
+ // action: the policy action taken in response to the
+ // rule match.
+ optional Action action = 3;
+
+ // match: the feature of the message exchange which matched the rule.
+ optional Match match = 4;
+
+ // The matched value. Format depends on the matched feature .
+ optional bytes value = 5;
+}
+
+// Message: a wire-format (RFC 1035 section 4) DNS message and associated
+// metadata. Applications generating "Message" payloads should follow
+// certain requirements based on the MessageType, see below.
+message Message {
+
+ // There are eight types of "Message" defined that correspond to the
+ // four arrows in the following diagram, slightly modified from RFC 1035
+ // section 2:
+
+ // +---------+ +----------+ +--------+
+ // | | query | | query | |
+ // | Stub |-SQ--------CQ->| Recursive|-RQ----AQ->| Auth. |
+ // | Resolver| | Server | | Name |
+ // | |<-SR--------CR-| |<-RR----AR-| Server |
+ // +---------+ response | | response | |
+ // +----------+ +--------+
+
+ // Each arrow has two Type values each, one for each "end" of each arrow,
+ // because these are considered to be distinct events. Each end of each
+ // arrow on the diagram above has been marked with a two-letter Type
+ // mnemonic. Clockwise from upper left, these mnemonic values are:
+ //
+ // SQ: STUB_QUERY
+ // CQ: CLIENT_QUERY
+ // RQ: RESOLVER_QUERY
+ // AQ: AUTH_QUERY
+ // AR: AUTH_RESPONSE
+ // RR: RESOLVER_RESPONSE
+ // CR: CLIENT_RESPONSE
+ // SR: STUB_RESPONSE
+
+ // Two additional types of "Message" have been defined for the
+ // "forwarding" case where an upstream DNS server is responsible for
+ // further recursion. These are not shown on the diagram above, but have
+ // the following mnemonic values:
+
+ // FQ: FORWARDER_QUERY
+ // FR: FORWARDER_RESPONSE
+
+ // The "Message" Type values are defined below.
+
+ enum Type {
+ // AUTH_QUERY is a DNS query message received from a resolver by an
+ // authoritative name server, from the perspective of the authoritative
+ // name server.
+ AUTH_QUERY = 1;
+
+ // AUTH_RESPONSE is a DNS response message sent from an authoritative
+ // name server to a resolver, from the perspective of the authoritative
+ // name server.
+ AUTH_RESPONSE = 2;
+
+ // RESOLVER_QUERY is a DNS query message sent from a resolver to an
+ // authoritative name server, from the perspective of the resolver.
+ // Resolvers typically clear the RD (recursion desired) bit when
+ // sending queries.
+ RESOLVER_QUERY = 3;
+
+ // RESOLVER_RESPONSE is a DNS response message received from an
+ // authoritative name server by a resolver, from the perspective of
+ // the resolver.
+ RESOLVER_RESPONSE = 4;
+
+ // CLIENT_QUERY is a DNS query message sent from a client to a DNS
+ // server which is expected to perform further recursion, from the
+ // perspective of the DNS server. The client may be a stub resolver or
+ // forwarder or some other type of software which typically sets the RD
+ // (recursion desired) bit when querying the DNS server. The DNS server
+ // may be a simple forwarding proxy or it may be a full recursive
+ // resolver.
+ CLIENT_QUERY = 5;
+
+ // CLIENT_RESPONSE is a DNS response message sent from a DNS server to
+ // a client, from the perspective of the DNS server. The DNS server
+ // typically sets the RA (recursion available) bit when responding.
+ CLIENT_RESPONSE = 6;
+
+ // FORWARDER_QUERY is a DNS query message sent from a downstream DNS
+ // server to an upstream DNS server which is expected to perform
+ // further recursion, from the perspective of the downstream DNS
+ // server.
+ FORWARDER_QUERY = 7;
+
+ // FORWARDER_RESPONSE is a DNS response message sent from an upstream
+ // DNS server performing recursion to a downstream DNS server, from the
+ // perspective of the downstream DNS server.
+ FORWARDER_RESPONSE = 8;
+
+ // STUB_QUERY is a DNS query message sent from a stub resolver to a DNS
+ // server, from the perspective of the stub resolver.
+ STUB_QUERY = 9;
+
+ // STUB_RESPONSE is a DNS response message sent from a DNS server to a
+ // stub resolver, from the perspective of the stub resolver.
+ STUB_RESPONSE = 10;
+
+ // TOOL_QUERY is a DNS query message sent from a DNS software tool to a
+ // DNS server, from the perspective of the tool.
+ TOOL_QUERY = 11;
+
+ // TOOL_RESPONSE is a DNS response message received by a DNS software
+ // tool from a DNS server, from the perspective of the tool.
+ TOOL_RESPONSE = 12;
+
+ // UPDATE_QUERY is a DNS update query message received from a resolver
+ // by an authoritative name server, from the perspective of the
+ // authoritative name server.
+ UPDATE_QUERY = 13;
+
+ // UPDATE_RESPONSE is a DNS update response message sent from an
+ // authoritative name server to a resolver, from the perspective of the
+ // authoritative name server.
+ UPDATE_RESPONSE = 14;
+ }
+
+ // One of the Type values described above.
+ required Type type = 1;
+
+ // One of the SocketFamily values described above.
+ optional SocketFamily socket_family = 2;
+
+ // One of the SocketProtocol values described above.
+ optional SocketProtocol socket_protocol = 3;
+
+ // The network address of the message initiator.
+ // For SocketFamily INET, this field is 4 octets (IPv4 address).
+ // For SocketFamily INET6, this field is 16 octets (IPv6 address).
+ optional bytes query_address = 4;
+
+ // The network address of the message responder.
+ // For SocketFamily INET, this field is 4 octets (IPv4 address).
+ // For SocketFamily INET6, this field is 16 octets (IPv6 address).
+ optional bytes response_address = 5;
+
+ // The transport port of the message initiator.
+ // This is a 16-bit UDP or TCP port number, depending on SocketProtocol.
+ optional uint32 query_port = 6;
+
+ // The transport port of the message responder.
+ // This is a 16-bit UDP or TCP port number, depending on SocketProtocol.
+ optional uint32 response_port = 7;
+
+ // The time at which the DNS query message was sent or received, depending
+ // on whether this is an AUTH_QUERY, RESOLVER_QUERY, or CLIENT_QUERY.
+ // This is the number of seconds since the UNIX epoch.
+ optional uint64 query_time_sec = 8;
+
+ // The time at which the DNS query message was sent or received.
+ // This is the seconds fraction, expressed as a count of nanoseconds.
+ optional fixed32 query_time_nsec = 9;
+
+ // The initiator's original wire-format DNS query message, verbatim.
+ optional bytes query_message = 10;
+
+ // The "zone" or "bailiwick" pertaining to the DNS query message.
+ // This is a wire-format DNS domain name.
+ optional bytes query_zone = 11;
+
+ // The time at which the DNS response message was sent or received,
+ // depending on whether this is an AUTH_RESPONSE, RESOLVER_RESPONSE, or
+ // CLIENT_RESPONSE.
+ // This is the number of seconds since the UNIX epoch.
+ optional uint64 response_time_sec = 12;
+
+ // The time at which the DNS response message was sent or received.
+ // This is the seconds fraction, expressed as a count of nanoseconds.
+ optional fixed32 response_time_nsec = 13;
+
+ // The responder's original wire-format DNS response message, verbatim.
+ optional bytes response_message = 14;
+
+ // Operator policy applied to the processing of this message, if any.
+ optional Policy policy = 15;
+}
+
+// All fields except for 'type' in the Message schema are optional.
+// It is recommended that at least the following fields be filled in for
+// particular types of Messages.
+
+// AUTH_QUERY:
+// socket_family, socket_protocol
+// query_address, query_port
+// query_message
+// query_time_sec, query_time_nsec
+
+// AUTH_RESPONSE:
+// socket_family, socket_protocol
+// query_address, query_port
+// query_time_sec, query_time_nsec
+// response_message
+// response_time_sec, response_time_nsec
+
+// RESOLVER_QUERY:
+// socket_family, socket_protocol
+// query_message
+// query_time_sec, query_time_nsec
+// query_zone
+// response_address, response_port
+
+// RESOLVER_RESPONSE:
+// socket_family, socket_protocol
+// query_time_sec, query_time_nsec
+// query_zone
+// response_address, response_port
+// response_message
+// response_time_sec, response_time_nsec
+
+// CLIENT_QUERY:
+// socket_family, socket_protocol
+// query_message
+// query_time_sec, query_time_nsec
+
+// CLIENT_RESPONSE:
+// socket_family, socket_protocol
+// query_time_sec, query_time_nsec
+// response_message
+// response_time_sec, response_time_nsec
diff --git a/dnswriter.cc b/dnswriter.cc
new file mode 100644
index 0000000..0fd81b4
--- /dev/null
+++ b/dnswriter.cc
@@ -0,0 +1,521 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <boost/version.hpp>
+#if BOOST_VERSION >= 105400
+#include <boost/container/static_vector.hpp>
+#endif
+#include "dnswriter.hh"
+#include "misc.hh"
+#include "dnsparser.hh"
+
+#include <limits.h>
+
+/* d_content: <---- d_stuff ---->
+ v d_truncatemarker
+ dnsheader | qname | qtype | qclass | {recordname| dnsrecordheader | record }
+ ^ d_rollbackmarker ^ d_sor
+
+
+*/
+
+
+template <typename Container> GenericDNSPacketWriter<Container>::GenericDNSPacketWriter(Container& content, const DNSName& qname, uint16_t qtype, uint16_t qclass, uint8_t opcode)
+ : d_content(content), d_qname(qname), d_canonic(false), d_lowerCase(false)
+{
+ d_content.clear();
+ dnsheader dnsheader;
+
+ memset(&dnsheader, 0, sizeof(dnsheader));
+ dnsheader.id=0;
+ dnsheader.qdcount=htons(1);
+ dnsheader.opcode=opcode;
+
+ const uint8_t* ptr=(const uint8_t*)&dnsheader;
+ d_content.reserve(sizeof(dnsheader) + qname.wirelength() + sizeof(qtype) + sizeof(qclass));
+ d_content.resize(sizeof(dnsheader));
+ uint8_t* dptr=(&*d_content.begin());
+
+ memcpy(dptr, ptr, sizeof(dnsheader));
+ d_namepositions.reserve(16);
+ xfrName(qname, false);
+ xfr16BitInt(qtype);
+ xfr16BitInt(qclass);
+
+ d_truncatemarker=d_content.size();
+ d_sor = 0;
+ d_rollbackmarker = 0;
+}
+
+template <typename Container> dnsheader* GenericDNSPacketWriter<Container>::getHeader()
+{
+ return reinterpret_cast<dnsheader*>(&*d_content.begin());
+}
+
+
+template <typename Container> void GenericDNSPacketWriter<Container>::startRecord(const DNSName& name, uint16_t qtype, uint32_t ttl, uint16_t qclass, DNSResourceRecord::Place place, bool compress)
+{
+ d_compress = compress;
+ commit();
+ d_rollbackmarker=d_content.size();
+
+ if(compress && !name.isRoot() && d_qname==name) { // don't do the whole label compression thing if we *know* we can get away with "see question" - except when compressing the root
+ static unsigned char marker[2]={0xc0, 0x0c};
+ d_content.insert(d_content.end(), (const char *) &marker[0], (const char *) &marker[2]);
+ }
+ else {
+ xfrName(name, compress);
+ }
+ xfr16BitInt(qtype);
+ xfr16BitInt(qclass);
+ xfr32BitInt(ttl);
+ xfr16BitInt(0); // this will be the record size
+ d_recordplace = place;
+ d_sor=d_content.size(); // this will remind us where to stuff the record size
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::addOpt(const uint16_t udpsize, const uint16_t extRCode, const uint16_t ednsFlags, const optvect_t& options, const uint8_t version)
+{
+ uint32_t ttl=0;
+
+ EDNS0Record stuff;
+
+ stuff.version = version;
+ stuff.extFlags = htons(ednsFlags);
+
+ /* RFC 6891 section 4 on the Extended RCode wire format
+ * EXTENDED-RCODE
+ * Forms the upper 8 bits of extended 12-bit RCODE (together with the
+ * 4 bits defined in [RFC1035]. Note that EXTENDED-RCODE value 0
+ * indicates that an unextended RCODE is in use (values 0 through 15).
+ */
+ // XXX Should be check for extRCode > 1<<12 ?
+ stuff.extRCode = extRCode>>4;
+ if (extRCode != 0) { // As this trumps the existing RCODE
+ getHeader()->rcode = extRCode;
+ }
+
+ static_assert(sizeof(EDNS0Record) == sizeof(ttl), "sizeof(EDNS0Record) must match sizeof(ttl)");
+ memcpy(&ttl, &stuff, sizeof(stuff));
+
+ ttl=ntohl(ttl); // will be reversed later on
+
+ startRecord(g_rootdnsname, QType::OPT, ttl, udpsize, DNSResourceRecord::ADDITIONAL, false);
+ for(auto const &option : options) {
+ xfr16BitInt(option.first);
+ xfr16BitInt(option.second.length());
+ xfrBlob(option.second);
+ }
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfr48BitInt(uint64_t val)
+{
+ unsigned char bytes[6];
+ uint16_t theLeft = htons((val >> 32)&0xffffU);
+ uint32_t theRight = htonl(val & 0xffffffffU);
+ memcpy(bytes, (void*)&theLeft, sizeof(theLeft));
+ memcpy(bytes+2, (void*)&theRight, sizeof(theRight));
+
+ d_content.insert(d_content.end(), bytes, bytes + sizeof(bytes));
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfrNodeOrLocatorID(const NodeOrLocatorID& val)
+{
+ d_content.insert(d_content.end(), val.content, val.content + sizeof(val.content));
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfr32BitInt(uint32_t val)
+{
+ uint32_t rval=htonl(val);
+ uint8_t* ptr=reinterpret_cast<uint8_t*>(&rval);
+ d_content.insert(d_content.end(), ptr, ptr+4);
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfr16BitInt(uint16_t val)
+{
+ uint16_t rval=htons(val);
+ uint8_t* ptr=reinterpret_cast<uint8_t*>(&rval);
+ d_content.insert(d_content.end(), ptr, ptr+2);
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfr8BitInt(uint8_t val)
+{
+ d_content.push_back(val);
+}
+
+
+/* input:
+ if lenField is true
+ "" -> 0
+ "blah" -> 4blah
+ "blah" "blah" -> output 4blah4blah
+ "verylongstringlongerthan256....characters" \xffverylongstring\x23characters (autosplit)
+ "blah\"blah" -> 9blah"blah
+ "blah\97" -> 5blahb
+
+ if lenField is false
+ "blah" -> blah
+ "blah\"blah" -> blah"blah
+ */
+template <typename Container> void GenericDNSPacketWriter<Container>::xfrText(const string& text, bool, bool lenField)
+{
+ if(text.empty()) {
+ d_content.push_back(0);
+ return;
+ }
+ vector<string> segments = segmentDNSText(text);
+ for(const string& str : segments) {
+ if(lenField)
+ d_content.push_back(str.length());
+ d_content.insert(d_content.end(), str.c_str(), str.c_str() + str.length());
+ }
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfrUnquotedText(const string& text, bool lenField)
+{
+ if(text.empty()) {
+ d_content.push_back(0);
+ return;
+ }
+ if(lenField)
+ d_content.push_back(text.length());
+ d_content.insert(d_content.end(), text.c_str(), text.c_str() + text.length());
+}
+
+
+static constexpr bool l_verbose=false;
+static constexpr uint16_t maxCompressionOffset=16384;
+template <typename Container> uint16_t GenericDNSPacketWriter<Container>::lookupName(const DNSName& name, uint16_t* matchLen)
+{
+ // iterate over the written labels, see if we find a match
+ const auto& raw = name.getStorage();
+
+ /* name might be a.root-servers.net, we need to be able to benefit from finding:
+ b.root-servers.net, or even:
+ b\xc0\x0c
+ */
+ unsigned int bestpos=0;
+ *matchLen=0;
+#if BOOST_VERSION >= 105400
+ boost::container::static_vector<uint16_t, 34> nvect, pvect;
+#else
+ vector<uint16_t> nvect, pvect;
+#endif
+
+ try {
+ for(auto riter= raw.cbegin(); riter < raw.cend(); ) {
+ if(!*riter)
+ break;
+ nvect.push_back(riter - raw.cbegin());
+ riter+=*riter+1;
+ }
+ }
+ catch(std::bad_alloc& ba) {
+ if(l_verbose)
+ cout<<"Domain "<<name<<" too large to compress"<<endl;
+ return 0;
+ }
+
+ if(l_verbose) {
+ cout<<"Input vector for lookup "<<name<<": ";
+ for(const auto n : nvect)
+ cout << n<<" ";
+ cout<<endl;
+ cout<<makeHexDump(string(raw.c_str(), raw.c_str()+raw.size()))<<endl;
+ }
+
+ if(l_verbose)
+ cout<<"Have "<<d_namepositions.size()<<" to ponder"<<endl;
+ int counter=1;
+ for(auto p : d_namepositions) {
+ if(l_verbose) {
+ cout<<"Pos: "<<p<<", "<<d_content.size()<<endl;
+ DNSName pname((const char*)&d_content[0], d_content.size(), p, true); // only for debugging
+ cout<<"Looking at '"<<pname<<"' in packet at position "<<p<<"/"<<d_content.size()<<", option "<<counter<<"/"<<d_namepositions.size()<<endl;
+ ++counter;
+ }
+ // memcmp here makes things _slower_
+ pvect.clear();
+ try {
+ for(auto iter = d_content.cbegin() + p; iter < d_content.cend();) {
+ uint8_t c=*iter;
+ if(l_verbose)
+ cout<<"Found label length: "<<(int)c<<endl;
+ if(c & 0xc0) {
+ uint16_t npos = 0x100*(c & (~0xc0)) + *++iter;
+ iter = d_content.begin() + npos;
+ if(l_verbose)
+ cout<<"Is compressed label to newpos "<<npos<<", going there"<<endl;
+ // check against going forward here
+ continue;
+ }
+ if(!c)
+ break;
+ auto offset = iter - d_content.cbegin();
+ if (offset >= maxCompressionOffset) break; // compression pointers cannot point here
+ pvect.push_back(offset);
+ iter+=*iter+1;
+ }
+ }
+ catch(std::bad_alloc& ba) {
+ if(l_verbose)
+ cout<<"Domain "<<name<<" too large to compress"<<endl;
+ continue;
+ }
+ if(l_verbose) {
+ cout<<"Packet vector: "<<endl;
+ for(const auto n : pvect)
+ cout << n<<" ";
+ cout<<endl;
+ }
+ auto niter=nvect.crbegin(), piter=pvect.crbegin();
+ unsigned int cmatchlen=1;
+ for(; niter != nvect.crend() && piter != pvect.crend(); ++niter, ++piter) {
+ // niter is an offset in raw, pvect an offset in packet
+ uint8_t nlen = raw[*niter], plen=d_content[*piter];
+ if(l_verbose)
+ cout<<"nlnen="<<(int)nlen<<", plen="<<(int)plen<<endl;
+ if(nlen != plen)
+ break;
+ if(strncasecmp(raw.c_str()+*niter+1, (const char*)&d_content[*piter]+1, nlen)) {
+ if(l_verbose)
+ cout<<"Mismatch: "<<string(raw.c_str()+*niter+1, raw.c_str()+*niter+nlen+1)<< " != "<<string((const char*)&d_content[*piter]+1, (const char*)&d_content[*piter]+nlen+1)<<endl;
+ break;
+ }
+ cmatchlen+=nlen+1;
+ if(cmatchlen == raw.length()) { // have matched all of it, can't improve
+ if(l_verbose)
+ cout<<"Stopping search, matched whole name"<<endl;
+ *matchLen = cmatchlen;
+ return *piter;
+ }
+ }
+ if(piter != pvect.crbegin() && *matchLen < cmatchlen) {
+ *matchLen = cmatchlen;
+ bestpos=*--piter;
+ }
+ }
+ return bestpos;
+}
+// this is the absolute hottest function in the pdns recursor
+template <typename Container> void GenericDNSPacketWriter<Container>::xfrName(const DNSName& name, bool compress, bool)
+{
+ if(l_verbose)
+ cout<<"Wants to write "<<name<<", compress="<<compress<<", canonic="<<d_canonic<<", LC="<<d_lowerCase<<endl;
+ if(d_canonic || d_lowerCase) // d_lowerCase implies canonic
+ compress=false;
+
+ if(name.empty() || name.isRoot()) { // for speed
+ d_content.push_back(0);
+ return;
+ }
+
+ uint16_t li=0;
+ uint16_t matchlen=0;
+ if(d_compress && compress && (li=lookupName(name, &matchlen)) && li < maxCompressionOffset) {
+ const auto& dns=name.getStorage();
+ if(l_verbose)
+ cout<<"Found a substring of "<<matchlen<<" bytes from the back, offset: "<<li<<", dnslen: "<<dns.size()<<endl;
+ // found a substring, if www.powerdns.com matched powerdns.com, we get back matchlen = 13
+
+ unsigned int pos=d_content.size();
+ if(pos < maxCompressionOffset && matchlen != dns.size()) {
+ if(l_verbose)
+ cout<<"Inserting pos "<<pos<<" for "<<name<<" for compressed case"<<endl;
+ d_namepositions.push_back(pos);
+ }
+
+ if(l_verbose)
+ cout<<"Going to write unique part: '"<<makeHexDump(string(dns.c_str(), dns.c_str() + dns.size() - matchlen)) <<"'"<<endl;
+ d_content.insert(d_content.end(), (const unsigned char*)dns.c_str(), (const unsigned char*)dns.c_str() + dns.size() - matchlen);
+ uint16_t offset=li;
+ offset|=0xc000;
+
+ d_content.push_back((char)(offset >> 8));
+ d_content.push_back((char)(offset & 0xff));
+ }
+ else {
+ unsigned int pos=d_content.size();
+ if(l_verbose)
+ cout<<"Found nothing, we are at pos "<<pos<<", inserting whole name"<<endl;
+ if(pos < maxCompressionOffset) {
+ if(l_verbose)
+ cout<<"Inserting pos "<<pos<<" for "<<name<<" for uncompressed case"<<endl;
+ d_namepositions.push_back(pos);
+ }
+
+ std::unique_ptr<DNSName> lc;
+ if(d_lowerCase)
+ lc = make_unique<DNSName>(name.makeLowerCase());
+
+ const DNSName::string_t& raw = (lc ? *lc : name).getStorage();
+ if(l_verbose)
+ cout<<"Writing out the whole thing "<<makeHexDump(string(raw.c_str(), raw.c_str() + raw.length()))<<endl;
+ d_content.insert(d_content.end(), raw.c_str(), raw.c_str() + raw.size());
+ }
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfrBlob(const string& blob, int )
+{
+ const uint8_t* ptr=reinterpret_cast<const uint8_t*>(blob.c_str());
+ d_content.insert(d_content.end(), ptr, ptr+blob.size());
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfrBlob(const std::vector<uint8_t>& blob)
+{
+ d_content.insert(d_content.end(), blob.begin(), blob.end());
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfrBlobNoSpaces(const string& blob, int )
+{
+ xfrBlob(blob);
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfrHexBlob(const string& blob, bool keepReading)
+{
+ xfrBlob(blob);
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::xfrSvcParamKeyVals(const std::set<SvcParam> &kvs)
+{
+ for (auto const &param : kvs) {
+ // Key first!
+ xfr16BitInt(param.getKey());
+
+ switch (param.getKey())
+ {
+ case SvcParam::mandatory:
+ xfr16BitInt(2 * param.getMandatory().size());
+ for (auto const &m: param.getMandatory()) {
+ xfr16BitInt(m);
+ }
+ break;
+ case SvcParam::alpn:
+ {
+ uint16_t totalSize = param.getALPN().size(); // All 1 octet size headers for each value
+ for (auto const &a : param.getALPN()) {
+ totalSize += a.length();
+ }
+ xfr16BitInt(totalSize);
+ for (auto const &a : param.getALPN()) {
+ xfrUnquotedText(a, true); // will add the 1-byte length field
+ }
+ break;
+ }
+ case SvcParam::no_default_alpn:
+ xfr16BitInt(0); // no size :)
+ break;
+ case SvcParam::port:
+ xfr16BitInt(2); // size
+ xfr16BitInt(param.getPort());
+ break;
+ case SvcParam::ipv4hint:
+ xfr16BitInt(param.getIPHints().size() * 4); // size
+ for (auto a: param.getIPHints()) {
+ xfrCAWithoutPort(param.getKey(), a);
+ }
+ break;
+ case SvcParam::ipv6hint:
+ xfr16BitInt(param.getIPHints().size() * 16); // size
+ for (auto a: param.getIPHints()) {
+ xfrCAWithoutPort(param.getKey(), a);
+ }
+ break;
+ case SvcParam::ech:
+ xfr16BitInt(param.getECH().size()); // size
+ xfrBlobNoSpaces(param.getECH());
+ break;
+ default:
+ xfr16BitInt(param.getValue().size());
+ xfrBlob(param.getValue());
+ break;
+ }
+ }
+}
+
+// call __before commit__
+template <typename Container> void GenericDNSPacketWriter<Container>::getRecordPayload(string& records)
+{
+ records.assign(d_content.begin() + d_sor, d_content.end());
+}
+
+template <typename Container> uint32_t GenericDNSPacketWriter<Container>::size() const
+{
+ return d_content.size();
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::rollback()
+{
+ d_content.resize(d_rollbackmarker);
+ d_sor = 0;
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::truncate()
+{
+ d_content.resize(d_truncatemarker);
+ dnsheader* dh=reinterpret_cast<dnsheader*>( &*d_content.begin());
+ dh->ancount = dh->nscount = dh->arcount = 0;
+}
+
+template <typename Container> void GenericDNSPacketWriter<Container>::commit()
+{
+ if(!d_sor)
+ return;
+ uint16_t rlen = d_content.size() - d_sor;
+ d_content[d_sor-2]=rlen >> 8;
+ d_content[d_sor-1]=rlen & 0xff;
+ d_sor=0;
+ dnsheader* dh=reinterpret_cast<dnsheader*>( &*d_content.begin());
+ switch(d_recordplace) {
+ case DNSResourceRecord::QUESTION:
+ dh->qdcount = htons(ntohs(dh->qdcount) + 1);
+ break;
+ case DNSResourceRecord::ANSWER:
+ dh->ancount = htons(ntohs(dh->ancount) + 1);
+ break;
+ case DNSResourceRecord::AUTHORITY:
+ dh->nscount = htons(ntohs(dh->nscount) + 1);
+ break;
+ case DNSResourceRecord::ADDITIONAL:
+ dh->arcount = htons(ntohs(dh->arcount) + 1);
+ break;
+ }
+
+}
+
+template <typename Container> size_t GenericDNSPacketWriter<Container>::getSizeWithOpts(const optvect_t& options) const
+{
+ size_t result = size() + /* root */ 1 + DNS_TYPE_SIZE + DNS_CLASS_SIZE + DNS_TTL_SIZE + DNS_RDLENGTH_SIZE;
+
+ for(auto const &option : options) {
+ result += 4;
+ result += option.second.size();
+ }
+
+ return result;
+}
+
+template class GenericDNSPacketWriter<std::vector<uint8_t>>;
+#include "noinitvector.hh"
+template class GenericDNSPacketWriter<PacketBuffer>;
diff --git a/dnswriter.hh b/dnswriter.hh
new file mode 100644
index 0000000..485b547
--- /dev/null
+++ b/dnswriter.hh
@@ -0,0 +1,183 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <string>
+#include <vector>
+#include <map>
+#include "dns.hh"
+#include "dnsname.hh"
+#include "namespaces.hh"
+#include "iputils.hh"
+#include "svc-records.hh"
+#include <arpa/inet.h>
+
+
+/** this class can be used to write DNS packets. It knows about DNS in the sense that it makes
+ the packet header and record headers.
+
+ The model is:
+
+ packetheader (recordheader recordcontent)*
+
+ The packetheader needs to be updated with the amount of packets of each kind (answer, auth, additional)
+
+ Each recordheader contains the length of a dns record.
+
+ Calling convention:
+
+ vector<uint8_t> content;
+ DNSPacketWriter dpw(content, const string& qname, uint16_t qtype, uint16_t qclass=QClass:IN); // sets the question
+ dpw.startrecord("this.is.an.ip.address.", ns_t_a); // does nothing, except store qname and qtype
+ dpw.xfr32BitInt(0x01020304); // adds 4 bytes (0x01020304) to the record buffer
+ dpw.startrecord("this.is.an.ip.address.", ns_t_a); // aha! writes out dnsrecord header containing qname and qtype and length 4, plus the recordbuffer, which gets emptied
+ // new qname and qtype are stored
+ dpw.xfr32BitInt(0x04030201); // adds 4 bytes (0x04030201) to the record buffer
+ dpw.commit(); // writes out dnsrecord header containing qname and qtype and length 4, plus the recordbuffer
+
+ // content now contains the ready packet, with 1 question and 2 answers
+
+*/
+
+template <typename Container> class GenericDNSPacketWriter : public boost::noncopyable
+{
+
+public:
+ //! Start a DNS Packet in the vector passed, with question qname, qtype and qclass
+ GenericDNSPacketWriter(Container& content, const DNSName& qname, uint16_t qtype, uint16_t qclass=QClass::IN, uint8_t opcode=0);
+
+ /** Start a new DNS record within this packet for name, qtype, ttl, class and in the requested place. Note that packets can only be written in natural order -
+ ANSWER, AUTHORITY, ADDITIONAL */
+ void startRecord(const DNSName& name, uint16_t qtype, uint32_t ttl=3600, uint16_t qclass=QClass::IN, DNSResourceRecord::Place place=DNSResourceRecord::ANSWER, bool compress=true);
+
+ /** Shorthand way to add an Opt-record, for example for EDNS0 purposes */
+ typedef vector<pair<uint16_t,std::string> > optvect_t;
+ void addOpt(const uint16_t udpsize, const uint16_t extRCode, const uint16_t ednsFlags, const optvect_t& options=optvect_t(), const uint8_t version=0);
+
+ /** needs to be called after the last record is added, but can be called again and again later on. Is called internally by startRecord too.
+ The content of the vector<> passed to the constructor is inconsistent until commit is called.
+ */
+ void commit();
+
+ uint32_t size() const; // needs to be 32 bit because otherwise we don't see the wrap coming when it happened!
+
+ /** Should the packet have grown too big for the writer's liking, rollback removes the record currently being written */
+ void rollback();
+
+ /** Discard all content except the question section */
+ void truncate();
+
+ void xfr48BitInt(uint64_t val);
+ void xfrNodeOrLocatorID(const NodeOrLocatorID& val);
+ void xfr32BitInt(uint32_t val);
+ void xfr16BitInt(uint16_t val);
+ void xfrType(uint16_t val)
+ {
+ xfr16BitInt(val);
+ }
+ void xfrIP(const uint32_t& val)
+ {
+ xfr32BitInt(htonl(val));
+ }
+ void xfrIP6(const std::string& val)
+ {
+ xfrBlob(val,16);
+ }
+
+ void xfrCAWithoutPort(uint8_t version, const ComboAddress &val)
+ {
+ if (version == 4) xfrIP(val.sin4.sin_addr.s_addr);
+ else if (version == 6) {
+ string blob;
+ blob.assign((const char*)val.sin6.sin6_addr.s6_addr, 16);
+ xfrBlob(blob, 16);
+ }
+ else throw runtime_error("invalid IP protocol");
+ }
+
+ void xfrCAPort(const ComboAddress &val)
+ {
+ uint16_t port;
+ port = val.sin4.sin_port;
+ xfr16BitInt(port);
+ }
+
+ void xfrTime(const uint32_t& val)
+ {
+ xfr32BitInt(val);
+ }
+
+ void xfr8BitInt(uint8_t val);
+
+ void xfrName(const DNSName& label, bool compress=false, bool noDot=false);
+ void xfrText(const string& text, bool multi=false, bool lenField=true);
+ void xfrUnquotedText(const string& text, bool lenField);
+ void xfrBlob(const string& blob, int len=-1);
+ void xfrBlob(const vector<uint8_t>& blob);
+ void xfrSvcParamKeyVals(const set<SvcParam>& kvs);
+ void xfrBlobNoSpaces(const string& blob, int len=-1);
+ void xfrHexBlob(const string& blob, bool keepReading=false);
+
+ dnsheader* getHeader();
+ void getRecordPayload(string& records); // call __before commit__
+
+ void setCanonic(bool val)
+ {
+ d_canonic=val;
+ }
+
+ void setLowercase(bool val)
+ {
+ d_lowerCase=val;
+ }
+ Container& getContent()
+ {
+ return d_content;
+ }
+ bool eof() { return true; } // we don't know how long the record should be
+
+ const string getRemaining() const {
+ return "";
+ }
+
+ size_t getSizeWithOpts(const optvect_t& options) const;
+
+private:
+ uint16_t lookupName(const DNSName& name, uint16_t* matchlen);
+ vector<uint16_t> d_namepositions;
+ // We declare 1 uint_16 in the public section, these 3 align on a 8-byte boundary
+ uint16_t d_sor;
+ uint16_t d_rollbackmarker; // start of last complete packet, for rollback
+
+ Container& d_content;
+ DNSName d_qname;
+
+ uint16_t d_truncatemarker; // end of header, for truncate
+ DNSResourceRecord::Place d_recordplace;
+ bool d_canonic, d_lowerCase, d_compress{false};
+};
+
+using DNSPacketWriter = GenericDNSPacketWriter<std::vector<uint8_t>>;
+
+typedef vector<pair<string::size_type, string::size_type> > labelparts_t;
+// bool labeltokUnescape(labelparts_t& parts, const DNSName& label);
+std::vector<string> segmentDNSText(const string& text); // from dnslabeltext.rl
+std::deque<string> segmentDNSName(const string& input); // from dnslabeltext.rl
diff --git a/doh.cc b/doh.cc
new file mode 100644
index 0000000..ed29758
--- /dev/null
+++ b/doh.cc
@@ -0,0 +1,1707 @@
+#include "config.h"
+#include "doh.hh"
+
+#ifdef HAVE_DNS_OVER_HTTPS
+#define H2O_USE_EPOLL 1
+
+#include <errno.h>
+#include <iostream>
+#include <thread>
+
+#include <boost/algorithm/string.hpp>
+#include <h2o.h>
+//#include <h2o/http1.h>
+#include <h2o/http2.h>
+
+#include <openssl/err.h>
+#include <openssl/ssl.h>
+
+#include "base64.hh"
+#include "dnsname.hh"
+#undef CERT
+#include "dnsdist.hh"
+#include "dnsdist-tcp.hh"
+#include "misc.hh"
+#include "dns.hh"
+#include "dolog.hh"
+#include "dnsdist-ecs.hh"
+#include "dnsdist-proxy-protocol.hh"
+#include "dnsdist-rules.hh"
+#include "dnsdist-xpf.hh"
+#include "libssl.hh"
+#include "threadname.hh"
+
+/* So, how does this work. We use h2o for our http2 and TLS needs.
+ If the operator has configured multiple IP addresses to listen on,
+ we launch multiple h2o listener threads. We can hook in to multiple
+ URLs though on the same IP. There is no SNI yet (I think).
+
+ h2o is event driven, so we get callbacks if a new DNS query arrived.
+ When it does, we do some minimal parsing on it, and send it on to the
+ dnsdist worker thread which we also launched.
+
+ This dnsdist worker thread injects the query into the normal dnsdist flow
+ (over a pipe). The response also goes back over a (different) pipe,
+ where we pick it up and deliver it back to h2o.
+
+ For coordination, we use the h2o socket multiplexer, which is sensitive to our
+ pipe too.
+*/
+
+/* h2o notes.
+ Paths and parameters etc just *happen* to be null-terminated in HTTP2.
+ They are not in HTTP1. So you MUST use the length field!
+*/
+
+/* 'Intermediate' compatibility from https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29 */
+#define DOH_DEFAULT_CIPHERS "ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS"
+
+class DOHAcceptContext
+{
+public:
+ DOHAcceptContext()
+ {
+ memset(&d_h2o_accept_ctx, 0, sizeof(d_h2o_accept_ctx));
+ d_rotatingTicketsKey.clear();
+ }
+ DOHAcceptContext(const DOHAcceptContext&) = delete;
+ DOHAcceptContext& operator=(const DOHAcceptContext&) = delete;
+
+ h2o_accept_ctx_t* get()
+ {
+ return &d_h2o_accept_ctx;
+ }
+
+ ~DOHAcceptContext()
+ {
+ SSL_CTX_free(d_h2o_accept_ctx.ssl_ctx);
+ d_h2o_accept_ctx.ssl_ctx = nullptr;
+ }
+
+ void decrementConcurrentConnections()
+ {
+ if (d_cs != nullptr) {
+ --d_cs->tcpCurrentConnections;
+ }
+ }
+
+ time_t getNextTicketsKeyRotation() const
+ {
+ return d_ticketsKeyNextRotation;
+ }
+
+ size_t getTicketsKeysCount() const
+ {
+ size_t res = 0;
+ if (d_ticketKeys) {
+ res = d_ticketKeys->getKeysCount();
+ }
+ return res;
+ }
+
+ void rotateTicketsKey(time_t now)
+ {
+ if (!d_ticketKeys) {
+ return;
+ }
+
+ d_ticketKeys->rotateTicketsKey(now);
+
+ if (d_ticketsKeyRotationDelay > 0) {
+ d_ticketsKeyNextRotation = now + d_ticketsKeyRotationDelay;
+ }
+ }
+
+ void loadTicketsKeys(const std::string& keyFile)
+ {
+ if (!d_ticketKeys) {
+ return;
+ }
+ d_ticketKeys->loadTicketsKeys(keyFile);
+
+ if (d_ticketsKeyRotationDelay > 0) {
+ d_ticketsKeyNextRotation = time(nullptr) + d_ticketsKeyRotationDelay;
+ }
+ }
+
+ void handleTicketsKeyRotation()
+ {
+ if (d_ticketsKeyRotationDelay == 0) {
+ return;
+ }
+
+ time_t now = time(nullptr);
+ if (now > d_ticketsKeyNextRotation) {
+ if (d_rotatingTicketsKey.test_and_set()) {
+ /* someone is already rotating */
+ return;
+ }
+ try {
+ rotateTicketsKey(now);
+
+ d_rotatingTicketsKey.clear();
+ }
+ catch(const std::runtime_error& e) {
+ d_rotatingTicketsKey.clear();
+ throw std::runtime_error(std::string("Error generating a new tickets key for TLS context:") + e.what());
+ }
+ catch(...) {
+ d_rotatingTicketsKey.clear();
+ throw;
+ }
+ }
+ }
+
+ std::map<int, std::string> d_ocspResponses;
+ std::unique_ptr<OpenSSLTLSTicketKeysRing> d_ticketKeys{nullptr};
+ std::unique_ptr<FILE, int(*)(FILE*)> d_keyLogFile{nullptr, fclose};
+ ClientState* d_cs{nullptr};
+ time_t d_ticketsKeyRotationDelay{0};
+
+private:
+ h2o_accept_ctx_t d_h2o_accept_ctx;
+ std::atomic<uint64_t> d_refcnt{1};
+ time_t d_ticketsKeyNextRotation{0};
+ std::atomic_flag d_rotatingTicketsKey;
+};
+
+// we create one of these per thread, and pass around a pointer to it
+// through the bowels of h2o
+struct DOHServerConfig
+{
+ DOHServerConfig(uint32_t idleTimeout, uint32_t internalPipeBufferSize): accept_ctx(std::make_shared<DOHAcceptContext>())
+ {
+ int fd[2];
+ if (pipe(fd) < 0) {
+ unixDie("Creating a pipe for DNS over HTTPS");
+ }
+ dohquerypair[0] = fd[1];
+ dohquerypair[1] = fd[0];
+
+ setNonBlocking(dohquerypair[0]);
+ if (internalPipeBufferSize > 0) {
+ setPipeBufferSize(dohquerypair[0], internalPipeBufferSize);
+ }
+
+ if (pipe(fd) < 0) {
+ close(dohquerypair[0]);
+ close(dohquerypair[1]);
+ unixDie("Creating a pipe for DNS over HTTPS");
+ }
+
+ dohresponsepair[0] = fd[1];
+ dohresponsepair[1] = fd[0];
+
+ setNonBlocking(dohresponsepair[0]);
+ if (internalPipeBufferSize > 0) {
+ setPipeBufferSize(dohresponsepair[0], internalPipeBufferSize);
+ }
+
+ setNonBlocking(dohresponsepair[1]);
+
+ h2o_config_init(&h2o_config);
+ h2o_config.http2.idle_timeout = idleTimeout * 1000;
+ /* if you came here for a way to make the number of concurrent streams (concurrent requests per connection)
+ configurable, or even just bigger, I have bad news for you.
+ h2o_config.http2.max_concurrent_requests_per_connection (default of 100) is capped by
+ H2O_HTTP2_SETTINGS_HOST.max_concurrent_streams which is not configurable. Even if decided to change the
+ hard-coded value, libh2o's author warns that there might be parts of the code where the stream ID is stored
+ in 8 bits, making 256 a hard value: https://github.com/h2o/h2o/issues/805
+ */
+ }
+ DOHServerConfig(const DOHServerConfig&) = delete;
+ DOHServerConfig& operator=(const DOHServerConfig&) = delete;
+
+ LocalHolders holders;
+ std::set<std::string> paths;
+ h2o_globalconf_t h2o_config;
+ h2o_context_t h2o_ctx;
+ std::shared_ptr<DOHAcceptContext> accept_ctx{nullptr};
+ ClientState* cs{nullptr};
+ std::shared_ptr<DOHFrontend> df{nullptr};
+ int dohquerypair[2]{-1,-1};
+ int dohresponsepair[2]{-1,-1};
+};
+
+/* This internal function sends back the object to the main thread to send a reply.
+ The caller should NOT release or touch the unit after calling this function */
+static void sendDoHUnitToTheMainThread(DOHUnitUniquePtr&& du, const char* description)
+{
+ /* taking a naked pointer since we are about to send that pointer over a pipe */
+ auto ptr = du.release();
+ /* increasing the reference counter. This should not be strictly needed because
+ we already hold a reference and will only release it if we failed to send the
+ pointer over the pipe, but TSAN seems confused when the responder thread gets
+ a reply from a backend before the send() syscall sending the corresponding query
+ to that backend has returned in the initial thread.
+ The memory barrier needed to increase that counter seems to work around that.
+ */
+ ptr->get();
+ static_assert(sizeof(ptr) <= PIPE_BUF, "Writes up to PIPE_BUF are guaranteed not to be interleaved and to either fully succeed or fail");
+
+ ssize_t sent = write(ptr->rsock, &ptr, sizeof(ptr));
+ if (sent != sizeof(ptr)) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ ++g_stats.dohResponsePipeFull;
+ vinfolog("Unable to pass a %s to the DoH worker thread because the pipe is full", description);
+ }
+ else {
+ vinfolog("Unable to pass a %s to the DoH worker thread because we couldn't write to the pipe: %s", description, stringerror());
+ }
+
+ /* we fail to write over the pipe so we do not need to hold to that ref anymore */
+ ptr->release();
+ }
+ /* we decrement the counter incremented above at the beginning of that function */
+ ptr->release();
+}
+
+/* This function is called from other threads than the main DoH one,
+ instructing it to send a 502 error to the client.
+ It takes ownership of the unit. */
+void handleDOHTimeout(DOHUnitUniquePtr&& oldDU)
+{
+ if (oldDU == nullptr) {
+ return;
+ }
+
+/* we are about to erase an existing DU */
+ oldDU->status_code = 502;
+
+ sendDoHUnitToTheMainThread(std::move(oldDU), "DoH timeout");
+}
+
+struct DOHConnection
+{
+ std::shared_ptr<DOHAcceptContext> d_acceptCtx{nullptr};
+ struct timeval d_connectionStartTime{0, 0};
+ size_t d_nbQueries{0};
+ int d_desc{-1};
+};
+
+static thread_local std::unordered_map<int, DOHConnection> t_conns;
+
+static void on_socketclose(void *data)
+{
+ auto conn = reinterpret_cast<DOHConnection*>(data);
+ if (conn != nullptr) {
+ if (conn->d_acceptCtx) {
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto diff = now - conn->d_connectionStartTime;
+
+ conn->d_acceptCtx->decrementConcurrentConnections();
+ conn->d_acceptCtx->d_cs->updateTCPMetrics(conn->d_nbQueries, diff.tv_sec * 1000 + diff.tv_usec / 1000);
+ }
+
+ t_conns.erase(conn->d_desc);
+ }
+}
+
+static const std::string& getReasonFromStatusCode(uint16_t statusCode)
+{
+ /* no need to care too much about this, HTTP/2 has no 'reason' anyway */
+ static const std::unordered_map<uint16_t, std::string> reasons = {
+ { 200, "OK" },
+ { 301, "Moved Permanently" },
+ { 302, "Found" },
+ { 303, "See Other" },
+ { 304, "Not Modified" },
+ { 305, "Use Proxy" },
+ { 306, "Switch Proxy" },
+ { 307, "Temporary Redirect" },
+ { 308, "Permanent Redirect" },
+ { 400, "Bad Request" },
+ { 401, "Unauthorized" },
+ { 402, "Payment Required" },
+ { 403, "Forbidden" },
+ { 404, "Not Found" },
+ { 405, "Method Not Allowed" },
+ { 406, "Not Acceptable" },
+ { 407, "Proxy Authentication Required" },
+ { 408, "Request Timeout" },
+ { 409, "Conflict" },
+ { 410, "Gone" },
+ { 411, "Length Required" },
+ { 412, "Precondition Failed" },
+ { 413, "Payload Too Large" },
+ { 414, "URI Too Long" },
+ { 415, "Unsupported Media Type" },
+ { 416, "Range Not Satisfiable" },
+ { 417, "Expectation Failed" },
+ { 418, "I'm a teapot" },
+ { 451, "Unavailable For Legal Reasons" },
+ { 500, "Internal Server Error" },
+ { 501, "Not Implemented" },
+ { 502, "Bad Gateway" },
+ { 503, "Service Unavailable" },
+ { 504, "Gateway Timeout" },
+ { 505, "HTTP Version Not Supported" }
+ };
+ static const std::string unknown = "Unknown";
+
+ const auto it = reasons.find(statusCode);
+ if (it == reasons.end()) {
+ return unknown;
+ }
+ else {
+ return it->second;
+ }
+}
+
+/* Always called from the main DoH thread */
+static void handleResponse(DOHFrontend& df, st_h2o_req_t* req, uint16_t statusCode, const PacketBuffer& response, const std::vector<std::pair<std::string, std::string>>& customResponseHeaders, const std::string& contentType, bool addContentType)
+{
+ constexpr int overwrite_if_exists = 1;
+ constexpr int maybe_token = 1;
+ for (auto const& headerPair : customResponseHeaders) {
+ h2o_set_header_by_str(&req->pool, &req->res.headers, headerPair.first.c_str(), headerPair.first.size(), maybe_token, headerPair.second.c_str(), headerPair.second.size(), overwrite_if_exists);
+ }
+
+ if (statusCode == 200) {
+ ++df.d_validresponses;
+ req->res.status = 200;
+
+ if (addContentType) {
+ if (contentType.empty()) {
+ h2o_add_header(&req->pool, &req->res.headers, H2O_TOKEN_CONTENT_TYPE, nullptr, H2O_STRLIT("application/dns-message"));
+ }
+ else {
+ /* we need to duplicate the header content because h2o keeps a pointer and we will be deleted before the response has been sent */
+ h2o_iovec_t ct = h2o_strdup(&req->pool, contentType.c_str(), contentType.size());
+ h2o_add_header(&req->pool, &req->res.headers, H2O_TOKEN_CONTENT_TYPE, nullptr, ct.base, ct.len);
+ }
+ }
+
+ if (df.d_sendCacheControlHeaders && response.size() > sizeof(dnsheader)) {
+ uint32_t minTTL = getDNSPacketMinTTL(reinterpret_cast<const char*>(response.data()), response.size());
+ if (minTTL != std::numeric_limits<uint32_t>::max()) {
+ std::string cacheControlValue = "max-age=" + std::to_string(minTTL);
+ /* we need to duplicate the header content because h2o keeps a pointer and we will be deleted before the response has been sent */
+ h2o_iovec_t ccv = h2o_strdup(&req->pool, cacheControlValue.c_str(), cacheControlValue.size());
+ h2o_add_header(&req->pool, &req->res.headers, H2O_TOKEN_CACHE_CONTROL, nullptr, ccv.base, ccv.len);
+ }
+ }
+
+ req->res.content_length = response.size();
+ h2o_send_inline(req, reinterpret_cast<const char*>(response.data()), response.size());
+ }
+ else if (statusCode >= 300 && statusCode < 400) {
+ /* in that case the response is actually a URL */
+ /* we need to duplicate the URL because h2o uses it for the location header, keeping a pointer, and we will be deleted before the response has been sent */
+ h2o_iovec_t url = h2o_strdup(&req->pool, reinterpret_cast<const char*>(response.data()), response.size());
+ h2o_send_redirect(req, statusCode, getReasonFromStatusCode(statusCode).c_str(), url.base, url.len);
+ ++df.d_redirectresponses;
+ }
+ else {
+ // we need to make sure it's null-terminated */
+ if (!response.empty() && response.at(response.size() - 1) == 0) {
+ h2o_send_error_generic(req, statusCode, getReasonFromStatusCode(statusCode).c_str(), reinterpret_cast<const char*>(response.data()), H2O_SEND_ERROR_KEEP_HEADERS);
+ }
+ else {
+ switch(statusCode) {
+ case 400:
+ h2o_send_error_400(req, getReasonFromStatusCode(statusCode).c_str(), "invalid DNS query" , 0);
+ break;
+ case 403:
+ h2o_send_error_403(req, getReasonFromStatusCode(statusCode).c_str(), "dns query not allowed", 0);
+ break;
+ case 502:
+ h2o_send_error_502(req, getReasonFromStatusCode(statusCode).c_str(), "no downstream server available", 0);
+ break;
+ case 500:
+ /* fall-through */
+ default:
+ h2o_send_error_500(req, getReasonFromStatusCode(statusCode).c_str(), "Internal Server Error", 0);
+ break;
+ }
+ }
+
+ ++df.d_errorresponses;
+ }
+}
+
+class DoHTCPCrossQuerySender : public TCPQuerySender
+{
+public:
+ DoHTCPCrossQuerySender(DOHUnitUniquePtr&& du_): du(std::move(du_))
+ {
+ }
+
+ bool active() const override
+ {
+ return true;
+ }
+
+ const ClientState* getClientState() const override
+ {
+ if (!du || !du->dsc || !du->dsc->cs) {
+ throw std::runtime_error("No query associated to this DoHTCPCrossQuerySender");
+ }
+
+ return du->dsc->cs;
+ }
+
+ void handleResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ if (!du) {
+ return;
+ }
+
+ if (du->rsock == -1) {
+ return;
+ }
+
+ du->response = std::move(response.d_buffer);
+ du->ids = std::move(response.d_idstate);
+
+ thread_local LocalStateHolder<vector<DNSDistResponseRuleAction>> localRespRuleActions = g_respruleactions.getLocal();
+ DNSResponse dr = makeDNSResponseFromIDState(du->ids, du->response);
+ dnsheader cleartextDH;
+ memcpy(&cleartextDH, dr.getHeader(), sizeof(cleartextDH));
+
+ if (!processResponse(du->response, localRespRuleActions, dr, false, false)) {
+ du.reset();
+ return;
+ }
+
+ double udiff = du->ids.sentTime.udiff();
+ vinfolog("Got answer from %s, relayed to %s (https), took %f usec", du->downstream->remote.toStringWithPort(), du->ids.origRemote.toStringWithPort(), udiff);
+
+ auto backendProtocol = du->downstream->getProtocol();
+ if (backendProtocol == dnsdist::Protocol::DoUDP && du->tcp) {
+ backendProtocol = dnsdist::Protocol::DoTCP;
+ }
+ handleResponseSent(du->ids, udiff, *dr.remote, du->downstream->remote, du->response.size(), cleartextDH, backendProtocol);
+
+ ++g_stats.responses;
+ if (du->ids.cs) {
+ ++du->ids.cs->responses;
+ }
+
+ sendDoHUnitToTheMainThread(std::move(du), "cross-protocol response");
+ }
+
+ void handleXFRResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ return handleResponse(now, std::move(response));
+ }
+
+ void notifyIOError(IDState&& query, const struct timeval& now) override
+ {
+ if (!du) {
+ return;
+ }
+
+ if (du->rsock == -1) {
+ return;
+ }
+
+ du->ids = std::move(query);
+ du->status_code = 502;
+ sendDoHUnitToTheMainThread(std::move(du), "cross-protocol error response");
+ }
+
+private:
+ DOHUnitUniquePtr du;
+};
+
+class DoHCrossProtocolQuery : public CrossProtocolQuery
+{
+public:
+ DoHCrossProtocolQuery(DOHUnitUniquePtr&& du_): du(std::move(du_))
+ {
+ query = InternalQuery(std::move(du->query), std::move(du->ids));
+ /* we _could_ remove it from the query buffer and put in query's d_proxyProtocolPayload,
+ clearing query.d_proxyProtocolPayloadAdded and du->proxyProtocolPayloadSize.
+ Leave it for now because we know that the onky case where the payload has been
+ added is when we tried over UDP, got a TC=1 answer and retried over TCP/DoT,
+ and we know the TCP/DoT code can handle it. */
+ query.d_proxyProtocolPayloadAdded = du->proxyProtocolPayloadSize > 0;
+ downstream = du->downstream;
+ proxyProtocolPayloadSize = du->proxyProtocolPayloadSize;
+ }
+
+ void handleInternalError()
+ {
+ du->status_code = 502;
+ sendDoHUnitToTheMainThread(std::move(du), "DoH internal error");
+ }
+
+ std::shared_ptr<TCPQuerySender> getTCPQuerySender() override
+ {
+ auto sender = std::make_shared<DoHTCPCrossQuerySender>(std::move(du));
+ return sender;
+ }
+
+private:
+ DOHUnitUniquePtr du;
+};
+
+/*
+ We are not in the main DoH thread but in the DoH 'client' thread.
+*/
+static void processDOHQuery(DOHUnitUniquePtr&& du)
+{
+ uint16_t queryId = 0;
+ ComboAddress remote;
+ bool duRefCountIncremented = false;
+ try {
+ if (!du->req) {
+ // we got closed meanwhile. XXX small race condition here
+ // but we should be fine as long as we don't touch du->req
+ // outside of the main DoH thread
+ du->status_code = 500;
+ sendDoHUnitToTheMainThread(std::move(du), "DoH killed in flight");
+ return;
+ }
+ remote = du->ids.origRemote;
+ DOHServerConfig* dsc = du->dsc;
+ auto& holders = dsc->holders;
+ ClientState& cs = *dsc->cs;
+
+ if (du->query.size() < sizeof(dnsheader)) {
+ ++g_stats.nonCompliantQueries;
+ du->status_code = 400;
+ sendDoHUnitToTheMainThread(std::move(du), "DoH non-compliant query");
+ return;
+ }
+
+ ++cs.queries;
+ ++g_stats.queries;
+
+ /* we need an accurate ("real") value for the response and
+ to store into the IDS, but not for insertion into the
+ rings for example */
+ struct timespec queryRealTime;
+ gettime(&queryRealTime, true);
+
+ {
+ /* don't keep that pointer around, it will be invalidated if the buffer is ever resized */
+ struct dnsheader* dh = reinterpret_cast<struct dnsheader*>(du->query.data());
+
+ if (!checkQueryHeaders(dh)) {
+ du->status_code = 400;
+ sendDoHUnitToTheMainThread(std::move(du), "DoH invalid headers");
+ return;
+ }
+
+ if (dh->qdcount == 0) {
+ dh->rcode = RCode::NotImp;
+ dh->qr = true;
+ du->response = std::move(du->query);
+
+ sendDoHUnitToTheMainThread(std::move(du), "DoH empty query");
+ return;
+ }
+
+ queryId = ntohs(dh->id);
+ }
+
+ uint16_t qtype, qclass;
+ unsigned int qnameWireLength = 0;
+ DNSName qname(reinterpret_cast<const char*>(du->query.data()), du->query.size(), sizeof(dnsheader), false, &qtype, &qclass, &qnameWireLength);
+ DNSQuestion dq(&qname, qtype, qclass, &du->ids.origDest, &du->ids.origRemote, du->query, dnsdist::Protocol::DoH, &queryRealTime);
+ dq.ednsAdded = du->ids.ednsAdded;
+ /* store the raw pointer */
+ dq.du = du.get();
+ dq.sni = std::move(du->sni);
+
+ auto result = processQuery(dq, cs, holders, du->downstream);
+
+ if (result == ProcessQueryResult::Drop) {
+ du->status_code = 403;
+ sendDoHUnitToTheMainThread(std::move(du), "DoH dropped query");
+ return;
+ }
+
+ if (result == ProcessQueryResult::SendAnswer) {
+ if (du->response.empty()) {
+ du->response = std::move(du->query);
+ }
+ sendDoHUnitToTheMainThread(std::move(du), "DoH self-answered response");
+ return;
+ }
+
+ if (result != ProcessQueryResult::PassToBackend) {
+ du->status_code = 500;
+ sendDoHUnitToTheMainThread(std::move(du), "DoH no backend available");
+ return;
+ }
+
+ if (du->downstream == nullptr) {
+ du->status_code = 502;
+ sendDoHUnitToTheMainThread(std::move(du), "DoH no backend available");
+ return;
+ }
+
+ if (du->downstream->isTCPOnly()) {
+ std::string proxyProtocolPayload;
+ /* we need to do this _before_ creating the cross protocol query because
+ after that the buffer will have been moved */
+ if (du->downstream->useProxyProtocol) {
+ proxyProtocolPayload = getProxyProtocolPayload(dq);
+ }
+
+ du->ids.origID = htons(queryId);
+ du->ids.cs = &cs;
+ setIDStateFromDNSQuestion(du->ids, dq, std::move(qname));
+
+ du->tcp = true;
+ std::shared_ptr<DownstreamState>& downstream = du->downstream;
+
+ /* this moves du->ids, careful! */
+ auto cpq = std::make_unique<DoHCrossProtocolQuery>(std::move(du));
+ cpq->query.d_proxyProtocolPayload = std::move(proxyProtocolPayload);
+
+ if (downstream->passCrossProtocolQuery(std::move(cpq))) {
+ return;
+ }
+ else {
+ cpq->handleInternalError();
+ return;
+ }
+ }
+
+ ComboAddress dest = du->ids.origDest;
+ unsigned int idOffset = (du->downstream->idOffset++) % du->downstream->idStates.size();
+ IDState* ids = &du->downstream->idStates[idOffset];
+ ids->age = 0;
+ DOHUnit* oldDU = nullptr;
+ if (ids->isInUse()) {
+ /* that means that the state was in use, possibly with an allocated
+ DOHUnit that we will need to handle, but we can't touch it before
+ confirming that we now own this state */
+ oldDU = ids->du;
+ }
+
+ /* we atomically replace the value, we now own this state */
+ int64_t generation = ids->generation++;
+ if (!ids->markAsUsed(generation)) {
+ /* the state was not in use.
+ we reset 'oldDU' because it might have still been in use when we read it. */
+ oldDU = nullptr;
+ ++du->downstream->outstanding;
+ }
+ else {
+ ids->du = nullptr;
+ /* we are reusing a state, no change in outstanding but if there was an existing DOHUnit we need
+ to handle it because it's about to be overwritten. */
+ ++du->downstream->reuseds;
+ ++g_stats.downstreamTimeouts;
+ handleDOHTimeout(DOHUnitUniquePtr(oldDU, DOHUnit::release));
+ }
+
+ ids->origFD = 0;
+ /* increase the ref count since we are about to store the pointer */
+ du->get();
+ duRefCountIncremented = true;
+ /* store the raw pointer */
+ ids->du = du.get();
+
+ ids->cs = &cs;
+ ids->origID = htons(queryId);
+ setIDStateFromDNSQuestion(*ids, dq, std::move(qname));
+
+ dq.getHeader()->id = idOffset;
+
+ /* If we couldn't harvest the real dest addr, still
+ write down the listening addr since it will be useful
+ (especially if it's not an 'any' one).
+ We need to keep track of which one it is since we may
+ want to use the real but not the listening addr to reply.
+ */
+ if (dest.sin4.sin_family != 0) {
+ ids->origDest = dest;
+ ids->destHarvested = true;
+ }
+ else {
+ ids->origDest = cs.local;
+ ids->destHarvested = false;
+ }
+
+ bool failed = false;
+ if (du->downstream->useProxyProtocol) {
+ try {
+ size_t payloadSize = 0;
+ if (addProxyProtocol(dq, &payloadSize)) {
+ du->proxyProtocolPayloadSize = payloadSize;
+ }
+ }
+ catch (const std::exception& e) {
+ vinfolog("Adding proxy protocol payload to DoH query from %s failed: %s", ids->origDest.toStringWithPort(), e.what());
+ failed = true;
+ }
+ }
+
+ try {
+ if (!failed) {
+ int fd = pickBackendSocketForSending(du->downstream);
+ /* you can't touch du after this line, unless the call returned a non-negative value,
+ because it might already have been freed */
+ ssize_t ret = udpClientSendRequestToBackend(du->downstream, fd, du->query);
+
+ if (ret < 0) {
+ failed = true;
+ }
+ }
+
+ if (failed) {
+ /* we are about to handle the error, make sure that
+ this pointer is not accessed when the state is cleaned,
+ but first check that it still belongs to us */
+ if (ids->tryMarkUnused(generation)) {
+ ids->du = nullptr;
+ du->release();
+ duRefCountIncremented = false;
+ --du->downstream->outstanding;
+ }
+ ++du->downstream->sendErrors;
+ ++g_stats.downstreamSendErrors;
+ du->status_code = 502;
+ sendDoHUnitToTheMainThread(std::move(du), "DoH internal error");
+ return;
+ }
+ }
+ catch (const std::exception& e) {
+ if (duRefCountIncremented) {
+ du->release();
+ }
+ throw;
+ }
+
+ vinfolog("Got query for %s|%s from %s (https), relayed to %s", ids->qname.toString(), QType(ids->qtype).toString(), remote.toStringWithPort(), du->downstream->getName());
+ }
+ catch (const std::exception& e) {
+ vinfolog("Got an error in DOH question thread while parsing a query from %s, id %d: %s", remote.toStringWithPort(), queryId, e.what());
+ du->status_code = 500;
+ sendDoHUnitToTheMainThread(std::move(du), "DoH internal error");
+ return;
+ }
+
+ return;
+}
+
+/* called when a HTTP response is about to be sent, from the main DoH thread */
+static void on_response_ready_cb(struct st_h2o_filter_t *self, h2o_req_t *req, h2o_ostream_t **slot)
+{
+ if (req == nullptr) {
+ return;
+ }
+
+ DOHServerConfig* dsc = reinterpret_cast<DOHServerConfig*>(req->conn->ctx->storage.entries[0].data);
+
+ DOHFrontend::HTTPVersionStats* stats = nullptr;
+ if (req->version < 0x200) {
+ /* HTTP 1.x */
+ stats = &dsc->df->d_http1Stats;
+ }
+ else {
+ /* HTTP 2.0 */
+ stats = &dsc->df->d_http2Stats;
+ }
+
+ switch (req->res.status) {
+ case 200:
+ ++stats->d_nb200Responses;
+ break;
+ case 400:
+ ++stats->d_nb400Responses;
+ break;
+ case 403:
+ ++stats->d_nb403Responses;
+ break;
+ case 500:
+ ++stats->d_nb500Responses;
+ break;
+ case 502:
+ ++stats->d_nb502Responses;
+ break;
+ default:
+ ++stats->d_nbOtherResponses;
+ break;
+ }
+
+ h2o_setup_next_ostream(req, slot);
+}
+
+/* this is called by h2o when our request dies.
+ We use this to signal to the 'du' that this req is no longer alive */
+static void on_generator_dispose(void *_self)
+{
+ DOHUnit** du = reinterpret_cast<DOHUnit**>(_self);
+ if (*du) { // if 0, on_dnsdist cleaned up du already
+ (*du)->self = nullptr;
+ (*du)->req = nullptr;
+ }
+}
+
+/* This executes in the main DoH thread.
+ We allocate a DOHUnit and send it to dnsdistclient() function in the doh client thread
+ via a pipe */
+static void doh_dispatch_query(DOHServerConfig* dsc, h2o_handler_t* self, h2o_req_t* req, PacketBuffer&& query, const ComboAddress& local, const ComboAddress& remote, std::string&& path)
+{
+ try {
+ /* we only parse it there as a sanity check, we will parse it again later */
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(query.data()), query.size(), sizeof(dnsheader), false, &qtype);
+
+ auto du = std::make_unique<DOHUnit>();
+ du->dsc = dsc;
+ du->req = req;
+ du->ids.origDest = local;
+ du->ids.origRemote = remote;
+ du->rsock = dsc->dohresponsepair[0];
+ du->query = std::move(query);
+ du->path = std::move(path);
+ /* we are doing quite some copies here, sorry about that,
+ but we can't keep accessing the req object once we are in a different thread
+ because the request might get killed by h2o at pretty much any time */
+ if (req->scheme != nullptr) {
+ du->scheme = std::string(req->scheme->name.base, req->scheme->name.len);
+ }
+ du->host = std::string(req->authority.base, req->authority.len);
+ du->query_at = req->query_at;
+ du->headers.reserve(req->headers.size);
+ for (size_t i = 0; i < req->headers.size; ++i) {
+ du->headers.emplace_back(std::string(req->headers.entries[i].name->base, req->headers.entries[i].name->len),
+ std::string(req->headers.entries[i].value.base, req->headers.entries[i].value.len));
+ }
+
+#ifdef HAVE_H2O_SOCKET_GET_SSL_SERVER_NAME
+ h2o_socket_t* sock = req->conn->callbacks->get_socket(req->conn);
+ const char * sni = h2o_socket_get_ssl_server_name(sock);
+ if (sni != nullptr) {
+ du->sni = sni;
+ }
+#endif /* HAVE_H2O_SOCKET_GET_SSL_SERVER_NAME */
+
+ du->self = reinterpret_cast<DOHUnit**>(h2o_mem_alloc_shared(&req->pool, sizeof(*self), on_generator_dispose));
+ auto ptr = du.release();
+ *(ptr->self) = ptr;
+ try {
+ static_assert(sizeof(ptr) <= PIPE_BUF, "Writes up to PIPE_BUF are guaranteed not to be interleaved and to either fully succeed or fail");
+ ssize_t sent = write(dsc->dohquerypair[0], &ptr, sizeof(ptr));
+ if (sent != sizeof(ptr)) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ ++g_stats.dohQueryPipeFull;
+ vinfolog("Unable to pass a DoH query to the DoH worker thread because the pipe is full");
+ }
+ else {
+ vinfolog("Unable to pass a DoH query to the DoH worker thread because we couldn't write to the pipe: %s", stringerror());
+ }
+ ptr->release();
+ ptr = nullptr;
+ h2o_send_error_500(req, "Internal Server Error", "Internal Server Error", 0);
+ }
+ }
+ catch (...) {
+ if (ptr != nullptr) {
+ ptr->release();
+ }
+ }
+ }
+ catch(const std::exception& e) {
+ vinfolog("Had error parsing DoH DNS packet from %s: %s", remote.toStringWithPort(), e.what());
+ h2o_send_error_400(req, "Bad Request", "The DNS query could not be parsed", 0);
+ }
+}
+
+/* can only be called from the main DoH thread */
+static bool getHTTPHeaderValue(const h2o_req_t* req, const std::string& headerName, pdns_string_view& value)
+{
+ bool found = false;
+ /* early versions of boost::string_ref didn't have the ability to compare to string */
+ pdns_string_view headerNameView(headerName);
+
+ for (size_t i = 0; i < req->headers.size; ++i) {
+ if (pdns_string_view(req->headers.entries[i].name->base, req->headers.entries[i].name->len) == headerNameView) {
+ value = pdns_string_view(req->headers.entries[i].value.base, req->headers.entries[i].value.len);
+ /* don't stop there, we might have more than one header with the same name, and we want the last one */
+ found = true;
+ }
+ }
+
+ return found;
+}
+
+/* can only be called from the main DoH thread */
+static void processForwardedForHeader(const h2o_req_t* req, ComboAddress& remote)
+{
+ static const std::string headerName = "x-forwarded-for";
+ pdns_string_view value;
+
+ if (getHTTPHeaderValue(req, headerName, value)) {
+ try {
+ auto pos = value.rfind(',');
+ if (pos != pdns_string_view::npos) {
+ ++pos;
+ for (; pos < value.size() && value[pos] == ' '; ++pos)
+ {
+ }
+
+ if (pos < value.size()) {
+ value = value.substr(pos);
+ }
+ }
+ auto newRemote = ComboAddress(std::string(value));
+ remote = newRemote;
+ }
+ catch (const std::exception& e) {
+ vinfolog("Invalid X-Forwarded-For header ('%s') received from %s : %s", std::string(value), remote.toStringWithPort(), e.what());
+ }
+ catch (const PDNSException& e) {
+ vinfolog("Invalid X-Forwarded-For header ('%s') received from %s : %s", std::string(value), remote.toStringWithPort(), e.reason);
+ }
+ }
+}
+
+/*
+ A query has been parsed by h2o, this executes in the main DoH thread.
+ For GET, the base64url-encoded payload is in the 'dns' parameter, which might be the first parameter, or not.
+ For POST, the payload is the payload.
+ */
+static int doh_handler(h2o_handler_t *self, h2o_req_t *req)
+{
+ try {
+ if (!req->conn->ctx->storage.size) {
+ return 0; // although we might was well crash on this
+ }
+ h2o_socket_t* sock = req->conn->callbacks->get_socket(req->conn);
+ ComboAddress remote;
+ ComboAddress local;
+
+ if (h2o_socket_getpeername(sock, reinterpret_cast<struct sockaddr*>(&remote)) == 0) {
+ /* getpeername failed, likely because the connection has already been closed,
+ but anyway that means we can't get the remote address, which could allow an ACL bypass */
+ h2o_send_error_500(req, getReasonFromStatusCode(500).c_str(), "Internal Server Error - Unable to get remote address", 0);
+ return 0;
+ }
+
+ h2o_socket_getsockname(sock, reinterpret_cast<struct sockaddr*>(&local));
+ DOHServerConfig* dsc = reinterpret_cast<DOHServerConfig*>(req->conn->ctx->storage.entries[0].data);
+
+ if (dsc->df->d_trustForwardedForHeader) {
+ processForwardedForHeader(req, remote);
+ }
+
+ auto& holders = dsc->holders;
+ if (!holders.acl->match(remote)) {
+ ++g_stats.aclDrops;
+ vinfolog("Query from %s (DoH) dropped because of ACL", remote.toStringWithPort());
+ h2o_send_error_403(req, "Forbidden", "dns query not allowed because of ACL", 0);
+ return 0;
+ }
+
+ const int descriptor = h2o_socket_get_fd(sock);
+ if (descriptor != -1) {
+ auto& conn = t_conns.at(descriptor);
+ ++conn.d_nbQueries;
+ if (conn.d_nbQueries == 1) {
+ if (h2o_socket_get_ssl_session_reused(sock) == 0) {
+ ++dsc->cs->tlsNewSessions;
+ }
+ else {
+ ++dsc->cs->tlsResumptions;
+ }
+ }
+ }
+
+ if (auto tlsversion = h2o_socket_get_ssl_protocol_version(sock)) {
+ if(!strcmp(tlsversion, "TLSv1.0"))
+ ++dsc->cs->tls10queries;
+ else if(!strcmp(tlsversion, "TLSv1.1"))
+ ++dsc->cs->tls11queries;
+ else if(!strcmp(tlsversion, "TLSv1.2"))
+ ++dsc->cs->tls12queries;
+ else if(!strcmp(tlsversion, "TLSv1.3"))
+ ++dsc->cs->tls13queries;
+ else
+ ++dsc->cs->tlsUnknownqueries;
+ }
+
+ if (dsc->df->d_exactPathMatching) {
+ // would be nice to be able to use a pdns_string_view there, but we would need heterogeneous lookups
+ // (having string in the set and compare them to string_view, for example. Note that comparing
+ // two boost::string_view uses the pointer, not the content).
+ const std::string pathOnly(req->path_normalized.base, req->path_normalized.len);
+ if (dsc->paths.count(pathOnly) == 0) {
+ h2o_send_error_404(req, "Not Found", "there is no endpoint configured for this path", 0);
+ return 0;
+ }
+ }
+
+ // would be nice to be able to use a pdns_string_view there,
+ // but regex (called by matches() internally) requires a null-terminated string
+ string path(req->path.base, req->path.len);
+ /* the responses map can be updated at runtime, so we need to take a copy of
+ the shared pointer, increasing the reference counter */
+ auto responsesMap = dsc->df->d_responsesMap;
+ /* 1 byte for the root label, 2 type, 2 class, 4 TTL (fake), 2 record length, 2 option length, 2 option code, 2 family, 1 source, 1 scope, 16 max for a full v6 */
+ const size_t maxAdditionalSizeForEDNS = 35U;
+ if (responsesMap) {
+ for (const auto& entry : *responsesMap) {
+ if (entry->matches(path)) {
+ const auto& customHeaders = entry->getHeaders();
+ handleResponse(*dsc->df, req, entry->getStatusCode(), entry->getContent(), customHeaders ? *customHeaders : dsc->df->d_customResponseHeaders, std::string(), false);
+ return 0;
+ }
+ }
+ }
+
+ if (h2o_memis(req->method.base, req->method.len, H2O_STRLIT("POST"))) {
+ ++dsc->df->d_postqueries;
+ if(req->version >= 0x0200)
+ ++dsc->df->d_http2Stats.d_nbQueries;
+ else
+ ++dsc->df->d_http1Stats.d_nbQueries;
+
+ PacketBuffer query;
+ /* We reserve a few additional bytes to be able to add EDNS later */
+ query.reserve(req->entity.len + maxAdditionalSizeForEDNS);
+ query.resize(req->entity.len);
+ memcpy(query.data(), req->entity.base, req->entity.len);
+ doh_dispatch_query(dsc, self, req, std::move(query), local, remote, std::move(path));
+ }
+ else if(req->query_at != SIZE_MAX && (req->path.len - req->query_at > 5)) {
+ auto pos = path.find("?dns=");
+ if(pos == string::npos)
+ pos = path.find("&dns=");
+ if(pos != string::npos) {
+ // need to base64url decode this
+ string sdns(path.substr(pos+5));
+ boost::replace_all(sdns,"-", "+");
+ boost::replace_all(sdns,"_", "/");
+ // re-add padding that may have been missing
+ switch (sdns.size() % 4) {
+ case 2:
+ sdns.append(2, '=');
+ break;
+ case 3:
+ sdns.append(1, '=');
+ break;
+ }
+
+ PacketBuffer decoded;
+
+ /* rough estimate so we hopefully don't need a new allocation later */
+ /* We reserve at few additional bytes to be able to add EDNS later */
+ const size_t estimate = ((sdns.size() * 3) / 4);
+ decoded.reserve(estimate + maxAdditionalSizeForEDNS);
+ if(B64Decode(sdns, decoded) < 0) {
+ h2o_send_error_400(req, "Bad Request", "Unable to decode BASE64-URL", 0);
+ ++dsc->df->d_badrequests;
+ return 0;
+ }
+ else {
+ ++dsc->df->d_getqueries;
+ if(req->version >= 0x0200)
+ ++dsc->df->d_http2Stats.d_nbQueries;
+ else
+ ++dsc->df->d_http1Stats.d_nbQueries;
+
+ doh_dispatch_query(dsc, self, req, std::move(decoded), local, remote, std::move(path));
+ }
+ }
+ else
+ {
+ vinfolog("HTTP request without DNS parameter: %s", req->path.base);
+ h2o_send_error_400(req, "Bad Request", "Unable to find the DNS parameter", 0);
+ ++dsc->df->d_badrequests;
+ return 0;
+ }
+ }
+ else {
+ h2o_send_error_400(req, "Bad Request", "Unable to parse the request", 0);
+ ++dsc->df->d_badrequests;
+ }
+ return 0;
+ }
+ catch(const std::exception& e)
+ {
+ errlog("DOH Handler function failed with error %s", e.what());
+ return 0;
+ }
+}
+
+HTTPHeaderRule::HTTPHeaderRule(const std::string& header, const std::string& regex)
+ : d_header(toLower(header)), d_regex(regex), d_visual("http[" + header+ "] ~ " + regex)
+{
+}
+
+bool HTTPHeaderRule::matches(const DNSQuestion* dq) const
+{
+ if (!dq->du) {
+ return false;
+ }
+
+ for (const auto& header : dq->du->headers) {
+ if (header.first == d_header) {
+ return d_regex.match(header.second);
+ }
+ }
+ return false;
+}
+
+string HTTPHeaderRule::toString() const
+{
+ return d_visual;
+}
+
+HTTPPathRule::HTTPPathRule(const std::string& path)
+ : d_path(path)
+{
+
+}
+
+bool HTTPPathRule::matches(const DNSQuestion* dq) const
+{
+ if (!dq->du) {
+ return false;
+ }
+
+ if (dq->du->query_at == SIZE_MAX) {
+ return dq->du->path == d_path;
+ }
+ else {
+ return d_path.compare(0, d_path.size(), dq->du->path, 0, dq->du->query_at) == 0;
+ }
+}
+
+string HTTPPathRule::toString() const
+{
+ return "url path == " + d_path;
+}
+
+HTTPPathRegexRule::HTTPPathRegexRule(const std::string& regex): d_regex(regex), d_visual("http path ~ " + regex)
+{
+}
+
+bool HTTPPathRegexRule::matches(const DNSQuestion* dq) const
+{
+ if (!dq->du) {
+ return false;
+ }
+
+ return d_regex.match(dq->du->getHTTPPath());
+}
+
+string HTTPPathRegexRule::toString() const
+{
+ return d_visual;
+}
+
+std::unordered_map<std::string, std::string> DOHUnit::getHTTPHeaders() const
+{
+ std::unordered_map<std::string, std::string> results;
+ results.reserve(headers.size());
+
+ for (const auto& header : headers) {
+ results.insert(header);
+ }
+
+ return results;
+}
+
+std::string DOHUnit::getHTTPPath() const
+{
+ if (query_at == SIZE_MAX) {
+ return path;
+ }
+ else {
+ return std::string(path, 0, query_at);
+ }
+}
+
+std::string DOHUnit::getHTTPHost() const
+{
+ return host;
+}
+
+std::string DOHUnit::getHTTPScheme() const
+{
+ return scheme;
+}
+
+std::string DOHUnit::getHTTPQueryString() const
+{
+ if (query_at == SIZE_MAX) {
+ return std::string();
+ }
+ else {
+ return path.substr(query_at);
+ }
+}
+
+void DOHUnit::setHTTPResponse(uint16_t statusCode, PacketBuffer&& body_, const std::string& contentType_)
+{
+ status_code = statusCode;
+ response = std::move(body_);
+ if (!response.empty() && statusCode >= 400) {
+ // we need to make sure it's null-terminated */
+ if (response.at(response.size() - 1) != 0) {
+ response.push_back(0);
+ }
+ }
+
+ contentType = contentType_;
+}
+
+/* query has been parsed by h2o, which called doh_handler() in the main DoH thread.
+ In order not to blockfor long, doh_handler() called doh_dispatch_query() which allocated
+ a DOHUnit object and passed it to us */
+static void dnsdistclient(int qsock)
+{
+ setThreadName("dnsdist/doh-cli");
+
+ for(;;) {
+ try {
+ DOHUnit* ptr = nullptr;
+ ssize_t got = read(qsock, &ptr, sizeof(ptr));
+ if (got < 0) {
+ warnlog("Error receiving internal DoH query: %s", strerror(errno));
+ continue;
+ }
+ else if (static_cast<size_t>(got) < sizeof(ptr)) {
+ continue;
+ }
+
+ DOHUnitUniquePtr du(ptr, DOHUnit::release);
+ /* we are not in the main DoH thread anymore, so there is a real risk of
+ a race condition where h2o kills the query while we are processing it,
+ so we can't touch the content of du->req until we are back into the
+ main DoH thread */
+ if (!du->req) {
+ // it got killed in flight already
+ du->self = nullptr;
+ continue;
+ }
+
+ // if there was no EDNS, we add it with a large buffer size
+ // so we can use UDP to talk to the backend.
+ auto dh = const_cast<struct dnsheader*>(reinterpret_cast<const struct dnsheader*>(du->query.data()));
+
+ if (!dh->arcount) {
+ if (generateOptRR(std::string(), du->query, 4096, 4096, 0, false)) {
+ dh = const_cast<struct dnsheader*>(reinterpret_cast<const struct dnsheader*>(du->query.data())); // may have reallocated
+ dh->arcount = htons(1);
+ du->ids.ednsAdded = true;
+ }
+ }
+ else {
+ // we leave existing EDNS in place
+ }
+
+ processDOHQuery(std::move(du));
+ }
+ catch (const std::exception& e) {
+ errlog("Error while processing query received over DoH: %s", e.what());
+ }
+ catch (...) {
+ errlog("Unspecified error while processing query received over DoH");
+ }
+ }
+}
+
+/* Called in the main DoH thread if h2o finds that dnsdist gave us an answer by writing into
+ the dohresponsepair[0] side of the pipe so from:
+ - handleDOHTimeout() when we did not get a response fast enough (called
+ either from the health check thread (active) or from the frontend ones (reused))
+ - dnsdistclient (error 500 because processDOHQuery() returned a negative value)
+ - processDOHQuery (self-answered queries)
+ */
+static void on_dnsdist(h2o_socket_t *listener, const char *err)
+{
+ /* we want to read as many responses from the pipe as possible before
+ giving up. Even if we are overloaded and fighting with the DoH connections
+ for the CPU, the first thing we need to do is to send responses to free slots
+ anyway, otherwise queries and responses are piling up in our pipes, consuming
+ memory and likely coming up too late after the client has gone away */
+ while (true) {
+ DOHUnit *ptr = nullptr;
+ DOHServerConfig* dsc = reinterpret_cast<DOHServerConfig*>(listener->data);
+ ssize_t got = read(dsc->dohresponsepair[1], &ptr, sizeof(ptr));
+
+ if (got < 0) {
+ if (errno != EWOULDBLOCK && errno != EAGAIN) {
+ errlog("Error reading a DOH internal response: %s", strerror(errno));
+ }
+ return;
+ }
+ else if (static_cast<size_t>(got) != sizeof(ptr)) {
+ errlog("Error reading a DoH internal response, got %d bytes instead of the expected %d", got, sizeof(ptr));
+ return;
+ }
+
+ DOHUnitUniquePtr du(ptr, DOHUnit::release);
+ if (!du->req) { // it got killed in flight
+ du->self = nullptr;
+ continue;
+ }
+
+ if (!du->tcp &&
+ du->truncated &&
+ du->query.size() > du->proxyProtocolPayloadSize &&
+ (du->query.size() - du->proxyProtocolPayloadSize) > sizeof(dnsheader)) {
+ /* restoring the original ID */
+ dnsheader* queryDH = reinterpret_cast<struct dnsheader*>(du->query.data() + du->proxyProtocolPayloadSize);
+ queryDH->id = du->ids.origID;
+
+ du->tcp = true;
+ du->truncated = false;
+ auto cpq = std::make_unique<DoHCrossProtocolQuery>(std::move(du));
+
+ if (g_tcpclientthreads && g_tcpclientthreads->passCrossProtocolQueryToThread(std::move(cpq))) {
+ continue;
+ }
+ else {
+ vinfolog("Unable to pass DoH query to a TCP worker thread after getting a TC response over UDP");
+ continue;
+ }
+ }
+
+ if (du->self) {
+ // we are back in the h2o main thread now, so we don't risk
+ // a race (h2o killing the query) when accessing du->req anymore
+ *du->self = nullptr; // so we don't clean up again in on_generator_dispose
+ du->self = nullptr;
+ }
+
+ handleResponse(*dsc->df, du->req, du->status_code, du->response, dsc->df->d_customResponseHeaders, du->contentType, true);
+ }
+}
+
+/* called when a TCP connection has been accepted, the TLS session has not been established */
+static void on_accept(h2o_socket_t *listener, const char *err)
+{
+ DOHServerConfig* dsc = reinterpret_cast<DOHServerConfig*>(listener->data);
+ h2o_socket_t *sock = nullptr;
+
+ if (err != nullptr) {
+ return;
+ }
+
+ if ((sock = h2o_evloop_socket_accept(listener)) == nullptr) {
+ return;
+ }
+
+ const int descriptor = h2o_socket_get_fd(sock);
+ if (descriptor == -1) {
+ h2o_socket_close(sock);
+ return;
+ }
+
+ auto concurrentConnections = ++dsc->cs->tcpCurrentConnections;
+ if (dsc->cs->d_tcpConcurrentConnectionsLimit > 0 && concurrentConnections > dsc->cs->d_tcpConcurrentConnectionsLimit) {
+ --dsc->cs->tcpCurrentConnections;
+ h2o_socket_close(sock);
+ return;
+ }
+
+ if (concurrentConnections > dsc->cs->tcpMaxConcurrentConnections.load()) {
+ dsc->cs->tcpMaxConcurrentConnections.store(concurrentConnections);
+ }
+
+ auto& conn = t_conns[descriptor];
+
+ gettimeofday(&conn.d_connectionStartTime, nullptr);
+ conn.d_nbQueries = 0;
+ conn.d_acceptCtx = std::atomic_load_explicit(&dsc->accept_ctx, std::memory_order_acquire);
+ conn.d_desc = descriptor;
+
+ sock->on_close.cb = on_socketclose;
+ sock->on_close.data = &conn;
+ sock->data = dsc;
+
+ ++dsc->df->d_httpconnects;
+
+ h2o_accept(conn.d_acceptCtx->get(), sock);
+}
+
+static int create_listener(const ComboAddress& addr, std::shared_ptr<DOHServerConfig>& dsc, int fd)
+{
+ auto sock = h2o_evloop_socket_create(dsc->h2o_ctx.loop, fd, H2O_SOCKET_FLAG_DONT_READ);
+ sock->data = dsc.get();
+ h2o_socket_read_start(sock, on_accept);
+
+ return 0;
+}
+
+static int ocsp_stapling_callback(SSL* ssl, void* arg)
+{
+ if (ssl == nullptr || arg == nullptr) {
+ return SSL_TLSEXT_ERR_NOACK;
+ }
+ const auto ocspMap = reinterpret_cast<std::map<int, std::string>*>(arg);
+ return libssl_ocsp_stapling_callback(ssl, *ocspMap);
+}
+
+static int ticket_key_callback(SSL *s, unsigned char keyName[TLS_TICKETS_KEY_NAME_SIZE], unsigned char *iv, EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx, int enc)
+{
+ DOHAcceptContext* ctx = reinterpret_cast<DOHAcceptContext*>(libssl_get_ticket_key_callback_data(s));
+ if (ctx == nullptr || !ctx->d_ticketKeys) {
+ return -1;
+ }
+
+ ctx->handleTicketsKeyRotation();
+
+ auto ret = libssl_ticket_key_callback(s, *ctx->d_ticketKeys, keyName, iv, ectx, hctx, enc);
+ if (enc == 0) {
+ if (ret == 0) {
+ ++ctx->d_cs->tlsUnknownTicketKey;
+ }
+ else if (ret == 2) {
+ ++ctx->d_cs->tlsInactiveTicketKey;
+ }
+ }
+
+ return ret;
+}
+
+static void setupTLSContext(DOHAcceptContext& acceptCtx,
+ TLSConfig& tlsConfig,
+ TLSErrorCounters& counters)
+{
+ if (tlsConfig.d_ciphers.empty()) {
+ tlsConfig.d_ciphers = DOH_DEFAULT_CIPHERS;
+ }
+
+ auto ctx = libssl_init_server_context(tlsConfig, acceptCtx.d_ocspResponses);
+
+ if (tlsConfig.d_enableTickets && tlsConfig.d_numberOfTicketsKeys > 0) {
+ acceptCtx.d_ticketKeys = std::make_unique<OpenSSLTLSTicketKeysRing>(tlsConfig.d_numberOfTicketsKeys);
+ SSL_CTX_set_tlsext_ticket_key_cb(ctx.get(), &ticket_key_callback);
+ libssl_set_ticket_key_callback_data(ctx.get(), &acceptCtx);
+ }
+
+ if (!acceptCtx.d_ocspResponses.empty()) {
+ SSL_CTX_set_tlsext_status_cb(ctx.get(), &ocsp_stapling_callback);
+ SSL_CTX_set_tlsext_status_arg(ctx.get(), &acceptCtx.d_ocspResponses);
+ }
+
+ libssl_set_error_counters_callback(ctx, &counters);
+
+ if (!tlsConfig.d_keyLogFile.empty()) {
+ acceptCtx.d_keyLogFile = libssl_set_key_log_file(ctx, tlsConfig.d_keyLogFile);
+ }
+
+ h2o_ssl_register_alpn_protocols(ctx.get(), h2o_http2_alpn_protocols);
+
+ acceptCtx.d_ticketsKeyRotationDelay = tlsConfig.d_ticketsKeyRotationDelay;
+ if (tlsConfig.d_ticketKeyFile.empty()) {
+ acceptCtx.handleTicketsKeyRotation();
+ }
+ else {
+ acceptCtx.loadTicketsKeys(tlsConfig.d_ticketKeyFile);
+ }
+
+ auto nativeCtx = acceptCtx.get();
+ nativeCtx->ssl_ctx = ctx.release();
+}
+
+static void setupAcceptContext(DOHAcceptContext& ctx, DOHServerConfig& dsc, bool setupTLS)
+{
+ auto nativeCtx = ctx.get();
+ nativeCtx->ctx = &dsc.h2o_ctx;
+ nativeCtx->hosts = dsc.h2o_config.hosts;
+ ctx.d_ticketsKeyRotationDelay = dsc.df->d_tlsConfig.d_ticketsKeyRotationDelay;
+
+ if (setupTLS && dsc.df->isHTTPS()) {
+ try {
+ setupTLSContext(ctx,
+ dsc.df->d_tlsConfig,
+ dsc.df->d_tlsCounters);
+ }
+ catch (const std::runtime_error& e) {
+ throw std::runtime_error("Error setting up TLS context for DoH listener on '" + dsc.df->d_local.toStringWithPort() + "': " + e.what());
+ }
+ }
+ ctx.d_cs = dsc.cs;
+}
+
+void DOHFrontend::rotateTicketsKey(time_t now)
+{
+ if (d_dsc && d_dsc->accept_ctx) {
+ d_dsc->accept_ctx->rotateTicketsKey(now);
+ }
+}
+
+void DOHFrontend::loadTicketsKeys(const std::string& keyFile)
+{
+ if (d_dsc && d_dsc->accept_ctx) {
+ d_dsc->accept_ctx->loadTicketsKeys(keyFile);
+ }
+}
+
+void DOHFrontend::handleTicketsKeyRotation()
+{
+ if (d_dsc && d_dsc->accept_ctx) {
+ d_dsc->accept_ctx->handleTicketsKeyRotation();
+ }
+}
+
+time_t DOHFrontend::getNextTicketsKeyRotation() const
+{
+ if (d_dsc && d_dsc->accept_ctx) {
+ return d_dsc->accept_ctx->getNextTicketsKeyRotation();
+ }
+ return 0;
+}
+
+size_t DOHFrontend::getTicketsKeysCount() const
+{
+ size_t res = 0;
+ if (d_dsc && d_dsc->accept_ctx) {
+ res = d_dsc->accept_ctx->getTicketsKeysCount();
+ }
+ return res;
+}
+
+void DOHFrontend::reloadCertificates()
+{
+ auto newAcceptContext = std::make_shared<DOHAcceptContext>();
+ setupAcceptContext(*newAcceptContext, *d_dsc, true);
+ std::atomic_store_explicit(&d_dsc->accept_ctx, newAcceptContext, std::memory_order_release);
+}
+
+void DOHFrontend::setup()
+{
+ registerOpenSSLUser();
+
+ d_dsc = std::make_shared<DOHServerConfig>(d_idleTimeout, d_internalPipeBufferSize);
+
+ if (isHTTPS()) {
+ try {
+ setupTLSContext(*d_dsc->accept_ctx,
+ d_tlsConfig,
+ d_tlsCounters);
+ }
+ catch (const std::runtime_error& e) {
+ throw std::runtime_error("Error setting up TLS context for DoH listener on '" + d_local.toStringWithPort() + "': " + e.what());
+ }
+ }
+}
+
+static h2o_pathconf_t *register_handler(h2o_hostconf_t *hostconf, const char *path, int (*on_req)(h2o_handler_t *, h2o_req_t *))
+{
+ h2o_pathconf_t *pathconf = h2o_config_register_path(hostconf, path, 0);
+ if (pathconf == nullptr) {
+ return pathconf;
+ }
+ h2o_filter_t *filter = h2o_create_filter(pathconf, sizeof(*filter));
+ if (filter) {
+ filter->on_setup_ostream = on_response_ready_cb;
+ }
+
+ h2o_handler_t *handler = h2o_create_handler(pathconf, sizeof(*handler));
+ if (handler != nullptr) {
+ handler->on_req = on_req;
+ }
+
+ return pathconf;
+}
+
+// this is the entrypoint from dnsdist.cc
+void dohThread(ClientState* cs)
+{
+ try {
+ std::shared_ptr<DOHFrontend>& df = cs->dohFrontend;
+ auto& dsc = df->d_dsc;
+ dsc->cs = cs;
+ dsc->df = cs->dohFrontend;
+ dsc->h2o_config.server_name = h2o_iovec_init(df->d_serverTokens.c_str(), df->d_serverTokens.size());
+
+ std::thread dnsdistThread(dnsdistclient, dsc->dohquerypair[1]);
+ dnsdistThread.detach(); // gets us better error reporting
+
+ setThreadName("dnsdist/doh");
+ // I wonder if this registers an IP address.. I think it does
+ // this may mean we need to actually register a site "name" here and not the IP address
+ h2o_hostconf_t *hostconf = h2o_config_register_host(&dsc->h2o_config, h2o_iovec_init(df->d_local.toString().c_str(), df->d_local.toString().size()), 65535);
+
+ for(const auto& url : df->d_urls) {
+ register_handler(hostconf, url.c_str(), doh_handler);
+ dsc->paths.insert(url);
+ }
+
+ h2o_context_init(&dsc->h2o_ctx, h2o_evloop_create(), &dsc->h2o_config);
+
+ // in this complicated way we insert the DOHServerConfig pointer in there
+ h2o_vector_reserve(nullptr, &dsc->h2o_ctx.storage, 1);
+ dsc->h2o_ctx.storage.entries[0].data = dsc.get();
+ ++dsc->h2o_ctx.storage.size;
+
+ auto sock = h2o_evloop_socket_create(dsc->h2o_ctx.loop, dsc->dohresponsepair[1], H2O_SOCKET_FLAG_DONT_READ);
+ sock->data = dsc.get();
+
+ // this listens to responses from dnsdist to turn into http responses
+ h2o_socket_read_start(sock, on_dnsdist);
+
+ setupAcceptContext(*dsc->accept_ctx, *dsc, false);
+
+ if (create_listener(df->d_local, dsc, cs->tcpFD) != 0) {
+ throw std::runtime_error("DOH server failed to listen on " + df->d_local.toStringWithPort() + ": " + strerror(errno));
+ }
+
+ bool stop = false;
+ do {
+ int result = h2o_evloop_run(dsc->h2o_ctx.loop, INT32_MAX);
+ if (result == -1) {
+ if (errno != EINTR) {
+ errlog("Error in the DoH event loop: %s", strerror(errno));
+ stop = true;
+ }
+ }
+ }
+ while (stop == false);
+
+ }
+ catch (const std::exception& e) {
+ throw runtime_error("DOH thread failed to launch: " + std::string(e.what()));
+ }
+ catch (...) {
+ throw runtime_error("DOH thread failed to launch");
+ }
+}
+
+void handleUDPResponseForDoH(DOHUnitUniquePtr&& du, PacketBuffer&& udpResponse, IDState&& state)
+{
+ du->response = std::move(udpResponse);
+ du->ids = std::move(state);
+
+ const dnsheader* dh = reinterpret_cast<const struct dnsheader*>(du->response.data());
+ if (!dh->tc) {
+ thread_local LocalStateHolder<vector<DNSDistResponseRuleAction>> localRespRuleActions = g_respruleactions.getLocal();
+ DNSResponse dr = makeDNSResponseFromIDState(du->ids, du->response);
+ dnsheader cleartextDH;
+ memcpy(&cleartextDH, dr.getHeader(), sizeof(cleartextDH));
+
+ if (!processResponse(du->response, localRespRuleActions, dr, false, true)) {
+ return;
+ }
+
+ double udiff = du->ids.sentTime.udiff();
+ vinfolog("Got answer from %s, relayed to %s (https), took %f usec", du->downstream->remote.toStringWithPort(), du->ids.origRemote.toStringWithPort(), udiff);
+
+ handleResponseSent(du->ids, udiff, *dr.remote, du->downstream->remote, du->response.size(), cleartextDH, du->downstream->getProtocol());
+
+ ++g_stats.responses;
+ if (du->ids.cs) {
+ ++du->ids.cs->responses;
+ }
+ }
+ else {
+ du->truncated = true;
+ }
+
+ sendDoHUnitToTheMainThread(std::move(du), "DoH response");
+}
+
+#else /* HAVE_DNS_OVER_HTTPS */
+
+void handleDOHTimeout(DOHUnitUniquePtr&& oldDU)
+{
+}
+
+#endif /* HAVE_DNS_OVER_HTTPS */
diff --git a/doh.hh b/doh.hh
new file mode 100644
index 0000000..6004379
--- /dev/null
+++ b/doh.hh
@@ -0,0 +1,265 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "iputils.hh"
+#include "libssl.hh"
+#include "noinitvector.hh"
+#include "stat_t.hh"
+
+struct DOHServerConfig;
+
+class DOHResponseMapEntry
+{
+public:
+ DOHResponseMapEntry(const std::string& regex, uint16_t status, const PacketBuffer& content, const boost::optional<std::vector<std::pair<std::string, std::string>>>& headers): d_regex(regex), d_customHeaders(headers), d_content(content), d_status(status)
+ {
+ if (status >= 400 && !d_content.empty() && d_content.at(d_content.size() -1) != 0) {
+ // we need to make sure it's null-terminated
+ d_content.push_back(0);
+ }
+ }
+
+ bool matches(const std::string& path) const
+ {
+ return d_regex.match(path);
+ }
+
+ uint16_t getStatusCode() const
+ {
+ return d_status;
+ }
+
+ const PacketBuffer& getContent() const
+ {
+ return d_content;
+ }
+
+ const boost::optional<std::vector<std::pair<std::string, std::string>>>& getHeaders() const
+ {
+ return d_customHeaders;
+ }
+
+private:
+ Regex d_regex;
+ boost::optional<std::vector<std::pair<std::string, std::string>>> d_customHeaders;
+ PacketBuffer d_content;
+ uint16_t d_status;
+};
+
+struct DOHFrontend
+{
+ DOHFrontend()
+ {
+ }
+
+ std::shared_ptr<DOHServerConfig> d_dsc{nullptr};
+ std::shared_ptr<std::vector<std::shared_ptr<DOHResponseMapEntry>>> d_responsesMap;
+ TLSConfig d_tlsConfig;
+ TLSErrorCounters d_tlsCounters;
+ std::string d_serverTokens{"h2o/dnsdist"};
+ std::vector<std::pair<std::string, std::string>> d_customResponseHeaders;
+ ComboAddress d_local;
+
+ uint32_t d_idleTimeout{30}; // HTTP idle timeout in seconds
+ std::vector<std::string> d_urls;
+
+ pdns::stat_t d_httpconnects{0}; // number of TCP/IP connections established
+ pdns::stat_t d_getqueries{0}; // valid DNS queries received via GET
+ pdns::stat_t d_postqueries{0}; // valid DNS queries received via POST
+ pdns::stat_t d_badrequests{0}; // request could not be converted to dns query
+ pdns::stat_t d_errorresponses{0}; // dnsdist set 'error' on response
+ pdns::stat_t d_redirectresponses{0}; // dnsdist set 'redirect' on response
+ pdns::stat_t d_validresponses{0}; // valid responses sent out
+
+ struct HTTPVersionStats
+ {
+ pdns::stat_t d_nbQueries{0}; // valid DNS queries received
+ pdns::stat_t d_nb200Responses{0};
+ pdns::stat_t d_nb400Responses{0};
+ pdns::stat_t d_nb403Responses{0};
+ pdns::stat_t d_nb500Responses{0};
+ pdns::stat_t d_nb502Responses{0};
+ pdns::stat_t d_nbOtherResponses{0};
+ };
+
+ HTTPVersionStats d_http1Stats;
+ HTTPVersionStats d_http2Stats;
+#ifdef __linux__
+ // On Linux this gives us 128k pending queries (default is 8192 queries),
+ // which should be enough to deal with huge spikes
+ uint32_t d_internalPipeBufferSize{1024*1024};
+#else
+ uint32_t d_internalPipeBufferSize{0};
+#endif
+ bool d_sendCacheControlHeaders{true};
+ bool d_trustForwardedForHeader{false};
+ /* whether we require tue query path to exactly match one of configured ones,
+ or accept everything below these paths. */
+ bool d_exactPathMatching{true};
+
+ time_t getTicketsKeyRotationDelay() const
+ {
+ return d_tlsConfig.d_ticketsKeyRotationDelay;
+ }
+
+ bool isHTTPS() const
+ {
+ return !d_tlsConfig.d_certKeyPairs.empty();
+ }
+
+#ifndef HAVE_DNS_OVER_HTTPS
+ void setup()
+ {
+ }
+
+ void reloadCertificates()
+ {
+ }
+
+ void rotateTicketsKey(time_t now)
+ {
+ }
+
+ void loadTicketsKeys(const std::string& keyFile)
+ {
+ }
+
+ void handleTicketsKeyRotation()
+ {
+ }
+
+ time_t getNextTicketsKeyRotation() const
+ {
+ return 0;
+ }
+
+ size_t getTicketsKeysCount() const
+ {
+ size_t res = 0;
+ return res;
+ }
+
+#else
+ void setup();
+ void reloadCertificates();
+
+ void rotateTicketsKey(time_t now);
+ void loadTicketsKeys(const std::string& keyFile);
+ void handleTicketsKeyRotation();
+ time_t getNextTicketsKeyRotation() const;
+ size_t getTicketsKeysCount() const;
+#endif /* HAVE_DNS_OVER_HTTPS */
+};
+
+#ifndef HAVE_DNS_OVER_HTTPS
+struct DOHUnit
+{
+ static void release(DOHUnit* ptr)
+ {
+ }
+};
+
+#else /* HAVE_DNS_OVER_HTTPS */
+#include <unordered_map>
+
+#include "dnsdist-idstate.hh"
+
+struct st_h2o_req_t;
+struct DownstreamState;
+
+struct DOHUnit
+{
+ DOHUnit()
+ {
+ ids.ednsAdded = false;
+ }
+ DOHUnit(const DOHUnit&) = delete;
+ DOHUnit& operator=(const DOHUnit&) = delete;
+
+ void get()
+ {
+ ++d_refcnt;
+ }
+
+ void release()
+ {
+ if (--d_refcnt == 0) {
+ if (self) {
+ *self = nullptr;
+ }
+
+ delete this;
+ }
+ }
+
+ static void release(DOHUnit* ptr)
+ {
+ if (ptr) {
+ ptr->release();
+ }
+ }
+
+ IDState ids;
+ std::string sni;
+ std::string path;
+ std::string scheme;
+ std::string host;
+ std::string contentType;
+ std::vector<std::pair<std::string, std::string>> headers;
+ PacketBuffer query;
+ PacketBuffer response;
+ std::shared_ptr<DownstreamState> downstream{nullptr};
+ st_h2o_req_t* req{nullptr};
+ DOHUnit** self{nullptr};
+ DOHServerConfig* dsc{nullptr};
+ std::atomic<uint64_t> d_refcnt{1};
+ size_t query_at{0};
+ size_t proxyProtocolPayloadSize{0};
+ int rsock{-1};
+ /* the status_code is set from
+ processDOHQuery() (which is executed in
+ the DOH client thread) so that the correct
+ response can be sent in on_dnsdist(),
+ after the DOHUnit has been passed back to
+ the main DoH thread.
+ */
+ uint16_t status_code{200};
+ /* whether the query was re-sent to the backend over
+ TCP after receiving a truncated answer over UDP */
+ bool tcp{false};
+ bool truncated{false};
+
+ std::string getHTTPPath() const;
+ std::string getHTTPHost() const;
+ std::string getHTTPScheme() const;
+ std::string getHTTPQueryString() const;
+ std::unordered_map<std::string, std::string> getHTTPHeaders() const;
+ void setHTTPResponse(uint16_t statusCode, PacketBuffer&& body, const std::string& contentType="");
+};
+
+void handleUDPResponseForDoH(std::unique_ptr<DOHUnit, void(*)(DOHUnit*)>&&, PacketBuffer&& response, IDState&& state);
+
+#endif /* HAVE_DNS_OVER_HTTPS */
+
+using DOHUnitUniquePtr = std::unique_ptr<DOHUnit, void(*)(DOHUnit*)>;
+
+void handleDOHTimeout(DOHUnitUniquePtr&& oldDU);
diff --git a/dolog.hh b/dolog.hh
new file mode 100644
index 0000000..557c767
--- /dev/null
+++ b/dolog.hh
@@ -0,0 +1,173 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <iostream>
+#include <sstream>
+#if !defined(RECURSOR)
+#include <syslog.h>
+#else
+#include "logger.hh"
+#endif // RECURSOR
+
+
+/* This file is intended not to be metronome specific, and is simple example of C++2011
+ variadic templates in action.
+
+ The goal is rapid easy to use logging to console & syslog.
+
+ Usage:
+ string address="localhost";
+ vinfolog("Got TCP connection from %s", remote);
+ infolog("Bound to %s port %d", address, port);
+ warnlog("Query took %d milliseconds", 1232.4); // yes, %d
+ errlog("Unable to bind to %s: %s", ca.toStringWithPort(), strerr(errno));
+
+ Will log to stdout. Will syslog in any case with LOG_INFO,
+ LOG_WARNING, LOG_ERR respectively. If g_verbose=false, vinfolog is a noop.
+ More generically, dolog(someiostream, "Hello %s", stream) will log to someiostream
+
+ This will happily print a string to %d! Doesn't do further format processing.
+*/
+
+#if !defined(RECURSOR)
+inline void dolog(std::ostream& os, const char*s)
+{
+ os<<s;
+}
+
+template<typename T, typename... Args>
+void dolog(std::ostream& os, const char* s, T value, Args... args)
+{
+ while (*s) {
+ if (*s == '%') {
+ if (*(s + 1) == '%') {
+ ++s;
+ }
+ else {
+ os << value;
+ s += 2;
+ dolog(os, s, args...);
+ return;
+ }
+ }
+ os << *s++;
+ }
+}
+
+extern bool g_verbose;
+extern bool g_syslog;
+
+inline void setSyslogFacility(int facility)
+{
+ /* we always call openlog() right away at startup */
+ closelog();
+ openlog("dnsdist", LOG_PID|LOG_NDELAY, facility);
+}
+
+template<typename... Args>
+void genlog(int level, const char* s, Args... args)
+{
+ std::ostringstream str;
+ dolog(str, s, args...);
+ if(g_syslog)
+ syslog(level, "%s", str.str().c_str());
+ std::cout<<str.str()<<std::endl;
+}
+
+
+#define vinfolog if(g_verbose)infolog
+
+template<typename... Args>
+void infolog(const char* s, Args... args)
+{
+ genlog(LOG_INFO, s, args...);
+}
+
+template<typename... Args>
+void warnlog(const char* s, Args... args)
+{
+ genlog(LOG_WARNING, s, args...);
+}
+
+template<typename... Args>
+void errlog(const char* s, Args... args)
+{
+ genlog(LOG_ERR, s, args...);
+}
+
+
+#else // RECURSOR
+
+#define g_verbose 0
+
+inline void dolog(Logger::Urgency u, const char* s)
+{
+ g_log << u << s << std::endl;
+}
+
+inline void dolog(const char* s)
+{
+ g_log << s << std::endl;
+}
+
+template<typename T, typename... Args>
+void dolog(Logger::Urgency u, const char* s, T value, Args... args)
+{
+ g_log << u;
+ while (*s) {
+ if (*s == '%') {
+ if (*(s + 1) == '%') {
+ ++s;
+ }
+ else {
+ g_log << value;
+ s += 2;
+ dolog(s, args...);
+ return;
+ }
+ }
+ g_log << *s++;
+ }
+}
+
+#define vinfolog if(g_verbose)infolog
+
+template<typename... Args>
+void infolog(const char* s, Args... args)
+{
+ dolog(Logger::Info, s, args...);
+}
+
+template<typename... Args>
+void warnlog(const char* s, Args... args)
+{
+ dolog(Logger::Warning, s, args...);
+}
+
+template<typename... Args>
+void errlog(const char* s, Args... args)
+{
+ dolog(Logger::Error, s, args...);
+}
+
+#endif
+
diff --git a/ednscookies.cc b/ednscookies.cc
new file mode 100644
index 0000000..5992b13
--- /dev/null
+++ b/ednscookies.cc
@@ -0,0 +1,174 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "ednscookies.hh"
+#include "misc.hh"
+
+#ifdef HAVE_CRYPTO_SHORTHASH
+#include <sodium.h>
+#endif
+
+EDNSCookiesOpt::EDNSCookiesOpt(const std::string& option)
+{
+ getEDNSCookiesOptFromString(option.c_str(), option.length());
+}
+
+EDNSCookiesOpt::EDNSCookiesOpt(const char* option, unsigned int len)
+{
+ getEDNSCookiesOptFromString(option, len);
+}
+
+bool EDNSCookiesOpt::makeFromString(const std::string& option)
+{
+ getEDNSCookiesOptFromString(option.c_str(), option.length());
+ return isWellFormed();
+}
+
+bool EDNSCookiesOpt::makeFromString(const char* option, unsigned int len)
+{
+ getEDNSCookiesOptFromString(option, len);
+ return isWellFormed();
+}
+
+string EDNSCookiesOpt::makeOptString() const
+{
+ string ret;
+ if (!isWellFormed())
+ return ret;
+ ret.assign(client);
+ if (server.length() != 0)
+ ret.append(server);
+ return ret;
+}
+
+void EDNSCookiesOpt::getEDNSCookiesOptFromString(const char* option, unsigned int len)
+{
+ client.clear();
+ server.clear();
+ if (len < 8)
+ return;
+ client = string(option, 8);
+ if (len > 8) {
+ server = string(option + 8, len - 8);
+ }
+}
+
+bool EDNSCookiesOpt::isValid(const string& secret, const ComboAddress& source) const
+{
+#ifdef HAVE_CRYPTO_SHORTHASH
+ if (server.length() != 16 || client.length() != 8) {
+ return false;
+ }
+ if (server[0] != '\x01') {
+ // Version is not 1, can't verify
+ return false;
+ }
+ uint32_t ts;
+ memcpy(&ts, &server[4], sizeof(ts));
+ ts = ntohl(ts);
+ uint32_t now = static_cast<uint32_t>(time(nullptr));
+ // RFC 9018 section 4.3:
+ // The DNS server
+ // SHOULD allow cookies within a 1-hour period in the past and a
+ // 5-minute period into the future
+ if (rfc1982LessThan(now + 300, ts) && rfc1982LessThan(ts + 3600, now)) {
+ return false;
+ }
+ if (secret.length() != crypto_shorthash_KEYBYTES) {
+ return false;
+ }
+
+ string toHash = client + server.substr(0, 8) + source.toByteString();
+ string hashResult;
+ hashResult.resize(8);
+ crypto_shorthash(
+ reinterpret_cast<unsigned char*>(&hashResult[0]),
+ reinterpret_cast<const unsigned char*>(&toHash[0]),
+ toHash.length(),
+ reinterpret_cast<const unsigned char*>(&secret[0]));
+ return constantTimeStringEquals(server.substr(8), hashResult);
+#else
+ return false;
+#endif
+}
+
+bool EDNSCookiesOpt::shouldRefresh() const
+{
+ if (server.size() < 16) {
+ return true;
+ }
+ uint32_t ts;
+ memcpy(&ts, &server[4], sizeof(ts));
+ ts = ntohl(ts);
+ uint32_t now = static_cast<uint32_t>(time(nullptr));
+ // RFC 9018 section 4.3:
+ // The DNS server
+ // SHOULD allow cookies within a 1-hour period in the past and a
+ // 5-minute period into the future
+ // If this is not the case, we need to refresh
+ if (rfc1982LessThan(now + 300, ts) && rfc1982LessThan(ts + 3600, now)) {
+ return true;
+ }
+
+ // RFC 9018 section 4.3:
+ // The DNS server SHOULD generate a new Server Cookie at least if the
+ // received Server Cookie from the client is more than half an hour old
+ return rfc1982LessThan(ts + 1800, now);
+}
+
+bool EDNSCookiesOpt::makeServerCookie(const string& secret, const ComboAddress& source)
+{
+#ifdef HAVE_CRYPTO_SHORTHASH
+ static_assert(EDNSCookieSecretSize == crypto_shorthash_KEYBYTES * 2, "The EDNSCookieSecretSize is not twice crypto_shorthash_KEYBYTES");
+
+ if (isValid(secret, source) && !shouldRefresh()) {
+ return true;
+ }
+
+ if (secret.length() != crypto_shorthash_KEYBYTES) {
+ return false;
+ }
+
+ server.clear();
+ server.reserve(16);
+ server = "\x01"; // Version
+ server.resize(4, '\0'); // 3 reserved bytes
+ uint32_t now = htonl(static_cast<uint32_t>(time(nullptr)));
+ server += string(reinterpret_cast<const char*>(&now), sizeof(now));
+ server.resize(8);
+
+ string toHash = client;
+ toHash += server;
+ toHash += source.toByteString();
+ server.resize(16);
+ crypto_shorthash(
+ reinterpret_cast<unsigned char*>(&server[8]),
+ reinterpret_cast<const unsigned char*>(&toHash[0]),
+ toHash.length(),
+ reinterpret_cast<const unsigned char*>(&secret[0]));
+ return true;
+#else
+ return false;
+#endif
+}
diff --git a/ednscookies.hh b/ednscookies.hh
new file mode 100644
index 0000000..7eff3c6
--- /dev/null
+++ b/ednscookies.hh
@@ -0,0 +1,72 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "namespaces.hh"
+#include "iputils.hh"
+
+struct EDNSCookiesOpt
+{
+ static const size_t EDNSCookieSecretSize = 32;
+ static const size_t EDNSCookieOptSize = 24;
+
+ EDNSCookiesOpt(){};
+ EDNSCookiesOpt(const std::string& option);
+ EDNSCookiesOpt(const char* option, unsigned int len);
+
+ bool makeFromString(const std::string& option);
+ bool makeFromString(const char* option, unsigned int len);
+
+ size_t size() const
+ {
+ return server.size() + client.size();
+ }
+
+ bool isWellFormed() const
+ {
+ // RFC7873 section 5.2.2
+ // In summary, valid cookie lengths are 8 and 16 to 40 inclusive.
+ return (
+ client.size() == 8 && (server.size() == 0 || (server.size() >= 8 && server.size() <= 32)));
+ }
+
+ bool isValid(const string& secret, const ComboAddress& source) const;
+ bool makeServerCookie(const string& secret, const ComboAddress& source);
+ string makeOptString() const;
+ string getServer() const
+ {
+ return server;
+ }
+ string getClient() const
+ {
+ return client;
+ }
+
+private:
+ bool shouldRefresh() const;
+
+ // the client cookie
+ string client;
+ // the server cookie
+ string server;
+
+ void getEDNSCookiesOptFromString(const char* option, unsigned int len);
+};
diff --git a/ednsoptions.cc b/ednsoptions.cc
new file mode 100644
index 0000000..8221f72
--- /dev/null
+++ b/ednsoptions.cc
@@ -0,0 +1,163 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dns.hh"
+#include "ednsoptions.hh"
+#include "iputils.hh"
+
+bool getNextEDNSOption(const char* data, size_t dataLen, uint16_t& optionCode, uint16_t& optionLen)
+{
+ if (data == nullptr || dataLen < (sizeof(uint16_t) + sizeof(uint16_t))) {
+ return false;
+ }
+
+ size_t pos = 0;
+ const uint8_t* p = reinterpret_cast<const uint8_t*>(data);
+
+ optionCode = (static_cast<uint16_t>(p[pos]) * 256) + p[pos + 1];
+ pos += EDNS_OPTION_CODE_SIZE;
+
+ optionLen = (static_cast<uint16_t>(p[pos]) * 256) + p[pos + 1];
+ pos += EDNS_OPTION_LENGTH_SIZE;
+ (void) pos;
+
+ return true;
+}
+
+/* extract the position (relative to the optRR pointer!) and size of a specific EDNS0 option from a pointer on the beginning rdLen of the OPT RR */
+int getEDNSOption(const char* optRR, const size_t len, uint16_t wantedOption, size_t* optionValuePosition, size_t * optionValueSize)
+{
+ assert(optRR != nullptr);
+ assert(optionValuePosition != nullptr);
+ assert(optionValueSize != nullptr);
+ size_t pos = 0;
+ if (len < DNS_RDLENGTH_SIZE)
+ return EINVAL;
+
+ const uint16_t rdLen = (((unsigned char) optRR[pos]) * 256) + ((unsigned char) optRR[pos+1]);
+ size_t rdPos = 0;
+ pos += DNS_RDLENGTH_SIZE;
+ if ((pos + rdLen) > len) {
+ return EINVAL;
+ }
+
+ while(len >= (pos + EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE) &&
+ rdLen >= (rdPos + EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE)) {
+ uint16_t optionCode;
+ uint16_t optionLen;
+ if (!getNextEDNSOption(optRR + pos, len-pos, optionCode, optionLen)) {
+ break;
+ }
+
+ pos += EDNS_OPTION_CODE_SIZE;
+ rdPos += EDNS_OPTION_CODE_SIZE;
+ pos += EDNS_OPTION_LENGTH_SIZE;
+ rdPos += EDNS_OPTION_LENGTH_SIZE;
+
+ if (optionLen > (rdLen - rdPos) || optionLen > (len - pos)) {
+ return EINVAL;
+ }
+
+ if (optionCode == wantedOption) {
+ *optionValuePosition = pos - (EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE);
+ *optionValueSize = optionLen + EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE;
+ return 0;
+ }
+ else {
+ /* skip this option */
+ pos += optionLen;
+ rdPos += optionLen;
+ }
+ }
+
+ return ENOENT;
+}
+
+/* extract all EDNS0 options from a pointer on the beginning rdLen of the OPT RR */
+int getEDNSOptions(const char* optRR, const size_t len, EDNSOptionViewMap& options)
+{
+ assert(optRR != nullptr);
+ size_t pos = 0;
+ if (len < DNS_RDLENGTH_SIZE)
+ return EINVAL;
+
+ const uint16_t rdLen = (((unsigned char) optRR[pos]) * 256) + ((unsigned char) optRR[pos+1]);
+ size_t rdPos = 0;
+ pos += DNS_RDLENGTH_SIZE;
+ if ((pos + rdLen) > len) {
+ return EINVAL;
+ }
+
+ while(len >= (pos + EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE) &&
+ rdLen >= (rdPos + EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE)) {
+ const uint16_t optionCode = (((unsigned char) optRR[pos]) * 256) + ((unsigned char) optRR[pos+1]);
+ pos += EDNS_OPTION_CODE_SIZE;
+ rdPos += EDNS_OPTION_CODE_SIZE;
+ const uint16_t optionLen = (((unsigned char) optRR[pos]) * 256) + ((unsigned char) optRR[pos+1]);
+ pos += EDNS_OPTION_LENGTH_SIZE;
+ rdPos += EDNS_OPTION_LENGTH_SIZE;
+ if (optionLen > (rdLen - rdPos) || optionLen > (len - pos))
+ return EINVAL;
+
+ EDNSOptionViewValue value;
+ value.content = optRR + pos;
+ value.size = optionLen;
+ options[optionCode].values.push_back(value);
+
+ /* skip this option */
+ pos += optionLen;
+ rdPos += optionLen;
+ }
+
+ return 0;
+}
+
+bool getEDNSOptionsFromContent(const std::string& content, std::vector<std::pair<uint16_t, std::string>>& options)
+{
+ size_t pos = 0;
+ uint16_t code, len;
+ const size_t contentLength = content.size();
+
+ while (pos < contentLength && (contentLength - pos) >= (EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE)) {
+ code = (static_cast<unsigned char>(content.at(pos)) * 256) + static_cast<unsigned char>(content.at(pos+1));
+ pos += EDNS_OPTION_CODE_SIZE;
+ len = (static_cast<unsigned char>(content.at(pos)) * 256) + static_cast<unsigned char>(content.at(pos+1));
+ pos += EDNS_OPTION_LENGTH_SIZE;
+
+ if (pos > contentLength || len > (contentLength - pos)) {
+ return false;
+ }
+
+ options.emplace_back(code, std::string(&content.at(pos), len));
+ pos += len;
+ }
+
+ return true;
+}
+
+void generateEDNSOption(uint16_t optionCode, const std::string& payload, std::string& res)
+{
+ const uint16_t ednsOptionCode = htons(optionCode);
+ const uint16_t payloadLen = htons(payload.length());
+ res.append((const char *) &ednsOptionCode, sizeof ednsOptionCode);
+ res.append((const char *) &payloadLen, sizeof payloadLen);
+ res.append(payload);
+}
diff --git a/ednsoptions.hh b/ednsoptions.hh
new file mode 100644
index 0000000..a26eb23
--- /dev/null
+++ b/ednsoptions.hh
@@ -0,0 +1,56 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "namespaces.hh"
+
+struct EDNSOptionCode
+{
+ enum EDNSOptionCodeEnum {NSID=3, DAU=5, DHU=6, N3U=7, ECS=8, EXPIRE=9, COOKIE=10, TCPKEEPALIVE=11, PADDING=12, CHAIN=13, KEYTAG=14, EXTENDEDERROR=15};
+};
+
+/* extract the position (relative to the optRR pointer!) and size of a specific EDNS0 option from a pointer on the beginning rdLen of the OPT RR */
+int getEDNSOption(const char* optRR, size_t len, uint16_t wantedOption, size_t* optionValuePosition, size_t* optionValueSize);
+
+struct EDNSOptionViewValue
+{
+ const char* content{nullptr};
+ uint16_t size{0};
+};
+
+struct EDNSOptionView
+{
+ std::vector<EDNSOptionViewValue> values;
+};
+
+static constexpr size_t EDNSOptionCodeSize = 2;
+static constexpr size_t EDNSOptionLengthSize = 2;
+
+typedef std::map<uint16_t, EDNSOptionView> EDNSOptionViewMap;
+
+/* extract all EDNS0 options from a pointer on the beginning rdLen of the OPT RR */
+int getEDNSOptions(const char* optRR, size_t len, EDNSOptionViewMap& options);
+/* extract all EDNS0 options from the content (so after rdLen) of the OPT RR */
+bool getEDNSOptionsFromContent(const std::string& content, std::vector<std::pair<uint16_t, std::string>>& options);
+/* parse the next EDNS option and the return the code and length. data should point to the beginning of the option code, dataLen should be maximum length of the data (minimum of remaining size in packet and remaining size in rdata) */
+bool getNextEDNSOption(const char* data, size_t dataLen, uint16_t& optionCode, uint16_t& optionLen);
+
+void generateEDNSOption(uint16_t optionCode, const std::string& payload, std::string& res);
diff --git a/ednssubnet.cc b/ednssubnet.cc
new file mode 100644
index 0000000..cf78ecf
--- /dev/null
+++ b/ednssubnet.cc
@@ -0,0 +1,108 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "ednssubnet.hh"
+#include "dns.hh"
+
+namespace {
+ struct EDNSSubnetOptsWire
+ {
+ uint16_t family;
+ uint8_t sourceMask;
+ uint8_t scopeMask;
+ } GCCPACKATTRIBUTE; // BRRRRR
+
+}
+
+bool getEDNSSubnetOptsFromString(const string& options, EDNSSubnetOpts* eso)
+{
+ //cerr<<"options.size:"<<options.size()<<endl;
+ return getEDNSSubnetOptsFromString(options.c_str(), options.length(), eso);
+}
+bool getEDNSSubnetOptsFromString(const char* options, unsigned int len, EDNSSubnetOpts* eso)
+{
+ EDNSSubnetOptsWire esow;
+ static_assert (sizeof(esow) == 4, "sizeof(EDNSSubnetOptsWire) must be 4 bytes");
+ if(len < sizeof(esow))
+ return false;
+ memcpy(&esow, options, sizeof(esow));
+ esow.family = ntohs(esow.family);
+ //cerr<<"Family when parsing from string: "<<esow.family<<endl;
+ ComboAddress address;
+ unsigned int octetsin = esow.sourceMask > 0 ? (((esow.sourceMask - 1)>> 3)+1) : 0;
+ //cerr<<"octetsin:"<<octetsin<<endl;
+ if(esow.family == 1) {
+ if(len != sizeof(esow)+octetsin)
+ return false;
+ if(octetsin > sizeof(address.sin4.sin_addr.s_addr))
+ return false;
+ address.reset();
+ address.sin4.sin_family = AF_INET;
+ if(octetsin > 0)
+ memcpy(&address.sin4.sin_addr.s_addr, options+sizeof(esow), octetsin);
+ } else if(esow.family == 2) {
+ if(len != sizeof(esow)+octetsin)
+ return false;
+ if(octetsin > sizeof(address.sin6.sin6_addr.s6_addr))
+ return false;
+
+ address.reset();
+ address.sin4.sin_family = AF_INET6;
+ if(octetsin > 0)
+ memcpy(&address.sin6.sin6_addr.s6_addr, options+sizeof(esow), octetsin);
+ }
+ else
+ return false;
+ //cerr<<"Source address: "<<address.toString()<<", mask: "<<(int)esow.sourceMask<<endl;
+ eso->source = Netmask(address, esow.sourceMask);
+ /* 'address' has more bits set (potentially) than scopeMask. This leads to odd looking netmasks that promise
+ more precision than they have. For this reason we truncate the address to scopeMask bits */
+
+ address.truncate(esow.scopeMask); // truncate will not throw for odd scopeMasks
+ eso->scope = Netmask(address, esow.scopeMask);
+
+ return true;
+}
+
+string makeEDNSSubnetOptsString(const EDNSSubnetOpts& eso)
+{
+ string ret;
+ EDNSSubnetOptsWire esow;
+ uint16_t family = htons(eso.source.getNetwork().sin4.sin_family == AF_INET ? 1 : 2);
+ esow.family = family;
+ esow.sourceMask = eso.source.getBits();
+ esow.scopeMask = eso.scope.getBits();
+ ret.assign((const char*)&esow, sizeof(esow));
+ int octetsout = ((esow.sourceMask - 1)>> 3)+1;
+
+ ComboAddress src=eso.source.getNetwork();
+ src.truncate(esow.sourceMask);
+
+ if(family == htons(1))
+ ret.append((const char*) &src.sin4.sin_addr.s_addr, octetsout);
+ else
+ ret.append((const char*) &src.sin6.sin6_addr.s6_addr, octetsout);
+ return ret;
+}
+
diff --git a/ednssubnet.hh b/ednssubnet.hh
new file mode 100644
index 0000000..b0f6e48
--- /dev/null
+++ b/ednssubnet.hh
@@ -0,0 +1,35 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "namespaces.hh"
+#include "iputils.hh"
+#include "dnsname.hh"
+
+struct EDNSSubnetOpts
+{
+ Netmask source;
+ Netmask scope;
+};
+
+bool getEDNSSubnetOptsFromString(const string& options, EDNSSubnetOpts* eso);
+bool getEDNSSubnetOptsFromString(const char* options, unsigned int len, EDNSSubnetOpts* eso);
+string makeEDNSSubnetOptsString(const EDNSSubnetOpts& eso);
diff --git a/epollmplexer.cc b/epollmplexer.cc
new file mode 100644
index 0000000..d0cbf54
--- /dev/null
+++ b/epollmplexer.cc
@@ -0,0 +1,240 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "mplexer.hh"
+#include "sstuff.hh"
+#include <iostream>
+#include <unistd.h>
+#include "misc.hh"
+#ifdef __linux__
+#include <sys/epoll.h>
+#endif
+
+#include "namespaces.hh"
+
+class EpollFDMultiplexer : public FDMultiplexer
+{
+public:
+ EpollFDMultiplexer();
+ ~EpollFDMultiplexer()
+ {
+ if (d_epollfd >= 0) {
+ close(d_epollfd);
+ }
+ }
+
+ int run(struct timeval* tv, int timeout = 500) override;
+ void getAvailableFDs(std::vector<int>& fds, int timeout) override;
+
+ void addFD(int fd, FDMultiplexer::EventKind kind) override;
+ void removeFD(int fd, FDMultiplexer::EventKind kind) override;
+ void alterFD(int fd, FDMultiplexer::EventKind from, FDMultiplexer::EventKind to) override;
+
+ string getName() const override
+ {
+ return "epoll";
+ }
+
+private:
+ int d_epollfd;
+ boost::shared_array<epoll_event> d_eevents;
+ static int s_maxevents; // not a hard maximum
+};
+
+static FDMultiplexer* makeEpoll()
+{
+ return new EpollFDMultiplexer();
+}
+
+static struct EpollRegisterOurselves
+{
+ EpollRegisterOurselves()
+ {
+ FDMultiplexer::getMultiplexerMap().emplace(0, &makeEpoll); // priority 0!
+ }
+} doItEpoll;
+
+int EpollFDMultiplexer::s_maxevents = 1024;
+
+EpollFDMultiplexer::EpollFDMultiplexer() :
+ d_eevents(new epoll_event[s_maxevents])
+{
+ d_epollfd = epoll_create(s_maxevents); // not hard max
+ if (d_epollfd < 0) {
+ throw FDMultiplexerException("Setting up epoll: " + stringerror());
+ }
+ int fd = socket(AF_INET, SOCK_DGRAM, 0); // for self-test
+
+ if (fd < 0) {
+ return;
+ }
+
+ try {
+ addReadFD(fd, 0);
+ removeReadFD(fd);
+ close(fd);
+ return;
+ }
+ catch (const FDMultiplexerException& fe) {
+ close(fd);
+ close(d_epollfd);
+ throw FDMultiplexerException("epoll multiplexer failed self-test: " + string(fe.what()));
+ }
+}
+
+static uint32_t convertEventKind(FDMultiplexer::EventKind kind)
+{
+ switch (kind) {
+ case FDMultiplexer::EventKind::Read:
+ return EPOLLIN;
+ case FDMultiplexer::EventKind::Write:
+ return EPOLLOUT;
+ case FDMultiplexer::EventKind::Both:
+ return EPOLLIN | EPOLLOUT;
+ }
+
+ throw std::runtime_error("Unhandled event kind in the epoll multiplexer");
+}
+
+void EpollFDMultiplexer::addFD(int fd, FDMultiplexer::EventKind kind)
+{
+ struct epoll_event eevent;
+
+ eevent.events = convertEventKind(kind);
+
+ eevent.data.u64 = 0; // placate valgrind (I love it so much)
+ eevent.data.fd = fd;
+
+ if (epoll_ctl(d_epollfd, EPOLL_CTL_ADD, fd, &eevent) < 0) {
+ throw FDMultiplexerException("Adding fd to epoll set: " + stringerror());
+ }
+}
+
+void EpollFDMultiplexer::removeFD(int fd, FDMultiplexer::EventKind)
+{
+ struct epoll_event dummy;
+ dummy.events = 0;
+ dummy.data.u64 = 0;
+
+ if (epoll_ctl(d_epollfd, EPOLL_CTL_DEL, fd, &dummy) < 0) {
+ throw FDMultiplexerException("Removing fd from epoll set: " + stringerror());
+ }
+}
+
+void EpollFDMultiplexer::alterFD(int fd, FDMultiplexer::EventKind, FDMultiplexer::EventKind to)
+{
+ struct epoll_event eevent;
+ eevent.events = convertEventKind(to);
+ eevent.data.u64 = 0; // placate valgrind (I love it so much)
+ eevent.data.fd = fd;
+
+ if (epoll_ctl(d_epollfd, EPOLL_CTL_MOD, fd, &eevent) < 0) {
+ throw FDMultiplexerException("Altering fd in epoll set: " + stringerror());
+ }
+}
+
+void EpollFDMultiplexer::getAvailableFDs(std::vector<int>& fds, int timeout)
+{
+ int ret = epoll_wait(d_epollfd, d_eevents.get(), s_maxevents, timeout);
+
+ if (ret < 0 && errno != EINTR) {
+ throw FDMultiplexerException("epoll returned error: " + stringerror());
+ }
+
+ for (int n = 0; n < ret; ++n) {
+ fds.push_back(d_eevents[n].data.fd);
+ }
+}
+
+int EpollFDMultiplexer::run(struct timeval* now, int timeout)
+{
+ if (d_inrun) {
+ throw FDMultiplexerException("FDMultiplexer::run() is not reentrant!\n");
+ }
+
+ int ret = epoll_wait(d_epollfd, d_eevents.get(), s_maxevents, timeout);
+ gettimeofday(now, nullptr); // MANDATORY
+
+ if (ret < 0 && errno != EINTR) {
+ throw FDMultiplexerException("epoll returned error: " + stringerror());
+ }
+
+ if (ret < 1) { // thanks AB!
+ return 0;
+ }
+
+ d_inrun = true;
+ int count = 0;
+ for (int n = 0; n < ret; ++n) {
+ if ((d_eevents[n].events & EPOLLIN) || (d_eevents[n].events & EPOLLERR) || (d_eevents[n].events & EPOLLHUP)) {
+ const auto& iter = d_readCallbacks.find(d_eevents[n].data.fd);
+ if (iter != d_readCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ count++;
+ }
+ }
+
+ if ((d_eevents[n].events & EPOLLOUT) || (d_eevents[n].events & EPOLLERR) || (d_eevents[n].events & EPOLLHUP)) {
+ const auto& iter = d_writeCallbacks.find(d_eevents[n].data.fd);
+ if (iter != d_writeCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ count++;
+ }
+ }
+ }
+
+ d_inrun = false;
+ return count;
+}
+
+#if 0
+void acceptData(int fd, funcparam_t& parameter)
+{
+ cout<<"Have data on fd "<<fd<<endl;
+ Socket* sock=funcparam_t_cast<Socket*>(parameter);
+ string packet;
+ IPEndpoint rem;
+ sock->recvFrom(packet, rem);
+ cout<<"Received "<<packet.size()<<" bytes!\n";
+}
+
+
+int main()
+{
+ Socket s(AF_INET, SOCK_DGRAM);
+
+ IPEndpoint loc("0.0.0.0", 2000);
+ s.bind(loc);
+
+ EpollFDMultiplexer sfm;
+
+ sfm.addReadFD(s.getHandle(), &acceptData, &s);
+
+ for(int n=0; n < 100 ; ++n) {
+ sfm.run();
+ }
+ sfm.removeReadFD(s.getHandle());
+ sfm.removeReadFD(s.getHandle());
+}
+#endif
diff --git a/ext/ipcrypt/LICENSE b/ext/ipcrypt/LICENSE
new file mode 100644
index 0000000..0a199e5
--- /dev/null
+++ b/ext/ipcrypt/LICENSE
@@ -0,0 +1,14 @@
+Copyright (c) 2015-2018, Frank Denis <j at pureftpd dot org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/ext/ipcrypt/Makefile.am b/ext/ipcrypt/Makefile.am
new file mode 100644
index 0000000..cd66bfc
--- /dev/null
+++ b/ext/ipcrypt/Makefile.am
@@ -0,0 +1,8 @@
+EXTRA_DIST = \
+ LICENSE
+
+noinst_LTLIBRARIES = libipcrypt.la
+
+libipcrypt_la_SOURCES = \
+ ipcrypt.c \
+ ipcrypt.h
diff --git a/ext/ipcrypt/Makefile.in b/ext/ipcrypt/Makefile.in
new file mode 100644
index 0000000..d717105
--- /dev/null
+++ b/ext/ipcrypt/Makefile.in
@@ -0,0 +1,722 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = ext/ipcrypt
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_pthread_set_name.m4 \
+ $(top_srcdir)/m4/ax_arg_default_enable_disable.m4 \
+ $(top_srcdir)/m4/ax_check_sign.m4 \
+ $(top_srcdir)/m4/ax_compile_check_sizeof.m4 \
+ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
+ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \
+ $(top_srcdir)/m4/ax_python_module.m4 $(top_srcdir)/m4/boost.m4 \
+ $(top_srcdir)/m4/dnsdist_enable_dnscrypt.m4 \
+ $(top_srcdir)/m4/dnsdist_enable_doh.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/pdns_check_cdb.m4 \
+ $(top_srcdir)/m4/pdns_check_clock_gettime.m4 \
+ $(top_srcdir)/m4/pdns_check_dnstap.m4 \
+ $(top_srcdir)/m4/pdns_check_libcrypto.m4 \
+ $(top_srcdir)/m4/pdns_check_libedit.m4 \
+ $(top_srcdir)/m4/pdns_check_libh2o_evloop.m4 \
+ $(top_srcdir)/m4/pdns_check_lmdb.m4 \
+ $(top_srcdir)/m4/pdns_check_lua_hpp.m4 \
+ $(top_srcdir)/m4/pdns_check_network_libs.m4 \
+ $(top_srcdir)/m4/pdns_check_os.m4 \
+ $(top_srcdir)/m4/pdns_check_pthread_np.m4 \
+ $(top_srcdir)/m4/pdns_check_python_venv.m4 \
+ $(top_srcdir)/m4/pdns_check_ragel.m4 \
+ $(top_srcdir)/m4/pdns_check_secure_memset.m4 \
+ $(top_srcdir)/m4/pdns_check_time_t.m4 \
+ $(top_srcdir)/m4/pdns_d_fortify_source.m4 \
+ $(top_srcdir)/m4/pdns_enable_sanitizers.m4 \
+ $(top_srcdir)/m4/pdns_enable_tls.m4 \
+ $(top_srcdir)/m4/pdns_enable_unit_tests.m4 \
+ $(top_srcdir)/m4/pdns_param_ssp_buffer_size.m4 \
+ $(top_srcdir)/m4/pdns_pie.m4 $(top_srcdir)/m4/pdns_relro.m4 \
+ $(top_srcdir)/m4/pdns_stack_protector.m4 \
+ $(top_srcdir)/m4/pdns_with_ebpf.m4 \
+ $(top_srcdir)/m4/pdns_with_gnutls.m4 \
+ $(top_srcdir)/m4/pdns_with_libcap.m4 \
+ $(top_srcdir)/m4/pdns_with_libsodium.m4 \
+ $(top_srcdir)/m4/pdns_with_libssl.m4 \
+ $(top_srcdir)/m4/pdns_with_lua.m4 \
+ $(top_srcdir)/m4/pdns_with_net_snmp.m4 \
+ $(top_srcdir)/m4/pdns_with_nghttp2.m4 \
+ $(top_srcdir)/m4/pdns_with_re2.m4 \
+ $(top_srcdir)/m4/pdns_with_service_user.m4 \
+ $(top_srcdir)/m4/systemd.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libipcrypt_la_LIBADD =
+am_libipcrypt_la_OBJECTS = ipcrypt.lo
+libipcrypt_la_OBJECTS = $(am_libipcrypt_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/ipcrypt.Plo
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libipcrypt_la_SOURCES)
+DIST_SOURCES = $(libipcrypt_la_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CPPFLAGS = @AM_CPPFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
+BOOST_LDPATH = @BOOST_LDPATH@
+BOOST_ROOT = @BOOST_ROOT@
+BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS = @BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS@
+BOOST_UNIT_TEST_FRAMEWORK_LDPATH = @BOOST_UNIT_TEST_FRAMEWORK_LDPATH@
+BOOST_UNIT_TEST_FRAMEWORK_LIBS = @BOOST_UNIT_TEST_FRAMEWORK_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDB_CFLAGS = @CDB_CFLAGS@
+CDB_LIBS = @CDB_LIBS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+DYNLINKFLAGS = @DYNLINKFLAGS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FSTRM_CFLAGS = @FSTRM_CFLAGS@
+FSTRM_LIBS = @FSTRM_LIBS@
+GNUTLS_CFLAGS = @GNUTLS_CFLAGS@
+GNUTLS_LIBS = @GNUTLS_LIBS@
+GREP = @GREP@
+HAVE_CXX17 = @HAVE_CXX17@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPCRYPT_CFLAGS = @IPCRYPT_CFLAGS@
+IPCRYPT_LIBS = @IPCRYPT_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAP_CFLAGS = @LIBCAP_CFLAGS@
+LIBCAP_LIBS = @LIBCAP_LIBS@
+LIBCRYPTO_INCLUDES = @LIBCRYPTO_INCLUDES@
+LIBCRYPTO_LDFLAGS = @LIBCRYPTO_LDFLAGS@
+LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@
+LIBEDIT_CFLAGS = @LIBEDIT_CFLAGS@
+LIBEDIT_LIBS = @LIBEDIT_LIBS@
+LIBH2OEVLOOP_CFLAGS = @LIBH2OEVLOOP_CFLAGS@
+LIBH2OEVLOOP_LIBS = @LIBH2OEVLOOP_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSODIUM_CFLAGS = @LIBSODIUM_CFLAGS@
+LIBSODIUM_LIBS = @LIBSODIUM_LIBS@
+LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
+LIBSSL_LIBS = @LIBSSL_LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LMDB_CFLAGS = @LMDB_CFLAGS@
+LMDB_LIBS = @LMDB_LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LUA_CFLAGS = @LUA_CFLAGS@
+LUA_LIBS = @LUA_LIBS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NET_SNMP_CFLAGS = @NET_SNMP_CFLAGS@
+NET_SNMP_LIBS = @NET_SNMP_LIBS@
+NGHTTP2_CFLAGS = @NGHTTP2_CFLAGS@
+NGHTTP2_LIBS = @NGHTTP2_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGEVERSION = @PACKAGEVERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PIE_CFLAGS = @PIE_CFLAGS@
+PIE_LDFLAGS = @PIE_LDFLAGS@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PROGRAM_LDFLAGS = @PROGRAM_LDFLAGS@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RAGEL = @RAGEL@
+RANLIB = @RANLIB@
+RE2_CFLAGS = @RE2_CFLAGS@
+RE2_LIBS = @RE2_LIBS@
+RELRO_LDFLAGS = @RELRO_LDFLAGS@
+RT_LIBS = @RT_LIBS@
+SANITIZER_FLAGS = @SANITIZER_FLAGS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEMCTL = @SYSTEMCTL@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_DIR = @SYSTEMD_DIR@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+SYSTEMD_MODULES_LOAD = @SYSTEMD_MODULES_LOAD@
+THREADFLAGS = @THREADFLAGS@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+YAHTTP_CFLAGS = @YAHTTP_CFLAGS@
+YAHTTP_LIBS = @YAHTTP_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+service_group = @service_group@
+service_user = @service_user@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemd = @systemd@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = \
+ LICENSE
+
+noinst_LTLIBRARIES = libipcrypt.la
+libipcrypt_la_SOURCES = \
+ ipcrypt.c \
+ ipcrypt.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ext/ipcrypt/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign ext/ipcrypt/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+libipcrypt.la: $(libipcrypt_la_OBJECTS) $(libipcrypt_la_DEPENDENCIES) $(EXTRA_libipcrypt_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(LINK) $(libipcrypt_la_OBJECTS) $(libipcrypt_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipcrypt.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/ipcrypt.Plo
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ./$(DEPDIR)/ipcrypt.Plo
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ext/ipcrypt/ipcrypt.c b/ext/ipcrypt/ipcrypt.c
new file mode 100644
index 0000000..6ef464a
--- /dev/null
+++ b/ext/ipcrypt/ipcrypt.c
@@ -0,0 +1,87 @@
+
+#include "ipcrypt.h"
+
+#define ROTL(X, R) (X) = (unsigned char) ((X) << (R)) | ((X) >> (8 - (R)))
+
+static void
+arx_fwd(unsigned char state[4])
+{
+ state[0] += state[1];
+ state[2] += state[3];
+ ROTL(state[1], 2);
+ ROTL(state[3], 5);
+ state[1] ^= state[0];
+ state[3] ^= state[2];
+ ROTL(state[0], 4);
+ state[0] += state[3];
+ state[2] += state[1];
+ ROTL(state[1], 3);
+ ROTL(state[3], 7);
+ state[1] ^= state[2];
+ state[3] ^= state[0];
+ ROTL(state[2], 4);
+}
+
+static void
+arx_bwd(unsigned char state[4])
+{
+ ROTL(state[2], 4);
+ state[1] ^= state[2];
+ state[3] ^= state[0];
+ ROTL(state[1], 5);
+ ROTL(state[3], 1);
+ state[0] -= state[3];
+ state[2] -= state[1];
+ ROTL(state[0], 4);
+ state[1] ^= state[0];
+ state[3] ^= state[2];
+ ROTL(state[1], 6);
+ ROTL(state[3], 3);
+ state[0] -= state[1];
+ state[2] -= state[3];
+}
+
+static inline void
+xor4(unsigned char *out, const unsigned char *x, const unsigned char *y)
+{
+ out[0] = x[0] ^ y[0];
+ out[1] = x[1] ^ y[1];
+ out[2] = x[2] ^ y[2];
+ out[3] = x[3] ^ y[3];
+}
+
+int
+ipcrypt_encrypt(unsigned char out[IPCRYPT_BYTES],
+ const unsigned char in[IPCRYPT_BYTES],
+ const unsigned char key[IPCRYPT_KEYBYTES])
+{
+ unsigned char state[4];
+
+ xor4(state, in, key);
+ arx_fwd(state);
+ xor4(state, state, key + 4);
+ arx_fwd(state);
+ xor4(state, state, key + 8);
+ arx_fwd(state);
+ xor4(out, state, key + 12);
+
+ return 0;
+}
+
+int
+ipcrypt_decrypt(unsigned char out[IPCRYPT_BYTES],
+ const unsigned char in[IPCRYPT_BYTES],
+ const unsigned char key[IPCRYPT_KEYBYTES])
+{
+ unsigned char state[4];
+
+ xor4(state, in, key + 12);
+ arx_bwd(state);
+ xor4(state, state, key + 8);
+ arx_bwd(state);
+ xor4(state, state, key + 4);
+ arx_bwd(state);
+ xor4(out, state, key);
+
+ return 0;
+}
diff --git a/ext/ipcrypt/ipcrypt.h b/ext/ipcrypt/ipcrypt.h
new file mode 100644
index 0000000..76b94f5
--- /dev/null
+++ b/ext/ipcrypt/ipcrypt.h
@@ -0,0 +1,24 @@
+
+#ifndef ipcrypt_H
+#define ipcrypt_H
+
+#define IPCRYPT_BYTES 4
+#define IPCRYPT_KEYBYTES 16
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int ipcrypt_encrypt(unsigned char out[IPCRYPT_BYTES],
+ const unsigned char in[IPCRYPT_BYTES],
+ const unsigned char key[IPCRYPT_KEYBYTES]);
+
+int ipcrypt_decrypt(unsigned char out[IPCRYPT_BYTES],
+ const unsigned char in[IPCRYPT_BYTES],
+ const unsigned char key[IPCRYPT_KEYBYTES]);
+
+#ifdef __cplusplus
+} /* End of the 'extern "C"' block */
+#endif
+
+#endif
diff --git a/ext/json11/json11.cpp b/ext/json11/json11.cpp
new file mode 100644
index 0000000..f48833b
--- /dev/null
+++ b/ext/json11/json11.cpp
@@ -0,0 +1,784 @@
+/* Copyright (c) 2013 Dropbox, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#include "json11.hpp"
+#include <cassert>
+#include <cmath>
+#include <cstdlib>
+#include <cstdio>
+#include <limits>
+#include <string>
+
+namespace json11 {
+
+static const int max_depth = 200;
+
+using std::string;
+using std::vector;
+using std::map;
+using std::make_shared;
+using std::initializer_list;
+using std::move;
+
+/* Helper for representing null - just a do-nothing struct, plus comparison
+ * operators so the helpers in JsonValue work. We can't use nullptr_t because
+ * it may not be orderable.
+ */
+struct NullStruct {
+ bool operator==(NullStruct) const { return true; }
+ bool operator<(NullStruct) const { return false; }
+};
+
+/* * * * * * * * * * * * * * * * * * * *
+ * Serialization
+ */
+
+static void dump(NullStruct, string &out) {
+ out += "null";
+}
+
+static void dump(double value, string &out) {
+ if (std::isfinite(value)) {
+ char buf[32];
+ snprintf(buf, sizeof buf, "%.17g", value);
+ out += buf;
+ } else {
+ out += "null";
+ }
+}
+
+static void dump(int value, string &out) {
+ char buf[32];
+ snprintf(buf, sizeof buf, "%d", value);
+ out += buf;
+}
+
+static void dump(bool value, string &out) {
+ out += value ? "true" : "false";
+}
+
+static void dump(const string &value, string &out) {
+ out += '"';
+ for (size_t i = 0; i < value.length(); i++) {
+ const char ch = value[i];
+ if (ch == '\\') {
+ out += "\\\\";
+ } else if (ch == '"') {
+ out += "\\\"";
+ } else if (ch == '\b') {
+ out += "\\b";
+ } else if (ch == '\f') {
+ out += "\\f";
+ } else if (ch == '\n') {
+ out += "\\n";
+ } else if (ch == '\r') {
+ out += "\\r";
+ } else if (ch == '\t') {
+ out += "\\t";
+ } else if (static_cast<uint8_t>(ch) <= 0x1f) {
+ char buf[8];
+ snprintf(buf, sizeof buf, "\\u%04x", ch);
+ out += buf;
+ } else if (static_cast<uint8_t>(ch) == 0xe2 && static_cast<uint8_t>(value[i+1]) == 0x80
+ && static_cast<uint8_t>(value[i+2]) == 0xa8) {
+ out += "\\u2028";
+ i += 2;
+ } else if (static_cast<uint8_t>(ch) == 0xe2 && static_cast<uint8_t>(value[i+1]) == 0x80
+ && static_cast<uint8_t>(value[i+2]) == 0xa9) {
+ out += "\\u2029";
+ i += 2;
+ } else {
+ out += ch;
+ }
+ }
+ out += '"';
+}
+
+static void dump(const Json::array &values, string &out) {
+ bool first = true;
+ out += "[";
+ for (const auto &value : values) {
+ if (!first)
+ out += ", ";
+ value.dump(out);
+ first = false;
+ }
+ out += "]";
+}
+
+static void dump(const Json::object &values, string &out) {
+ bool first = true;
+ out += "{";
+ for (const auto &kv : values) {
+ if (!first)
+ out += ", ";
+ dump(kv.first, out);
+ out += ": ";
+ kv.second.dump(out);
+ first = false;
+ }
+ out += "}";
+}
+
+void Json::dump(string &out) const {
+ m_ptr->dump(out);
+}
+
+/* * * * * * * * * * * * * * * * * * * *
+ * Value wrappers
+ */
+
+template <Json::Type tag, typename T>
+class Value : public JsonValue {
+protected:
+
+ // Constructors
+ explicit Value(const T &value) : m_value(value) {}
+ explicit Value(T &&value) : m_value(move(value)) {}
+
+ // Get type tag
+ Json::Type type() const override {
+ return tag;
+ }
+
+ // Comparisons
+ bool equals(const JsonValue * other) const override {
+ return m_value == static_cast<const Value<tag, T> *>(other)->m_value;
+ }
+ bool less(const JsonValue * other) const override {
+ return m_value < static_cast<const Value<tag, T> *>(other)->m_value;
+ }
+
+ const T m_value;
+ void dump(string &out) const override { json11::dump(m_value, out); }
+};
+
+class JsonDouble final : public Value<Json::NUMBER, double> {
+ double number_value() const override { return m_value; }
+ int int_value() const override { return static_cast<int>(m_value); }
+ bool equals(const JsonValue * other) const override { return m_value == other->number_value(); }
+ bool less(const JsonValue * other) const override { return m_value < other->number_value(); }
+public:
+ explicit JsonDouble(double value) : Value(value) {}
+};
+
+class JsonInt final : public Value<Json::NUMBER, int> {
+ double number_value() const override { return m_value; }
+ int int_value() const override { return m_value; }
+ bool equals(const JsonValue * other) const override { return m_value == other->number_value(); }
+ bool less(const JsonValue * other) const override { return m_value < other->number_value(); }
+public:
+ explicit JsonInt(int value) : Value(value) {}
+};
+
+class JsonBoolean final : public Value<Json::BOOL, bool> {
+ bool bool_value() const override { return m_value; }
+public:
+ explicit JsonBoolean(bool value) : Value(value) {}
+};
+
+class JsonString final : public Value<Json::STRING, string> {
+ const string &string_value() const override { return m_value; }
+public:
+ explicit JsonString(const string &value) : Value(value) {}
+ explicit JsonString(string &&value) : Value(move(value)) {}
+};
+
+class JsonArray final : public Value<Json::ARRAY, Json::array> {
+ const Json::array &array_items() const override { return m_value; }
+ const Json & operator[](size_t i) const override;
+public:
+ explicit JsonArray(const Json::array &value) : Value(value) {}
+ explicit JsonArray(Json::array &&value) : Value(move(value)) {}
+};
+
+class JsonObject final : public Value<Json::OBJECT, Json::object> {
+ const Json::object &object_items() const override { return m_value; }
+ const Json & operator[](const string &key) const override;
+public:
+ explicit JsonObject(const Json::object &value) : Value(value) {}
+ explicit JsonObject(Json::object &&value) : Value(move(value)) {}
+};
+
+class JsonNull final : public Value<Json::NUL, NullStruct> {
+public:
+ JsonNull() : Value({}) {}
+};
+
+/* * * * * * * * * * * * * * * * * * * *
+ * Static globals - static-init-safe
+ */
+struct Statics {
+ const std::shared_ptr<JsonValue> null = make_shared<JsonNull>();
+ const std::shared_ptr<JsonValue> t = make_shared<JsonBoolean>(true);
+ const std::shared_ptr<JsonValue> f = make_shared<JsonBoolean>(false);
+ const string empty_string;
+ const vector<Json> empty_vector;
+ const map<string, Json> empty_map;
+ Statics() {}
+};
+
+static const Statics & statics() {
+ static const Statics s {};
+ return s;
+}
+
+static const Json & static_null() {
+ // This has to be separate, not in Statics, because Json() accesses statics().null.
+ static const Json json_null;
+ return json_null;
+}
+
+/* * * * * * * * * * * * * * * * * * * *
+ * Constructors
+ */
+
+Json::Json() noexcept : m_ptr(statics().null) {}
+Json::Json(std::nullptr_t) noexcept : m_ptr(statics().null) {}
+Json::Json(double value) : m_ptr(make_shared<JsonDouble>(value)) {}
+Json::Json(int value) : m_ptr(make_shared<JsonInt>(value)) {}
+Json::Json(bool value) : m_ptr(value ? statics().t : statics().f) {}
+Json::Json(const string &value) : m_ptr(make_shared<JsonString>(value)) {}
+Json::Json(string &&value) : m_ptr(make_shared<JsonString>(move(value))) {}
+Json::Json(const char * value) : m_ptr(make_shared<JsonString>(value)) {}
+Json::Json(const Json::array &values) : m_ptr(make_shared<JsonArray>(values)) {}
+Json::Json(Json::array &&values) : m_ptr(make_shared<JsonArray>(move(values))) {}
+Json::Json(const Json::object &values) : m_ptr(make_shared<JsonObject>(values)) {}
+Json::Json(Json::object &&values) : m_ptr(make_shared<JsonObject>(move(values))) {}
+
+/* * * * * * * * * * * * * * * * * * * *
+ * Accessors
+ */
+
+Json::Type Json::type() const { return m_ptr->type(); }
+double Json::number_value() const { return m_ptr->number_value(); }
+int Json::int_value() const { return m_ptr->int_value(); }
+bool Json::bool_value() const { return m_ptr->bool_value(); }
+const string & Json::string_value() const { return m_ptr->string_value(); }
+const vector<Json> & Json::array_items() const { return m_ptr->array_items(); }
+const map<string, Json> & Json::object_items() const { return m_ptr->object_items(); }
+const Json & Json::operator[] (size_t i) const { return (*m_ptr)[i]; }
+const Json & Json::operator[] (const string &key) const { return (*m_ptr)[key]; }
+
+double JsonValue::number_value() const { return 0; }
+int JsonValue::int_value() const { return 0; }
+bool JsonValue::bool_value() const { return false; }
+const string & JsonValue::string_value() const { return statics().empty_string; }
+const vector<Json> & JsonValue::array_items() const { return statics().empty_vector; }
+const map<string, Json> & JsonValue::object_items() const { return statics().empty_map; }
+const Json & JsonValue::operator[] (size_t) const { return static_null(); }
+const Json & JsonValue::operator[] (const string &) const { return static_null(); }
+
+const Json & JsonObject::operator[] (const string &key) const {
+ auto iter = m_value.find(key);
+ return (iter == m_value.end()) ? static_null() : iter->second;
+}
+const Json & JsonArray::operator[] (size_t i) const {
+ if (i >= m_value.size()) return static_null();
+ else return m_value[i];
+}
+
+/* * * * * * * * * * * * * * * * * * * *
+ * Comparison
+ */
+
+bool Json::operator== (const Json &other) const {
+ if (m_ptr->type() != other.m_ptr->type())
+ return false;
+
+ return m_ptr->equals(other.m_ptr.get());
+}
+
+bool Json::operator< (const Json &other) const {
+ if (m_ptr->type() != other.m_ptr->type())
+ return m_ptr->type() < other.m_ptr->type();
+
+ return m_ptr->less(other.m_ptr.get());
+}
+
+/* * * * * * * * * * * * * * * * * * * *
+ * Parsing
+ */
+
+/* esc(c)
+ *
+ * Format char c suitable for printing in an error message.
+ */
+static inline string esc(char c) {
+ char buf[12];
+ if (static_cast<uint8_t>(c) >= 0x20 && static_cast<uint8_t>(c) <= 0x7f) {
+ snprintf(buf, sizeof buf, "'%c' (%d)", c, c);
+ } else {
+ snprintf(buf, sizeof buf, "(%d)", c);
+ }
+ return string(buf);
+}
+
+static inline bool in_range(long x, long lower, long upper) {
+ return (x >= lower && x <= upper);
+}
+
+namespace {
+/* JsonParser
+ *
+ * Object that tracks all state of an in-progress parse.
+ */
+struct JsonParser final {
+
+ /* State
+ */
+ const string &str;
+ size_t i;
+ string &err;
+ bool failed;
+ const JsonParse strategy;
+
+ /* fail(msg, err_ret = Json())
+ *
+ * Mark this parse as failed.
+ */
+ Json fail(string &&msg) {
+ return fail(move(msg), Json());
+ }
+
+ template <typename T>
+ T fail(string &&msg, const T err_ret) {
+ if (!failed)
+ err = std::move(msg);
+ failed = true;
+ return err_ret;
+ }
+
+ /* consume_whitespace()
+ *
+ * Advance until the current character is non-whitespace.
+ */
+ void consume_whitespace() {
+ while (str[i] == ' ' || str[i] == '\r' || str[i] == '\n' || str[i] == '\t')
+ i++;
+ }
+
+ /* consume_comment()
+ *
+ * Advance comments (c-style inline and multiline).
+ */
+ bool consume_comment() {
+ bool comment_found = false;
+ if (str[i] == '/') {
+ i++;
+ if (i == str.size())
+ return fail("unexpected end of input inside comment", false);
+ if (str[i] == '/') { // inline comment
+ i++;
+ if (i == str.size())
+ return fail("unexpected end of input inside inline comment", false);
+ // advance until next line
+ while (str[i] != '\n') {
+ i++;
+ if (i == str.size())
+ return fail("unexpected end of input inside inline comment", false);
+ }
+ comment_found = true;
+ }
+ else if (str[i] == '*') { // multiline comment
+ i++;
+ if (i > str.size()-2)
+ return fail("unexpected end of input inside multi-line comment", false);
+ // advance until closing tokens
+ while (!(str[i] == '*' && str[i+1] == '/')) {
+ i++;
+ if (i > str.size()-2)
+ return fail(
+ "unexpected end of input inside multi-line comment", false);
+ }
+ i += 2;
+ if (i == str.size())
+ return fail(
+ "unexpected end of input inside multi-line comment", false);
+ comment_found = true;
+ }
+ else
+ return fail("malformed comment", false);
+ }
+ return comment_found;
+ }
+
+ /* consume_garbage()
+ *
+ * Advance until the current character is non-whitespace and non-comment.
+ */
+ void consume_garbage() {
+ consume_whitespace();
+ if(strategy == JsonParse::COMMENTS) {
+ bool comment_found = false;
+ do {
+ comment_found = consume_comment();
+ consume_whitespace();
+ }
+ while(comment_found);
+ }
+ }
+
+ /* get_next_token()
+ *
+ * Return the next non-whitespace character. If the end of the input is reached,
+ * flag an error and return 0.
+ */
+ char get_next_token() {
+ consume_garbage();
+ if (i == str.size())
+ return fail("unexpected end of input", (char)0);
+
+ return str[i++];
+ }
+
+ /* encode_utf8(pt, out)
+ *
+ * Encode pt as UTF-8 and add it to out.
+ */
+ void encode_utf8(long pt, string & out) {
+ if (pt < 0)
+ return;
+
+ if (pt < 0x80) {
+ out += static_cast<char>(pt);
+ } else if (pt < 0x800) {
+ out += static_cast<char>((pt >> 6) | 0xC0);
+ out += static_cast<char>((pt & 0x3F) | 0x80);
+ } else if (pt < 0x10000) {
+ out += static_cast<char>((pt >> 12) | 0xE0);
+ out += static_cast<char>(((pt >> 6) & 0x3F) | 0x80);
+ out += static_cast<char>((pt & 0x3F) | 0x80);
+ } else {
+ out += static_cast<char>((pt >> 18) | 0xF0);
+ out += static_cast<char>(((pt >> 12) & 0x3F) | 0x80);
+ out += static_cast<char>(((pt >> 6) & 0x3F) | 0x80);
+ out += static_cast<char>((pt & 0x3F) | 0x80);
+ }
+ }
+
+ /* parse_string()
+ *
+ * Parse a string, starting at the current position.
+ */
+ string parse_string() {
+ string out;
+ long last_escaped_codepoint = -1;
+ while (true) {
+ if (i == str.size())
+ return fail("unexpected end of input in string", "");
+
+ char ch = str[i++];
+
+ if (ch == '"') {
+ encode_utf8(last_escaped_codepoint, out);
+ return out;
+ }
+
+ if (in_range(ch, 0, 0x1f))
+ return fail("unescaped " + esc(ch) + " in string", "");
+
+ // The usual case: non-escaped characters
+ if (ch != '\\') {
+ encode_utf8(last_escaped_codepoint, out);
+ last_escaped_codepoint = -1;
+ out += ch;
+ continue;
+ }
+
+ // Handle escapes
+ if (i == str.size())
+ return fail("unexpected end of input in string", "");
+
+ ch = str[i++];
+
+ if (ch == 'u') {
+ // Extract 4-byte escape sequence
+ string esc = str.substr(i, 4);
+ // Explicitly check length of the substring. The following loop
+ // relies on std::string returning the terminating NUL when
+ // accessing str[length]. Checking here reduces brittleness.
+ if (esc.length() < 4) {
+ return fail("bad \\u escape: " + esc, "");
+ }
+ for (size_t j = 0; j < 4; j++) {
+ if (!in_range(esc[j], 'a', 'f') && !in_range(esc[j], 'A', 'F')
+ && !in_range(esc[j], '0', '9'))
+ return fail("bad \\u escape: " + esc, "");
+ }
+
+ long codepoint = strtol(esc.data(), nullptr, 16);
+
+ // JSON specifies that characters outside the BMP shall be encoded as a pair
+ // of 4-hex-digit \u escapes encoding their surrogate pair components. Check
+ // whether we're in the middle of such a beast: the previous codepoint was an
+ // escaped lead (high) surrogate, and this is a trail (low) surrogate.
+ if (in_range(last_escaped_codepoint, 0xD800, 0xDBFF)
+ && in_range(codepoint, 0xDC00, 0xDFFF)) {
+ // Reassemble the two surrogate pairs into one astral-plane character, per
+ // the UTF-16 algorithm.
+ encode_utf8((((last_escaped_codepoint - 0xD800) << 10)
+ | (codepoint - 0xDC00)) + 0x10000, out);
+ last_escaped_codepoint = -1;
+ } else {
+ encode_utf8(last_escaped_codepoint, out);
+ last_escaped_codepoint = codepoint;
+ }
+
+ i += 4;
+ continue;
+ }
+
+ encode_utf8(last_escaped_codepoint, out);
+ last_escaped_codepoint = -1;
+
+ if (ch == 'b') {
+ out += '\b';
+ } else if (ch == 'f') {
+ out += '\f';
+ } else if (ch == 'n') {
+ out += '\n';
+ } else if (ch == 'r') {
+ out += '\r';
+ } else if (ch == 't') {
+ out += '\t';
+ } else if (ch == '"' || ch == '\\' || ch == '/') {
+ out += ch;
+ } else {
+ return fail("invalid escape character " + esc(ch), "");
+ }
+ }
+ }
+
+ /* parse_number()
+ *
+ * Parse a double.
+ */
+ Json parse_number() {
+ size_t start_pos = i;
+
+ if (str[i] == '-')
+ i++;
+
+ // Integer part
+ if (str[i] == '0') {
+ i++;
+ if (in_range(str[i], '0', '9'))
+ return fail("leading 0s not permitted in numbers");
+ } else if (in_range(str[i], '1', '9')) {
+ i++;
+ while (in_range(str[i], '0', '9'))
+ i++;
+ } else {
+ return fail("invalid " + esc(str[i]) + " in number");
+ }
+
+ if (str[i] != '.' && str[i] != 'e' && str[i] != 'E'
+ && (i - start_pos) <= static_cast<size_t>(std::numeric_limits<int>::digits10)) {
+ return std::atoi(str.c_str() + start_pos);
+ }
+
+ // Decimal part
+ if (str[i] == '.') {
+ i++;
+ if (!in_range(str[i], '0', '9'))
+ return fail("at least one digit required in fractional part");
+
+ while (in_range(str[i], '0', '9'))
+ i++;
+ }
+
+ // Exponent part
+ if (str[i] == 'e' || str[i] == 'E') {
+ i++;
+
+ if (str[i] == '+' || str[i] == '-')
+ i++;
+
+ if (!in_range(str[i], '0', '9'))
+ return fail("at least one digit required in exponent");
+
+ while (in_range(str[i], '0', '9'))
+ i++;
+ }
+
+ return std::strtod(str.c_str() + start_pos, nullptr);
+ }
+
+ /* expect(str, res)
+ *
+ * Expect that 'str' starts at the character that was just read. If it does, advance
+ * the input and return res. If not, flag an error.
+ */
+ Json expect(const string &expected, Json res) {
+ assert(i != 0);
+ i--;
+ if (str.compare(i, expected.length(), expected) == 0) {
+ i += expected.length();
+ return res;
+ } else {
+ return fail("parse error: expected " + expected + ", got " + str.substr(i, expected.length()));
+ }
+ }
+
+ /* parse_json()
+ *
+ * Parse a JSON object.
+ */
+ Json parse_json(int depth) {
+ if (depth > max_depth) {
+ return fail("exceeded maximum nesting depth");
+ }
+
+ char ch = get_next_token();
+ if (failed)
+ return Json();
+
+ if (ch == '-' || (ch >= '0' && ch <= '9')) {
+ i--;
+ return parse_number();
+ }
+
+ if (ch == 't')
+ return expect("true", true);
+
+ if (ch == 'f')
+ return expect("false", false);
+
+ if (ch == 'n')
+ return expect("null", Json());
+
+ if (ch == '"')
+ return parse_string();
+
+ if (ch == '{') {
+ map<string, Json> data;
+ ch = get_next_token();
+ if (ch == '}')
+ return data;
+
+ while (1) {
+ if (ch != '"')
+ return fail("expected '\"' in object, got " + esc(ch));
+
+ string key = parse_string();
+ if (failed)
+ return Json();
+
+ ch = get_next_token();
+ if (ch != ':')
+ return fail("expected ':' in object, got " + esc(ch));
+
+ data[std::move(key)] = parse_json(depth + 1);
+ if (failed)
+ return Json();
+
+ ch = get_next_token();
+ if (ch == '}')
+ break;
+ if (ch != ',')
+ return fail("expected ',' in object, got " + esc(ch));
+
+ ch = get_next_token();
+ }
+ return data;
+ }
+
+ if (ch == '[') {
+ vector<Json> data;
+ ch = get_next_token();
+ if (ch == ']')
+ return data;
+
+ while (1) {
+ i--;
+ data.push_back(parse_json(depth + 1));
+ if (failed)
+ return Json();
+
+ ch = get_next_token();
+ if (ch == ']')
+ break;
+ if (ch != ',')
+ return fail("expected ',' in list, got " + esc(ch));
+
+ ch = get_next_token();
+ (void)ch;
+ }
+ return data;
+ }
+
+ return fail("expected value, got " + esc(ch));
+ }
+};
+}//namespace {
+
+Json Json::parse(const string &in, string &err, JsonParse strategy) {
+ JsonParser parser { in, 0, err, false, strategy };
+ Json result = parser.parse_json(0);
+
+ // Check for any trailing garbage
+ parser.consume_garbage();
+ if (parser.i != in.size())
+ return parser.fail("unexpected trailing " + esc(in[parser.i]));
+
+ return result;
+}
+
+// Documented in json11.hpp
+vector<Json> Json::parse_multi(const string &in,
+ std::string::size_type &parser_stop_pos,
+ string &err,
+ JsonParse strategy) {
+ JsonParser parser { in, 0, err, false, strategy };
+ parser_stop_pos = 0;
+ vector<Json> json_vec;
+ while (parser.i != in.size() && !parser.failed) {
+ json_vec.push_back(parser.parse_json(0));
+ // Check for another object
+ parser.consume_garbage();
+ if (!parser.failed)
+ parser_stop_pos = parser.i;
+ }
+ return json_vec;
+}
+
+/* * * * * * * * * * * * * * * * * * * *
+ * Shape-checking
+ */
+
+bool Json::has_shape(const shape & types, string & err) const {
+ if (!is_object()) {
+ err = "expected JSON object, got " + dump();
+ return false;
+ }
+
+ for (auto & item : types) {
+ if ((*this)[item.first].type() != item.second) {
+ err = "bad type for " + item.first + " in " + dump();
+ return false;
+ }
+ }
+
+ return true;
+}
+
+} // namespace json11
diff --git a/ext/json11/json11.hpp b/ext/json11/json11.hpp
new file mode 100644
index 0000000..a68394b
--- /dev/null
+++ b/ext/json11/json11.hpp
@@ -0,0 +1,232 @@
+/* json11
+ *
+ * json11 is a tiny JSON library for C++11, providing JSON parsing and serialization.
+ *
+ * The core object provided by the library is json11::Json. A Json object represents any JSON
+ * value: null, bool, number (int or double), string (std::string), array (std::vector), or
+ * object (std::map).
+ *
+ * Json objects act like values: they can be assigned, copied, moved, compared for equality or
+ * order, etc. There are also helper methods Json::dump, to serialize a Json to a string, and
+ * Json::parse (static) to parse a std::string as a Json object.
+ *
+ * Internally, the various types of Json object are represented by the JsonValue class
+ * hierarchy.
+ *
+ * A note on numbers - JSON specifies the syntax of number formatting but not its semantics,
+ * so some JSON implementations distinguish between integers and floating-point numbers, while
+ * some don't. In json11, we choose the latter. Because some JSON implementations (namely
+ * JavaScript itself) treat all numbers as the same type, distinguishing the two leads
+ * to JSON that will be *silently* changed by a round-trip through those implementations.
+ * Dangerous! To avoid that risk, json11 stores all numbers as double internally, but also
+ * provides integer helpers.
+ *
+ * Fortunately, double-precision IEEE754 ('double') can precisely store any integer in the
+ * range +/-2^53, which includes every 'int' on most systems. (Timestamps often use int64
+ * or long long to avoid the Y2038K problem; a double storing microseconds since some epoch
+ * will be exact for +/- 275 years.)
+ */
+
+/* Copyright (c) 2013 Dropbox, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+#pragma once
+
+#include <string>
+#include <vector>
+#include <map>
+#include <memory>
+#include <initializer_list>
+
+#ifdef _MSC_VER
+ #if _MSC_VER <= 1800 // VS 2013
+ #ifndef noexcept
+ #define noexcept throw()
+ #endif
+
+ #ifndef snprintf
+ #define snprintf _snprintf_s
+ #endif
+ #endif
+#endif
+
+namespace json11 {
+
+enum JsonParse {
+ STANDARD, COMMENTS
+};
+
+class JsonValue;
+
+class Json final {
+public:
+ // Types
+ enum Type {
+ NUL, NUMBER, BOOL, STRING, ARRAY, OBJECT
+ };
+
+ // Array and object typedefs
+ typedef std::vector<Json> array;
+ typedef std::map<std::string, Json> object;
+
+ // Constructors for the various types of JSON value.
+ Json() noexcept; // NUL
+ Json(std::nullptr_t) noexcept; // NUL
+ Json(double value); // NUMBER
+ Json(int value); // NUMBER
+ Json(bool value); // BOOL
+ Json(const std::string &value); // STRING
+ Json(std::string &&value); // STRING
+ Json(const char * value); // STRING
+ Json(const array &values); // ARRAY
+ Json(array &&values); // ARRAY
+ Json(const object &values); // OBJECT
+ Json(object &&values); // OBJECT
+
+ // Implicit constructor: anything with a to_json() function.
+ template <class T, class = decltype(&T::to_json)>
+ Json(const T & t) : Json(t.to_json()) {}
+
+ // Implicit constructor: map-like objects (std::map, std::unordered_map, etc)
+ template <class M, typename std::enable_if<
+ std::is_constructible<std::string, typename M::key_type>::value
+ && std::is_constructible<Json, typename M::mapped_type>::value,
+ int>::type = 0>
+ Json(const M & m) : Json(object(m.begin(), m.end())) {}
+
+ // Implicit constructor: vector-like objects (std::list, std::vector, std::set, etc)
+ template <class V, typename std::enable_if<
+ std::is_constructible<Json, typename V::value_type>::value,
+ int>::type = 0>
+ Json(const V & v) : Json(array(v.begin(), v.end())) {}
+
+ // This prevents Json(some_pointer) from accidentally producing a bool. Use
+ // Json(bool(some_pointer)) if that behavior is desired.
+ Json(void *) = delete;
+
+ // Accessors
+ Type type() const;
+
+ bool is_null() const { return type() == NUL; }
+ bool is_number() const { return type() == NUMBER; }
+ bool is_bool() const { return type() == BOOL; }
+ bool is_string() const { return type() == STRING; }
+ bool is_array() const { return type() == ARRAY; }
+ bool is_object() const { return type() == OBJECT; }
+
+ // Return the enclosed value if this is a number, 0 otherwise. Note that json11 does not
+ // distinguish between integer and non-integer numbers - number_value() and int_value()
+ // can both be applied to a NUMBER-typed object.
+ double number_value() const;
+ int int_value() const;
+
+ // Return the enclosed value if this is a boolean, false otherwise.
+ bool bool_value() const;
+ // Return the enclosed string if this is a string, "" otherwise.
+ const std::string &string_value() const;
+ // Return the enclosed std::vector if this is an array, or an empty vector otherwise.
+ const array &array_items() const;
+ // Return the enclosed std::map if this is an object, or an empty map otherwise.
+ const object &object_items() const;
+
+ // Return a reference to arr[i] if this is an array, Json() otherwise.
+ const Json & operator[](size_t i) const;
+ // Return a reference to obj[key] if this is an object, Json() otherwise.
+ const Json & operator[](const std::string &key) const;
+
+ // Serialize.
+ void dump(std::string &out) const;
+ std::string dump() const {
+ std::string out;
+ dump(out);
+ return out;
+ }
+
+ // Parse. If parse fails, return Json() and assign an error message to err.
+ static Json parse(const std::string & in,
+ std::string & err,
+ JsonParse strategy = JsonParse::STANDARD);
+ static Json parse(const char * in,
+ std::string & err,
+ JsonParse strategy = JsonParse::STANDARD) {
+ if (in) {
+ return parse(std::string(in), err, strategy);
+ } else {
+ err = "null input";
+ return nullptr;
+ }
+ }
+ // Parse multiple objects, concatenated or separated by whitespace
+ static std::vector<Json> parse_multi(
+ const std::string & in,
+ std::string::size_type & parser_stop_pos,
+ std::string & err,
+ JsonParse strategy = JsonParse::STANDARD);
+
+ static inline std::vector<Json> parse_multi(
+ const std::string & in,
+ std::string & err,
+ JsonParse strategy = JsonParse::STANDARD) {
+ std::string::size_type parser_stop_pos;
+ return parse_multi(in, parser_stop_pos, err, strategy);
+ }
+
+ bool operator== (const Json &rhs) const;
+ bool operator< (const Json &rhs) const;
+ bool operator!= (const Json &rhs) const { return !(*this == rhs); }
+ bool operator<= (const Json &rhs) const { return !(rhs < *this); }
+ bool operator> (const Json &rhs) const { return (rhs < *this); }
+ bool operator>= (const Json &rhs) const { return !(*this < rhs); }
+
+ /* has_shape(types, err)
+ *
+ * Return true if this is a JSON object and, for each item in types, has a field of
+ * the given type. If not, return false and set err to a descriptive message.
+ */
+ typedef std::initializer_list<std::pair<std::string, Type>> shape;
+ bool has_shape(const shape & types, std::string & err) const;
+
+private:
+ std::shared_ptr<JsonValue> m_ptr;
+};
+
+// Internal class hierarchy - JsonValue objects are not exposed to users of this API.
+class JsonValue {
+protected:
+ friend class Json;
+ friend class JsonInt;
+ friend class JsonDouble;
+ virtual Json::Type type() const = 0;
+ virtual bool equals(const JsonValue * other) const = 0;
+ virtual bool less(const JsonValue * other) const = 0;
+ virtual void dump(std::string &out) const = 0;
+ virtual double number_value() const;
+ virtual int int_value() const;
+ virtual bool bool_value() const;
+ virtual const std::string &string_value() const;
+ virtual const Json::array &array_items() const;
+ virtual const Json &operator[](size_t i) const;
+ virtual const Json::object &object_items() const;
+ virtual const Json &operator[](const std::string &key) const;
+ virtual ~JsonValue() {}
+};
+
+} // namespace json11
diff --git a/ext/libbpf/libbpf.h b/ext/libbpf/libbpf.h
new file mode 100644
index 0000000..8002b72
--- /dev/null
+++ b/ext/libbpf/libbpf.h
@@ -0,0 +1,210 @@
+/* eBPF mini library */
+#ifndef __LIBBPF_H
+#define __LIBBPF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct bpf_insn;
+
+int bpf_create_map(enum bpf_map_type map_type, int key_size, int value_size,
+ int max_entries);
+int bpf_update_elem(int fd, void *key, void *value, unsigned long long flags);
+int bpf_lookup_elem(int fd, void *key, void *value);
+int bpf_delete_elem(int fd, void *key);
+int bpf_get_next_key(int fd, void *key, void *next_key);
+
+int bpf_prog_load(enum bpf_prog_type prog_type,
+ const struct bpf_insn *insns, int insn_len,
+ const char *license, int kern_version);
+
+int bpf_obj_pin(int fd, const char *pathname);
+int bpf_obj_get(const char *pathname);
+
+#define LOG_BUF_SIZE 65536
+extern char bpf_log_buf[LOG_BUF_SIZE];
+
+/* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */
+
+#define BPF_ALU64_REG(OP, DST, SRC) \
+ ((struct bpf_insn) { \
+ .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \
+ .dst_reg = DST, \
+ .src_reg = SRC, \
+ .off = 0, \
+ .imm = 0 })
+
+#define BPF_ALU32_REG(OP, DST, SRC) \
+ ((struct bpf_insn) { \
+ .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
+ .dst_reg = DST, \
+ .src_reg = SRC, \
+ .off = 0, \
+ .imm = 0 })
+
+/* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */
+
+#define BPF_ALU64_IMM(OP, DST, IMM) \
+ ((struct bpf_insn) { \
+ .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \
+ .dst_reg = DST, \
+ .src_reg = 0, \
+ .off = 0, \
+ .imm = IMM })
+
+#define BPF_ALU32_IMM(OP, DST, IMM) \
+ ((struct bpf_insn) { \
+ .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
+ .dst_reg = DST, \
+ .src_reg = 0, \
+ .off = 0, \
+ .imm = IMM })
+
+/* Short form of mov, dst_reg = src_reg */
+
+#define BPF_MOV64_REG(DST, SRC) \
+ ((struct bpf_insn) { \
+ .code = BPF_ALU64 | BPF_MOV | BPF_X, \
+ .dst_reg = DST, \
+ .src_reg = SRC, \
+ .off = 0, \
+ .imm = 0 })
+
+#define BPF_MOV32_REG(DST, SRC) \
+ ((struct bpf_insn) { \
+ .code = BPF_ALU | BPF_MOV | BPF_X, \
+ .dst_reg = DST, \
+ .src_reg = SRC, \
+ .off = 0, \
+ .imm = 0 })
+
+/* Short form of mov, dst_reg = imm32 */
+
+#define BPF_MOV64_IMM(DST, IMM) \
+ ((struct bpf_insn) { \
+ .code = BPF_ALU64 | BPF_MOV | BPF_K, \
+ .dst_reg = DST, \
+ .src_reg = 0, \
+ .off = 0, \
+ .imm = IMM })
+
+/* BPF_LD_IMM64 macro encodes single 'load 64-bit immediate' insn */
+#define BPF_LD_IMM64(DST, IMM) \
+ BPF_LD_IMM64_RAW(DST, 0, IMM)
+
+#define BPF_LD_IMM64_RAW(DST, SRC, IMM) \
+ ((struct bpf_insn) { \
+ .code = BPF_LD | BPF_DW | BPF_IMM, \
+ .dst_reg = DST, \
+ .src_reg = SRC, \
+ .off = 0, \
+ .imm = (__s32) (IMM) }), \
+ ((struct bpf_insn) { \
+ .code = 0, /* zero is reserved opcode */ \
+ .dst_reg = 0, \
+ .src_reg = 0, \
+ .off = 0, \
+ .imm = (__s32)(((__u64) (IMM)) >> 32) })
+
+#ifndef BPF_PSEUDO_MAP_FD
+# define BPF_PSEUDO_MAP_FD 1
+#endif
+
+/* pseudo BPF_LD_IMM64 insn used to refer to process-local map_fd */
+#define BPF_LD_MAP_FD(DST, MAP_FD) \
+ BPF_LD_IMM64_RAW(DST, BPF_PSEUDO_MAP_FD, MAP_FD)
+
+
+/* Direct packet access, R0 = *(uint *) (skb->data + imm32) */
+
+#define BPF_LD_ABS(SIZE, IMM) \
+ ((struct bpf_insn) { \
+ .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \
+ .dst_reg = 0, \
+ .src_reg = 0, \
+ .off = 0, \
+ .imm = IMM })
+
+/* Memory load, dst_reg = *(uint *) (src_reg + off16) */
+
+#define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \
+ ((struct bpf_insn) { \
+ .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \
+ .dst_reg = DST, \
+ .src_reg = SRC, \
+ .off = OFF, \
+ .imm = 0 })
+
+/* Memory store, *(uint *) (dst_reg + off16) = src_reg */
+
+#define BPF_STX_MEM(SIZE, DST, SRC, OFF) \
+ ((struct bpf_insn) { \
+ .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \
+ .dst_reg = DST, \
+ .src_reg = SRC, \
+ .off = OFF, \
+ .imm = 0 })
+
+/* Memory store, *(uint *) (dst_reg + off16) = imm32 */
+
+#define BPF_ST_MEM(SIZE, DST, OFF, IMM) \
+ ((struct bpf_insn) { \
+ .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \
+ .dst_reg = DST, \
+ .src_reg = 0, \
+ .off = OFF, \
+ .imm = IMM })
+
+/* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */
+
+#define BPF_JMP_REG(OP, DST, SRC, OFF) \
+ ((struct bpf_insn) { \
+ .code = BPF_JMP | BPF_OP(OP) | BPF_X, \
+ .dst_reg = DST, \
+ .src_reg = SRC, \
+ .off = OFF, \
+ .imm = 0 })
+
+/* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */
+
+#define BPF_JMP_IMM(OP, DST, IMM, OFF) \
+ ((struct bpf_insn) { \
+ .code = BPF_JMP | BPF_OP(OP) | BPF_K, \
+ .dst_reg = DST, \
+ .src_reg = 0, \
+ .off = OFF, \
+ .imm = IMM })
+
+/* Raw code statement block */
+
+#define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \
+ ((struct bpf_insn) { \
+ .code = CODE, \
+ .dst_reg = DST, \
+ .src_reg = SRC, \
+ .off = OFF, \
+ .imm = IMM })
+
+/* Program exit */
+
+#define BPF_EXIT_INSN() \
+ ((struct bpf_insn) { \
+ .code = BPF_JMP | BPF_EXIT, \
+ .dst_reg = 0, \
+ .src_reg = 0, \
+ .off = 0, \
+ .imm = 0 })
+
+/* create RAW socket and bind to interface 'name' */
+int open_raw_sock(const char *name);
+
+struct perf_event_attr;
+int perf_event_open(struct perf_event_attr *attr, int pid, int cpu,
+ int group_fd, unsigned long flags);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/ext/lmdb-safe/lmdb-safe.cc b/ext/lmdb-safe/lmdb-safe.cc
new file mode 100644
index 0000000..7a023fd
--- /dev/null
+++ b/ext/lmdb-safe/lmdb-safe.cc
@@ -0,0 +1,364 @@
+#include "lmdb-safe.hh"
+#include <fcntl.h>
+#include <mutex>
+#include <memory>
+#include <sys/stat.h>
+#include <string.h>
+#include <map>
+
+using std::string;
+using std::runtime_error;
+using std::tuple;
+using std::weak_ptr;
+
+static string MDBError(int rc)
+{
+ return mdb_strerror(rc);
+}
+
+MDBDbi::MDBDbi(MDB_env* env, MDB_txn* txn, const string_view dbname, int flags)
+{
+ // A transaction that uses this function must finish (either commit or abort) before any other transaction in the process may use this function.
+
+ int rc = mdb_dbi_open(txn, dbname.empty() ? 0 : &dbname[0], flags, &d_dbi);
+ if(rc)
+ throw std::runtime_error("Unable to open named database: " + MDBError(rc));
+
+ // Database names are keys in the unnamed database, and may be read but not written.
+}
+
+MDBEnv::MDBEnv(const char* fname, int flags, int mode)
+{
+ mdb_env_create(&d_env);
+ uint64_t mapsizeMB = (sizeof(long)==4) ? 100 : 16000;
+ // on 32 bit platforms, there is just no room for more
+ if(mdb_env_set_mapsize(d_env, mapsizeMB * 1048576))
+ throw std::runtime_error("setting map size");
+ /*
+Various other options may also need to be set before opening the handle, e.g. mdb_env_set_mapsize(), mdb_env_set_maxreaders(), mdb_env_set_maxdbs(),
+ */
+
+ mdb_env_set_maxdbs(d_env, 128);
+
+ // we need MDB_NOTLS since we rely on its semantics
+ if(int rc=mdb_env_open(d_env, fname, flags | MDB_NOTLS, mode)) {
+ // If this function fails, mdb_env_close() must be called to discard the MDB_env handle.
+ mdb_env_close(d_env);
+ throw std::runtime_error("Unable to open database file "+std::string(fname)+": " + MDBError(rc));
+ }
+
+ if ((flags & MDB_RDONLY) == 0) {
+ // Check for stale readers to prevent unbridled database growth.
+ // Only do this when in RW mode since it affects the file.
+ mdb_reader_check(d_env, nullptr);
+ }
+}
+
+void MDBEnv::incROTX()
+{
+ std::lock_guard<std::mutex> l(d_countmutex);
+ ++d_ROtransactionsOut[std::this_thread::get_id()];
+}
+
+void MDBEnv::decROTX()
+{
+ std::lock_guard<std::mutex> l(d_countmutex);
+ --d_ROtransactionsOut[std::this_thread::get_id()];
+}
+
+void MDBEnv::incRWTX()
+{
+ std::lock_guard<std::mutex> l(d_countmutex);
+ ++d_RWtransactionsOut[std::this_thread::get_id()];
+}
+
+void MDBEnv::decRWTX()
+{
+ std::lock_guard<std::mutex> l(d_countmutex);
+ --d_RWtransactionsOut[std::this_thread::get_id()];
+}
+
+int MDBEnv::getRWTX()
+{
+ std::lock_guard<std::mutex> l(d_countmutex);
+ return d_RWtransactionsOut[std::this_thread::get_id()];
+}
+int MDBEnv::getROTX()
+{
+ std::lock_guard<std::mutex> l(d_countmutex);
+ return d_ROtransactionsOut[std::this_thread::get_id()];
+}
+
+
+std::shared_ptr<MDBEnv> getMDBEnv(const char* fname, int flags, int mode)
+{
+ struct Value
+ {
+ weak_ptr<MDBEnv> wp;
+ int flags;
+ };
+
+ static std::map<tuple<dev_t, ino_t>, Value> s_envs;
+ static std::mutex mut;
+
+ struct stat statbuf;
+ if(stat(fname, &statbuf)) {
+ if(errno != ENOENT)
+ throw std::runtime_error("Unable to stat prospective mdb database: "+string(strerror(errno)));
+ else {
+ std::lock_guard<std::mutex> l(mut);
+ auto fresh = std::make_shared<MDBEnv>(fname, flags, mode);
+ if(stat(fname, &statbuf))
+ throw std::runtime_error("Unable to stat prospective mdb database: "+string(strerror(errno)));
+ auto key = std::tie(statbuf.st_dev, statbuf.st_ino);
+ s_envs[key] = {fresh, flags};
+ return fresh;
+ }
+ }
+
+ std::lock_guard<std::mutex> l(mut);
+ auto key = std::tie(statbuf.st_dev, statbuf.st_ino);
+ auto iter = s_envs.find(key);
+ if(iter != s_envs.end()) {
+ auto sp = iter->second.wp.lock();
+ if(sp) {
+ if(iter->second.flags != flags)
+ throw std::runtime_error("Can't open mdb with differing flags");
+
+ return sp;
+ }
+ else {
+ s_envs.erase(iter); // useful if make_shared fails
+ }
+ }
+
+ auto fresh = std::make_shared<MDBEnv>(fname, flags, mode);
+ s_envs[key] = {fresh, flags};
+
+ return fresh;
+}
+
+
+MDBDbi MDBEnv::openDB(const string_view dbname, int flags)
+{
+ unsigned int envflags;
+ mdb_env_get_flags(d_env, &envflags);
+ /*
+ This function must not be called from multiple concurrent transactions in the same process. A transaction that uses this function must finish (either commit or abort) before any other transaction in the process may use this function.
+ */
+ std::lock_guard<std::mutex> l(d_openmut);
+
+ if(!(envflags & MDB_RDONLY)) {
+ auto rwt = getRWTransaction();
+ MDBDbi ret = rwt->openDB(dbname, flags);
+ rwt->commit();
+ return ret;
+ }
+
+ MDBDbi ret;
+ {
+ auto rwt = getROTransaction();
+ ret = rwt->openDB(dbname, flags);
+ }
+ return ret;
+}
+
+MDBRWTransactionImpl::MDBRWTransactionImpl(MDBEnv *parent, MDB_txn *txn):
+ MDBROTransactionImpl(parent, txn)
+
+{
+
+}
+
+MDB_txn *MDBRWTransactionImpl::openRWTransaction(MDBEnv *env, MDB_txn *parent, int flags)
+{
+ MDB_txn *result;
+ if(env->getROTX() || env->getRWTX())
+ throw std::runtime_error("Duplicate RW transaction");
+
+ if(int rc=mdb_txn_begin(env->d_env, parent, flags, &result))
+ throw std::runtime_error("Unable to start RW transaction: "+std::string(mdb_strerror(rc)));
+
+ env->incRWTX();
+ return result;
+}
+
+MDBRWTransactionImpl::MDBRWTransactionImpl(MDBEnv* parent, int flags):
+ MDBRWTransactionImpl(parent, openRWTransaction(parent, nullptr, flags))
+{
+}
+
+MDBRWTransactionImpl::~MDBRWTransactionImpl()
+{
+ abort();
+}
+
+void MDBRWTransactionImpl::commit()
+{
+ closeRORWCursors();
+ if (!d_txn) {
+ return;
+ }
+
+ if(int rc = mdb_txn_commit(d_txn)) {
+ throw std::runtime_error("committing: " + std::string(mdb_strerror(rc)));
+ }
+ environment().decRWTX();
+ d_txn = nullptr;
+}
+
+void MDBRWTransactionImpl::abort()
+{
+ closeRORWCursors();
+ if (!d_txn) {
+ return;
+ }
+
+ mdb_txn_abort(d_txn);
+ // prevent the RO destructor from cleaning up the transaction itself
+ environment().decRWTX();
+ d_txn = nullptr;
+}
+
+MDBROTransactionImpl::MDBROTransactionImpl(MDBEnv *parent, MDB_txn *txn):
+ d_parent(parent),
+ d_cursors(),
+ d_txn(txn)
+{
+
+}
+
+MDB_txn *MDBROTransactionImpl::openROTransaction(MDBEnv *env, MDB_txn *parent, int flags)
+{
+ if(env->getRWTX())
+ throw std::runtime_error("Duplicate RO transaction");
+
+ /*
+ A transaction and its cursors must only be used by a single thread, and a thread may only have a single transaction at a time. If MDB_NOTLS is in use, this does not apply to read-only transactions. */
+ MDB_txn *result = nullptr;
+
+ if(int rc=mdb_txn_begin(env->d_env, parent, MDB_RDONLY | flags, &result))
+ throw std::runtime_error("Unable to start RO transaction: "+string(mdb_strerror(rc)));
+
+ env->incROTX();
+
+ return result;
+}
+
+void MDBROTransactionImpl::closeROCursors()
+{
+ // we need to move the vector away to ensure that the cursors don’t mess with our iteration.
+ std::vector<MDBROCursor*> buf;
+ std::swap(d_cursors, buf);
+ for (auto &cursor: buf) {
+ cursor->close();
+ }
+}
+
+MDBROTransactionImpl::MDBROTransactionImpl(MDBEnv *parent, int flags):
+ MDBROTransactionImpl(parent, openROTransaction(parent, nullptr, flags))
+{
+
+}
+
+MDBROTransactionImpl::~MDBROTransactionImpl()
+{
+ // this is safe because C++ will not call overrides of virtual methods in destructors.
+ commit();
+}
+
+void MDBROTransactionImpl::abort()
+{
+ closeROCursors();
+ // if d_txn is non-nullptr here, either the transaction object was invalidated earlier (e.g. by moving from it), or it is an RW transaction which has already cleaned up the d_txn pointer (with an abort).
+ if (d_txn) {
+ d_parent->decROTX();
+ mdb_txn_abort(d_txn); // this appears to work better than abort for r/o database opening
+ d_txn = nullptr;
+ }
+}
+
+void MDBROTransactionImpl::commit()
+{
+ closeROCursors();
+ // if d_txn is non-nullptr here, either the transaction object was invalidated earlier (e.g. by moving from it), or it is an RW transaction which has already cleaned up the d_txn pointer (with an abort).
+ if (d_txn) {
+ d_parent->decROTX();
+ mdb_txn_commit(d_txn); // this appears to work better than abort for r/o database opening
+ d_txn = nullptr;
+ }
+}
+
+
+
+void MDBRWTransactionImpl::clear(MDB_dbi dbi)
+{
+ if(int rc = mdb_drop(d_txn, dbi, 0)) {
+ throw runtime_error("Error clearing database: " + MDBError(rc));
+ }
+}
+
+MDBRWCursor MDBRWTransactionImpl::getRWCursor(const MDBDbi& dbi)
+{
+ MDB_cursor *cursor;
+ int rc= mdb_cursor_open(d_txn, dbi, &cursor);
+ if(rc) {
+ throw std::runtime_error("Error creating RO cursor: "+std::string(mdb_strerror(rc)));
+ }
+ return MDBRWCursor(d_rw_cursors, cursor);
+}
+
+MDBRWCursor MDBRWTransactionImpl::getCursor(const MDBDbi &dbi)
+{
+ return getRWCursor(dbi);
+}
+
+MDBRWTransaction MDBRWTransactionImpl::getRWTransaction()
+{
+ MDB_txn *txn;
+ if (int rc = mdb_txn_begin(environment(), *this, 0, &txn)) {
+ throw std::runtime_error(std::string("failed to start child transaction: ")+mdb_strerror(rc));
+ }
+ // we need to increase the counter here because commit/abort on the child transaction will decrease it
+ environment().incRWTX();
+ return MDBRWTransaction(new MDBRWTransactionImpl(&environment(), txn));
+}
+
+MDBROTransaction MDBRWTransactionImpl::getROTransaction()
+{
+ return getRWTransaction();
+}
+
+MDBROTransaction MDBEnv::getROTransaction()
+{
+ return MDBROTransaction(new MDBROTransactionImpl(this));
+}
+MDBRWTransaction MDBEnv::getRWTransaction()
+{
+ return MDBRWTransaction(new MDBRWTransactionImpl(this));
+}
+
+
+void MDBRWTransactionImpl::closeRWCursors()
+{
+ decltype(d_rw_cursors) buf;
+ std::swap(d_rw_cursors, buf);
+ for (auto &cursor: buf) {
+ cursor->close();
+ }
+}
+
+MDBROCursor MDBROTransactionImpl::getCursor(const MDBDbi& dbi)
+{
+ return getROCursor(dbi);
+}
+
+MDBROCursor MDBROTransactionImpl::getROCursor(const MDBDbi &dbi)
+{
+ MDB_cursor *cursor;
+ int rc= mdb_cursor_open(d_txn, dbi, &cursor);
+ if(rc) {
+ throw std::runtime_error("Error creating RO cursor: "+std::string(mdb_strerror(rc)));
+ }
+ return MDBROCursor(d_cursors, cursor);
+}
diff --git a/ext/lmdb-safe/lmdb-safe.hh b/ext/lmdb-safe/lmdb-safe.hh
new file mode 100644
index 0000000..6844909
--- /dev/null
+++ b/ext/lmdb-safe/lmdb-safe.hh
@@ -0,0 +1,610 @@
+#pragma once
+#include <lmdb.h>
+#include <iostream>
+#include <fstream>
+#include <set>
+#include <map>
+#include <thread>
+#include <memory>
+#include <string>
+#include <string.h>
+#include <mutex>
+#include <vector>
+#include <algorithm>
+
+using std::string_view;
+
+/* open issues:
+ *
+ * - missing convenience functions (string_view, string)
+ */
+
+/*
+The error strategy. Anything that "should never happen" turns into an exception. But things like 'duplicate entry' or 'no such key' are for you to deal with.
+ */
+
+/*
+ Thread safety: we are as safe as lmdb. You can talk to MDBEnv from as many threads as you want
+*/
+
+/** MDBDbi is our only 'value type' object, as 1) a dbi is actually an integer
+ and 2) per LMDB documentation, we never close it. */
+class MDBDbi
+{
+public:
+ MDBDbi(): d_dbi(-1)
+ {
+ }
+ explicit MDBDbi(MDB_env* env, MDB_txn* txn, string_view dbname, int flags);
+
+ operator const MDB_dbi&() const
+ {
+ return d_dbi;
+ }
+
+ MDB_dbi d_dbi;
+};
+
+class MDBRWTransactionImpl;
+class MDBROTransactionImpl;
+
+using MDBROTransaction = std::unique_ptr<MDBROTransactionImpl>;
+using MDBRWTransaction = std::unique_ptr<MDBRWTransactionImpl>;
+
+class MDBEnv
+{
+public:
+ MDBEnv(const char* fname, int flags, int mode);
+
+ ~MDBEnv()
+ {
+ // Only a single thread may call this function. All transactions, databases, and cursors must already be closed before calling this function
+ mdb_env_close(d_env);
+ // but, elsewhere, docs say database handles do not need to be closed?
+ }
+
+ MDBDbi openDB(const string_view dbname, int flags);
+
+ MDBRWTransaction getRWTransaction();
+ MDBROTransaction getROTransaction();
+
+ operator MDB_env*& ()
+ {
+ return d_env;
+ }
+ MDB_env* d_env;
+
+ int getRWTX();
+ void incRWTX();
+ void decRWTX();
+ int getROTX();
+ void incROTX();
+ void decROTX();
+private:
+ std::mutex d_openmut;
+ std::mutex d_countmutex;
+ std::map<std::thread::id, int> d_RWtransactionsOut;
+ std::map<std::thread::id, int> d_ROtransactionsOut;
+};
+
+std::shared_ptr<MDBEnv> getMDBEnv(const char* fname, int flags, int mode);
+
+
+
+struct MDBOutVal
+{
+ operator MDB_val&()
+ {
+ return d_mdbval;
+ }
+
+ template <class T,
+ typename std::enable_if<std::is_arithmetic<T>::value,
+ T>::type* = nullptr> const
+ T get()
+ {
+ T ret;
+ if(d_mdbval.mv_size != sizeof(T))
+ throw std::runtime_error("MDB data has wrong length for type");
+
+ memcpy(&ret, d_mdbval.mv_data, sizeof(T));
+ return ret;
+ }
+
+ template <class T,
+ typename std::enable_if<std::is_class<T>::value,T>::type* = nullptr>
+ T get() const;
+
+ template<class T>
+ T get_struct() const
+ {
+ T ret;
+ if(d_mdbval.mv_size != sizeof(T))
+ throw std::runtime_error("MDB data has wrong length for type");
+
+ memcpy(&ret, d_mdbval.mv_data, sizeof(T));
+ return ret;
+ }
+
+ template<class T>
+ const T* get_struct_ptr() const
+ {
+ if(d_mdbval.mv_size != sizeof(T))
+ throw std::runtime_error("MDB data has wrong length for type");
+
+ return reinterpret_cast<const T*>(d_mdbval.mv_data);
+ }
+
+
+ MDB_val d_mdbval;
+};
+
+template<> inline std::string MDBOutVal::get<std::string>() const
+{
+ return std::string((char*)d_mdbval.mv_data, d_mdbval.mv_size);
+}
+
+template<> inline string_view MDBOutVal::get<string_view>() const
+{
+ return string_view((char*)d_mdbval.mv_data, d_mdbval.mv_size);
+}
+
+class MDBInVal
+{
+public:
+ MDBInVal(const MDBOutVal& rhs): d_mdbval(rhs.d_mdbval)
+ {
+ }
+
+ template <class T,
+ typename std::enable_if<std::is_arithmetic<T>::value,
+ T>::type* = nullptr>
+ MDBInVal(T i)
+ {
+ memcpy(&d_memory[0], &i, sizeof(i));
+ d_mdbval.mv_size = sizeof(T);
+ d_mdbval.mv_data = d_memory;;
+ }
+
+ MDBInVal(const char* s)
+ {
+ d_mdbval.mv_size = strlen(s);
+ d_mdbval.mv_data = (void*)s;
+ }
+
+ MDBInVal(const string_view& v)
+ {
+ d_mdbval.mv_size = v.size();
+ d_mdbval.mv_data = (void*)&v[0];
+ }
+
+ MDBInVal(const std::string& v)
+ {
+ d_mdbval.mv_size = v.size();
+ d_mdbval.mv_data = (void*)&v[0];
+ }
+
+
+ template<typename T>
+ static MDBInVal fromStruct(const T& t)
+ {
+ MDBInVal ret;
+ ret.d_mdbval.mv_size = sizeof(T);
+ ret.d_mdbval.mv_data = (void*)&t;
+ return ret;
+ }
+
+ operator MDB_val&()
+ {
+ return d_mdbval;
+ }
+ MDB_val d_mdbval;
+private:
+ MDBInVal(){}
+ char d_memory[sizeof(double)];
+
+};
+
+
+
+
+class MDBROCursor;
+
+class MDBROTransactionImpl
+{
+protected:
+ MDBROTransactionImpl(MDBEnv *parent, MDB_txn *txn);
+
+private:
+ static MDB_txn *openROTransaction(MDBEnv *env, MDB_txn *parent, int flags=0);
+
+ MDBEnv* d_parent;
+ std::vector<MDBROCursor*> d_cursors;
+
+protected:
+ MDB_txn* d_txn;
+
+ void closeROCursors();
+
+public:
+ explicit MDBROTransactionImpl(MDBEnv* parent, int flags=0);
+
+ MDBROTransactionImpl(const MDBROTransactionImpl& src) = delete;
+ MDBROTransactionImpl &operator=(const MDBROTransactionImpl& src) = delete;
+
+ // The move constructor/operator cannot be made safe due to Object Slicing with MDBRWTransaction.
+ MDBROTransactionImpl(MDBROTransactionImpl&& rhs) = delete;
+ MDBROTransactionImpl &operator=(MDBROTransactionImpl &&rhs) = delete;
+
+ virtual ~MDBROTransactionImpl();
+
+ virtual void abort();
+ virtual void commit();
+
+ int get(MDB_dbi dbi, const MDBInVal& key, MDBOutVal& val)
+ {
+ if(!d_txn)
+ throw std::runtime_error("Attempt to use a closed RO transaction for get");
+
+ int rc = mdb_get(d_txn, dbi, const_cast<MDB_val*>(&key.d_mdbval),
+ const_cast<MDB_val*>(&val.d_mdbval));
+ if(rc && rc != MDB_NOTFOUND)
+ throw std::runtime_error("getting data: " + std::string(mdb_strerror(rc)));
+
+ return rc;
+ }
+
+ int get(MDB_dbi dbi, const MDBInVal& key, string_view& val)
+ {
+ MDBOutVal out;
+ int rc = get(dbi, key, out);
+ if(!rc)
+ val = out.get<string_view>();
+ return rc;
+ }
+
+
+ // this is something you can do, readonly
+ MDBDbi openDB(string_view dbname, int flags)
+ {
+ return MDBDbi( d_parent->d_env, d_txn, dbname, flags);
+ }
+
+ MDBROCursor getCursor(const MDBDbi&);
+ MDBROCursor getROCursor(const MDBDbi&);
+
+ operator MDB_txn*()
+ {
+ return d_txn;
+ }
+
+ inline operator bool() const {
+ return d_txn;
+ }
+
+ inline MDBEnv &environment()
+ {
+ return *d_parent;
+ }
+};
+
+/*
+ A cursor in a read-only transaction must be closed explicitly, before or after its transaction ends. It can be reused with mdb_cursor_renew() before finally closing it.
+
+ "If the parent transaction commits, the cursor must not be used again."
+*/
+
+template<class Transaction, class T>
+class MDBGenCursor
+{
+private:
+ std::vector<T*> *d_registry;
+ MDB_cursor* d_cursor{nullptr};
+
+public:
+ MDBGenCursor():
+ d_registry(nullptr),
+ d_cursor(nullptr)
+ {
+
+ }
+
+ MDBGenCursor(std::vector<T*> &registry, MDB_cursor *cursor):
+ d_registry(&registry),
+ d_cursor(cursor)
+ {
+ registry.emplace_back(static_cast<T*>(this));
+ }
+
+private:
+ void move_from(MDBGenCursor *src)
+ {
+ if (!d_registry) {
+ return;
+ }
+
+ auto iter = std::find(d_registry->begin(),
+ d_registry->end(),
+ src);
+ if (iter != d_registry->end()) {
+ *iter = static_cast<T*>(this);
+ } else {
+ d_registry->emplace_back(static_cast<T*>(this));
+ }
+ }
+
+public:
+ MDBGenCursor(const MDBGenCursor &src) = delete;
+
+ MDBGenCursor(MDBGenCursor &&src) noexcept:
+ d_registry(src.d_registry),
+ d_cursor(src.d_cursor)
+ {
+ move_from(&src);
+ src.d_registry = nullptr;
+ src.d_cursor = nullptr;
+ }
+
+ MDBGenCursor &operator=(const MDBGenCursor &src) = delete;
+
+ MDBGenCursor &operator=(MDBGenCursor &&src) noexcept
+ {
+ d_registry = src.d_registry;
+ d_cursor = src.d_cursor;
+ move_from(&src);
+ src.d_registry = nullptr;
+ src.d_cursor = nullptr;
+ return *this;
+ }
+
+ ~MDBGenCursor()
+ {
+ close();
+ }
+
+public:
+ int get(MDBOutVal& key, MDBOutVal& data, MDB_cursor_op op)
+ {
+ int rc = mdb_cursor_get(d_cursor, &key.d_mdbval, &data.d_mdbval, op);
+ if(rc && rc != MDB_NOTFOUND)
+ throw std::runtime_error("Unable to get from cursor: " + std::string(mdb_strerror(rc)));
+ return rc;
+ }
+
+ int find(const MDBInVal& in, MDBOutVal& key, MDBOutVal& data)
+ {
+ key.d_mdbval = in.d_mdbval;
+ int rc=mdb_cursor_get(d_cursor, const_cast<MDB_val*>(&key.d_mdbval), &data.d_mdbval, MDB_SET);
+ if(rc && rc != MDB_NOTFOUND)
+ throw std::runtime_error("Unable to find from cursor: " + std::string(mdb_strerror(rc)));
+ return rc;
+ }
+
+ int lower_bound(const MDBInVal& in, MDBOutVal& key, MDBOutVal& data)
+ {
+ key.d_mdbval = in.d_mdbval;
+
+ int rc = mdb_cursor_get(d_cursor, const_cast<MDB_val*>(&key.d_mdbval), &data.d_mdbval, MDB_SET_RANGE);
+ if(rc && rc != MDB_NOTFOUND)
+ throw std::runtime_error("Unable to lower_bound from cursor: " + std::string(mdb_strerror(rc)));
+ return rc;
+ }
+
+
+ int nextprev(MDBOutVal& key, MDBOutVal& data, MDB_cursor_op op)
+ {
+ int rc = mdb_cursor_get(d_cursor, const_cast<MDB_val*>(&key.d_mdbval), &data.d_mdbval, op);
+ if(rc && rc != MDB_NOTFOUND)
+ throw std::runtime_error("Unable to prevnext from cursor: " + std::string(mdb_strerror(rc)));
+ return rc;
+ }
+
+ int next(MDBOutVal& key, MDBOutVal& data)
+ {
+ return nextprev(key, data, MDB_NEXT);
+ }
+
+ int prev(MDBOutVal& key, MDBOutVal& data)
+ {
+ return nextprev(key, data, MDB_PREV);
+ }
+
+ int currentlast(MDBOutVal& key, MDBOutVal& data, MDB_cursor_op op)
+ {
+ int rc = mdb_cursor_get(d_cursor, const_cast<MDB_val*>(&key.d_mdbval), &data.d_mdbval, op);
+ if(rc && rc != MDB_NOTFOUND)
+ throw std::runtime_error("Unable to next from cursor: " + std::string(mdb_strerror(rc)));
+ return rc;
+ }
+
+ int current(MDBOutVal& key, MDBOutVal& data)
+ {
+ return currentlast(key, data, MDB_GET_CURRENT);
+ }
+ int last(MDBOutVal& key, MDBOutVal& data)
+ {
+ return currentlast(key, data, MDB_LAST);
+ }
+ int first(MDBOutVal& key, MDBOutVal& data)
+ {
+ return currentlast(key, data, MDB_FIRST);
+ }
+
+ operator MDB_cursor*()
+ {
+ return d_cursor;
+ }
+
+ operator bool() const
+ {
+ return d_cursor;
+ }
+
+ void close()
+ {
+ if (d_registry) {
+ auto iter = std::find(d_registry->begin(),
+ d_registry->end(),
+ static_cast<T*>(this));
+ if (iter != d_registry->end()) {
+ d_registry->erase(iter);
+ }
+ d_registry = nullptr;
+ }
+ if (d_cursor) {
+ mdb_cursor_close(d_cursor);
+ d_cursor = nullptr;
+ }
+ }
+};
+
+class MDBROCursor : public MDBGenCursor<MDBROTransactionImpl, MDBROCursor>
+{
+public:
+ MDBROCursor() = default;
+ using MDBGenCursor<MDBROTransactionImpl, MDBROCursor>::MDBGenCursor;
+ MDBROCursor(const MDBROCursor &src) = delete;
+ MDBROCursor(MDBROCursor &&src) = default;
+ MDBROCursor &operator=(const MDBROCursor &src) = delete;
+ MDBROCursor &operator=(MDBROCursor &&src) = default;
+ ~MDBROCursor() = default;
+
+};
+
+class MDBRWCursor;
+
+class MDBRWTransactionImpl: public MDBROTransactionImpl
+{
+protected:
+ MDBRWTransactionImpl(MDBEnv* parent, MDB_txn* txn);
+
+private:
+ static MDB_txn *openRWTransaction(MDBEnv* env, MDB_txn *parent, int flags);
+
+private:
+ std::vector<MDBRWCursor*> d_rw_cursors;
+
+ void closeRWCursors();
+ inline void closeRORWCursors() {
+ closeROCursors();
+ closeRWCursors();
+ }
+
+public:
+ explicit MDBRWTransactionImpl(MDBEnv* parent, int flags=0);
+
+ MDBRWTransactionImpl(const MDBRWTransactionImpl& rhs) = delete;
+ MDBRWTransactionImpl(MDBRWTransactionImpl&& rhs) = delete;
+ MDBRWTransactionImpl &operator=(const MDBRWTransactionImpl& rhs) = delete;
+ MDBRWTransactionImpl &operator=(MDBRWTransactionImpl&& rhs) = delete;
+
+ ~MDBRWTransactionImpl() override;
+
+ void commit() override;
+ void abort() override;
+
+ void clear(MDB_dbi dbi);
+
+ void put(MDB_dbi dbi, const MDBInVal& key, const MDBInVal& val, int flags=0)
+ {
+ if(!d_txn)
+ throw std::runtime_error("Attempt to use a closed RW transaction for put");
+ int rc;
+ if((rc=mdb_put(d_txn, dbi,
+ const_cast<MDB_val*>(&key.d_mdbval),
+ const_cast<MDB_val*>(&val.d_mdbval), flags)))
+ throw std::runtime_error("putting data: " + std::string(mdb_strerror(rc)));
+ }
+
+
+ int del(MDBDbi& dbi, const MDBInVal& key, const MDBInVal& val)
+ {
+ int rc;
+ rc=mdb_del(d_txn, dbi, (MDB_val*)&key.d_mdbval, (MDB_val*)&val.d_mdbval);
+ if(rc && rc != MDB_NOTFOUND)
+ throw std::runtime_error("deleting data: " + std::string(mdb_strerror(rc)));
+ return rc;
+ }
+
+ int del(MDBDbi& dbi, const MDBInVal& key)
+ {
+ int rc;
+ rc=mdb_del(d_txn, dbi, (MDB_val*)&key.d_mdbval, 0);
+ if(rc && rc != MDB_NOTFOUND)
+ throw std::runtime_error("deleting data: " + std::string(mdb_strerror(rc)));
+ return rc;
+ }
+
+
+ int get(MDBDbi& dbi, const MDBInVal& key, MDBOutVal& val)
+ {
+ if(!d_txn)
+ throw std::runtime_error("Attempt to use a closed RW transaction for get");
+
+ int rc = mdb_get(d_txn, dbi, const_cast<MDB_val*>(&key.d_mdbval),
+ const_cast<MDB_val*>(&val.d_mdbval));
+ if(rc && rc != MDB_NOTFOUND)
+ throw std::runtime_error("getting data: " + std::string(mdb_strerror(rc)));
+ return rc;
+ }
+
+ int get(MDBDbi& dbi, const MDBInVal& key, string_view& val)
+ {
+ MDBOutVal out;
+ int rc = get(dbi, key, out);
+ if(!rc)
+ val = out.get<string_view>();
+ return rc;
+ }
+
+ MDBDbi openDB(string_view dbname, int flags)
+ {
+ return MDBDbi(environment().d_env, d_txn, dbname, flags);
+ }
+
+ MDBRWCursor getRWCursor(const MDBDbi&);
+ MDBRWCursor getCursor(const MDBDbi&);
+
+ MDBRWTransaction getRWTransaction();
+ MDBROTransaction getROTransaction();
+};
+
+/* "A cursor in a write-transaction can be closed before its transaction ends, and will otherwise be closed when its transaction ends"
+ This is a problem for us since it may means we are closing the cursor twice, which is bad
+*/
+class MDBRWCursor : public MDBGenCursor<MDBRWTransactionImpl, MDBRWCursor>
+{
+public:
+ MDBRWCursor() = default;
+ using MDBGenCursor<MDBRWTransactionImpl, MDBRWCursor>::MDBGenCursor;
+ MDBRWCursor(const MDBRWCursor &src) = delete;
+ MDBRWCursor(MDBRWCursor &&src) = default;
+ MDBRWCursor &operator=(const MDBRWCursor &src) = delete;
+ MDBRWCursor &operator=(MDBRWCursor &&src) = default;
+ ~MDBRWCursor() = default;
+
+ void put(const MDBOutVal& key, const MDBInVal& data)
+ {
+ int rc = mdb_cursor_put(*this,
+ const_cast<MDB_val*>(&key.d_mdbval),
+ const_cast<MDB_val*>(&data.d_mdbval), MDB_CURRENT);
+ if(rc)
+ throw std::runtime_error("mdb_cursor_put: " + std::string(mdb_strerror(rc)));
+ }
+
+
+ int put(const MDBOutVal& key, const MDBOutVal& data, int flags=0)
+ {
+ // XXX check errors
+ return mdb_cursor_put(*this,
+ const_cast<MDB_val*>(&key.d_mdbval),
+ const_cast<MDB_val*>(&data.d_mdbval), flags);
+ }
+
+ int del(int flags=0)
+ {
+ return mdb_cursor_del(*this, flags);
+ }
+
+};
+
diff --git a/ext/luawrapper/include/LuaContext.hpp b/ext/luawrapper/include/LuaContext.hpp
new file mode 100644
index 0000000..e3a87ee
--- /dev/null
+++ b/ext/luawrapper/include/LuaContext.hpp
@@ -0,0 +1,3002 @@
+/*
+Copyright (c) 2013, Pierre KRIEGER
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the <organization> 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef INCLUDE_LUACONTEXT_HPP
+#define INCLUDE_LUACONTEXT_HPP
+
+#include <algorithm>
+#include <array>
+#include <cassert>
+#include <cmath>
+#include <cstring>
+#include <functional>
+#include <limits>
+#include <list>
+#include <map>
+#include <memory>
+#include <random>
+#include <set>
+#include <stdexcept>
+#include <string>
+#include <sstream>
+#include <tuple>
+#include <type_traits>
+#include <unordered_map>
+#include <boost/any.hpp>
+#include <boost/format.hpp>
+#include <boost/mpl/distance.hpp>
+#include <boost/mpl/transform.hpp>
+#include <boost/optional.hpp>
+#include <boost/variant.hpp>
+#include <boost/type_traits.hpp>
+#include <lua.hpp>
+
+#if defined(_MSC_VER) && _MSC_VER < 1900
+# include "misc/exception.hpp"
+#endif
+
+#ifdef __GNUC__
+# define ATTR_UNUSED __attribute__((unused))
+#else
+# define ATTR_UNUSED
+#endif
+
+#define LUACONTEXT_GLOBAL_EQ "e5ddced079fc405aa4937b386ca387d2"
+#define EQ_FUNCTION_NAME "__eq"
+#define TOSTRING_FUNCTION_NAME "__tostring"
+
+/**
+ * Defines a Lua context
+ * A Lua context is used to interpret Lua code. Since everything in Lua is a variable (including functions),
+ * we only provide few functions like readVariable and writeVariable.
+ *
+ * You can also write variables with C++ functions so that they are callable by Lua. Note however that you HAVE TO convert
+ * your function to std::function (not directly std::bind or a lambda function) so the class can detect which argument types
+ * it wants. These arguments may only be of basic types (int, float, etc.) or std::string.
+ */
+
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
+
+class LuaContext {
+ struct ValueInRegistry;
+ template<typename TFunctionObject, typename TFirstParamType> struct Binder;
+ template<typename T> struct IsOptional;
+ enum Globals_t { Globals }; // tag for "global variables"
+public:
+ /**
+ * @param openDefaultLibs True if luaL_openlibs should be called
+ */
+ explicit LuaContext(bool openDefaultLibs = true)
+ {
+ // luaL_newstate can return null if allocation failed
+ mState = luaL_newstate();
+ if (mState == nullptr)
+ throw std::bad_alloc();
+
+ // setting the panic function
+ lua_atpanic(mState, [](lua_State* state) -> int {
+ const std::string str = lua_tostring(state, -1);
+ lua_pop(state, 1);
+ assert(false && "lua_atpanic triggered");
+ exit(0);
+ });
+
+ // opening default library if required to do so
+ if (openDefaultLibs)
+ luaL_openlibs(mState);
+
+ writeGlobalEq();
+ }
+
+ void writeGlobalEq() {
+ const auto eqFunction = [](lua_State* lua) -> int {
+ try {
+ lua_pushstring(lua, "__eq");
+ lua_gettable(lua, -2);
+ /* if not found, return false */
+ if (lua_isnil(lua, -1)) {
+ lua_pop(lua, -2);
+ lua_pushboolean(lua, false);
+ return 1;
+ }
+ lua_insert(lua, lua_gettop(lua)-2);
+ return callRaw(lua, PushedObject{lua, 3}, 1).release();
+ } catch(...) {
+ Pusher<std::exception_ptr>::push(lua, std::current_exception()).release();
+ luaError(lua);
+ }
+ };
+ lua_pushcfunction(mState, eqFunction);
+ lua_setglobal(mState, LUACONTEXT_GLOBAL_EQ);
+ };
+
+ /**
+ * Move constructor
+ */
+ LuaContext(LuaContext&& s) :
+ mState(s.mState)
+ {
+ s.mState = luaL_newstate();
+ }
+
+ /**
+ * Move operator
+ */
+ LuaContext& operator=(LuaContext&& s) noexcept
+ {
+ std::swap(mState, s.mState);
+ return *this;
+ }
+
+ /**
+ * Copy is forbidden
+ */
+ LuaContext(const LuaContext&) = delete;
+
+ /**
+ * Copy is forbidden
+ */
+ LuaContext& operator=(const LuaContext&) = delete;
+
+ /**
+ * Destructor
+ */
+ ~LuaContext() noexcept
+ {
+ assert(mState);
+ lua_close(mState);
+ }
+
+ /**
+ * Thrown when an error happens during execution of lua code (like not enough parameters for a function)
+ */
+ class ExecutionErrorException : public std::runtime_error
+ {
+ public:
+ ExecutionErrorException(const std::string& msg) :
+ std::runtime_error(msg)
+ {
+ }
+ };
+
+ /**
+ * Thrown when a syntax error happens in a lua script
+ */
+ class SyntaxErrorException : public std::runtime_error
+ {
+ public:
+ SyntaxErrorException(const std::string& msg) :
+ std::runtime_error(msg)
+ {
+ }
+ };
+
+ /**
+ * Thrown when trying to cast a Lua variable to an unvalid type, eg. trying to read a number when the variable is a string
+ */
+ class WrongTypeException : public std::runtime_error
+ {
+ public:
+ WrongTypeException(const std::string& luaType_, const std::type_info& destination_) :
+ std::runtime_error("Trying to cast a lua variable from \"" + luaType_ + "\" to \"" + destination_.name() + "\""),
+ luaType(luaType_),
+ destination(destination_)
+ {
+ }
+
+ std::string luaType;
+ const std::type_info& destination;
+ };
+
+ /**
+ * Function object that can call a function stored by Lua
+ * This type is copiable and movable, but not constructible. It can only be created through readVariable.
+ * @tparam TFunctionType Function type (eg. "int (int, bool)")
+ */
+ template<typename TFunctionType>
+ class LuaFunctionCaller;
+
+ /**
+ * Opaque type that identifies a Lua object
+ */
+ struct LuaObject {
+ LuaObject() = default;
+ LuaObject(lua_State* state, int index=-1) {
+ this->objectInRegistry = std::make_shared<LuaContext::ValueInRegistry>(state, index);
+ }
+ std::shared_ptr<LuaContext::ValueInRegistry> objectInRegistry;
+ };
+
+ /**
+ * Opaque type that identifies a Lua thread
+ */
+ struct ThreadID {
+ ThreadID() = default;
+ ThreadID(ThreadID&& o) : state(o.state), threadInRegistry(std::move(o.threadInRegistry)) { }
+ ThreadID& operator=(ThreadID&& o) { std::swap(state, o.state); std::swap(threadInRegistry, o.threadInRegistry); return *this; }
+ public:
+ friend LuaContext;
+ lua_State* state;
+ std::unique_ptr<ValueInRegistry> threadInRegistry;
+ };
+
+ /**
+ * Type that is considered as an empty array
+ */
+ enum EmptyArray_t { EmptyArray };
+
+ /**
+ * Type for a metatable
+ */
+ enum Metatable_t { Metatable };
+
+ /**
+ * Executes lua code from the stream
+ * @param code A stream that Lua will read its code from
+ */
+ void executeCode(std::istream& code)
+ {
+ auto toCall = load(mState, code);
+ call<std::tuple<>>(mState, std::move(toCall));
+ }
+
+ /**
+ * Executes lua code from the stream and returns a value
+ * @param code A stream that Lua will read its code from
+ * @tparam TType The type that the executing code should return
+ */
+ template<typename TType>
+ auto executeCode(std::istream& code)
+ -> TType
+ {
+ auto toCall = load(mState, code);
+ return call<TType>(mState, std::move(toCall));
+ }
+
+ /**
+ * Executes lua code given as parameter
+ * @param code A string containing code that will be executed by Lua
+ */
+ void executeCode(const std::string& code)
+ {
+ executeCode(code.c_str());
+ }
+
+ /*
+ * Executes Lua code from the stream and returns a value
+ * @param code A string containing code that will be executed by Lua
+ * @tparam TType The type that the executing code should return
+ */
+ template<typename TType>
+ auto executeCode(const std::string& code)
+ -> TType
+ {
+ return executeCode<TType>(code.c_str());
+ }
+
+ /**
+ * Executes Lua code
+ * @param code A string containing code that will be executed by Lua
+ */
+ void executeCode(const char* code)
+ {
+ auto toCall = load(mState, code);
+ call<std::tuple<>>(mState, std::move(toCall));
+ }
+
+ /*
+ * Executes Lua code from the stream and returns a value
+ * @param code A string containing code that will be executed by Lua
+ * @tparam TType The type that the executing code should return
+ */
+ template<typename TType>
+ auto executeCode(const char* code)
+ -> TType
+ {
+ auto toCall = load(mState, code);
+ return call<TType>(mState, std::move(toCall));
+ }
+
+ /**
+ * Executes lua code from the stream
+ * @param code A stream that Lua will read its code from
+ */
+ void executeCode(const ThreadID& thread, std::istream& code)
+ {
+ auto toCall = load(thread.state, code);
+ call<std::tuple<>>(thread.state, std::move(toCall));
+ }
+
+ /**
+ * Executes lua code from the stream and returns a value
+ * @param code A stream that Lua will read its code from
+ * @tparam TType The type that the executing code should return
+ */
+ template<typename TType>
+ auto executeCode(const ThreadID& thread, std::istream& code)
+ -> TType
+ {
+ auto toCall = load(thread.state, code);
+ return call<TType>(thread.state, std::move(toCall));
+ }
+
+ /**
+ * Executes lua code given as parameter
+ * @param code A string containing code that will be executed by Lua
+ */
+ void executeCode(const ThreadID& thread, const std::string& code)
+ {
+ executeCode(thread, code.c_str());
+ }
+
+ /*
+ * Executes Lua code from the stream and returns a value
+ * @param code A string containing code that will be executed by Lua
+ * @tparam TType The type that the executing code should return
+ */
+ template<typename TType>
+ auto executeCode(const ThreadID& thread, const std::string& code)
+ -> TType
+ {
+ return executeCode<TType>(thread, code.c_str());
+ }
+
+ /**
+ * Executes Lua code
+ * @param code A string containing code that will be executed by Lua
+ */
+ void executeCode(const ThreadID& thread, const char* code)
+ {
+ auto toCall = load(thread.state, code);
+ call<std::tuple<>>(thread.state, std::move(toCall));
+ }
+
+ /*
+ * Executes Lua code from the stream and returns a value
+ * @param code A string containing code that will be executed by Lua
+ * @tparam TType The type that the executing code should return
+ */
+ template<typename TType>
+ auto executeCode(const ThreadID& thread, const char* code)
+ -> TType
+ {
+ auto toCall = load(thread.state, code);
+ return call<TType>(thread.state, std::move(toCall));
+ }
+
+ /**
+ * Tells that Lua will be allowed to access an object's function
+ * This is the version "registerFunction(name, &Foo::function)"
+ */
+ template<typename TPointerToMemberFunction>
+ auto registerFunction(const std::string& name, TPointerToMemberFunction pointer)
+ -> typename std::enable_if<std::is_member_function_pointer<TPointerToMemberFunction>::value>::type
+ {
+ registerFunctionImpl(name, std::mem_fn(pointer), tag<TPointerToMemberFunction>{});
+ }
+
+ /**
+ * Tells that Lua will be allowed to access an object's function
+ * This is the version with an explicit template parameter: "registerFunction<void (Foo::*)()>(name, [](Foo&) { })"
+ * @param fn Function object which takes as first parameter a reference to the object
+ * @tparam TFunctionType Pointer-to-member function type
+ */
+ template<typename TFunctionType, typename TType>
+ void registerFunction(const std::string& functionName, TType fn)
+ {
+ static_assert(std::is_member_function_pointer<TFunctionType>::value, "registerFunction must take a member function pointer type as template parameter");
+ registerFunctionImpl(functionName, std::move(fn), tag<TFunctionType>{});
+ }
+
+ /**
+ * Tells that Lua will be allowed to access an object's function
+ * This is the alternative version with an explicit template parameter: "registerFunction<Foo, void (*)()>(name, [](Foo&) { })"
+ * @param fn Function object which takes as first parameter a reference to the object
+ * @tparam TObject Object to register this function to
+ * @tparam TFunctionType Function type
+ */
+ template<typename TObject, typename TFunctionType, typename TType>
+ void registerFunction(const std::string& functionName, TType fn)
+ {
+ static_assert(std::is_function<TFunctionType>::value, "registerFunction must take a function type as template parameter");
+ registerFunctionImpl(functionName, std::move(fn), tag<TObject>{}, tag<TFunctionType>{});
+ }
+
+ /**
+ * Wrappers for registering "__eq" function in case we want to change this to something else some day
+ */
+
+ template<typename TPointerToMemberFunction>
+ auto registerEqFunction(TPointerToMemberFunction pointer)
+ -> typename std::enable_if<std::is_member_function_pointer<TPointerToMemberFunction>::value>::type
+ {
+ registerFunctionImpl(EQ_FUNCTION_NAME, std::mem_fn(pointer), tag<TPointerToMemberFunction>{});
+ }
+
+ template<typename TFunctionType, typename TType>
+ void registerEqFunction(TType fn)
+ {
+ static_assert(std::is_member_function_pointer<TFunctionType>::value, "registerFunction must take a member function pointer type as template parameter");
+ registerFunctionImpl(EQ_FUNCTION_NAME, std::move(fn), tag<TFunctionType>{});
+ }
+
+ template<typename TObject, typename TFunctionType, typename TType>
+ void registerEqFunction(TType fn)
+ {
+ static_assert(std::is_function<TFunctionType>::value, "registerFunction must take a function type as template parameter");
+ registerFunctionImpl(EQ_FUNCTION_NAME, std::move(fn), tag<TObject>{}, tag<TFunctionType>{});
+ }
+
+ /**
+ * Wrappers for registering "__tostring" function in case we want to change this to something else some day
+ */
+
+ template<typename TPointerToMemberFunction>
+ auto registerToStringFunction(TPointerToMemberFunction pointer)
+ -> typename std::enable_if<std::is_member_function_pointer<TPointerToMemberFunction>::value>::type
+ {
+ registerFunctionImpl(TOSTRING_FUNCTION_NAME, std::mem_fn(pointer), tag<TPointerToMemberFunction>{});
+ }
+
+ template<typename TFunctionType, typename TType>
+ void registerToStringFunction(TType fn)
+ {
+ static_assert(std::is_member_function_pointer<TFunctionType>::value, "registerFunction must take a member function pointer type as template parameter");
+ registerFunctionImpl(TOSTRING_FUNCTION_NAME, std::move(fn), tag<TFunctionType>{});
+ }
+
+ template<typename TObject, typename TFunctionType, typename TType>
+ void registerToStringFunction(TType fn)
+ {
+ static_assert(std::is_function<TFunctionType>::value, "registerFunction must take a function type as template parameter");
+ registerFunctionImpl(TOSTRING_FUNCTION_NAME, std::move(fn), tag<TObject>{}, tag<TFunctionType>{});
+ }
+
+ /**
+ * Inverse operation of registerFunction
+ * @tparam TType Type whose function belongs to
+ */
+ template<typename TType>
+ void unregisterFunction(const std::string& /*functionName*/)
+ {
+ lua_pushlightuserdata(mState, const_cast<std::type_info*>(&typeid(TType)));
+ lua_pushnil(mState);
+ lua_settable(mState, LUA_REGISTRYINDEX);
+ checkTypeRegistration(mState, &typeid(TType));
+
+ lua_pushlightuserdata(mState, const_cast<std::type_info*>(&typeid(TType*)));
+ lua_pushnil(mState);
+ lua_settable(mState, LUA_REGISTRYINDEX);
+ checkTypeRegistration(mState, &typeid(TType*));
+
+ lua_pushlightuserdata(mState, const_cast<std::type_info*>(&typeid(std::shared_ptr<TType>)));
+ lua_pushnil(mState);
+ lua_settable(mState, LUA_REGISTRYINDEX);
+ checkTypeRegistration(mState, &typeid(std::shared_ptr<TType>));
+ }
+
+ /**
+ * Registers a member variable
+ * This is the version "registerMember(name, &Foo::member)"
+ */
+ template<typename TObject, typename TVarType>
+ void registerMember(const std::string& name, TVarType TObject::*member)
+ {
+ // implementation simply calls the custom member with getter and setter
+ const auto getter = [=](const TObject& obj) -> TVarType { return obj.*member; };
+ const auto setter = [=](TObject& obj, const TVarType& value) { obj.*member = value; };
+ registerMember<TVarType (TObject::*)>(name, getter, setter);
+ }
+
+ /**
+ * Registers a member variable
+ * This is the version "registerMember<Foo, int>(name, getter, setter)"
+ * @tparam TObject Type to register the member to
+ * @tparam TVarType Type of the member
+ * @param name Name of the member to register
+ * @param readFunction Function of type "TVarType (const TObject&)"
+ * @param writeFunction_ Function of type "void (TObject&, const TVarType&)"
+ */
+ template<typename TObject, typename TVarType, typename TReadFunction, typename TWriteFunction>
+ void registerMember(const std::string& name, TReadFunction readFunction, TWriteFunction writeFunction_)
+ {
+ registerMemberImpl<TObject,TVarType>(name, std::move(readFunction), std::move(writeFunction_));
+ }
+
+ /**
+ * Registers a member variable
+ * This is the version "registerMember<int (Foo::*)>(name, getter, setter)"
+ * @tparam TMemberType Pointer to member object representing the type
+ * @param name Name of the member to register
+ * @param readFunction Function of type "TVarType (const TObject&)"
+ * @param writeFunction_ Function of type "void (TObject&, const TVarType&)"
+ */
+ template<typename TMemberType, typename TReadFunction, typename TWriteFunction>
+ void registerMember(const std::string& name, TReadFunction readFunction, TWriteFunction writeFunction_)
+ {
+ static_assert(std::is_member_object_pointer<TMemberType>::value, "registerMember must take a member object pointer type as template parameter");
+ registerMemberImpl(tag<TMemberType>{}, name, std::move(readFunction), std::move(writeFunction_));
+ }
+
+ /**
+ * Registers a non-modifiable member variable
+ * This is the version "registerMember<Foo, int>(name, getter)"
+ * @tparam TObject Type to register the member to
+ * @tparam TVarType Type of the member
+ * @param name Name of the member to register
+ * @param readFunction Function of type "TVarType (const TObject&)"
+ */
+ template<typename TObject, typename TVarType, typename TReadFunction>
+ void registerMember(const std::string& name, TReadFunction readFunction)
+ {
+ registerMemberImpl<TObject,TVarType>(name, std::move(readFunction));
+ }
+
+ /**
+ * Registers a non-modifiable member variable
+ * This is the version "registerMember<int (Foo::*)>(name, getter)"
+ * @tparam TMemberType Pointer to member object representing the type
+ * @param name Name of the member to register
+ * @param readFunction Function of type "TVarType (const TObject&)"
+ */
+ template<typename TMemberType, typename TReadFunction>
+ void registerMember(const std::string& name, TReadFunction readFunction)
+ {
+ static_assert(std::is_member_object_pointer<TMemberType>::value, "registerMember must take a member object pointer type as template parameter");
+ registerMemberImpl(tag<TMemberType>{}, name, std::move(readFunction));
+ }
+
+ /**
+ * Registers a dynamic member variable
+ * This is the version "registerMember<Foo, int>(getter, setter)"
+ * @tparam TObject Type to register the member to
+ * @tparam TVarType Type of the member
+ * @param readFunction Function of type "TVarType (const TObject&, const std::string&)"
+ * @param writeFunction_ Function of type "void (TObject&, const std::string&, const TVarType&)"
+ */
+ template<typename TObject, typename TVarType, typename TReadFunction, typename TWriteFunction>
+ void registerMember(TReadFunction readFunction, TWriteFunction writeFunction_)
+ {
+ registerMemberImpl<TObject,TVarType>(std::move(readFunction), std::move(writeFunction_));
+ }
+
+ /**
+ * Registers a dynamic member variable
+ * This is the version "registerMember<int (Foo::*)>(getter, setter)"
+ * @tparam TMemberType Pointer to member object representing the type
+ * @param readFunction Function of type "TVarType (const TObject&, const std::string&)"
+ * @param writeFunction_ Function of type "void (TObject&, const std::string&, const TVarType&)"
+ */
+ template<typename TMemberType, typename TReadFunction, typename TWriteFunction>
+ void registerMember(TReadFunction readFunction, TWriteFunction writeFunction_)
+ {
+ static_assert(std::is_member_object_pointer<TMemberType>::value, "registerMember must take a member object pointer type as template parameter");
+ registerMemberImpl(tag<TMemberType>{}, std::move(readFunction), std::move(writeFunction_));
+ }
+
+ /**
+ * Registers a dynamic non-modifiable member variable
+ * This is the version "registerMember<Foo, int>(getter)"
+ * @tparam TObject Type to register the member to
+ * @tparam TVarType Type of the member
+ * @param readFunction Function of type "TVarType (const TObject&, const std::string&)"
+ */
+ template<typename TObject, typename TVarType, typename TReadFunction>
+ void registerMember(TReadFunction readFunction)
+ {
+ registerMemberImpl<TObject, TVarType>(std::move(readFunction));
+ }
+
+ /**
+ * Registers a dynamic non-modifiable member variable
+ * This is the version "registerMember<int (Foo::*)>(getter)"
+ * @tparam TMemberType Pointer to member object representing the type
+ * @param readFunction Function of type "TVarType (const TObject&, const std::string&)"
+ */
+ template<typename TMemberType, typename TReadFunction>
+ void registerMember(TReadFunction readFunction)
+ {
+ static_assert(std::is_member_object_pointer<TMemberType>::value, "registerMember must take a member object pointer type as template parameter");
+ registerMemberImpl(tag<TMemberType>{}, std::move(readFunction));
+ }
+
+ /**
+ * Creates a new thread
+ * A Lua thread is not really a thread, but rather an "execution stack".
+ * You can destroy the thread by calling destroyThread
+ * @sa destroyThread
+ */
+ auto createThread()
+ -> ThreadID
+ {
+ ThreadID result;
+
+ result.state = lua_newthread(mState);
+ result.threadInRegistry = std::unique_ptr<ValueInRegistry>(new ValueInRegistry(mState));
+ lua_pop(mState, 1);
+
+ return result;
+ }
+
+ /**
+ * Destroys a thread created with createThread
+ * @sa createThread
+ */
+ void destroyThread(ThreadID& id)
+ {
+ id.threadInRegistry.reset();
+ }
+
+ /**
+ * Reads the content of a Lua variable
+ *
+ * @tparam TType Type requested for the read
+ * @throw WrongTypeException When the variable is not convertible to the requested type
+ * @sa writeVariable
+ *
+ * Readable types are all types accepted by writeVariable except nullptr, std::unique_ptr and function pointers
+ * Additionally supported:
+ * - LuaFunctionCaller<FunctionType>, which is an alternative to std::function
+ * - references to custom objects, in which case it will return the object in-place
+ *
+ * After the variable name, you can add other parameters.
+ * If the variable is an array, it will instead get the element of that array whose offset is the second parameter.
+ * Same applies for third, fourth, etc. parameters.
+ */
+ template<typename TType, typename... TTypes>
+ TType readVariable(const std::string& name, TTypes&&... elements) const
+ {
+ lua_getglobal(mState, name.c_str());
+ lookIntoStackTop(mState, std::forward<TTypes>(elements)...);
+ return readTopAndPop<TType>(mState, PushedObject{mState, 1});
+ }
+
+ /**
+ * @sa readVariable
+ */
+ template<typename TType, typename... TTypes>
+ TType readVariable(const char* name, TTypes&&... elements) const
+ {
+ lua_getglobal(mState, name);
+ lookIntoStackTop(mState, std::forward<TTypes>(elements)...);
+ return readTopAndPop<TType>(mState, PushedObject{mState, 1});
+ }
+
+ /**
+ * @sa readVariable
+ */
+ template<typename TType, typename... TTypes>
+ TType readVariable(const ThreadID& thread, const std::string& name, TTypes&&... elements) const
+ {
+ lua_getglobal(thread.state, name.c_str());
+ lookIntoStackTop(thread.state, std::forward<TTypes>(elements)...);
+ return readTopAndPop<TType>(thread.state, PushedObject{thread.state, 1});
+ }
+
+ /**
+ * @sa readVariable
+ */
+ template<typename TType, typename... TTypes>
+ TType readVariable(const ThreadID& thread, const char* name, TTypes&&... elements) const
+ {
+ lua_getglobal(thread.state, name);
+ lookIntoStackTop(thread.state, std::forward<TTypes>(elements)...);
+ return readTopAndPop<TType>(thread.state, PushedObject{thread.state, 1});
+ }
+
+ /**
+ * Changes the content of a Lua variable
+ *
+ * Accepted values are:
+ * - all base types (char, short, int, float, double, bool)
+ * - std::string
+ * - enums
+ * - std::vector<>
+ * - std::vector<std::pair<>>, std::map<> and std::unordered_map<> (the key and value must also be accepted values)
+ * - std::function<> (all parameters must be accepted values, and return type must be either an accepted value for readVariable or a tuple)
+ * - std::shared_ptr<> (std::unique_ptr<> are converted to std::shared_ptr<>)
+ * - nullptr (writes nil)
+ * - any object
+ *
+ * All objects are passed by copy and destroyed by the garbage collector if necessary.
+ */
+ template<typename... TData>
+ void writeVariable(TData&&... data) noexcept {
+ static_assert(sizeof...(TData) >= 2, "You must pass at least a variable name and a value to writeVariable");
+ typedef typename std::decay<typename std::tuple_element<sizeof...(TData) - 1,std::tuple<TData...>>::type>::type
+ RealDataType;
+ static_assert(!std::is_same<typename Tupleizer<RealDataType>::type,RealDataType>::value, "Error: you can't use LuaContext::writeVariable with a tuple");
+
+ setTable<RealDataType>(mState, Globals, std::forward<TData>(data)...);
+ }
+
+ /**
+ * Equivalent to writeVariable(varName, ..., std::function<TFunctionType>(data));
+ * This version is more efficient than writeVariable if you want to write functions
+ */
+ template<typename TFunctionType, typename... TData>
+ void writeFunction(TData&&... data) noexcept {
+ static_assert(sizeof...(TData) >= 2, "You must pass at least a variable name and a value to writeFunction");
+
+ setTable<TFunctionType>(mState, Globals, std::forward<TData>(data)...);
+ }
+
+ /**
+ * Same as the other writeFunction, except that the template parameter is automatically detected
+ * This only works if the data is either a native function pointer, or contains one operator() (this is the case for lambdas)
+ */
+ template<typename... TData>
+ void writeFunction(TData&&... data) noexcept {
+ static_assert(sizeof...(TData) >= 2, "You must pass at least a variable name and a value to writeFunction");
+ typedef typename std::decay<typename std::tuple_element<sizeof...(TData) - 1,std::tuple<TData...>>::type>::type
+ RealDataType;
+ typedef typename FunctionTypeDetector<RealDataType>::type
+ DetectedFunctionType;
+
+ return writeFunction<DetectedFunctionType>(std::forward<TData>(data)...);
+ }
+
+
+private:
+ // the state is the most important variable in the class since it is our interface with Lua
+ // - registered members and functions are stored in tables at offset &typeid(type) of the registry
+ // each table has its getter functions at offset 0, getter members at offset 1, default getter at offset 2
+ // offset 3 is unused, setter members at offset 4, default setter at offset 5
+ lua_State* mState;
+
+
+ /**************************************************/
+ /* PUSH OBJECT */
+ /**************************************************/
+ struct PushedObject {
+ PushedObject(lua_State* state_, int num_ = 1) : state(state_), num(num_) {}
+ ~PushedObject() { assert(lua_gettop(state) >= num); if (num >= 1) lua_pop(state, num); }
+
+ PushedObject& operator=(const PushedObject&) = delete;
+ PushedObject(const PushedObject&) = delete;
+ PushedObject& operator=(PushedObject&& other) { std::swap(state, other.state); std::swap(num, other.num); return *this; }
+ PushedObject(PushedObject&& other) : state(other.state), num(other.num) { other.num = 0; }
+
+ PushedObject operator+(PushedObject&& other) && { PushedObject obj(state, num + other.num); num = 0; other.num = 0; return obj; }
+ void operator+=(PushedObject&& other) { assert(state == other.state); num += other.num; other.num = 0; }
+
+ auto getState() const -> lua_State* { return state; }
+ auto getNum() const -> int { return num; }
+
+ int release() { const auto n = num; num = 0; return n; }
+ void pop() { if (num >= 1) lua_pop(state, num); num = 0; }
+ void pop(int n) { assert(num >= n); lua_pop(state, n); num -= n; }
+
+ private:
+ lua_State* state;
+ int num = 0;
+ };
+
+
+ /**************************************************/
+ /* MISC */
+ /**************************************************/
+ // type used as a tag
+ template<typename T>
+ struct tag {};
+
+ // tag for "the registry"
+ enum RegistryTag { Registry };
+
+ // this function takes a value representing the offset to look into
+ // it will look into the top element of the stack and replace the element by its content at the given index
+ template<typename OffsetType1, typename... OffsetTypeOthers>
+ static void lookIntoStackTop(lua_State* state, OffsetType1&& offset1, OffsetTypeOthers&&... offsetOthers) {
+ static_assert(Pusher<typename std::decay<OffsetType1>::type>::minSize == 1 && Pusher<typename std::decay<OffsetType1>::type>::maxSize == 1, "Impossible to have a multiple-values index");
+ auto p1 = Pusher<typename std::decay<OffsetType1>::type>::push(state, offset1);
+ lua_gettable(state, -2);
+ lua_remove(state, -2);
+ p1.release();
+
+ lookIntoStackTop(state, std::forward<OffsetTypeOthers>(offsetOthers)...);
+ }
+
+ template<typename... OffsetTypeOthers>
+ static void lookIntoStackTop(lua_State* state, Metatable_t, OffsetTypeOthers&&... offsetOthers) {
+ lua_getmetatable(state, -1);
+ lua_remove(state, -2);
+
+ lookIntoStackTop(state, std::forward<OffsetTypeOthers>(offsetOthers)...);
+ }
+
+ static void lookIntoStackTop(lua_State*) {
+ }
+
+ // equivalent of lua_settable with t[k]=n, where t is the value at the index in the template parameter, k is the second parameter, n is the last parameter, and n is pushed by the function in the first parameter
+ // if there are more than 3 parameters, parameters 3 to n-1 are considered as sub-indices into the array
+ // the dataPusher MUST push only one thing on the stack
+ // TTableIndex must be either LUA_REGISTRYINDEX, LUA_GLOBALSINDEX, LUA_ENVINDEX, or the position of the element on the stack
+ template<typename TDataType, typename TIndex, typename TData>
+ static void setTable(lua_State* state, const PushedObject&, TIndex&& index, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TIndex>::type>::minSize == 1 && Pusher<typename std::decay<TIndex>::type>::maxSize == 1, "Impossible to have a multiple-values index");
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+ auto p1 = Pusher<typename std::decay<TIndex>::type>::push(state, index);
+ auto p2 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+
+ lua_settable(state, -3);
+ p1.release();
+ p2.release();
+ }
+
+ template<typename TDataType, typename TData>
+ static void setTable(lua_State* state, const PushedObject&, const std::string& index, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+ auto p1 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+ lua_setfield(state, -2, index.c_str());
+ p1.release();
+ }
+
+ template<typename TDataType, typename TData>
+ static void setTable(lua_State* state, const PushedObject&, const char* index, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+ auto p1 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+ lua_setfield(state, -2, index);
+ p1.release();
+ }
+
+ template<typename TDataType, typename TData>
+ static void setTable(lua_State* state, const PushedObject&, Metatable_t, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+ auto p1 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+ lua_setmetatable(state, -2);
+ p1.release();
+ }
+
+ template<typename TDataType, typename TIndex1, typename TIndex2, typename TIndex3, typename... TIndices>
+ static auto setTable(lua_State* state, PushedObject&, TIndex1&& index1, TIndex2&& index2, TIndex3&& index3, TIndices&&... indices) noexcept
+ -> typename std::enable_if<!std::is_same<typename std::decay<TIndex1>::type, Metatable_t>::value>::type
+ {
+ static_assert(Pusher<typename std::decay<TIndex1>::type>::minSize == 1 && Pusher<typename std::decay<TIndex1>::type>::maxSize == 1, "Impossible to have a multiple-values index");
+
+ auto p1 = Pusher<typename std::decay<TIndex1>::type>::push(state, std::forward<TIndex1>(index1));
+ lua_gettable(state, -2);
+
+ setTable<TDataType>(state, std::move(p1), std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+ }
+
+ template<typename TDataType, typename TIndex1, typename TIndex2, typename TIndex3, typename... TIndices>
+ static auto setTable(lua_State* state, PushedObject&& pushedTable, TIndex1&& index1, TIndex2&& index2, TIndex3&& index3, TIndices&&... indices) noexcept
+ -> typename std::enable_if<!std::is_same<typename std::decay<TIndex1>::type, Metatable_t>::value>::type
+ {
+ static_assert(Pusher<typename std::decay<TIndex1>::type>::minSize == 1 && Pusher<typename std::decay<TIndex1>::type>::maxSize == 1, "Impossible to have a multiple-values index");
+
+ auto p1 = Pusher<typename std::decay<TIndex1>::type>::push(state, std::forward<TIndex1>(index1)) + std::move(pushedTable);
+ lua_gettable(state, -2);
+
+ setTable<TDataType>(state, std::move(p1), std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+ }
+
+ template<typename TDataType, typename TIndex2, typename TIndex3, typename... TIndices>
+ static void setTable(lua_State* state, PushedObject& pushedObject, Metatable_t, TIndex2&& index2, TIndex3&& index3, TIndices&&... indices) noexcept
+ {
+ if (lua_getmetatable(state, -1) == 0)
+ {
+ lua_newtable(state);
+ PushedObject p1{state, 1};
+
+ setTable<TDataType>(state, p1, std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+
+ lua_setmetatable(state, -2);
+ p1.release();
+ }
+ else
+ {
+ setTable<TDataType>(state, pushedObject, std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+ }
+ }
+
+ template<typename TDataType, typename TIndex2, typename TIndex3, typename... TIndices>
+ static void setTable(lua_State* state, PushedObject&& pushedObject, Metatable_t, TIndex2&& index2, TIndex3&& index3, TIndices&&... indices) noexcept
+ {
+ if (lua_getmetatable(state, -1) == 0)
+ {
+ lua_newtable(state);
+ PushedObject p1{state, 1};
+
+ setTable<TDataType>(state, p1, std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+
+ lua_setmetatable(state, -2);
+ p1.release();
+ }
+ else
+ {
+ setTable<TDataType>(state, std::move(pushedObject), std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+ }
+ }
+
+ template<typename TDataType, typename TIndex, typename TData>
+ static void setTable(lua_State* state, RegistryTag, TIndex&& index, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TIndex>::type>::minSize == 1 && Pusher<typename std::decay<TIndex>::type>::maxSize == 1, "Impossible to have a multiple-values index");
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+ auto p1 = Pusher<typename std::decay<TIndex>::type>::push(state, index);
+ auto p2 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+
+ lua_settable(state, LUA_REGISTRYINDEX);
+ p1.release();
+ p2.release();
+ }
+
+ template<typename TDataType, typename TData>
+ static void setTable(lua_State* state, RegistryTag, const std::string& index, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+ auto p1 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+ lua_setfield(state, LUA_REGISTRYINDEX, index.c_str());
+ p1.release();
+ }
+
+ template<typename TDataType, typename TData>
+ static void setTable(lua_State* state, RegistryTag, const char* index, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+ auto p1 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+ lua_setfield(state, LUA_REGISTRYINDEX, index);
+ p1.release();
+ }
+
+ template<typename TDataType, typename TIndex1, typename TIndex2, typename TIndex3, typename... TIndices>
+ static void setTable(lua_State* state, RegistryTag, TIndex1&& index1, TIndex2&& index2, TIndex3&& index3, TIndices&&... indices) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TIndex1>::type>::minSize == 1 && Pusher<typename std::decay<TIndex1>::type>::maxSize == 1, "Impossible to have a multiple-values index");
+
+ auto p1 = Pusher<typename std::decay<TIndex1>::type>::push(state, std::forward<TIndex1>(index1));
+ lua_gettable(state, LUA_REGISTRYINDEX);
+
+ setTable<TDataType>(state, std::move(p1), std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+ }
+
+ template<typename TDataType, typename TIndex, typename TData>
+ static void setTable(lua_State* state, Globals_t, TIndex&& index, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TIndex>::type>::minSize == 1 && Pusher<typename std::decay<TIndex>::type>::maxSize == 1, "Impossible to have a multiple-values index");
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+
+# if LUA_VERSION_NUM >= 502
+
+ lua_pushglobaltable(state);
+ PushedObject p3{state, 1};
+ auto p1 = Pusher<typename std::decay<TIndex>::type>::push(state, index);
+ auto p2 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+ lua_settable(state, -3);
+
+# else
+
+ auto p1 = Pusher<typename std::decay<TIndex>::type>::push(state, index);
+ auto p2 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+ lua_settable(state, LUA_GLOBALSINDEX);
+
+# endif
+
+ p1.release();
+ p2.release();
+ }
+
+ template<typename TDataType, typename TData>
+ static void setTable(lua_State* state, Globals_t, const std::string& index, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+ auto p1 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+ lua_setglobal(state, index.c_str());
+ p1.release();
+ }
+
+ template<typename TDataType, typename TData>
+ static void setTable(lua_State* state, Globals_t, const char* index, TData&& data) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TDataType>::type>::minSize == 1 && Pusher<typename std::decay<TDataType>::type>::maxSize == 1, "Impossible to have a multiple-values data");
+
+ auto p1 = Pusher<typename std::decay<TDataType>::type>::push(state, std::forward<TData>(data));
+ lua_setglobal(state, index);
+ p1.release();
+ }
+
+ template<typename TDataType, typename TIndex1, typename TIndex2, typename TIndex3, typename... TIndices>
+ static void setTable(lua_State* state, Globals_t, TIndex1&& index1, TIndex2&& index2, TIndex3&& index3, TIndices&&... indices) noexcept
+ {
+ static_assert(Pusher<typename std::decay<TIndex1>::type>::minSize == 1 && Pusher<typename std::decay<TIndex1>::type>::maxSize == 1, "Impossible to have a multiple-values index");
+
+# if LUA_VERSION_NUM >= 502
+
+ lua_pushglobaltable(state);
+ auto p1 = Pusher<typename std::decay<TIndex1>::type>::push(state, std::forward<TIndex1>(index1)) + PushedObject{state, 1};
+ lua_gettable(state, -2);
+
+# else
+
+ auto p1 = Pusher<typename std::decay<TIndex1>::type>::push(state, std::forward<TIndex1>(index1));
+ lua_gettable(state, LUA_GLOBALSINDEX);
+
+# endif
+
+ setTable<TDataType>(state, std::move(p1), std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+ }
+
+ // TODO: g++ reports "ambiguous overload"
+ /*template<typename TDataType, typename TIndex2, typename TIndex3, typename... TIndices>
+ static void setTable(lua_State* state, Globals_t, const char* index, TIndex2&& index2, TIndex3&& index3, TIndices&&... indices) noexcept
+ {
+ lua_getglobal(state, index);
+ PushedObject p1{state, 1};
+
+ setTable<TDataType>(state, std::move(p1), std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+ }
+
+ template<typename TDataType, typename TIndex2, typename TIndex3, typename... TIndices>
+ static void setTable(lua_State* state, Globals_t, const std::string& index, TIndex2&& index2, TIndex3&& index3, TIndices&&... indices) noexcept
+ {
+ lua_getglobal(state, index.c_str());
+ PushedObject p1{state, 1};
+
+ setTable<TDataType>(state, std::move(p1), std::forward<TIndex2>(index2), std::forward<TIndex3>(index3), std::forward<TIndices>(indices)...);
+ }*/
+
+ // simple function that reads the "nb" first top elements of the stack, pops them, and returns the value
+ // warning: first parameter is the number of parameters, not the parameter index
+ // if read generates an exception, stack is poped anyway
+ template<typename TReturnType>
+ static auto readTopAndPop(lua_State* state, PushedObject object)
+ -> TReturnType
+ {
+ auto val = Reader<typename std::decay<TReturnType>::type>::read(state, -object.getNum());
+ if (!val.is_initialized())
+ throw WrongTypeException{lua_typename(state, lua_type(state, -object.getNum())), typeid(TReturnType)};
+ return val.get();
+ }
+
+ // checks that the offsets for a type's registrations are set in the registry
+ static void checkTypeRegistration(lua_State* state, const std::type_info* type)
+ {
+ lua_pushlightuserdata(state, const_cast<std::type_info*>(type));
+ lua_gettable(state, LUA_REGISTRYINDEX);
+ if (!lua_isnil(state, -1)) {
+ lua_pop(state, 1);
+ return;
+ }
+ lua_pop(state, 1);
+
+ lua_pushlightuserdata(state, const_cast<std::type_info*>(type));
+ lua_newtable(state);
+
+ lua_pushinteger(state, 0);
+ lua_newtable(state);
+ lua_settable(state, -3);
+
+ lua_pushinteger(state, 1);
+ lua_newtable(state);
+ lua_settable(state, -3);
+
+ lua_pushinteger(state, 3);
+ lua_newtable(state);
+ lua_settable(state, -3);
+
+ lua_pushinteger(state, 4);
+ lua_newtable(state);
+ lua_settable(state, -3);
+
+ lua_settable(state, LUA_REGISTRYINDEX);
+ }
+
+ //
+# ifdef _MSC_VER
+ __declspec(noreturn)
+# else
+ [[noreturn]]
+# endif
+ static void luaError(lua_State* state)
+ {
+ lua_error(state);
+ assert(false);
+ std::terminate(); // removes compilation warning
+ }
+
+
+ /**************************************************/
+ /* FUNCTIONS REGISTRATION */
+ /**************************************************/
+ // the "registerFunction" public functions call this one
+ template<typename TFunctionType, typename TRetValue, typename TObject, typename... TOtherParams>
+ void registerFunctionImpl(const std::string& functionName, TFunctionType function, tag<TObject>, tag<TRetValue (TOtherParams...)>)
+ {
+ static_assert(std::is_class<TObject>::value || std::is_pointer<TObject>::value || std::is_union<TObject>::value , "registerFunction can only be used for a class a union or a pointer");
+
+ checkTypeRegistration(mState, &typeid(TObject));
+ setTable<TRetValue(TObject&, TOtherParams...)>(mState, Registry, &typeid(TObject), 0, functionName, function);
+
+ checkTypeRegistration(mState, &typeid(TObject*));
+ setTable<TRetValue(TObject*, TOtherParams...)>(mState, Registry, &typeid(TObject*), 0, functionName, [=](TObject* obj, TOtherParams... rest) { assert(obj); return function(*obj, std::forward<TOtherParams>(rest)...); });
+
+ checkTypeRegistration(mState, &typeid(std::shared_ptr<TObject>));
+ setTable<TRetValue(std::shared_ptr<TObject>, TOtherParams...)>(mState, Registry, &typeid(std::shared_ptr<TObject>), 0, functionName, [=](const std::shared_ptr<TObject>& obj, TOtherParams... rest) { assert(obj); return function(*obj, std::forward<TOtherParams>(rest)...); });
+ }
+
+ template<typename TFunctionType, typename TRetValue, typename TObject, typename... TOtherParams>
+ void registerFunctionImpl(const std::string& functionName, TFunctionType function, tag<const TObject>, tag<TRetValue (TOtherParams...)> fTypeTag)
+ {
+ registerFunctionImpl(functionName, function, tag<TObject>{}, fTypeTag);
+
+ checkTypeRegistration(mState, &typeid(TObject const*));
+ setTable<TRetValue(TObject const*, TOtherParams...)>(mState, Registry, &typeid(TObject const*), 0, functionName, [=](TObject const* obj, TOtherParams... rest) { assert(obj); return function(*obj, std::forward<TOtherParams>(rest)...); });
+
+ checkTypeRegistration(mState, &typeid(std::shared_ptr<TObject const>));
+ setTable<TRetValue(std::shared_ptr<TObject const>, TOtherParams...)>(mState, Registry, &typeid(std::shared_ptr<TObject const>), 0, functionName, [=](const std::shared_ptr<TObject const>& obj, TOtherParams... rest) { assert(obj); return function(*obj, std::forward<TOtherParams>(rest)...); });
+ }
+
+ template<typename TFunctionType, typename TRetValue, typename TObject, typename... TOtherParams>
+ void registerFunctionImpl(const std::string& functionName, TFunctionType function, tag<TRetValue (TObject::*)(TOtherParams...)>)
+ {
+ registerFunctionImpl(functionName, std::move(function), tag<TObject>{}, tag<TRetValue (TOtherParams...)>{});
+ }
+
+ template<typename TFunctionType, typename TRetValue, typename TObject, typename... TOtherParams>
+ void registerFunctionImpl(const std::string& functionName, TFunctionType function, tag<TRetValue (TObject::*)(TOtherParams...) const>)
+ {
+ registerFunctionImpl(functionName, std::move(function), tag<const TObject>{}, tag<TRetValue (TOtherParams...)>{});
+ }
+
+ template<typename TFunctionType, typename TRetValue, typename TObject, typename... TOtherParams>
+ void registerFunctionImpl(const std::string& functionName, TFunctionType function, tag<TRetValue (TObject::*)(TOtherParams...) volatile>)
+ {
+ registerFunctionImpl(functionName, std::move(function), tag<TObject>{}, tag<TRetValue (TOtherParams...)>{});
+ }
+
+ template<typename TFunctionType, typename TRetValue, typename TObject, typename... TOtherParams>
+ void registerFunctionImpl(const std::string& functionName, TFunctionType function, tag<TRetValue (TObject::*)(TOtherParams...) const volatile>)
+ {
+ registerFunctionImpl(functionName, std::move(function), tag<const TObject>{}, tag<TRetValue (TOtherParams...)>{});
+ }
+
+ // the "registerMember" public functions call this one
+ template<typename TObject, typename TVarType, typename TReadFunction>
+ void registerMemberImpl(const std::string& name, TReadFunction readFunction)
+ {
+ static_assert(std::is_class<TObject>::value || std::is_pointer<TObject>::value, "registerMember can only be called on a class or a pointer");
+
+ checkTypeRegistration(mState, &typeid(TObject));
+ setTable<TVarType (TObject&)>(mState, Registry, &typeid(TObject), 1, name, [readFunction](TObject const& object) {
+ return readFunction(object);
+ });
+
+ checkTypeRegistration(mState, &typeid(TObject*));
+ setTable<TVarType (TObject*)>(mState, Registry, &typeid(TObject*), 1, name, [readFunction](TObject const* object) {
+ assert(object);
+ return readFunction(*object);
+ });
+
+ checkTypeRegistration(mState, &typeid(TObject const*));
+ setTable<TVarType (TObject const*)>(mState, Registry, &typeid(TObject const*), 1, name, [readFunction](TObject const* object) {
+ assert(object);
+ return readFunction(*object);
+ });
+
+ checkTypeRegistration(mState, &typeid(std::shared_ptr<TObject>));
+ setTable<TVarType (std::shared_ptr<TObject>)>(mState, Registry, &typeid(std::shared_ptr<TObject>), 1, name, [readFunction](const std::shared_ptr<TObject>& object) {
+ assert(object);
+ return readFunction(*object);
+ });
+
+ checkTypeRegistration(mState, &typeid(std::shared_ptr<TObject const>));
+ setTable<TVarType (std::shared_ptr<TObject const>)>(mState, Registry, &typeid(std::shared_ptr<TObject const>), 1, name, [readFunction](const std::shared_ptr<TObject const>& object) {
+ assert(object);
+ return readFunction(*object);
+ });
+ }
+
+ template<typename TObject, typename TVarType, typename TReadFunction, typename TWriteFunction>
+ void registerMemberImpl(const std::string& name, TReadFunction readFunction, TWriteFunction writeFunction_)
+ {
+ registerMemberImpl<TObject,TVarType>(name, readFunction);
+
+ setTable<void (TObject&, TVarType)>(mState, Registry, &typeid(TObject), 4, name, [writeFunction_](TObject& object, const TVarType& value) {
+ writeFunction_(object, value);
+ });
+
+ setTable<void (TObject*, TVarType)>(mState, Registry, &typeid(TObject*), 4, name, [writeFunction_](TObject* object, const TVarType& value) {
+ assert(object);
+ writeFunction_(*object, value);
+ });
+
+ setTable<void (std::shared_ptr<TObject>, TVarType)>(mState, Registry, &typeid(std::shared_ptr<TObject>), 4, name, [writeFunction_](std::shared_ptr<TObject> object, const TVarType& value) {
+ assert(object);
+ writeFunction_(*object, value);
+ });
+ }
+
+ template<typename TObject, typename TVarType, typename TReadFunction, typename TWriteFunction>
+ void registerMemberImpl(tag<TVarType (TObject::*)>, const std::string& name, TReadFunction readFunction, TWriteFunction writeFunction_)
+ {
+ registerMemberImpl<TObject,TVarType>(name, std::move(readFunction), std::move(writeFunction_));
+ }
+
+ template<typename TObject, typename TVarType, typename TReadFunction>
+ void registerMemberImpl(tag<TVarType(TObject::*)>, const std::string& name, TReadFunction readFunction)
+ {
+ registerMemberImpl<TObject, TVarType>(name, std::move(readFunction));
+ }
+
+ // the "registerMember" public functions call this one
+ template<typename TObject, typename TVarType, typename TReadFunction>
+ void registerMemberImpl(TReadFunction readFunction)
+ {
+ checkTypeRegistration(mState, &typeid(TObject));
+ setTable<TVarType (TObject const&, std::string)>(mState, Registry, &typeid(TObject), 2, [readFunction](TObject const& object, const std::string& name) {
+ return readFunction(object, name);
+ });
+
+ checkTypeRegistration(mState, &typeid(TObject*));
+ setTable<TVarType (TObject*, std::string)>(mState, Registry, &typeid(TObject*), 2, [readFunction](TObject const* object, const std::string& name) {
+ assert(object);
+ return readFunction(*object, name);
+ });
+
+ checkTypeRegistration(mState, &typeid(TObject const*));
+ setTable<TVarType (TObject const*, std::string)>(mState, Registry, &typeid(TObject const*), 2, [readFunction](TObject const* object, const std::string& name) {
+ assert(object);
+ return readFunction(*object, name);
+ });
+
+ checkTypeRegistration(mState, &typeid(std::shared_ptr<TObject>));
+ setTable<TVarType (std::shared_ptr<TObject>, std::string)>(mState, Registry, &typeid(std::shared_ptr<TObject>), 2, [readFunction](const std::shared_ptr<TObject>& object, const std::string& name) {
+ assert(object);
+ return readFunction(*object, name);
+ });
+
+ checkTypeRegistration(mState, &typeid(std::shared_ptr<TObject const>));
+ setTable<TVarType (std::shared_ptr<TObject const>, std::string)>(mState, Registry, &typeid(std::shared_ptr<TObject const>), 2, [readFunction](const std::shared_ptr<TObject const>& object, const std::string& name) {
+ assert(object);
+ return readFunction(*object, name);
+ });
+ }
+
+ template<typename TObject, typename TVarType, typename TReadFunction, typename TWriteFunction>
+ void registerMemberImpl(TReadFunction readFunction, TWriteFunction writeFunction_)
+ {
+ registerMemberImpl<TObject,TVarType>(readFunction);
+
+ setTable<void (TObject&, std::string, TVarType)>(mState, Registry, &typeid(TObject), 5, [writeFunction_](TObject& object, const std::string& name, const TVarType& value) {
+ writeFunction_(object, name, value);
+ });
+
+ setTable<void (TObject*, std::string, TVarType)>(mState, Registry, &typeid(TObject*), 2, [writeFunction_](TObject* object, const std::string& name, const TVarType& value) {
+ assert(object);
+ writeFunction_(*object, name, value);
+ });
+
+ setTable<void (std::shared_ptr<TObject>, std::string, TVarType)>(mState, Registry, &typeid(std::shared_ptr<TObject>), 2, [writeFunction_](const std::shared_ptr<TObject>& object, const std::string& name, const TVarType& value) {
+ assert(object);
+ writeFunction_(*object, name, value);
+ });
+ }
+
+ template<typename TObject, typename TVarType, typename TReadFunction, typename TWriteFunction>
+ void registerMemberImpl(tag<TVarType (TObject::*)>, TReadFunction readFunction, TWriteFunction writeFunction_)
+ {
+ registerMemberImpl<TObject,TVarType>(std::move(readFunction), std::move(writeFunction_));
+ }
+
+ template<typename TObject, typename TVarType, typename TReadFunction>
+ void registerMemberImpl(tag<TVarType(TObject::*)>, TReadFunction readFunction)
+ {
+ registerMemberImpl<TObject, TVarType>(std::move(readFunction));
+ }
+
+
+ /**************************************************/
+ /* LOADING AND CALLING */
+ /**************************************************/
+ // this function loads data from the stream and pushes a function at the top of the stack
+ // throws in case of syntax error
+ static PushedObject load(lua_State* state, std::istream& code) {
+ // since the lua_load function requires a static function, we use this structure
+ // the Reader structure is at the same time an object storing an istream and a buffer,
+ // and a static function provider
+ struct Reader {
+ Reader(std::istream& str) : stream(str) {}
+ std::istream& stream;
+ std::array<char,512> buffer;
+
+ // read function ; "data" must be an instance of Reader
+ static const char* read(lua_State* /*l*/, void* data, size_t* size) {
+ assert(size != nullptr);
+ assert(data != nullptr);
+ Reader& me = *static_cast<Reader*>(data);
+ if (me.stream.eof()) { *size = 0; return nullptr; }
+
+ me.stream.read(me.buffer.data(), me.buffer.size());
+ *size = static_cast<size_t>(me.stream.gcount()); // gcount could return a value larger than a size_t, but its maximum is me.buffer.size() so there's no problem
+ return me.buffer.data();
+ }
+ };
+
+ // we create an instance of Reader, and we call lua_load
+ Reader reader{code};
+ const auto loadReturnValue = lua_load(state, &Reader::read, &reader, "chunk"
+# if LUA_VERSION_NUM >= 502
+ , nullptr
+# endif
+ );
+
+ // now we have to check return value
+ if (loadReturnValue != 0) {
+ // there was an error during loading, an error message was pushed on the stack
+ const std::string errorMsg = lua_tostring(state, -1);
+ lua_pop(state, 1);
+ if (loadReturnValue == LUA_ERRMEM)
+ throw std::bad_alloc();
+ else if (loadReturnValue == LUA_ERRSYNTAX)
+ throw SyntaxErrorException{errorMsg};
+ throw std::runtime_error("Error while calling lua_load: " + errorMsg);
+ }
+
+ return PushedObject{state, 1};
+ }
+
+ // this function loads data and pushes a function at the top of the stack
+ // throws in case of syntax error
+ static PushedObject load(lua_State* state, const char* code) {
+ auto loadReturnValue = luaL_loadstring(state, code);
+
+ // now we have to check return value
+ if (loadReturnValue != 0) {
+ // there was an error during loading, an error message was pushed on the stack
+ const std::string errorMsg = lua_tostring(state, -1);
+ lua_pop(state, 1);
+ if (loadReturnValue == LUA_ERRMEM)
+ throw std::bad_alloc();
+ else if (loadReturnValue == LUA_ERRSYNTAX)
+ throw SyntaxErrorException{errorMsg};
+ throw std::runtime_error("Error while calling lua_load: " + errorMsg);
+ }
+
+ return PushedObject{state, 1};
+ }
+
+ // this function calls what is on the top of the stack and removes it (just like lua_call)
+ // if an exception is triggered, the top of the stack will be removed anyway
+ template<typename TReturnType, typename... TParameters>
+ static auto call(lua_State* state, PushedObject toCall, TParameters&&... input)
+ -> TReturnType
+ {
+ typedef typename Tupleizer<TReturnType>::type
+ RealReturnType;
+
+ // we push the parameters on the stack
+ auto inArguments = Pusher<std::tuple<TParameters&&...>>::push(state, std::forward_as_tuple(std::forward<TParameters>(input)...));
+
+ //
+ const int outArgumentsCount = std::tuple_size<RealReturnType>::value;
+ auto outArguments = callRaw(state, std::move(toCall) + std::move(inArguments), outArgumentsCount);
+
+ // pcall succeeded, we pop the returned values and return them
+ return readTopAndPop<TReturnType>(state, std::move(outArguments));
+ }
+
+ static int gettraceback(lua_State* L) {
+ lua_getglobal(L, "debug"); // stack: error, debug library
+ lua_getfield(L, -1, "traceback"); // stack: error, debug library, debug.traceback function
+ lua_remove(L, -2); // stack: error, debug.traceback function
+ lua_pushstring(L, ""); // stack: error, debug.traceback, ""
+ lua_pushinteger(L, 2); // stack: error, debug.traceback, "", 2
+ lua_call(L, 2, 1); // stack: error, traceback
+ lua_createtable(L, 2, 0); // stack: error, traceback, {}
+ lua_insert(L, 1); // stack: {}, error, traceback
+ lua_rawseti(L, 1, 2); // stack: {[2]=traceback}, error
+ lua_rawseti(L, 1, 1); // stack: {[1]=error,[2]=traceback}
+ return 1; // return the table
+ }
+
+ // this function just calls lua_pcall and checks for errors
+ static PushedObject callRaw(lua_State* state, PushedObject functionAndArguments, const int outArguments)
+ {
+ // provide traceback handler
+ int tbindex = lua_gettop(state) - (functionAndArguments.getNum() - 1);
+ lua_pushcfunction(state, gettraceback);
+
+ // move it back up, before our function and arguments
+ lua_insert(state, tbindex);
+
+ // calling pcall automatically pops the parameters and pushes output
+ const auto pcallReturnValue = lua_pcall(state, functionAndArguments.getNum() - 1, outArguments, tbindex);
+ functionAndArguments.release();
+
+ lua_remove(state, tbindex); // remove traceback function
+
+
+ // if pcall failed, analyzing the problem and throwing
+ if (pcallReturnValue != 0) {
+
+ // stack top: {error, traceback}
+ lua_rawgeti(state, -1, 1); // stack top: {error, traceback}, error
+ lua_rawgeti(state, -2, 2); // stack top: {error, traceback}, error, traceback
+ lua_remove(state, -3); // stack top: error, traceback
+
+ PushedObject traceBackRef{state, 1};
+ const auto traceBack = readTopAndPop<std::string>(state, std::move(traceBackRef)); // stack top: error
+ PushedObject errorCode{state, 1};
+
+ // an error occurred during execution, either an error message or a std::exception_ptr was pushed on the stack
+ if (pcallReturnValue == LUA_ERRMEM) {
+ throw std::bad_alloc{};
+
+ } else if (pcallReturnValue == LUA_ERRRUN) {
+ if (lua_isstring(state, 1)) {
+ // the error is a string
+ const auto str = readTopAndPop<std::string>(state, std::move(errorCode));
+ throw ExecutionErrorException{str+traceBack};
+
+ } else {
+ // an exception_ptr was pushed on the stack
+ // rethrowing it with an additional ExecutionErrorException
+ try {
+ if (const auto exp = readTopAndPop<std::exception_ptr>(state, std::move(errorCode))) {
+ std::rethrow_exception(exp);
+ }
+ } catch(const std::exception& e) {
+ std::throw_with_nested(ExecutionErrorException{std::string{"Exception thrown by a callback function: "} + e.what()});
+ } catch(...) {
+ std::throw_with_nested(ExecutionErrorException{"Exception thrown by a callback function called by Lua. "+traceBack});
+ }
+ throw ExecutionErrorException{"Unknown Lua error"};
+ }
+ }
+ }
+
+ return PushedObject{state, outArguments};
+ }
+
+
+ /**************************************************/
+ /* PUSH FUNCTIONS */
+ /**************************************************/
+ template<typename T>
+ static PushedObject push(lua_State* state, T&& value)
+ {
+ return Pusher<typename std::decay<T>::type>::push(state, std::forward<T>(value));
+ }
+
+ // the Pusher structures allow you to push a value on the stack
+ // - static const int minSize : minimum size on the stack that the value can have
+ // - static const int maxSize : maximum size on the stack that the value can have
+ // - static int push(const LuaContext&, ValueType) : pushes the value on the stack and returns the size on the stack
+
+ // implementation for custom objects
+ template<typename TType, typename = void>
+ struct Pusher {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ template<typename TType2>
+ static PushedObject push(lua_State* state, TType2&& value) noexcept {
+ // this function is called when lua's garbage collector wants to destroy our object
+ // we simply call its destructor
+ const auto garbageCallbackFunction = [](lua_State* lua) -> int {
+ assert(lua_gettop(lua) == 1);
+ TType* ptr = static_cast<TType*>(lua_touserdata(lua, 1));
+ assert(ptr);
+ ptr->~TType();
+ return 0;
+ };
+
+ // this function will be stored in __index in the metatable
+ const auto indexFunction = [](lua_State* lua) -> int {
+ try {
+ assert(lua_gettop(lua) == 2);
+ assert(lua_isuserdata(lua, 1));
+
+ // searching for a handler
+ lua_pushlightuserdata(lua, const_cast<std::type_info*>(&typeid(TType)));
+ lua_gettable(lua, LUA_REGISTRYINDEX);
+ assert(!lua_isnil(lua, -1));
+
+ // looking into getter functions
+ lua_pushinteger(lua, 0);
+ lua_gettable(lua, -2);
+ lua_pushvalue(lua, 2);
+ lua_gettable(lua, -2);
+ if (!lua_isnil(lua, -1))
+ return 1;
+ lua_pop(lua, 2);
+
+ // looking into getter members
+ lua_pushinteger(lua, 1);
+ lua_gettable(lua, -2);
+ lua_pushvalue(lua, 2);
+ lua_gettable(lua, -2);
+ if (!lua_isnil(lua, -1)) {
+ lua_pushvalue(lua, 1);
+ return callRaw(lua, PushedObject{lua, 2}, 1).release();
+ }
+ lua_pop(lua, 2);
+
+ // looking into default getter
+ lua_pushinteger(lua, 2);
+ lua_gettable(lua, -2);
+ if (lua_isnil(lua, -1))
+ return 1;
+ lua_pushvalue(lua, 1);
+ lua_pushvalue(lua, 2);
+ return callRaw(lua, PushedObject{lua, 3}, 1).release();
+
+ } catch (...) {
+ Pusher<std::exception_ptr>::push(lua, std::current_exception()).release();
+ luaError(lua);
+ }
+ };
+
+ // this function will be stored in __newindex in the metatable
+ const auto newIndexFunction = [](lua_State* lua) -> int {
+ try {
+ assert(lua_gettop(lua) == 3);
+ assert(lua_isuserdata(lua, 1));
+
+ // searching for a handler
+ lua_pushlightuserdata(lua, const_cast<std::type_info*>(&typeid(TType)));
+ lua_rawget(lua, LUA_REGISTRYINDEX);
+ assert(!lua_isnil(lua, -1));
+
+ // looking into setter members
+ lua_pushinteger(lua, 4);
+ lua_rawget(lua, -2);
+ lua_pushvalue(lua, 2);
+ lua_rawget(lua, -2);
+ if (!lua_isnil(lua, -1)) {
+ lua_pushvalue(lua, 1);
+ lua_pushvalue(lua, 3);
+ callRaw(lua, PushedObject{lua, 3}, 0);
+ lua_pop(lua, 2);
+ return 0;
+ }
+ lua_pop(lua, 2);
+
+ // looking into default setter
+ lua_pushinteger(lua, 5);
+ lua_rawget(lua, -2);
+ if (lua_isnil(lua, -1))
+ {
+ lua_pop(lua, 2);
+ lua_pushstring(lua, "No setter found");
+ luaError(lua);
+ }
+ lua_pushvalue(lua, 1);
+ lua_pushvalue(lua, 2);
+ lua_pushvalue(lua, 3);
+ callRaw(lua, PushedObject{lua, 4}, 0);
+ lua_pop(lua, 1);
+ return 0;
+
+ } catch (...) {
+ Pusher<std::exception_ptr>::push(lua, std::current_exception()).release();
+ luaError(lua);
+ }
+ };
+
+ const auto toStringFunction = [](lua_State* lua) -> int {
+ try {
+ assert(lua_gettop(lua) == 1);
+ assert(lua_isuserdata(lua, 1));
+ lua_pushstring(lua, "__tostring");
+ lua_gettable(lua, 1);
+ if (lua_isnil(lua, -1))
+ {
+ const void *ptr = lua_topointer(lua, -2);
+ lua_pop(lua, 1);
+ lua_pushstring(lua, (boost::format("userdata 0x%08x") % reinterpret_cast<intptr_t>(ptr)).str().c_str());
+ return 1;
+ }
+ lua_pushvalue(lua, 1);
+ return callRaw(lua, PushedObject{lua, 2}, 1).release();
+ } catch (...) {
+ Pusher<std::exception_ptr>::push(lua, std::current_exception()).release();
+ luaError(lua);
+ }
+ };
+
+
+ // writing structure for this type into the registry
+ checkTypeRegistration(state, &typeid(TType));
+
+ // creating the object
+ // lua_newuserdata allocates memory in the internals of the lua library and returns it so we can fill it
+ // and that's what we do with placement-new
+ const auto pointerLocation = static_cast<TType*>(lua_newuserdata(state, sizeof(TType)));
+ new (pointerLocation) TType(std::forward<TType2>(value));
+ PushedObject obj{state, 1};
+
+ // creating the metatable (over the object on the stack)
+ // lua_settable pops the key and value we just pushed, so stack management is easy
+ // all that remains on the stack after these function calls is the metatable
+ lua_newtable(state);
+ PushedObject pushedTable{state, 1};
+
+ // using the garbage collecting function we created above
+ if (!boost::has_trivial_destructor<TType>::value)
+ {
+ lua_pushstring(state, "__gc");
+ lua_pushcfunction(state, garbageCallbackFunction);
+ lua_settable(state, -3);
+ }
+
+ // the _typeid index of the metatable will store the type_info*
+ lua_pushstring(state, "_typeid");
+ lua_pushlightuserdata(state, const_cast<std::type_info*>(&typeid(TType)));
+ lua_settable(state, -3);
+
+ // using the index function we created above
+ lua_pushstring(state, "__index");
+ lua_pushcfunction(state, indexFunction);
+ lua_settable(state, -3);
+
+ // using the newindex function we created above
+ lua_pushstring(state, "__newindex");
+ lua_pushcfunction(state, newIndexFunction);
+ lua_settable(state, -3);
+
+ lua_pushstring(state, "__tostring");
+ lua_pushcfunction(state, toStringFunction);
+ lua_settable(state, -3);
+
+ lua_pushstring(state, "__eq");
+ lua_getglobal(state, LUACONTEXT_GLOBAL_EQ);
+ lua_settable(state, -3);
+
+
+ // at this point, the stack contains the object at offset -2 and the metatable at offset -1
+ // lua_setmetatable will bind the two together and pop the metatable
+ // our custom type remains on the stack (and that's what we want since this is a push function)
+ lua_setmetatable(state, -2);
+ pushedTable.release();
+
+ return obj;
+ }
+ };
+
+ // this structure has a "size" int static member which is equal to the total of the push min size of all the types
+ template<typename... TTypes>
+ struct PusherTotalMinSize;
+
+ // this structure has a "size" int static member which is equal to the total of the push max size of all the types
+ template<typename... TTypes>
+ struct PusherTotalMaxSize;
+
+ // this structure has a "size" int static member which is equal to the maximum size of the push of all the types
+ template<typename... TTypes>
+ struct PusherMinSize;
+
+ // this structure has a "size" int static member which is equal to the maximum size of the push of all the types
+ template<typename... TTypes>
+ struct PusherMaxSize;
+
+
+ /**************************************************/
+ /* READ FUNCTIONS */
+ /**************************************************/
+ // the "Reader" structures allow to read data from the stack
+ // - the "ReturnType" type is what is returned by the reader, and can be different than the template parameter (especially with references and constness)
+ // - the "read" static function will check and read at the same time, returning an empty optional if it is the wrong type
+
+ template<typename TType, typename = void>
+ struct Reader {
+ typedef typename std::conditional<std::is_pointer<TType>::value, TType, TType&>::type
+ ReturnType;
+
+ static auto read(lua_State* state, int index)
+ -> boost::optional<ReturnType>
+ {
+ if (!test(state, index))
+ return boost::none;
+ return boost::optional<ReturnType>(*static_cast<TType*>(lua_touserdata(state, index)));
+ }
+
+ private:
+ static bool test(lua_State* state, int index)
+ {
+ if (!lua_isuserdata(state, index))
+ return false;
+ if (!lua_getmetatable(state, index))
+ return false;
+
+ // now we have our metatable on the top of the stack
+ // retrieving its _typeid member
+ lua_pushstring(state, "_typeid");
+ lua_gettable(state, -2);
+ const auto storedTypeID = static_cast<const std::type_info*>(lua_touserdata(state, -1));
+ const auto typeIDToCompare = &typeid(TType);
+
+ // if wrong typeid, returning false
+ lua_pop(state, 2);
+ if (storedTypeID != typeIDToCompare)
+ return false;
+
+ return true;
+ }
+ };
+
+ /**
+ * This functions reads multiple values starting at "index" and passes them to the callback
+ */
+ template<typename TRetValue, typename TCallback>
+ static auto readIntoFunction(lua_State* /*state*/, tag<TRetValue>, TCallback&& callback, int /*index*/)
+ -> TRetValue
+ {
+ return callback();
+ }
+ template<typename TRetValue, typename TCallback, typename TFirstType, typename... TTypes>
+ static auto readIntoFunction(lua_State* state, tag<TRetValue> retValueTag, TCallback&& callback, int index, tag<TFirstType>, tag<TTypes>... othersTags)
+ -> typename std::enable_if<IsOptional<TFirstType>::value, TRetValue>::type
+ {
+ if (index >= 0) {
+ Binder<TCallback, const TFirstType&> binder{ callback, {} };
+ return readIntoFunction(state, retValueTag, binder, index + 1, othersTags...);
+ }
+
+ const auto& firstElem = Reader<typename std::decay<TFirstType>::type>::read(state, index);
+ if (!firstElem)
+ throw WrongTypeException(lua_typename(state, lua_type(state, index)), typeid(TFirstType));
+
+ Binder<TCallback, const TFirstType&> binder{ callback, *firstElem };
+ return readIntoFunction(state, retValueTag, binder, index + 1, othersTags...);
+ }
+ template<typename TRetValue, typename TCallback, typename TFirstType, typename... TTypes>
+ static auto readIntoFunction(lua_State* state, tag<TRetValue> retValueTag, TCallback&& callback, int index, tag<TFirstType>, tag<TTypes>... othersTags)
+ -> typename std::enable_if<!IsOptional<TFirstType>::value, TRetValue>::type
+ {
+ if (index >= 0)
+ throw std::logic_error("Wrong number of parameters");
+
+ const auto& firstElem = Reader<typename std::decay<TFirstType>::type>::read(state, index);
+ if (!firstElem)
+ throw WrongTypeException(lua_typename(state, lua_type(state, index)), typeid(TFirstType));
+
+ Binder<TCallback, const TFirstType&> binder{ callback, *firstElem };
+ return readIntoFunction(state, retValueTag, binder, index + 1, othersTags...);
+ }
+
+
+ /**************************************************/
+ /* UTILITIES */
+ /**************************************************/
+ // structure that will ensure that a certain value is stored somewhere in the registry
+ struct ValueInRegistry {
+ // this constructor will clone and hold the value at the specified index (or by default at the top of the stack) in the registry
+ ValueInRegistry(lua_State* lua_, int index=-1) : lua{lua_}
+ {
+ lua_pushlightuserdata(lua, this);
+ lua_pushvalue(lua, -1 + index);
+ lua_settable(lua, LUA_REGISTRYINDEX);
+ }
+
+ // removing the function from the registry
+ ~ValueInRegistry()
+ {
+ lua_pushlightuserdata(lua, this);
+ lua_pushnil(lua);
+ lua_settable(lua, LUA_REGISTRYINDEX);
+ }
+
+ // loads the value and puts it at the top of the stack
+ PushedObject pop()
+ {
+ lua_pushlightuserdata(lua, this);
+ lua_gettable(lua, LUA_REGISTRYINDEX);
+ return PushedObject{lua, 1};
+ }
+
+ ValueInRegistry(const ValueInRegistry&) = delete;
+ ValueInRegistry& operator=(const ValueInRegistry&) = delete;
+
+ private:
+ lua_State* lua;
+ };
+
+ // binds the first parameter of a function object
+ template<typename TFunctionObject, typename TFirstParamType>
+ struct Binder {
+ TFunctionObject function;
+ TFirstParamType param;
+
+ template<typename... TParams>
+ auto operator()(TParams&&... params)
+ -> decltype(function(param, std::forward<TParams>(params)...))
+ {
+ return function(param, std::forward<TParams>(params)...);
+ }
+ };
+
+ // turns a type into a tuple
+ // void is turned into std::tuple<>
+ // existing tuples are untouched
+ template<typename T>
+ struct Tupleizer;
+
+ // this structure takes a pointer to a member function type and returns the base function type
+ template<typename TType>
+ struct RemoveMemberPointerFunction { typedef void type; }; // required because of a compiler bug
+
+ // this structure takes any object and detects its function type
+ template<typename TObjectType>
+ struct FunctionTypeDetector { typedef typename RemoveMemberPointerFunction<decltype(&std::decay<TObjectType>::type::operator())>::type type; };
+
+ // this structure takes a function arguments list and has the "min" and the "max" static const member variables, whose value equal to the min and max number of parameters for the function
+ // the only case where "min != max" is with boost::optional at the end of the list
+ template<typename... TArgumentsList>
+ struct FunctionArgumentsCounter {};
+
+ // true is the template parameter is a boost::optional
+ template<typename T>
+ struct IsOptional : public std::false_type {};
+};
+
+/// @deprecated
+static LuaContext::EmptyArray_t ATTR_UNUSED
+ LuaEmptyArray {};
+/// @deprecated
+static LuaContext::Metatable_t ATTR_UNUSED
+ LuaMetatable {};
+
+/**************************************************/
+/* PARTIAL IMPLEMENTATIONS */
+/**************************************************/
+template<>
+inline auto LuaContext::readTopAndPop<void>(lua_State* /*state*/, PushedObject /*obj*/)
+ -> void
+{
+}
+
+// this structure takes a template parameter T
+// if T is a tuple, it returns T ; if T is not a tuple, it returns std::tuple<T>
+// we have to use this structure because std::tuple<std::tuple<...>> triggers a bug in both MSVC++ and GCC
+template<typename T>
+struct LuaContext::Tupleizer { typedef std::tuple<T> type; };
+template<typename... Args>
+struct LuaContext::Tupleizer<std::tuple<Args...>> { typedef std::tuple<Args...> type; };
+template<>
+struct LuaContext::Tupleizer<void> { typedef std::tuple<> type; };
+
+// this structure takes any object and detects its function type
+template<typename TRetValue, typename... TParameters>
+struct LuaContext::FunctionTypeDetector<TRetValue (TParameters...)> { typedef TRetValue type(TParameters...); };
+template<typename TObjectType>
+struct LuaContext::FunctionTypeDetector<TObjectType*> { typedef typename FunctionTypeDetector<TObjectType>::type type; };
+
+// this structure takes a pointer to a member function type and returns the base function type
+template<typename TType, typename TRetValue, typename... TParameters>
+struct LuaContext::RemoveMemberPointerFunction<TRetValue (TType::*)(TParameters...)> { typedef TRetValue type(TParameters...); };
+template<typename TType, typename TRetValue, typename... TParameters>
+struct LuaContext::RemoveMemberPointerFunction<TRetValue (TType::*)(TParameters...) const> { typedef TRetValue type(TParameters...); };
+template<typename TType, typename TRetValue, typename... TParameters>
+struct LuaContext::RemoveMemberPointerFunction<TRetValue (TType::*)(TParameters...) volatile> { typedef TRetValue type(TParameters...); };
+template<typename TType, typename TRetValue, typename... TParameters>
+struct LuaContext::RemoveMemberPointerFunction<TRetValue (TType::*)(TParameters...) const volatile> { typedef TRetValue type(TParameters...); };
+
+// implementation of PusherTotalMinSize
+template<typename TFirst, typename... TTypes>
+struct LuaContext::PusherTotalMinSize<TFirst, TTypes...> { static const int size = Pusher<typename std::decay<TFirst>::type>::minSize + PusherTotalMinSize<TTypes...>::size; };
+template<>
+struct LuaContext::PusherTotalMinSize<> { static const int size = 0; };
+
+// implementation of PusherTotalMaxSize
+template<typename TFirst, typename... TTypes>
+struct LuaContext::PusherTotalMaxSize<TFirst, TTypes...> { static const int size = Pusher<typename std::decay<TFirst>::type>::maxSize + PusherTotalMaxSize<TTypes...>::size; };
+template<>
+struct LuaContext::PusherTotalMaxSize<> { static const int size = 0; };
+
+// implementation of PusherMinSize
+template<typename TFirst, typename TSecond, typename... TTypes>
+struct LuaContext::PusherMinSize<TFirst, TSecond, TTypes...>
+{
+ static const int size = Pusher<typename std::decay<TFirst>::type>::minSize < Pusher<typename std::decay<TSecond>::type>::minSize
+ ?
+ PusherMinSize<typename std::decay<TFirst>::type, TTypes...>::size
+ :
+ PusherMinSize<typename std::decay<TSecond>::type, TTypes...>::size;
+};
+
+template<typename TFirst>
+struct LuaContext::PusherMinSize<TFirst> { static const int size = Pusher<typename std::decay<TFirst>::type>::minSize; };
+
+// implementation of PusherMaxSize
+template<typename TFirst, typename... TTypes>
+struct LuaContext::PusherMaxSize<TFirst, TTypes...> { static const int size = Pusher<typename std::decay<TFirst>::type>::maxSize > PusherTotalMaxSize<TTypes...>::size ? Pusher<typename std::decay<TFirst>::type>::maxSize : PusherMaxSize<TTypes...>::size; };
+template<>
+struct LuaContext::PusherMaxSize<> { static const int size = 0; };
+
+// implementation of FunctionArgumentsCounter
+template<typename TFirst, typename... TParams>
+struct LuaContext::FunctionArgumentsCounter<TFirst, TParams...> {
+ typedef FunctionArgumentsCounter<TParams...>
+ SubType;
+ static const int min = (IsOptional<TFirst>::value && SubType::min == 0) ? 0 : 1 + SubType::min;
+ static const int max = 1 + SubType::max;
+};
+template<>
+struct LuaContext::FunctionArgumentsCounter<> {
+ static const int min = 0;
+ static const int max = 0;
+};
+
+// implementation of IsOptional
+template<typename T>
+struct LuaContext::IsOptional<boost::optional<T>> : public std::true_type {};
+
+// implementation of LuaFunctionCaller
+template<typename TFunctionType>
+class LuaContext::LuaFunctionCaller { static_assert(std::is_function<TFunctionType>::value, "Template parameter of LuaFunctionCaller must be a function type"); };
+template<typename TRetValue, typename... TParams>
+class LuaContext::LuaFunctionCaller<TRetValue (TParams...)>
+{
+public:
+ TRetValue operator()(TParams&&... params) const
+ {
+ auto obj = valueHolder->pop();
+ return call<TRetValue>(state, std::move(obj), std::forward<TParams>(params)...);
+ }
+
+private:
+ std::shared_ptr<ValueInRegistry> valueHolder;
+ lua_State* state;
+
+private:
+ friend LuaContext;
+ explicit LuaFunctionCaller(lua_State* state_, int index) :
+ valueHolder(std::make_shared<ValueInRegistry>(state_, index)),
+ state(state_)
+ {}
+};
+
+
+/**************************************************/
+/* PUSH FUNCTIONS */
+/**************************************************/
+// specializations of the Pusher structure
+
+// opaque Lua references
+template<>
+struct LuaContext::Pusher<LuaContext::LuaObject> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const LuaContext::LuaObject& value) noexcept {
+ if (value.objectInRegistry.get()) {
+ PushedObject obj = value.objectInRegistry->pop();
+ return obj;
+ } else {
+ lua_pushnil(state);
+ return PushedObject{state, 1};
+ }
+ }
+};
+
+// boolean
+template<>
+struct LuaContext::Pusher<bool> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, bool value) noexcept {
+ lua_pushboolean(state, value);
+ return PushedObject{state, 1};
+ }
+};
+
+// string
+template<>
+struct LuaContext::Pusher<std::string> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const std::string& value) noexcept {
+ lua_pushlstring(state, value.c_str(), value.length());
+ return PushedObject{state, 1};
+ }
+};
+
+// const char*
+template<>
+struct LuaContext::Pusher<const char*> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const char* value) noexcept {
+ lua_pushstring(state, value);
+ return PushedObject{state, 1};
+ }
+};
+
+// const char[N]
+template<int N>
+struct LuaContext::Pusher<const char[N]> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const char* value) noexcept {
+ lua_pushstring(state, value);
+ return PushedObject{state, 1};
+ }
+};
+
+// floating numbers
+template<typename T>
+struct LuaContext::Pusher<T, typename std::enable_if<std::is_floating_point<T>::value>::type> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, T value) noexcept {
+ lua_pushnumber(state, value);
+ return PushedObject{state, 1};
+ }
+};
+
+// integers
+template<typename T>
+struct LuaContext::Pusher<T, typename std::enable_if<std::is_integral<T>::value>::type> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, T value) noexcept {
+ lua_pushinteger(state, value);
+ return PushedObject{state, 1};
+ }
+};
+
+// nil
+template<>
+struct LuaContext::Pusher<std::nullptr_t> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, std::nullptr_t) noexcept {
+ lua_pushnil(state);
+ return PushedObject{state, 1};
+ }
+};
+
+// empty arrays
+template<>
+struct LuaContext::Pusher<LuaContext::EmptyArray_t> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, EmptyArray_t) noexcept {
+ lua_newtable(state);
+ return PushedObject{state, 1};
+ }
+};
+
+// std::type_info* is a lightuserdata
+template<>
+struct LuaContext::Pusher<const std::type_info*> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const std::type_info* ptr) noexcept {
+ lua_pushlightuserdata(state, const_cast<std::type_info*>(ptr));
+ return PushedObject{state, 1};
+ }
+};
+
+// thread
+template<>
+struct LuaContext::Pusher<LuaContext::ThreadID> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const LuaContext::ThreadID& value) noexcept {
+ lua_pushthread(value.state);
+ return PushedObject{state, 1};
+ }
+};
+
+// maps
+template<typename TKey, typename TValue>
+struct LuaContext::Pusher<std::map<TKey,TValue>> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const std::map<TKey,TValue>& value) noexcept {
+ static_assert(Pusher<typename std::decay<TKey>::type>::minSize == 1 && Pusher<typename std::decay<TKey>::type>::maxSize == 1, "Can't push multiple elements for a table key");
+ static_assert(Pusher<typename std::decay<TValue>::type>::minSize == 1 && Pusher<typename std::decay<TValue>::type>::maxSize == 1, "Can't push multiple elements for a table value");
+
+ auto obj = Pusher<EmptyArray_t>::push(state, EmptyArray);
+
+ for (auto i = value.begin(), e = value.end(); i != e; ++i)
+ setTable<TValue>(state, obj, i->first, i->second);
+
+ return obj;
+ }
+};
+
+// unordered_maps
+template<typename TKey, typename TValue, typename THash, typename TKeyEqual>
+struct LuaContext::Pusher<std::unordered_map<TKey,TValue,THash,TKeyEqual>> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const std::unordered_map<TKey,TValue,THash,TKeyEqual>& value) noexcept {
+ static_assert(Pusher<typename std::decay<TKey>::type>::minSize == 1 && Pusher<typename std::decay<TKey>::type>::maxSize == 1, "Can't push multiple elements for a table key");
+ static_assert(Pusher<typename std::decay<TValue>::type>::minSize == 1 && Pusher<typename std::decay<TValue>::type>::maxSize == 1, "Can't push multiple elements for a table value");
+
+ auto obj = Pusher<EmptyArray_t>::push(state, EmptyArray);
+
+ for (auto i = value.begin(), e = value.end(); i != e; ++i)
+ setTable<TValue>(state, obj, i->first, i->second);
+
+ return obj;
+ }
+};
+
+// vectors of pairs
+template<typename TType1, typename TType2>
+struct LuaContext::Pusher<std::vector<std::pair<TType1,TType2>>> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const std::vector<std::pair<TType1,TType2>>& value) noexcept {
+ static_assert(Pusher<typename std::decay<TType1>::type>::minSize == 1 && Pusher<typename std::decay<TType1>::type>::maxSize == 1, "Can't push multiple elements for a table key");
+ static_assert(Pusher<typename std::decay<TType2>::type>::minSize == 1 && Pusher<typename std::decay<TType2>::type>::maxSize == 1, "Can't push multiple elements for a table value");
+
+ auto obj = Pusher<EmptyArray_t>::push(state, EmptyArray);
+
+ for (auto i = value.begin(), e = value.end(); i != e; ++i)
+ setTable<TType2>(state, obj, i->first, i->second);
+
+ return obj;
+ }
+};
+
+// vectors
+template<typename TType>
+struct LuaContext::Pusher<std::vector<TType>> {
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ static PushedObject push(lua_State* state, const std::vector<TType>& value) noexcept {
+ static_assert(Pusher<typename std::decay<TType>::type>::minSize == 1 && Pusher<typename std::decay<TType>::type>::maxSize == 1, "Can't push multiple elements for a table value");
+
+ auto obj = Pusher<EmptyArray_t>::push(state, EmptyArray);
+
+ for (unsigned int i = 0; i < value.size(); ++i)
+ setTable<TType>(state, obj, i + 1, value[i]);
+
+ return obj;
+ }
+};
+
+// unique_ptr
+template<typename TType>
+struct LuaContext::Pusher<std::unique_ptr<TType>> {
+ static const int minSize = Pusher<std::shared_ptr<TType>>::minSize;
+ static const int maxSize = Pusher<std::shared_ptr<TType>>::maxSize;
+
+ static PushedObject push(lua_State* state, std::unique_ptr<TType> value) noexcept {
+ return Pusher<std::shared_ptr<TType>>::push(state, std::move(value));
+ }
+};
+
+// enum
+template<typename TEnum>
+struct LuaContext::Pusher<TEnum, typename std::enable_if<std::is_enum<TEnum>::value>::type> {
+ #if !defined(__clang__) || __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ > 3)
+ typedef typename std::underlying_type<TEnum>::type
+ RealType;
+ #else
+ // implementation when std::underlying_type is not supported
+ typedef unsigned long
+ RealType;
+ #endif
+
+ static const int minSize = Pusher<RealType>::minSize;
+ static const int maxSize = Pusher<RealType>::maxSize;
+
+ static PushedObject push(lua_State* state, TEnum value) noexcept {
+ return Pusher<RealType>::push(state, static_cast<RealType>(value));
+ }
+};
+
+// any function
+// this specialization is not directly called, but is called by other specializations
+template<typename TReturnType, typename... TParameters>
+struct LuaContext::Pusher<TReturnType (TParameters...)>
+{
+ static const int minSize = 1;
+ static const int maxSize = 1;
+
+ // counts the number of arguments
+ typedef FunctionArgumentsCounter<TParameters...>
+ LocalFunctionArgumentsCounter;
+
+ // this is the version of "push" for non-trivially destructible function objects
+ template<typename TFunctionObject>
+ static auto push(lua_State* state, TFunctionObject fn) noexcept
+ -> typename std::enable_if<!boost::has_trivial_destructor<TFunctionObject>::value, PushedObject>::type
+ {
+ // TODO: is_move_constructible not supported by some compilers
+ //static_assert(std::is_move_constructible<TFunctionObject>::value, "The function object must be move-constructible");
+
+ // when the lua script calls the thing we will push on the stack, we want "fn" to be executed
+ // if we used lua's cfunctions system, we could not detect when the function is no longer in use, which could cause problems
+ // so we use userdata instead
+
+ // this function is called when the lua script tries to call our custom data type
+ // we transfer execution to the "callback" function below
+ const auto callCallback = [](lua_State* lua) -> int {
+ assert(lua_gettop(lua) >= 1);
+ assert(lua_isuserdata(lua, 1));
+ auto function = static_cast<TFunctionObject*>(lua_touserdata(lua, 1));
+ assert(function);
+
+ return callback(lua, function, lua_gettop(lua) - 1).release();
+ };
+
+ // this one is called when lua's garbage collector no longer needs our custom data type
+ // we call the function object's destructor
+ const auto garbageCallback = [](lua_State* lua) -> int {
+ assert(lua_gettop(lua) == 1);
+ auto function = static_cast<TFunctionObject*>(lua_touserdata(lua, 1));
+ assert(function);
+ function->~TFunctionObject();
+ return 0;
+ };
+
+ // creating the object
+ // lua_newuserdata allocates memory in the internals of the lua library and returns it so we can fill it
+ // and that's what we do with placement-new
+ const auto functionLocation = static_cast<TFunctionObject*>(lua_newuserdata(state, sizeof(TFunctionObject)));
+ new (functionLocation) TFunctionObject(std::move(fn));
+
+ // creating the metatable (over the object on the stack)
+ // lua_settable pops the key and value we just pushed, so stack management is easy
+ // all that remains on the stack after these function calls is the metatable
+ lua_newtable(state);
+ lua_pushstring(state, "__call");
+ lua_pushcfunction(state, callCallback);
+ lua_settable(state, -3);
+
+ lua_pushstring(state, "__gc");
+ lua_pushcfunction(state, garbageCallback);
+ lua_settable(state, -3);
+
+ // at this point, the stack contains the object at offset -2 and the metatable at offset -1
+ // lua_setmetatable will bind the two together and pop the metatable
+ // our custom function remains on the stack (and that's what we want)
+ lua_setmetatable(state, -2);
+
+ return PushedObject{state, 1};
+ }
+
+ // this is the version of "push" for trivially destructible objects
+ template<typename TFunctionObject>
+ static auto push(lua_State* state, TFunctionObject fn) noexcept
+ -> typename std::enable_if<boost::has_trivial_destructor<TFunctionObject>::value, PushedObject>::type
+ {
+ // TODO: is_move_constructible not supported by some compilers
+ //static_assert(std::is_move_constructible<TFunctionObject>::value, "The function object must be move-constructible");
+
+ // when the lua script calls the thing we will push on the stack, we want "fn" to be executed
+ // since "fn" doesn't need to be destroyed, we simply push it on the stack
+
+ // this is the cfunction that is the callback
+ const auto function = [](lua_State* state_) -> int
+ {
+ // the function object is an upvalue
+ const auto toCall = static_cast<TFunctionObject*>(lua_touserdata(state_, lua_upvalueindex(1)));
+ return callback(state_, toCall, lua_gettop(state_)).release();
+ };
+
+ // we copy the function object onto the stack
+ const auto functionObjectLocation = static_cast<TFunctionObject*>(lua_newuserdata(state, sizeof(TFunctionObject)));
+ new (functionObjectLocation) TFunctionObject(std::move(fn));
+
+ // pushing the function with the function object as upvalue
+ lua_pushcclosure(state, function, 1);
+ return PushedObject{state, 1};
+ }
+
+ // this is the version of "push" for pointer to functions
+ static auto push(lua_State* state, TReturnType (*fn)(TParameters...)) noexcept
+ -> PushedObject
+ {
+ // when the lua script calls the thing we will push on the stack, we want "fn" to be executed
+ // since "fn" doesn't need to be destroyed, we simply push it on the stack
+
+ // this is the cfunction that is the callback
+ const auto function = [](lua_State* state_) -> int
+ {
+ // the function object is an upvalue
+ const auto toCall = reinterpret_cast<TReturnType (*)(TParameters...)>(lua_touserdata(state_, lua_upvalueindex(1)));
+ return callback(state_, toCall, lua_gettop(state_)).release();
+ };
+
+ // we copy the function object onto the stack
+ lua_pushlightuserdata(state, reinterpret_cast<void*>(fn));
+
+ // pushing the function with the function object as upvalue
+ lua_pushcclosure(state, function, 1);
+ return PushedObject{state, 1};
+ }
+
+ // this is the version of "push" for references to functions
+ static auto push(lua_State* state, TReturnType (&fn)(TParameters...)) noexcept
+ -> PushedObject
+ {
+ return push(state, &fn);
+ }
+
+private:
+ // callback that calls the function object
+ // this function is used by the callbacks and handles loading arguments from the stack and pushing the return value back
+ template<typename TFunctionObject>
+ static auto callback(lua_State* state, TFunctionObject* toCall, int argumentsCount)
+ -> PushedObject
+ {
+ // checking if number of parameters is correct
+ if (argumentsCount < LocalFunctionArgumentsCounter::min) {
+ // if not, using lua_error to return an error
+ luaL_where(state, 1);
+ lua_pushstring(state, "This function requires at least ");
+ lua_pushnumber(state, LocalFunctionArgumentsCounter::min);
+ lua_pushstring(state, " parameter(s)");
+ lua_concat(state, 4);
+ luaError(state);
+
+ } else if (argumentsCount > LocalFunctionArgumentsCounter::max) {
+ // if not, using lua_error to return an error
+ luaL_where(state, 1);
+ lua_pushstring(state, "This function requires at most ");
+ lua_pushnumber(state, LocalFunctionArgumentsCounter::max);
+ lua_pushstring(state, " parameter(s)");
+ lua_concat(state, 4);
+ luaError(state);
+ }
+
+ // calling the function
+ try {
+ return callback2(state, *toCall, argumentsCount);
+
+ } catch (const WrongTypeException& ex) {
+ // wrong parameter type, using lua_error to return an error
+ luaL_where(state, 1);
+ lua_pushstring(state, "Unable to convert parameter from ");
+ lua_pushstring(state, ex.luaType.c_str());
+ lua_pushstring(state, " to ");
+ lua_pushstring(state, ex.destination.name());
+ lua_concat(state, 5);
+ luaError(state);
+
+ } catch (const std::exception& e) {
+ luaL_where(state, 1);
+ lua_pushstring(state, "Caught exception: ");
+ lua_pushstring(state, e.what());
+ lua_concat(state, 3);
+ luaError(state);
+ } catch (...) {
+ Pusher<std::exception_ptr>::push(state, std::current_exception()).release();
+ luaError(state);
+ }
+ }
+
+ template<typename TFunctionObject>
+ static auto callback2(lua_State* state, TFunctionObject&& toCall, int argumentsCount)
+ -> typename std::enable_if<!std::is_void<TReturnType>::value && !std::is_void<TFunctionObject>::value, PushedObject>::type
+ {
+ // pushing the result on the stack and returning number of pushed elements
+ typedef Pusher<typename std::decay<TReturnType>::type>
+ P;
+ return P::push(state, readIntoFunction(state, tag<TReturnType>{}, toCall, -argumentsCount, tag<TParameters>{}...));
+ }
+
+ template<typename TFunctionObject>
+ static auto callback2(lua_State* state, TFunctionObject&& toCall, int argumentsCount)
+ -> typename std::enable_if<std::is_void<TReturnType>::value && !std::is_void<TFunctionObject>::value, PushedObject>::type
+ {
+ readIntoFunction(state, tag<TReturnType>{}, toCall, -argumentsCount, tag<TParameters>{}...);
+ return PushedObject{state, 0};
+ }
+};
+
+// C function pointers
+template<typename TReturnType, typename... TParameters>
+struct LuaContext::Pusher<TReturnType (*)(TParameters...)>
+{
+ // using the function-pushing implementation
+ typedef Pusher<TReturnType (TParameters...)>
+ SubPusher;
+ static const int minSize = SubPusher::minSize;
+ static const int maxSize = SubPusher::maxSize;
+
+ template<typename TType>
+ static PushedObject push(lua_State* state, TType value) noexcept {
+ return SubPusher::push(state, value);
+ }
+};
+
+// C function references
+template<typename TReturnType, typename... TParameters>
+struct LuaContext::Pusher<TReturnType (&)(TParameters...)>
+{
+ // using the function-pushing implementation
+ typedef Pusher<TReturnType(TParameters...)>
+ SubPusher;
+ static const int minSize = SubPusher::minSize;
+ static const int maxSize = SubPusher::maxSize;
+
+ template<typename TType>
+ static PushedObject push(lua_State* state, TType value) noexcept {
+ return SubPusher::push(state, value);
+ }
+};
+
+// std::function
+template<typename TReturnType, typename... TParameters>
+struct LuaContext::Pusher<std::function<TReturnType (TParameters...)>>
+{
+ // using the function-pushing implementation
+ typedef Pusher<TReturnType (TParameters...)>
+ SubPusher;
+ static const int minSize = SubPusher::minSize;
+ static const int maxSize = SubPusher::maxSize;
+
+ static PushedObject push(lua_State* state, const std::function<TReturnType (TParameters...)>& value) noexcept {
+ return SubPusher::push(state, value);
+ }
+};
+
+// boost::variant
+template<typename... TTypes>
+struct LuaContext::Pusher<boost::variant<TTypes...>>
+{
+ static const int minSize = PusherMinSize<TTypes...>::size;
+ static const int maxSize = PusherMaxSize<TTypes...>::size;
+
+ static PushedObject push(lua_State* state, const boost::variant<TTypes...>& value) noexcept {
+ PushedObject obj{state, 0};
+ VariantWriter writer{state, obj};
+ value.apply_visitor(writer);
+ return obj;
+ }
+
+private:
+ struct VariantWriter : public boost::static_visitor<> {
+ template<typename TType>
+ void operator()(TType value) noexcept
+ {
+ obj = Pusher<typename std::decay<TType>::type>::push(state, std::move(value));
+ }
+
+ VariantWriter(lua_State* state_, PushedObject& obj_) : state(state_), obj(obj_) {}
+ lua_State* state;
+ PushedObject& obj;
+ };
+};
+
+// boost::optional
+template<typename TType>
+struct LuaContext::Pusher<boost::optional<TType>> {
+ typedef Pusher<typename std::decay<TType>::type>
+ UnderlyingPusher;
+
+ static const int minSize = UnderlyingPusher::minSize < 1 ? UnderlyingPusher::minSize : 1;
+ static const int maxSize = UnderlyingPusher::maxSize > 1 ? UnderlyingPusher::maxSize : 1;
+
+ static PushedObject push(lua_State* state, const boost::optional<TType>& value) noexcept {
+ if (value) {
+ return UnderlyingPusher::push(state, value.get());
+ } else {
+ lua_pushnil(state);
+ return PushedObject{state, 1};
+ }
+ }
+};
+
+// tuple
+template<typename... TTypes>
+struct LuaContext::Pusher<std::tuple<TTypes...>> {
+ // TODO: NOT EXCEPTION SAFE /!\ //
+ static const int minSize = PusherTotalMinSize<TTypes...>::size;
+ static const int maxSize = PusherTotalMaxSize<TTypes...>::size;
+
+ static PushedObject push(lua_State* state, const std::tuple<TTypes...>& value) noexcept {
+ return PushedObject{state, push2(state, value, std::integral_constant<int,0>{})};
+ }
+
+ static PushedObject push(lua_State* state, std::tuple<TTypes...>&& value) noexcept {
+ return PushedObject{state, push2(state, std::move(value), std::integral_constant<int,0>{})};
+ }
+
+private:
+ template<int N>
+ static int push2(lua_State* state, const std::tuple<TTypes...>& value, std::integral_constant<int,N>) noexcept {
+ typedef typename std::tuple_element<N,std::tuple<TTypes...>>::type ElemType;
+
+ return Pusher<typename std::decay<ElemType>::type>::push(state, std::get<N>(value)).release() +
+ push2(state, value, std::integral_constant<int,N+1>{});
+ }
+
+ template<int N>
+ static int push2(lua_State* state, std::tuple<TTypes...>&& value, std::integral_constant<int,N>) noexcept {
+ typedef typename std::tuple_element<N,std::tuple<TTypes...>>::type ElemType;
+
+ return Pusher<typename std::decay<ElemType>::type>::push(state, std::move(std::get<N>(value))).release() +
+ push2(state, std::move(value), std::integral_constant<int,N+1>{});
+ }
+
+ static int push2(lua_State* /*state*/, const std::tuple<TTypes...>&, std::integral_constant<int,sizeof...(TTypes)>) noexcept {
+ return 0;
+ }
+
+ static int push2(lua_State* /*state*/, std::tuple<TTypes...>&&, std::integral_constant<int,sizeof...(TTypes)>) noexcept {
+ return 0;
+ }
+};
+
+/**************************************************/
+/* READ FUNCTIONS */
+/**************************************************/
+// specializations of the Reader structures
+
+// opaque Lua references
+template<>
+struct LuaContext::Reader<LuaContext::LuaObject>
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<LuaContext::LuaObject>
+ {
+ LuaContext::LuaObject obj(state, index);
+ return obj;
+ }
+};
+
+// reading null
+template<>
+struct LuaContext::Reader<std::nullptr_t>
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<std::nullptr_t>
+ {
+ if (!lua_isnil(state, index))
+ return boost::none;
+ return nullptr;
+ }
+};
+
+// integrals
+template<typename TType>
+struct LuaContext::Reader<
+ TType,
+ typename std::enable_if<std::is_integral<TType>::value>::type
+ >
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<TType>
+ {
+# if LUA_VERSION_NUM >= 502
+
+ int success;
+ auto value = lua_tointegerx(state, index, &success);
+ if (success == 0)
+ return boost::none;
+ return static_cast<TType>(value);
+
+# else
+
+ if (!lua_isnumber(state, index))
+ return boost::none;
+ return static_cast<TType>(lua_tointeger(state, index));
+
+# endif
+ }
+};
+
+// floating points
+template<typename TType>
+struct LuaContext::Reader<
+ TType,
+ typename std::enable_if<std::is_floating_point<TType>::value>::type
+ >
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<TType>
+ {
+# if LUA_VERSION_NUM >= 502
+
+ int success;
+ auto value = lua_tonumberx(state, index, &success);
+ if (success == 0)
+ return boost::none;
+ return static_cast<TType>(value);
+
+# else
+
+ if (!lua_isnumber(state, index))
+ return boost::none;
+ return static_cast<TType>(lua_tonumber(state, index));
+
+# endif
+ }
+};
+
+// boolean
+template<>
+struct LuaContext::Reader<bool>
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<bool>
+ {
+ if (!lua_isboolean(state, index))
+ return boost::none;
+ return lua_toboolean(state, index) != 0;
+ }
+};
+
+// string
+// lua_tostring returns a temporary pointer, but that's not a problem since we copy
+// the data into a std::string
+template<>
+struct LuaContext::Reader<std::string>
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<std::string>
+ {
+ std::string result;
+
+ // lua_tolstring might convert the variable that would confuse lua_next, so we
+ // make a copy of the variable.
+ lua_pushvalue(state, index);
+
+ size_t len;
+ const auto val = lua_tolstring(state, -1, &len);
+
+ if (val != nullptr)
+ result.assign(val, len);
+
+ lua_pop(state, 1);
+
+ return val != nullptr ? boost::optional<std::string>{ std::move(result) } : boost::none;
+ }
+};
+
+// enums
+template<typename TType>
+struct LuaContext::Reader<
+ TType,
+ typename std::enable_if<std::is_enum<TType>::value>::type
+ >
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<TType>
+ {
+ if (!lua_isnumber(state, index) || fmod(lua_tonumber(state, index), 1.) != 0)
+ return boost::none;
+ return static_cast<TType>(lua_tointeger(state, index));
+ }
+};
+
+// LuaFunctionCaller
+template<typename TRetValue, typename... TParameters>
+struct LuaContext::Reader<LuaContext::LuaFunctionCaller<TRetValue (TParameters...)>>
+{
+ typedef LuaFunctionCaller<TRetValue (TParameters...)>
+ ReturnType;
+
+ static auto read(lua_State* state, int index)
+ -> boost::optional<ReturnType>
+ {
+ if (lua_isfunction(state, index) == 0 && lua_isuserdata(state, index) == 0)
+ return boost::none;
+ return ReturnType(state, index);
+ }
+};
+
+// function
+template<typename TRetValue, typename... TParameters>
+struct LuaContext::Reader<std::function<TRetValue (TParameters...)>>
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<std::function<TRetValue (TParameters...)>>
+ {
+ if (auto val = Reader<LuaContext::LuaFunctionCaller<TRetValue (TParameters...)>>::read(state, index))
+ {
+ std::function<TRetValue (TParameters...)> f{*val};
+ return boost::optional<std::function<TRetValue (TParameters...)>>{std::move(f)};
+ }
+
+ return boost::none;
+ }
+};
+
+// vector of pairs
+template<typename TType1, typename TType2>
+struct LuaContext::Reader<std::vector<std::pair<TType1,TType2>>>
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<std::vector<std::pair<TType1, TType2>>>
+ {
+ if (!lua_istable(state, index))
+ return boost::none;
+
+ std::vector<std::pair<TType1, TType2>> result;
+
+ // we traverse the table at the top of the stack
+ lua_pushnil(state); // first key
+ while (lua_next(state, (index > 0) ? index : (index - 1)) != 0) {
+ // now a key and its value are pushed on the stack
+ try {
+ auto val1 = Reader<TType1>::read(state, -2);
+ auto val2 = Reader<TType2>::read(state, -1);
+
+ if (!val1.is_initialized() || !val2.is_initialized()) {
+ lua_pop(state, 2); // we remove the value and the key
+ return {};
+ }
+
+ result.push_back({ val1.get(), val2.get() });
+ lua_pop(state, 1); // we remove the value but keep the key for the next iteration
+
+ } catch(...) {
+ lua_pop(state, 2); // we remove the value and the key
+ return {};
+ }
+ }
+
+ return { std::move(result) };
+ }
+};
+
+// map
+template<typename TKey, typename TValue>
+struct LuaContext::Reader<std::map<TKey,TValue>>
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<std::map<TKey,TValue>>
+ {
+ if (!lua_istable(state, index))
+ return boost::none;
+
+ std::map<TKey,TValue> result;
+
+ // we traverse the table at the top of the stack
+ lua_pushnil(state); // first key
+ while (lua_next(state, (index > 0) ? index : (index - 1)) != 0) {
+ // now a key and its value are pushed on the stack
+ try {
+ auto key = Reader<TKey>::read(state, -2);
+ auto value = Reader<TValue>::read(state, -1);
+
+ if (!key.is_initialized() || !value.is_initialized()) {
+ lua_pop(state, 2); // we remove the value and the key
+ return {};
+ }
+
+ result.insert({ key.get(), value.get() });
+ lua_pop(state, 1); // we remove the value but keep the key for the next iteration
+
+ } catch(...) {
+ lua_pop(state, 2); // we remove the value and the key
+ return {};
+ }
+ }
+
+ return { std::move(result) };
+ }
+};
+
+// unordered_map
+template<typename TKey, typename TValue, typename THash, typename TKeyEqual>
+struct LuaContext::Reader<std::unordered_map<TKey,TValue,THash,TKeyEqual>>
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<std::unordered_map<TKey,TValue,THash,TKeyEqual>>
+ {
+ if (!lua_istable(state, index))
+ return boost::none;
+
+ std::unordered_map<TKey,TValue,THash,TKeyEqual> result;
+
+ // we traverse the table at the top of the stack
+ lua_pushnil(state); // first key
+ while (lua_next(state, (index > 0) ? index : (index - 1)) != 0) {
+ // now a key and its value are pushed on the stack
+ try {
+ auto key = Reader<TKey>::read(state, -2);
+ auto value = Reader<TValue>::read(state, -1);
+
+ if (!key.is_initialized() || !value.is_initialized()) {
+ lua_pop(state, 2); // we remove the value and the key
+ return {};
+ }
+
+ result.insert({ key.get(), value.get() });
+ lua_pop(state, 1); // we remove the value but keep the key for the next iteration
+
+ } catch(...) {
+ lua_pop(state, 2); // we remove the value and the key
+ return {};
+ }
+ }
+
+ return { std::move(result) };
+ }
+};
+
+// optional
+// IMPORTANT: optional means "either nil or the value of the right type"
+// * if the value is nil, then an optional containing an empty optional is returned
+// * if the value is of the right type, then an optional containing an optional containing the value is returned
+// * if the value is of the wrong type, then an empty optional is returned
+template<typename TType>
+struct LuaContext::Reader<boost::optional<TType>>
+{
+ static auto read(lua_State* state, int index)
+ -> boost::optional<boost::optional<TType>>
+ {
+ if (lua_isnil(state, index))
+ return boost::optional<TType>{boost::none};
+ if (auto&& other = Reader<TType>::read(state, index))
+ return std::move(other);
+ return boost::none;
+ }
+};
+
+// variant
+template<typename... TTypes>
+struct LuaContext::Reader<boost::variant<TTypes...>>
+{
+ typedef boost::variant<TTypes...>
+ ReturnType;
+
+private:
+ // class doing operations for a range of types from TIterBegin to TIterEnd
+ template<typename TIterBegin, typename TIterEnd, typename = void>
+ struct VariantReader
+ {
+ using SubReader = Reader<typename std::decay<typename boost::mpl::deref<TIterBegin>::type>::type>;
+
+ static auto read(lua_State* state, int index)
+ -> boost::optional<ReturnType>
+ {
+ // note: using SubReader::read triggers a compilation error when used with a reference
+ if (const auto val = SubReader::read(state, index))
+ return boost::variant<TTypes...>{*val};
+ return VariantReader<typename boost::mpl::next<TIterBegin>::type, TIterEnd>::read(state, index);
+ }
+ };
+
+ // specialization of class above being called when list of remaining types is empty
+ template<typename TIterBegin, typename TIterEnd>
+ struct VariantReader<TIterBegin, TIterEnd, typename std::enable_if<boost::mpl::distance<TIterBegin, TIterEnd>::type::value == 0>::type>
+ {
+ static auto read(lua_State* /*state*/, int /*index*/)
+ -> boost::optional<ReturnType>
+ {
+ return boost::none;
+ }
+ };
+
+ // this is the main type
+ typedef VariantReader<typename boost::mpl::begin<typename ReturnType::types>::type, typename boost::mpl::end<typename ReturnType::types>::type>
+ MainVariantReader;
+
+public:
+ static auto read(lua_State* state, int index)
+ -> boost::optional<ReturnType>
+ {
+ return MainVariantReader::read(state, index);
+ }
+};
+
+// reading a tuple
+// tuple have an additional argument for their functions, that is the maximum size to read
+// if maxSize is smaller than the tuple size, then the remaining parameters will be left to default value
+template<>
+struct LuaContext::Reader<std::tuple<>>
+{
+ static auto read(lua_State* /*state*/, int /*index*/, int /*maxSize*/ = 0)
+ -> boost::optional<std::tuple<>>
+ {
+ return std::tuple<>{};
+ }
+};
+
+template<typename TFirst, typename... TOthers>
+struct LuaContext::Reader<std::tuple<TFirst, TOthers...>,
+ typename std::enable_if<!LuaContext::IsOptional<TFirst>::value>::type // TODO: replace by std::is_default_constructible when it works on every compiler
+ >
+{
+ // this is the "TFirst is NOT default constructible" version
+
+ typedef std::tuple<TFirst, TOthers...>
+ ReturnType;
+
+ static auto read(lua_State* state, int index, int maxSize = std::tuple_size<ReturnType>::value)
+ -> boost::optional<ReturnType>
+ {
+ if (maxSize <= 0)
+ return boost::none;
+
+ auto firstVal = Reader<TFirst>::read(state, index);
+ auto othersVal = Reader<std::tuple<TOthers...>>::read(state, index + 1, maxSize - 1);
+
+ if (!firstVal || !othersVal)
+ return boost::none;
+
+ return std::tuple_cat(std::tuple<TFirst>(*firstVal), std::move(*othersVal));
+ }
+};
+
+template<typename TFirst, typename... TOthers>
+struct LuaContext::Reader<std::tuple<TFirst, TOthers...>,
+ typename std::enable_if<LuaContext::IsOptional<TFirst>::value>::type // TODO: replace by std::is_default_constructible when it works on every compiler
+ >
+{
+ // this is the "TFirst is default-constructible" version
+
+ typedef std::tuple<TFirst, TOthers...>
+ ReturnType;
+
+ static auto read(lua_State* state, int index, int maxSize = std::tuple_size<ReturnType>::value)
+ -> boost::optional<ReturnType>
+ {
+ auto othersVal = Reader<std::tuple<TOthers...>>::read(state, index + 1, maxSize - 1);
+ if (!othersVal)
+ return boost::none;
+
+ if (maxSize <= 0)
+ return std::tuple_cat(std::tuple<TFirst>(), std::move(*othersVal));
+
+ auto firstVal = Reader<TFirst>::read(state, index);
+ if (!firstVal)
+ return boost::none;
+
+ return std::tuple_cat(std::tuple<TFirst>(*firstVal), std::move(*othersVal));
+ }
+};
+
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+
+#endif
diff --git a/ext/protozero/include/protozero/basic_pbf_builder.hpp b/ext/protozero/include/protozero/basic_pbf_builder.hpp
new file mode 100644
index 0000000..0ede726
--- /dev/null
+++ b/ext/protozero/include/protozero/basic_pbf_builder.hpp
@@ -0,0 +1,266 @@
+#ifndef PROTOZERO_BASIC_PBF_BUILDER_HPP
+#define PROTOZERO_BASIC_PBF_BUILDER_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file basic_pbf_builder.hpp
+ *
+ * @brief Contains the basic_pbf_builder template class.
+ */
+
+#include "basic_pbf_writer.hpp"
+#include "types.hpp"
+
+#include <type_traits>
+
+namespace protozero {
+
+/**
+ * The basic_pbf_builder is used to write PBF formatted messages into a buffer.
+ * It is based on the basic_pbf_writer class and has all the same methods. The
+ * difference is that while the pbf_writer class takes an integer tag,
+ * this template class takes a tag of the template type T. The idea is that
+ * T will be an enumeration value and this helps reduce the possibility of
+ * programming errors.
+ *
+ * Almost all methods in this class can throw an std::bad_alloc exception if
+ * the underlying buffer class wants to resize.
+ *
+ * Read the tutorial to understand how this class is used. In most cases you
+ * want to use the pbf_builder class which uses a std::string as buffer type.
+ */
+template <typename TBuffer, typename T>
+class basic_pbf_builder : public basic_pbf_writer<TBuffer> {
+
+ static_assert(std::is_same<pbf_tag_type, typename std::underlying_type<T>::type>::value,
+ "T must be enum with underlying type protozero::pbf_tag_type");
+
+public:
+
+ /// The type of messages this class will build.
+ using enum_type = T;
+
+ basic_pbf_builder() = default;
+
+ /**
+ * Create a builder using the given string as a data store. The object
+ * stores a reference to that string and adds all data to it. The string
+ * doesn't have to be empty. The pbf_message object will just append data.
+ */
+ explicit basic_pbf_builder(TBuffer& data) noexcept :
+ basic_pbf_writer<TBuffer>{data} {
+ }
+
+ /**
+ * Construct a pbf_builder for a submessage from the pbf_message or
+ * pbf_writer of the parent message.
+ *
+ * @param parent_writer The parent pbf_message or pbf_writer
+ * @param tag Tag of the field that will be written
+ */
+ template <typename P>
+ basic_pbf_builder(basic_pbf_writer<TBuffer>& parent_writer, P tag) noexcept :
+ basic_pbf_writer<TBuffer>{parent_writer, pbf_tag_type(tag)} {
+ }
+
+/// @cond INTERNAL
+#define PROTOZERO_WRITER_WRAP_ADD_SCALAR(name, type) \
+ void add_##name(T tag, type value) { \
+ basic_pbf_writer<TBuffer>::add_##name(pbf_tag_type(tag), value); \
+ }
+
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(bool, bool)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(enum, int32_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(int32, int32_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(sint32, int32_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(uint32, uint32_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(int64, int64_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(sint64, int64_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(uint64, uint64_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(fixed32, uint32_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(sfixed32, int32_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(fixed64, uint64_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(sfixed64, int64_t)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(float, float)
+ PROTOZERO_WRITER_WRAP_ADD_SCALAR(double, double)
+
+#undef PROTOZERO_WRITER_WRAP_ADD_SCALAR
+/// @endcond
+
+ /**
+ * Add "bytes" field to data.
+ *
+ * @param tag Tag of the field
+ * @param value Pointer to value to be written
+ * @param size Number of bytes to be written
+ */
+ void add_bytes(T tag, const char* value, std::size_t size) {
+ basic_pbf_writer<TBuffer>::add_bytes(pbf_tag_type(tag), value, size);
+ }
+
+ /**
+ * Add "bytes" field to data.
+ *
+ * @param tag Tag of the field
+ * @param value Value to be written
+ */
+ void add_bytes(T tag, const data_view& value) {
+ basic_pbf_writer<TBuffer>::add_bytes(pbf_tag_type(tag), value);
+ }
+
+ /**
+ * Add "bytes" field to data.
+ *
+ * @param tag Tag of the field
+ * @param value Value to be written
+ */
+ void add_bytes(T tag, const std::string& value) {
+ basic_pbf_writer<TBuffer>::add_bytes(pbf_tag_type(tag), value);
+ }
+
+ /**
+ * Add "bytes" field to data. Bytes from the value are written until
+ * a null byte is encountered. The null byte is not added.
+ *
+ * @param tag Tag of the field
+ * @param value Pointer to zero-delimited value to be written
+ */
+ void add_bytes(T tag, const char* value) {
+ basic_pbf_writer<TBuffer>::add_bytes(pbf_tag_type(tag), value);
+ }
+
+ /**
+ * Add "bytes" field to data using vectored input. All the data in the
+ * 2nd and further arguments is "concatenated" with only a single copy
+ * into the final buffer.
+ *
+ * This will work with objects of any type supporting the data() and
+ * size() methods like std::string or protozero::data_view.
+ *
+ * Example:
+ * @code
+ * std::string data1 = "abc";
+ * std::string data2 = "xyz";
+ * builder.add_bytes_vectored(1, data1, data2);
+ * @endcode
+ *
+ * @tparam Ts List of types supporting data() and size() methods.
+ * @param tag Tag of the field
+ * @param values List of objects of types Ts with data to be appended.
+ */
+ template <typename... Ts>
+ void add_bytes_vectored(T tag, Ts&&... values) {
+ basic_pbf_writer<TBuffer>::add_bytes_vectored(pbf_tag_type(tag), std::forward<Ts>(values)...);
+ }
+
+ /**
+ * Add "string" field to data.
+ *
+ * @param tag Tag of the field
+ * @param value Pointer to value to be written
+ * @param size Number of bytes to be written
+ */
+ void add_string(T tag, const char* value, std::size_t size) {
+ basic_pbf_writer<TBuffer>::add_string(pbf_tag_type(tag), value, size);
+ }
+
+ /**
+ * Add "string" field to data.
+ *
+ * @param tag Tag of the field
+ * @param value Value to be written
+ */
+ void add_string(T tag, const data_view& value) {
+ basic_pbf_writer<TBuffer>::add_string(pbf_tag_type(tag), value);
+ }
+
+ /**
+ * Add "string" field to data.
+ *
+ * @param tag Tag of the field
+ * @param value Value to be written
+ */
+ void add_string(T tag, const std::string& value) {
+ basic_pbf_writer<TBuffer>::add_string(pbf_tag_type(tag), value);
+ }
+
+ /**
+ * Add "string" field to data. Bytes from the value are written until
+ * a null byte is encountered. The null byte is not added.
+ *
+ * @param tag Tag of the field
+ * @param value Pointer to value to be written
+ */
+ void add_string(T tag, const char* value) {
+ basic_pbf_writer<TBuffer>::add_string(pbf_tag_type(tag), value);
+ }
+
+ /**
+ * Add "message" field to data.
+ *
+ * @param tag Tag of the field
+ * @param value Pointer to message to be written
+ * @param size Length of the message
+ */
+ void add_message(T tag, const char* value, std::size_t size) {
+ basic_pbf_writer<TBuffer>::add_message(pbf_tag_type(tag), value, size);
+ }
+
+ /**
+ * Add "message" field to data.
+ *
+ * @param tag Tag of the field
+ * @param value Value to be written. The value must be a complete message.
+ */
+ void add_message(T tag, const data_view& value) {
+ basic_pbf_writer<TBuffer>::add_message(pbf_tag_type(tag), value);
+ }
+
+ /**
+ * Add "message" field to data.
+ *
+ * @param tag Tag of the field
+ * @param value Value to be written. The value must be a complete message.
+ */
+ void add_message(T tag, const std::string& value) {
+ basic_pbf_writer<TBuffer>::add_message(pbf_tag_type(tag), value);
+ }
+
+/// @cond INTERNAL
+#define PROTOZERO_WRITER_WRAP_ADD_PACKED(name) \
+ template <typename InputIterator> \
+ void add_packed_##name(T tag, InputIterator first, InputIterator last) { \
+ basic_pbf_writer<TBuffer>::add_packed_##name(pbf_tag_type(tag), first, last); \
+ }
+
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(bool)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(enum)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(int32)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(sint32)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(uint32)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(int64)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(sint64)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(uint64)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(fixed32)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(sfixed32)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(fixed64)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(sfixed64)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(float)
+ PROTOZERO_WRITER_WRAP_ADD_PACKED(double)
+
+#undef PROTOZERO_WRITER_WRAP_ADD_PACKED
+/// @endcond
+
+}; // class basic_pbf_builder
+
+} // end namespace protozero
+
+#endif // PROTOZERO_BASIC_PBF_BUILDER_HPP
diff --git a/ext/protozero/include/protozero/basic_pbf_writer.hpp b/ext/protozero/include/protozero/basic_pbf_writer.hpp
new file mode 100644
index 0000000..f167c4d
--- /dev/null
+++ b/ext/protozero/include/protozero/basic_pbf_writer.hpp
@@ -0,0 +1,1054 @@
+#ifndef PROTOZERO_BASIC_PBF_WRITER_HPP
+#define PROTOZERO_BASIC_PBF_WRITER_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file basic_pbf_writer.hpp
+ *
+ * @brief Contains the basic_pbf_writer template class.
+ */
+
+#include "buffer_tmpl.hpp"
+#include "config.hpp"
+#include "data_view.hpp"
+#include "types.hpp"
+#include "varint.hpp"
+
+#if PROTOZERO_BYTE_ORDER != PROTOZERO_LITTLE_ENDIAN
+# include <protozero/byteswap.hpp>
+#endif
+
+#include <cstddef>
+#include <cstdint>
+#include <cstring>
+#include <initializer_list>
+#include <iterator>
+#include <limits>
+#include <string>
+#include <utility>
+
+namespace protozero {
+
+namespace detail {
+
+ template <typename B, typename T> class packed_field_varint;
+ template <typename B, typename T> class packed_field_svarint;
+ template <typename B, typename T> class packed_field_fixed;
+
+} // end namespace detail
+
+/**
+ * The basic_pbf_writer is used to write PBF formatted messages into a buffer.
+ *
+ * This uses TBuffer as the type for the underlaying buffer. In typical uses
+ * this is std::string, but you can use a different type that must support
+ * the right interface. Please see the documentation for details.
+ *
+ * Almost all methods in this class can throw an std::bad_alloc exception if
+ * the underlying buffer class wants to resize.
+ */
+template <typename TBuffer>
+class basic_pbf_writer {
+
+ // A pointer to a buffer holding the data already written to the PBF
+ // message. For default constructed writers or writers that have been
+ // rolled back, this is a nullptr.
+ TBuffer* m_data = nullptr;
+
+ // A pointer to a parent writer object if this is a submessage. If this
+ // is a top-level writer, it is a nullptr.
+ basic_pbf_writer* m_parent_writer = nullptr;
+
+ // This is usually 0. If there is an open submessage, this is set in the
+ // parent to the rollback position, ie. the last position before the
+ // submessage was started. This is the position where the header of the
+ // submessage starts.
+ std::size_t m_rollback_pos = 0;
+
+ // This is usually 0. If there is an open submessage, this is set in the
+ // parent to the position where the data of the submessage is written to.
+ std::size_t m_pos = 0;
+
+ void add_varint(uint64_t value) {
+ protozero_assert(m_pos == 0 && "you can't add fields to a parent basic_pbf_writer if there is an existing basic_pbf_writer for a submessage");
+ protozero_assert(m_data);
+ add_varint_to_buffer(m_data, value);
+ }
+
+ void add_field(pbf_tag_type tag, pbf_wire_type type) {
+ protozero_assert(((tag > 0 && tag < 19000) || (tag > 19999 && tag <= ((1U << 29U) - 1))) && "tag out of range");
+ const uint32_t b = (tag << 3U) | uint32_t(type);
+ add_varint(b);
+ }
+
+ void add_tagged_varint(pbf_tag_type tag, uint64_t value) {
+ add_field(tag, pbf_wire_type::varint);
+ add_varint(value);
+ }
+
+ template <typename T>
+ void add_fixed(T value) {
+ protozero_assert(m_pos == 0 && "you can't add fields to a parent basic_pbf_writer if there is an existing basic_pbf_writer for a submessage");
+ protozero_assert(m_data);
+#if PROTOZERO_BYTE_ORDER != PROTOZERO_LITTLE_ENDIAN
+ byteswap_inplace(&value);
+#endif
+ buffer_customization<TBuffer>::append(m_data, reinterpret_cast<const char*>(&value), sizeof(T));
+ }
+
+ template <typename T, typename It>
+ void add_packed_fixed(pbf_tag_type tag, It first, It last, std::input_iterator_tag /*unused*/) {
+ if (first == last) {
+ return;
+ }
+
+ basic_pbf_writer sw{*this, tag};
+
+ while (first != last) {
+ sw.add_fixed<T>(*first++);
+ }
+ }
+
+ template <typename T, typename It>
+ void add_packed_fixed(pbf_tag_type tag, It first, It last, std::forward_iterator_tag /*unused*/) {
+ if (first == last) {
+ return;
+ }
+
+ const auto length = std::distance(first, last);
+ add_length_varint(tag, sizeof(T) * pbf_length_type(length));
+ reserve(sizeof(T) * std::size_t(length));
+
+ while (first != last) {
+ add_fixed<T>(*first++);
+ }
+ }
+
+ template <typename It>
+ void add_packed_varint(pbf_tag_type tag, It first, It last) {
+ if (first == last) {
+ return;
+ }
+
+ basic_pbf_writer sw{*this, tag};
+
+ while (first != last) {
+ sw.add_varint(uint64_t(*first++));
+ }
+ }
+
+ template <typename It>
+ void add_packed_svarint(pbf_tag_type tag, It first, It last) {
+ if (first == last) {
+ return;
+ }
+
+ basic_pbf_writer sw{*this, tag};
+
+ while (first != last) {
+ sw.add_varint(encode_zigzag64(*first++));
+ }
+ }
+
+ // The number of bytes to reserve for the varint holding the length of
+ // a length-delimited field. The length has to fit into pbf_length_type,
+ // and a varint needs 8 bit for every 7 bit.
+ enum : int {
+ reserve_bytes = sizeof(pbf_length_type) * 8 / 7 + 1
+ };
+
+ // If m_rollpack_pos is set to this special value, it means that when
+ // the submessage is closed, nothing needs to be done, because the length
+ // of the submessage has already been written correctly.
+ enum : std::size_t {
+ size_is_known = std::numeric_limits<std::size_t>::max()
+ };
+
+ void open_submessage(pbf_tag_type tag, std::size_t size) {
+ protozero_assert(m_pos == 0);
+ protozero_assert(m_data);
+ if (size == 0) {
+ m_rollback_pos = buffer_customization<TBuffer>::size(m_data);
+ add_field(tag, pbf_wire_type::length_delimited);
+ buffer_customization<TBuffer>::append_zeros(m_data, std::size_t(reserve_bytes));
+ } else {
+ m_rollback_pos = size_is_known;
+ add_length_varint(tag, pbf_length_type(size));
+ reserve(size);
+ }
+ m_pos = buffer_customization<TBuffer>::size(m_data);
+ }
+
+ void rollback_submessage() {
+ protozero_assert(m_pos != 0);
+ protozero_assert(m_rollback_pos != size_is_known);
+ protozero_assert(m_data);
+ buffer_customization<TBuffer>::resize(m_data, m_rollback_pos);
+ m_pos = 0;
+ }
+
+ void commit_submessage() {
+ protozero_assert(m_pos != 0);
+ protozero_assert(m_rollback_pos != size_is_known);
+ protozero_assert(m_data);
+ const auto length = pbf_length_type(buffer_customization<TBuffer>::size(m_data) - m_pos);
+
+ protozero_assert(buffer_customization<TBuffer>::size(m_data) >= m_pos - reserve_bytes);
+ const auto n = add_varint_to_buffer(buffer_customization<TBuffer>::at_pos(m_data, m_pos - reserve_bytes), length);
+
+ buffer_customization<TBuffer>::erase_range(m_data, m_pos - reserve_bytes + n, m_pos);
+ m_pos = 0;
+ }
+
+ void close_submessage() {
+ protozero_assert(m_data);
+ if (m_pos == 0 || m_rollback_pos == size_is_known) {
+ return;
+ }
+ if (buffer_customization<TBuffer>::size(m_data) - m_pos == 0) {
+ rollback_submessage();
+ } else {
+ commit_submessage();
+ }
+ }
+
+ void add_length_varint(pbf_tag_type tag, pbf_length_type length) {
+ add_field(tag, pbf_wire_type::length_delimited);
+ add_varint(length);
+ }
+
+public:
+
+ /**
+ * Create a writer using the specified buffer as a data store. The
+ * basic_pbf_writer stores a pointer to that buffer and adds all data to
+ * it. The buffer doesn't have to be empty. The basic_pbf_writer will just
+ * append data.
+ */
+ explicit basic_pbf_writer(TBuffer& buffer) noexcept :
+ m_data{&buffer} {
+ }
+
+ /**
+ * Create a writer without a data store. In this form the writer can not
+ * be used!
+ */
+ basic_pbf_writer() noexcept = default;
+
+ /**
+ * Construct a basic_pbf_writer for a submessage from the basic_pbf_writer
+ * of the parent message.
+ *
+ * @param parent_writer The basic_pbf_writer
+ * @param tag Tag (field number) of the field that will be written
+ * @param size Optional size of the submessage in bytes (use 0 for unknown).
+ * Setting this allows some optimizations but is only possible in
+ * a few very specific cases.
+ */
+ basic_pbf_writer(basic_pbf_writer& parent_writer, pbf_tag_type tag, std::size_t size = 0) :
+ m_data{parent_writer.m_data},
+ m_parent_writer{&parent_writer} {
+ m_parent_writer->open_submessage(tag, size);
+ }
+
+ /// A basic_pbf_writer object can not be copied
+ basic_pbf_writer(const basic_pbf_writer&) = delete;
+
+ /// A basic_pbf_writer object can not be copied
+ basic_pbf_writer& operator=(const basic_pbf_writer&) = delete;
+
+ /**
+ * A basic_pbf_writer object can be moved. After this the other
+ * basic_pbf_writer will be invalid.
+ */
+ basic_pbf_writer(basic_pbf_writer&& other) noexcept :
+ m_data{other.m_data},
+ m_parent_writer{other.m_parent_writer},
+ m_rollback_pos{other.m_rollback_pos},
+ m_pos{other.m_pos} {
+ other.m_data = nullptr;
+ other.m_parent_writer = nullptr;
+ other.m_rollback_pos = 0;
+ other.m_pos = 0;
+ }
+
+ /**
+ * A basic_pbf_writer object can be moved. After this the other
+ * basic_pbf_writer will be invalid.
+ */
+ basic_pbf_writer& operator=(basic_pbf_writer&& other) noexcept {
+ m_data = other.m_data;
+ m_parent_writer = other.m_parent_writer;
+ m_rollback_pos = other.m_rollback_pos;
+ m_pos = other.m_pos;
+ other.m_data = nullptr;
+ other.m_parent_writer = nullptr;
+ other.m_rollback_pos = 0;
+ other.m_pos = 0;
+ return *this;
+ }
+
+ ~basic_pbf_writer() noexcept {
+ try {
+ if (m_parent_writer != nullptr) {
+ m_parent_writer->close_submessage();
+ }
+ } catch (...) {
+ // This try/catch is used to make the destructor formally noexcept.
+ // close_submessage() is not noexcept, but will not throw the way
+ // it is called here, so we are good. But to be paranoid, call...
+ std::terminate();
+ }
+ }
+
+ /**
+ * Check if this writer is valid. A writer is invalid if it was default
+ * constructed, moved from, or if commit() has been called on it.
+ * Otherwise it is valid.
+ */
+ bool valid() const noexcept {
+ return m_data != nullptr;
+ }
+
+ /**
+ * Swap the contents of this object with the other.
+ *
+ * @param other Other object to swap data with.
+ */
+ void swap(basic_pbf_writer& other) noexcept {
+ using std::swap;
+ swap(m_data, other.m_data);
+ swap(m_parent_writer, other.m_parent_writer);
+ swap(m_rollback_pos, other.m_rollback_pos);
+ swap(m_pos, other.m_pos);
+ }
+
+ /**
+ * Reserve size bytes in the underlying message store in addition to
+ * whatever the message store already holds. So unlike
+ * the `std::string::reserve()` method this is not an absolute size,
+ * but additional memory that should be reserved.
+ *
+ * @param size Number of bytes to reserve in underlying message store.
+ */
+ void reserve(std::size_t size) {
+ protozero_assert(m_data);
+ buffer_customization<TBuffer>::reserve_additional(m_data, size);
+ }
+
+ /**
+ * Commit this submessage. This does the same as when the basic_pbf_writer
+ * goes out of scope and is destructed.
+ *
+ * @pre Must be a basic_pbf_writer of a submessage, ie one opened with the
+ * basic_pbf_writer constructor taking a parent message.
+ * @post The basic_pbf_writer is invalid and can't be used any more.
+ */
+ void commit() {
+ protozero_assert(m_parent_writer && "you can't call commit() on a basic_pbf_writer without a parent");
+ protozero_assert(m_pos == 0 && "you can't call commit() on a basic_pbf_writer that has an open nested submessage");
+ m_parent_writer->close_submessage();
+ m_parent_writer = nullptr;
+ m_data = nullptr;
+ }
+
+ /**
+ * Cancel writing of this submessage. The complete submessage will be
+ * removed as if it was never created and no fields were added.
+ *
+ * @pre Must be a basic_pbf_writer of a submessage, ie one opened with the
+ * basic_pbf_writer constructor taking a parent message.
+ * @post The basic_pbf_writer is invalid and can't be used any more.
+ */
+ void rollback() {
+ protozero_assert(m_parent_writer && "you can't call rollback() on a basic_pbf_writer without a parent");
+ protozero_assert(m_pos == 0 && "you can't call rollback() on a basic_pbf_writer that has an open nested submessage");
+ m_parent_writer->rollback_submessage();
+ m_parent_writer = nullptr;
+ m_data = nullptr;
+ }
+
+ ///@{
+ /**
+ * @name Scalar field writer functions
+ */
+
+ /**
+ * Add "bool" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_bool(pbf_tag_type tag, bool value) {
+ add_field(tag, pbf_wire_type::varint);
+ protozero_assert(m_pos == 0 && "you can't add fields to a parent basic_pbf_writer if there is an existing basic_pbf_writer for a submessage");
+ protozero_assert(m_data);
+ m_data->push_back(char(value));
+ }
+
+ /**
+ * Add "enum" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_enum(pbf_tag_type tag, int32_t value) {
+ add_tagged_varint(tag, uint64_t(value));
+ }
+
+ /**
+ * Add "int32" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_int32(pbf_tag_type tag, int32_t value) {
+ add_tagged_varint(tag, uint64_t(value));
+ }
+
+ /**
+ * Add "sint32" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_sint32(pbf_tag_type tag, int32_t value) {
+ add_tagged_varint(tag, encode_zigzag32(value));
+ }
+
+ /**
+ * Add "uint32" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_uint32(pbf_tag_type tag, uint32_t value) {
+ add_tagged_varint(tag, value);
+ }
+
+ /**
+ * Add "int64" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_int64(pbf_tag_type tag, int64_t value) {
+ add_tagged_varint(tag, uint64_t(value));
+ }
+
+ /**
+ * Add "sint64" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_sint64(pbf_tag_type tag, int64_t value) {
+ add_tagged_varint(tag, encode_zigzag64(value));
+ }
+
+ /**
+ * Add "uint64" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_uint64(pbf_tag_type tag, uint64_t value) {
+ add_tagged_varint(tag, value);
+ }
+
+ /**
+ * Add "fixed32" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_fixed32(pbf_tag_type tag, uint32_t value) {
+ add_field(tag, pbf_wire_type::fixed32);
+ add_fixed<uint32_t>(value);
+ }
+
+ /**
+ * Add "sfixed32" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_sfixed32(pbf_tag_type tag, int32_t value) {
+ add_field(tag, pbf_wire_type::fixed32);
+ add_fixed<int32_t>(value);
+ }
+
+ /**
+ * Add "fixed64" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_fixed64(pbf_tag_type tag, uint64_t value) {
+ add_field(tag, pbf_wire_type::fixed64);
+ add_fixed<uint64_t>(value);
+ }
+
+ /**
+ * Add "sfixed64" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_sfixed64(pbf_tag_type tag, int64_t value) {
+ add_field(tag, pbf_wire_type::fixed64);
+ add_fixed<int64_t>(value);
+ }
+
+ /**
+ * Add "float" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_float(pbf_tag_type tag, float value) {
+ add_field(tag, pbf_wire_type::fixed32);
+ add_fixed<float>(value);
+ }
+
+ /**
+ * Add "double" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_double(pbf_tag_type tag, double value) {
+ add_field(tag, pbf_wire_type::fixed64);
+ add_fixed<double>(value);
+ }
+
+ /**
+ * Add "bytes" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Pointer to value to be written
+ * @param size Number of bytes to be written
+ */
+ void add_bytes(pbf_tag_type tag, const char* value, std::size_t size) {
+ protozero_assert(m_pos == 0 && "you can't add fields to a parent basic_pbf_writer if there is an existing basic_pbf_writer for a submessage");
+ protozero_assert(m_data);
+ protozero_assert(size <= std::numeric_limits<pbf_length_type>::max());
+ add_length_varint(tag, pbf_length_type(size));
+ buffer_customization<TBuffer>::append(m_data, value, size);
+ }
+
+ /**
+ * Add "bytes" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_bytes(pbf_tag_type tag, const data_view& value) {
+ add_bytes(tag, value.data(), value.size());
+ }
+
+ /**
+ * Add "bytes" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_bytes(pbf_tag_type tag, const std::string& value) {
+ add_bytes(tag, value.data(), value.size());
+ }
+
+ /**
+ * Add "bytes" field to data. Bytes from the value are written until
+ * a null byte is encountered. The null byte is not added.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Pointer to zero-delimited value to be written
+ */
+ void add_bytes(pbf_tag_type tag, const char* value) {
+ add_bytes(tag, value, std::strlen(value));
+ }
+
+ /**
+ * Add "bytes" field to data using vectored input. All the data in the
+ * 2nd and further arguments is "concatenated" with only a single copy
+ * into the final buffer.
+ *
+ * This will work with objects of any type supporting the data() and
+ * size() methods like std::string or protozero::data_view.
+ *
+ * Example:
+ * @code
+ * std::string data1 = "abc";
+ * std::string data2 = "xyz";
+ * writer.add_bytes_vectored(1, data1, data2);
+ * @endcode
+ *
+ * @tparam Ts List of types supporting data() and size() methods.
+ * @param tag Tag (field number) of the field
+ * @param values List of objects of types Ts with data to be appended.
+ */
+ template <typename... Ts>
+ void add_bytes_vectored(pbf_tag_type tag, Ts&&... values) {
+ protozero_assert(m_pos == 0 && "you can't add fields to a parent basic_pbf_writer if there is an existing basic_pbf_writer for a submessage");
+ protozero_assert(m_data);
+ size_t sum_size = 0;
+ (void)std::initializer_list<size_t>{sum_size += values.size()...};
+ protozero_assert(sum_size <= std::numeric_limits<pbf_length_type>::max());
+ add_length_varint(tag, pbf_length_type(sum_size));
+ buffer_customization<TBuffer>::reserve_additional(m_data, sum_size);
+ (void)std::initializer_list<int>{(buffer_customization<TBuffer>::append(m_data, values.data(), values.size()), 0)...};
+ }
+
+ /**
+ * Add "string" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Pointer to value to be written
+ * @param size Number of bytes to be written
+ */
+ void add_string(pbf_tag_type tag, const char* value, std::size_t size) {
+ add_bytes(tag, value, size);
+ }
+
+ /**
+ * Add "string" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_string(pbf_tag_type tag, const data_view& value) {
+ add_bytes(tag, value.data(), value.size());
+ }
+
+ /**
+ * Add "string" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written
+ */
+ void add_string(pbf_tag_type tag, const std::string& value) {
+ add_bytes(tag, value.data(), value.size());
+ }
+
+ /**
+ * Add "string" field to data. Bytes from the value are written until
+ * a null byte is encountered. The null byte is not added.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Pointer to value to be written
+ */
+ void add_string(pbf_tag_type tag, const char* value) {
+ add_bytes(tag, value, std::strlen(value));
+ }
+
+ /**
+ * Add "message" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Pointer to message to be written
+ * @param size Length of the message
+ */
+ void add_message(pbf_tag_type tag, const char* value, std::size_t size) {
+ add_bytes(tag, value, size);
+ }
+
+ /**
+ * Add "message" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written. The value must be a complete message.
+ */
+ void add_message(pbf_tag_type tag, const data_view& value) {
+ add_bytes(tag, value.data(), value.size());
+ }
+
+ /**
+ * Add "message" field to data.
+ *
+ * @param tag Tag (field number) of the field
+ * @param value Value to be written. The value must be a complete message.
+ */
+ void add_message(pbf_tag_type tag, const std::string& value) {
+ add_bytes(tag, value.data(), value.size());
+ }
+
+ ///@}
+
+ ///@{
+ /**
+ * @name Repeated packed field writer functions
+ */
+
+ /**
+ * Add "repeated packed bool" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to bool.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_bool(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_varint(tag, first, last);
+ }
+
+ /**
+ * Add "repeated packed enum" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to int32_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_enum(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_varint(tag, first, last);
+ }
+
+ /**
+ * Add "repeated packed int32" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to int32_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_int32(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_varint(tag, first, last);
+ }
+
+ /**
+ * Add "repeated packed sint32" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to int32_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_sint32(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_svarint(tag, first, last);
+ }
+
+ /**
+ * Add "repeated packed uint32" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to uint32_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_uint32(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_varint(tag, first, last);
+ }
+
+ /**
+ * Add "repeated packed int64" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to int64_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_int64(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_varint(tag, first, last);
+ }
+
+ /**
+ * Add "repeated packed sint64" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to int64_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_sint64(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_svarint(tag, first, last);
+ }
+
+ /**
+ * Add "repeated packed uint64" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to uint64_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_uint64(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_varint(tag, first, last);
+ }
+
+ /**
+ * Add a "repeated packed" fixed-size field to data. The following
+ * fixed-size fields are available:
+ *
+ * uint32_t -> repeated packed fixed32
+ * int32_t -> repeated packed sfixed32
+ * uint64_t -> repeated packed fixed64
+ * int64_t -> repeated packed sfixed64
+ * double -> repeated packed double
+ * float -> repeated packed float
+ *
+ * @tparam ValueType One of the following types: (u)int32/64_t, double, float.
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename ValueType, typename InputIterator>
+ void add_packed_fixed(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ static_assert(std::is_same<ValueType, uint32_t>::value ||
+ std::is_same<ValueType, int32_t>::value ||
+ std::is_same<ValueType, int64_t>::value ||
+ std::is_same<ValueType, uint64_t>::value ||
+ std::is_same<ValueType, double>::value ||
+ std::is_same<ValueType, float>::value, "Only some types are allowed");
+ add_packed_fixed<ValueType, InputIterator>(tag, first, last,
+ typename std::iterator_traits<InputIterator>::iterator_category{});
+ }
+
+ /**
+ * Add "repeated packed fixed32" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to uint32_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_fixed32(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_fixed<uint32_t, InputIterator>(tag, first, last,
+ typename std::iterator_traits<InputIterator>::iterator_category{});
+ }
+
+ /**
+ * Add "repeated packed sfixed32" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to int32_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_sfixed32(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_fixed<int32_t, InputIterator>(tag, first, last,
+ typename std::iterator_traits<InputIterator>::iterator_category{});
+ }
+
+ /**
+ * Add "repeated packed fixed64" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to uint64_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_fixed64(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_fixed<uint64_t, InputIterator>(tag, first, last,
+ typename std::iterator_traits<InputIterator>::iterator_category{});
+ }
+
+ /**
+ * Add "repeated packed sfixed64" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to int64_t.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_sfixed64(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_fixed<int64_t, InputIterator>(tag, first, last,
+ typename std::iterator_traits<InputIterator>::iterator_category{});
+ }
+
+ /**
+ * Add "repeated packed float" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to float.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_float(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_fixed<float, InputIterator>(tag, first, last,
+ typename std::iterator_traits<InputIterator>::iterator_category{});
+ }
+
+ /**
+ * Add "repeated packed double" field to data.
+ *
+ * @tparam InputIterator A type satisfying the InputIterator concept.
+ * Dereferencing the iterator must yield a type assignable to double.
+ * @param tag Tag (field number) of the field
+ * @param first Iterator pointing to the beginning of the data
+ * @param last Iterator pointing one past the end of data
+ */
+ template <typename InputIterator>
+ void add_packed_double(pbf_tag_type tag, InputIterator first, InputIterator last) {
+ add_packed_fixed<double, InputIterator>(tag, first, last,
+ typename std::iterator_traits<InputIterator>::iterator_category{});
+ }
+
+ ///@}
+
+ template <typename B, typename T> friend class detail::packed_field_varint;
+ template <typename B, typename T> friend class detail::packed_field_svarint;
+ template <typename B, typename T> friend class detail::packed_field_fixed;
+
+}; // class basic_pbf_writer
+
+/**
+ * Swap two basic_pbf_writer objects.
+ *
+ * @param lhs First object.
+ * @param rhs Second object.
+ */
+template <typename TBuffer>
+inline void swap(basic_pbf_writer<TBuffer>& lhs, basic_pbf_writer<TBuffer>& rhs) noexcept {
+ lhs.swap(rhs);
+}
+
+namespace detail {
+
+ template <typename TBuffer>
+ class packed_field {
+
+ basic_pbf_writer<TBuffer> m_writer{};
+
+ public:
+
+ packed_field(const packed_field&) = delete;
+ packed_field& operator=(const packed_field&) = delete;
+
+ packed_field(packed_field&&) noexcept = default;
+ packed_field& operator=(packed_field&&) noexcept = default;
+
+ packed_field() = default;
+
+ packed_field(basic_pbf_writer<TBuffer>& parent_writer, pbf_tag_type tag) :
+ m_writer{parent_writer, tag} {
+ }
+
+ packed_field(basic_pbf_writer<TBuffer>& parent_writer, pbf_tag_type tag, std::size_t size) :
+ m_writer{parent_writer, tag, size} {
+ }
+
+ ~packed_field() noexcept = default;
+
+ bool valid() const noexcept {
+ return m_writer.valid();
+ }
+
+ void commit() {
+ m_writer.commit();
+ }
+
+ void rollback() {
+ m_writer.rollback();
+ }
+
+ basic_pbf_writer<TBuffer>& writer() noexcept {
+ return m_writer;
+ }
+
+ }; // class packed_field
+
+ template <typename TBuffer, typename T>
+ class packed_field_fixed : public packed_field<TBuffer> {
+
+ public:
+
+ packed_field_fixed() :
+ packed_field<TBuffer>{} {
+ }
+
+ template <typename P>
+ packed_field_fixed(basic_pbf_writer<TBuffer>& parent_writer, P tag) :
+ packed_field<TBuffer>{parent_writer, static_cast<pbf_tag_type>(tag)} {
+ }
+
+ template <typename P>
+ packed_field_fixed(basic_pbf_writer<TBuffer>& parent_writer, P tag, std::size_t size) :
+ packed_field<TBuffer>{parent_writer, static_cast<pbf_tag_type>(tag), size * sizeof(T)} {
+ }
+
+ void add_element(T value) {
+ this->writer().template add_fixed<T>(value);
+ }
+
+ }; // class packed_field_fixed
+
+ template <typename TBuffer, typename T>
+ class packed_field_varint : public packed_field<TBuffer> {
+
+ public:
+
+ packed_field_varint() :
+ packed_field<TBuffer>{} {
+ }
+
+ template <typename P>
+ packed_field_varint(basic_pbf_writer<TBuffer>& parent_writer, P tag) :
+ packed_field<TBuffer>{parent_writer, static_cast<pbf_tag_type>(tag)} {
+ }
+
+ void add_element(T value) {
+ this->writer().add_varint(uint64_t(value));
+ }
+
+ }; // class packed_field_varint
+
+ template <typename TBuffer, typename T>
+ class packed_field_svarint : public packed_field<TBuffer> {
+
+ public:
+
+ packed_field_svarint() :
+ packed_field<TBuffer>{} {
+ }
+
+ template <typename P>
+ packed_field_svarint(basic_pbf_writer<TBuffer>& parent_writer, P tag) :
+ packed_field<TBuffer>{parent_writer, static_cast<pbf_tag_type>(tag)} {
+ }
+
+ void add_element(T value) {
+ this->writer().add_varint(encode_zigzag64(value));
+ }
+
+ }; // class packed_field_svarint
+
+} // end namespace detail
+
+} // end namespace protozero
+
+#endif // PROTOZERO_BASIC_PBF_WRITER_HPP
diff --git a/ext/protozero/include/protozero/buffer_fixed.hpp b/ext/protozero/include/protozero/buffer_fixed.hpp
new file mode 100644
index 0000000..b2e6d1d
--- /dev/null
+++ b/ext/protozero/include/protozero/buffer_fixed.hpp
@@ -0,0 +1,222 @@
+#ifndef PROTOZERO_BUFFER_FIXED_HPP
+#define PROTOZERO_BUFFER_FIXED_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file buffer_fixed.hpp
+ *
+ * @brief Contains the fixed_size_buffer_adaptor class.
+ */
+
+#include "buffer_tmpl.hpp"
+#include "config.hpp"
+
+#include <algorithm>
+#include <cstddef>
+#include <iterator>
+#include <stdexcept>
+
+namespace protozero {
+
+/**
+ * This class can be used instead of std::string if you want to create a
+ * vector tile in a fixed-size buffer. Any operation that needs more space
+ * than is available will fail with a std::length_error exception.
+ */
+class fixed_size_buffer_adaptor {
+
+ char* m_data;
+ std::size_t m_capacity;
+ std::size_t m_size = 0;
+
+public:
+
+ /// @cond usual container typedefs not documented
+
+ using size_type = std::size_t;
+
+ using value_type = char;
+ using reference = value_type&;
+ using const_reference = const value_type&;
+ using pointer = value_type*;
+ using const_pointer = const value_type*;
+
+ using iterator = pointer;
+ using const_iterator = const_pointer;
+
+ /// @endcond
+
+ /**
+ * Constructor.
+ *
+ * @param data Pointer to some memory allocated for the buffer.
+ * @param capacity Number of bytes available.
+ */
+ fixed_size_buffer_adaptor(char* data, std::size_t capacity) noexcept :
+ m_data(data),
+ m_capacity(capacity) {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param container Some container class supporting the member functions
+ * data() and size().
+ */
+ template <typename T>
+ explicit fixed_size_buffer_adaptor(T& container) :
+ m_data(container.data()),
+ m_capacity(container.size()) {
+ }
+
+ /// Returns a pointer to the data in the buffer.
+ const char* data() const noexcept {
+ return m_data;
+ }
+
+ /// Returns a pointer to the data in the buffer.
+ char* data() noexcept {
+ return m_data;
+ }
+
+ /// The capacity this buffer was created with.
+ std::size_t capacity() const noexcept {
+ return m_capacity;
+ }
+
+ /// The number of bytes used in the buffer. Always <= capacity().
+ std::size_t size() const noexcept {
+ return m_size;
+ }
+
+ /// Return iterator to beginning of data.
+ char* begin() noexcept {
+ return m_data;
+ }
+
+ /// Return iterator to beginning of data.
+ const char* begin() const noexcept {
+ return m_data;
+ }
+
+ /// Return iterator to beginning of data.
+ const char* cbegin() const noexcept {
+ return m_data;
+ }
+
+ /// Return iterator to end of data.
+ char* end() noexcept {
+ return m_data + m_size;
+ }
+
+ /// Return iterator to end of data.
+ const char* end() const noexcept {
+ return m_data + m_size;
+ }
+
+ /// Return iterator to end of data.
+ const char* cend() const noexcept {
+ return m_data + m_size;
+ }
+
+/// @cond INTERNAL
+
+ // Do not rely on anything beyond this point
+
+ void append(const char* data, std::size_t count) {
+ if (m_size + count > m_capacity) {
+ throw std::length_error{"fixed size data store exhausted"};
+ }
+ std::copy_n(data, count, m_data + m_size);
+ m_size += count;
+ }
+
+ void append_zeros(std::size_t count) {
+ if (m_size + count > m_capacity) {
+ throw std::length_error{"fixed size data store exhausted"};
+ }
+ std::fill_n(m_data + m_size, count, '\0');
+ m_size += count;
+ }
+
+ void resize(std::size_t size) {
+ protozero_assert(size < m_size);
+ if (size > m_capacity) {
+ throw std::length_error{"fixed size data store exhausted"};
+ }
+ m_size = size;
+ }
+
+ void erase_range(std::size_t from, std::size_t to) {
+ protozero_assert(from <= m_size);
+ protozero_assert(to <= m_size);
+ protozero_assert(from < to);
+ std::copy(m_data + to, m_data + m_size, m_data + from);
+ m_size -= (to - from);
+ }
+
+ char* at_pos(std::size_t pos) {
+ protozero_assert(pos <= m_size);
+ return m_data + pos;
+ }
+
+ void push_back(char ch) {
+ if (m_size >= m_capacity) {
+ throw std::length_error{"fixed size data store exhausted"};
+ }
+ m_data[m_size++] = ch;
+ }
+/// @endcond
+
+}; // class fixed_size_buffer_adaptor
+
+/// @cond INTERNAL
+template <>
+struct buffer_customization<fixed_size_buffer_adaptor> {
+
+ static std::size_t size(const fixed_size_buffer_adaptor* buffer) noexcept {
+ return buffer->size();
+ }
+
+ static void append(fixed_size_buffer_adaptor* buffer, const char* data, std::size_t count) {
+ buffer->append(data, count);
+ }
+
+ static void append_zeros(fixed_size_buffer_adaptor* buffer, std::size_t count) {
+ buffer->append_zeros(count);
+ }
+
+ static void resize(fixed_size_buffer_adaptor* buffer, std::size_t size) {
+ buffer->resize(size);
+ }
+
+ static void reserve_additional(fixed_size_buffer_adaptor* /*buffer*/, std::size_t /*size*/) {
+ /* nothing to be done for fixed-size buffers */
+ }
+
+ static void erase_range(fixed_size_buffer_adaptor* buffer, std::size_t from, std::size_t to) {
+ buffer->erase_range(from, to);
+ }
+
+ static char* at_pos(fixed_size_buffer_adaptor* buffer, std::size_t pos) {
+ return buffer->at_pos(pos);
+ }
+
+ static void push_back(fixed_size_buffer_adaptor* buffer, char ch) {
+ buffer->push_back(ch);
+ }
+
+};
+/// @endcond
+
+} // namespace protozero
+
+#endif // PROTOZERO_BUFFER_FIXED_HPP
diff --git a/ext/protozero/include/protozero/buffer_string.hpp b/ext/protozero/include/protozero/buffer_string.hpp
new file mode 100644
index 0000000..1f0f902
--- /dev/null
+++ b/ext/protozero/include/protozero/buffer_string.hpp
@@ -0,0 +1,76 @@
+#ifndef PROTOZERO_BUFFER_STRING_HPP
+#define PROTOZERO_BUFFER_STRING_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file buffer_string.hpp
+ *
+ * @brief Contains the customization points for buffer implementation based
+ * on std::string
+ */
+
+#include "buffer_tmpl.hpp"
+
+#include <cstddef>
+#include <iterator>
+#include <string>
+
+namespace protozero {
+
+// Implementation of buffer customizations points for std::string
+
+/// @cond INTERNAL
+template <>
+struct buffer_customization<std::string> {
+
+ static std::size_t size(const std::string* buffer) noexcept {
+ return buffer->size();
+ }
+
+ static void append(std::string* buffer, const char* data, std::size_t count) {
+ buffer->append(data, count);
+ }
+
+ static void append_zeros(std::string* buffer, std::size_t count) {
+ buffer->append(count, '\0');
+ }
+
+ static void resize(std::string* buffer, std::size_t size) {
+ protozero_assert(size < buffer->size());
+ buffer->resize(size);
+ }
+
+ static void reserve_additional(std::string* buffer, std::size_t size) {
+ buffer->reserve(buffer->size() + size);
+ }
+
+ static void erase_range(std::string* buffer, std::size_t from, std::size_t to) {
+ protozero_assert(from <= buffer->size());
+ protozero_assert(to <= buffer->size());
+ protozero_assert(from <= to);
+ buffer->erase(std::next(buffer->begin(), from), std::next(buffer->begin(), to));
+ }
+
+ static char* at_pos(std::string* buffer, std::size_t pos) {
+ protozero_assert(pos <= buffer->size());
+ return (&*buffer->begin()) + pos;
+ }
+
+ static void push_back(std::string* buffer, char ch) {
+ buffer->push_back(ch);
+ }
+
+};
+/// @endcond
+
+} // namespace protozero
+
+#endif // PROTOZERO_BUFFER_STRING_HPP
diff --git a/ext/protozero/include/protozero/buffer_tmpl.hpp b/ext/protozero/include/protozero/buffer_tmpl.hpp
new file mode 100644
index 0000000..ac22399
--- /dev/null
+++ b/ext/protozero/include/protozero/buffer_tmpl.hpp
@@ -0,0 +1,113 @@
+#ifndef PROTOZERO_BUFFER_TMPL_HPP
+#define PROTOZERO_BUFFER_TMPL_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file buffer_tmpl.hpp
+ *
+ * @brief Contains the customization points for buffer implementations.
+ */
+
+#include <cstddef>
+#include <iterator>
+#include <string>
+
+namespace protozero {
+
+// Implementation of buffer customizations points for std::string
+
+/// @cond INTERNAL
+template <typename T>
+struct buffer_customization {
+
+ /**
+ * Get the number of bytes currently used in the buffer.
+ *
+ * @param buffer Pointer to the buffer.
+ * @returns number of bytes used in the buffer.
+ */
+ static std::size_t size(const std::string* buffer);
+
+ /**
+ * Append count bytes from data to the buffer.
+ *
+ * @param buffer Pointer to the buffer.
+ * @param data Pointer to the data.
+ * @param count Number of bytes to be added to the buffer.
+ */
+ static void append(std::string* buffer, const char* data, std::size_t count);
+
+ /**
+ * Append count zero bytes to the buffer.
+ *
+ * @param buffer Pointer to the buffer.
+ * @param count Number of bytes to be added to the buffer.
+ */
+ static void append_zeros(std::string* buffer, std::size_t count);
+
+ /**
+ * Shrink the buffer to the specified size. The new size will always be
+ * smaller than the current size.
+ *
+ * @param buffer Pointer to the buffer.
+ * @param size New size of the buffer.
+ *
+ * @pre size < current size of buffer
+ */
+ static void resize(std::string* buffer, std::size_t size);
+
+ /**
+ * Reserve an additional size bytes for use in the buffer. This is used for
+ * variable-sized buffers to tell the buffer implementation that soon more
+ * memory will be used. The implementation can ignore this.
+ *
+ * @param buffer Pointer to the buffer.
+ * @param size Number of bytes to reserve.
+ */
+ static void reserve_additional(std::string* buffer, std::size_t size);
+
+ /**
+ * Delete data from the buffer. This must move back the data after the
+ * part being deleted and resize the buffer accordingly.
+ *
+ * @param buffer Pointer to the buffer.
+ * @param from Offset into the buffer where we want to erase from.
+ * @param to Offset into the buffer one past the last byte we want to erase.
+ *
+ * @pre from, to <= size of the buffer, from < to
+ */
+ static void erase_range(std::string* buffer, std::size_t from, std::size_t to);
+
+ /**
+ * Return a pointer to the memory at the specified position in the buffer.
+ *
+ * @param buffer Pointer to the buffer.
+ * @param pos The position in the buffer.
+ * @returns pointer to the memory in the buffer at the specified position.
+ *
+ * @pre pos <= size of the buffer
+ */
+ static char* at_pos(std::string* buffer, std::size_t pos);
+
+ /**
+ * Add a char to the buffer incrementing the number of chars in the buffer.
+ *
+ * @param buffer Pointer to the buffer.
+ * @param ch The character to add.
+ */
+ static void push_back(std::string* buffer, char ch);
+
+};
+/// @endcond
+
+} // namespace protozero
+
+#endif // PROTOZERO_BUFFER_TMPL_HPP
diff --git a/ext/protozero/include/protozero/buffer_vector.hpp b/ext/protozero/include/protozero/buffer_vector.hpp
new file mode 100644
index 0000000..6a34b07
--- /dev/null
+++ b/ext/protozero/include/protozero/buffer_vector.hpp
@@ -0,0 +1,76 @@
+#ifndef PROTOZERO_BUFFER_VECTOR_HPP
+#define PROTOZERO_BUFFER_VECTOR_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file buffer_vector.hpp
+ *
+ * @brief Contains the customization points for buffer implementation based
+ * on std::vector<char>
+ */
+
+#include "buffer_tmpl.hpp"
+
+#include <cstddef>
+#include <iterator>
+#include <vector>
+
+namespace protozero {
+
+// Implementation of buffer customizations points for std::vector<char>
+
+/// @cond INTERNAL
+template <>
+struct buffer_customization<std::vector<char>> {
+
+ static std::size_t size(const std::vector<char>* buffer) noexcept {
+ return buffer->size();
+ }
+
+ static void append(std::vector<char>* buffer, const char* data, std::size_t count) {
+ buffer->insert(buffer->end(), data, data + count);
+ }
+
+ static void append_zeros(std::vector<char>* buffer, std::size_t count) {
+ buffer->insert(buffer->end(), count, '\0');
+ }
+
+ static void resize(std::vector<char>* buffer, std::size_t size) {
+ protozero_assert(size < buffer->size());
+ buffer->resize(size);
+ }
+
+ static void reserve_additional(std::vector<char>* buffer, std::size_t size) {
+ buffer->reserve(buffer->size() + size);
+ }
+
+ static void erase_range(std::vector<char>* buffer, std::size_t from, std::size_t to) {
+ protozero_assert(from <= buffer->size());
+ protozero_assert(to <= buffer->size());
+ protozero_assert(from <= to);
+ buffer->erase(std::next(buffer->begin(), from), std::next(buffer->begin(), to));
+ }
+
+ static char* at_pos(std::vector<char>* buffer, std::size_t pos) {
+ protozero_assert(pos <= buffer->size());
+ return (&*buffer->begin()) + pos;
+ }
+
+ static void push_back(std::vector<char>* buffer, char ch) {
+ buffer->push_back(ch);
+ }
+
+};
+/// @endcond
+
+} // namespace protozero
+
+#endif // PROTOZERO_BUFFER_VECTOR_HPP
diff --git a/ext/protozero/include/protozero/byteswap.hpp b/ext/protozero/include/protozero/byteswap.hpp
new file mode 100644
index 0000000..799d179
--- /dev/null
+++ b/ext/protozero/include/protozero/byteswap.hpp
@@ -0,0 +1,99 @@
+#ifndef PROTOZERO_BYTESWAP_HPP
+#define PROTOZERO_BYTESWAP_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file byteswap.hpp
+ *
+ * @brief Contains functions to swap bytes in values (for different endianness).
+ */
+
+#include "config.hpp"
+
+#include <cstdint>
+
+namespace protozero {
+namespace detail {
+
+inline uint32_t byteswap_impl(uint32_t value) noexcept {
+#ifdef PROTOZERO_USE_BUILTIN_BSWAP
+ return __builtin_bswap32(value);
+#else
+ return ((value & 0xff000000U) >> 24U) |
+ ((value & 0x00ff0000U) >> 8U) |
+ ((value & 0x0000ff00U) << 8U) |
+ ((value & 0x000000ffU) << 24U);
+#endif
+}
+
+inline uint64_t byteswap_impl(uint64_t value) noexcept {
+#ifdef PROTOZERO_USE_BUILTIN_BSWAP
+ return __builtin_bswap64(value);
+#else
+ return ((value & 0xff00000000000000ULL) >> 56U) |
+ ((value & 0x00ff000000000000ULL) >> 40U) |
+ ((value & 0x0000ff0000000000ULL) >> 24U) |
+ ((value & 0x000000ff00000000ULL) >> 8U) |
+ ((value & 0x00000000ff000000ULL) << 8U) |
+ ((value & 0x0000000000ff0000ULL) << 24U) |
+ ((value & 0x000000000000ff00ULL) << 40U) |
+ ((value & 0x00000000000000ffULL) << 56U);
+#endif
+}
+
+} // end namespace detail
+
+/// byteswap the data pointed to by ptr in-place.
+inline void byteswap_inplace(uint32_t* ptr) noexcept {
+ *ptr = detail::byteswap_impl(*ptr);
+}
+
+/// byteswap the data pointed to by ptr in-place.
+inline void byteswap_inplace(uint64_t* ptr) noexcept {
+ *ptr = detail::byteswap_impl(*ptr);
+}
+
+/// byteswap the data pointed to by ptr in-place.
+inline void byteswap_inplace(int32_t* ptr) noexcept {
+ auto* bptr = reinterpret_cast<uint32_t*>(ptr);
+ *bptr = detail::byteswap_impl(*bptr);
+}
+
+/// byteswap the data pointed to by ptr in-place.
+inline void byteswap_inplace(int64_t* ptr) noexcept {
+ auto* bptr = reinterpret_cast<uint64_t*>(ptr);
+ *bptr = detail::byteswap_impl(*bptr);
+}
+
+/// byteswap the data pointed to by ptr in-place.
+inline void byteswap_inplace(float* ptr) noexcept {
+ auto* bptr = reinterpret_cast<uint32_t*>(ptr);
+ *bptr = detail::byteswap_impl(*bptr);
+}
+
+/// byteswap the data pointed to by ptr in-place.
+inline void byteswap_inplace(double* ptr) noexcept {
+ auto* bptr = reinterpret_cast<uint64_t*>(ptr);
+ *bptr = detail::byteswap_impl(*bptr);
+}
+
+namespace detail {
+
+ // Added for backwards compatibility with any code that might use this
+ // function (even if it shouldn't have). Will be removed in a later
+ // version of protozero.
+ using ::protozero::byteswap_inplace;
+
+} // end namespace detail
+
+} // end namespace protozero
+
+#endif // PROTOZERO_BYTESWAP_HPP
diff --git a/ext/protozero/include/protozero/config.hpp b/ext/protozero/include/protozero/config.hpp
new file mode 100644
index 0000000..6fc7749
--- /dev/null
+++ b/ext/protozero/include/protozero/config.hpp
@@ -0,0 +1,48 @@
+#ifndef PROTOZERO_CONFIG_HPP
+#define PROTOZERO_CONFIG_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+#include <cassert>
+
+/**
+ * @file config.hpp
+ *
+ * @brief Contains macro checks for different configurations.
+ */
+
+#define PROTOZERO_LITTLE_ENDIAN 1234
+#define PROTOZERO_BIG_ENDIAN 4321
+
+// Find out which byte order the machine has.
+#if defined(__BYTE_ORDER)
+# if (__BYTE_ORDER == __LITTLE_ENDIAN)
+# define PROTOZERO_BYTE_ORDER PROTOZERO_LITTLE_ENDIAN
+# endif
+# if (__BYTE_ORDER == __BIG_ENDIAN)
+# define PROTOZERO_BYTE_ORDER PROTOZERO_BIG_ENDIAN
+# endif
+#else
+// This probably isn't a very good default, but might do until we figure
+// out something better.
+# define PROTOZERO_BYTE_ORDER PROTOZERO_LITTLE_ENDIAN
+#endif
+
+// Check whether __builtin_bswap is available
+#if defined(__GNUC__) || defined(__clang__)
+# define PROTOZERO_USE_BUILTIN_BSWAP
+#endif
+
+// Wrapper for assert() used for testing
+#ifndef protozero_assert
+# define protozero_assert(x) assert(x)
+#endif
+
+#endif // PROTOZERO_CONFIG_HPP
diff --git a/ext/protozero/include/protozero/data_view.hpp b/ext/protozero/include/protozero/data_view.hpp
new file mode 100644
index 0000000..3ec87af
--- /dev/null
+++ b/ext/protozero/include/protozero/data_view.hpp
@@ -0,0 +1,236 @@
+#ifndef PROTOZERO_DATA_VIEW_HPP
+#define PROTOZERO_DATA_VIEW_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file data_view.hpp
+ *
+ * @brief Contains the implementation of the data_view class.
+ */
+
+#include "config.hpp"
+
+#include <algorithm>
+#include <cstddef>
+#include <cstring>
+#include <string>
+#include <utility>
+
+namespace protozero {
+
+#ifdef PROTOZERO_USE_VIEW
+using data_view = PROTOZERO_USE_VIEW;
+#else
+
+/**
+ * Holds a pointer to some data and a length.
+ *
+ * This class is supposed to be compatible with the std::string_view
+ * that will be available in C++17.
+ */
+class data_view {
+
+ const char* m_data = nullptr;
+ std::size_t m_size = 0;
+
+public:
+
+ /**
+ * Default constructor. Construct an empty data_view.
+ */
+ constexpr data_view() noexcept = default;
+
+ /**
+ * Create data_view from pointer and size.
+ *
+ * @param ptr Pointer to the data.
+ * @param length Length of the data.
+ */
+ constexpr data_view(const char* ptr, std::size_t length) noexcept
+ : m_data{ptr},
+ m_size{length} {
+ }
+
+ /**
+ * Create data_view from string.
+ *
+ * @param str String with the data.
+ */
+ data_view(const std::string& str) noexcept // NOLINT(google-explicit-constructor, hicpp-explicit-conversions)
+ : m_data{str.data()},
+ m_size{str.size()} {
+ }
+
+ /**
+ * Create data_view from zero-terminated string.
+ *
+ * @param ptr Pointer to the data.
+ */
+ data_view(const char* ptr) noexcept // NOLINT(google-explicit-constructor, hicpp-explicit-conversions)
+ : m_data{ptr},
+ m_size{std::strlen(ptr)} {
+ }
+
+ /**
+ * Swap the contents of this object with the other.
+ *
+ * @param other Other object to swap data with.
+ */
+ void swap(data_view& other) noexcept {
+ using std::swap;
+ swap(m_data, other.m_data);
+ swap(m_size, other.m_size);
+ }
+
+ /// Return pointer to data.
+ constexpr const char* data() const noexcept {
+ return m_data;
+ }
+
+ /// Return length of data in bytes.
+ constexpr std::size_t size() const noexcept {
+ return m_size;
+ }
+
+ /// Returns true if size is 0.
+ constexpr bool empty() const noexcept {
+ return m_size == 0;
+ }
+
+#ifndef PROTOZERO_STRICT_API
+ /**
+ * Convert data view to string.
+ *
+ * @pre Must not be default constructed data_view.
+ *
+ * @deprecated to_string() is not available in C++17 string_view so it
+ * should not be used to make conversion to that class easier
+ * in the future.
+ */
+ std::string to_string() const {
+ protozero_assert(m_data);
+ return {m_data, m_size};
+ }
+#endif
+
+ /**
+ * Convert data view to string.
+ *
+ * @pre Must not be default constructed data_view.
+ */
+ explicit operator std::string() const {
+ protozero_assert(m_data);
+ return {m_data, m_size};
+ }
+
+ /**
+ * Compares the contents of this object with the given other object.
+ *
+ * @returns 0 if they are the same, <0 if this object is smaller than
+ * the other or >0 if it is larger. If both objects have the
+ * same size returns <0 if this object is lexicographically
+ * before the other, >0 otherwise.
+ *
+ * @pre Must not be default constructed data_view.
+ */
+ int compare(data_view other) const noexcept {
+ assert(m_data && other.m_data);
+ const int cmp = std::memcmp(data(), other.data(),
+ std::min(size(), other.size()));
+ if (cmp == 0) {
+ if (size() == other.size()) {
+ return 0;
+ }
+ return size() < other.size() ? -1 : 1;
+ }
+ return cmp;
+ }
+
+}; // class data_view
+
+/**
+ * Swap two data_view objects.
+ *
+ * @param lhs First object.
+ * @param rhs Second object.
+ */
+inline void swap(data_view& lhs, data_view& rhs) noexcept {
+ lhs.swap(rhs);
+}
+
+/**
+ * Two data_view instances are equal if they have the same size and the
+ * same content.
+ *
+ * @param lhs First object.
+ * @param rhs Second object.
+ */
+inline constexpr bool operator==(const data_view lhs, const data_view rhs) noexcept {
+ return lhs.size() == rhs.size() &&
+ std::equal(lhs.data(), lhs.data() + lhs.size(), rhs.data());
+}
+
+/**
+ * Two data_view instances are not equal if they have different sizes or the
+ * content differs.
+ *
+ * @param lhs First object.
+ * @param rhs Second object.
+ */
+inline constexpr bool operator!=(const data_view lhs, const data_view rhs) noexcept {
+ return !(lhs == rhs);
+}
+
+/**
+ * Returns true if lhs.compare(rhs) < 0.
+ *
+ * @param lhs First object.
+ * @param rhs Second object.
+ */
+inline bool operator<(const data_view lhs, const data_view rhs) noexcept {
+ return lhs.compare(rhs) < 0;
+}
+
+/**
+ * Returns true if lhs.compare(rhs) <= 0.
+ *
+ * @param lhs First object.
+ * @param rhs Second object.
+ */
+inline bool operator<=(const data_view lhs, const data_view rhs) noexcept {
+ return lhs.compare(rhs) <= 0;
+}
+
+/**
+ * Returns true if lhs.compare(rhs) > 0.
+ *
+ * @param lhs First object.
+ * @param rhs Second object.
+ */
+inline bool operator>(const data_view lhs, const data_view rhs) noexcept {
+ return lhs.compare(rhs) > 0;
+}
+
+/**
+ * Returns true if lhs.compare(rhs) >= 0.
+ *
+ * @param lhs First object.
+ * @param rhs Second object.
+ */
+inline bool operator>=(const data_view lhs, const data_view rhs) noexcept {
+ return lhs.compare(rhs) >= 0;
+}
+
+#endif
+
+} // end namespace protozero
+
+#endif // PROTOZERO_DATA_VIEW_HPP
diff --git a/ext/protozero/include/protozero/exception.hpp b/ext/protozero/include/protozero/exception.hpp
new file mode 100644
index 0000000..a3cd0f1
--- /dev/null
+++ b/ext/protozero/include/protozero/exception.hpp
@@ -0,0 +1,101 @@
+#ifndef PROTOZERO_EXCEPTION_HPP
+#define PROTOZERO_EXCEPTION_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file exception.hpp
+ *
+ * @brief Contains the exceptions used in the protozero library.
+ */
+
+#include <exception>
+
+/**
+ * @brief All parts of the protozero header-only library are in this namespace.
+ */
+namespace protozero {
+
+/**
+ * All exceptions explicitly thrown by the functions of the protozero library
+ * derive from this exception.
+ */
+struct exception : std::exception {
+ /// Returns the explanatory string.
+ const char* what() const noexcept override {
+ return "pbf exception";
+ }
+};
+
+/**
+ * This exception is thrown when parsing a varint thats larger than allowed.
+ * This should never happen unless the data is corrupted.
+ */
+struct varint_too_long_exception : exception {
+ /// Returns the explanatory string.
+ const char* what() const noexcept override {
+ return "varint too long exception";
+ }
+};
+
+/**
+ * This exception is thrown when the wire type of a pdf field is unknown.
+ * This should never happen unless the data is corrupted.
+ */
+struct unknown_pbf_wire_type_exception : exception {
+ /// Returns the explanatory string.
+ const char* what() const noexcept override {
+ return "unknown pbf field type exception";
+ }
+};
+
+/**
+ * This exception is thrown when we are trying to read a field and there
+ * are not enough bytes left in the buffer to read it. Almost all functions
+ * of the pbf_reader class can throw this exception.
+ *
+ * This should never happen unless the data is corrupted or you have
+ * initialized the pbf_reader object with incomplete data.
+ */
+struct end_of_buffer_exception : exception {
+ /// Returns the explanatory string.
+ const char* what() const noexcept override {
+ return "end of buffer exception";
+ }
+};
+
+/**
+ * This exception is thrown when a tag has an invalid value. Tags must be
+ * unsigned integers between 1 and 2^29-1. Tags between 19000 and 19999 are
+ * not allowed. See
+ * https://developers.google.com/protocol-buffers/docs/proto#assigning-tags
+ */
+struct invalid_tag_exception : exception {
+ /// Returns the explanatory string.
+ const char* what() const noexcept override {
+ return "invalid tag exception";
+ }
+};
+
+/**
+ * This exception is thrown when a length field of a packed repeated field is
+ * invalid. For fixed size types the length must be a multiple of the size of
+ * the type.
+ */
+struct invalid_length_exception : exception {
+ /// Returns the explanatory string.
+ const char* what() const noexcept override {
+ return "invalid length exception";
+ }
+};
+
+} // end namespace protozero
+
+#endif // PROTOZERO_EXCEPTION_HPP
diff --git a/ext/protozero/include/protozero/iterators.hpp b/ext/protozero/include/protozero/iterators.hpp
new file mode 100644
index 0000000..ee8ef8e
--- /dev/null
+++ b/ext/protozero/include/protozero/iterators.hpp
@@ -0,0 +1,481 @@
+#ifndef PROTOZERO_ITERATORS_HPP
+#define PROTOZERO_ITERATORS_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file iterators.hpp
+ *
+ * @brief Contains the iterators for access to packed repeated fields.
+ */
+
+#include "config.hpp"
+#include "varint.hpp"
+
+#if PROTOZERO_BYTE_ORDER != PROTOZERO_LITTLE_ENDIAN
+# include <protozero/byteswap.hpp>
+#endif
+
+#include <algorithm>
+#include <cstring>
+#include <iterator>
+#include <utility>
+
+namespace protozero {
+
+/**
+ * A range of iterators based on std::pair. Created from beginning and
+ * end iterators. Used as a return type from some pbf_reader methods
+ * that is easy to use with range-based for loops.
+ */
+template <typename T, typename P = std::pair<T, T>>
+class iterator_range :
+#ifdef PROTOZERO_STRICT_API
+ protected
+#else
+ public
+#endif
+ P {
+
+public:
+
+ /// The type of the iterators in this range.
+ using iterator = T;
+
+ /// The value type of the underlying iterator.
+ using value_type = typename std::iterator_traits<T>::value_type;
+
+ /**
+ * Default constructor. Create empty iterator_range.
+ */
+ constexpr iterator_range() :
+ P{iterator{}, iterator{}} {
+ }
+
+ /**
+ * Create iterator range from two iterators.
+ *
+ * @param first_iterator Iterator to beginning of range.
+ * @param last_iterator Iterator to end of range.
+ */
+ constexpr iterator_range(iterator&& first_iterator, iterator&& last_iterator) :
+ P{std::forward<iterator>(first_iterator),
+ std::forward<iterator>(last_iterator)} {
+ }
+
+ /// Return iterator to beginning of range.
+ constexpr iterator begin() const noexcept {
+ return this->first;
+ }
+
+ /// Return iterator to end of range.
+ constexpr iterator end() const noexcept {
+ return this->second;
+ }
+
+ /// Return iterator to beginning of range.
+ constexpr iterator cbegin() const noexcept {
+ return this->first;
+ }
+
+ /// Return iterator to end of range.
+ constexpr iterator cend() const noexcept {
+ return this->second;
+ }
+
+ /**
+ * Return true if this range is empty.
+ *
+ * Complexity: Constant.
+ */
+ constexpr bool empty() const noexcept {
+ return begin() == end();
+ }
+
+ /**
+ * Get the size of the range, ie the number of elements it contains.
+ *
+ * Complexity: Constant or linear depending on the underlaying iterator.
+ */
+ std::size_t size() const noexcept {
+ return static_cast<size_t>(std::distance(begin(), end()));
+ }
+
+ /**
+ * Get element at the beginning of the range.
+ *
+ * @pre Range must not be empty.
+ */
+ value_type front() const {
+ protozero_assert(!empty());
+ return *(this->first);
+ }
+
+ /**
+ * Advance beginning of range by one.
+ *
+ * @pre Range must not be empty.
+ */
+ void drop_front() {
+ protozero_assert(!empty());
+ ++this->first;
+ }
+
+ /**
+ * Swap the contents of this range with the other.
+ *
+ * @param other Other range to swap data with.
+ */
+ void swap(iterator_range& other) noexcept {
+ using std::swap;
+ swap(this->first, other.first);
+ swap(this->second, other.second);
+ }
+
+}; // struct iterator_range
+
+/**
+ * Swap two iterator_ranges.
+ *
+ * @param lhs First range.
+ * @param rhs Second range.
+ */
+template <typename T>
+inline void swap(iterator_range<T>& lhs, iterator_range<T>& rhs) noexcept {
+ lhs.swap(rhs);
+}
+
+/**
+ * A forward iterator used for accessing packed repeated fields of fixed
+ * length (fixed32, sfixed32, float, double).
+ */
+template <typename T>
+class const_fixed_iterator {
+
+ /// Pointer to current iterator position
+ const char* m_data = nullptr;
+
+public:
+
+ /// @cond usual iterator functions not documented
+
+ using iterator_category = std::random_access_iterator_tag;
+ using value_type = T;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+
+ const_fixed_iterator() noexcept = default;
+
+ explicit const_fixed_iterator(const char* data) noexcept :
+ m_data{data} {
+ }
+
+ const_fixed_iterator(const const_fixed_iterator&) noexcept = default;
+ const_fixed_iterator(const_fixed_iterator&&) noexcept = default;
+
+ const_fixed_iterator& operator=(const const_fixed_iterator&) noexcept = default;
+ const_fixed_iterator& operator=(const_fixed_iterator&&) noexcept = default;
+
+ ~const_fixed_iterator() noexcept = default;
+
+ value_type operator*() const noexcept {
+ value_type result;
+ std::memcpy(&result, m_data, sizeof(value_type));
+#if PROTOZERO_BYTE_ORDER != PROTOZERO_LITTLE_ENDIAN
+ byteswap_inplace(&result);
+#endif
+ return result;
+ }
+
+ const_fixed_iterator& operator++() noexcept {
+ m_data += sizeof(value_type);
+ return *this;
+ }
+
+ const_fixed_iterator operator++(int) noexcept {
+ const const_fixed_iterator tmp{*this};
+ ++(*this);
+ return tmp;
+ }
+
+ const_fixed_iterator& operator--() noexcept {
+ m_data -= sizeof(value_type);
+ return *this;
+ }
+
+ const_fixed_iterator operator--(int) noexcept {
+ const const_fixed_iterator tmp{*this};
+ --(*this);
+ return tmp;
+ }
+
+ friend bool operator==(const_fixed_iterator lhs, const_fixed_iterator rhs) noexcept {
+ return lhs.m_data == rhs.m_data;
+ }
+
+ friend bool operator!=(const_fixed_iterator lhs, const_fixed_iterator rhs) noexcept {
+ return !(lhs == rhs);
+ }
+
+ friend bool operator<(const_fixed_iterator lhs, const_fixed_iterator rhs) noexcept {
+ return lhs.m_data < rhs.m_data;
+ }
+
+ friend bool operator>(const_fixed_iterator lhs, const_fixed_iterator rhs) noexcept {
+ return rhs < lhs;
+ }
+
+ friend bool operator<=(const_fixed_iterator lhs, const_fixed_iterator rhs) noexcept {
+ return !(lhs > rhs);
+ }
+
+ friend bool operator>=(const_fixed_iterator lhs, const_fixed_iterator rhs) noexcept {
+ return !(lhs < rhs);
+ }
+
+ const_fixed_iterator& operator+=(difference_type val) noexcept {
+ m_data += (sizeof(value_type) * val);
+ return *this;
+ }
+
+ friend const_fixed_iterator operator+(const_fixed_iterator lhs, difference_type rhs) noexcept {
+ const_fixed_iterator tmp{lhs};
+ tmp.m_data += (sizeof(value_type) * rhs);
+ return tmp;
+ }
+
+ friend const_fixed_iterator operator+(difference_type lhs, const_fixed_iterator rhs) noexcept {
+ const_fixed_iterator tmp{rhs};
+ tmp.m_data += (sizeof(value_type) * lhs);
+ return tmp;
+ }
+
+ const_fixed_iterator& operator-=(difference_type val) noexcept {
+ m_data -= (sizeof(value_type) * val);
+ return *this;
+ }
+
+ friend const_fixed_iterator operator-(const_fixed_iterator lhs, difference_type rhs) noexcept {
+ const_fixed_iterator tmp{lhs};
+ tmp.m_data -= (sizeof(value_type) * rhs);
+ return tmp;
+ }
+
+ friend difference_type operator-(const_fixed_iterator lhs, const_fixed_iterator rhs) noexcept {
+ return static_cast<difference_type>(lhs.m_data - rhs.m_data) / static_cast<difference_type>(sizeof(T));
+ }
+
+ value_type operator[](difference_type n) const noexcept {
+ return *(*this + n);
+ }
+
+ /// @endcond
+
+}; // class const_fixed_iterator
+
+/**
+ * A forward iterator used for accessing packed repeated varint fields
+ * (int32, uint32, int64, uint64, bool, enum).
+ */
+template <typename T>
+class const_varint_iterator {
+
+protected:
+
+ /// Pointer to current iterator position
+ const char* m_data = nullptr; // NOLINT(misc-non-private-member-variables-in-classes, cppcoreguidelines-non-private-member-variables-in-classes,-warnings-as-errors)
+
+ /// Pointer to end iterator position
+ const char* m_end = nullptr; // NOLINT(misc-non-private-member-variables-in-classes, cppcoreguidelines-non-private-member-variables-in-classes,-warnings-as-errors)
+
+public:
+
+ /// @cond usual iterator functions not documented
+
+ using iterator_category = std::forward_iterator_tag;
+ using value_type = T;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+
+ static difference_type distance(const_varint_iterator begin, const_varint_iterator end) noexcept {
+ // The "distance" between default initialized const_varint_iterator's
+ // is always 0.
+ if (!begin.m_data) {
+ return 0;
+ }
+ // We know that each varint contains exactly one byte with the most
+ // significant bit not set. We can use this to quickly figure out
+ // how many varints there are without actually decoding the varints.
+ return std::count_if(begin.m_data, end.m_data, [](char c) noexcept {
+ return (static_cast<unsigned char>(c) & 0x80U) == 0;
+ });
+ }
+
+ const_varint_iterator() noexcept = default;
+
+ const_varint_iterator(const char* data, const char* end) noexcept :
+ m_data{data},
+ m_end{end} {
+ }
+
+ const_varint_iterator(const const_varint_iterator&) noexcept = default;
+ const_varint_iterator(const_varint_iterator&&) noexcept = default;
+
+ const_varint_iterator& operator=(const const_varint_iterator&) noexcept = default;
+ const_varint_iterator& operator=(const_varint_iterator&&) noexcept = default;
+
+ ~const_varint_iterator() noexcept = default;
+
+ value_type operator*() const {
+ protozero_assert(m_data);
+ const char* d = m_data; // will be thrown away
+ return static_cast<value_type>(decode_varint(&d, m_end));
+ }
+
+ const_varint_iterator& operator++() {
+ protozero_assert(m_data);
+ skip_varint(&m_data, m_end);
+ return *this;
+ }
+
+ const_varint_iterator operator++(int) {
+ protozero_assert(m_data);
+ const const_varint_iterator tmp{*this};
+ ++(*this);
+ return tmp;
+ }
+
+ bool operator==(const const_varint_iterator& rhs) const noexcept {
+ return m_data == rhs.m_data && m_end == rhs.m_end;
+ }
+
+ bool operator!=(const const_varint_iterator& rhs) const noexcept {
+ return !(*this == rhs);
+ }
+
+ /// @endcond
+
+}; // class const_varint_iterator
+
+/**
+ * A forward iterator used for accessing packed repeated svarint fields
+ * (sint32, sint64).
+ */
+template <typename T>
+class const_svarint_iterator : public const_varint_iterator<T> {
+
+public:
+
+ /// @cond usual iterator functions not documented
+
+ using iterator_category = std::forward_iterator_tag;
+ using value_type = T;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+
+ const_svarint_iterator() noexcept :
+ const_varint_iterator<T>{} {
+ }
+
+ const_svarint_iterator(const char* data, const char* end) noexcept :
+ const_varint_iterator<T>{data, end} {
+ }
+
+ const_svarint_iterator(const const_svarint_iterator&) = default;
+ const_svarint_iterator(const_svarint_iterator&&) noexcept = default;
+
+ const_svarint_iterator& operator=(const const_svarint_iterator&) = default;
+ const_svarint_iterator& operator=(const_svarint_iterator&&) noexcept = default;
+
+ ~const_svarint_iterator() = default;
+
+ value_type operator*() const {
+ protozero_assert(this->m_data);
+ const char* d = this->m_data; // will be thrown away
+ return static_cast<value_type>(decode_zigzag64(decode_varint(&d, this->m_end)));
+ }
+
+ const_svarint_iterator& operator++() {
+ protozero_assert(this->m_data);
+ skip_varint(&this->m_data, this->m_end);
+ return *this;
+ }
+
+ const_svarint_iterator operator++(int) {
+ protozero_assert(this->m_data);
+ const const_svarint_iterator tmp{*this};
+ ++(*this);
+ return tmp;
+ }
+
+ /// @endcond
+
+}; // class const_svarint_iterator
+
+} // end namespace protozero
+
+namespace std {
+
+ // Specialize std::distance for all the protozero iterators. Because
+ // functions can't be partially specialized, we have to do this for
+ // every value_type we are using.
+
+ /// @cond individual overloads do not need to be documented
+
+ template <>
+ inline typename protozero::const_varint_iterator<int32_t>::difference_type
+ distance<protozero::const_varint_iterator<int32_t>>(protozero::const_varint_iterator<int32_t> first, // NOLINT(readability-inconsistent-declaration-parameter-name)
+ protozero::const_varint_iterator<int32_t> last) {
+ return protozero::const_varint_iterator<int32_t>::distance(first, last);
+ }
+
+ template <>
+ inline typename protozero::const_varint_iterator<int64_t>::difference_type
+ distance<protozero::const_varint_iterator<int64_t>>(protozero::const_varint_iterator<int64_t> first, // NOLINT(readability-inconsistent-declaration-parameter-name)
+ protozero::const_varint_iterator<int64_t> last) {
+ return protozero::const_varint_iterator<int64_t>::distance(first, last);
+ }
+
+ template <>
+ inline typename protozero::const_varint_iterator<uint32_t>::difference_type
+ distance<protozero::const_varint_iterator<uint32_t>>(protozero::const_varint_iterator<uint32_t> first, // NOLINT(readability-inconsistent-declaration-parameter-name)
+ protozero::const_varint_iterator<uint32_t> last) {
+ return protozero::const_varint_iterator<uint32_t>::distance(first, last);
+ }
+
+ template <>
+ inline typename protozero::const_varint_iterator<uint64_t>::difference_type
+ distance<protozero::const_varint_iterator<uint64_t>>(protozero::const_varint_iterator<uint64_t> first, // NOLINT(readability-inconsistent-declaration-parameter-name)
+ protozero::const_varint_iterator<uint64_t> last) {
+ return protozero::const_varint_iterator<uint64_t>::distance(first, last);
+ }
+
+ template <>
+ inline typename protozero::const_svarint_iterator<int32_t>::difference_type
+ distance<protozero::const_svarint_iterator<int32_t>>(protozero::const_svarint_iterator<int32_t> first, // NOLINT(readability-inconsistent-declaration-parameter-name)
+ protozero::const_svarint_iterator<int32_t> last) {
+ return protozero::const_svarint_iterator<int32_t>::distance(first, last);
+ }
+
+ template <>
+ inline typename protozero::const_svarint_iterator<int64_t>::difference_type
+ distance<protozero::const_svarint_iterator<int64_t>>(protozero::const_svarint_iterator<int64_t> first, // NOLINT(readability-inconsistent-declaration-parameter-name)
+ protozero::const_svarint_iterator<int64_t> last) {
+ return protozero::const_svarint_iterator<int64_t>::distance(first, last);
+ }
+
+ /// @endcond
+
+} // end namespace std
+
+#endif // PROTOZERO_ITERATORS_HPP
diff --git a/ext/protozero/include/protozero/pbf_builder.hpp b/ext/protozero/include/protozero/pbf_builder.hpp
new file mode 100644
index 0000000..71a2dec
--- /dev/null
+++ b/ext/protozero/include/protozero/pbf_builder.hpp
@@ -0,0 +1,32 @@
+#ifndef PROTOZERO_PBF_BUILDER_HPP
+#define PROTOZERO_PBF_BUILDER_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file pbf_builder.hpp
+ *
+ * @brief Contains the pbf_builder template class.
+ */
+
+#include "basic_pbf_builder.hpp"
+#include "pbf_writer.hpp"
+
+#include <string>
+
+namespace protozero {
+
+/// Specialization of basic_pbf_builder using std::string as buffer type.
+template <typename T>
+using pbf_builder = basic_pbf_builder<std::string, T>;
+
+} // end namespace protozero
+
+#endif // PROTOZERO_PBF_BUILDER_HPP
diff --git a/ext/protozero/include/protozero/pbf_message.hpp b/ext/protozero/include/protozero/pbf_message.hpp
new file mode 100644
index 0000000..d7fd8b5
--- /dev/null
+++ b/ext/protozero/include/protozero/pbf_message.hpp
@@ -0,0 +1,184 @@
+#ifndef PROTOZERO_PBF_MESSAGE_HPP
+#define PROTOZERO_PBF_MESSAGE_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file pbf_message.hpp
+ *
+ * @brief Contains the pbf_message template class.
+ */
+
+#include "pbf_reader.hpp"
+#include "types.hpp"
+
+#include <type_traits>
+
+namespace protozero {
+
+/**
+ * This class represents a protobuf message. Either a top-level message or
+ * a nested sub-message. Top-level messages can be created from any buffer
+ * with a pointer and length:
+ *
+ * @code
+ * enum class Message : protozero::pbf_tag_type {
+ * ...
+ * };
+ *
+ * std::string buffer;
+ * // fill buffer...
+ * pbf_message<Message> message{buffer.data(), buffer.size()};
+ * @endcode
+ *
+ * Sub-messages are created using get_message():
+ *
+ * @code
+ * enum class SubMessage : protozero::pbf_tag_type {
+ * ...
+ * };
+ *
+ * pbf_message<Message> message{...};
+ * message.next();
+ * pbf_message<SubMessage> submessage = message.get_message();
+ * @endcode
+ *
+ * All methods of the pbf_message class except get_bytes() and get_string()
+ * provide the strong exception guarantee, ie they either succeed or do not
+ * change the pbf_message object they are called on. Use the get_data() method
+ * instead of get_bytes() or get_string(), if you need this guarantee.
+ *
+ * This template class is based on the pbf_reader class and has all the same
+ * methods. The difference is that whereever the pbf_reader class takes an
+ * integer tag, this template class takes a tag of the template type T.
+ *
+ * Read the tutorial to understand how this class is used.
+ */
+template <typename T>
+class pbf_message : public pbf_reader {
+
+ static_assert(std::is_same<pbf_tag_type, typename std::underlying_type<T>::type>::value,
+ "T must be enum with underlying type protozero::pbf_tag_type");
+
+public:
+
+ /// The type of messages this class will read.
+ using enum_type = T;
+
+ /**
+ * Construct a pbf_message. All arguments are forwarded to the pbf_reader
+ * parent class.
+ */
+ template <typename... Args>
+ pbf_message(Args&&... args) noexcept : // NOLINT(google-explicit-constructor, hicpp-explicit-conversions)
+ pbf_reader{std::forward<Args>(args)...} {
+ }
+
+ /**
+ * Set next field in the message as the current field. This is usually
+ * called in a while loop:
+ *
+ * @code
+ * pbf_message<...> message(...);
+ * while (message.next()) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * @returns `true` if there is a next field, `false` if not.
+ * @pre There must be no current field.
+ * @post If it returns `true` there is a current field now.
+ */
+ bool next() {
+ return pbf_reader::next();
+ }
+
+ /**
+ * Set next field with given tag in the message as the current field.
+ * Fields with other tags are skipped. This is usually called in a while
+ * loop for repeated fields:
+ *
+ * @code
+ * pbf_message<Example1> message{...};
+ * while (message.next(Example1::repeated_fixed64_r)) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * or you can call it just once to get the one field with this tag:
+ *
+ * @code
+ * pbf_message<Example1> message{...};
+ * if (message.next(Example1::required_uint32_x)) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * Note that this will not check the wire type. The two-argument version
+ * of this function will also check the wire type.
+ *
+ * @returns `true` if there is a next field with this tag.
+ * @pre There must be no current field.
+ * @post If it returns `true` there is a current field now with the given tag.
+ */
+ bool next(T next_tag) {
+ return pbf_reader::next(pbf_tag_type(next_tag));
+ }
+
+ /**
+ * Set next field with given tag and wire type in the message as the
+ * current field. Fields with other tags are skipped. This is usually
+ * called in a while loop for repeated fields:
+ *
+ * @code
+ * pbf_message<Example1> message{...};
+ * while (message.next(Example1::repeated_fixed64_r, pbf_wire_type::varint)) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * or you can call it just once to get the one field with this tag:
+ *
+ * @code
+ * pbf_message<Example1> message{...};
+ * if (message.next(Example1::required_uint32_x, pbf_wire_type::varint)) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * Note that this will also check the wire type. The one-argument version
+ * of this function will not check the wire type.
+ *
+ * @returns `true` if there is a next field with this tag.
+ * @pre There must be no current field.
+ * @post If it returns `true` there is a current field now with the given tag.
+ */
+ bool next(T next_tag, pbf_wire_type type) {
+ return pbf_reader::next(pbf_tag_type(next_tag), type);
+ }
+
+ /**
+ * The tag of the current field. The tag is the enum value for the field
+ * number from the description in the .proto file.
+ *
+ * Call next() before calling this function to set the current field.
+ *
+ * @returns tag of the current field.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ */
+ T tag() const noexcept {
+ return T(pbf_reader::tag());
+ }
+
+}; // class pbf_message
+
+} // end namespace protozero
+
+#endif // PROTOZERO_PBF_MESSAGE_HPP
diff --git a/ext/protozero/include/protozero/pbf_reader.hpp b/ext/protozero/include/protozero/pbf_reader.hpp
new file mode 100644
index 0000000..92bfdee
--- /dev/null
+++ b/ext/protozero/include/protozero/pbf_reader.hpp
@@ -0,0 +1,977 @@
+#ifndef PROTOZERO_PBF_READER_HPP
+#define PROTOZERO_PBF_READER_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file pbf_reader.hpp
+ *
+ * @brief Contains the pbf_reader class.
+ */
+
+#include "config.hpp"
+#include "data_view.hpp"
+#include "exception.hpp"
+#include "iterators.hpp"
+#include "types.hpp"
+#include "varint.hpp"
+
+#if PROTOZERO_BYTE_ORDER != PROTOZERO_LITTLE_ENDIAN
+# include <protozero/byteswap.hpp>
+#endif
+
+#include <cstddef>
+#include <cstdint>
+#include <cstring>
+#include <string>
+#include <utility>
+
+namespace protozero {
+
+/**
+ * This class represents a protobuf message. Either a top-level message or
+ * a nested sub-message. Top-level messages can be created from any buffer
+ * with a pointer and length:
+ *
+ * @code
+ * std::string buffer;
+ * // fill buffer...
+ * pbf_reader message{buffer.data(), buffer.size()};
+ * @endcode
+ *
+ * Sub-messages are created using get_message():
+ *
+ * @code
+ * pbf_reader message{...};
+ * message.next();
+ * pbf_reader submessage = message.get_message();
+ * @endcode
+ *
+ * All methods of the pbf_reader class except get_bytes() and get_string()
+ * provide the strong exception guarantee, ie they either succeed or do not
+ * change the pbf_reader object they are called on. Use the get_view() method
+ * instead of get_bytes() or get_string(), if you need this guarantee.
+ */
+class pbf_reader {
+
+ // A pointer to the next unread data.
+ const char* m_data = nullptr;
+
+ // A pointer to one past the end of data.
+ const char* m_end = nullptr;
+
+ // The wire type of the current field.
+ pbf_wire_type m_wire_type = pbf_wire_type::unknown;
+
+ // The tag of the current field.
+ pbf_tag_type m_tag = 0;
+
+ template <typename T>
+ T get_fixed() {
+ T result;
+ const char* data = m_data;
+ skip_bytes(sizeof(T));
+ std::memcpy(&result, data, sizeof(T));
+#if PROTOZERO_BYTE_ORDER != PROTOZERO_LITTLE_ENDIAN
+ byteswap_inplace(&result);
+#endif
+ return result;
+ }
+
+ template <typename T>
+ iterator_range<const_fixed_iterator<T>> packed_fixed() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ const auto len = get_len_and_skip();
+ if (len % sizeof(T) != 0) {
+ throw invalid_length_exception{};
+ }
+ return {const_fixed_iterator<T>(m_data - len),
+ const_fixed_iterator<T>(m_data)};
+ }
+
+ template <typename T>
+ T get_varint() {
+ const auto val = static_cast<T>(decode_varint(&m_data, m_end));
+ return val;
+ }
+
+ template <typename T>
+ T get_svarint() {
+ protozero_assert((has_wire_type(pbf_wire_type::varint) || has_wire_type(pbf_wire_type::length_delimited)) && "not a varint");
+ return static_cast<T>(decode_zigzag64(decode_varint(&m_data, m_end)));
+ }
+
+ pbf_length_type get_length() {
+ return get_varint<pbf_length_type>();
+ }
+
+ void skip_bytes(pbf_length_type len) {
+ if (m_end - m_data < static_cast<ptrdiff_t>(len)) {
+ throw end_of_buffer_exception{};
+ }
+ m_data += len;
+
+#ifndef NDEBUG
+ // In debug builds reset the tag to zero so that we can detect (some)
+ // wrong code.
+ m_tag = 0;
+#endif
+ }
+
+ pbf_length_type get_len_and_skip() {
+ const auto len = get_length();
+ skip_bytes(len);
+ return len;
+ }
+
+ template <typename T>
+ iterator_range<T> get_packed() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ const auto len = get_len_and_skip();
+ return {T{m_data - len, m_data},
+ T{m_data, m_data}};
+ }
+
+public:
+
+ /**
+ * Construct a pbf_reader message from a data_view. The pointer from the
+ * data_view will be stored inside the pbf_reader object, no data is
+ * copied. So you must make sure the view stays valid as long as the
+ * pbf_reader object is used.
+ *
+ * The buffer must contain a complete protobuf message.
+ *
+ * @post There is no current field.
+ */
+ explicit pbf_reader(const data_view& view) noexcept
+ : m_data{view.data()},
+ m_end{view.data() + view.size()} {
+ }
+
+ /**
+ * Construct a pbf_reader message from a data pointer and a length. The
+ * pointer will be stored inside the pbf_reader object, no data is copied.
+ * So you must make sure the buffer stays valid as long as the pbf_reader
+ * object is used.
+ *
+ * The buffer must contain a complete protobuf message.
+ *
+ * @post There is no current field.
+ */
+ pbf_reader(const char* data, std::size_t size) noexcept
+ : m_data{data},
+ m_end{data + size} {
+ }
+
+#ifndef PROTOZERO_STRICT_API
+ /**
+ * Construct a pbf_reader message from a data pointer and a length. The
+ * pointer will be stored inside the pbf_reader object, no data is copied.
+ * So you must make sure the buffer stays valid as long as the pbf_reader
+ * object is used.
+ *
+ * The buffer must contain a complete protobuf message.
+ *
+ * @post There is no current field.
+ * @deprecated Use one of the other constructors.
+ */
+ explicit pbf_reader(const std::pair<const char*, std::size_t>& data) noexcept
+ : m_data{data.first},
+ m_end{data.first + data.second} {
+ }
+#endif
+
+ /**
+ * Construct a pbf_reader message from a std::string. A pointer to the
+ * string internals will be stored inside the pbf_reader object, no data
+ * is copied. So you must make sure the string is unchanged as long as the
+ * pbf_reader object is used.
+ *
+ * The string must contain a complete protobuf message.
+ *
+ * @post There is no current field.
+ */
+ explicit pbf_reader(const std::string& data) noexcept
+ : m_data{data.data()},
+ m_end{data.data() + data.size()} {
+ }
+
+ /**
+ * pbf_reader can be default constructed and behaves like it has an empty
+ * buffer.
+ */
+ pbf_reader() noexcept = default;
+
+ /// pbf_reader messages can be copied trivially.
+ pbf_reader(const pbf_reader&) noexcept = default;
+
+ /// pbf_reader messages can be moved trivially.
+ pbf_reader(pbf_reader&&) noexcept = default;
+
+ /// pbf_reader messages can be copied trivially.
+ pbf_reader& operator=(const pbf_reader& other) noexcept = default;
+
+ /// pbf_reader messages can be moved trivially.
+ pbf_reader& operator=(pbf_reader&& other) noexcept = default;
+
+ ~pbf_reader() = default;
+
+ /**
+ * Swap the contents of this object with the other.
+ *
+ * @param other Other object to swap data with.
+ */
+ void swap(pbf_reader& other) noexcept {
+ using std::swap;
+ swap(m_data, other.m_data);
+ swap(m_end, other.m_end);
+ swap(m_wire_type, other.m_wire_type);
+ swap(m_tag, other.m_tag);
+ }
+
+ /**
+ * In a boolean context the pbf_reader class evaluates to `true` if there
+ * are still fields available and to `false` if the last field has been
+ * read.
+ */
+ operator bool() const noexcept { // NOLINT(google-explicit-constructor, hicpp-explicit-conversions)
+ return m_data != m_end;
+ }
+
+ /**
+ * Get a view of the not yet read data.
+ */
+ data_view data() const noexcept {
+ return {m_data, static_cast<std::size_t>(m_end - m_data)};
+ }
+
+ /**
+ * Return the length in bytes of the current message. If you have
+ * already called next() and/or any of the get_*() functions, this will
+ * return the remaining length.
+ *
+ * This can, for instance, be used to estimate the space needed for a
+ * buffer. Of course you have to know reasonably well what data to expect
+ * and how it is encoded for this number to have any meaning.
+ */
+ std::size_t length() const noexcept {
+ return std::size_t(m_end - m_data);
+ }
+
+ /**
+ * Set next field in the message as the current field. This is usually
+ * called in a while loop:
+ *
+ * @code
+ * pbf_reader message(...);
+ * while (message.next()) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * @returns `true` if there is a next field, `false` if not.
+ * @pre There must be no current field.
+ * @post If it returns `true` there is a current field now.
+ */
+ bool next() {
+ if (m_data == m_end) {
+ return false;
+ }
+
+ const auto value = get_varint<uint32_t>();
+ m_tag = pbf_tag_type(value >> 3U);
+
+ // tags 0 and 19000 to 19999 are not allowed as per
+ // https://developers.google.com/protocol-buffers/docs/proto#assigning-tags
+ if (m_tag == 0 || (m_tag >= 19000 && m_tag <= 19999)) {
+ throw invalid_tag_exception{};
+ }
+
+ m_wire_type = pbf_wire_type(value & 0x07U);
+ switch (m_wire_type) {
+ case pbf_wire_type::varint:
+ case pbf_wire_type::fixed64:
+ case pbf_wire_type::length_delimited:
+ case pbf_wire_type::fixed32:
+ break;
+ default:
+ throw unknown_pbf_wire_type_exception{};
+ }
+
+ return true;
+ }
+
+ /**
+ * Set next field with given tag in the message as the current field.
+ * Fields with other tags are skipped. This is usually called in a while
+ * loop for repeated fields:
+ *
+ * @code
+ * pbf_reader message{...};
+ * while (message.next(17)) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * or you can call it just once to get the one field with this tag:
+ *
+ * @code
+ * pbf_reader message{...};
+ * if (message.next(17)) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * Note that this will not check the wire type. The two-argument version
+ * of this function will also check the wire type.
+ *
+ * @returns `true` if there is a next field with this tag.
+ * @pre There must be no current field.
+ * @post If it returns `true` there is a current field now with the given tag.
+ */
+ bool next(pbf_tag_type next_tag) {
+ while (next()) {
+ if (m_tag == next_tag) {
+ return true;
+ }
+ skip();
+ }
+ return false;
+ }
+
+ /**
+ * Set next field with given tag and wire type in the message as the
+ * current field. Fields with other tags are skipped. This is usually
+ * called in a while loop for repeated fields:
+ *
+ * @code
+ * pbf_reader message{...};
+ * while (message.next(17, pbf_wire_type::varint)) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * or you can call it just once to get the one field with this tag:
+ *
+ * @code
+ * pbf_reader message{...};
+ * if (message.next(17, pbf_wire_type::varint)) {
+ * // handle field
+ * }
+ * @endcode
+ *
+ * Note that this will also check the wire type. The one-argument version
+ * of this function will not check the wire type.
+ *
+ * @returns `true` if there is a next field with this tag.
+ * @pre There must be no current field.
+ * @post If it returns `true` there is a current field now with the given tag.
+ */
+ bool next(pbf_tag_type next_tag, pbf_wire_type type) {
+ while (next()) {
+ if (m_tag == next_tag && m_wire_type == type) {
+ return true;
+ }
+ skip();
+ }
+ return false;
+ }
+
+ /**
+ * The tag of the current field. The tag is the field number from the
+ * description in the .proto file.
+ *
+ * Call next() before calling this function to set the current field.
+ *
+ * @returns tag of the current field.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ */
+ pbf_tag_type tag() const noexcept {
+ return m_tag;
+ }
+
+ /**
+ * Get the wire type of the current field. The wire types are:
+ *
+ * * 0 - varint
+ * * 1 - 64 bit
+ * * 2 - length-delimited
+ * * 5 - 32 bit
+ *
+ * All other types are illegal.
+ *
+ * Call next() before calling this function to set the current field.
+ *
+ * @returns wire type of the current field.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ */
+ pbf_wire_type wire_type() const noexcept {
+ return m_wire_type;
+ }
+
+ /**
+ * Get the tag and wire type of the current field in one integer suitable
+ * for comparison with a switch statement.
+ *
+ * Use it like this:
+ *
+ * @code
+ * pbf_reader message{...};
+ * while (message.next()) {
+ * switch (message.tag_and_type()) {
+ * case tag_and_type(17, pbf_wire_type::length_delimited):
+ * ....
+ * break;
+ * case tag_and_type(21, pbf_wire_type::varint):
+ * ....
+ * break;
+ * default:
+ * message.skip();
+ * }
+ * }
+ * @endcode
+ */
+ uint32_t tag_and_type() const noexcept {
+ return protozero::tag_and_type(tag(), wire_type());
+ }
+
+ /**
+ * Check the wire type of the current field.
+ *
+ * @returns `true` if the current field has the given wire type.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ */
+ bool has_wire_type(pbf_wire_type type) const noexcept {
+ return wire_type() == type;
+ }
+
+ /**
+ * Consume the current field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @post The current field was consumed and there is no current field now.
+ */
+ void skip() {
+ protozero_assert(tag() != 0 && "call next() before calling skip()");
+ switch (wire_type()) {
+ case pbf_wire_type::varint:
+ skip_varint(&m_data, m_end);
+ break;
+ case pbf_wire_type::fixed64:
+ skip_bytes(8);
+ break;
+ case pbf_wire_type::length_delimited:
+ skip_bytes(get_length());
+ break;
+ case pbf_wire_type::fixed32:
+ skip_bytes(4);
+ break;
+ default:
+ break;
+ }
+ }
+
+ ///@{
+ /**
+ * @name Scalar field accessor functions
+ */
+
+ /**
+ * Consume and return value of current "bool" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "bool".
+ * @post The current field was consumed and there is no current field now.
+ */
+ bool get_bool() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ protozero_assert(has_wire_type(pbf_wire_type::varint) && "not a varint");
+ const bool result = m_data[0] != 0;
+ skip_varint(&m_data, m_end);
+ return result;
+ }
+
+ /**
+ * Consume and return value of current "enum" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "enum".
+ * @post The current field was consumed and there is no current field now.
+ */
+ int32_t get_enum() {
+ protozero_assert(has_wire_type(pbf_wire_type::varint) && "not a varint");
+ return get_varint<int32_t>();
+ }
+
+ /**
+ * Consume and return value of current "int32" varint field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "int32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ int32_t get_int32() {
+ protozero_assert(has_wire_type(pbf_wire_type::varint) && "not a varint");
+ return get_varint<int32_t>();
+ }
+
+ /**
+ * Consume and return value of current "sint32" varint field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "sint32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ int32_t get_sint32() {
+ protozero_assert(has_wire_type(pbf_wire_type::varint) && "not a varint");
+ return get_svarint<int32_t>();
+ }
+
+ /**
+ * Consume and return value of current "uint32" varint field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "uint32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ uint32_t get_uint32() {
+ protozero_assert(has_wire_type(pbf_wire_type::varint) && "not a varint");
+ return get_varint<uint32_t>();
+ }
+
+ /**
+ * Consume and return value of current "int64" varint field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "int64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ int64_t get_int64() {
+ protozero_assert(has_wire_type(pbf_wire_type::varint) && "not a varint");
+ return get_varint<int64_t>();
+ }
+
+ /**
+ * Consume and return value of current "sint64" varint field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "sint64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ int64_t get_sint64() {
+ protozero_assert(has_wire_type(pbf_wire_type::varint) && "not a varint");
+ return get_svarint<int64_t>();
+ }
+
+ /**
+ * Consume and return value of current "uint64" varint field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "uint64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ uint64_t get_uint64() {
+ protozero_assert(has_wire_type(pbf_wire_type::varint) && "not a varint");
+ return get_varint<uint64_t>();
+ }
+
+ /**
+ * Consume and return value of current "fixed32" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "fixed32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ uint32_t get_fixed32() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ protozero_assert(has_wire_type(pbf_wire_type::fixed32) && "not a 32-bit fixed");
+ return get_fixed<uint32_t>();
+ }
+
+ /**
+ * Consume and return value of current "sfixed32" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "sfixed32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ int32_t get_sfixed32() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ protozero_assert(has_wire_type(pbf_wire_type::fixed32) && "not a 32-bit fixed");
+ return get_fixed<int32_t>();
+ }
+
+ /**
+ * Consume and return value of current "fixed64" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "fixed64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ uint64_t get_fixed64() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ protozero_assert(has_wire_type(pbf_wire_type::fixed64) && "not a 64-bit fixed");
+ return get_fixed<uint64_t>();
+ }
+
+ /**
+ * Consume and return value of current "sfixed64" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "sfixed64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ int64_t get_sfixed64() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ protozero_assert(has_wire_type(pbf_wire_type::fixed64) && "not a 64-bit fixed");
+ return get_fixed<int64_t>();
+ }
+
+ /**
+ * Consume and return value of current "float" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "float".
+ * @post The current field was consumed and there is no current field now.
+ */
+ float get_float() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ protozero_assert(has_wire_type(pbf_wire_type::fixed32) && "not a 32-bit fixed");
+ return get_fixed<float>();
+ }
+
+ /**
+ * Consume and return value of current "double" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "double".
+ * @post The current field was consumed and there is no current field now.
+ */
+ double get_double() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ protozero_assert(has_wire_type(pbf_wire_type::fixed64) && "not a 64-bit fixed");
+ return get_fixed<double>();
+ }
+
+ /**
+ * Consume and return value of current "bytes", "string", or "message"
+ * field.
+ *
+ * @returns A data_view object.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "bytes", "string", or "message".
+ * @post The current field was consumed and there is no current field now.
+ */
+ data_view get_view() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ protozero_assert(has_wire_type(pbf_wire_type::length_delimited) && "not of type string, bytes or message");
+ const auto len = get_len_and_skip();
+ return {m_data - len, len};
+ }
+
+#ifndef PROTOZERO_STRICT_API
+ /**
+ * Consume and return value of current "bytes" or "string" field.
+ *
+ * @returns A pair with a pointer to the data and the length of the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "bytes" or "string".
+ * @post The current field was consumed and there is no current field now.
+ */
+ std::pair<const char*, pbf_length_type> get_data() {
+ protozero_assert(tag() != 0 && "call next() before accessing field value");
+ protozero_assert(has_wire_type(pbf_wire_type::length_delimited) && "not of type string, bytes or message");
+ const auto len = get_len_and_skip();
+ return {m_data - len, len};
+ }
+#endif
+
+ /**
+ * Consume and return value of current "bytes" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "bytes".
+ * @post The current field was consumed and there is no current field now.
+ */
+ std::string get_bytes() {
+ return std::string(get_view());
+ }
+
+ /**
+ * Consume and return value of current "string" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "string".
+ * @post The current field was consumed and there is no current field now.
+ */
+ std::string get_string() {
+ return std::string(get_view());
+ }
+
+ /**
+ * Consume and return value of current "message" field.
+ *
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "message".
+ * @post The current field was consumed and there is no current field now.
+ */
+ pbf_reader get_message() {
+ return pbf_reader{get_view()};
+ }
+
+ ///@}
+
+ /// Forward iterator for iterating over bool (int32 varint) values.
+ using const_bool_iterator = const_varint_iterator< int32_t>;
+
+ /// Forward iterator for iterating over enum (int32 varint) values.
+ using const_enum_iterator = const_varint_iterator< int32_t>;
+
+ /// Forward iterator for iterating over int32 (varint) values.
+ using const_int32_iterator = const_varint_iterator< int32_t>;
+
+ /// Forward iterator for iterating over sint32 (varint) values.
+ using const_sint32_iterator = const_svarint_iterator<int32_t>;
+
+ /// Forward iterator for iterating over uint32 (varint) values.
+ using const_uint32_iterator = const_varint_iterator<uint32_t>;
+
+ /// Forward iterator for iterating over int64 (varint) values.
+ using const_int64_iterator = const_varint_iterator< int64_t>;
+
+ /// Forward iterator for iterating over sint64 (varint) values.
+ using const_sint64_iterator = const_svarint_iterator<int64_t>;
+
+ /// Forward iterator for iterating over uint64 (varint) values.
+ using const_uint64_iterator = const_varint_iterator<uint64_t>;
+
+ /// Forward iterator for iterating over fixed32 values.
+ using const_fixed32_iterator = const_fixed_iterator<uint32_t>;
+
+ /// Forward iterator for iterating over sfixed32 values.
+ using const_sfixed32_iterator = const_fixed_iterator<int32_t>;
+
+ /// Forward iterator for iterating over fixed64 values.
+ using const_fixed64_iterator = const_fixed_iterator<uint64_t>;
+
+ /// Forward iterator for iterating over sfixed64 values.
+ using const_sfixed64_iterator = const_fixed_iterator<int64_t>;
+
+ /// Forward iterator for iterating over float values.
+ using const_float_iterator = const_fixed_iterator<float>;
+
+ /// Forward iterator for iterating over double values.
+ using const_double_iterator = const_fixed_iterator<double>;
+
+ ///@{
+ /**
+ * @name Repeated packed field accessor functions
+ */
+
+ /**
+ * Consume current "repeated packed bool" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed bool".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_bool_iterator> get_packed_bool() {
+ return get_packed<pbf_reader::const_bool_iterator>();
+ }
+
+ /**
+ * Consume current "repeated packed enum" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed enum".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_enum_iterator> get_packed_enum() {
+ return get_packed<pbf_reader::const_enum_iterator>();
+ }
+
+ /**
+ * Consume current "repeated packed int32" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed int32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_int32_iterator> get_packed_int32() {
+ return get_packed<pbf_reader::const_int32_iterator>();
+ }
+
+ /**
+ * Consume current "repeated packed sint32" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed sint32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_sint32_iterator> get_packed_sint32() {
+ return get_packed<pbf_reader::const_sint32_iterator>();
+ }
+
+ /**
+ * Consume current "repeated packed uint32" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed uint32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_uint32_iterator> get_packed_uint32() {
+ return get_packed<pbf_reader::const_uint32_iterator>();
+ }
+
+ /**
+ * Consume current "repeated packed int64" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed int64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_int64_iterator> get_packed_int64() {
+ return get_packed<pbf_reader::const_int64_iterator>();
+ }
+
+ /**
+ * Consume current "repeated packed sint64" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed sint64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_sint64_iterator> get_packed_sint64() {
+ return get_packed<pbf_reader::const_sint64_iterator>();
+ }
+
+ /**
+ * Consume current "repeated packed uint64" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed uint64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_uint64_iterator> get_packed_uint64() {
+ return get_packed<pbf_reader::const_uint64_iterator>();
+ }
+
+ /**
+ * Consume current "repeated packed fixed32" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed fixed32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_fixed32_iterator> get_packed_fixed32() {
+ return packed_fixed<uint32_t>();
+ }
+
+ /**
+ * Consume current "repeated packed sfixed32" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed sfixed32".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_sfixed32_iterator> get_packed_sfixed32() {
+ return packed_fixed<int32_t>();
+ }
+
+ /**
+ * Consume current "repeated packed fixed64" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed fixed64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_fixed64_iterator> get_packed_fixed64() {
+ return packed_fixed<uint64_t>();
+ }
+
+ /**
+ * Consume current "repeated packed sfixed64" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed sfixed64".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_sfixed64_iterator> get_packed_sfixed64() {
+ return packed_fixed<int64_t>();
+ }
+
+ /**
+ * Consume current "repeated packed float" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed float".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_float_iterator> get_packed_float() {
+ return packed_fixed<float>();
+ }
+
+ /**
+ * Consume current "repeated packed double" field.
+ *
+ * @returns a pair of iterators to the beginning and one past the end of
+ * the data.
+ * @pre There must be a current field (ie. next() must have returned `true`).
+ * @pre The current field must be of type "repeated packed double".
+ * @post The current field was consumed and there is no current field now.
+ */
+ iterator_range<pbf_reader::const_double_iterator> get_packed_double() {
+ return packed_fixed<double>();
+ }
+
+ ///@}
+
+}; // class pbf_reader
+
+/**
+ * Swap two pbf_reader objects.
+ *
+ * @param lhs First object.
+ * @param rhs Second object.
+ */
+inline void swap(pbf_reader& lhs, pbf_reader& rhs) noexcept {
+ lhs.swap(rhs);
+}
+
+} // end namespace protozero
+
+#endif // PROTOZERO_PBF_READER_HPP
diff --git a/ext/protozero/include/protozero/pbf_writer.hpp b/ext/protozero/include/protozero/pbf_writer.hpp
new file mode 100644
index 0000000..9a07bd5
--- /dev/null
+++ b/ext/protozero/include/protozero/pbf_writer.hpp
@@ -0,0 +1,76 @@
+#ifndef PROTOZERO_PBF_WRITER_HPP
+#define PROTOZERO_PBF_WRITER_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file pbf_writer.hpp
+ *
+ * @brief Contains the pbf_writer class.
+ */
+
+#include "basic_pbf_writer.hpp"
+#include "buffer_string.hpp"
+
+#include <cstdint>
+#include <string>
+
+namespace protozero {
+
+/**
+ * Specialization of basic_pbf_writer using std::string as buffer type.
+ */
+using pbf_writer = basic_pbf_writer<std::string>;
+
+/// Class for generating packed repeated bool fields.
+using packed_field_bool = detail::packed_field_varint<std::string, bool>;
+
+/// Class for generating packed repeated enum fields.
+using packed_field_enum = detail::packed_field_varint<std::string, int32_t>;
+
+/// Class for generating packed repeated int32 fields.
+using packed_field_int32 = detail::packed_field_varint<std::string, int32_t>;
+
+/// Class for generating packed repeated sint32 fields.
+using packed_field_sint32 = detail::packed_field_svarint<std::string, int32_t>;
+
+/// Class for generating packed repeated uint32 fields.
+using packed_field_uint32 = detail::packed_field_varint<std::string, uint32_t>;
+
+/// Class for generating packed repeated int64 fields.
+using packed_field_int64 = detail::packed_field_varint<std::string, int64_t>;
+
+/// Class for generating packed repeated sint64 fields.
+using packed_field_sint64 = detail::packed_field_svarint<std::string, int64_t>;
+
+/// Class for generating packed repeated uint64 fields.
+using packed_field_uint64 = detail::packed_field_varint<std::string, uint64_t>;
+
+/// Class for generating packed repeated fixed32 fields.
+using packed_field_fixed32 = detail::packed_field_fixed<std::string, uint32_t>;
+
+/// Class for generating packed repeated sfixed32 fields.
+using packed_field_sfixed32 = detail::packed_field_fixed<std::string, int32_t>;
+
+/// Class for generating packed repeated fixed64 fields.
+using packed_field_fixed64 = detail::packed_field_fixed<std::string, uint64_t>;
+
+/// Class for generating packed repeated sfixed64 fields.
+using packed_field_sfixed64 = detail::packed_field_fixed<std::string, int64_t>;
+
+/// Class for generating packed repeated float fields.
+using packed_field_float = detail::packed_field_fixed<std::string, float>;
+
+/// Class for generating packed repeated double fields.
+using packed_field_double = detail::packed_field_fixed<std::string, double>;
+
+} // end namespace protozero
+
+#endif // PROTOZERO_PBF_WRITER_HPP
diff --git a/ext/protozero/include/protozero/types.hpp b/ext/protozero/include/protozero/types.hpp
new file mode 100644
index 0000000..3aefddf
--- /dev/null
+++ b/ext/protozero/include/protozero/types.hpp
@@ -0,0 +1,66 @@
+#ifndef PROTOZERO_TYPES_HPP
+#define PROTOZERO_TYPES_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file types.hpp
+ *
+ * @brief Contains the declaration of low-level types used in the pbf format.
+ */
+
+#include "config.hpp"
+
+#include <algorithm>
+#include <cstddef>
+#include <cstdint>
+#include <cstring>
+#include <string>
+#include <utility>
+
+namespace protozero {
+
+/**
+ * The type used for field tags (field numbers).
+ */
+using pbf_tag_type = uint32_t;
+
+/**
+ * The type used to encode type information.
+ * See the table on
+ * https://developers.google.com/protocol-buffers/docs/encoding
+ */
+enum class pbf_wire_type : uint32_t {
+ varint = 0, // int32/64, uint32/64, sint32/64, bool, enum
+ fixed64 = 1, // fixed64, sfixed64, double
+ length_delimited = 2, // string, bytes, nested messages, packed repeated fields
+ fixed32 = 5, // fixed32, sfixed32, float
+ unknown = 99 // used for default setting in this library
+};
+
+/**
+ * Get the tag and wire type of the current field in one integer suitable
+ * for comparison with a switch statement.
+ *
+ * See pbf_reader.tag_and_type() for an example how to use this.
+ */
+template <typename T>
+constexpr inline uint32_t tag_and_type(T tag, pbf_wire_type wire_type) noexcept {
+ return (static_cast<uint32_t>(static_cast<pbf_tag_type>(tag)) << 3U) | static_cast<uint32_t>(wire_type);
+}
+
+/**
+ * The type used for length values, such as the length of a field.
+ */
+using pbf_length_type = uint32_t;
+
+} // end namespace protozero
+
+#endif // PROTOZERO_TYPES_HPP
diff --git a/ext/protozero/include/protozero/varint.hpp b/ext/protozero/include/protozero/varint.hpp
new file mode 100644
index 0000000..b4648a4
--- /dev/null
+++ b/ext/protozero/include/protozero/varint.hpp
@@ -0,0 +1,245 @@
+#ifndef PROTOZERO_VARINT_HPP
+#define PROTOZERO_VARINT_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file varint.hpp
+ *
+ * @brief Contains low-level varint and zigzag encoding and decoding functions.
+ */
+
+#include "buffer_tmpl.hpp"
+#include "exception.hpp"
+
+#include <cstdint>
+
+namespace protozero {
+
+/**
+ * The maximum length of a 64 bit varint.
+ */
+constexpr const int8_t max_varint_length = sizeof(uint64_t) * 8 / 7 + 1;
+
+namespace detail {
+
+ // from https://github.com/facebook/folly/blob/master/folly/Varint.h
+ inline uint64_t decode_varint_impl(const char** data, const char* end) {
+ const auto* begin = reinterpret_cast<const int8_t*>(*data);
+ const auto* iend = reinterpret_cast<const int8_t*>(end);
+ const int8_t* p = begin;
+ uint64_t val = 0;
+
+ if (iend - begin >= max_varint_length) { // fast path
+ do {
+ int64_t b = *p++;
+ val = ((uint64_t(b) & 0x7fU) ); if (b >= 0) { break; }
+ b = *p++; val |= ((uint64_t(b) & 0x7fU) << 7U); if (b >= 0) { break; }
+ b = *p++; val |= ((uint64_t(b) & 0x7fU) << 14U); if (b >= 0) { break; }
+ b = *p++; val |= ((uint64_t(b) & 0x7fU) << 21U); if (b >= 0) { break; }
+ b = *p++; val |= ((uint64_t(b) & 0x7fU) << 28U); if (b >= 0) { break; }
+ b = *p++; val |= ((uint64_t(b) & 0x7fU) << 35U); if (b >= 0) { break; }
+ b = *p++; val |= ((uint64_t(b) & 0x7fU) << 42U); if (b >= 0) { break; }
+ b = *p++; val |= ((uint64_t(b) & 0x7fU) << 49U); if (b >= 0) { break; }
+ b = *p++; val |= ((uint64_t(b) & 0x7fU) << 56U); if (b >= 0) { break; }
+ b = *p++; val |= ((uint64_t(b) & 0x01U) << 63U); if (b >= 0) { break; }
+ throw varint_too_long_exception{};
+ } while (false);
+ } else {
+ unsigned int shift = 0;
+ while (p != iend && *p < 0) {
+ val |= (uint64_t(*p++) & 0x7fU) << shift;
+ shift += 7;
+ }
+ if (p == iend) {
+ throw end_of_buffer_exception{};
+ }
+ val |= uint64_t(*p++) << shift;
+ }
+
+ *data = reinterpret_cast<const char*>(p);
+ return val;
+ }
+
+} // end namespace detail
+
+/**
+ * Decode a 64 bit varint.
+ *
+ * Strong exception guarantee: if there is an exception the data pointer will
+ * not be changed.
+ *
+ * @param[in,out] data Pointer to pointer to the input data. After the function
+ * returns this will point to the next data to be read.
+ * @param[in] end Pointer one past the end of the input data.
+ * @returns The decoded integer
+ * @throws varint_too_long_exception if the varint is longer then the maximum
+ * length that would fit in a 64 bit int. Usually this means your data
+ * is corrupted or you are trying to read something as a varint that
+ * isn't.
+ * @throws end_of_buffer_exception if the *end* of the buffer was reached
+ * before the end of the varint.
+ */
+inline uint64_t decode_varint(const char** data, const char* end) {
+ // If this is a one-byte varint, decode it here.
+ if (end != *data && ((static_cast<uint64_t>(**data) & 0x80U) == 0)) {
+ const auto val = static_cast<uint64_t>(**data);
+ ++(*data);
+ return val;
+ }
+ // If this varint is more than one byte, defer to complete implementation.
+ return detail::decode_varint_impl(data, end);
+}
+
+/**
+ * Skip over a varint.
+ *
+ * Strong exception guarantee: if there is an exception the data pointer will
+ * not be changed.
+ *
+ * @param[in,out] data Pointer to pointer to the input data. After the function
+ * returns this will point to the next data to be read.
+ * @param[in] end Pointer one past the end of the input data.
+ * @throws end_of_buffer_exception if the *end* of the buffer was reached
+ * before the end of the varint.
+ */
+inline void skip_varint(const char** data, const char* end) {
+ const auto* begin = reinterpret_cast<const int8_t*>(*data);
+ const auto* iend = reinterpret_cast<const int8_t*>(end);
+ const int8_t* p = begin;
+
+ while (p != iend && *p < 0) {
+ ++p;
+ }
+
+ if (p - begin >= max_varint_length) {
+ throw varint_too_long_exception{};
+ }
+
+ if (p == iend) {
+ throw end_of_buffer_exception{};
+ }
+
+ ++p;
+
+ *data = reinterpret_cast<const char*>(p);
+}
+
+/**
+ * Varint encode a 64 bit integer.
+ *
+ * @tparam T An output iterator type.
+ * @param data Output iterator the varint encoded value will be written to
+ * byte by byte.
+ * @param value The integer that will be encoded.
+ * @returns the number of bytes written
+ * @throws Any exception thrown by increment or dereference operator on data.
+ * @deprecated Use add_varint_to_buffer() instead.
+ */
+template <typename T>
+inline int write_varint(T data, uint64_t value) {
+ int n = 1;
+
+ while (value >= 0x80U) {
+ *data++ = char((value & 0x7fU) | 0x80U);
+ value >>= 7U;
+ ++n;
+ }
+ *data = char(value);
+
+ return n;
+}
+
+/**
+ * Varint encode a 64 bit integer.
+ *
+ * @tparam TBuffer A buffer type.
+ * @param buffer Output buffer the varint will be written to.
+ * @param value The integer that will be encoded.
+ * @returns the number of bytes written
+ * @throws Any exception thrown by calling the buffer_push_back() function.
+ */
+template <typename TBuffer>
+inline void add_varint_to_buffer(TBuffer* buffer, uint64_t value) {
+ while (value >= 0x80U) {
+ buffer_customization<TBuffer>::push_back(buffer, char((value & 0x7fU) | 0x80U));
+ value >>= 7U;
+ }
+ buffer_customization<TBuffer>::push_back(buffer, char(value));
+}
+
+/**
+ * Varint encode a 64 bit integer.
+ *
+ * @param data Where to add the varint. There must be enough space available!
+ * @param value The integer that will be encoded.
+ * @returns the number of bytes written
+ */
+inline int add_varint_to_buffer(char* data, uint64_t value) noexcept {
+ int n = 1;
+
+ while (value >= 0x80U) {
+ *data++ = char((value & 0x7fU) | 0x80U);
+ value >>= 7U;
+ ++n;
+ }
+ *data = char(value);
+
+ return n;
+}
+
+/**
+ * Get the length of the varint the specified value would produce.
+ *
+ * @param value The integer to be encoded.
+ * @returns the number of bytes the varint would have if we created it.
+ */
+inline int length_of_varint(uint64_t value) noexcept {
+ int n = 1;
+
+ while (value >= 0x80U) {
+ value >>= 7U;
+ ++n;
+ }
+
+ return n;
+}
+
+/**
+ * ZigZag encodes a 32 bit integer.
+ */
+inline constexpr uint32_t encode_zigzag32(int32_t value) noexcept {
+ return (static_cast<uint32_t>(value) << 1U) ^ static_cast<uint32_t>(-static_cast<int32_t>(static_cast<uint32_t>(value) >> 31U));
+}
+
+/**
+ * ZigZag encodes a 64 bit integer.
+ */
+inline constexpr uint64_t encode_zigzag64(int64_t value) noexcept {
+ return (static_cast<uint64_t>(value) << 1U) ^ static_cast<uint64_t>(-static_cast<int64_t>(static_cast<uint64_t>(value) >> 63U));
+}
+
+/**
+ * Decodes a 32 bit ZigZag-encoded integer.
+ */
+inline constexpr int32_t decode_zigzag32(uint32_t value) noexcept {
+ return static_cast<int32_t>((value >> 1U) ^ static_cast<uint32_t>(-static_cast<int32_t>(value & 1U)));
+}
+
+/**
+ * Decodes a 64 bit ZigZag-encoded integer.
+ */
+inline constexpr int64_t decode_zigzag64(uint64_t value) noexcept {
+ return static_cast<int64_t>((value >> 1U) ^ static_cast<uint64_t>(-static_cast<int64_t>(value & 1U)));
+}
+
+} // end namespace protozero
+
+#endif // PROTOZERO_VARINT_HPP
diff --git a/ext/protozero/include/protozero/version.hpp b/ext/protozero/include/protozero/version.hpp
new file mode 100644
index 0000000..9a0e4cc
--- /dev/null
+++ b/ext/protozero/include/protozero/version.hpp
@@ -0,0 +1,34 @@
+#ifndef PROTOZERO_VERSION_HPP
+#define PROTOZERO_VERSION_HPP
+
+/*****************************************************************************
+
+protozero - Minimalistic protocol buffer decoder and encoder in C++.
+
+This file is from https://github.com/mapbox/protozero where you can find more
+documentation.
+
+*****************************************************************************/
+
+/**
+ * @file version.hpp
+ *
+ * @brief Contains macros defining the protozero version.
+ */
+
+/// The major version number
+#define PROTOZERO_VERSION_MAJOR 1
+
+/// The minor version number
+#define PROTOZERO_VERSION_MINOR 7
+
+/// The patch number
+#define PROTOZERO_VERSION_PATCH 0
+
+/// The complete version number
+#define PROTOZERO_VERSION_CODE (PROTOZERO_VERSION_MAJOR * 10000 + PROTOZERO_VERSION_MINOR * 100 + PROTOZERO_VERSION_PATCH)
+
+/// Version number as string
+#define PROTOZERO_VERSION_STRING "1.7.0"
+
+#endif // PROTOZERO_VERSION_HPP
diff --git a/ext/yahttp/LICENSE b/ext/yahttp/LICENSE
new file mode 100644
index 0000000..08f6f64
--- /dev/null
+++ b/ext/yahttp/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Aki Tuomi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/ext/yahttp/Makefile.am b/ext/yahttp/Makefile.am
new file mode 100644
index 0000000..aaaeee0
--- /dev/null
+++ b/ext/yahttp/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = yahttp
+
+EXTRA_DIST = LICENSE README.md
diff --git a/ext/yahttp/Makefile.in b/ext/yahttp/Makefile.in
new file mode 100644
index 0000000..04def69
--- /dev/null
+++ b/ext/yahttp/Makefile.in
@@ -0,0 +1,740 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = ext/yahttp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_pthread_set_name.m4 \
+ $(top_srcdir)/m4/ax_arg_default_enable_disable.m4 \
+ $(top_srcdir)/m4/ax_check_sign.m4 \
+ $(top_srcdir)/m4/ax_compile_check_sizeof.m4 \
+ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
+ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \
+ $(top_srcdir)/m4/ax_python_module.m4 $(top_srcdir)/m4/boost.m4 \
+ $(top_srcdir)/m4/dnsdist_enable_dnscrypt.m4 \
+ $(top_srcdir)/m4/dnsdist_enable_doh.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/pdns_check_cdb.m4 \
+ $(top_srcdir)/m4/pdns_check_clock_gettime.m4 \
+ $(top_srcdir)/m4/pdns_check_dnstap.m4 \
+ $(top_srcdir)/m4/pdns_check_libcrypto.m4 \
+ $(top_srcdir)/m4/pdns_check_libedit.m4 \
+ $(top_srcdir)/m4/pdns_check_libh2o_evloop.m4 \
+ $(top_srcdir)/m4/pdns_check_lmdb.m4 \
+ $(top_srcdir)/m4/pdns_check_lua_hpp.m4 \
+ $(top_srcdir)/m4/pdns_check_network_libs.m4 \
+ $(top_srcdir)/m4/pdns_check_os.m4 \
+ $(top_srcdir)/m4/pdns_check_pthread_np.m4 \
+ $(top_srcdir)/m4/pdns_check_python_venv.m4 \
+ $(top_srcdir)/m4/pdns_check_ragel.m4 \
+ $(top_srcdir)/m4/pdns_check_secure_memset.m4 \
+ $(top_srcdir)/m4/pdns_check_time_t.m4 \
+ $(top_srcdir)/m4/pdns_d_fortify_source.m4 \
+ $(top_srcdir)/m4/pdns_enable_sanitizers.m4 \
+ $(top_srcdir)/m4/pdns_enable_tls.m4 \
+ $(top_srcdir)/m4/pdns_enable_unit_tests.m4 \
+ $(top_srcdir)/m4/pdns_param_ssp_buffer_size.m4 \
+ $(top_srcdir)/m4/pdns_pie.m4 $(top_srcdir)/m4/pdns_relro.m4 \
+ $(top_srcdir)/m4/pdns_stack_protector.m4 \
+ $(top_srcdir)/m4/pdns_with_ebpf.m4 \
+ $(top_srcdir)/m4/pdns_with_gnutls.m4 \
+ $(top_srcdir)/m4/pdns_with_libcap.m4 \
+ $(top_srcdir)/m4/pdns_with_libsodium.m4 \
+ $(top_srcdir)/m4/pdns_with_libssl.m4 \
+ $(top_srcdir)/m4/pdns_with_lua.m4 \
+ $(top_srcdir)/m4/pdns_with_net_snmp.m4 \
+ $(top_srcdir)/m4/pdns_with_nghttp2.m4 \
+ $(top_srcdir)/m4/pdns_with_re2.m4 \
+ $(top_srcdir)/m4/pdns_with_service_user.m4 \
+ $(top_srcdir)/m4/systemd.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+ ctags-recursive dvi-recursive html-recursive info-recursive \
+ install-data-recursive install-dvi-recursive \
+ install-exec-recursive install-html-recursive \
+ install-info-recursive install-pdf-recursive \
+ install-ps-recursive install-recursive installcheck-recursive \
+ installdirs-recursive pdf-recursive ps-recursive \
+ tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+ $(RECURSIVE_TARGETS) \
+ $(RECURSIVE_CLEAN_TARGETS) \
+ $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+ distdir distdir-am
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+ dir0=`pwd`; \
+ sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+ sed_rest='s,^[^/]*/*,,'; \
+ sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+ sed_butlast='s,/*[^/]*$$,,'; \
+ while test -n "$$dir1"; do \
+ first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+ if test "$$first" != "."; then \
+ if test "$$first" = ".."; then \
+ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+ else \
+ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+ if test "$$first2" = "$$first"; then \
+ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+ else \
+ dir2="../$$dir2"; \
+ fi; \
+ dir0="$$dir0"/"$$first"; \
+ fi; \
+ fi; \
+ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+ done; \
+ reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CPPFLAGS = @AM_CPPFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
+BOOST_LDPATH = @BOOST_LDPATH@
+BOOST_ROOT = @BOOST_ROOT@
+BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS = @BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS@
+BOOST_UNIT_TEST_FRAMEWORK_LDPATH = @BOOST_UNIT_TEST_FRAMEWORK_LDPATH@
+BOOST_UNIT_TEST_FRAMEWORK_LIBS = @BOOST_UNIT_TEST_FRAMEWORK_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDB_CFLAGS = @CDB_CFLAGS@
+CDB_LIBS = @CDB_LIBS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+DYNLINKFLAGS = @DYNLINKFLAGS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FSTRM_CFLAGS = @FSTRM_CFLAGS@
+FSTRM_LIBS = @FSTRM_LIBS@
+GNUTLS_CFLAGS = @GNUTLS_CFLAGS@
+GNUTLS_LIBS = @GNUTLS_LIBS@
+GREP = @GREP@
+HAVE_CXX17 = @HAVE_CXX17@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPCRYPT_CFLAGS = @IPCRYPT_CFLAGS@
+IPCRYPT_LIBS = @IPCRYPT_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAP_CFLAGS = @LIBCAP_CFLAGS@
+LIBCAP_LIBS = @LIBCAP_LIBS@
+LIBCRYPTO_INCLUDES = @LIBCRYPTO_INCLUDES@
+LIBCRYPTO_LDFLAGS = @LIBCRYPTO_LDFLAGS@
+LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@
+LIBEDIT_CFLAGS = @LIBEDIT_CFLAGS@
+LIBEDIT_LIBS = @LIBEDIT_LIBS@
+LIBH2OEVLOOP_CFLAGS = @LIBH2OEVLOOP_CFLAGS@
+LIBH2OEVLOOP_LIBS = @LIBH2OEVLOOP_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSODIUM_CFLAGS = @LIBSODIUM_CFLAGS@
+LIBSODIUM_LIBS = @LIBSODIUM_LIBS@
+LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
+LIBSSL_LIBS = @LIBSSL_LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LMDB_CFLAGS = @LMDB_CFLAGS@
+LMDB_LIBS = @LMDB_LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LUA_CFLAGS = @LUA_CFLAGS@
+LUA_LIBS = @LUA_LIBS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NET_SNMP_CFLAGS = @NET_SNMP_CFLAGS@
+NET_SNMP_LIBS = @NET_SNMP_LIBS@
+NGHTTP2_CFLAGS = @NGHTTP2_CFLAGS@
+NGHTTP2_LIBS = @NGHTTP2_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGEVERSION = @PACKAGEVERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PIE_CFLAGS = @PIE_CFLAGS@
+PIE_LDFLAGS = @PIE_LDFLAGS@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PROGRAM_LDFLAGS = @PROGRAM_LDFLAGS@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RAGEL = @RAGEL@
+RANLIB = @RANLIB@
+RE2_CFLAGS = @RE2_CFLAGS@
+RE2_LIBS = @RE2_LIBS@
+RELRO_LDFLAGS = @RELRO_LDFLAGS@
+RT_LIBS = @RT_LIBS@
+SANITIZER_FLAGS = @SANITIZER_FLAGS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEMCTL = @SYSTEMCTL@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_DIR = @SYSTEMD_DIR@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+SYSTEMD_MODULES_LOAD = @SYSTEMD_MODULES_LOAD@
+THREADFLAGS = @THREADFLAGS@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+YAHTTP_CFLAGS = @YAHTTP_CFLAGS@
+YAHTTP_LIBS = @YAHTTP_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+service_group = @service_group@
+service_user = @service_user@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemd = @systemd@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = yahttp
+EXTRA_DIST = LICENSE README.md
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ext/yahttp/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign ext/yahttp/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+# (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+ @fail=; \
+ if $(am__make_keepgoing); then \
+ failcom='fail=yes'; \
+ else \
+ failcom='exit 1'; \
+ fi; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+ @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ $(am__make_dryrun) \
+ || test -d "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
+ || exit 1; \
+ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+ $(am__relativize); \
+ new_distdir=$$reldir; \
+ dir1=$$subdir; dir2="$(top_distdir)"; \
+ $(am__relativize); \
+ new_top_distdir=$$reldir; \
+ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+ ($(am__cd) $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$new_top_distdir" \
+ distdir="$$new_distdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
+ am__skip_mode_fix=: \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+ check-am clean clean-generic clean-libtool cscopelist-am ctags \
+ ctags-am distclean distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ext/yahttp/README.md b/ext/yahttp/README.md
new file mode 100644
index 0000000..86794b5
--- /dev/null
+++ b/ext/yahttp/README.md
@@ -0,0 +1,69 @@
+Yet Another HTTP Library
+========================
+
+YaHTTP aims to be a pure http request/response parser that has no IO ties. It is intended to be used on small-footprint applications and other utilities that want to use HTTP over something else than network IO.
+
+[![Build Status](https://travis-ci.org/cmouse/yahttp.svg?branch=master)](https://travis-ci.org/cmouse/yahttp)
+[![Coverity Scan Build Status](https://scan.coverity.com/projects/2161/badge.svg)](https://scan.coverity.com/projects/2161)
+[![Coverage Status](https://coveralls.io/repos/github/cmouse/yahttp/badge.svg)](https://coveralls.io/github/cmouse/yahttp)
+
+WARNINGS
+--------
+If you are upgrading from version before May 02, 2014 - *PLEASE BE SURE TO CHECK THAT EVERYTHING WORKS AS EXPECTED*. There has been complete overhaul of the library and many things have changed.
+
+NOTES
+-----
+Do not use resp = req, or resp(req) to build the response object, despite it being supported. This will cause request headers to get duplicated. Also, you *must* set response#version to request#version if you intend to support older than HTTP/1.1 clients. Set response#status to at least 200, it won't be done for you. No Server or Product token is sent either, you can add those if you want.
+
+If you do not want to send chunked responses, set content-length header. Setting this header will always disable chunked responses. This will also happen if you downgrade your responses to version 10 or 9.
+
+Integration guide
+-----------------
+
+Here are some instructions on how to integrate YaHTTP into your project.
+
+With automake and libtool
+-------------------------
+
+If you don't need router or any of the C++11 features, you can just create empty yahttp-config.h, or symlink it to your project's config.h for the yahttp.hpp to include. Then just put this stuff into it's own folder and create Makefile.am with following contents (you can change the compilation flags):
+
+```
+noinst_LTLIBRARIES=libyahttp.la
+libyahttp_la_CXXFLAGS=$(RELRO_CFLAGS) $(PIE_CFLAGS) -D__STRICT_ANSI__
+libyahttp_la_SOURCES=cookie.hpp exception.hpp reqresp.cpp reqresp.hpp router.cpp router.hpp url.hpp utility.hpp yahttp.hpp
+```
+
+You can define RELRO and PIE to match your project.
+
+To compile your project use -Lpath/to/yahttp -lyahttp
+
+If you need router, additionally check for boost or C++11 and replace yahttp-config.h to config.h in yahttp.hpp or add relevant options to your compiler CXXFLAGS. See below for the flags.
+
+Without automake
+----------------
+
+Create simple Makefile with contents for C++11:
+
+```
+OBJECTS=reqresp.o router.o
+CXX=gcc
+CXXFLAGS=-W -Wall -DHAVE_CXX11 -std=c++11
+```
+
+Or create simple Makefile with contents for boost:
+
+```
+OBJECTS=reqresp.o router.o
+CXX=gcc
+CXXFLAGS=-W -Wall -DHAVE_BOOST
+```
+
+Or if you don't need either one, just:
+
+```
+OBJECTS=reqresp.o
+CXX=gcc
+CXXFLAGS=-W -Wall
+```
+
+YaHTTP include files can be placed where the rest of your includes are. Then just add your own code there and it should work just fine.
diff --git a/ext/yahttp/yahttp/Makefile.am b/ext/yahttp/yahttp/Makefile.am
new file mode 100644
index 0000000..3ed41e5
--- /dev/null
+++ b/ext/yahttp/yahttp/Makefile.am
@@ -0,0 +1,13 @@
+noinst_LTLIBRARIES = libyahttp.la
+
+libyahttp_la_SOURCES = \
+ cookie.hpp \
+ exception.hpp \
+ reqresp.cpp \
+ reqresp.hpp \
+ router.cpp \
+ router.hpp \
+ url.hpp \
+ utility.hpp \
+ yahttp-config.h \
+ yahttp.hpp
diff --git a/ext/yahttp/yahttp/Makefile.in b/ext/yahttp/yahttp/Makefile.in
new file mode 100644
index 0000000..5dd68a8
--- /dev/null
+++ b/ext/yahttp/yahttp/Makefile.in
@@ -0,0 +1,748 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = ext/yahttp/yahttp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/ac_pthread_set_name.m4 \
+ $(top_srcdir)/m4/ax_arg_default_enable_disable.m4 \
+ $(top_srcdir)/m4/ax_check_sign.m4 \
+ $(top_srcdir)/m4/ax_compile_check_sizeof.m4 \
+ $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
+ $(top_srcdir)/m4/ax_cxx_compile_stdcxx_17.m4 \
+ $(top_srcdir)/m4/ax_python_module.m4 $(top_srcdir)/m4/boost.m4 \
+ $(top_srcdir)/m4/dnsdist_enable_dnscrypt.m4 \
+ $(top_srcdir)/m4/dnsdist_enable_doh.m4 \
+ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+ $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/m4/pdns_check_cdb.m4 \
+ $(top_srcdir)/m4/pdns_check_clock_gettime.m4 \
+ $(top_srcdir)/m4/pdns_check_dnstap.m4 \
+ $(top_srcdir)/m4/pdns_check_libcrypto.m4 \
+ $(top_srcdir)/m4/pdns_check_libedit.m4 \
+ $(top_srcdir)/m4/pdns_check_libh2o_evloop.m4 \
+ $(top_srcdir)/m4/pdns_check_lmdb.m4 \
+ $(top_srcdir)/m4/pdns_check_lua_hpp.m4 \
+ $(top_srcdir)/m4/pdns_check_network_libs.m4 \
+ $(top_srcdir)/m4/pdns_check_os.m4 \
+ $(top_srcdir)/m4/pdns_check_pthread_np.m4 \
+ $(top_srcdir)/m4/pdns_check_python_venv.m4 \
+ $(top_srcdir)/m4/pdns_check_ragel.m4 \
+ $(top_srcdir)/m4/pdns_check_secure_memset.m4 \
+ $(top_srcdir)/m4/pdns_check_time_t.m4 \
+ $(top_srcdir)/m4/pdns_d_fortify_source.m4 \
+ $(top_srcdir)/m4/pdns_enable_sanitizers.m4 \
+ $(top_srcdir)/m4/pdns_enable_tls.m4 \
+ $(top_srcdir)/m4/pdns_enable_unit_tests.m4 \
+ $(top_srcdir)/m4/pdns_param_ssp_buffer_size.m4 \
+ $(top_srcdir)/m4/pdns_pie.m4 $(top_srcdir)/m4/pdns_relro.m4 \
+ $(top_srcdir)/m4/pdns_stack_protector.m4 \
+ $(top_srcdir)/m4/pdns_with_ebpf.m4 \
+ $(top_srcdir)/m4/pdns_with_gnutls.m4 \
+ $(top_srcdir)/m4/pdns_with_libcap.m4 \
+ $(top_srcdir)/m4/pdns_with_libsodium.m4 \
+ $(top_srcdir)/m4/pdns_with_libssl.m4 \
+ $(top_srcdir)/m4/pdns_with_lua.m4 \
+ $(top_srcdir)/m4/pdns_with_net_snmp.m4 \
+ $(top_srcdir)/m4/pdns_with_nghttp2.m4 \
+ $(top_srcdir)/m4/pdns_with_re2.m4 \
+ $(top_srcdir)/m4/pdns_with_service_user.m4 \
+ $(top_srcdir)/m4/systemd.m4 $(top_srcdir)/m4/warnings.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libyahttp_la_LIBADD =
+am_libyahttp_la_OBJECTS = reqresp.lo router.lo
+libyahttp_la_OBJECTS = $(am_libyahttp_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/reqresp.Plo ./$(DEPDIR)/router.Plo
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+AM_V_CXX = $(am__v_CXX_@AM_V@)
+am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
+am__v_CXX_0 = @echo " CXX " $@;
+am__v_CXX_1 =
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
+am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
+am__v_CXXLD_0 = @echo " CXXLD " $@;
+am__v_CXXLD_1 =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libyahttp_la_SOURCES)
+DIST_SOURCES = $(libyahttp_la_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_CPPFLAGS = @AM_CPPFLAGS@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BOOST_CPPFLAGS = @BOOST_CPPFLAGS@
+BOOST_LDPATH = @BOOST_LDPATH@
+BOOST_ROOT = @BOOST_ROOT@
+BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS = @BOOST_UNIT_TEST_FRAMEWORK_LDFLAGS@
+BOOST_UNIT_TEST_FRAMEWORK_LDPATH = @BOOST_UNIT_TEST_FRAMEWORK_LDPATH@
+BOOST_UNIT_TEST_FRAMEWORK_LIBS = @BOOST_UNIT_TEST_FRAMEWORK_LIBS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDB_CFLAGS = @CDB_CFLAGS@
+CDB_LIBS = @CDB_LIBS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DISTCHECK_CONFIGURE_FLAGS = @DISTCHECK_CONFIGURE_FLAGS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+DYNLINKFLAGS = @DYNLINKFLAGS@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FSTRM_CFLAGS = @FSTRM_CFLAGS@
+FSTRM_LIBS = @FSTRM_LIBS@
+GNUTLS_CFLAGS = @GNUTLS_CFLAGS@
+GNUTLS_LIBS = @GNUTLS_LIBS@
+GREP = @GREP@
+HAVE_CXX17 = @HAVE_CXX17@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPCRYPT_CFLAGS = @IPCRYPT_CFLAGS@
+IPCRYPT_LIBS = @IPCRYPT_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCAP_CFLAGS = @LIBCAP_CFLAGS@
+LIBCAP_LIBS = @LIBCAP_LIBS@
+LIBCRYPTO_INCLUDES = @LIBCRYPTO_INCLUDES@
+LIBCRYPTO_LDFLAGS = @LIBCRYPTO_LDFLAGS@
+LIBCRYPTO_LIBS = @LIBCRYPTO_LIBS@
+LIBEDIT_CFLAGS = @LIBEDIT_CFLAGS@
+LIBEDIT_LIBS = @LIBEDIT_LIBS@
+LIBH2OEVLOOP_CFLAGS = @LIBH2OEVLOOP_CFLAGS@
+LIBH2OEVLOOP_LIBS = @LIBH2OEVLOOP_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBSODIUM_CFLAGS = @LIBSODIUM_CFLAGS@
+LIBSODIUM_LIBS = @LIBSODIUM_LIBS@
+LIBSSL_CFLAGS = @LIBSSL_CFLAGS@
+LIBSSL_LIBS = @LIBSSL_LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LMDB_CFLAGS = @LMDB_CFLAGS@
+LMDB_LIBS = @LMDB_LIBS@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LUA_CFLAGS = @LUA_CFLAGS@
+LUA_LIBS = @LUA_LIBS@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NET_SNMP_CFLAGS = @NET_SNMP_CFLAGS@
+NET_SNMP_LIBS = @NET_SNMP_LIBS@
+NGHTTP2_CFLAGS = @NGHTTP2_CFLAGS@
+NGHTTP2_LIBS = @NGHTTP2_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGEVERSION = @PACKAGEVERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PIE_CFLAGS = @PIE_CFLAGS@
+PIE_LDFLAGS = @PIE_LDFLAGS@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PROGRAM_LDFLAGS = @PROGRAM_LDFLAGS@
+PYTHON = @PYTHON@
+PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PLATFORM = @PYTHON_PLATFORM@
+PYTHON_PREFIX = @PYTHON_PREFIX@
+PYTHON_VERSION = @PYTHON_VERSION@
+RAGEL = @RAGEL@
+RANLIB = @RANLIB@
+RE2_CFLAGS = @RE2_CFLAGS@
+RE2_LIBS = @RE2_LIBS@
+RELRO_LDFLAGS = @RELRO_LDFLAGS@
+RT_LIBS = @RT_LIBS@
+SANITIZER_FLAGS = @SANITIZER_FLAGS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEMCTL = @SYSTEMCTL@
+SYSTEMD_CFLAGS = @SYSTEMD_CFLAGS@
+SYSTEMD_DIR = @SYSTEMD_DIR@
+SYSTEMD_LIBS = @SYSTEMD_LIBS@
+SYSTEMD_MODULES_LOAD = @SYSTEMD_MODULES_LOAD@
+THREADFLAGS = @THREADFLAGS@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+YAHTTP_CFLAGS = @YAHTTP_CFLAGS@
+YAHTTP_LIBS = @YAHTTP_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+pkgpyexecdir = @pkgpyexecdir@
+pkgpythondir = @pkgpythondir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+pyexecdir = @pyexecdir@
+pythondir = @pythondir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+service_group = @service_group@
+service_user = @service_user@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemd = @systemd@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+noinst_LTLIBRARIES = libyahttp.la
+libyahttp_la_SOURCES = \
+ cookie.hpp \
+ exception.hpp \
+ reqresp.cpp \
+ reqresp.hpp \
+ router.cpp \
+ router.hpp \
+ url.hpp \
+ utility.hpp \
+ yahttp-config.h \
+ yahttp.hpp
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ext/yahttp/yahttp/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign ext/yahttp/yahttp/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+ -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+ @list='$(noinst_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+libyahttp.la: $(libyahttp_la_OBJECTS) $(libyahttp_la_DEPENDENCIES) $(EXTRA_libyahttp_la_DEPENDENCIES)
+ $(AM_V_CXXLD)$(CXXLINK) $(libyahttp_la_OBJECTS) $(libyahttp_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reqresp.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/router.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ set x; \
+ here=`pwd`; \
+ $(am__define_uniq_tagged_files); \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/reqresp.Plo
+ -rm -f ./$(DEPDIR)/router.Plo
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f ./$(DEPDIR)/reqresp.Plo
+ -rm -f ./$(DEPDIR)/router.Plo
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-noinstLTLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ext/yahttp/yahttp/cookie.hpp b/ext/yahttp/yahttp/cookie.hpp
new file mode 100644
index 0000000..aa5359b
--- /dev/null
+++ b/ext/yahttp/yahttp/cookie.hpp
@@ -0,0 +1,144 @@
+namespace YaHTTP {
+ /*! Implements a single cookie */
+ class Cookie {
+ public:
+ Cookie() {
+ secure = false;
+ httponly = false;
+ name = value = "";
+ expires = DateTime();
+ }; //!< Set the cookie to empty value
+
+ Cookie(const Cookie &rhs) {
+ name = rhs.name;
+ value = rhs.value;
+ domain = rhs.domain;
+ path = rhs.path;
+ secure = rhs.secure;
+ httponly = rhs.httponly;
+ expires = rhs.expires;
+ }; //<! Copy cookie values
+
+ Cookie& operator=(const Cookie &rhs) {
+ name = rhs.name;
+ value = rhs.value;
+ domain = rhs.domain;
+ path = rhs.path;
+ secure = rhs.secure;
+ httponly = rhs.httponly;
+ expires = rhs.expires;
+ return *this;
+ }
+
+ DateTime expires; /*!< Expiration date */
+ std::string domain; /*!< Domain where cookie is valid */
+ std::string path; /*!< Path where the cookie is valid */
+ bool httponly; /*!< Whether the cookie is for server use only */
+ bool secure; /*!< Whether the cookie is for HTTPS only */
+
+ std::string name; /*!< Cookie name */
+ std::string value; /*!< Cookie value */
+
+ std::string str() const {
+ std::ostringstream oss;
+ oss << YaHTTP::Utility::encodeURL(name) << "=" << YaHTTP::Utility::encodeURL(value);
+
+ if (expires.isSet)
+ oss << "; expires=" << expires.cookie_str();
+ if (domain.size()>0)
+ oss << "; domain=" << domain;
+ if (path.size()>0)
+ oss << "; path=" << path;
+ if (secure)
+ oss << "; secure";
+ if (httponly)
+ oss << "; httpOnly";
+ return oss.str();
+ }; //!< Stringify the cookie
+ };
+
+ /*! Implements a Cookie jar for storing multiple cookies */
+ class CookieJar {
+ public:
+ std::map<std::string, Cookie, ASCIICINullSafeComparator> cookies; //<! cookie container
+
+ CookieJar() {}; //<! constructs empty cookie jar
+ CookieJar(const CookieJar & rhs) {
+ this->cookies = rhs.cookies;
+ } //<! copy cookies from another cookie jar
+ CookieJar& operator=(const CookieJar & rhs) = default;
+
+ void clear() {
+ this->cookies.clear();
+ }
+
+ void keyValuePair(const std::string &keyvalue, std::string &key, std::string &value) {
+ size_t pos;
+ pos = keyvalue.find("=");
+ if (pos == std::string::npos) throw ParseError("Not a Key-Value pair (cookie)");
+ key = std::string(keyvalue.begin(), keyvalue.begin()+pos);
+ value = std::string(keyvalue.begin()+pos+1, keyvalue.end());
+ } //<! key value pair parser
+
+ void parseCookieHeader(const std::string &cookiestr) {
+ size_t pos, npos;
+ std::list<Cookie> lcookies;
+ Cookie c;
+ pos = 0;
+ while(pos < cookiestr.size()) {
+ if ((npos = cookiestr.find("; ", pos)) == std::string::npos)
+ npos = cookiestr.size();
+ keyValuePair(cookiestr.substr(pos, npos-pos), c.name, c.value);
+ c.name = YaHTTP::Utility::decodeURL(c.name);
+ c.value = YaHTTP::Utility::decodeURL(c.value);
+ lcookies.push_back(c);
+ pos = npos+2;
+ }
+ for(std::list<Cookie>::iterator i = lcookies.begin(); i != lcookies.end(); i++) {
+ this->cookies[i->name] = *i;
+ }
+ }
+
+ void parseSetCookieHeader(const std::string &cookiestr) {
+ Cookie c;
+ size_t pos,npos;
+ std::string k, v;
+
+ if ((pos = cookiestr.find("; ", 0)) == std::string::npos)
+ pos = cookiestr.size();
+ keyValuePair(cookiestr.substr(0, pos), c.name, c.value);
+ c.name = YaHTTP::Utility::decodeURL(c.name);
+ c.value = YaHTTP::Utility::decodeURL(c.value);
+ if (pos < cookiestr.size()) pos+=2;
+
+ while(pos < cookiestr.size()) {
+ if ((npos = cookiestr.find("; ", pos)) == std::string::npos)
+ npos = cookiestr.size();
+ std::string s = cookiestr.substr(pos, npos-pos);
+ if (s.find("=") != std::string::npos)
+ keyValuePair(s, k, v);
+ else
+ k = s;
+ if (k == "expires") {
+ DateTime dt;
+ dt.parseCookie(v);
+ c.expires = dt;
+ } else if (k == "domain") {
+ c.domain = v;
+ } else if (k == "path") {
+ c.path = v;
+ } else if (k == "httpOnly") {
+ c.httponly = true;
+ } else if (k == "secure") {
+ c.secure = true;
+ } else {
+ // ignore crap
+ break;
+ }
+ pos = npos+2;
+ }
+
+ this->cookies[c.name] = c;
+ }; //<! Parse multiple cookies from header
+ };
+};
diff --git a/ext/yahttp/yahttp/exception.hpp b/ext/yahttp/yahttp/exception.hpp
new file mode 100644
index 0000000..d0ea0fe
--- /dev/null
+++ b/ext/yahttp/yahttp/exception.hpp
@@ -0,0 +1,24 @@
+#pragma once
+#include <exception>
+
+namespace YaHTTP {
+ /*! Generic error class */
+ class Error: public std::exception {
+ public:
+ Error() {};
+ Error(const std::string& reason_): reason(reason_) {};
+ virtual ~Error() throw() {};
+
+ virtual const char* what() const throw()
+ {
+ return reason.c_str();
+ }
+ const std::string reason; //<! Cause of the error
+ };
+ /*! Parse error class */
+ class ParseError: public YaHTTP::Error {
+ public:
+ ParseError() {};
+ ParseError(const std::string& reason_): Error(reason_) {};
+ };
+};
diff --git a/ext/yahttp/yahttp/reqresp.cpp b/ext/yahttp/yahttp/reqresp.cpp
new file mode 100644
index 0000000..dc49cb6
--- /dev/null
+++ b/ext/yahttp/yahttp/reqresp.cpp
@@ -0,0 +1,331 @@
+#include "yahttp.hpp"
+
+namespace YaHTTP {
+
+ template class AsyncLoader<Request>;
+ template class AsyncLoader<Response>;
+
+ bool isspace(char c) {
+ return std::isspace(c) != 0;
+ }
+
+ bool isspace(char c, const std::locale& loc) {
+ return std::isspace(c, loc);
+ }
+
+ bool isxdigit(char c) {
+ return std::isxdigit(c) != 0;
+ }
+
+ bool isxdigit(char c, const std::locale& loc) {
+ return std::isxdigit(c, loc);
+ }
+
+ bool isdigit(char c) {
+ return std::isdigit(c) != 0;
+ }
+
+ bool isdigit(char c, const std::locale& loc) {
+ return std::isdigit(c, loc);
+ }
+
+ bool isalnum(char c) {
+ return std::isalnum(c) != 0;
+ }
+
+ bool isalnum(char c, const std::locale& loc) {
+ return std::isalnum(c, loc);
+ }
+
+ template <class T>
+ bool AsyncLoader<T>::feed(const std::string& somedata) {
+ buffer.append(somedata);
+ while(state < 2) {
+ int cr=0;
+ pos = buffer.find_first_of("\n");
+ // need to find CRLF in buffer
+ if (pos == std::string::npos) return false;
+ if (pos>0 && buffer[pos-1]=='\r')
+ cr=1;
+ std::string line(buffer.begin(), buffer.begin()+pos-cr); // exclude CRLF
+ buffer.erase(buffer.begin(), buffer.begin()+pos+1); // remove line from buffer including CRLF
+
+ if (state == 0) { // startup line
+ if (target->kind == YAHTTP_TYPE_REQUEST) {
+ std::string ver;
+ std::string tmpurl;
+ std::istringstream iss(line);
+ iss >> target->method >> tmpurl >> ver;
+ if (ver.size() == 0)
+ target->version = 9;
+ else if (ver.find("HTTP/0.9") == 0)
+ target->version = 9;
+ else if (ver.find("HTTP/1.0") == 0)
+ target->version = 10;
+ else if (ver.find("HTTP/1.1") == 0)
+ target->version = 11;
+ else
+ throw ParseError("HTTP version not supported");
+ // uppercase the target method
+ std::transform(target->method.begin(), target->method.end(), target->method.begin(), ::toupper);
+ target->url.parse(tmpurl);
+ target->getvars = Utility::parseUrlParameters(target->url.parameters);
+ state = 1;
+ } else if(target->kind == YAHTTP_TYPE_RESPONSE) {
+ std::string ver;
+ std::istringstream iss(line);
+ std::string::size_type pos1;
+ iss >> ver >> target->status;
+ std::getline(iss, target->statusText);
+ pos1=0;
+ while(pos1 < target->statusText.size() && YaHTTP::isspace(target->statusText.at(pos1))) pos1++;
+ target->statusText = target->statusText.substr(pos1);
+ if ((pos1 = target->statusText.find("\r")) != std::string::npos) {
+ target->statusText = target->statusText.substr(0, pos1-1);
+ }
+ if (ver.size() == 0) {
+ target->version = 9;
+ } else if (ver.find("HTTP/0.9") == 0)
+ target->version = 9;
+ else if (ver.find("HTTP/1.0") == 0)
+ target->version = 10;
+ else if (ver.find("HTTP/1.1") == 0)
+ target->version = 11;
+ else
+ throw ParseError("HTTP version not supported");
+ state = 1;
+ }
+ } else if (state == 1) {
+ std::string key,value;
+ size_t pos1;
+ if (line.empty()) {
+ chunked = (target->headers.find("transfer-encoding") != target->headers.end() && target->headers["transfer-encoding"] == "chunked");
+ state = 2;
+ break;
+ }
+ // split headers
+ if ((pos1 = line.find(":")) == std::string::npos) {
+ throw ParseError("Malformed header line");
+ }
+ key = line.substr(0, pos1);
+ value = line.substr(pos1 + 1);
+ for(std::string::iterator it=key.begin(); it != key.end(); it++)
+ if (YaHTTP::isspace(*it))
+ throw ParseError("Header key contains whitespace which is not allowed by RFC");
+
+ Utility::trim(value);
+ std::transform(key.begin(), key.end(), key.begin(), ::tolower);
+ // is it already defined
+
+ if (key == "set-cookie" && target->kind == YAHTTP_TYPE_RESPONSE) {
+ target->jar.parseSetCookieHeader(value);
+ } else if (key == "cookie" && target->kind == YAHTTP_TYPE_REQUEST) {
+ target->jar.parseCookieHeader(value);
+ } else {
+ if (key == "host" && target->kind == YAHTTP_TYPE_REQUEST) {
+ // maybe it contains port?
+ if ((pos1 = value.find(":")) == std::string::npos) {
+ target->url.host = value;
+ } else {
+ target->url.host = value.substr(0, pos1);
+ target->url.port = ::atoi(value.substr(pos1).c_str());
+ }
+ }
+ if (target->headers.find(key) != target->headers.end()) {
+ target->headers[key] = target->headers[key] + ";" + value;
+ } else {
+ target->headers[key] = value;
+ }
+ }
+ }
+ }
+
+ minbody = 0;
+ // check for expected body size
+ if (target->kind == YAHTTP_TYPE_REQUEST) maxbody = target->max_request_size;
+ else if (target->kind == YAHTTP_TYPE_RESPONSE) maxbody = target->max_response_size;
+ else maxbody = 0;
+
+ if (!chunked) {
+ if (target->headers.find("content-length") != target->headers.end()) {
+ std::istringstream maxbodyS(target->headers["content-length"]);
+ maxbodyS >> minbody;
+ maxbody = minbody;
+ }
+ if (minbody < 1) return true; // guess there isn't anything left.
+ if (target->kind == YAHTTP_TYPE_REQUEST && static_cast<ssize_t>(minbody) > target->max_request_size) throw ParseError("Max request body size exceeded");
+ else if (target->kind == YAHTTP_TYPE_RESPONSE && static_cast<ssize_t>(minbody) > target->max_response_size) throw ParseError("Max response body size exceeded");
+ }
+
+ if (maxbody == 0) hasBody = false;
+ else hasBody = true;
+
+ if (buffer.size() == 0) return ready();
+
+ while(buffer.size() > 0) {
+ if (chunked) {
+ if (chunk_size == 0) {
+ char buf[100];
+ // read chunk length
+ if ((pos = buffer.find('\n')) == std::string::npos) return false;
+ if (pos > 99)
+ throw ParseError("Impossible chunk_size");
+ buffer.copy(buf, pos);
+ buf[pos]=0; // just in case...
+ buffer.erase(buffer.begin(), buffer.begin()+pos+1); // remove line from buffer
+ if (sscanf(buf, "%x", &chunk_size) != 1) {
+ throw ParseError("Unable to parse chunk size");
+ }
+ if (chunk_size == 0) { state = 3; break; } // last chunk
+ } else {
+ int crlf=1;
+ if (buffer.size() < static_cast<size_t>(chunk_size+1)) return false; // expect newline
+ if (buffer.at(chunk_size) == '\r') {
+ if (buffer.size() < static_cast<size_t>(chunk_size+2) || buffer.at(chunk_size+1) != '\n') return false; // expect newline after carriage return
+ crlf=2;
+ } else if (buffer.at(chunk_size) != '\n') return false;
+ std::string tmp = buffer.substr(0, chunk_size);
+ buffer.erase(buffer.begin(), buffer.begin()+chunk_size+crlf);
+ bodybuf << tmp;
+ chunk_size = 0;
+ if (buffer.size() == 0) break; // just in case
+ }
+ } else {
+ if (bodybuf.str().length() + buffer.length() > maxbody)
+ bodybuf << buffer.substr(0, maxbody - bodybuf.str().length());
+ else
+ bodybuf << buffer;
+ buffer = "";
+ }
+ }
+
+ if (chunk_size!=0) return false; // need more data
+
+ return ready();
+ };
+
+ void HTTPBase::write(std::ostream& os) const {
+ if (kind == YAHTTP_TYPE_REQUEST) {
+ std::ostringstream getparmbuf;
+ std::string getparms;
+ // prepare URL
+ for(strstr_map_t::const_iterator i = getvars.begin(); i != getvars.end(); i++) {
+ getparmbuf << Utility::encodeURL(i->first, false) << "=" << Utility::encodeURL(i->second, false) << "&";
+ }
+ if (getparmbuf.str().length() > 0) {
+ std::string buf = getparmbuf.str();
+ getparms = "?" + std::string(buf.begin(), buf.end() - 1);
+ }
+ else
+ getparms = "";
+ os << method << " " << url.path << getparms << " HTTP/" << versionStr(this->version);
+ } else if (kind == YAHTTP_TYPE_RESPONSE) {
+ os << "HTTP/" << versionStr(this->version) << " " << status << " ";
+ if (statusText.empty())
+ os << Utility::status2text(status);
+ else
+ os << statusText;
+ }
+ os << "\r\n";
+
+ bool cookieSent = false;
+ bool sendChunked = false;
+
+ if (this->version > 10) { // 1.1 or better
+ if (headers.find("content-length") == headers.end() && !this->is_multipart) {
+ // must use chunked on response
+ sendChunked = (kind == YAHTTP_TYPE_RESPONSE);
+ if ((headers.find("transfer-encoding") != headers.end() && headers.find("transfer-encoding")->second != "chunked")) {
+ throw YaHTTP::Error("Transfer-encoding must be chunked, or Content-Length defined");
+ }
+ if ((headers.find("transfer-encoding") == headers.end() && kind == YAHTTP_TYPE_RESPONSE)) {
+ sendChunked = true;
+ os << "Transfer-Encoding: chunked\r\n";
+ }
+ } else {
+ sendChunked = false;
+ }
+ }
+
+ // write headers
+ strstr_map_t::const_iterator iter = headers.begin();
+ while(iter != headers.end()) {
+ if (iter->first == "host" && (kind != YAHTTP_TYPE_REQUEST || version < 10)) { iter++; continue; }
+ if (iter->first == "transfer-encoding" && sendChunked) { iter++; continue; }
+ std::string header = Utility::camelizeHeader(iter->first);
+ if (header == "Cookie" || header == "Set-Cookie") cookieSent = true;
+ os << Utility::camelizeHeader(iter->first) << ": " << iter->second << "\r\n";
+ iter++;
+ }
+ if (version > 9 && !cookieSent && jar.cookies.size() > 0) { // write cookies
+ if (kind == YAHTTP_TYPE_REQUEST) {
+ bool first = true;
+ os << "Cookie: ";
+ for(strcookie_map_t::const_iterator i = jar.cookies.begin(); i != jar.cookies.end(); i++) {
+ if (first)
+ first = false;
+ else
+ os << "; ";
+ os << Utility::encodeURL(i->second.name) << "=" << Utility::encodeURL(i->second.value);
+ }
+ } else if (kind == YAHTTP_TYPE_RESPONSE) {
+ for(strcookie_map_t::const_iterator i = jar.cookies.begin(); i != jar.cookies.end(); i++) {
+ os << "Set-Cookie: ";
+ os << i->second.str() << "\r\n";
+ }
+ }
+ }
+ os << "\r\n";
+#ifdef HAVE_CPP_FUNC_PTR
+ this->renderer(this, os, sendChunked);
+#else
+ SendbodyRenderer r;
+ r(this, os, chunked)
+#endif
+ };
+
+ std::ostream& operator<<(std::ostream& os, const Response &resp) {
+ resp.write(os);
+ return os;
+ };
+
+ std::istream& operator>>(std::istream& is, Response &resp) {
+ YaHTTP::AsyncResponseLoader arl;
+ arl.initialize(&resp);
+ while(is.good()) {
+ char buf[1024];
+ is.read(buf, 1024);
+ if (is.gcount()>0) { // did we actually read anything
+ is.clear();
+ if (arl.feed(std::string(buf, is.gcount())) == true) break; // completed
+ }
+ }
+ // throw unless ready
+ if (arl.ready() == false)
+ throw ParseError("Was not able to extract a valid Response from stream");
+ arl.finalize();
+ return is;
+ };
+
+ std::ostream& operator<<(std::ostream& os, const Request &req) {
+ req.write(os);
+ return os;
+ };
+
+ std::istream& operator>>(std::istream& is, Request &req) {
+ YaHTTP::AsyncRequestLoader arl;
+ arl.initialize(&req);
+ while(is.good()) {
+ char buf[1024];
+ is.read(buf, 1024);
+ if (is.gcount() > 0) { // did we actually read anything
+ is.clear();
+ if (arl.feed(std::string(buf, is.gcount())) == true) break; // completed
+ }
+ }
+ if (arl.ready() == false)
+ throw ParseError("Was not able to extract a valid Request from stream");
+ arl.finalize();
+ return is;
+ };
+};
diff --git a/ext/yahttp/yahttp/reqresp.hpp b/ext/yahttp/yahttp/reqresp.hpp
new file mode 100644
index 0000000..00ba545
--- /dev/null
+++ b/ext/yahttp/yahttp/reqresp.hpp
@@ -0,0 +1,351 @@
+#ifdef HAVE_CXX11
+#include <functional>
+#define HAVE_CPP_FUNC_PTR
+namespace funcptr = std;
+#else
+#ifdef HAVE_BOOST
+#include <boost/function.hpp>
+namespace funcptr = boost;
+#define HAVE_CPP_FUNC_PTR
+#endif
+#endif
+
+#include <fstream>
+#include <cctype>
+
+#ifndef WIN32
+#include <cstdio>
+#include <unistd.h>
+#endif
+
+#include <algorithm>
+
+#ifndef YAHTTP_MAX_REQUEST_SIZE
+#define YAHTTP_MAX_REQUEST_SIZE 2097152
+#endif
+
+#ifndef YAHTTP_MAX_RESPONSE_SIZE
+#define YAHTTP_MAX_RESPONSE_SIZE 2097152
+#endif
+
+#define YAHTTP_TYPE_REQUEST 1
+#define YAHTTP_TYPE_RESPONSE 2
+
+namespace YaHTTP {
+ typedef std::map<std::string,Cookie,ASCIICINullSafeComparator> strcookie_map_t; //<! String to Cookie map
+
+ typedef enum {
+ urlencoded,
+ multipart
+ } postformat_t; //<! Enumeration of possible post encodings, url encoding or multipart
+
+ /*! Base class for request and response */
+ class HTTPBase {
+ public:
+ /*! Default renderer for request/response, simply copies body to response */
+ class SendBodyRender {
+ public:
+ SendBodyRender() {};
+
+ size_t operator()(const HTTPBase *doc, std::ostream& os, bool chunked) const {
+ if (chunked) {
+ std::string::size_type i,cl;
+ for(i=0;i<doc->body.length();i+=1024) {
+ cl = std::min(static_cast<std::string::size_type>(1024), doc->body.length()-i); // for less than 1k blocks
+ os << std::hex << cl << std::dec << "\r\n";
+ os << doc->body.substr(i, cl) << "\r\n";
+ }
+ os << 0 << "\r\n\r\n"; // last chunk
+ } else {
+ os << doc->body;
+ }
+ return doc->body.length();
+ }; //<! writes body to ostream and returns length
+ };
+ /* Simple sendfile renderer which streams file to ostream */
+ class SendFileRender {
+ public:
+ SendFileRender(const std::string& path_) {
+ this->path = path_;
+ };
+
+ size_t operator()(const HTTPBase *doc __attribute__((unused)), std::ostream& os, bool chunked) const {
+ char buf[4096];
+ size_t n,k;
+#ifdef HAVE_CXX11
+ std::ifstream ifs(path, std::ifstream::binary);
+#else
+ std::ifstream ifs(path.c_str(), std::ifstream::binary);
+#endif
+ n = 0;
+
+ while(ifs.good()) {
+ ifs.read(buf, sizeof buf);
+ n += (k = ifs.gcount());
+ if (k > 0) {
+ if (chunked) os << std::hex << k << std::dec << "\r\n";
+ os.write(buf, k);
+ if (chunked) os << "\r\n";
+ }
+ }
+ if (chunked) os << 0 << "\r\n\r\n";
+ return n;
+ }; //<! writes file to ostream and returns length
+
+ std::string path; //<! File to send
+ };
+
+ HTTPBase() {
+ HTTPBase::initialize();
+ };
+
+ virtual void initialize() {
+ kind = 0;
+ status = 0;
+#ifdef HAVE_CPP_FUNC_PTR
+ renderer = SendBodyRender();
+#endif
+ max_request_size = YAHTTP_MAX_REQUEST_SIZE;
+ max_response_size = YAHTTP_MAX_RESPONSE_SIZE;
+ url = "";
+ method = "";
+ statusText = "";
+ jar.clear();
+ headers.clear();
+ parameters.clear();
+ getvars.clear();
+ postvars.clear();
+ body = "";
+ routeName = "";
+ version = 11; // default to version 1.1
+ is_multipart = false;
+ }
+protected:
+ HTTPBase(const HTTPBase& rhs) {
+ this->url = rhs.url; this->kind = rhs.kind;
+ this->status = rhs.status; this->statusText = rhs.statusText;
+ this->method = rhs.method; this->headers = rhs.headers;
+ this->jar = rhs.jar; this->postvars = rhs.postvars;
+ this->parameters = rhs.parameters; this->getvars = rhs.getvars;
+ this->body = rhs.body; this->max_request_size = rhs.max_request_size;
+ this->max_response_size = rhs.max_response_size; this->version = rhs.version;
+#ifdef HAVE_CPP_FUNC_PTR
+ this->renderer = rhs.renderer;
+#endif
+ this->is_multipart = rhs.is_multipart;
+ };
+ virtual HTTPBase& operator=(const HTTPBase& rhs) {
+ this->url = rhs.url; this->kind = rhs.kind;
+ this->status = rhs.status; this->statusText = rhs.statusText;
+ this->method = rhs.method; this->headers = rhs.headers;
+ this->jar = rhs.jar; this->postvars = rhs.postvars;
+ this->parameters = rhs.parameters; this->getvars = rhs.getvars;
+ this->body = rhs.body; this->max_request_size = rhs.max_request_size;
+ this->max_response_size = rhs.max_response_size; this->version = rhs.version;
+#ifdef HAVE_CPP_FUNC_PTR
+ this->renderer = rhs.renderer;
+#endif
+ this->is_multipart = rhs.is_multipart;
+ return *this;
+ };
+public:
+ URL url; //<! URL of this request/response
+ int kind; //<! Type of object (1 = request, 2 = response)
+ int status; //<! status code
+ int version; //<! http version 9 = 0.9, 10 = 1.0, 11 = 1.1
+ std::string statusText; //<! textual representation of status code
+ std::string method; //<! http verb
+ strstr_map_t headers; //<! map of header(s)
+ CookieJar jar; //<! cookies
+ strstr_map_t postvars; //<! map of POST variables (from POST body)
+ strstr_map_t getvars; //<! map of GET variables (from URL)
+// these two are for Router
+ strstr_map_t parameters; //<! map of route parameters (only if you use YaHTTP::Router)
+ std::string routeName; //<! name of the current route (only if you use YaHTTP::Router)
+
+ std::string body; //<! the actual content
+
+ ssize_t max_request_size; //<! maximum size of request
+ ssize_t max_response_size; //<! maximum size of response
+ bool is_multipart; //<! if the request is multipart, prevents Content-Length header
+#ifdef HAVE_CPP_FUNC_PTR
+ funcptr::function<size_t(const HTTPBase*,std::ostream&,bool)> renderer; //<! rendering function
+#endif
+ void write(std::ostream& os) const; //<! writes request to the given output stream
+
+ strstr_map_t& GET() { return getvars; }; //<! acccessor for getvars
+ strstr_map_t& POST() { return postvars; }; //<! accessor for postvars
+ strcookie_map_t& COOKIES() { return jar.cookies; }; //<! accessor for cookies
+
+ std::string versionStr(int version_) const {
+ switch(version_) {
+ case 9: return "0.9";
+ case 10: return "1.0";
+ case 11: return "1.1";
+ default: throw YaHTTP::Error("Unsupported version");
+ }
+ };
+
+ std::string str() const {
+ std::ostringstream oss;
+ write(oss);
+ return oss.str();
+ }; //<! return string representation of this object
+ };
+
+ /*! Response class, represents a HTTP Response document */
+ class Response: public HTTPBase {
+ public:
+ Response() { Response::initialize(); };
+ Response(const HTTPBase& rhs): HTTPBase(rhs) {
+ this->kind = YAHTTP_TYPE_RESPONSE;
+ };
+ Response& operator=(const HTTPBase& rhs) override {
+ HTTPBase::operator=(rhs);
+ this->kind = YAHTTP_TYPE_RESPONSE;
+ return *this;
+ };
+ void initialize() override {
+ HTTPBase::initialize();
+ this->kind = YAHTTP_TYPE_RESPONSE;
+ }
+ void initialize(const HTTPBase& rhs) {
+ HTTPBase::initialize();
+ this->kind = YAHTTP_TYPE_RESPONSE;
+ // copy SOME attributes
+ this->url = rhs.url;
+ this->method = rhs.method;
+ this->jar = rhs.jar;
+ this->version = rhs.version;
+ }
+ friend std::ostream& operator<<(std::ostream& os, const Response &resp);
+ friend std::istream& operator>>(std::istream& is, Response &resp);
+ };
+
+ /* Request class, represents a HTTP Request document */
+ class Request: public HTTPBase {
+ public:
+ Request() { Request::initialize(); };
+ Request(const HTTPBase& rhs): HTTPBase(rhs) {
+ this->kind = YAHTTP_TYPE_REQUEST;
+ };
+ Request& operator=(const HTTPBase& rhs) override {
+ HTTPBase::operator=(rhs);
+ this->kind = YAHTTP_TYPE_REQUEST;
+ return *this;
+ };
+ void initialize() override {
+ HTTPBase::initialize();
+ this->kind = YAHTTP_TYPE_REQUEST;
+ }
+ void initialize(const HTTPBase& rhs) {
+ HTTPBase::initialize();
+ this->kind = YAHTTP_TYPE_REQUEST;
+ // copy SOME attributes
+ this->url = rhs.url;
+ this->method = rhs.method;
+ this->jar = rhs.jar;
+ this->version = rhs.version;
+ }
+ void setup(const std::string& method_, const std::string& url_) {
+ this->url.parse(url_);
+ this->headers["host"] = this->url.host.find(":") == std::string::npos ? this->url.host : "[" + this->url.host + "]";
+ this->method = method_;
+ std::transform(this->method.begin(), this->method.end(), this->method.begin(), ::toupper);
+ this->headers["user-agent"] = "YaHTTP v1.0";
+ }; //<! Set some initial things for a request
+
+ void preparePost(postformat_t format = urlencoded) {
+ std::ostringstream postbuf;
+ if (format == urlencoded) {
+ for(strstr_map_t::const_iterator i = POST().begin(); i != POST().end(); i++) {
+ postbuf << Utility::encodeURL(i->first, false) << "=" << Utility::encodeURL(i->second, false) << "&";
+ }
+ // remove last bit
+ if (postbuf.str().length()>0)
+ body = postbuf.str().substr(0, postbuf.str().length()-1);
+ else
+ body = "";
+ headers["content-type"] = "application/x-www-form-urlencoded; charset=utf-8";
+ } else if (format == multipart) {
+ headers["content-type"] = "multipart/form-data; boundary=YaHTTP-12ca543";
+ this->is_multipart = true;
+ for(strstr_map_t::const_iterator i = POST().begin(); i != POST().end(); i++) {
+ postbuf << "--YaHTTP-12ca543\r\nContent-Disposition: form-data; name=\"" << Utility::encodeURL(i->first, false) << "\"; charset=UTF-8\r\nContent-Length: " << i->second.size() << "\r\n\r\n"
+ << Utility::encodeURL(i->second, false) << "\r\n";
+ }
+ postbuf << "--";
+ body = postbuf.str();
+ }
+
+ postbuf.str("");
+ postbuf << body.length();
+ // set method and change headers
+ method = "POST";
+ if (!this->is_multipart)
+ headers["content-length"] = postbuf.str();
+ }; //<! convert all postvars into string and stuff it into body
+
+ friend std::ostream& operator<<(std::ostream& os, const Request &resp);
+ friend std::istream& operator>>(std::istream& is, Request &resp);
+ };
+
+ /*! Asynchronous HTTP document loader */
+ template <class T>
+ class AsyncLoader {
+ public:
+ T* target; //<! target to populate
+ int state; //<! reader state
+ size_t pos; //<! reader position
+
+ std::string buffer; //<! read buffer
+ bool chunked; //<! whether we are parsing chunked data
+ int chunk_size; //<! expected size of next chunk
+ std::ostringstream bodybuf; //<! buffer for body
+ size_t maxbody; //<! maximum size of body
+ size_t minbody; //<! minimum size of body
+ bool hasBody; //<! are we expecting body
+
+ void keyValuePair(const std::string &keyvalue, std::string &key, std::string &value); //<! key value pair parser helper
+
+ void initialize(T* target_) {
+ chunked = false; chunk_size = 0;
+ bodybuf.str(""); minbody = 0; maxbody = 0;
+ pos = 0; state = 0; this->target = target_;
+ hasBody = false;
+ buffer = "";
+ this->target->initialize();
+ }; //<! Initialize the parser for target and clear state
+ bool feed(const std::string& somedata); //<! Feed data to the parser
+ bool ready() {
+ return (chunked == true && state == 3) || // if it's chunked we get end of data indication
+ (chunked == false && state > 1 &&
+ (!hasBody ||
+ (bodybuf.str().size() <= maxbody &&
+ bodybuf.str().size() >= minbody)
+ )
+ );
+ }; //<! whether we have received enough data
+ void finalize() {
+ bodybuf.flush();
+ if (ready()) {
+ strstr_map_t::iterator cpos = target->headers.find("content-type");
+ if (cpos != target->headers.end() && Utility::iequals(cpos->second, "application/x-www-form-urlencoded", 32)) {
+ target->postvars = Utility::parseUrlParameters(bodybuf.str());
+ }
+ target->body = bodybuf.str();
+ }
+ bodybuf.str("");
+ this->target = NULL;
+ }; //<! finalize and release target
+ };
+
+ /*! Asynchronous HTTP response loader */
+ class AsyncResponseLoader: public AsyncLoader<Response> {
+ };
+
+ /*! Asynchronous HTTP request loader */
+ class AsyncRequestLoader: public AsyncLoader<Request> {
+ };
+
+};
diff --git a/ext/yahttp/yahttp/router.cpp b/ext/yahttp/yahttp/router.cpp
new file mode 100644
index 0000000..489f8cf
--- /dev/null
+++ b/ext/yahttp/yahttp/router.cpp
@@ -0,0 +1,160 @@
+/* @file
+ * @brief Concrete implementation of Router
+ */
+#include "yahttp.hpp"
+#include "router.hpp"
+
+namespace YaHTTP {
+ typedef funcptr::tuple<int,int> TDelim;
+
+ // router is defined here.
+ YaHTTP::Router Router::router;
+
+ void Router::map(const std::string& method, const std::string& url, THandlerFunction handler, const std::string& name) {
+ std::string method2 = method;
+ bool isopen=false;
+ // add into vector
+ for(std::string::const_iterator i = url.begin(); i != url.end(); i++) {
+ if (*i == '<' && isopen) throw Error("Invalid URL mask, cannot have < after <");
+ if (*i == '<') isopen = true;
+ if (*i == '>' && !isopen) throw Error("Invalid URL mask, cannot have > without < first");
+ if (*i == '>') isopen = false;
+ }
+ std::transform(method2.begin(), method2.end(), method2.begin(), ::toupper);
+ routes.push_back(funcptr::make_tuple(method2, url, handler, name));
+ };
+
+ bool Router::route(Request *req, THandlerFunction& handler) {
+ std::map<std::string, TDelim> params;
+ int pos1,pos2;
+ bool matched = false;
+ std::string rname;
+
+ // iterate routes
+ for(TRouteList::iterator i = routes.begin(); !matched && i != routes.end(); i++) {
+ int k1,k2,k3;
+ std::string pname;
+ std::string method, url;
+ funcptr::tie(method, url, handler, rname) = *i;
+
+ if (method.empty() == false && req->method != method) continue; // no match on method
+ // see if we can't match the url
+ params.clear();
+ // simple matcher func
+ for(k1=0, k2=0; k1 < static_cast<int>(url.size()) && k2 < static_cast<int>(req->url.path.size()); ) {
+ if (url[k1] == '<') {
+ pos1 = k2;
+ k3 = k1+1;
+ // start of parameter
+ while(k1 < static_cast<int>(url.size()) && url[k1] != '>') k1++;
+ pname = std::string(url.begin()+k3, url.begin()+k1);
+ // then we also look it on the url
+ if (pname[0]=='*') {
+ pname = pname.substr(1);
+ // this matches whatever comes after it, basically end of string
+ pos2 = req->url.path.size();
+ if (pname != "")
+ params[pname] = funcptr::tie(pos1,pos2);
+ k1 = url.size();
+ k2 = req->url.path.size();
+ break;
+ } else {
+ // match until url[k1]
+ while(k2 < static_cast<int>(req->url.path.size()) && req->url.path[k2] != url[k1+1]) k2++;
+ pos2 = k2;
+ params[pname] = funcptr::tie(pos1,pos2);
+ }
+ k2--;
+ }
+ else if (url[k1] != req->url.path[k2]) {
+ break;
+ }
+
+ k1++; k2++;
+ }
+
+ // ensure.
+ if (url[k1] != req->url.path[k2])
+ matched = false;
+ else
+ matched = true;
+ }
+
+ if (!matched) { return false; } // no route
+ req->parameters.clear();
+
+ for(std::map<std::string, TDelim>::iterator i = params.begin(); i != params.end(); i++) {
+ int p1,p2;
+ funcptr::tie(p1,p2) = i->second;
+ std::string value(req->url.path.begin() + p1, req->url.path.begin() + p2);
+ value = Utility::decodeURL(value);
+ req->parameters[i->first] = value;
+ }
+
+ req->routeName = rname;
+
+ return true;
+ };
+
+ void Router::printRoutes(std::ostream &os) {
+ for(TRouteList::iterator i = routes.begin(); i != routes.end(); i++) {
+#ifdef HAVE_CXX11
+ std::streamsize ss = os.width();
+ std::ios::fmtflags ff = os.setf(std::ios::left);
+ os.width(10);
+ os << std::get<0>(*i);
+ os.width(50);
+ os << std::get<1>(*i);
+ os.width(ss);
+ os.setf(ff);
+ os << " " << std::get<3>(*i);
+ os << std::endl;
+#else
+ os << i->get<0>() << " " << i->get<1>() << " " << i->get<3>() << std::endl;
+#endif
+ }
+ };
+
+ std::pair<std::string,std::string> Router::urlFor(const std::string &name, const strstr_map_t& arguments) {
+ std::ostringstream path;
+ std::string mask,method,result;
+ int k1,k2,k3;
+
+ bool found = false;
+ for(TRouteList::iterator i = routes.begin(); !found && i != routes.end(); i++) {
+#ifdef HAVE_CXX11
+ if (std::get<3>(*i) == name) { mask = std::get<1>(*i); method = std::get<0>(*i); found = true; }
+#else
+ if (i->get<3>() == name) { mask = i->get<1>(); method = i->get<0>(); found = true; }
+#endif
+ }
+
+ if (!found)
+ throw Error("Route not found");
+
+ for(k1=0,k3=0;k1<static_cast<int>(mask.size());k1++) {
+ if (mask[k1] == '<') {
+ std::string pname;
+ strstr_map_t::const_iterator pptr;
+ k2=k1;
+ while(k1<static_cast<int>(mask.size()) && mask[k1]!='>') k1++;
+ path << mask.substr(k3,k2-k3);
+ if (mask[k2+1] == '*')
+ pname = std::string(mask.begin() + k2 + 2, mask.begin() + k1);
+ else
+ pname = std::string(mask.begin() + k2 + 1, mask.begin() + k1);
+ if ((pptr = arguments.find(pname)) != arguments.end())
+ path << Utility::encodeURL(pptr->second);
+ k3 = k1+1;
+ }
+ else if (mask[k1] == '*') {
+ // ready
+ k3++;
+ continue;
+ }
+ }
+ path << mask.substr(k3);
+ result = path.str();
+ return std::make_pair(method, result);
+ }
+};
diff --git a/ext/yahttp/yahttp/router.hpp b/ext/yahttp/yahttp/router.hpp
new file mode 100644
index 0000000..a0dbd13
--- /dev/null
+++ b/ext/yahttp/yahttp/router.hpp
@@ -0,0 +1,72 @@
+#pragma once
+/* @file
+ * @brief Defines router class and support structures
+ */
+#ifdef HAVE_CXX11
+#include <functional>
+#include <tuple>
+#define HAVE_CPP_FUNC_PTR
+#define IGNORE std::ignore
+namespace funcptr = std;
+#else
+#ifdef HAVE_BOOST
+#include <boost/function.hpp>
+#include <boost/tuple/tuple.hpp>
+#define IGNORE boost::tuples::ignore
+namespace funcptr = boost;
+#define HAVE_CPP_FUNC_PTR
+#else
+#warning "You need to configure with boost or have C++11 capable compiler for router"
+#endif
+#endif
+
+#ifdef HAVE_CPP_FUNC_PTR
+#include <vector>
+#include <utility>
+
+namespace YaHTTP {
+ typedef funcptr::function <void(Request* req, Response* resp)> THandlerFunction; //!< Handler function pointer
+ typedef funcptr::tuple<std::string, std::string, THandlerFunction, std::string> TRoute; //!< Route tuple (method, urlmask, handler, name)
+ typedef std::vector<TRoute> TRouteList; //!< List of routes in order of evaluation
+
+ /*! Implements simple router.
+
+This class implements a router for masked urls. The URL mask syntax is as of follows
+
+/&lt;masked&gt;/url&lt;number&gt;/&lt;hi&gt;.&lt;format&gt;
+
+You can use &lt;*param&gt; to denote that everything will be matched and consumed into the parameter, including slash (/). Use &lt;*&gt; to denote that URL
+is consumed but not stored. Note that only path is matched, scheme, host and url parameters are ignored.
+ */
+ class Router {
+ private:
+ Router() {};
+ static Router router; //<! Singleton instance of Router
+ public:
+ void map(const std::string& method, const std::string& url, THandlerFunction handler, const std::string& name); //<! Instance method for mapping urls
+ bool route(Request *req, THandlerFunction& handler); //<! Instance method for performing routing
+ void printRoutes(std::ostream &os); //<! Instance method for printing routes
+ std::pair<std::string, std::string> urlFor(const std::string &name, const strstr_map_t& arguments); //<! Instance method for generating paths
+
+/*! Map an URL.
+If method is left empty, it will match any method. Name is also optional, but needed if you want to find it for making URLs
+*/
+ static void Map(const std::string& method, const std::string& url, THandlerFunction handler, const std::string& name = "") { router.map(method, url, handler, name); };
+ static void Get(const std::string& url, THandlerFunction handler, const std::string& name = "") { router.map("GET", url, handler, name); }; //<! Helper for mapping GET
+ static void Post(const std::string& url, THandlerFunction handler, const std::string& name = "") { router.map("POST", url, handler, name); }; //<! Helper for mapping POST
+ static void Put(const std::string& url, THandlerFunction handler, const std::string& name = "") { router.map("PUT", url, handler, name); }; //<! Helper for mapping PUT
+ static void Patch(const std::string& url, THandlerFunction handler, const std::string& name = "") { router.map("PATCH", url, handler, name); }; //<! Helper for mapping PATCH
+ static void Delete(const std::string& url, THandlerFunction handler, const std::string& name = "") { router.map("DELETE", url, handler, name); }; //<! Helper for mapping DELETE
+ static void Any(const std::string& url, THandlerFunction handler, const std::string& name = "") { router.map("", url, handler, name); }; //<! Helper for mapping any method
+
+ static bool Route(Request *req, THandlerFunction& handler) { return router.route(req, handler); }; //<! Performs routing based on req->url.path
+ static void PrintRoutes(std::ostream &os) { router.printRoutes(os); }; //<! Prints all known routes to given output stream
+
+ static std::pair<std::string, std::string> URLFor(const std::string &name, const strstr_map_t& arguments) { return router.urlFor(name,arguments); }; //<! Generates url from named route and arguments. Missing arguments are assumed empty
+ static const TRouteList& GetRoutes() { return router.routes; } //<! Reference to route list
+ static void Clear() { router.routes.clear(); } //<! Clear all routes
+
+ TRouteList routes; //<! Instance variable for routes
+ };
+};
+#endif
diff --git a/ext/yahttp/yahttp/url.hpp b/ext/yahttp/yahttp/url.hpp
new file mode 100644
index 0000000..fbdd48d
--- /dev/null
+++ b/ext/yahttp/yahttp/url.hpp
@@ -0,0 +1,200 @@
+#pragma once
+#include <sstream>
+#include <string>
+
+#include "utility.hpp"
+
+#ifndef YAHTTP_MAX_URL_LENGTH
+#define YAHTTP_MAX_URL_LENGTH 2048
+#endif
+
+namespace YaHTTP {
+ /*! URL parser and container */
+ class URL {
+ private:
+ bool parseSchema(const std::string& url, size_t &pos) {
+ size_t pos1;
+ if (pos >= url.size()) return false; // no data
+ if ( (pos1 = url.find_first_of(":",pos)) == std::string::npos ) return false; // schema is mandatory
+ protocol = url.substr(pos, pos1-pos);
+ if (protocol == "http") port = 80;
+ if (protocol == "https") port = 443;
+ pos = pos1+1; // after :
+ if (url.compare(pos, 2, "//") == 0) {
+ pathless = false; // if this is true we put rest into parameters
+ pos += 2;
+ }
+ return true;
+ }; //<! parse schema/protocol part
+
+ bool parseHost(const std::string& url, size_t &pos) {
+ size_t pos1;
+ if (pos >= url.size()) return true; // no data
+ if ( (pos1 = url.find_first_of("/", pos)) == std::string::npos ) {
+ host = url.substr(pos);
+ path = "/";
+ pos = url.size();
+ } else {
+ host = url.substr(pos, pos1-pos);
+ pos = pos1;
+ }
+ if (host.at(0) == '[') { // IPv6
+ if ((pos1 = host.find_first_of("]")) == std::string::npos) {
+ // incomplete address
+ return false;
+ }
+ size_t pos2;
+ if ((pos2 = host.find_first_of(":", pos1)) != std::string::npos) {
+ std::istringstream tmp(host.substr(pos2 + 1));
+ tmp >> port;
+ }
+ host = host.substr(1, pos1 - 1);
+ } else if ( (pos1 = host.find_first_of(":")) != std::string::npos ) {
+ std::istringstream tmp(host.substr(pos1+1));
+ tmp >> port;
+ host = host.substr(0, pos1);
+ }
+ return true;
+ }; //<! parse host and port
+
+ bool parseUserPass(const std::string& url, size_t &pos) {
+ size_t pos1,pos2;
+ if (pos >= url.size()) return true; // no data
+
+ if ( (pos1 = url.find_first_of("@",pos)) == std::string::npos ) return true; // no userinfo
+ pos2 = url.find_first_of(":",pos);
+
+ if (pos2 != std::string::npos) { // comes with password
+ username = url.substr(pos, pos2 - pos);
+ password = url.substr(pos2+1, pos1 - pos2 - 1);
+ password = Utility::decodeURL(password);
+ } else {
+ username = url.substr(pos, pos1 - pos);
+ }
+ pos = pos1+1;
+ username = Utility::decodeURL(username);
+ return true;
+ }; //<! parse possible username and password
+
+ bool parsePath(const std::string& url, size_t &pos) {
+ size_t pos1;
+ if (pos >= url.size()) return true; // no data
+ if (url[pos] != '/') return false; // not an url
+ if ( (pos1 = url.find_first_of("?", pos)) == std::string::npos ) {
+ path = url.substr(pos);
+ pos = url.size();
+ } else {
+ path = url.substr(pos, pos1-pos);
+ pos = pos1;
+ }
+ return true;
+ }; //<! parse path component
+
+ bool parseParameters(const std::string& url, size_t &pos) {
+ size_t pos1;
+ if (pos >= url.size()) return true; // no data
+ if (url[pos] == '#') return true; // anchor starts here
+ if (url[pos] != '?') return false; // not a parameter
+ if ( (pos1 = url.find_first_of("#", pos)) == std::string::npos ) {
+ parameters = url.substr(pos+1);;
+ pos = url.size();
+ } else {
+ parameters = url.substr(pos+1, pos1-pos-1);
+ pos = pos1;
+ }
+ if (parameters.size()>0 && *(parameters.end()-1) == '&') parameters.resize(parameters.size()-1);
+ return true;
+ }; //<! parse url parameters
+
+ bool parseAnchor(const std::string& url, size_t &pos) {
+ if (pos >= url.size()) return true; // no data
+ if (url[pos] != '#') return false; // not anchor
+ anchor = url.substr(pos+1);
+ return true;
+ }; //<! parse anchor
+
+ void initialize() {
+ protocol = ""; host = ""; port = 0; username = ""; password = ""; path = ""; parameters = ""; anchor =""; pathless = true;
+ }; //<! initialize to empty URL
+
+ public:
+ std::string to_string() const {
+ std::string tmp;
+ std::ostringstream oss;
+
+ if (protocol.empty() == false) {
+ oss << protocol << ":";
+ if (host.empty() == false) {
+ oss << "//";
+ }
+ }
+
+ if (username.empty() == false) {
+ if (password.empty() == false)
+ oss << Utility::encodeURL(username) << ":" << Utility::encodeURL(password) << "@";
+ else
+ oss << Utility::encodeURL(username) << "@";
+ }
+ if (host.empty() == false)
+ oss << host;
+ if (!(protocol == "http" && port == 80) &&
+ !(protocol == "https" && port == 443) &&
+ port > 0)
+ oss << ":" << port;
+
+ oss << path;
+ if (parameters.empty() == false) {
+ if (!pathless)
+ oss << "?";
+ oss << parameters;
+ }
+ if (anchor.empty() == false)
+ oss << "#" << anchor;
+ return oss.str();
+ }; //<! convert this URL to string
+
+ std::string protocol; //<! schema/protocol
+ std::string host; //<! host
+ int port; //<! port
+ std::string username; //<! username
+ std::string password; //<! password
+ std::string path; //<! path
+ std::string parameters; //<! url parameters
+ std::string anchor; //<! anchor
+ bool pathless; //<! whether this url has no path
+
+ URL() { initialize(); }; //<! construct empty url
+ URL(const std::string& url) {
+ parse(url);
+ }; //<! calls parse with url
+
+ URL(const char *url) {
+ parse(std::string(url));
+ }; //<! calls parse with url
+
+ bool parse(const std::string& url) {
+ // setup
+ initialize();
+
+ if (url.size() > YAHTTP_MAX_URL_LENGTH) return false;
+ size_t pos = 0;
+ if (*(url.begin()) != '/') { // full url?
+ if (parseSchema(url, pos) == false) return false;
+ if (pathless) {
+ parameters = url.substr(pos);
+ return true;
+ }
+ if (parseUserPass(url, pos) == false) return false;
+ if (parseHost(url, pos) == false) return false;
+ }
+ if (parsePath(url, pos) == false) return false;
+ if (parseParameters(url, pos) == false) return false;
+ return parseAnchor(url, pos);
+ }; //<! parse various formats of urls ranging from http://example.com/foo?bar=baz into data:base64:d089swt64wt...
+
+ friend std::ostream & operator<<(std::ostream& os, const URL& url) {
+ os<<url.to_string();
+ return os;
+ };
+ };
+};
diff --git a/ext/yahttp/yahttp/utility.hpp b/ext/yahttp/yahttp/utility.hpp
new file mode 100644
index 0000000..23e6b8a
--- /dev/null
+++ b/ext/yahttp/yahttp/utility.hpp
@@ -0,0 +1,462 @@
+#pragma once
+namespace YaHTTP {
+ static const char *MONTHS[] = {0,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",0}; //<! List of months
+ static const char *DAYS[] = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat",0}; //<! List of days
+
+ bool isspace(char c);
+ bool isspace(char c, const std::locale& loc);
+ bool isxdigit(char c);
+ bool isxdigit(char c, const std::locale& loc);
+ bool isdigit(char c);
+ bool isdigit(char c, const std::locale& loc);
+ bool isalnum(char c);
+ bool isalnum(char c, const std::locale& loc);
+
+ /*! Case-Insensitive NULL safe comparator for string maps */
+ struct ASCIICINullSafeComparator {
+ bool operator() (const std::string& lhs, const std::string& rhs) const {
+ int v;
+ std::string::const_iterator lhi = lhs.begin();
+ std::string::const_iterator rhi = rhs.begin();
+ for(;lhi != lhs.end() && rhi != rhs.end(); lhi++, rhi++)
+ if ((v = ::tolower(*lhi) - ::tolower(*rhi)) != 0) return v<0;
+ if (lhi == lhs.end() && rhi != rhs.end()) return true;
+ if (lhi != lhs.end() && rhi == rhs.end()) return false;
+ return false; // they are equal
+ }
+ };
+
+ typedef std::map<std::string,std::string,ASCIICINullSafeComparator> strstr_map_t; //<! String to String map
+
+ /*! Represents a date/time with utc offset */
+ class DateTime {
+ public:
+ bool isSet; //<! if this is initialized yet
+
+ int year; //<! year, 0 is year 0, not 1900
+
+ int month; //<! month, range 1-12
+ int day; //<! day, range 1-31
+ int wday; //<! week day, range 1-7
+
+ int hours; //<! hours, range 0-23
+ int minutes; //<! minutes, range 0-59
+ int seconds; //<! seconds, range 0-60
+
+ int utc_offset; //<! UTC offset with minutes (hhmm)
+
+ DateTime() {
+ initialize();
+ }; //<! Construct and initialize
+
+ void initialize() {
+ isSet = false;
+ year = month = day = wday = hours = minutes = seconds = utc_offset = 0;
+ month = 1; // it's invalid otherwise
+ }; //<! Creates year 0 date
+
+ void setLocal() {
+ fromLocaltime(time((time_t*)NULL));
+ }; //<! sets current local time
+
+ void setGm() {
+ fromGmtime(time((time_t*)NULL));
+ }; //<! sets current gmtime (almost UTC)
+
+ void fromLocaltime(time_t t) {
+#ifdef HAVE_LOCALTIME_R
+ struct tm tm;
+ localtime_r(&t, &tm);
+ fromTm(&tm);
+#else
+ struct tm *tm;
+ #error define HAVE_LOCALTIME_R
+ tm = localtime(&t); // lgtm [cpp/potentially-dangerous-function]
+ fromTm(tm);
+#endif
+#ifndef HAVE_TM_GMTOFF
+ time_t t2;
+# ifdef HAVE_LOCALTIME_R
+ gmtime_r(&t, &tm);
+ t2 = mktime(&tm);
+# else
+ #error define HAVE_LOCALTIME_R
+ tm = gmtime(&t); // lgtm [cpp/potentially-dangerous-function]
+ t2 = mktime(tm);
+# endif
+ this->utc_offset = ((t2-t)/10)*10; // removes any possible differences.
+#endif
+ }; //<! uses localtime for time
+
+ void fromGmtime(time_t t) {
+#ifdef HAVE_GMTIME_R
+ struct tm tm;
+ gmtime_r(&t, &tm);
+ fromTm(&tm);
+#else
+ struct tm *tm;
+ #error define HAVE_GMTIME_R
+ tm = gmtime(&t);// lgtm [cpp/potentially-dangerous-function]
+ fromTm(tm);
+#endif
+#ifndef HAVE_TM_GMTOFF
+ this->utc_offset = 0;
+#endif
+ }; //<! uses gmtime for time
+
+ void fromTm(const struct tm *tm) {
+ year = tm->tm_year + 1900;
+ month = tm->tm_mon + 1;
+ day = tm->tm_mday;
+ hours = tm->tm_hour;
+ minutes = tm->tm_min;
+ seconds = tm->tm_sec;
+ wday = tm->tm_wday;
+#ifdef HAVE_TM_GMTOFF
+ utc_offset = tm->tm_gmtoff;
+#endif
+ isSet = true;
+ }; //<! parses date from struct tm
+
+ void validate() const {
+ if (wday < 0 || wday > 6) throw std::range_error("Invalid date");
+ if (month < 1 || month > 12) throw std::range_error("Invalid date");
+ if (year < 0) throw std::range_error("Invalid date");
+ if (hours < 0 || hours > 23 ||
+ minutes < 0 || minutes > 59 ||
+ seconds < 0 || seconds > 60) throw std::range_error("Invalid date");
+ }; //<! make sure we are within ranges (not a *REAL* validation, just range check)
+
+ std::string rfc_str() const {
+ std::ostringstream oss;
+ validate();
+ oss << DAYS[wday] << ", " << std::setfill('0') << std::setw(2) << day << " " << MONTHS[month] << " " <<
+ std::setfill('0') << std::setw(2) << year << " " <<
+ std::setfill('0') << std::setw(2) << hours << ":" <<
+ std::setfill('0') << std::setw(2) << minutes << ":" <<
+ std::setfill('0') << std::setw(2) << seconds << " ";
+ if (utc_offset>=0) oss << "+";
+ else oss << "-";
+ int tmp_off = ( utc_offset < 0 ? utc_offset*-1 : utc_offset );
+ oss << std::setfill('0') << std::setw(2) << (tmp_off/3600);
+ oss << std::setfill('0') << std::setw(2) << (tmp_off%3600)/60;
+
+ return oss.str();
+ }; //<! converts this date into a RFC-822 format
+
+ std::string cookie_str() const {
+ std::ostringstream oss;
+ validate();
+ oss << std::setfill('0') << std::setw(2) << day << "-" << MONTHS[month] << "-" << year << " " <<
+ std::setfill('0') << std::setw(2) << hours << ":" <<
+ std::setfill('0') << std::setw(2) << minutes << ":" <<
+ std::setfill('0') << std::setw(2) << seconds << " GMT";
+ return oss.str();
+ }; //<! converts this date into a HTTP Cookie date
+
+ void parse822(const std::string &rfc822_date) {
+ struct tm tm;
+ const char *ptr;
+#ifdef HAVE_TM_GMTOFF
+ if ( (ptr = strptime(rfc822_date.c_str(), "%a, %d %b %Y %T %z", &tm)) != NULL) {
+#else
+ if ( (ptr = strptime(rfc822_date.c_str(), "%a, %d %b %Y %T", &tm)) != NULL) {
+ int sign;
+ // parse the timezone parameter
+ while(*ptr && YaHTTP::isspace(*ptr)) ptr++;
+ if (*ptr == '+') sign = 0;
+ else if (*ptr == '-') sign = -1;
+ else throw YaHTTP::ParseError("Unparseable date");
+ ptr++;
+ utc_offset = ::atoi(ptr) * sign;
+ while(*ptr != '\0' && YaHTTP::isdigit(*ptr)) ptr++;
+#endif
+ while(*ptr != '\0' && YaHTTP::isspace(*ptr)) ptr++;
+ if (*ptr != '\0') throw YaHTTP::ParseError("Unparseable date"); // must be final.
+ fromTm(&tm);
+ } else {
+ throw YaHTTP::ParseError("Unparseable date");
+ }
+ }; //<! parses RFC-822 date
+
+ void parseCookie(const std::string &cookie_date) {
+ struct tm tm;
+ const char *ptr;
+ if ( (ptr = strptime(cookie_date.c_str(), "%d-%b-%Y %T", &tm)) != NULL
+#ifdef HAVE_TM_GMTOFF
+ || (ptr = strptime(cookie_date.c_str(), "%d-%b-%Y %T %z", &tm)) != NULL
+ || (ptr = strptime(cookie_date.c_str(), "%a, %d-%b-%Y %T %Z", &tm)) != NULL
+#endif
+ ) {
+ while(*ptr != '\0' && ( YaHTTP::isspace(*ptr) || YaHTTP::isalnum(*ptr) )) ptr++;
+ if (*ptr != '\0') throw YaHTTP::ParseError("Unparseable date (non-final)"); // must be final.
+ fromTm(&tm);
+ this->utc_offset = 0;
+ } else {
+ std::cout << cookie_date << std::endl;
+ throw YaHTTP::ParseError("Unparseable date (did not match pattern cookie)");
+ }
+ }; //<! parses HTTP Cookie date
+
+ time_t unixtime() const {
+ struct tm tm;
+ tm.tm_year = year-1900;
+ tm.tm_mon = month-1;
+ tm.tm_mday = day;
+ tm.tm_hour = hours;
+ tm.tm_min = minutes;
+ tm.tm_sec = seconds;
+ tm.tm_isdst = 0;
+#ifdef HAVE_TM_GMTOFF
+ tm.tm_gmtoff = utc_offset;
+#endif
+ return mktime(&tm);
+ }; //<! returns this datetime as unixtime. will not work for dates before 1970/1/1 00:00:00 GMT
+ };
+
+ /*! Various helpers needed in the code */
+ class Utility {
+ public:
+ static std::string decodeURL(const std::string& component) {
+ std::string result = component;
+ size_t pos1,pos2;
+ pos2 = 0;
+ while((pos1 = result.find_first_of("%", pos2))!=std::string::npos) {
+ std::string code;
+ char a,b,c;
+ if (pos1 + 2 > result.length()) return result; // end of result
+ code = result.substr(pos1+1, 2);
+ a = std::tolower(code[0]); b = std::tolower(code[1]);
+
+ if ((( '0' > a || a > '9') && ('a' > a || a > 'f')) ||
+ (( '0' > b || b > '9') && ('a' > b || b > 'f'))) {
+ pos2 = pos1+3;
+ continue;
+ }
+
+ if ('0' <= a && a <= '9') a = a - '0';
+ else if ('a' <= a && a <= 'f') a = a - 'a' + 0x0a;
+ if ('0' <= b && b <= '9') b = b - '0';
+ else if ('a' <= b && b <= 'f') b = b - 'a' + 0x0a;
+
+ c = (a<<4)+b;
+ result = result.replace(pos1,3,1,c);
+ pos2=pos1;
+ }
+ return result;
+ }; //<! Decodes %xx from string into bytes
+
+ static std::string encodeURL(const std::string& component, bool asUrl = true) {
+ std::string result = component;
+ std::string skip = "+-.:,&;_#%[]?/@(){}=";
+ char repl[3];
+ size_t pos;
+ for(std::string::iterator iter = result.begin(); iter != result.end(); iter++) {
+ if (!YaHTTP::isalnum(*iter) && (!asUrl || skip.find(*iter) == std::string::npos)) {
+ // replace with different thing
+ pos = std::distance(result.begin(), iter);
+ ::snprintf(repl,3,"%02x", static_cast<unsigned char>(*iter));
+ result = result.replace(pos, 1, "%", 1).insert(pos+1, repl, 2);
+ iter = result.begin() + pos + 2;
+ }
+ }
+ return result;
+ }; //<! Escapes any characters into %xx representation when necessary, set asUrl to false to fully encode the url
+
+ static std::string encodeURL(const std::wstring& component, bool asUrl = true) {
+ unsigned char const *p = reinterpret_cast<unsigned char const*>(&component[0]);
+ std::size_t s = component.size() * sizeof((*component.begin()));
+ std::vector<unsigned char> vec(p, p+s);
+
+ std::ostringstream result;
+ std::string skip = "+-.,&;_#%[]?/@(){}=";
+ for(std::vector<unsigned char>::iterator iter = vec.begin(); iter != vec.end(); iter++) {
+ if (!YaHTTP::isalnum((char)*iter) && (!asUrl || skip.find((char)*iter) == std::string::npos)) {
+ // bit more complex replace
+ result << "%" << std::hex << std::setw(2) << std::setfill('0') << static_cast<unsigned int>(*iter);
+ } else result << (char)*iter;
+ }
+ return result.str();
+ }; //<! Escapes any characters into %xx representation when necessary, set asUrl to false to fully encode the url, for wide strings, returns ordinary string
+
+ static std::string status2text(int status) {
+ switch(status) {
+ case 200:
+ return "OK";
+ case 201:
+ return "Created";
+ case 202:
+ return "Accepted";
+ case 203:
+ return "Non-Authoritative Information";
+ case 204:
+ return "No Content";
+ case 205:
+ return "Reset Content";
+ case 206:
+ return "Partial Content";
+ case 300:
+ return "Multiple Choices";
+ case 301:
+ return "Moved Permanently";
+ case 302:
+ return "Found";
+ case 303:
+ return "See Other";
+ case 304:
+ return "Not Modified";
+ case 305:
+ return "Use Proxy";
+ case 307:
+ return "Temporary Redirect";
+ case 400:
+ return "Bad Request";
+ case 401:
+ return "Unauthorized";
+ case 402:
+ return "Payment Required";
+ case 403:
+ return "Forbidden";
+ case 404:
+ return "Not Found";
+ case 405:
+ return "Method Not Allowed";
+ case 406:
+ return "Not Acceptable";
+ case 407:
+ return "Proxy Authentication Required";
+ case 408:
+ return "Request Time-out";
+ case 409:
+ return "Conflict";
+ case 410:
+ return "Gone";
+ case 411:
+ return "Length Required";
+ case 412:
+ return "Precondition Failed";
+ case 413:
+ return "Request Entity Too Large";
+ case 414:
+ return "Request-URI Too Large";
+ case 415:
+ return "Unsupported Media Type";
+ case 416:
+ return "Requested range not satisfiable";
+ case 417:
+ return "Expectation Failed";
+ case 422:
+ return "Unprocessable Entity";
+ case 500:
+ return "Internal Server Error";
+ case 501:
+ return "Not Implemented";
+ case 502:
+ return "Bad Gateway";
+ case 503:
+ return "Service Unavailable";
+ case 504:
+ return "Gateway Time-out";
+ case 505:
+ return "HTTP Version not supported";
+ default:
+ return "Unknown Status";
+ }
+ }; //<! static HTTP codes to text mappings
+
+ static strstr_map_t parseUrlParameters(std::string parameters) {
+ std::string::size_type pos = 0;
+ strstr_map_t parameter_map;
+ while (pos != std::string::npos) {
+ // find next parameter start
+ std::string::size_type nextpos = parameters.find("&", pos);
+ std::string::size_type delim = parameters.find("=", pos);
+ if (delim > nextpos) {
+ delim = nextpos;
+ }
+ std::string key;
+ std::string value;
+ if (delim == std::string::npos) {
+ key = parameters.substr(pos);
+ } else {
+ key = parameters.substr(pos, delim-pos);
+ if (nextpos == std::string::npos) {
+ value = parameters.substr(delim+1);
+ } else {
+ value = parameters.substr(delim+1, nextpos-delim-1);
+ }
+ }
+ if (key.empty()) {
+ // no parameters at all
+ break;
+ }
+ key = decodeURL(key);
+ value = decodeURL(value);
+ parameter_map[key] = value;
+ if (nextpos == std::string::npos) {
+ // no more parameters left
+ break;
+ }
+
+ pos = nextpos+1;
+ }
+ return parameter_map;
+ }; //<! parses URL parameters into string map
+
+ static bool iequals(const std::string& a, const std::string& b, size_t length) {
+ std::string::const_iterator ai, bi;
+ size_t i;
+ for(ai = a.begin(), bi = b.begin(), i = 0; ai != a.end() && bi != b.end() && i < length; ai++,bi++,i++) {
+ if (::toupper(*ai) != ::toupper(*bi)) return false;
+ }
+
+ if (ai == a.end() && bi == b.end()) return true;
+ if ((ai == a.end() && bi != b.end()) ||
+ (ai != a.end() && bi == b.end())) return false;
+
+ return ::toupper(*ai) == ::toupper(*bi);
+ }; //<! case-insensitive comparison with length
+
+ static bool iequals(const std::string& a, const std::string& b) {
+ if (a.size() != b.size()) return false;
+ return iequals(a,b,a.size());
+ }; //<! case-insensitive comparison
+
+ static void trimLeft(std::string &str) {
+ const std::locale &loc = std::locale::classic();
+ std::string::iterator iter = str.begin();
+ while(iter != str.end() && YaHTTP::isspace(*iter, loc)) iter++;
+ str.erase(str.begin(), iter);
+ }; //<! removes whitespace from left
+
+ static void trimRight(std::string &str) {
+ const std::locale &loc = std::locale::classic();
+ std::string::reverse_iterator iter = str.rbegin();
+ while(iter != str.rend() && YaHTTP::isspace(*iter, loc)) iter++;
+ str.erase(iter.base(), str.end());
+ }; //<! removes whitespace from right
+
+ static void trim(std::string &str) {
+ trimLeft(str);
+ trimRight(str);
+ }; //<! removes whitespace from left and right
+
+ static std::string camelizeHeader(const std::string &str) {
+ std::string::const_iterator iter = str.begin();
+ std::string result;
+ const std::locale &loc = std::locale::classic();
+
+ bool doNext = true;
+
+ while(iter != str.end()) {
+ if (doNext)
+ result.insert(result.end(), std::toupper(*iter, loc));
+ else
+ result.insert(result.end(), std::tolower(*iter, loc));
+ doNext = (*(iter++) == '-');
+ }
+
+ return result;
+ }; //<! camelizes headers, such as, content-type => Content-Type
+ };
+};
diff --git a/ext/yahttp/yahttp/yahttp-config.h b/ext/yahttp/yahttp/yahttp-config.h
new file mode 100644
index 0000000..1ac2545
--- /dev/null
+++ b/ext/yahttp/yahttp/yahttp-config.h
@@ -0,0 +1 @@
+#include "config.h"
diff --git a/ext/yahttp/yahttp/yahttp.hpp b/ext/yahttp/yahttp/yahttp.hpp
new file mode 100644
index 0000000..d60be7a
--- /dev/null
+++ b/ext/yahttp/yahttp/yahttp.hpp
@@ -0,0 +1,37 @@
+#include <map>
+#include <iostream>
+#include <locale>
+#include <algorithm>
+#include <string>
+#include <cstdio>
+#include <stdexcept>
+#include <sys/time.h>
+#include <iomanip>
+#include <list>
+#include <vector>
+
+#include "yahttp-config.h"
+#include "exception.hpp"
+#include "url.hpp"
+#include "utility.hpp"
+#include "url.hpp"
+#include "cookie.hpp"
+#include "reqresp.hpp"
+
+/*! \mainpage Yet Another HTTP Library Documentation
+\section sec_quick_start Quick start example
+
+@code
+#include <yahttp/yahttp.hpp>
+
+int main(void) {
+ std::ifstream ifs("request.txt");
+ YaHTTP::Request req;
+ ifs >> req;
+
+ std::cout << req.method " " << req.url.path << std::endl;
+ return 0;
+}
+@endcode
+\author Aki Tuomi
+*/
diff --git a/fstrm_logger.cc b/fstrm_logger.cc
new file mode 100644
index 0000000..6e608cb
--- /dev/null
+++ b/fstrm_logger.cc
@@ -0,0 +1,202 @@
+#include <unistd.h>
+#include <sys/un.h>
+
+#include "config.h"
+#include "fstrm_logger.hh"
+
+#ifdef RECURSOR
+#include "logger.hh"
+#else
+#include "dolog.hh"
+#endif
+
+#define DNSTAP_CONTENT_TYPE "protobuf:dnstap.Dnstap"
+
+#ifdef HAVE_FSTRM
+
+FrameStreamLogger::FrameStreamLogger(const int family, const std::string& address, bool connect,
+ const std::unordered_map<string,unsigned>& options): d_family(family), d_address(address)
+{
+ fstrm_res res;
+
+ try {
+ d_fwopt = fstrm_writer_options_init();
+ if (!d_fwopt) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_writer_options_init failed.");
+ }
+
+ res = fstrm_writer_options_add_content_type(d_fwopt, DNSTAP_CONTENT_TYPE, sizeof(DNSTAP_CONTENT_TYPE) - 1);
+ if (res != fstrm_res_success) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_writer_options_add_content_type failed: " + std::to_string(res));
+ }
+
+ if (d_family == AF_UNIX) {
+ struct sockaddr_un local;
+ if (makeUNsockaddr(d_address, &local)) {
+ throw std::runtime_error("FrameStreamLogger: Unable to use '" + d_address + "', it is not a valid UNIX socket path.");
+ }
+
+ d_uwopt = fstrm_unix_writer_options_init();
+ if (!d_uwopt) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_unix_writer_options_init failed.");
+ }
+
+ // void return, no error checking.
+ fstrm_unix_writer_options_set_socket_path(d_uwopt, d_address.c_str());
+
+ d_writer = fstrm_unix_writer_init(d_uwopt, d_fwopt);
+ if (!d_writer) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_unix_writer_init() failed.");
+ }
+ #ifdef HAVE_FSTRM_TCP_WRITER_INIT
+ } else if (family == AF_INET) {
+ d_twopt = fstrm_tcp_writer_options_init();
+ if (!d_twopt) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_tcp_writer_options_init failed.");
+ }
+
+ try {
+ ComboAddress ca(d_address);
+
+ // void return, no error checking.
+ fstrm_tcp_writer_options_set_socket_address(d_twopt, ca.toString().c_str());
+ fstrm_tcp_writer_options_set_socket_port(d_twopt, std::to_string(ca.getPort()).c_str());
+ } catch (PDNSException &e) {
+ throw std::runtime_error("FrameStreamLogger: Unable to use '" + d_address + "': " + e.reason);
+ }
+
+ d_writer = fstrm_tcp_writer_init(d_twopt, d_fwopt);
+ if (!d_writer) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_tcp_writer_init() failed.");
+ }
+ #endif
+ } else {
+ throw std::runtime_error("FrameStreamLogger: family " + std::to_string(family) + " not supported");
+ }
+
+ d_iothropt = fstrm_iothr_options_init();
+ if (!d_iothropt) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_iothr_options_init() failed.");
+ }
+
+ res = fstrm_iothr_options_set_queue_model(d_iothropt, FSTRM_IOTHR_QUEUE_MODEL_MPSC);
+ if (res != fstrm_res_success) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_iothr_options_set_queue_model failed: " + std::to_string(res));
+ }
+
+ const struct {
+ const std::string name;
+ fstrm_res (*function)(struct fstrm_iothr_options *, const unsigned int);
+ } list[] = {
+ { "bufferHint", fstrm_iothr_options_set_buffer_hint },
+ { "flushTimeout", fstrm_iothr_options_set_flush_timeout },
+ { "inputQueueSize", fstrm_iothr_options_set_input_queue_size },
+ { "outputQueueSize", fstrm_iothr_options_set_output_queue_size },
+ { "queueNotifyThreshold", fstrm_iothr_options_set_queue_notify_threshold },
+ { "setReopenInterval", fstrm_iothr_options_set_reopen_interval }
+ };
+
+ for (const auto& i : list) {
+ if (options.find(i.name) != options.end() && options.at(i.name)) {
+ fstrm_res r = i.function(d_iothropt, options.at(i.name));
+ if (r != fstrm_res_success) {
+ throw std::runtime_error("FrameStreamLogger: setting " + string(i.name) + " failed: " + std::to_string(r));
+ }
+ }
+ }
+
+ if (connect) {
+ d_iothr = fstrm_iothr_init(d_iothropt, &d_writer);
+ if (!d_iothr) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_iothr_init() failed.");
+ }
+
+ d_ioqueue = fstrm_iothr_get_input_queue(d_iothr);
+ if (!d_ioqueue) {
+ throw std::runtime_error("FrameStreamLogger: fstrm_iothr_get_input_queue() failed.");
+ }
+ }
+ } catch (std::runtime_error &e) {
+ this->cleanup();
+ throw;
+ }
+}
+
+void FrameStreamLogger::cleanup()
+{
+ if (d_iothr != nullptr) {
+ fstrm_iothr_destroy(&d_iothr);
+ d_iothr = nullptr;
+ }
+ if (d_iothropt != nullptr) {
+ fstrm_iothr_options_destroy(&d_iothropt);
+ d_iothropt = nullptr;
+ }
+ if (d_writer != nullptr) {
+ fstrm_writer_destroy(&d_writer);
+ d_writer = nullptr;
+ }
+ if (d_uwopt != nullptr) {
+ fstrm_unix_writer_options_destroy(&d_uwopt);
+ d_uwopt = nullptr;
+ }
+#ifdef HAVE_FSTRM_TCP_WRITER_INIT
+ if (d_twopt != nullptr) {
+ fstrm_tcp_writer_options_destroy(&d_twopt);
+ d_twopt = nullptr;
+ }
+#endif
+ if (d_fwopt != nullptr) {
+ fstrm_writer_options_destroy(&d_fwopt);
+ d_fwopt = nullptr;
+ }
+}
+
+FrameStreamLogger::~FrameStreamLogger()
+{
+ this->cleanup();
+}
+
+void FrameStreamLogger::queueData(const std::string& data)
+{
+ if (!d_ioqueue || !d_iothr) {
+ return;
+ }
+ uint8_t *frame = (uint8_t*)malloc(data.length());
+ if (!frame) {
+#ifdef RECURSOR
+ g_log<<Logger::Warning<<"FrameStreamLogger: cannot allocate memory for stream."<<std::endl;
+#else
+ warnlog("FrameStreamLogger: cannot allocate memory for stream.");
+#endif
+ return;
+ }
+ memcpy(frame, data.c_str(), data.length());
+
+ fstrm_res res;
+ res = fstrm_iothr_submit(d_iothr, d_ioqueue, frame, data.length(), fstrm_free_wrapper, nullptr);
+
+ if (res == fstrm_res_success) {
+ // Frame successfully queued.
+ ++d_framesSent;
+ } else if (res == fstrm_res_again) {
+ free(frame);
+#ifdef RECURSOR
+ g_log<<Logger::Debug<<"FrameStreamLogger: queue full, dropping."<<std::endl;
+#else
+ vinfolog("FrameStreamLogger: queue full, dropping.");
+#endif
+ ++d_queueFullDrops;
+ } else {
+ // Permanent failure.
+ free(frame);
+#ifdef RECURSOR
+ g_log<<Logger::Warning<<"FrameStreamLogger: submitting to queue failed."<<std::endl;
+#else
+ warnlog("FrameStreamLogger: submitting to queue failed.");
+#endif
+ ++d_permanentFailures;
+ }
+}
+
+#endif /* HAVE_FSTRM */
diff --git a/fstrm_logger.hh b/fstrm_logger.hh
new file mode 100644
index 0000000..a59e194
--- /dev/null
+++ b/fstrm_logger.hh
@@ -0,0 +1,69 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "config.h"
+#include "remote_logger.hh"
+
+#ifdef HAVE_FSTRM
+
+#include <unordered_map>
+#include <fstrm.h>
+#include <fstrm/iothr.h>
+#include <fstrm/unix_writer.h>
+#ifdef HAVE_FSTRM_TCP_WRITER_INIT
+#include <fstrm/tcp_writer.h>
+#endif
+
+class FrameStreamLogger : public RemoteLoggerInterface, boost::noncopyable
+{
+public:
+ FrameStreamLogger(int family, const std::string& address, bool connect, const std::unordered_map<string,unsigned>& options = std::unordered_map<string,unsigned>());
+ ~FrameStreamLogger();
+ void queueData(const std::string& data) override;
+ std::string toString() const override
+ {
+ return "FrameStreamLogger to " + d_address + " (" + std::to_string(d_framesSent) + " frames sent, " + std::to_string(d_queueFullDrops) + " dropped, " + std::to_string(d_permanentFailures) + " permanent failures)";
+ }
+
+private:
+
+ const int d_family;
+ const std::string d_address;
+ struct fstrm_iothr_queue *d_ioqueue{nullptr};
+ struct fstrm_writer_options *d_fwopt{nullptr};
+ struct fstrm_unix_writer_options *d_uwopt{nullptr};
+#ifdef HAVE_FSTRM_TCP_WRITER_INIT
+ struct fstrm_tcp_writer_options *d_twopt{nullptr};
+#endif
+ struct fstrm_writer *d_writer{nullptr};
+ struct fstrm_iothr_options *d_iothropt{nullptr};
+ struct fstrm_iothr *d_iothr{nullptr};
+ std::atomic<uint64_t> d_framesSent{0};
+ std::atomic<uint64_t> d_queueFullDrops{0};
+ std::atomic<uint64_t> d_permanentFailures{0};
+
+ void cleanup();
+};
+
+#else
+class FrameStreamLogger : public RemoteLoggerInterface, boost::noncopyable {};
+#endif /* HAVE_FSTRM */
diff --git a/gettime.cc b/gettime.cc
new file mode 100644
index 0000000..b6d95a4
--- /dev/null
+++ b/gettime.cc
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "gettime.hh"
+#include "config.h"
+
+#ifdef HAVE_CLOCK_GETTIME
+#include <time.h>
+
+#ifndef CLOCK_MONOTONIC_RAW
+#define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC
+#endif
+
+int gettime(struct timespec *tp, bool needRealTime)
+{
+ return clock_gettime(needRealTime ? CLOCK_REALTIME : CLOCK_MONOTONIC, tp);
+}
+
+#else
+#include <sys/time.h>
+
+int gettime(struct timespec *tp, bool needRealTime)
+{
+ struct timeval tv;
+
+ int ret = gettimeofday(&tv, NULL);
+ if(ret < 0) return ret;
+
+ tp->tv_sec = tv.tv_sec;
+ tp->tv_nsec = tv.tv_usec * 1000;
+ return ret;
+}
+
+#endif
diff --git a/gettime.hh b/gettime.hh
new file mode 100644
index 0000000..29c0fca
--- /dev/null
+++ b/gettime.hh
@@ -0,0 +1,24 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+extern int gettime(struct timespec *tp, bool needRealTime=false);
diff --git a/html/detail.css b/html/detail.css
new file mode 100644
index 0000000..b0567a4
--- /dev/null
+++ b/html/detail.css
@@ -0,0 +1,104 @@
+.rickshaw_graph .detail {
+ pointer-events: none;
+ position: absolute;
+ top: 0;
+ z-index: 2;
+ background: rgba(0, 0, 0, 0.1);
+ bottom: 0;
+ width: 1px;
+ transition: opacity 0.25s linear;
+ -moz-transition: opacity 0.25s linear;
+ -o-transition: opacity 0.25s linear;
+ -webkit-transition: opacity 0.25s linear;
+}
+.rickshaw_graph .detail.inactive {
+ opacity: 0;
+}
+.rickshaw_graph .detail .item.active {
+ opacity: 1;
+}
+.rickshaw_graph .detail .x_label {
+ font-family: Arial, sans-serif;
+ border-radius: 3px;
+ padding: 6px;
+ opacity: 0.5;
+ border: 1px solid #e0e0e0;
+ font-size: 12px;
+ position: absolute;
+ background: white;
+ white-space: nowrap;
+ top: -20px; /* add this */
+}
+.rickshaw_graph .detail .x_label.left {
+ left: 0;
+}
+.rickshaw_graph .detail .x_label.right {
+ right: 0;
+}
+.rickshaw_graph .detail .item {
+ position: absolute;
+ z-index: 2;
+ border-radius: 3px;
+ padding: 0.25em;
+ font-size: 12px;
+ font-family: Arial, sans-serif;
+ opacity: 0;
+ background: rgba(0, 0, 0, 0.4);
+ color: white;
+ border: 1px solid rgba(0, 0, 0, 0.4);
+ margin-left: 1em;
+ margin-right: 1em;
+ margin-top: -1em;
+ white-space: nowrap;
+}
+.rickshaw_graph .detail .item.left {
+ left: 0;
+}
+.rickshaw_graph .detail .item.right {
+ right: 0;
+}
+.rickshaw_graph .detail .item.active {
+ opacity: 1;
+ background: rgba(0, 0, 0, 0.8);
+}
+.rickshaw_graph .detail .item:after {
+ position: absolute;
+ display: block;
+ width: 0;
+ height: 0;
+
+ content: "";
+
+ border: 5px solid transparent;
+}
+.rickshaw_graph .detail .item.left:after {
+ top: 1em;
+ left: -5px;
+ margin-top: -5px;
+ border-right-color: rgba(0, 0, 0, 0.8);
+ border-left-width: 0;
+}
+.rickshaw_graph .detail .item.right:after {
+ top: 1em;
+ right: -5px;
+ margin-top: -5px;
+ border-left-color: rgba(0, 0, 0, 0.8);
+ border-right-width: 0;
+}
+.rickshaw_graph .detail .dot {
+ width: 4px;
+ height: 4px;
+ margin-left: -2px;
+ margin-top: -2px;
+ border-radius: 5px;
+ position: absolute;
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.6);
+ background: white;
+ border-width: 2px;
+ border-style: solid;
+ display: none;
+ background-clip: padding-box;
+}
+.rickshaw_graph .detail .dot.active {
+ display: block;
+}
diff --git a/html/graph.css b/html/graph.css
new file mode 100644
index 0000000..1f9c976
--- /dev/null
+++ b/html/graph.css
@@ -0,0 +1,177 @@
+/* graph */
+
+.rickshaw_graph {
+ position: relative;
+}
+.rickshaw_graph svg {
+ display: block;
+ overflow: hidden;
+}
+
+/* ticks */
+
+.rickshaw_graph .x_tick {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 0px;
+ border-left: 1px dotted rgba(0, 0, 0, 0.2);
+ pointer-events: none;
+}
+.rickshaw_graph .x_tick .title {
+ position: absolute;
+ font-size: 12px;
+ font-family: Arial, sans-serif;
+ opacity: 0.5;
+ white-space: nowrap;
+ margin-left: 3px;
+ bottom: 1px;
+}
+
+/* annotations */
+
+.rickshaw_annotation_timeline {
+ height: 1px;
+ border-top: 1px solid #e0e0e0;
+ margin-top: 10px;
+ position: relative;
+}
+.rickshaw_annotation_timeline .annotation {
+ position: absolute;
+ height: 6px;
+ width: 6px;
+ margin-left: -2px;
+ top: -3px;
+ border-radius: 5px;
+ background-color: rgba(0, 0, 0, 0.25);
+}
+.rickshaw_graph .annotation_line {
+ position: absolute;
+ top: 0;
+ bottom: -6px;
+ width: 0px;
+ border-left: 2px solid rgba(0, 0, 0, 0.3);
+ display: none;
+}
+.rickshaw_graph .annotation_line.active {
+ display: block;
+}
+
+.rickshaw_graph .annotation_range {
+ background: rgba(0, 0, 0, 0.1);
+ display: none;
+ position: absolute;
+ top: 0;
+ bottom: -6px;
+}
+.rickshaw_graph .annotation_range.active {
+ display: block;
+}
+.rickshaw_graph .annotation_range.active.offscreen {
+ display: none;
+}
+
+.rickshaw_annotation_timeline .annotation .content {
+ background: white;
+ color: black;
+ opacity: 0.9;
+ padding: 5px 5px;
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
+ border-radius: 3px;
+ position: relative;
+ z-index: 20;
+ font-size: 12px;
+ padding: 6px 8px 8px;
+ top: 18px;
+ left: -11px;
+ width: 160px;
+ display: none;
+ cursor: pointer;
+}
+.rickshaw_annotation_timeline .annotation .content:before {
+ content: "\25b2";
+ position: absolute;
+ top: -11px;
+ color: white;
+ text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.8);
+}
+.rickshaw_annotation_timeline .annotation.active,
+.rickshaw_annotation_timeline .annotation:hover {
+ background-color: rgba(0, 0, 0, 0.8);
+ cursor: none;
+}
+.rickshaw_annotation_timeline .annotation .content:hover {
+ z-index: 50;
+}
+.rickshaw_annotation_timeline .annotation.active .content {
+ display: block;
+}
+.rickshaw_annotation_timeline .annotation:hover .content {
+ display: block;
+ z-index: 50;
+}
+.rickshaw_graph .y_axis,
+.rickshaw_graph .x_axis_d3 {
+ fill: none;
+}
+.rickshaw_graph .y_ticks .tick,
+.rickshaw_graph .x_ticks_d3 .tick {
+ stroke: rgba(0, 0, 0, 0.16);
+ stroke-width: 2px;
+ shape-rendering: crisp-edges;
+ pointer-events: none;
+}
+.rickshaw_graph .y_grid .tick,
+.rickshaw_graph .x_grid_d3 .tick {
+ z-index: -1;
+ stroke: rgba(0, 0, 0, 0.20);
+ stroke-width: 1px;
+ stroke-dasharray: 1 1;
+}
+.rickshaw_graph .y_grid .tick[data-y-value="0"] {
+ stroke-dasharray: 1 0;
+}
+.rickshaw_graph .y_grid path,
+.rickshaw_graph .x_grid_d3 path {
+ fill: none;
+ stroke: none;
+}
+.rickshaw_graph .y_ticks path,
+.rickshaw_graph .x_ticks_d3 path {
+ fill: none;
+ stroke: #808080;
+}
+.rickshaw_graph .y_ticks text,
+.rickshaw_graph .x_ticks_d3 text {
+ opacity: 0.5;
+ font-size: 12px;
+ pointer-events: none;
+}
+.rickshaw_graph .x_tick.glow .title,
+.rickshaw_graph .y_ticks.glow text {
+ fill: black;
+ color: black;
+ text-shadow:
+ -1px 1px 0 rgba(255, 255, 255, 0.1),
+ 1px -1px 0 rgba(255, 255, 255, 0.1),
+ 1px 1px 0 rgba(255, 255, 255, 0.1),
+ 0px 1px 0 rgba(255, 255, 255, 0.1),
+ 0px -1px 0 rgba(255, 255, 255, 0.1),
+ 1px 0px 0 rgba(255, 255, 255, 0.1),
+ -1px 0px 0 rgba(255, 255, 255, 0.1),
+ -1px -1px 0 rgba(255, 255, 255, 0.1);
+}
+.rickshaw_graph .x_tick.inverse .title,
+.rickshaw_graph .y_ticks.inverse text {
+ fill: white;
+ color: white;
+ text-shadow:
+ -1px 1px 0 rgba(0, 0, 0, 0.8),
+ 1px -1px 0 rgba(0, 0, 0, 0.8),
+ 1px 1px 0 rgba(0, 0, 0, 0.8),
+ 0px 1px 0 rgba(0, 0, 0, 0.8),
+ 0px -1px 0 rgba(0, 0, 0, 0.8),
+ 1px 0px 0 rgba(0, 0, 0, 0.8),
+ -1px 0px 0 rgba(0, 0, 0, 0.8),
+ -1px -1px 0 rgba(0, 0, 0, 0.8);
+}
diff --git a/html/index.html b/html/index.html
new file mode 100644
index 0000000..7e25997
--- /dev/null
+++ b/html/index.html
@@ -0,0 +1,106 @@
+<!DOCTYPE html>
+<head>
+ <meta charset="utf-8" />
+ <script src="js/jquery.min.js"></script>
+ <script src="js/d3.min.js"></script>
+ <script src="js/rickshaw.min.js"></script>
+ <script src="js/moment.min.js"></script>
+ <style>
+ #qpschart {
+ position: relative;
+ left: 40px;
+ }
+ #qpsy_axis {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 40px;
+ }
+
+ #cpuchart {
+ position: relative;
+ left: 40px;
+ }
+ #cpuy_axis {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ width: 40px;
+ }
+
+ table.border, table.border>tbody>tr>td {
+ border: 1px solid black;
+ border-collapse: collapse;
+ }
+ </style>
+ <link type="text/css" rel="stylesheet" href="graph.css">
+ <link type="text/css" rel="stylesheet" href="detail.css">
+ <link type="text/css" rel="stylesheet" href="legend.css">
+ <link type="text/css" rel="stylesheet" href="lines.css">
+
+ <script src="local.js"></script>
+ </head>
+ <body>
+
+ <table width="100%" border="0"><tr><td><img src="powerdns-logo-220px.png"/></td>
+ <td style="padding: 0px 90px 0px 20px">
+ <span id="version"></span><br/>
+ dnsdist comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it according to the terms of the GPL version 2.<br/>
+ </td>
+ </tr></table>
+ <p>
+ Uptime: <span id="uptime"></span>, Number of queries: <span id="questions"></span> (<span id="qps"></span> qps), ACL drops: <span id="acl-drops"></span>, Dynamic drops: <span id="dyn-drops"></span>, Rule drops: <span id="rule-drops"></span><br/>
+ Average response time: <span id="latency"></span> ms, CPU Usage: <span id="cpu"></span>%, Cache hitrate: <span id="phitrate"></span>%, Server selection policy: <span id="server-policy"></span><br/>
+ Listening on: <span id="local"></span>, ACL: <span id="acl"></span>
+ </p>
+ <table width="100%" cellpadding="20">
+ <tr valign="top">
+ <td>
+ <table cellpadding="12">
+ <tr><td align="center">QPS / SERVFAILPS</td></tr>
+ <tr><td>
+ <div class="chart_container">
+ <div id="qpsy_axis"></div>
+ <div id="qpschart"></div>
+ </div>
+ </td></tr>
+ <tr><td align="center">CACHE HITRATE / CPU %</td></tr>
+ <tr><td>
+ <div class="chart_container">
+ <div id="cpuy_axis"></div>
+ <div id="cpuchart"></div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+
+ <td>
+ <table cellpadding="15" width="100%" class="border">
+ <tr>
+ <td><div id="downstreams"></div> </td>
+ </tr>
+ <tr>
+ <td><div id="rules"></div></td>
+ </tr>
+ <tr>
+ <td><div id="response-rules"></div></td>
+ </tr>
+ <tr>
+ <td><div id="dynblock"></div></td>
+ </tr>
+ <tr>
+ <td><div id="ebpfblock"></div></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+ </table>
+
+ <div>
+ <br/><br/>
+ <p></p><p></p>
+ </div>
+ </body>
+</html>
diff --git a/html/js/d3.min.js b/html/js/d3.min.js
new file mode 100644
index 0000000..8d8c745
--- /dev/null
+++ b/html/js/d3.min.js
@@ -0,0 +1,5 @@
+!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function a(n){return n.length}function o(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function s(n){return(n+="")===xa||n[0]===ba?ba+n:n}function f(n){return(n+="")[0]===ba?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=_a.length;r>e;++e){var u=_a[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new c;return t.on=function(t,u){var i,a=r.get(t);return arguments.length<2?a&&a.on:(a&&(a.on=null,e=e.slice(0,i=e.indexOf(a)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function S(){oa.event.preventDefault()}function k(){for(var n,t=oa.event;n=t.sourceEvent;)t=n;return t}function N(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=oa.event;u.target=n,oa.event=u,t[u.type].apply(e,r)}finally{oa.event=i}}},t}function E(n){return Sa(n,Aa),n}function A(n){return"function"==typeof n?n:function(){return ka(n,this)}}function C(n){return"function"==typeof n?n:function(){return Na(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=oa.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?o:a:n.local?i:u}function L(n){return n.trim().replace(/\s+/g," ")}function q(n){return new RegExp("(?:^|\\s+)"+oa.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=T(n).map(D);var u=n.length;return"function"==typeof t?r:e}function D(n){var t=q(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",L(u+" "+n))):e.setAttribute("class",L(u.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function j(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function U(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e?t.createElementNS(e,n):t.createElement(n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=oa.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return Ea(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],a=0,o=i.length;o>a;a++)(u=i[a])&&t(u,a,e);return n}function Z(n){return Sa(n,za),n}function V(n){var t,e;return function(r,u,i){var a,o=n[i].update,l=o.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(a=o[t])&&++t<l;);return a}}function X(n,t,e){function r(){var t=this[a];t&&(this.removeEventListener(n,t,t.$),delete this[a])}function u(){var u=l(t,ca(arguments));r.call(this),this.addEventListener(n,this[a]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+oa.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var a="__on"+n,o=n.indexOf("."),l=$;o>0&&(n=n.slice(0,o));var c=La.get(n);return c&&(n=c,l=B),o?t?u:r:t?b:i}function $(n,t){return function(e){var r=oa.event;oa.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{oa.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Ta,u="click"+r,i=oa.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==qa&&(qa="onselectstart"in e?!1:x(e.style,"userSelect")),qa){var a=n(e).style,o=a[qa];a[qa]="none"}return function(n){if(i.on(r,null),qa&&(a[qa]=o),n){var t=function(){i.on(u,null)};i.on(u,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var u=r.createSVGPoint();if(0>Ra){var i=t(n);if(i.scrollX||i.scrollY){r=oa.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=r[0][0].getScreenCTM();Ra=!(a.f||a.e),r.remove()}}return Ra?(u.x=e.pageX,u.y=e.pageY):(u.x=e.clientX,u.y=e.clientY),u=u.matrixTransform(n.getScreenCTM().inverse()),[u.x,u.y]}var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}function G(){return oa.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?ja:Math.acos(n)}function tn(n){return n>1?Ha:-1>n?-Ha:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function an(n){return(n=Math.sin(n/2))*n}function on(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(a-i)*n/60:180>n?a:240>n?i+(a-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,a;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,a=.5>=e?e*(1+t):e+t-e*t,i=2*e-a,new yn(u(n+120),u(n),u(n-120))}function sn(n,t,e){return this instanceof sn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof sn?new sn(n.h,n.c,n.l):n instanceof hn?pn(n.l,n.a,n.b):pn((n=Sn((n=oa.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new sn(n,t,e)}function fn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Oa)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof sn?fn(n.h,n.c,n.l):Sn((n=yn(n)).r,n.g,n.b):new hn(n,t,e)}function gn(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=vn(u)*Ka,r=vn(r)*Qa,i=vn(i)*no,new yn(mn(3.2404542*u-1.5371385*r-.4985314*i),mn(-.969266*u+1.8760108*r+.041556*i),mn(.0556434*u-.2040259*r+1.0572252*i))}function pn(n,t,e){return n>0?new sn(Math.atan2(e,t)*Ia,Math.sqrt(t*t+e*e),n):new sn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function mn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function yn(n,t,e){return this instanceof yn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof yn?new yn(n.r,n.g,n.b):_n(""+n,yn,cn):new yn(n,t,e)}function Mn(n){return new yn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,u,i,a=0,o=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(Nn(u[0]),Nn(u[1]),Nn(u[2]))}return(i=ro.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(a=(3840&i)>>4,a=a>>4|a,o=240&i,o=o>>4|o,l=15&i,l=l<<4|l):7===n.length&&(a=(16711680&i)>>16,o=(65280&i)>>8,l=255&i)),t(a,o,l))}function wn(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),a=Math.max(n,t,e),o=a-i,l=(a+i)/2;return o?(u=.5>l?o/(a+i):o/(2-a-i),r=n==a?(t-e)/o+(e>t?6:0):t==a?(e-n)/o+2:(n-t)/o+4,r*=60):(r=NaN,u=l>0&&1>l?0:r),new ln(r,u,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/Ka),u=dn((.2126729*n+.7151522*t+.072175*e)/Qa),i=dn((.0193339*n+.119192*t+.9503041*e)/no);return hn(116*u-16,500*(r-u),200*(u-i))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function u(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(i,l)}catch(r){return void a.error.call(i,r)}a.load.call(i,n)}else a.error.call(i,l)}var i={},a=oa.dispatch("beforesend","progress","load","error"),o={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=u:l.onreadystatechange=function(){l.readyState>3&&u()},l.onprogress=function(n){var t=oa.event;oa.event=n;try{a.progress.call(i,l)}finally{oa.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?o[n]:(null==t?delete o[n]:o[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(c=n,i):c},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ca(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),l.open(e,n,!0),null==t||"accept"in o||(o.accept=t+",*/*"),l.setRequestHeader)for(var s in o)l.setRequestHeader(s,o[s]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),a.beforesend.call(i,l),l.send(null==r?null:r),i},i.abort=function(){return l.abort(),i},oa.rebind(i,a,"on"),null==r?i:i.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,n:null};return io?io.n=i:uo=i,io=i,ao||(oo=clearTimeout(oo),ao=1,lo(Tn)),i}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(oo),oo=setTimeout(Tn,t)),ao=0):(ao=1,lo(Tn))}function Rn(){for(var n=Date.now(),t=uo;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=uo,e=1/0;t;)t.c?(t.t<e&&(e=t.t),t=(n=t).n):t=n?n.n=t.n:uo=t.n;return io=n,e}function Pn(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function jn(n,t){var e=Math.pow(10,3*Ma(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Un(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],a=0,o=r[0],l=0;u>0&&o>0&&(l+o+1>t&&(o=Math.max(1,t-l)),i.push(n.substring(u-=o,u+o)),!((l+=o+1)>t));)o=r[a=(a+1)%r.length];return i.reverse().join(e)}:y;return function(n){var e=so.exec(n),r=e[1]||" ",a=e[2]||">",o=e[3]||"-",l=e[4]||"",c=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===a)&&(c=r="0",a="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===l&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=fo.get(g)||Fn;var M=c&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===o?"":o;if(0>p){var l=oa.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===a?u+n+k:">"===a?k+u+n:"^"===a?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new go(e-1)),1),e}function i(n,e){return t(n=new go(+n),e),n}function a(n,r,i){var a=u(n),o=[];if(i>1)for(;r>a;)e(a)%i||o.push(new Date(+a)),t(a,1);else for(;r>a;)o.push(new Date(+a)),t(a,1);return o}function o(n,t,e){try{go=Hn;var r=new Hn;return r._=n,a(r,t,e)}finally{go=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=a;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(u),l.offset=In(i),l.range=o,n}function In(n){return function(t,e){try{go=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{go=Date}}}function Yn(n){function t(n){function t(t){for(var e,u,i,a=[],o=-1,l=0;++o<r;)37===n.charCodeAt(o)&&(a.push(n.slice(l,o)),null!=(u=vo[e=n.charAt(++o)])&&(e=n.charAt(++o)),(i=A[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),a.push(e),l=o+1);return a.push(n.slice(l,o)),a.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&go!==Hn,a=new(i?Hn:go);return"j"in r?a.setFullYear(r.y,0,r.j):"W"in r||"U"in r?("w"in r||(r.w="W"in r?1:0),a.setFullYear(r.y,0,1),a.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(a.getDay()+5)%7:r.w+7*r.U-(a.getDay()+6)%7)):a.setFullYear(r.y,r.m,r.d),a.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),i?a._:a},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,a,o=0,l=t.length,c=e.length;l>o;){if(r>=c)return-1;if(u=t.charCodeAt(o++),37===u){if(a=t.charAt(o++),i=C[a in vo?t.charAt(o++):a],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{go=Hn;var t=new go;return t._=n,r(t)}finally{go=Date}}var r=t(n);return e.parse=function(n){try{go=Hn;var t=r.parse(n);return t&&t._}finally{go=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=oa.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(m),k=Xn(m),N=Vn(y),E=Xn(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+ho.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(ho.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(ho.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:ot,"%":function(){return"%"}},C={a:r,A:u,b:i,B:a,c:o,d:tt,e:tt,H:rt,I:rt,j:et,L:at,m:nt,M:ut,p:s,S:it,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Vn(n){return new RegExp("^(?:"+n.map(oa.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function $n(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Bn(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Wn(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Jn(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Gn(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.y=Qn(+r[0]),e+r[0].length):-1}function Kn(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Qn(n){return n+(n>68?1900:2e3)}function nt(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ut(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function it(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function at(n,t,e){mo.lastIndex=0;var r=mo.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ot(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=Ma(t)/60|0,u=Ma(t)%60;return e+Zn(r,"0",2)+Zn(u,"0",2)}function lt(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function st(){}function ft(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function ht(n,t){n&&_o.hasOwnProperty(n.type)&&_o[n.type](n,t)}function gt(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function pt(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)gt(n[e],t,1);t.polygonEnd()}function vt(){function n(n,t){n*=Oa,t=t*Oa/2+ja/4;var e=n-r,a=e>=0?1:-1,o=a*e,l=Math.cos(t),c=Math.sin(t),s=i*c,f=u*l+s*Math.cos(o),h=s*a*Math.sin(o);So.add(Math.atan2(h,f)),r=n,u=l,i=c}var t,e,r,u,i;ko.point=function(a,o){ko.point=n,r=(t=a)*Oa,u=Math.cos(o=(e=o)*Oa/2+ja/4),i=Math.sin(o)},ko.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function mt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function yt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return Ma(n[0]-t[0])<Da&&Ma(n[1]-t[1])<Da}function St(n,t){n*=Oa;var e=Math.cos(t*=Oa);kt(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function kt(n,t,e){++No,Ao+=(n-Ao)/No,Co+=(t-Co)/No,zo+=(e-zo)/No}function Nt(){function n(n,u){n*=Oa;var i=Math.cos(u*=Oa),a=i*Math.cos(n),o=i*Math.sin(n),l=Math.sin(u),c=Math.atan2(Math.sqrt((c=e*l-r*o)*c+(c=r*a-t*l)*c+(c=t*o-e*a)*c),t*a+e*o+r*l);Eo+=c,Lo+=c*(t+(t=a)),qo+=c*(e+(e=o)),To+=c*(r+(r=l)),kt(t,e,r)}var t,e,r;jo.point=function(u,i){u*=Oa;var a=Math.cos(i*=Oa);t=a*Math.cos(u),e=a*Math.sin(u),r=Math.sin(i),jo.point=n,kt(t,e,r)}}function Et(){jo.point=St}function At(){function n(n,t){n*=Oa;var e=Math.cos(t*=Oa),a=e*Math.cos(n),o=e*Math.sin(n),l=Math.sin(t),c=u*l-i*o,s=i*a-r*l,f=r*o-u*a,h=Math.sqrt(c*c+s*s+f*f),g=r*a+u*o+i*l,p=h&&-nn(g)/h,v=Math.atan2(h,g);Ro+=p*c,Do+=p*s,Po+=p*f,Eo+=v,Lo+=v*(r+(r=a)),qo+=v*(u+(u=o)),To+=v*(i+(i=l)),kt(r,u,i)}var t,e,r,u,i;jo.point=function(a,o){t=a,e=o,jo.point=n,a*=Oa;var l=Math.cos(o*=Oa);r=l*Math.cos(a),u=l*Math.sin(a),i=Math.sin(o),kt(r,u,i)},jo.lineEnd=function(){n(t,e),jo.lineEnd=Et,jo.point=St}}function Ct(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function zt(){return!0}function Lt(n,t,e,r,u){var i=[],a=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(wt(e,r)){u.lineStart();for(var o=0;t>o;++o)u.point((e=n[o])[0],e[1]);return void u.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,i.push(l),a.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,i.push(l),a.push(c)}}),a.sort(t),qt(i),qt(a),i.length){for(var o=0,l=e,c=a.length;c>o;++o)a[o].e=l=!l;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var o=0,c=s.length;c>o;++o)u.point((f=s[o])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var o=s.length-1;o>=0;--o)u.point((f=s[o])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function Tt(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Rt(n,t,e,r){return function(u,i){function a(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function o(n,t){var e=u(n,t);d.point(e[0],e[1])}function l(){y.point=o,d.lineStart()}function c(){y.point=a,d.lineEnd()}function s(n,t){v.push([n,t]);var e=u(n,t);x.point(e[0],e[1])}function f(){x.lineStart(),v=[]}function h(){s(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,a=-1;if(r>0){for(b||(i.polygonStart(),b=!0),i.lineStart();++a<r;)i.point((u=n[a])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Dt))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:a,lineStart:l,lineEnd:c,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=a,y.lineStart=l,y.lineEnd=c,g=oa.merge(g);var n=Ot(m,p);g.length?(b||(i.polygonStart(),b=!0),Lt(g,jt,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Pt(),x=t(M),b=!1;return y}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function jt(n,t){return((n=n.x)[0]<0?n[1]-Ha-Da:Ha-n[1])-((t=t.x)[0]<0?t[1]-Ha-Da:Ha-t[1])}function Ut(n){var t,e=NaN,r=NaN,u=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(i,a){var o=i>0?ja:-ja,l=Ma(i-e);Ma(l-ja)<Da?(n.point(e,r=(r+a)/2>0?Ha:-Ha),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(o,r),n.point(i,r),t=0):u!==o&&l>=ja&&(Ma(e-u)<Da&&(e-=u*Da),Ma(i-o)<Da&&(i-=o*Da),r=Ft(e,r,i,a),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(o,r),t=0),n.point(e=i,r=a),u=o},lineEnd:function(){n.lineEnd(),e=r=NaN},clean:function(){return 2-t}}}function Ft(n,t,e,r){var u,i,a=Math.sin(n-e);return Ma(a)>Da?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*a)):(t+r)/2}function Ht(n,t,e,r){var u;if(null==n)u=e*Ha,r.point(-ja,u),r.point(0,u),r.point(ja,u),r.point(ja,0),r.point(ja,-u),r.point(0,-u),r.point(-ja,-u),r.point(-ja,0),r.point(-ja,u);else if(Ma(n[0]-t[0])>Da){var i=n[0]<t[0]?ja:-ja;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function Ot(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,a=0;So.reset();for(var o=0,l=t.length;l>o;++o){var c=t[o],s=c.length;if(s)for(var f=c[0],h=f[0],g=f[1]/2+ja/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=c[d];var m=n[0],y=n[1]/2+ja/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>ja,k=p*M;if(So.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*Ua:b,S^h>=e^m>=e){var N=yt(dt(f),dt(n));bt(N);var E=yt(u,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(a+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Da>i||Da>i&&0>So)^1&a}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,l,c,s;return{lineStart:function(){c=l=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=a?v?0:u(f,h):v?u(f+(0>f?ja:-ja),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(g=r(e,p),(wt(e,g)||wt(p,g))&&(p[0]+=Da,p[1]+=Da,v=t(p[0],p[1]))),v!==l)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(o&&e&&a^v){var m;d&i||!(m=r(p,e,!0))||(s=0,a?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&wt(e,p)||n.point(p[0],p[1]),e=p,l=v,i=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return s|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),u=dt(t),a=[1,0,0],o=yt(r,u),l=mt(o,o),c=o[0],s=l-c*c;if(!s)return!e&&n;var f=i*l/s,h=-i*c/s,g=yt(a,o),p=xt(a,f),v=xt(o,h);Mt(p,v);var d=g,m=mt(p,d),y=mt(d,d),M=m*m-y*(mt(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-m-x)/y);if(Mt(b,p),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=Ma(E-ja)<Da,C=A||Da>E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(Ma(b[0]-w)<Da?k:N):k<=b[1]&&b[1]<=N:E>ja^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-m+x)/y);return Mt(z,p),[b,_t(z)]}}}function u(t,e){var r=a?n:ja-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),a=i>0,o=Ma(i)>Da,l=ve(n,6*Oa);return Rt(t,e,l,a?[0,-n]:[-ja,n-ja])}function Yt(n,t,e,r){return function(u){var i,a=u.a,o=u.b,l=a.x,c=a.y,s=o.x,f=o.y,h=0,g=1,p=s-l,v=f-c;if(i=n-l,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-l,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-c,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-c,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:l+h*p,y:c+h*v}),1>g&&(u.b={x:l+g*p,y:c+g*v}),u}}}}}}function Zt(n,t,e,r){function u(r,u){return Ma(r[0]-n)<Da?u>0?0:3:Ma(r[0]-e)<Da?u>0?2:1:Ma(r[1]-t)<Da?u>0?1:0:u>0?3:2}function i(n,t){return a(n.x,t.x)}function a(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(o){function l(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,a=1,o=d[u],l=o.length,c=o[0];l>a;++a)i=o[a],c[1]<=r?i[1]>r&&Q(c,i,n)>0&&++t:i[1]<=r&&Q(c,i,n)<0&&--t,c=i;return 0!==t}function c(i,o,l,c){var s=0,f=0;if(null==i||(s=u(i,l))!==(f=u(o,l))||a(i,o)<0^l>0){do c.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+l+4)%4)!==f)}else c.point(o[0],o[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&o.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=NaN}function g(){v&&(p(y,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=f,w&&o.lineEnd()}function p(n,t){n=Math.max(-Fo,Math.min(Fo,n)),t=Math.max(-Fo,Math.min(Fo,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(o.lineStart(),o.point(n,t));else if(e&&w)o.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),e||o.lineEnd(),k=!1):e&&(o.lineStart(),o.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,N=o,E=Pt(),A=Yt(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){o=E,v=[],d=[],k=!0},polygonEnd:function(){o=N,v=oa.merge(v);var t=l([n,r]),e=k&&t,u=v.length;(e||u)&&(o.polygonStart(),e&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),u&&Lt(v,i,t,c,o),o.polygonEnd()),v=d=m=null}};return C}}function Vt(n){var t=0,e=ja/3,r=oe(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*ja/180,e=n[1]*ja/180):[t/ja*180,e/ja*180]},u}function Xt(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),a-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),a=Math.sqrt(i)/u;return e.invert=function(n,t){var e=a-t;return[Math.atan2(n,e)/u,tn((i-(n*n+e*e)*u*u)/(2*u))]},e}function $t(){function n(n,t){Oo+=u*n-r*t,r=n,u=t}var t,e,r,u;Xo.point=function(i,a){Xo.point=n,t=r=i,e=u=a},Xo.lineEnd=function(){n(t,e)}}function Bt(n,t){Io>n&&(Io=n),n>Zo&&(Zo=n),Yo>t&&(Yo=t),t>Vo&&(Vo=t)}function Wt(){function n(n,t){a.push("M",n,",",t,i)}function t(n,t){a.push("M",n,",",t),o.point=e}function e(n,t){a.push("L",n,",",t)}function r(){o.point=n}function u(){a.push("Z")}var i=Jt(4.5),a=[],o={point:n,lineStart:function(){o.point=t},lineEnd:r,polygonStart:function(){o.lineEnd=u},polygonEnd:function(){o.lineEnd=r,o.point=n},pointRadius:function(n){return i=Jt(n),o},result:function(){if(a.length){var n=a.join("");return a=[],n}}};return o}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Ao+=n,Co+=t,++zo}function Kt(){function n(n,r){var u=n-t,i=r-e,a=Math.sqrt(u*u+i*i);Lo+=a*(t+n)/2,qo+=a*(e+r)/2,To+=a,Gt(t=n,e=r)}var t,e;Bo.point=function(r,u){Bo.point=n,Gt(t=r,e=u)}}function Qt(){Bo.point=Gt}function ne(){function n(n,t){var e=n-r,i=t-u,a=Math.sqrt(e*e+i*i);Lo+=a*(r+n)/2,qo+=a*(u+t)/2,To+=a,a=u*n-r*t,Ro+=a*(r+n),Do+=a*(u+t),Po+=3*a,Gt(r=n,u=t)}var t,e,r,u;Bo.point=function(i,a){Bo.point=n,Gt(t=r=i,e=u=a)},Bo.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+a,e),n.arc(t,e,a,0,Ua)}function e(t,e){n.moveTo(t,e),o.point=r}function r(t,e){n.lineTo(t,e)}function u(){o.point=t}function i(){n.closePath()}var a=4.5,o={point:t,lineStart:function(){o.point=e},lineEnd:u,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=u,o.point=t},pointRadius:function(n){return a=n,o},result:b};return o}function ee(n){function t(n){return(o?r:e)(n)}function e(t){return ie(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=i,t.lineStart()}function i(e,r){var i=dt([e,r]),a=n(e,r);u(M,x,y,b,_,w,M=a[0],x=a[1],y=e,b=i[0],_=i[1],w=i[2],o,t),t.point(M,x)}function a(){S.point=e,t.lineEnd()}function l(){r(),S.point=c,S.lineEnd=s}function c(n,t){
+i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,o,t),S.lineEnd=a,a()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,o,l,c,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=o+g,_=l+p,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=Ma(Ma(w)-1)<Da||Ma(r-h)<Da?(r+h)/2:Math.atan2(_,b),E=n(N,k),A=E[0],C=E[1],z=A-t,L=C-e,q=M*z-y*L;(q*q/x>i||Ma((y*z+M*L)/x-.5)>.3||a>o*g+l*p+c*v)&&(u(t,e,r,o,l,c,A,C,N,b/=S,_/=S,w,d,m),m.point(A,C),u(A,C,N,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,a=Math.cos(30*Oa),o=16;return t.precision=function(n){return arguments.length?(o=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function re(n){var t=ee(function(t,e){return n([t*Ia,e*Ia])});return function(n){return le(t(n))}}function ue(n){this.stream=n}function ie(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ae(n){return oe(function(){return n})()}function oe(n){function t(n){return n=o(n[0]*Oa,n[1]*Oa),[n[0]*h+l,c-n[1]*h]}function e(n){return n=o.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Ia,n[1]*Ia]}function r(){o=Ct(a=fe(m,M,x),i);var n=i(v,d);return l=g-n[0]*h,c=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,a,o,l,c,s,f=ee(function(n,t){return n=i(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Uo,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=le(b(a,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Uo):It((w=+n)*Oa),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Oa,d=n[1]%360*Oa,r()):[v*Ia,d*Ia]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Oa,M=n[1]%360*Oa,x=n.length>2?n[2]%360*Oa:0,r()):[m*Ia,M*Ia,x*Ia]},oa.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function le(n){return ie(n,function(t,e){n.point(t*Oa,e*Oa)})}function ce(n,t){return[n,t]}function se(n,t){return[n>ja?n-Ua:-ja>n?n+Ua:n,t]}function fe(n,t,e){return n?t||e?Ct(ge(n),pe(t,e)):ge(n):t||e?pe(t,e):se}function he(n){return function(t,e){return t+=n,[t>ja?t-Ua:-ja>t?t+Ua:t,e]}}function ge(n){var t=he(n);return t.invert=he(-n),t}function pe(n,t){function e(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*r+o*u;return[Math.atan2(l*i-s*a,o*r-c*u),tn(s*i+l*a)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),a=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*i-l*a;return[Math.atan2(l*i+c*a,o*r+s*u),tn(s*r-o*u)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,a,o){var l=a*t;null!=u?(u=de(e,u),i=de(e,i),(a>0?i>u:u>i)&&(u+=a*Ua)):(u=n+a*Ua,i=n-.5*l);for(var c,s=u;a>0?s>i:i>s;s-=l)o.point((c=_t([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Da)%(2*Math.PI)}function me(n,t,e){var r=oa.range(n,t-Da,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function ye(n,t,e){var r=oa.range(n,t-Da,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),a=Math.cos(r),o=Math.sin(r),l=u*Math.cos(n),c=u*Math.sin(n),s=a*Math.cos(e),f=a*Math.sin(e),h=2*Math.asin(Math.sqrt(an(r-t)+u*a*an(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*l+t*s,u=e*c+t*f,a=e*i+t*o;return[Math.atan2(u,r)*Ia,Math.atan2(a,Math.sqrt(r*r+u*u))*Ia]}:function(){return[n*Ia,t*Ia]};return p.distance=h,p}function _e(){function n(n,u){var i=Math.sin(u*=Oa),a=Math.cos(u),o=Ma((n*=Oa)-t),l=Math.cos(o);Wo+=Math.atan2(Math.sqrt((o=a*Math.sin(o))*o+(o=r*i-e*a*l)*o),e*i+r*a*l),t=n,e=i,r=a}var t,e,r;Jo.point=function(u,i){t=u*Oa,e=Math.sin(i*=Oa),r=Math.cos(i),Jo.point=n},Jo.lineEnd=function(){Jo.point=Jo.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),a=Math.cos(u);return[Math.atan2(n*i,r*a),Math.asin(r&&e*i/r)]},e}function Se(n,t){function e(n,t){a>0?-Ha+Da>t&&(t=-Ha+Da):t>Ha-Da&&(t=Ha-Da);var e=a/Math.pow(u(t),i);return[e*Math.sin(i*n),a-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(ja/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),a=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=a-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(a/r,1/i))-Ha]},e):Ne}function ke(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return Ma(u)<Da?ce:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-K(u)*Math.sqrt(n*n+e*e)]},e)}function Ne(n,t){return[n,Math.log(Math.tan(ja/4+t/2))]}function Ee(n){var t,e=ae(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var a=i.apply(e,arguments);if(a===e){if(t=null==n){var o=ja*r(),l=u();i([[l[0]-o,l[1]-o],[l[0]+o,l[1]+o]])}}else t&&(a=null);return a},e.clipExtent(null)}function Ae(n,t){return[Math.log(Math.tan(ja/4+t/2)),-n]}function Ce(n){return n[0]}function ze(n){return n[1]}function Le(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var u=n[0],i=e[0],a=t[0]-u,o=r[0]-i,l=n[1],c=e[1],s=t[1]-l,f=r[1]-c,h=(o*(l-c)-f*(u-i))/(f*a-o*s);return[u+h*a,l+h*s]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function je(n){var t=ll.pop()||new Pe;return t.site=n,t}function Ue(n){Be(n),il.remove(n),ll.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,a=n.N,o=[n];Ue(n);for(var l=i;l.circle&&Ma(e-l.circle.x)<Da&&Ma(r-l.circle.cy)<Da;)i=l.P,o.unshift(l),Ue(l),l=i;o.unshift(l),Be(l);for(var c=a;c.circle&&Ma(e-c.circle.x)<Da&&Ma(r-c.circle.cy)<Da;)a=c.N,o.push(c),Ue(c),c=a;o.push(c),Be(c);var s,f=o.length;for(s=1;f>s;++s)c=o[s],l=o[s-1],nr(c.edge,l.site,c.site,u);l=o[0],c=o[f-1],c.edge=Ke(l.site,c.site,null,u),$e(l),$e(c)}function He(n){for(var t,e,r,u,i=n.x,a=n.y,o=il._;o;)if(r=Oe(o,a)-i,r>Da)o=o.L;else{if(u=i-Ie(o,a),!(u>Da)){r>-Da?(t=o.P,e=o):u>-Da?(t=o,e=o.N):t=e=o;break}if(!o.R){t=o;break}o=o.R}var l=je(n);if(il.insert(t,l),t||e){if(t===e)return Be(t),e=je(t.site),il.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,s=c.x,f=c.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};nr(e.edge,c,p,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,p,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var a=n.P;if(!a)return-(1/0);e=a.site;var o=e.x,l=e.y,c=l-t;if(!c)return o;var s=o-r,f=1/i-1/c,h=s/c;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*c)-l+c/2+u-i/2)))/f+r:(r+o)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,u,i,a,o,l,c,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=ul,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(o=i.edges,l=o.length,a=0;l>a;)s=o[a].end(),r=s.x,u=s.y,c=o[++a%l].start(),t=c.x,e=c.y,(Ma(r-t)>Da||Ma(u-e)>Da)&&(o.splice(a,0,new tr(Qe(i.site,s,Ma(r-f)<Da&&p-u>Da?{x:f,y:Ma(t-f)<Da?e:p}:Ma(u-p)<Da&&h-r>Da?{x:Ma(e-p)<Da?t:h,y:p}:Ma(r-h)<Da&&u-g>Da?{x:h,y:Ma(t-h)<Da?e:g}:Ma(u-g)<Da&&r-f>Da?{x:Ma(e-g)<Da?t:f,y:g}:null),i.site,null)),++l)}function Ve(n,t){return t.angle-n.angle}function Xe(){rr(this),this.x=this.y=this.arc=this.site=this.cy=null}function $e(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var a=u.x,o=u.y,l=r.x-a,c=r.y-o,s=i.x-a,f=i.y-o,h=2*(l*f-c*s);if(!(h>=-Pa)){var g=l*l+c*c,p=s*s+f*f,v=(f*g-c*p)/h,d=(l*p-s*g)/h,f=d+o,m=cl.pop()||new Xe;m.arc=n,m.site=u,m.x=v+a,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=ol._;M;)if(m.y<M.y||m.y===M.y&&m.x<=M.x){if(!M.L){y=M.P;break}M=M.L}else{if(!M.R){y=M;break}M=M.R}ol.insert(y,m),y||(al=m)}}}}function Be(n){var t=n.circle;t&&(t.P||(al=t.N),ol.remove(t),cl.push(t),rr(t),n.circle=null)}function We(n){for(var t,e=rl,r=Yt(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Je(t,n)||!r(t)||Ma(t.a.x-t.b.x)<Da&&Ma(t.a.y-t.b.y)<Da)&&(t.a=t.b=null,e.splice(u,1))}function Je(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,a=t[0][0],o=t[1][0],l=t[0][1],c=t[1][1],s=n.l,f=n.r,h=s.x,g=s.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(a>d||d>=o)return;if(h>p){if(i){if(i.y>=c)return}else i={x:d,y:l};e={x:d,y:c}}else{if(i){if(i.y<l)return}else i={x:d,y:c};e={x:d,y:l}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else{if(i){if(i.y<l)return}else i={x:(c-u)/r,y:c};e={x:(l-u)/r,y:l}}else if(v>g){if(i){if(i.x>=o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}else{if(i){if(i.x<a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}return n.a=i,n.b=e,!0}function Ge(n,t){this.l=n,this.r=t,this.a=this.b=null}function Ke(n,t,e,r){var u=new Ge(n,t);return rl.push(u),e&&nr(u,n,t,e),r&&nr(u,t,n,r),ul[n.i].edges.push(new tr(u,n,t)),ul[t.i].edges.push(new tr(u,t,n)),u}function Qe(n,t,e){var r=new Ge(n,null);return r.a=t,r.b=e,rl.push(r),r}function nr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function tr(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function er(){this._=null}function rr(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function ur(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ir(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function ar(n){for(;n.L;)n=n.L;return n}function or(n,t){var e,r,u,i=n.sort(lr).pop();for(rl=[],ul=new Array(n.length),il=new er,ol=new er;;)if(u=al,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(ul[i.i]=new Ye(i),He(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;Fe(u.arc)}t&&(We(t),Ze(t));var a={cells:ul,edges:rl};return il=ol=rl=ul=null,a}function lr(n,t){return t.y-n.y||t.x-n.x}function cr(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function sr(n){return n.x}function fr(n){return n.y}function hr(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function gr(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var a=.5*(e+u),o=.5*(r+i),l=t.nodes;l[0]&&gr(n,l[0],e,r,a,o),l[1]&&gr(n,l[1],a,r,u,o),l[2]&&gr(n,l[2],e,o,a,i),l[3]&&gr(n,l[3],a,o,u,i)}}function pr(n,t,e,r,u,i,a){var o,l=1/0;return function c(n,s,f,h,g){if(!(s>i||f>a||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(l>m){var y=Math.sqrt(l=m);r=t-y,u=e-y,i=t+y,a=e+y,o=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,s,f,x,b);break;case 1:c(n,x,f,h,b);break;case 2:c(n,s,b,x,g);break;case 3:c(n,x,b,h,g)}}}(n,r,u,i,a),o}function vr(n,t){n=oa.rgb(n),t=oa.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,a=t.g-r,o=t.b-u;return function(n){return"#"+bn(Math.round(e+i*n))+bn(Math.round(r+a*n))+bn(Math.round(u+o*n))}}function dr(n,t){var e,r={},u={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function mr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function yr(n,t){var e,r,u,i=fl.lastIndex=hl.lastIndex=0,a=-1,o=[],l=[];for(n+="",t+="";(e=fl.exec(n))&&(r=hl.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),o[a]?o[a]+=u:o[++a]=u),(e=e[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:mr(e,r)})),i=hl.lastIndex;return i<t.length&&(u=t.slice(i),o[a]?o[a]+=u:o[++a]=u),o.length<2?l[0]?(t=l[0].x,function(n){return t(n)+""}):function(){return t}:(t=l.length,function(n){for(var e,r=0;t>r;++r)o[(e=l[r]).i]=e.x(n);return o.join("")})}function Mr(n,t){for(var e,r=oa.interpolators.length;--r>=0&&!(e=oa.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],u=[],i=n.length,a=t.length,o=Math.min(n.length,t.length);for(e=0;o>e;++e)r.push(Mr(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;a>e;++e)u[e]=t[e];return function(n){for(e=0;o>e;++e)u[e]=r[e](n);return u}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Ha)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Ua*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Ua/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=oa.hcl(n),t=oa.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,a=t.c-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return fn(e+i*n,r+a*n,u+o*n)+""}}function Dr(n,t){n=oa.hsl(n),t=oa.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,a=t.s-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return cn(e+i*n,r+a*n,u+o*n)+""}}function Pr(n,t){n=oa.lab(n),t=oa.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,a=t.a-r,o=t.b-u;return function(n){return gn(e+i*n,r+a*n,u+o*n)+""}}function jr(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Ur(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),u=Fr(t,e),i=Hr(Or(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Ia,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Ia:0}function Fr(n,t){return n[0]*t[0]+n[1]*t[1]}function Hr(n){var t=Math.sqrt(Fr(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Or(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Ir(n){return n.length?n.pop()+",":""}function Yr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var u=e.push("translate(",null,",",null,")");r.push({i:u-4,x:mr(n[0],t[0])},{i:u-2,x:mr(n[1],t[1])})}else(t[0]||t[1])&&e.push("translate("+t+")")}function Zr(n,t,e,r){n!==t?(n-t>180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:mr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:mr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var u=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:u-4,x:mr(n[0],t[0])},{i:u-2,x:mr(n[1],t[1])})}else(1!==t[0]||1!==t[1])&&e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=oa.transform(n),t=oa.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,u=-1,i=r.length;++u<i;)e[(t=r[u]).i]=t.x(n);return e.join("")}}function Br(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Wr(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Jr(n){for(var t=n.source,e=n.target,r=Kr(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Gr(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Kr(n,t){if(n===t)return n;for(var e=Gr(n),r=Gr(t),u=e.pop(),i=r.pop(),a=null;u===i;)a=u,u=e.pop(),i=r.pop();return a}function Qr(n){n.fixed|=2}function nu(n){n.fixed&=-7}function tu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function eu(n){n.fixed&=-5}function ru(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,a=n.nodes,o=a.length,l=-1;++l<o;)i=a[l],null!=i&&(ru(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var c=t*e[n.point.index];n.charge+=n.pointCharge=c,r+=c*n.point.x,u+=c*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function uu(n,t){return oa.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=su,n}function iu(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function au(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,a=-1;++a<u;)e.push(i[a]);for(;null!=(n=r.pop());)t(n)}function ou(n){return n.children}function lu(n){return n.value}function cu(n,t){return t.value-n.value}function su(n){return oa.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function fu(n){return n.x}function hu(n){return n.y}function gu(n,t,e){n.y0=t,n.y=e}function pu(n){return oa.range(n.length)}function vu(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function du(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function mu(n){return n.reduce(yu,0)}function yu(n,t){return n+t[1]}function Mu(n,t){return xu(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xu(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function bu(n){return[oa.min(n),oa.max(n)]}function _u(n,t){return n.value-t.value}function wu(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Su(n,t){n._pack_next=t,t._pack_prev=n}function ku(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Nu(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(c=e.length)){var e,r,u,i,a,o,l,c,s=1/0,f=-(1/0),h=1/0,g=-(1/0);if(e.forEach(Eu),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(u=e[1],u.x=u.r,u.y=0,t(u),c>2))for(i=e[2],zu(r,u,i),t(i),wu(r,i),r._pack_prev=i,wu(i,u),u=r._pack_next,a=3;c>a;a++){zu(r,u,i=e[a]);var p=0,v=1,d=1;for(o=u._pack_next;o!==u;o=o._pack_next,v++)if(ku(o,i)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!ku(l,i);l=l._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?Su(r,u=o):Su(r=l,u),a--):(wu(r,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(a=0;c>a;a++)i=e[a],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(Au)}}function Eu(n){n._pack_next=n._pack_prev=n}function Au(n){delete n._pack_next,delete n._pack_prev}function Cu(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,a=u.length;++i<a;)Cu(u[i],t,e,r)}function zu(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var a=t.r+e.r,o=u*u+i*i;a*=a,r*=r;var l=.5+(r-a)/(2*o),c=Math.sqrt(Math.max(0,2*a*(r+o)-(r-=o)*r-a*a))/(2*o);e.x=n.x+l*u+c*i,e.y=n.y+l*i-c*u}else e.x=n.x+r,e.y=n.y}function Lu(n,t){return n.parent==t.parent?1:2}function qu(n){var t=n.children;return t.length?t[0]:n.t}function Tu(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ru(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Du(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pu(n,t,e){return n.a.parent===t.parent?n.a:e}function ju(n){return 1+oa.max(n,function(n){return n.y})}function Uu(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fu(n){var t=n.children;return t&&t.length?Fu(t[0]):n}function Hu(n){var t,e=n.children;return e&&(t=e.length)?Hu(e[t-1]):n}function Ou(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Iu(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Yu(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zu(n){return n.rangeExtent?n.rangeExtent():Yu(n.range())}function Vu(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Xu(n,t){var e,r=0,u=n.length-1,i=n[r],a=n[u];return i>a&&(e=r,r=u,u=e,e=i,i=a,a=e),n[r]=t.floor(i),n[u]=t.ceil(a),n}function $u(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:wl}function Bu(n,t,e,r){var u=[],i=[],a=0,o=Math.min(n.length,t.length)-1;for(n[o]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++a<=o;)u.push(e(n[a-1],n[a])),i.push(r(t[a-1],t[a]));return function(t){var e=oa.bisect(n,t,1,o)-1;return i[e](u[e](t))}}function Wu(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Bu:Vu,l=r?Wr:Br;return a=u(n,t,l,e),o=u(t,n,l,Mr),i}function i(n){return a(n)}var a,o;return i.invert=function(n){return o(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(jr)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Qu(n,t)},i.tickFormat=function(t,e){return ni(n,t,e)},i.nice=function(t){return Gu(n,t),u()},i.copy=function(){return Wu(n,t,e,r)},u()}function Ju(n,t){return oa.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gu(n,t){return Xu(n,$u(Ku(n,t)[2])),Xu(n,$u(Ku(n,t)[2])),n}function Ku(n,t){null==t&&(t=10);var e=Yu(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Qu(n,t){return oa.range.apply(oa,Ku(n,t))}function ni(n,t,e){var r=Ku(n,t);if(e){var u=so.exec(e);if(u.shift(),"s"===u[8]){var i=oa.formatPrefix(Math.max(Ma(r[0]),Ma(r[1])));return u[7]||(u[7]="."+ti(i.scale(r[2]))),u[8]="f",e=oa.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+ei(u[8],r)),e=u.join("")}else e=",."+ti(r[2])+"f";return oa.format(e)}function ti(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function ei(n,t){var e=ti(t[2]);return n in Sl?Math.abs(e-ti(Math.max(Ma(t[0]),Ma(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ri(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function a(t){return n(u(t))}return a.invert=function(t){return i(n.invert(t))},a.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),a):r},a.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),a):t},a.nice=function(){var t=Xu(r.map(u),e?Math:Nl);return n.domain(t),r=t.map(i),a},a.ticks=function(){var n=Yu(r),a=[],o=n[0],l=n[1],c=Math.floor(u(o)),s=Math.ceil(u(l)),f=t%1?2:t;if(isFinite(s-c)){if(e){for(;s>c;c++)for(var h=1;f>h;h++)a.push(i(c)*h);a.push(i(c))}else for(a.push(i(c));c++<s;)for(var h=f-1;h>0;h--)a.push(i(c)*h);for(c=0;a[c]<o;c++);for(s=a.length;a[s-1]>l;s--);a=a.slice(c,s)}return a},a.tickFormat=function(n,e){if(!arguments.length)return kl;arguments.length<2?e=kl:"function"!=typeof e&&(e=oa.format(e));var r=Math.max(1,t*n/a.ticks().length);return function(n){var a=n/i(Math.round(u(n)));return t-.5>a*t&&(a*=t),r>=a?e(n):""}},a.copy=function(){return ri(n.copy(),t,e,r)},Ju(a,n)}function ui(n,t,e){function r(t){return n(u(t))}var u=ii(t),i=ii(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Qu(e,n)},r.tickFormat=function(n,t){return ni(e,n,t)},r.nice=function(n){return r.domain(Gu(e,n))},r.exponent=function(a){return arguments.length?(u=ii(t=a),i=ii(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return ui(n.copy(),t,e)},Ju(r,n)}function ii(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ai(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):NaN))-1)%i.length]}function r(t,e){return oa.range(n.length).map(function(n){return t+e*n})}var u,i,a;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new c;for(var i,a=-1,o=r.length;++a<o;)u.has(i=r[a])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,a=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,o){arguments.length<2&&(o=0);var l=u[0],c=u[1],s=n.length<2?(l=(l+c)/2,0):(c-l)/(n.length-1+o);return i=r(l+s*o/2,s),a=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(u,o){arguments.length<2&&(o=0);var l=u[0],c=u[1],s=n.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(n.length-1+o)|0;return i=r(l+Math.round(s*o/2+(c-l-(n.length-1+o)*s)/2),s),a=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(u,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var c=u[1]<u[0],s=u[c-0],f=u[1-c],h=(f-s)/(n.length-o+2*l);return i=r(s+h*l,h),c&&i.reverse(),a=h*(1-o),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,o,l){arguments.length<2&&(o=0),arguments.length<3&&(l=o);var c=u[1]<u[0],s=u[c-0],f=u[1-c],h=Math.floor((f-s)/(n.length-o+2*l));return i=r(s+Math.round((f-s-(n.length-o)*h)/2),h),c&&i.reverse(),a=Math.round(h*(1-o)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return a},e.rangeExtent=function(){return Yu(t.a[0])},e.copy=function(){return ai(n,t)},e.domain(n)}function oi(n,t){function i(){var e=0,r=t.length;for(o=[];++e<r;)o[e-1]=oa.quantile(n,e/r);return a}function a(n){return isNaN(n=+n)?void 0:t[oa.bisect(o,n)]}var o;return a.domain=function(t){return arguments.length?(n=t.map(r).filter(u).sort(e),i()):n},a.range=function(n){return arguments.length?(t=n,i()):t},a.quantiles=function(){return o},a.invertExtent=function(e){return e=t.indexOf(e),0>e?[NaN,NaN]:[e>0?o[e-1]:n[0],e<o.length?o[e]:n[n.length-1]]},a.copy=function(){return oi(n,t)},i()}function li(n,t,e){function r(t){return e[Math.max(0,Math.min(a,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),a=e.length-1,r}var i,a;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?NaN:t/i+n,[t,t+1/i]},r.copy=function(){return li(n,t,e)},u()}function ci(n,t){function e(e){return e>=e?t[oa.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return ci(n,t)},e}function si(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qu(n,t)},t.tickFormat=function(t,e){return ni(n,t,e)},t.copy=function(){return si(n)},t}function fi(){return 0}function hi(n){return n.innerRadius}function gi(n){return n.outerRadius}function pi(n){return n.startAngle}function vi(n){return n.endAngle}function di(n){return n&&n.padAngle}function mi(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function yi(n,t,e,r,u){var i=n[0]-t[0],a=n[1]-t[1],o=(u?r:-r)/Math.sqrt(i*i+a*a),l=o*a,c=-o*i,s=n[0]+l,f=n[1]+c,h=t[0]+l,g=t[1]+c,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(Math.max(0,M*M*y-x*x)),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,N=_-p,E=w-v,A=S-p,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mi(n){function t(t){function a(){c.push("M",i(n(s),o))}for(var l,c=[],s=[],f=-1,h=t.length,g=En(e),p=En(r);++f<h;)u.call(this,l=t[f],f)?s.push([+g.call(this,l,f),+p.call(this,l,f)]):s.length&&(a(),s=[]);return s.length&&a(),c.length?c.join(""):null}var e=Ce,r=ze,u=zt,i=xi,a=i.key,o=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(a="function"==typeof n?i=n:(i=ql.get(n)||xi).key,t):a},t.tension=function(n){return arguments.length?(o=n,t):o},t}function xi(n){return n.length>1?n.join("L"):n+"Z"}function bi(n){return n.join("L")+"Z"}function _i(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function wi(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function Si(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function ki(n,t){return n.length<4?xi(n):n[1]+Ai(n.slice(1,-1),Ci(n,t))}function Ni(n,t){return n.length<3?bi(n):n[0]+Ai((n.push(n[0]),n),Ci([n[n.length-2]].concat(n,[n[1]]),t))}function Ei(n,t){return n.length<3?xi(n):n[0]+Ai(n,Ci(n,t))}function Ai(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return xi(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],a=t[0],o=a,l=1;if(e&&(r+="Q"+(i[0]-2*a[0]/3)+","+(i[1]-2*a[1]/3)+","+i[0]+","+i[1],u=n[1],l=2),t.length>1){o=t[1],i=n[l],l++,r+="C"+(u[0]+a[0])+","+(u[1]+a[1])+","+(i[0]-o[0])+","+(i[1]-o[1])+","+i[0]+","+i[1];for(var c=2;c<t.length;c++,l++)i=n[l],o=t[c],r+="S"+(i[0]-o[0])+","+(i[1]-o[1])+","+i[0]+","+i[1]}if(e){var s=n[l];r+="Q"+(i[0]+2*o[0]/3)+","+(i[1]+2*o[1]/3)+","+s[0]+","+s[1]}return r}function Ci(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],a=n[1],o=1,l=n.length;++o<l;)e=i,i=a,a=n[o],r.push([u*(a[0]-e[0]),u*(a[1]-e[1])]);return r}function zi(n){if(n.length<3)return xi(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],a=[u,u,u,(r=n[1])[0]],o=[i,i,i,r[1]],l=[u,",",i,"L",Ri(Dl,a),",",Ri(Dl,o)];for(n.push(n[e-1]);++t<=e;)r=n[t],a.shift(),a.push(r[0]),o.shift(),o.push(r[1]),Di(l,a,o);return n.pop(),l.push("L",r),l.join("")}function Li(n){if(n.length<4)return xi(n);for(var t,e=[],r=-1,u=n.length,i=[0],a=[0];++r<3;)t=n[r],i.push(t[0]),a.push(t[1]);for(e.push(Ri(Dl,i)+","+Ri(Dl,a)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),a.shift(),a.push(t[1]),Di(e,i,a);return e.join("")}function qi(n){for(var t,e,r=-1,u=n.length,i=u+4,a=[],o=[];++r<4;)e=n[r%u],a.push(e[0]),o.push(e[1]);for(t=[Ri(Dl,a),",",Ri(Dl,o)],--r;++r<i;)e=n[r%u],a.shift(),a.push(e[0]),o.shift(),o.push(e[1]),Di(t,a,o);return t.join("")}function Ti(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],a=n[0][1],o=n[e][0]-i,l=n[e][1]-a,c=-1;++c<=e;)r=n[c],u=c/e,r[0]=t*r[0]+(1-t)*(i+u*o),r[1]=t*r[1]+(1-t)*(a+u*l);return zi(n)}function Ri(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Di(n,t,e){n.push("C",Ri(Tl,t),",",Ri(Tl,e),",",Ri(Rl,t),",",Ri(Rl,e),",",Ri(Dl,t),",",Ri(Dl,e))}function Pi(n,t){return(t[1]-n[1])/(t[0]-n[0])}function ji(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],a=r[0]=Pi(u,i);++t<e;)r[t]=(a+(a=Pi(u=i,i=n[t+1])))/2;return r[t]=a,r}function Ui(n){for(var t,e,r,u,i=[],a=ji(n),o=-1,l=n.length-1;++o<l;)t=Pi(n[o],n[o+1]),Ma(t)<Da?a[o]=a[o+1]=0:(e=a[o]/t,r=a[o+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),a[o]=u*e,a[o+1]=u*r));for(o=-1;++o<=l;)u=(n[Math.min(l,o+1)][0]-n[Math.max(0,o-1)][0])/(6*(1+a[o]*a[o])),i.push([u||0,a[o]*u||0]);return i}function Fi(n){return n.length<3?xi(n):n[0]+Ai(n,Ui(n))}function Hi(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]-Ha,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Oi(n){function t(t){function l(){v.push("M",o(n(m),f),s,c(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,M=t.length,x=En(e),b=En(u),_=e===r?function(){
+return g}:En(r),w=u===i?function(){return p}:En(i);++y<M;)a.call(this,h=t[y],y)?(d.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):d.length&&(l(),d=[],m=[]);return d.length&&l(),v.length?v.join(""):null}var e=Ce,r=Ce,u=0,i=ze,a=zt,o=xi,l=o.key,c=o,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(a=n,t):a},t.interpolate=function(n){return arguments.length?(l="function"==typeof n?o=n:(o=ql.get(n)||xi).key,c=o.reverse||o,s=o.closed?"M":"L",t):l},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Ii(n){return n.radius}function Yi(n){return[n.x,n.y]}function Zi(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Ha;return[e*Math.cos(r),e*Math.sin(r)]}}function Vi(){return 64}function Xi(){return"circle"}function $i(n){var t=Math.sqrt(n/ja);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Bi(n){return function(){var t,e,r;(t=this[n])&&(r=t[e=t.active])&&(r.timer.c=null,r.timer.t=NaN,--t.count?delete t[e]:delete this[n],t.active+=.5,r.event&&r.event.interrupt.call(this,this.__data__,r.index))}}function Wi(n,t,e){return Sa(n,Il),n.namespace=t,n.id=e,n}function Ji(n,t,e,r){var u=n.id,i=n.namespace;return Y(n,"function"==typeof e?function(n,a,o){n[i][u].tween.set(t,r(e.call(n,n.__data__,a,o)))}:(e=r(e),function(n){n[i][u].tween.set(t,e)}))}function Gi(n){return null==n&&(n=""),function(){this.textContent=n}}function Ki(n){return null==n?"__transition__":"__transition_"+n+"__"}function Qi(n,t,e,r,u){function i(n){var t=v.delay;return s.t=t+l,n>=t?a(n-t):void(s.c=a)}function a(e){var u=p.active,i=p[u];i&&(i.timer.c=null,i.timer.t=NaN,--p.count,delete p[u],i.event&&i.event.interrupt.call(n,n.__data__,i.index));for(var a in p)if(r>+a){var c=p[a];c.timer.c=null,c.timer.t=NaN,--p.count,delete p[a]}s.c=o,qn(function(){return s.c&&o(e||1)&&(s.c=null,s.t=NaN),1},0,l),p.active=r,v.event&&v.event.start.call(n,n.__data__,t),g=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&g.push(r)}),h=v.ease,f=v.duration}function o(u){for(var i=u/f,a=h(i),o=g.length;o>0;)g[--o].call(n,a);return i>=1?(v.event&&v.event.end.call(n,n.__data__,t),--p.count?delete p[r]:delete n[e],1):void 0}var l,s,f,h,g,p=n[e]||(n[e]={active:0,count:0}),v=p[r];v||(l=u.time,s=qn(i,0,l),v=p[r]={tween:new c,time:l,timer:s,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++p.count)}function na(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function ta(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function ea(n){return n.toISOString()}function ra(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=oa.bisect(Gl,u);return i==Gl.length?[t.year,Ku(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Gl[i-1]<Gl[i]/u?i-1:i]:[nc,Ku(n,e)[2]]}return r.invert=function(t){return ua(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(ua)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,ua(+e+1),t).length}var i=r.domain(),a=Yu(i),o=null==n?u(a,10):"number"==typeof n&&u(a,n);return o&&(n=o[0],t=o[1]),r.domain(Xu(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=ua(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=ua(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yu(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],ua(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ra(n.copy(),t,e)},Ju(r,n)}function ua(n){return new Date(n)}function ia(n){return JSON.parse(n.responseText)}function aa(n){var t=sa.createRange();return t.selectNode(sa.body),t.createContextualFragment(n.responseText)}var oa={version:"3.5.13"},la=[].slice,ca=function(n){return la.call(n)},sa=this.document;if(sa)try{ca(sa.documentElement.childNodes)[0].nodeType}catch(fa){ca=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),sa)try{sa.createElement("DIV").style.setProperty("opacity",0,"")}catch(ha){var ga=this.Element.prototype,pa=ga.setAttribute,va=ga.setAttributeNS,da=this.CSSStyleDeclaration.prototype,ma=da.setProperty;ga.setAttribute=function(n,t){pa.call(this,n,t+"")},ga.setAttributeNS=function(n,t,e){va.call(this,n,t,e+"")},da.setProperty=function(n,t,e){ma.call(this,n,t+"",e)}}oa.ascending=e,oa.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},oa.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},oa.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},oa.extent=function(n,t){var e,r,u,i=-1,a=n.length;if(1===arguments.length){for(;++i<a;)if(null!=(r=n[i])&&r>=r){e=u=r;break}for(;++i<a;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<a;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=u=r;break}for(;++i<a;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},oa.sum=function(n,t){var e,r=0,i=n.length,a=-1;if(1===arguments.length)for(;++a<i;)u(e=+n[a])&&(r+=e);else for(;++a<i;)u(e=+t.call(n,n[a],a))&&(r+=e);return r},oa.mean=function(n,t){var e,i=0,a=n.length,o=-1,l=a;if(1===arguments.length)for(;++o<a;)u(e=r(n[o]))?i+=e:--l;else for(;++o<a;)u(e=r(t.call(n,n[o],o)))?i+=e:--l;return l?i/l:void 0},oa.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},oa.median=function(n,t){var i,a=[],o=n.length,l=-1;if(1===arguments.length)for(;++l<o;)u(i=r(n[l]))&&a.push(i);else for(;++l<o;)u(i=r(t.call(n,n[l],l)))&&a.push(i);return a.length?oa.quantile(a.sort(e),.5):void 0},oa.variance=function(n,t){var e,i,a=n.length,o=0,l=0,c=-1,s=0;if(1===arguments.length)for(;++c<a;)u(e=r(n[c]))&&(i=e-o,o+=i/++s,l+=i*(e-o));else for(;++c<a;)u(e=r(t.call(n,n[c],c)))&&(i=e-o,o+=i/++s,l+=i*(e-o));return s>1?l/(s-1):void 0},oa.deviation=function(){var n=oa.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ya=i(e);oa.bisectLeft=ya.left,oa.bisect=oa.bisectRight=ya.right,oa.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},oa.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},oa.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},oa.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},oa.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=oa.min(arguments,a),e=new Array(t);++n<t;)for(var r,u=-1,i=e[n]=new Array(r);++u<r;)i[u]=arguments[u][n];return e},oa.transpose=function(n){return oa.zip.apply(oa,n)},oa.keys=function(n){var t=[];for(var e in n)t.push(e);return t},oa.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},oa.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},oa.merge=function(n){for(var t,e,r,u=n.length,i=-1,a=0;++i<u;)a+=n[i].length;for(e=new Array(a);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--a]=r[t];return e};var Ma=Math.abs;oa.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=o(Ma(e)),a=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++a)>t;)u.push(r/i);else for(;(r=n+e*++a)<t;)u.push(r/i);return u},oa.map=function(n,t){var e=new c;if(n instanceof c)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)e.set(u,n[u]);else for(;++u<i;)e.set(t.call(n,r=n[u],u),r)}else for(var a in n)e.set(a,n[a]);return e};var xa="__proto__",ba="\x00";l(c,{has:h,get:function(n){return this._[s(n)]},set:function(n,t){return this._[s(n)]=t},remove:g,keys:p,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:f(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t),this._[t])}}),oa.nest=function(){function n(t,a,o){if(o>=i.length)return r?r.call(u,a):e?a.sort(e):a;for(var l,s,f,h,g=-1,p=a.length,v=i[o++],d=new c;++g<p;)(h=d.get(l=v(s=a[g])))?h.push(s):d.set(l,[s]);return t?(s=t(),f=function(e,r){s.set(e,n(t,r,o))}):(s={},f=function(e,r){s[e]=n(t,r,o)}),d.forEach(f),s}function t(n,e){if(e>=i.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],a=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(oa.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return a[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},oa.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),oa.behavior={},oa.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=M(n,t,t[e]);return n};var _a=["webkit","ms","moz","Moz","o","O"];oa.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},oa.event=null,oa.requote=function(n){return n.replace(wa,"\\$&")};var wa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Sa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},ka=function(n,t){return t.querySelector(n)},Na=function(n,t){return t.querySelectorAll(n)},Ea=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ea=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(ka=function(n,t){return Sizzle(n,t)[0]||null},Na=Sizzle,Ea=Sizzle.matchesSelector),oa.selection=function(){return oa.select(sa.documentElement)};var Aa=oa.selection.prototype=[];Aa.select=function(n){var t,e,r,u,i=[];n=A(n);for(var a=-1,o=this.length;++a<o;){i.push(t=[]),t.parentNode=(r=this[a]).parentNode;for(var l=-1,c=r.length;++l<c;)(u=r[l])?(t.push(e=n.call(u,u.__data__,l,a)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return E(i)},Aa.selectAll=function(n){var t,e,r=[];n=C(n);for(var u=-1,i=this.length;++u<i;)for(var a=this[u],o=-1,l=a.length;++o<l;)(e=a[o])&&(r.push(t=ca(n.call(e,e.__data__,o,u))),t.parentNode=e);return E(r)};var Ca={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};oa.ns={prefix:Ca,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),Ca.hasOwnProperty(e)?{space:Ca[e],local:n}:n}},Aa.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=oa.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Aa.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!q(n[u]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},Aa.style=function(n,e,r){var u=arguments.length;if(3>u){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Aa.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(j(t,n[t]));return this}return this.each(j(n,t))},Aa.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Aa.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Aa.append=function(n){return n=U(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Aa.insert=function(n,t){return n=U(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Aa.remove=function(){return this.each(F)},Aa.data=function(n,t){function e(n,e){var r,u,i,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),v=new Array(a);if(t){var d,m=new c,y=new Array(a);for(r=-1;++r<a;)(u=n[r])&&(m.has(d=t.call(u,u.__data__,r))?v[r]=u:m.set(d,u),y[r]=d);for(r=-1;++r<f;)(u=m.get(d=t.call(e,i=e[r],r)))?u!==!0&&(g[r]=u,u.__data__=i):p[r]=H(i),m.set(d,!0);for(r=-1;++r<a;)r in y&&m.get(y[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=H(i);for(;f>r;++r)p[r]=H(e[r]);for(;a>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,o.push(p),l.push(g),s.push(v)}var r,u,i=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++i<a;)(u=r[i])&&(n[i]=u.__data__);return n}var o=Z([]),l=E([]),s=E([]);if("function"==typeof n)for(;++i<a;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<a;)e(r=this[i],n);return l.enter=function(){return o},l.exit=function(){return s},l},Aa.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},Aa.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,a=this.length;a>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var o=0,l=e.length;l>o;o++)(r=e[o])&&n.call(r,r.__data__,o,i)&&t.push(r)}return E(u)},Aa.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},Aa.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},Aa.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},Aa.call=function(n){var t=ca(arguments);return n.apply(t[0]=this,t),this},Aa.empty=function(){return!this.node()},Aa.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},Aa.size=function(){var n=0;return Y(this,function(){++n}),n};var za=[];oa.selection.enter=Z,oa.selection.enter.prototype=za,za.append=Aa.append,za.empty=Aa.empty,za.node=Aa.node,za.call=Aa.call,za.size=Aa.size,za.select=function(n){for(var t,e,r,u,i,a=[],o=-1,l=this.length;++o<l;){r=(u=this[o]).update,a.push(t=[]),t.parentNode=u.parentNode;for(var c=-1,s=u.length;++c<s;)(i=u[c])?(t.push(r[c]=e=n.call(u.parentNode,i.__data__,c,o)),e.__data__=i.__data__):t.push(null)}return E(a)},za.insert=function(n,t){return arguments.length<2&&(t=V(this)),Aa.insert.call(this,n,t)},oa.select=function(t){var e;return"string"==typeof t?(e=[ka(t,sa)],e.parentNode=sa.documentElement):(e=[t],e.parentNode=n(t)),E([e])},oa.selectAll=function(n){var t;return"string"==typeof n?(t=ca(Na(n,sa)),t.parentNode=sa.documentElement):(t=ca(n),t.parentNode=null),E([t])},Aa.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var La=oa.map({mouseenter:"mouseover",mouseleave:"mouseout"});sa&&La.forEach(function(n){"on"+n in sa&&La.remove(n)});var qa,Ta=0;oa.mouse=function(n){return J(n,k())};var Ra=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;oa.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},oa.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",a)}function e(n,t,e,i,a){return function(){function o(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(m.on(i+d,null).on(a+d,null),y(p),g({type:"dragend"}))}var c,s=this,f=oa.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=oa.select(e(f)).on(i+d,o).on(a+d,l),y=W(f),M=t(h,v);u?(c=u.apply(s,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],g({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),u=null,i=e(b,oa.mouse,t,"mousemove","mouseup"),a=e(G,oa.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},oa.rebind(n,r,"on")},oa.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ca(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Da=1e-6,Pa=Da*Da,ja=Math.PI,Ua=2*ja,Fa=Ua-Da,Ha=ja/2,Oa=ja/180,Ia=180/ja,Ya=Math.SQRT2,Za=2,Va=4;oa.interpolateZoom=function(n,t){var e,r,u=n[0],i=n[1],a=n[2],o=t[0],l=t[1],c=t[2],s=o-u,f=l-i,h=s*s+f*f;if(Pa>h)r=Math.log(c/a)/Ya,e=function(n){return[u+n*s,i+n*f,a*Math.exp(Ya*n*r)]};else{var g=Math.sqrt(h),p=(c*c-a*a+Va*h)/(2*a*Za*g),v=(c*c-a*a-Va*h)/(2*c*Za*g),d=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(v*v+1)-v);r=(m-d)/Ya,e=function(n){var t=n*r,e=rn(d),o=a/(Za*g)*(e*un(Ya*t+d)-en(d));return[u+o*s,i+o*f,a*e/rn(Ya*t+d)]}}return e.duration=1e3*r,e},oa.behavior.zoom=function(){function n(n){n.on(L,f).on($a+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(A[0],Math.min(A[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function a(t,e,r,a){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,a)),i(d=e,r),t=oa.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function o(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){o(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||(n({type:"zoomend"}),d=null)}function f(){function n(){o=1,i(oa.mouse(u),h),c(a)}function r(){f.on(q,null).on(T,null),g(o),s(a)}var u=this,a=D.of(u,arguments),o=0,f=oa.select(t(u)).on(q,n).on(T,r),h=e(oa.mouse(u)),g=W(u);Ol.call(u),l(a)}function h(){function n(){var n=oa.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=oa.event.target;oa.select(t).on(x,r).on(b,o),_.push(t);for(var e=oa.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var s=l[0];a(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var s=l[0],f=l[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,a=oa.touches(p);Ol.call(p);for(var o=0,l=a.length;l>o;++o,r=null)if(e=a[o],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),c(v)}function o(){if(oa.event.touches.length){for(var t=oa.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}oa.selectAll(_).on(y,null),w.on(L,f).on(R,h),N(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+oa.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=oa.select(p),N=W(p);t(),l(v),w.on(L,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(Ol.call(this),v=e(d=m||oa.mouse(this)),l(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*Xa())*k.k),i(d,v),c(n)}function p(){var n=oa.mouse(this),t=Math.log(k.k)/Math.LN2;a(this,n,e(n),oa.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Ba,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return $a||($a="onwheel"in sa?(Xa=function(){return-oa.event.deltaY*(oa.event.deltaMode?120:1)},"wheel"):"onmousewheel"in sa?(Xa=function(){return oa.event.wheelDelta},"mousewheel"):(Xa=function(){return-oa.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Fl?oa.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],u=d?d[0]:e/2,i=d?d[1]:r/2,a=oa.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=a(t),o=e/r[2];this.__chart__=k={x:u-r[0]*o,y:i-r[1]*o,k:o},c(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,l(n),c(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},o(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},u(+t),o(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Ba:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},oa.rebind(n,D,"on")};var Xa,$a,Ba=[0,1/0];oa.color=on,on.prototype.toString=function(){return this.rgb()+""},oa.hsl=ln;var Wa=ln.prototype=new on;Wa.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Wa.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Wa.rgb=function(){return cn(this.h,this.s,this.l)},oa.hcl=sn;var Ja=sn.prototype=new on;Ja.brighter=function(n){return new sn(this.h,this.c,Math.min(100,this.l+Ga*(arguments.length?n:1)))},Ja.darker=function(n){return new sn(this.h,this.c,Math.max(0,this.l-Ga*(arguments.length?n:1)))},Ja.rgb=function(){return fn(this.h,this.c,this.l).rgb()},oa.lab=hn;var Ga=18,Ka=.95047,Qa=1,no=1.08883,to=hn.prototype=new on;to.brighter=function(n){return new hn(Math.min(100,this.l+Ga*(arguments.length?n:1)),this.a,this.b)},to.darker=function(n){return new hn(Math.max(0,this.l-Ga*(arguments.length?n:1)),this.a,this.b)},to.rgb=function(){return gn(this.l,this.a,this.b)},oa.rgb=yn;var eo=yn.prototype=new on;eo.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new yn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new yn(u,u,u)},eo.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new yn(n*this.r,n*this.g,n*this.b)},eo.hsl=function(){return wn(this.r,this.g,this.b)},eo.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var ro=oa.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});ro.forEach(function(n,t){ro.set(n,Mn(t))}),oa.functor=En,oa.xhr=An(y),oa.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var a=Cn(n,t,null==e?r:u(e),i);return a.row=function(n){return arguments.length?a.response(null==(e=n)?r:u(n)):e},a}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(a).join(n)}function a(n){return o.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var o=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=c)return a;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++<c;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}s=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++s):10===r&&(u=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;c>s;){var r=n.charCodeAt(s++),o=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++o);else if(r!==l)continue;return n.slice(t,s-o)}return n.slice(t)}for(var r,u,i={},a={},o=[],c=n.length,s=0,f=0;(r=e())!==a;){for(var h=[];r!==i&&r!==a;)h.push(r),r=e();t&&null==(h=t(h,f++))||o.push(h)}return o},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(a).join(n)].concat(t.map(function(t){return u.map(function(n){return a(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},oa.csv=oa.dsv(",","text/csv"),oa.tsv=oa.dsv(" ","text/tab-separated-values");var uo,io,ao,oo,lo=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};oa.timer=function(){qn.apply(this,arguments)},oa.timer.flush=function(){Rn(),Dn()},oa.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var co=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(jn);oa.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=oa.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),co[8+e/3]};var so=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fo=oa.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=oa.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),ho=oa.time={},go=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){po.setUTCDate.apply(this._,arguments)},setDay:function(){po.setUTCDay.apply(this._,arguments)},setFullYear:function(){po.setUTCFullYear.apply(this._,arguments)},setHours:function(){po.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){po.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){po.setUTCMinutes.apply(this._,arguments)},setMonth:function(){po.setUTCMonth.apply(this._,arguments)},setSeconds:function(){po.setUTCSeconds.apply(this._,arguments)},setTime:function(){po.setTime.apply(this._,arguments)}};var po=Date.prototype;ho.year=On(function(n){return n=ho.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ho.years=ho.year.range,ho.years.utc=ho.year.utc.range,ho.day=On(function(n){var t=new go(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ho.days=ho.day.range,ho.days.utc=ho.day.utc.range,ho.dayOfYear=function(n){var t=ho.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ho[n]=On(function(n){return(n=ho.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ho.year(n).getDay();return Math.floor((ho.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ho[n+"s"]=e.range,ho[n+"s"].utc=e.utc.range,ho[n+"OfYear"]=function(n){var e=ho.year(n).getDay();return Math.floor((ho.dayOfYear(n)+(e+t)%7)/7)}}),ho.week=ho.sunday,ho.weeks=ho.sunday.range,ho.weeks.utc=ho.sunday.utc.range,ho.weekOfYear=ho.sundayOfYear;var vo={"-":"",_:" ",0:"0"},mo=/^\s*\d+/,yo=/^%/;oa.locale=function(n){return{numberFormat:Un(n),timeFormat:Yn(n)}};var Mo=oa.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
+shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});oa.format=Mo.numberFormat,oa.geo={},st.prototype={s:0,t:0,add:function(n){ft(n,this.t,xo),ft(xo.s,this.s,this),this.s?this.t+=xo.t:this.s=xo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var xo=new st;oa.geo.stream=function(n,t){n&&bo.hasOwnProperty(n.type)?bo[n.type](n,t):ht(n,t)};var bo={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)ht(e[r].geometry,t)}},_o={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){gt(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)gt(e[r],t,0)},Polygon:function(n,t){pt(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)pt(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)ht(e[r],t)}};oa.geo.area=function(n){return wo=0,oa.geo.stream(n,ko),wo};var wo,So=new st,ko={sphere:function(){wo+=4*ja},point:b,lineStart:b,lineEnd:b,polygonStart:function(){So.reset(),ko.lineStart=vt},polygonEnd:function(){var n=2*So;wo+=0>n?4*ja+n:n,ko.lineStart=ko.lineEnd=ko.point=b}};oa.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=dt([t*Oa,e*Oa]);if(m){var u=yt(m,r),i=[u[1],-u[0],0],a=yt(i,u);bt(a),a=_t(a);var l=t-p,c=l>0?1:-1,v=a[0]*Ia*c,d=Ma(l)>180;if(d^(v>c*p&&c*t>v)){var y=a[1]*Ia;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>c*p&&c*t>v)){var y=-a[1]*Ia;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=Ma(r)>180?r+(r>0?360:-360):r}else v=n,d=e;ko.point(n,e),t(n,e)}function i(){ko.lineStart()}function a(){u(v,d),ko.lineEnd(),Ma(y)>Da&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function o(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,v,d,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=a,y=0,ko.polygonStart()},polygonEnd:function(){ko.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>So?(s=-(h=180),f=-(g=90)):y>Da?g=90:-Da>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],oa.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],c(e[0],u)||c(e[1],u)?(o(u[0],e[1])>o(u[0],u[1])&&(u[1]=e[1]),o(e[0],u[1])>o(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var a,e,p=-(1/0),t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(a=o(u[1],e[0]))>p&&(p=a,s=e[0],h=u[1])}return M=x=null,s===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[s,f],[h,g]]}}(),oa.geo.centroid=function(n){No=Eo=Ao=Co=zo=Lo=qo=To=Ro=Do=Po=0,oa.geo.stream(n,jo);var t=Ro,e=Do,r=Po,u=t*t+e*e+r*r;return Pa>u&&(t=Lo,e=qo,r=To,Da>Eo&&(t=Ao,e=Co,r=zo),u=t*t+e*e+r*r,Pa>u)?[NaN,NaN]:[Math.atan2(e,t)*Ia,tn(r/Math.sqrt(u))*Ia]};var No,Eo,Ao,Co,zo,Lo,qo,To,Ro,Do,Po,jo={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){jo.lineStart=At},polygonEnd:function(){jo.lineStart=Nt}},Uo=Rt(zt,Ut,Ht,[-ja,-ja/2]),Fo=1e9;oa.geo.clipExtent=function(){var n,t,e,r,u,i,a={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(o){return arguments.length?(i=Zt(n=+o[0][0],t=+o[0][1],e=+o[1][0],r=+o[1][1]),u&&(u.valid=!1,u=null),a):[[n,t],[e,r]]}};return a.extent([[0,0],[960,500]])},(oa.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,oa.geo.albers=function(){return oa.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},oa.geo.albersUsa=function(){function n(n){var i=n[0],a=n[1];return t=null,e(i,a),t||(r(i,a),t)||u(i,a),t}var t,e,r,u,i=oa.geo.albers(),a=oa.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=oa.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?a:u>=.166&&.234>u&&r>=-.214&&-.115>r?o:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=a.stream(n),r=o.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),a.precision(t),o.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),a.scale(.35*t),o.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var c=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*c,f-.238*c],[s+.455*c,f+.238*c]]).stream(l).point,r=a.translate([s-.307*c,f+.201*c]).clipExtent([[s-.425*c+Da,f+.12*c+Da],[s-.214*c-Da,f+.234*c-Da]]).stream(l).point,u=o.translate([s-.205*c,f+.212*c]).clipExtent([[s-.214*c+Da,f+.166*c+Da],[s-.115*c-Da,f+.234*c-Da]]).stream(l).point,n},n.scale(1070)};var Ho,Oo,Io,Yo,Zo,Vo,Xo={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Oo=0,Xo.lineStart=$t},polygonEnd:function(){Xo.lineStart=Xo.lineEnd=Xo.point=b,Ho+=Ma(Oo/2)}},$o={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Bo={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Bo.lineStart=ne},polygonEnd:function(){Bo.point=Gt,Bo.lineStart=Kt,Bo.lineEnd=Qt}};oa.geo.path=function(){function n(n){return n&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=u(i)),oa.geo.stream(n,a)),i.result()}function t(){return a=null,n}var e,r,u,i,a,o=4.5;return n.area=function(n){return Ho=0,oa.geo.stream(n,u(Xo)),Ho},n.centroid=function(n){return Ao=Co=zo=Lo=qo=To=Ro=Do=Po=0,oa.geo.stream(n,u(Bo)),Po?[Ro/Po,Do/Po]:To?[Lo/To,qo/To]:zo?[Ao/zo,Co/zo]:[NaN,NaN]},n.bounds=function(n){return Zo=Vo=-(Io=Yo=1/0),oa.geo.stream(n,u($o)),[[Io,Yo],[Zo,Vo]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||re(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Wt:new te(n),"function"!=typeof o&&i.pointRadius(o),t()):r},n.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),n):o},n.projection(oa.geo.albersUsa()).context(null)},oa.geo.transform=function(n){return{stream:function(t){var e=new ue(t);for(var r in n)e[r]=n[r];return e}}},ue.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},oa.geo.projection=ae,oa.geo.projectionMutator=oe,(oa.geo.equirectangular=function(){return ae(ce)}).raw=ce.invert=ce,oa.geo.rotation=function(n){function t(t){return t=n(t[0]*Oa,t[1]*Oa),t[0]*=Ia,t[1]*=Ia,t}return n=fe(n[0]%360*Oa,n[1]*Oa,n.length>2?n[2]*Oa:0),t.invert=function(t){return t=n.invert(t[0]*Oa,t[1]*Oa),t[0]*=Ia,t[1]*=Ia,t},t},se.invert=ce,oa.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=fe(-n[0]*Oa,-n[1]*Oa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ia,n[1]*=Ia}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Oa,u*Oa),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Oa,(u=+r)*Oa),n):u},n.angle(90)},oa.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Oa,u=n[1]*Oa,i=t[1]*Oa,a=Math.sin(r),o=Math.cos(r),l=Math.sin(u),c=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*a)*e+(e=c*s-l*f*o)*e),l*s+c*f*o)},oa.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return oa.range(Math.ceil(i/d)*d,u,d).map(h).concat(oa.range(Math.ceil(c/m)*m,l,m).map(g)).concat(oa.range(Math.ceil(r/p)*p,e,p).filter(function(n){return Ma(n%d)>Da}).map(s)).concat(oa.range(Math.ceil(o/v)*v,a,v).filter(function(n){return Ma(n%m)>Da}).map(f))}var e,r,u,i,a,o,l,c,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(l).slice(1),h(u).reverse().slice(1),g(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],c=+t[0][1],l=+t[1][1],i>u&&(t=i,i=u,u=t),c>l&&(t=c,c=l,l=t),n.precision(y)):[[i,c],[u,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),n.precision(y)):[[r,o],[e,a]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=me(o,a,90),f=ye(r,e,y),h=me(c,l,90),g=ye(i,u,y),n):y},n.majorExtent([[-180,-90+Da],[180,90-Da]]).minorExtent([[-180,-80-Da],[180,80+Da]])},oa.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=Me,u=xe;return n.distance=function(){return oa.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},oa.geo.interpolate=function(n,t){return be(n[0]*Oa,n[1]*Oa,t[0]*Oa,t[1]*Oa)},oa.geo.length=function(n){return Wo=0,oa.geo.stream(n,Jo),Wo};var Wo,Jo={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Go=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(oa.geo.azimuthalEqualArea=function(){return ae(Go)}).raw=Go;var Ko=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(oa.geo.azimuthalEquidistant=function(){return ae(Ko)}).raw=Ko,(oa.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(oa.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var Qo=we(function(n){return 1/n},Math.atan);(oa.geo.gnomonic=function(){return ae(Qo)}).raw=Qo,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Ha]},(oa.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var nl=we(function(){return 1},Math.asin);(oa.geo.orthographic=function(){return ae(nl)}).raw=nl;var tl=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(oa.geo.stereographic=function(){return ae(tl)}).raw=tl,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Ha]},(oa.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,oa.geom={},oa.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=En(e),i=En(r),a=n.length,o=[],l=[];for(t=0;a>t;t++)o.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(o.sort(qe),t=0;a>t;t++)l.push([o[t][0],-o[t][1]]);var c=Le(o),s=Le(l),f=s[0]===c[0],h=s[s.length-1]===c[c.length-1],g=[];for(t=c.length-1;t>=0;--t)g.push(n[o[c[t]][2]]);for(t=+f;t<s.length-h;++t)g.push(n[o[s[t]][2]]);return g}var e=Ce,r=ze;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},oa.geom.polygon=function(n){return Sa(n,el),n};var el=oa.geom.polygon.prototype=[];el.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},el.centroid=function(n){var t,e,r=-1,u=this.length,i=0,a=0,o=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=o,o=this[r],e=t[0]*o[1]-o[0]*t[1],i+=(t[0]+o[0])*e,a+=(t[1]+o[1])*e;return[i*n,a*n]},el.clip=function(n){for(var t,e,r,u,i,a,o=De(n),l=-1,c=this.length-De(this),s=this[c-1];++l<c;){for(t=n.slice(),n.length=0,u=this[l],i=t[(r=t.length-o)-1],e=-1;++e<r;)a=t[e],Te(a,s,u)?(Te(i,s,u)||n.push(Re(i,a,s,u)),n.push(a)):Te(i,s,u)&&n.push(Re(i,a,s,u)),i=a;o&&n.push(n[0]),s=u}return n};var rl,ul,il,al,ol,ll=[],cl=[];Ye.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Ve),t.length},tr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},er.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=ar(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(ur(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ir(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(ir(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ur(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,a=n.R;if(e=i?a?ar(a):i:a,u?u.L===n?u.L=e:u.R=e:this._=e,i&&a?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==a?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=a,a.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,ur(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ir(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,ur(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,ir(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ur(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,ir(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},oa.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=o[0][0],u=o[0][1],i=o[1][0],a=o[1][1];return or(e(n),o).cells.forEach(function(e,o){var l=e.edges,c=e.site,s=t[o]=l.length?l.map(function(n){var t=n.start();return[t.x,t.y]}):c.x>=r&&c.x<=i&&c.y>=u&&c.y<=a?[[r,a],[i,a],[i,u],[r,u]]:[];s.point=n[o]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Da)*Da,y:Math.round(a(n,t)/Da)*Da,i:t}})}var r=Ce,u=ze,i=r,a=u,o=sl;return n?t(n):(t.links=function(n){return or(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return or(e(n)).cells.forEach(function(e,r){for(var u,i,a=e.site,o=e.edges.sort(Ve),l=-1,c=o.length,s=o[c-1].edge,f=s.l===a?s.r:s.l;++l<c;)u=s,i=f,s=o[l].edge,f=s.l===a?s.r:s.l,r<i.i&&r<f.i&&cr(a,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=En(r=n),t):r},t.y=function(n){return arguments.length?(a=En(u=n),t):u},t.clipExtent=function(n){return arguments.length?(o=null==n?sl:n,t):o===sl?null:o},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):o===sl?null:o&&o[1]},t)};var sl=[[-1e6,-1e6],[1e6,1e6]];oa.geom.delaunay=function(n){return oa.geom.voronoi().triangles(n)},oa.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,a,o){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var l=n.x,s=n.y;if(null!=l)if(Ma(l-e)+Ma(s-r)<.01)c(n,t,e,r,u,i,a,o);else{var f=n.point;n.x=n.y=n.point=null,c(n,f,l,s,u,i,a,o),c(n,t,e,r,u,i,a,o)}else n.x=e,n.y=r,n.point=t}else c(n,t,e,r,u,i,a,o)}function c(n,t,e,r,u,a,o,l){var c=.5*(u+o),s=.5*(a+l),f=e>=c,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=hr()),f?u=c:o=c,h?a=s:l=s,i(n,t,e,r,u,a,o,l)}var s,f,h,g,p,v,d,m,y,M=En(o),x=En(l);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,a)for(g=0;p>g;++g)s=n[g],s.x<v&&(v=s.x),s.y<d&&(d=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=hr();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){gr(n,k,v,d,m,y)},k.find=function(n){return pr(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=s=null,k}var a,o=Ce,l=ze;return(a=arguments.length)?(o=sr,l=fr,3===a&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(o=n,i):o},i.y=function(n){return arguments.length?(l=n,i):l},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},oa.interpolateRgb=vr,oa.interpolateObject=dr,oa.interpolateNumber=mr,oa.interpolateString=yr;var fl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,hl=new RegExp(fl.source,"g");oa.interpolate=Mr,oa.interpolators=[function(n,t){var e=typeof t;return("string"===e?ro.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?vr:yr:t instanceof on?vr:Array.isArray(t)?xr:"object"===e&&isNaN(t)?dr:mr)(n,t)}],oa.interpolateArray=xr;var gl=function(){return y},pl=oa.map({linear:gl,poly:Er,quad:function(){return Sr},cubic:function(){return kr},sin:function(){return Ar},exp:function(){return Cr},circle:function(){return zr},elastic:Lr,back:qr,bounce:function(){return Tr}}),vl=oa.map({"in":y,out:_r,"in-out":wr,"out-in":function(n){return wr(_r(n))}});oa.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=pl.get(e)||gl,r=vl.get(r)||y,br(r(e.apply(null,la.call(arguments,1))))},oa.interpolateHcl=Rr,oa.interpolateHsl=Dr,oa.interpolateLab=Pr,oa.interpolateRound=jr,oa.transform=function(n){var t=sa.createElementNS(oa.ns.prefix.svg,"g");return(oa.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Ur(e?e.matrix:dl)})(n)},Ur.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var dl={a:1,b:0,c:0,d:1,e:0,f:0};oa.interpolateTransform=$r,oa.layout={},oa.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Jr(n[e]));return t}},oa.layout.chord=function(){function n(){var n,c,f,h,g,p={},v=[],d=oa.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(c=0,g=-1;++g<i;)c+=u[h][g];v.push(c),m.push(oa.range(i)),n+=c}for(a&&d.sort(function(n,t){return a(v[n],v[t])}),o&&m.forEach(function(n,t){n.sort(function(n,e){return o(u[t][n],u[t][e])})}),n=(Ua-s*i)/n,c=0,h=-1;++h<i;){for(f=c,g=-1;++g<i;){var y=d[h],M=m[y][g],x=u[y][M],b=c,_=c+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:c,value:v[y]},c+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}l&&t()}function t(){e.sort(function(n,t){return l((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,a,o,l,c={},s=0;return c.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,c):u},c.padding=function(n){return arguments.length?(s=n,e=r=null,c):s},c.sortGroups=function(n){return arguments.length?(a=n,e=r=null,c):a},c.sortSubgroups=function(n){return arguments.length?(o=n,e=null,c):o},c.sortChords=function(n){return arguments.length?(l=n,e&&t(),c):l},c.chords=function(){return e||n(),e},c.groups=function(){return r||n(),r},c},oa.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,a=t.cy-n.y,o=u-e,l=i*i+a*a;if(l>o*o/m){if(v>l){var c=t.charge/l;n.px-=i*c,n.py-=a*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=i*c,n.py-=a*c}}return!t.charge}}function t(n){n.px=oa.event.x,n.py=oa.event.y,l.resume()}var e,r,u,i,a,o,l={},c=oa.dispatch("start","tick","end"),s=[1,1],f=.9,h=ml,g=yl,p=-30,v=Ml,d=.1,m=.64,M=[],x=[];return l.tick=function(){if((u*=.99)<.005)return e=null,c.end({type:"end",alpha:u=0}),!0;var t,r,l,h,g,v,m,y,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,g=l.target,y=g.x-h.x,b=g.y-h.y,(v=y*y+b*b)&&(v=u*a[r]*((v=Math.sqrt(v))-i[r])/v,y*=v,b*=v,g.x-=y*(m=h.weight+g.weight?h.weight/(h.weight+g.weight):.5),g.y-=b*m,h.x+=y*(m=1-m),h.y+=b*m);if((m=u*d)&&(y=s[0]/2,b=s[1]/2,r=-1,m))for(;++r<_;)l=M[r],l.x+=(y-l.x)*m,l.y+=(b-l.y)*m;if(p)for(ru(t=oa.geom.quadtree(M),u,o),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*f,l.y-=(l.py-(l.py=l.y))*f);c.tick({type:"tick",alpha:u})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(s=n,l):s},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.friction=function(n){return arguments.length?(f=+n,l):f},l.charge=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(m=n*n,l):Math.sqrt(m)},l.alpha=function(n){return arguments.length?(n=+n,u?n>0?u=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:u=0})):n>0&&(c.start({type:"start",alpha:u=n}),e=qn(l.tick)),l):u},l.start=function(){function n(n,r){if(!e){for(e=new Array(u),l=0;u>l;++l)e[l]=[];for(l=0;c>l;++l){var i=x[l];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var a,o=e[t],l=-1,s=o.length;++l<s;)if(!isNaN(a=o[l][n]))return a;return Math.random()*r}var t,e,r,u=M.length,c=x.length,f=s[0],v=s[1];for(t=0;u>t;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;u>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",f)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(t=0;c>t;++t)i[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)i[t]=h;if(a=[],"function"==typeof g)for(t=0;c>t;++t)a[t]=+g.call(this,x[t],t);else for(t=0;c>t;++t)a[t]=g;if(o=[],"function"==typeof p)for(t=0;u>t;++t)o[t]=+p.call(this,M[t],t);else for(t=0;u>t;++t)o[t]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=oa.behavior.drag().origin(y).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",nu)),arguments.length?void this.on("mouseover.force",tu).on("mouseout.force",eu).call(r):r},oa.rebind(l,c,"on")};var ml=20,yl=1,Ml=1/0;oa.layout.hierarchy=function(){function n(u){var i,a=[u],o=[];for(u.depth=0;null!=(i=a.pop());)if(o.push(i),(c=e.call(n,i,i.depth))&&(l=c.length)){for(var l,c,s;--l>=0;)a.push(s=c[l]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return au(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),o}var t=cu,e=ou,r=lu;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(iu(t,function(n){n.children&&(n.value=0)}),au(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},oa.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(a=i.length)){var a,o,l,c=-1;for(r=t.value?r/t.value:0;++c<a;)n(o=i[c],e,l=o.value*r,u),e+=l}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var a=r.call(this,e,i);return n(a[0],0,u[0],u[1]/t(a[0])),a}var r=oa.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},uu(e,r)},oa.layout.pie=function(){function n(a){var o,l=a.length,c=a.map(function(e,r){return+t.call(n,e,r)}),s=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof u?u.apply(this,arguments):u)-s,h=Math.min(Math.abs(f)/l,+("function"==typeof i?i.apply(this,arguments):i)),g=h*(0>f?-1:1),p=oa.sum(c),v=p?(f-l*g)/p:0,d=oa.range(l),m=[];return null!=e&&d.sort(e===xl?function(n,t){return c[t]-c[n]}:function(n,t){return e(a[n],a[t])}),d.forEach(function(n){m[n]={data:a[n],value:o=c[n],startAngle:s,endAngle:s+=o*v+g,padAngle:h}}),m}var t=Number,e=xl,r=0,u=Ua,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var xl={};oa.layout.stack=function(){function n(o,l){if(!(h=o.length))return o;var c=o.map(function(e,r){return t.call(n,e,r)}),s=c.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),a.call(n,t,e)]})}),f=e.call(n,s,l);c=oa.permute(c,f),s=oa.permute(s,f);var h,g,p,v,d=r.call(n,s,l),m=c[0].length;for(p=0;m>p;++p)for(u.call(n,c[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,c[g][p],v+=s[g-1][p][1],s[g][p][1]);return o}var t=y,e=pu,r=vu,u=gu,i=fu,a=hu;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:bl.get(t)||pu,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:_l.get(t)||vu,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(a=t,n):a},n.out=function(t){return arguments.length?(u=t,n):u},n};var bl=oa.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(du),i=n.map(mu),a=oa.range(r).sort(function(n,t){return u[n]-u[t]}),o=0,l=0,c=[],s=[];for(t=0;r>t;++t)e=a[t],l>o?(o+=i[e],c.push(e)):(l+=i[e],s.push(e));return s.reverse().concat(c)},reverse:function(n){return oa.range(n.length).reverse()},"default":pu}),_l=oa.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,a=[],o=0,l=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>o&&(o=r),a.push(r)}for(e=0;i>e;++e)l[e]=(o-a[e])/2;return l},wiggle:function(n){var t,e,r,u,i,a,o,l,c,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=l=c=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,o=f[e][0]-f[e-1][0];s>t;++t){for(r=0,a=(n[t][e][1]-n[t][e-1][1])/(2*o);t>r;++r)a+=(n[r][e][1]-n[r][e-1][1])/o;i+=a*n[t][e][1]}g[e]=l-=u?i/u*o:0,c>l&&(c=l)}for(e=0;h>e;++e)g[e]-=c;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,a=1/u,o=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=a}for(e=0;i>e;++e)o[e]=0;return o},zero:vu});oa.layout.histogram=function(){function n(n,i){for(var a,o,l=[],c=n.map(e,this),s=r.call(this,c,i),f=u.call(this,s,c,i),i=-1,h=c.length,g=f.length-1,p=t?1:1/h;++i<g;)a=l[i]=[],a.dx=f[i+1]-(a.x=f[i]),a.y=0;if(g>0)for(i=-1;++i<h;)o=c[i],o>=s[0]&&o<=s[1]&&(a=l[oa.bisect(f,o,1,g)-1],a.y+=p,a.push(n[i]));return l}var t=!0,e=Number,r=bu,u=Mu;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return xu(n,t)}:En(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},oa.layout.pack=function(){function n(n,i){var a=e.call(this,n,i),o=a[0],l=u[0],c=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(o.x=o.y=0,au(o,function(n){n.r=+s(n.value)}),au(o,Nu),r){var f=r*(t?1:Math.max(2*o.r/l,2*o.r/c))/2;au(o,function(n){n.r+=f}),au(o,Nu),au(o,function(n){n.r-=f})}return Cu(o,l/2,c/2,t?1:1/Math.max(2*o.r/l,2*o.r/c)),a}var t,e=oa.layout.hierarchy().sort(_u),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},uu(n,e)},oa.layout.tree=function(){function n(n,u){var s=a.call(this,n,u),f=s[0],h=t(f);if(au(h,e),h.parent.m=-h.z,iu(h,r),c)iu(f,i);else{var g=f,p=f,v=f;iu(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=o(g,p)/2-g.x,m=l[0]/(p.x+o(p,g)/2+d),y=l[1]/(v.depth||1);iu(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,a=0,o=i.length;o>a;++a)r.push((i[a]=u={_:i[a],parent:t,children:(u=i[a].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Du(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+o(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+o(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,a=t,l=u.parent.children[0],c=u.m,s=i.m,f=a.m,h=l.m;a=Tu(a),u=qu(u),a&&u;)l=qu(l),i=Tu(i),i.a=n,r=a.z+f-u.z-c+o(a._,u._),r>0&&(Ru(Pu(a,n,e),n,r),c+=r,s+=r),f+=a.m,c+=u.m,h+=l.m,s+=i.m;a&&!Tu(i)&&(i.t=a,i.m+=f-s),u&&!qu(l)&&(l.t=u,l.m+=c-h,e=n)}return e}function i(n){n.x*=l[0],n.y=n.depth*l[1]}var a=oa.layout.hierarchy().sort(null).value(null),o=Lu,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(o=t,n):o},n.size=function(t){return arguments.length?(c=null==(l=t)?i:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:i,n):c?l:null},uu(n,a)},oa.layout.cluster=function(){function n(n,i){var a,o=t.call(this,n,i),l=o[0],c=0;au(l,function(n){var t=n.children;t&&t.length?(n.x=Uu(t),n.y=ju(t)):(n.x=a?c+=e(n,a):0,n.y=0,a=n)});var s=Fu(l),f=Hu(l),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return au(l,u?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),o}var t=oa.layout.hierarchy().sort(null).value(null),e=Lu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},uu(n,t)},oa.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var a,o,l,c=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?c.dx:"dice"===g?c.dy:"slice-dice"===g?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),s.area=0;(l=h.length)>0;)s.push(a=h[l-1]),s.area+=a.area,"squarify"!==g||(o=r(s,v))<=p?(h.pop(),p=o):(s.area-=s.pop().area,u(s,v,c,!1),v=Math.min(c.dx,c.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,c,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,a=f(t),o=r.slice(),l=[];for(n(o,a.dx*a.dy/t.value),l.area=0;i=o.pop();)l.push(i),l.area+=i.area,null!=i.z&&(u(l,i.z?a.dx:a.dy,a,!o.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,a=-1,o=n.length;++a<o;)(e=n[a].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,a=n.length,o=e.x,c=e.y,s=t?l(n.area/t):0;
+if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<a;)u=n[i],u.x=o,u.y=c,u.dy=s,o+=u.dx=Math.min(e.x+e.dx-o,s?l(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-o,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<a;)u=n[i],u.x=o,u.y=c,u.dx=s,c+=u.dy=Math.min(e.y+e.dy-c,s?l(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-c,e.x+=s,e.dx-=s}}function i(r){var u=a||o(r),i=u[0];return i.x=i.y=0,i.value?(i.dx=c[0],i.dy=c[1]):i.dx=i.dy=0,a&&o.revalue(i),n([i],i.dx*i.dy/i.value),(a?e:t)(i),h&&(a=u),u}var a,o=oa.layout.hierarchy(),l=Math.round,c=[1,1],s=null,f=Ou,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(c=n,i):c},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Ou(t):Iu(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Iu(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Ou:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(l=n?Math.round:Number,i):l!=Number},i.sticky=function(n){return arguments.length?(h=n,a=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},uu(i,o)},oa.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=oa.random.normal.apply(oa,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=oa.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},oa.scale={};var wl={floor:y,ceil:y};oa.scale.linear=function(){return Wu([0,1],[0,1],Mr,!1)};var Sl={s:1,g:1,p:1,r:1,e:1};oa.scale.log=function(){return ri(oa.scale.linear().domain([0,1]),10,!0,[1,10])};var kl=oa.format(".0e"),Nl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};oa.scale.pow=function(){return ui(oa.scale.linear(),1,[0,1])},oa.scale.sqrt=function(){return oa.scale.pow().exponent(.5)},oa.scale.ordinal=function(){return ai([],{t:"range",a:[[]]})},oa.scale.category10=function(){return oa.scale.ordinal().range(El)},oa.scale.category20=function(){return oa.scale.ordinal().range(Al)},oa.scale.category20b=function(){return oa.scale.ordinal().range(Cl)},oa.scale.category20c=function(){return oa.scale.ordinal().range(zl)};var El=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Al=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),Cl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),zl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);oa.scale.quantile=function(){return oi([],[])},oa.scale.quantize=function(){return li(0,1,[0,1])},oa.scale.threshold=function(){return ci([.5],[0,1])},oa.scale.identity=function(){return si([0,1])},oa.svg={},oa.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),s=a.apply(this,arguments)-Ha,f=o.apply(this,arguments)-Ha,h=Math.abs(f-s),g=s>f?0:1;if(n>c&&(p=c,c=n,n=p),h>=Fa)return t(c,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,N=0,E=0,A=[];if((m=(+l.apply(this,arguments)||0)/2)&&(d=i===Ll?Math.sqrt(n*n+c*c):+i.apply(this,arguments),g||(E*=-1),c&&(E=tn(d/c*Math.sin(m))),n&&(N=tn(d/n*Math.sin(m)))),c){y=c*Math.cos(s+E),M=c*Math.sin(s+E),x=c*Math.cos(f-E),b=c*Math.sin(f-E);var C=Math.abs(f-s-2*E)<=ja?0:1;if(E&&mi(y,M,x,b)===g^C){var z=(s+f)/2;y=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-N),w=n*Math.sin(f-N),S=n*Math.cos(s+N),k=n*Math.sin(s+N);var L=Math.abs(s-f+2*N)<=ja?0:1;if(N&&mi(_,w,S,k)===1-g^L){var q=(s+f)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Da&&(p=Math.min(Math.abs(c-n)/2,+u.apply(this,arguments)))>.001){v=c>n^g?0:1;var T=p,R=p;if(ja>h){var D=null==S?[_,w]:null==x?[y,M]:Re([y,M],[S,k],[x,b],[_,w]),P=y-D[0],j=M-D[1],U=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*U+j*F)/(Math.sqrt(P*P+j*j)*Math.sqrt(U*U+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(p,(n-O)/(H-1)),T=Math.min(p,(c-O)/(H+1))}if(null!=x){var I=yi(null==S?[_,w]:[S,k],[y,M],c,T,g),Y=yi([x,b],[_,w],c,T,g);p===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-g^mi(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",g," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",y,",",M);if(null!=S){var Z=yi([y,M],[S,k],n,-R,g),V=yi([_,w],null==x?[y,M]:[x,b],n,-R,g);p===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^mi(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",y,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",g," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-g," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hi,r=gi,u=fi,i=Ll,a=pi,o=vi,l=di;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=En(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==Ll?Ll:En(t),n):i},n.startAngle=function(t){return arguments.length?(a=En(t),n):a},n.endAngle=function(t){return arguments.length?(o=En(t),n):o},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+a.apply(this,arguments)+ +o.apply(this,arguments))/2-Ha;return[Math.cos(t)*n,Math.sin(t)*n]},n};var Ll="auto";oa.svg.line=function(){return Mi(y)};var ql=oa.map({linear:xi,"linear-closed":bi,step:_i,"step-before":wi,"step-after":Si,basis:zi,"basis-open":Li,"basis-closed":qi,bundle:Ti,cardinal:Ei,"cardinal-open":ki,"cardinal-closed":Ni,monotone:Fi});ql.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Tl=[0,2/3,1/3,0],Rl=[0,1/3,2/3,0],Dl=[0,1/6,2/3,1/6];oa.svg.line.radial=function(){var n=Mi(Hi);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wi.reverse=Si,Si.reverse=wi,oa.svg.area=function(){return Oi(y)},oa.svg.area.radial=function(){var n=Oi(Hi);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},oa.svg.chord=function(){function n(n,o){var l=t(this,i,n,o),c=t(this,a,n,o);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?u(l.r,l.p1,l.r,l.p0):u(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+u(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=o.call(n,u,r),a=l.call(n,u,r)-Ha,s=c.call(n,u,r)-Ha;return{r:i,a0:a,a1:s,p0:[i*Math.cos(a),i*Math.sin(a)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>ja)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=Me,a=xe,o=Ii,l=pi,c=vi;return n.radius=function(t){return arguments.length?(o=En(t),n):o},n.source=function(t){return arguments.length?(i=En(t),n):i},n.target=function(t){return arguments.length?(a=En(t),n):a},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},oa.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),a=e.call(this,n,u),o=(i.y+a.y)/2,l=[i,{x:i.x,y:o},{x:a.x,y:o},a];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yi;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},oa.svg.diagonal.radial=function(){var n=oa.svg.diagonal(),t=Yi,e=n.projection;return n.projection=function(n){return arguments.length?e(Zi(t=n)):t},n},oa.svg.symbol=function(){function n(n,r){return(Pl.get(t.call(this,n,r))||$i)(e.call(this,n,r))}var t=Xi,e=Vi;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Pl=oa.map({circle:$i,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Ul)),e=t*Ul;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});oa.svg.symbolTypes=Pl.keys();var jl=Math.sqrt(3),Ul=Math.tan(30*Oa);Aa.transition=function(n){for(var t,e,r=Fl||++Yl,u=Ki(n),i=[],a=Hl||{time:Date.now(),ease:Nr,delay:0,duration:250},o=-1,l=this.length;++o<l;){i.push(t=[]);for(var c=this[o],s=-1,f=c.length;++s<f;)(e=c[s])&&Qi(e,s,u,r,a),t.push(e)}return Wi(i,u,r)},Aa.interrupt=function(n){return this.each(null==n?Ol:Bi(Ki(n)))};var Fl,Hl,Ol=Bi(Ki()),Il=[],Yl=0;Il.call=Aa.call,Il.empty=Aa.empty,Il.node=Aa.node,Il.size=Aa.size,oa.transition=function(n,t){return n&&n.transition?Fl?n.transition(t):n:oa.selection().transition(n)},oa.transition.prototype=Il,Il.select=function(n){var t,e,r,u=this.id,i=this.namespace,a=[];n=A(n);for(var o=-1,l=this.length;++o<l;){a.push(t=[]);for(var c=this[o],s=-1,f=c.length;++s<f;)(r=c[s])&&(e=n.call(r,r.__data__,s,o))?("__data__"in r&&(e.__data__=r.__data__),Qi(e,s,i,u,r[i][u]),t.push(e)):t.push(null)}return Wi(a,i,u)},Il.selectAll=function(n){var t,e,r,u,i,a=this.id,o=this.namespace,l=[];n=C(n);for(var c=-1,s=this.length;++c<s;)for(var f=this[c],h=-1,g=f.length;++h<g;)if(r=f[h]){i=r[o][a],e=n.call(r,r.__data__,h,c),l.push(t=[]);for(var p=-1,v=e.length;++p<v;)(u=e[p])&&Qi(u,p,o,a,i),t.push(u)}return Wi(l,o,a)},Il.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,a=this.length;a>i;i++){u.push(t=[]);for(var e=this[i],o=0,l=e.length;l>o;o++)(r=e[o])&&n.call(r,r.__data__,o,i)&&t.push(r)}return Wi(u,this.namespace,this.id)},Il.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Il.attr=function(n,t){function e(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(o);return e!==n&&(t=a(e,n),function(n){this.setAttribute(o,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(o.space,o.local);return e!==n&&(t=a(e,n),function(n){this.setAttributeNS(o.space,o.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var a="transform"==n?$r:Mr,o=oa.ns.qualify(n);return Ji(this,"attr."+n,t,o.local?i:u)},Il.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=oa.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Il.style=function(n,e,r){function u(){this.style.removeProperty(n)}function i(e){return null==e?u:(e+="",function(){var u,i=t(this).getComputedStyle(this,null).getPropertyValue(n);return i!==e&&(u=Mr(i,e),function(t){this.style.setProperty(n,u(t),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof n){2>a&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ji(this,"style."+n,e,i)},Il.styleTween=function(n,e,r){function u(u,i){var a=e.call(this,u,i,t(this).getComputedStyle(this,null).getPropertyValue(n));return a&&function(t){this.style.setProperty(n,a(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,u)},Il.text=function(n){return Ji(this,"text",n,Gi)},Il.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Il.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=oa.ease.apply(oa,arguments)),Y(this,function(r){r[e][t].ease=n}))},Il.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Il.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Il.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Hl,i=Fl;try{Fl=e,Y(this,function(t,u,i){Hl=t[r][e],n.call(t,t.__data__,u,i)})}finally{Hl=u,Fl=i}}else Y(this,function(u){var i=u[r][e];(i.event||(i.event=oa.dispatch("start","end","interrupt"))).on(n,t)});return this},Il.transition=function(){for(var n,t,e,r,u=this.id,i=++Yl,a=this.namespace,o=[],l=0,c=this.length;c>l;l++){o.push(n=[]);for(var t=this[l],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[a][u],Qi(e,s,a,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wi(o,a,i)},oa.svg.axis=function(){function n(n){n.each(function(){var n,c=oa.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==l?f.ticks?f.ticks.apply(f,o):f.domain():l,g=null==t?f.tickFormat?f.tickFormat.apply(f,o):y:t,p=c.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Da),d=oa.transition(p.exit()).style("opacity",Da).remove(),m=oa.transition(p.order()).style("opacity",1),M=Math.max(u,0)+a,x=Zu(f),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),oa.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=m.select("line"),C=p.select("text").text(g),z=v.select("text"),L=m.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=na,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*i+"V0H"+x[1]+"V"+q*i)):(n=ta,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*i+","+x[0]+"H0V"+x[1]+"H"+q*i)),E.attr(N,q*u),z.attr(k,q*M),A.attr(S,0).attr(N,q*u),L.attr(w,0).attr(k,q*M),f.rangeBand){var T=f,R=T.rangeBand()/2;s=f=function(n){return T(n)+R}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=oa.scale.linear(),r=Zl,u=6,i=6,a=3,o=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Vl?t+"":Zl,n):r},n.ticks=function(){return arguments.length?(o=ca(arguments),n):o},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(a=+t,n):a},n.tickSubdivide=function(){return arguments.length&&n},n};var Zl="bottom",Vl={top:1,right:1,bottom:1,left:1};oa.svg.brush=function(){function n(t){t.each(function(){var t=oa.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),a=t.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=t.selectAll(".resize").data(v,y);o.exit().remove(),o.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Xl[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",n.empty()?"none":null);var l,f=oa.transition(t),h=oa.transition(a);c&&(l=Zu(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(f)),s&&(l=Zu(s),h.attr("y",l[0]).attr("height",l[1]-l[0]),u(f)),e(f)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function u(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==oa.event.keyCode&&(C||(M=null,L[0]-=f[1],L[1]-=h[1],C=2),S())}function v(){32==oa.event.keyCode&&2==C&&(L[0]+=f[1],L[1]+=h[1],C=0,S())}function d(){var n=oa.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(oa.event.altKey?(M||(M=[(f[0]+f[1])/2,(h[0]+h[1])/2]),L[0]=f[+(n[0]<M[0])],L[1]=h[+(n[1]<M[1])]):M=null),E&&m(n,c,0)&&(r(k),t=!0),A&&m(n,s,1)&&(u(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function m(n,t,e){var r,u,i=Zu(t),l=i[0],c=i[1],s=L[e],v=e?h:f,d=v[1]-v[0];return C&&(l-=s,c-=d+s),r=(e?p:g)?Math.max(l,Math.min(c,n[e])):n[e],C?u=(r+=s)+d:(M&&(s=Math.max(l,Math.min(c,2*M[e]-r))),r>s?(u=r,r=s):u=s),v[0]!=r||v[1]!=u?(e?o=null:a=null,v[0]=r,v[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),oa.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=oa.select(oa.event.target),w=l.of(b,arguments),k=oa.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&s,C=_.classed("extent"),z=W(b),L=oa.mouse(b),q=oa.select(t(b)).on("keydown.brush",i).on("keyup.brush",v);if(oa.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",y):q.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)L[0]=f[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[f[1-T]-L[0],h[1-R]-L[1]],L[0]=f[T],L[1]=h[R]}else oa.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),oa.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var a,o,l=N(n,"brushstart","brush","brushend"),c=null,s=null,f=[0,0],h=[0,0],g=!0,p=!0,v=$l[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:f,y:h,i:a,j:o},e=this.__chart__||t;this.__chart__=t,Fl?oa.select(this).transition().each("start.brush",function(){a=e.i,o=e.j,f=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(f,t.x),r=xr(h,t.y);return a=o=null,function(u){f=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=$l[!c<<1|!s],n):c},n.y=function(t){return arguments.length?(s=t,v=$l[!c<<1|!s],n):s},n.clamp=function(t){return arguments.length?(c&&s?(g=!!t[0],p=!!t[1]):c?g=!!t:s&&(p=!!t),n):c&&s?[g,p]:c?g:s?p:null},n.extent=function(t){var e,r,u,i,l;return arguments.length?(c&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),a=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),(e!=f[0]||r!=f[1])&&(f=[e,r])),s&&(u=t[0],i=t[1],c&&(u=u[1],i=i[1]),o=[u,i],s.invert&&(u=s(u),i=s(i)),u>i&&(l=u,u=i,i=l),(u!=h[0]||i!=h[1])&&(h=[u,i])),n):(c&&(a?(e=a[0],r=a[1]):(e=f[0],r=f[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),s&&(o?(u=o[0],i=o[1]):(u=h[0],i=h[1],s.invert&&(u=s.invert(u),i=s.invert(i)),u>i&&(l=u,u=i,i=l))),c&&s?[[e,u],[r,i]]:c?[e,r]:s&&[u,i])},n.clear=function(){return n.empty()||(f=[0,0],h=[0,0],a=o=null),n},n.empty=function(){return!!c&&f[0]==f[1]||!!s&&h[0]==h[1]},oa.rebind(n,l,"on")};var Xl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},$l=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Bl=ho.format=Mo.timeFormat,Wl=Bl.utc,Jl=Wl("%Y-%m-%dT%H:%M:%S.%LZ");Bl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?ea:Jl,ea.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},ea.toString=Jl.toString,ho.second=On(function(n){return new go(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ho.seconds=ho.second.range,ho.seconds.utc=ho.second.utc.range,ho.minute=On(function(n){return new go(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ho.minutes=ho.minute.range,ho.minutes.utc=ho.minute.utc.range,ho.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new go(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ho.hours=ho.hour.range,ho.hours.utc=ho.hour.utc.range,ho.month=On(function(n){return n=ho.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ho.months=ho.month.range,ho.months.utc=ho.month.utc.range;var Gl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Kl=[[ho.second,1],[ho.second,5],[ho.second,15],[ho.second,30],[ho.minute,1],[ho.minute,5],[ho.minute,15],[ho.minute,30],[ho.hour,1],[ho.hour,3],[ho.hour,6],[ho.hour,12],[ho.day,1],[ho.day,2],[ho.week,1],[ho.month,1],[ho.month,3],[ho.year,1]],Ql=Bl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),nc={range:function(n,t,e){return oa.range(Math.ceil(n/e)*e,+t,e).map(ua)},floor:y,ceil:y};Kl.year=ho.year,ho.scale=function(){return ra(oa.scale.linear(),Kl,Ql)};var tc=Kl.map(function(n){return[n[0].utc,n[1]]}),ec=Wl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);tc.year=ho.year.utc,ho.scale.utc=function(){return ra(oa.scale.linear(),tc,ec)},oa.text=An(function(n){return n.responseText}),oa.json=function(n,t){return Cn(n,"application/json",ia,t)},oa.html=function(n,t){return Cn(n,"text/html",aa,t)},oa.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=oa,define(oa)):"object"==typeof module&&module.exports?module.exports=oa:this.d3=oa}(); \ No newline at end of file
diff --git a/html/js/jquery.min.js b/html/js/jquery.min.js
new file mode 100644
index 0000000..6c60672
--- /dev/null
+++ b/html/js/jquery.min.js
@@ -0,0 +1,5 @@
+/*! jQuery v1.12.0 | (c) jQuery Foundation | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=a.document,e=c.slice,f=c.concat,g=c.push,h=c.indexOf,i={},j=i.toString,k=i.hasOwnProperty,l={},m="1.12.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return e.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:e.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a){return n.each(this,a)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(e.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor()},push:g,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){var b=a&&a.toString();return!n.isArray(a)&&b-parseFloat(b)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!k.call(a,"constructor")&&!k.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(!l.ownFirst)for(b in a)return k.call(a,b);for(b in a);return void 0===b||k.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?i[j.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b){var c,d=0;if(s(a)){for(c=a.length;c>d;d++)if(b.call(a[d],d,a[d])===!1)break}else for(d in a)if(b.call(a[d],d,a[d])===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):g.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(h)return h.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,e,g=0,h=[];if(s(a))for(d=a.length;d>g;g++)e=b(a[g],g,c),null!=e&&h.push(e);else for(g in a)e=b(a[g],g,c),null!=e&&h.push(e);return f.apply([],h)},guid:1,proxy:function(a,b){var c,d,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=e.call(arguments,2),d=function(){return a.apply(b||this,c.concat(e.call(arguments)))},d.guid=a.guid=a.guid||n.guid++,d):void 0},now:function(){return+new Date},support:l}),"function"==typeof Symbol&&(n.fn[Symbol.iterator]=c[Symbol.iterator]),n.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(a,b){i["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=!!a&&"length"in a&&a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ga(),z=ga(),A=ga(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+M+"))|)"+L+"*\\]",O=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+N+")*)|.*)\\)|)",P=new RegExp(L+"+","g"),Q=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),R=new RegExp("^"+L+"*,"+L+"*"),S=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),T=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),U=new RegExp(O),V=new RegExp("^"+M+"$"),W={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},X=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,$=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,_=/[+~]/,aa=/'|\\/g,ba=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),ca=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},da=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(ea){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fa(a,b,d,e){var f,h,j,k,l,o,r,s,w=b&&b.ownerDocument,x=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==x&&9!==x&&11!==x)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==x&&(o=$.exec(a)))if(f=o[1]){if(9===x){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(w&&(j=w.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(o[2])return H.apply(d,b.getElementsByTagName(a)),d;if((f=o[3])&&c.getElementsByClassName&&b.getElementsByClassName)return H.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==x)w=b,s=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(aa,"\\$&"):b.setAttribute("id",k=u),r=g(a),h=r.length,l=V.test(k)?"#"+k:"[id='"+k+"']";while(h--)r[h]=l+" "+qa(r[h]);s=r.join(","),w=_.test(a)&&oa(b.parentNode)||b}if(s)try{return H.apply(d,w.querySelectorAll(s)),d}catch(y){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(Q,"$1"),b,d,e)}function ga(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ha(a){return a[u]=!0,a}function ia(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ja(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function ka(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function la(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function na(a){return ha(function(b){return b=+b,ha(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function oa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=fa.support={},f=fa.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fa.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ia(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ia(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Z.test(n.getElementsByClassName),c.getById=ia(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ba,ca);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return"undefined"!=typeof b.getElementsByClassName&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=Z.test(n.querySelectorAll))&&(ia(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\r\\' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ia(function(a){var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Z.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ia(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",O)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Z.test(o.compareDocumentPosition),t=b||Z.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return ka(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?ka(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},fa.matches=function(a,b){return fa(a,null,null,b)},fa.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(T,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fa(b,n,null,[a]).length>0},fa.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fa.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fa.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fa.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fa.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fa.selectors={cacheLength:50,createPseudo:ha,match:W,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ba,ca),a[3]=(a[3]||a[4]||a[5]||"").replace(ba,ca),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fa.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fa.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return W.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&U.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ba,ca).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fa.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(P," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fa.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ha(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ha(function(a){var b=[],c=[],d=h(a.replace(Q,"$1"));return d[u]?ha(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ha(function(a){return function(b){return fa(a,b).length>0}}),contains:ha(function(a){return a=a.replace(ba,ca),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ha(function(a){return V.test(a||"")||fa.error("unsupported lang: "+a),a=a.replace(ba,ca).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Y.test(a.nodeName)},input:function(a){return X.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:na(function(){return[0]}),last:na(function(a,b){return[b-1]}),eq:na(function(a,b,c){return[0>c?c+b:c]}),even:na(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:na(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:na(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:na(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=la(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=ma(b);function pa(){}pa.prototype=d.filters=d.pseudos,d.setFilters=new pa,g=fa.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=R.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=S.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(Q," ")}),h=h.slice(c.length));for(g in d.filter)!(e=W[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fa.error(a):z(a,i).slice(0)};function qa(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function ra(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j,k=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(j=b[u]||(b[u]={}),i=j[b.uniqueID]||(j[b.uniqueID]={}),(h=i[d])&&h[0]===w&&h[1]===f)return k[2]=h[2];if(i[d]=k,k[2]=a(b,c,g))return!0}}}function sa(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ta(a,b,c){for(var d=0,e=b.length;e>d;d++)fa(a,b[d],c);return c}function ua(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function va(a,b,c,d,e,f){return d&&!d[u]&&(d=va(d)),e&&!e[u]&&(e=va(e,f)),ha(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ta(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ua(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ua(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ua(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function wa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ra(function(a){return a===b},h,!0),l=ra(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[ra(sa(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return va(i>1&&sa(m),i>1&&qa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(Q,"$1"),c,e>i&&wa(a.slice(i,e)),f>e&&wa(a=a.slice(e)),f>e&&qa(a))}m.push(c)}return sa(m)}function xa(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=F.call(i));u=ua(u)}H.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&fa.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ha(f):f}return h=fa.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xa(e,d)),f.selector=a}return f},i=fa.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ba,ca),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=W.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ba,ca),_.test(j[0].type)&&oa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qa(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||_.test(a)&&oa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ia(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ia(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ja("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ia(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ja("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ia(function(a){return null==a.getAttribute("disabled")})||ja(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fa}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.uniqueSort=n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},v=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},w=n.expr.match.needsContext,x=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,y=/^.[^:#\[\.,]*$/;function z(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(y.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>-1!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(z(this,a||[],!1))},not:function(a){return this.pushStack(z(this,a||[],!0))},is:function(a){return!!z(this,"string"==typeof a&&w.test(a)?n(a):a||[],!1).length}});var A,B=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=n.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||A,"string"==typeof a){if(e="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:B.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),x.test(e[1])&&n.isPlainObject(b))for(e in b)n.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}if(f=d.getElementById(e[2]),f&&f.parentNode){if(f.id!==e[2])return A.find(a);this.length=1,this[0]=f}return this.context=d,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof c.ready?c.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};C.prototype=n.fn,A=n(d);var D=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=w.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.uniqueSort(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function F(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return u(a,"parentNode")},parentsUntil:function(a,b,c){return u(a,"parentNode",c)},next:function(a){return F(a,"nextSibling")},prev:function(a){return F(a,"previousSibling")},nextAll:function(a){return u(a,"nextSibling")},prevAll:function(a){return u(a,"previousSibling")},nextUntil:function(a,b,c){return u(a,"nextSibling",c)},prevUntil:function(a,b,c){return u(a,"previousSibling",c)},siblings:function(a){return v((a.parentNode||{}).firstChild,a)},children:function(a){return v(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(E[a]||(e=n.uniqueSort(e)),D.test(a)&&(e=e.reverse())),this.pushStack(e)}});var G=/\S+/g;function H(a){var b={};return n.each(a.match(G)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?H(a):n.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h<f.length)f[h].apply(c[0],c[1])===!1&&a.stopOnFalse&&(h=f.length,c=!1)}a.memory||(c=!1),b=!1,e&&(f=c?[]:"")},j={add:function(){return f&&(c&&!b&&(h=f.length-1,g.push(c)),function d(b){n.each(b,function(b,c){n.isFunction(c)?a.unique&&j.has(c)||f.push(c):c&&c.length&&"string"!==n.type(c)&&d(c)})}(arguments),c&&!b&&i()),this},remove:function(){return n.each(arguments,function(a,b){var c;while((c=n.inArray(b,f,c))>-1)f.splice(c,1),h>=c&&h--}),this},has:function(a){return a?n.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=!0,c||j.disable(),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().progress(c.notify).done(c.resolve).fail(c.reject):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=e.call(arguments),d=c.length,f=1!==d||a&&n.isFunction(a.promise)?d:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?e.call(arguments):d,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(d>1)for(i=new Array(d),j=new Array(d),k=new Array(d);d>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().progress(h(b,j,i)).done(h(b,k,c)).fail(g.reject):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(d,[n]),n.fn.triggerHandler&&(n(d).triggerHandler("ready"),n(d).off("ready"))))}});function J(){d.addEventListener?(d.removeEventListener("DOMContentLoaded",K),a.removeEventListener("load",K)):(d.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(d.addEventListener||"load"===a.event.type||"complete"===d.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===d.readyState)a.setTimeout(n.ready);else if(d.addEventListener)d.addEventListener("DOMContentLoaded",K),a.addEventListener("load",K);else{d.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&d.documentElement}catch(e){}c&&c.doScroll&&!function f(){if(!n.isReady){try{c.doScroll("left")}catch(b){return a.setTimeout(f,50)}J(),n.ready()}}()}return I.promise(b)},n.ready.promise();var L;for(L in n(l))break;l.ownFirst="0"===L,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c,e;c=d.getElementsByTagName("body")[0],c&&c.style&&(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",l.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(e))}),function(){var a=d.createElement("div");l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}a=null}();var M=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b},N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
+return!0}function R(a,b,d,e){if(M(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f}}function S(a,b,c){if(M(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}}),function(){var a;l.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,e;return c=d.getElementsByTagName("body")[0],c&&c.style?(b=d.createElement("div"),e=d.createElement("div"),e.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(e).appendChild(b),"undefined"!=typeof b.style.zoom&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(d.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(e),a):void 0}}();var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),V=["Top","Right","Bottom","Left"],W=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)};function X(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return n.css(a,b,"")},i=h(),j=c&&c[3]||(n.cssNumber[b]?"":"px"),k=(n.cssNumber[b]||"px"!==j&&+i)&&U.exec(n.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,n.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}var Y=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)Y(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},Z=/^(?:checkbox|radio)$/i,$=/<([\w:-]+)/,_=/^$|\/(?:java|ecma)script/i,aa=/^\s+/,ba="abbr|article|aside|audio|bdi|canvas|data|datalist|details|dialog|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|picture|progress|section|summary|template|time|video";function ca(a){var b=ba.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}!function(){var a=d.createElement("div"),b=d.createDocumentFragment(),c=d.createElement("input");a.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",l.leadingWhitespace=3===a.firstChild.nodeType,l.tbody=!a.getElementsByTagName("tbody").length,l.htmlSerialize=!!a.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==d.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,b.appendChild(c),l.appendChecked=c.checked,a.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!a.cloneNode(!0).lastChild.defaultValue,b.appendChild(a),c=d.createElement("input"),c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),a.appendChild(c),l.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!!a.addEventListener,a[n.expando]=1,l.attributes=!a.getAttribute(n.expando)}();var da={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;function ea(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,ea(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function fa(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}var ga=/<|&#?\w+;/,ha=/<tbody/i;function ia(a){Z.test(a.type)&&(a.defaultChecked=a.checked)}function ja(a,b,c,d,e){for(var f,g,h,i,j,k,m,o=a.length,p=ca(b),q=[],r=0;o>r;r++)if(g=a[r],g||0===g)if("object"===n.type(g))n.merge(q,g.nodeType?[g]:g);else if(ga.test(g)){i=i||p.appendChild(b.createElement("div")),j=($.exec(g)||["",""])[1].toLowerCase(),m=da[j]||da._default,i.innerHTML=m[1]+n.htmlPrefilter(g)+m[2],f=m[0];while(f--)i=i.lastChild;if(!l.leadingWhitespace&&aa.test(g)&&q.push(b.createTextNode(aa.exec(g)[0])),!l.tbody){g="table"!==j||ha.test(g)?"<table>"!==m[1]||ha.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;while(f--)n.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k)}n.merge(q,i.childNodes),i.textContent="";while(i.firstChild)i.removeChild(i.firstChild);i=p.lastChild}else q.push(b.createTextNode(g));i&&p.removeChild(i),l.appendChecked||n.grep(ea(q,"input"),ia),r=0;while(g=q[r++])if(d&&n.inArray(g,d)>-1)e&&e.push(g);else if(h=n.contains(g.ownerDocument,g),i=ea(p.appendChild(g),"script"),h&&fa(i),c){f=0;while(g=i[f++])_.test(g.type||"")&&c.push(g)}return i=null,p}!function(){var b,c,e=d.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b]=c in a)||(e.setAttribute(c,"t"),l[b]=e.attributes[c].expando===!1);e=null}();var ka=/^(?:input|select|textarea)$/i,la=/^key/,ma=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,na=/^(?:focusinfocus|focusoutblur)$/,oa=/^([^.]*)(?:\.(.+)|)/;function pa(){return!0}function qa(){return!1}function ra(){try{return d.activeElement}catch(a){}}function sa(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)sa(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=qa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return n().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=n.guid++)),a.each(function(){n.event.add(this,b,e,d,c)})}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return"undefined"==typeof n||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(G)||[""],h=b.length;while(h--)f=oa.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(G)||[""],j=b.length;while(j--)if(h=oa.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,e,f){var g,h,i,j,l,m,o,p=[e||d],q=k.call(b,"type")?b.type:b,r=k.call(b,"namespace")?b.namespace.split("."):[];if(i=m=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!na.test(q+n.event.triggered)&&(q.indexOf(".")>-1&&(r=q.split("."),q=r.shift(),r.sort()),h=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=r.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:n.makeArray(c,[b]),l=n.event.special[q]||{},f||!l.trigger||l.trigger.apply(e,c)!==!1)){if(!f&&!l.noBubble&&!n.isWindow(e)){for(j=l.delegateType||q,na.test(j+q)||(i=i.parentNode);i;i=i.parentNode)p.push(i),m=i;m===(e.ownerDocument||d)&&p.push(m.defaultView||m.parentWindow||a)}o=0;while((i=p[o++])&&!b.isPropagationStopped())b.type=o>1?j:l.bindType||q,g=(n._data(i,"events")||{})[b.type]&&n._data(i,"handle"),g&&g.apply(i,c),g=h&&i[h],g&&g.apply&&M(i)&&(b.result=g.apply(i,c),b.result===!1&&b.preventDefault());if(b.type=q,!f&&!b.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),c)===!1)&&M(e)&&h&&e[q]&&!n.isWindow(e)){m=e[h],m&&(e[h]=null),n.event.triggered=q;try{e[q]()}catch(s){}n.event.triggered=void 0,m&&(e[h]=m)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,d,f,g,h=[],i=e.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.rnamespace||a.rnamespace.test(g.namespace))&&(a.handleObj=g,a.data=g.data,d=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==d&&(a.result=d)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&("click"!==a.type||isNaN(a.button)||a.button<1))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>-1:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,e,f=a.type,g=a,h=this.fixHooks[f];h||(this.fixHooks[f]=h=ma.test(f)?this.mouseHooks:la.test(f)?this.keyHooks:{}),e=h.props?this.props.concat(h.props):this.props,a=new n.Event(g),b=e.length;while(b--)c=e[b],a[c]=g[c];return a.target||(a.target=g.srcElement||d),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,h.filter?h.filter(a,g):a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,e,f,g=b.button,h=b.fromElement;return null==a.pageX&&null!=b.clientX&&(e=a.target.ownerDocument||d,f=e.documentElement,c=e.body,a.pageX=b.clientX+(f&&f.scrollLeft||c&&c.scrollLeft||0)-(f&&f.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(f&&f.scrollTop||c&&c.scrollTop||0)-(f&&f.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&h&&(a.relatedTarget=h===a.target?b.toElement:h),a.which||void 0===g||(a.which=1&g?1:2&g?3:4&g?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ra()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ra()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c){var d=n.extend(new n.Event,c,{type:a,isSimulated:!0});n.event.trigger(d,null,b),d.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=d.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c)}:function(a,b,c){var d="on"+b;a.detachEvent&&("undefined"==typeof a[d]&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?pa:qa):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={constructor:n.Event,isDefaultPrevented:qa,isPropagationStopped:qa,isImmediatePropagationStopped:qa,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=pa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=pa,a&&!this.isSimulated&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=pa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submit||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?n.prop(b,"form"):void 0;c&&!n._data(c,"submit")&&(n.event.add(c,"submit._submit",function(a){a._submitBubble=!0}),n._data(c,"submit",!0))})},postDispatch:function(a){a._submitBubble&&(delete a._submitBubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.change||(n.event.special.change={setup:function(){return ka.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._justChanged=!0)}),n.event.add(this,"click._change",function(a){this._justChanged&&!a.isTrigger&&(this._justChanged=!1),n.event.simulate("change",this,a)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;ka.test(b.nodeName)&&!n._data(b,"change")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a)}),n._data(b,"change",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!ka.test(this.nodeName)}}),l.focusin||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a))};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d){return sa(this,a,b,c,d)},one:function(a,b,c,d){return sa(this,a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=qa),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ta=/ jQuery\d+="(?:null|\d+)"/g,ua=new RegExp("<(?:"+ba+")[\\s/>]","i"),va=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,wa=/<script|<style|<link/i,xa=/checked\s*(?:[^=]|=\s*.checked.)/i,ya=/^true\/(.*)/,za=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Aa=ca(d),Ba=Aa.appendChild(d.createElement("div"));function Ca(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function Da(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function Ea(a){var b=ya.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Fa(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Ga(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(Da(b).text=a.text,Ea(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Z.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function Ha(a,b,c,d){b=f.apply([],b);var e,g,h,i,j,k,m=0,o=a.length,p=o-1,q=b[0],r=n.isFunction(q);if(r||o>1&&"string"==typeof q&&!l.checkClone&&xa.test(q))return a.each(function(e){var f=a.eq(e);r&&(b[0]=q.call(this,e,f.html())),Ha(f,b,c,d)});if(o&&(k=ja(b,a[0].ownerDocument,!1,a,d),e=k.firstChild,1===k.childNodes.length&&(k=e),e||d)){for(i=n.map(ea(k,"script"),Da),h=i.length;o>m;m++)g=k,m!==p&&(g=n.clone(g,!0,!0),h&&n.merge(i,ea(g,"script"))),c.call(a[m],g,m);if(h)for(j=i[i.length-1].ownerDocument,n.map(i,Ea),m=0;h>m;m++)g=i[m],_.test(g.type||"")&&!n._data(g,"globalEval")&&n.contains(j,g)&&(g.src?n._evalUrl&&n._evalUrl(g.src):n.globalEval((g.text||g.textContent||g.innerHTML||"").replace(za,"")));k=e=null}return a}function Ia(a,b,c){for(var d,e=b?n.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||n.cleanData(ea(d)),d.parentNode&&(c&&n.contains(d.ownerDocument,d)&&fa(ea(d,"script")),d.parentNode.removeChild(d));return a}n.extend({htmlPrefilter:function(a){return a.replace(va,"<$1></$2>")},clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!ua.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(Ba.innerHTML=a.outerHTML,Ba.removeChild(f=Ba.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=ea(f),h=ea(a),g=0;null!=(e=h[g]);++g)d[g]&&Ga(e,d[g]);if(b)if(c)for(h=h||ea(a),d=d||ea(f),g=0;null!=(e=h[g]);g++)Fa(e,d[g]);else Fa(a,f);return d=ea(f,"script"),d.length>0&&fa(d,!i&&ea(a,"script")),d=h=e=null,f},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.attributes,m=n.event.special;null!=(d=a[h]);h++)if((b||M(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k||"undefined"==typeof d.removeAttribute?d[i]=void 0:d.removeAttribute(i),c.push(f))}}}),n.fn.extend({domManip:Ha,detach:function(a){return Ia(this,a,!0)},remove:function(a){return Ia(this,a)},text:function(a){return Y(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||d).createTextNode(a))},null,a,arguments.length)},append:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.appendChild(a)}})},prepend:function(){return Ha(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ca(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ha(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(ea(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return Y(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(ta,""):void 0;if("string"==typeof a&&!wa.test(a)&&(l.htmlSerialize||!ua.test(a))&&(l.leadingWhitespace||!aa.test(a))&&!da[($.exec(a)||["",""])[1].toLowerCase()]){a=n.htmlPrefilter(a);try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ea(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=[];return Ha(this,arguments,function(b){var c=this.parentNode;n.inArray(this,a)<0&&(n.cleanData(ea(this)),c&&c.replaceChild(b,this))},a)}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],f=n(a),h=f.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(f[d])[b](c),g.apply(e,c.get());return this.pushStack(e)}});var Ja,Ka={HTML:"block",BODY:"block"};function La(a,b){var c=n(b.createElement(a)).appendTo(b.body),d=n.css(c[0],"display");return c.detach(),d}function Ma(a){var b=d,c=Ka[a];return c||(c=La(a,b),"none"!==c&&c||(Ja=(Ja||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ja[0].contentWindow||Ja[0].contentDocument).document,b.write(),b.close(),c=La(a,b),Ja.detach()),Ka[a]=c),c}var Na=/^margin/,Oa=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Pa=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e},Qa=d.documentElement;!function(){var b,c,e,f,g,h,i=d.createElement("div"),j=d.createElement("div");if(j.style){j.style.cssText="float:left;opacity:.5",l.opacity="0.5"===j.style.opacity,l.cssFloat=!!j.style.cssFloat,j.style.backgroundClip="content-box",j.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===j.style.backgroundClip,i=d.createElement("div"),i.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",j.innerHTML="",i.appendChild(j),l.boxSizing=""===j.style.boxSizing||""===j.style.MozBoxSizing||""===j.style.WebkitBoxSizing,n.extend(l,{reliableHiddenOffsets:function(){return null==b&&k(),f},boxSizingReliable:function(){return null==b&&k(),e},pixelMarginRight:function(){return null==b&&k(),c},pixelPosition:function(){return null==b&&k(),b},reliableMarginRight:function(){return null==b&&k(),g},reliableMarginLeft:function(){return null==b&&k(),h}});function k(){var k,l,m=d.documentElement;m.appendChild(i),j.style.cssText="-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",b=e=h=!1,c=g=!0,a.getComputedStyle&&(l=a.getComputedStyle(j),b="1%"!==(l||{}).top,h="2px"===(l||{}).marginLeft,e="4px"===(l||{width:"4px"}).width,j.style.marginRight="50%",c="4px"===(l||{marginRight:"4px"}).marginRight,k=j.appendChild(d.createElement("div")),k.style.cssText=j.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",k.style.marginRight=k.style.width="0",j.style.width="1px",g=!parseFloat((a.getComputedStyle(k)||{}).marginRight),j.removeChild(k)),j.style.display="none",f=0===j.getClientRects().length,f&&(j.style.display="",j.innerHTML="<table><tr><td></td><td>t</td></tr></table>",k=j.getElementsByTagName("td"),k[0].style.cssText="margin:0;border:0;padding:0;display:none",f=0===k[0].offsetHeight,f&&(k[0].style.display="",k[1].style.display="none",f=0===k[0].offsetHeight)),m.removeChild(i)}}}();var Ra,Sa,Ta=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ra=function(b){var c=b.ownerDocument.defaultView;return c.opener||(c=a),c.getComputedStyle(b)},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),!l.pixelMarginRight()&&Oa.test(g)&&Na.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):Qa.currentStyle&&(Ra=function(a){return a.currentStyle},Sa=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ra(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Oa.test(g)&&!Ta.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Ua(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}var Va=/alpha\([^)]*\)/i,Wa=/opacity\s*=\s*([^)]*)/i,Xa=/^(none|table(?!-c[ea]).+)/,Ya=new RegExp("^("+T+")(.*)$","i"),Za={position:"absolute",visibility:"hidden",display:"block"},$a={letterSpacing:"0",fontWeight:"400"},_a=["Webkit","O","Moz","ms"],ab=d.createElement("div").style;function bb(a){if(a in ab)return a;var b=a.charAt(0).toUpperCase()+a.slice(1),c=_a.length;while(c--)if(a=_a[c]+b,a in ab)return a}function cb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&W(d)&&(f[g]=n._data(d,"olddisplay",Ma(d.nodeName)))):(e=W(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function db(a,b,c){var d=Ya.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function eb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+V[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+V[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+V[f]+"Width",!0,e))):(g+=n.css(a,"padding"+V[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+V[f]+"Width",!0,e)));return g}function fb(b,c,e){var f=!0,g="width"===c?b.offsetWidth:b.offsetHeight,h=Ra(b),i=l.boxSizing&&"border-box"===n.css(b,"boxSizing",!1,h);if(d.msFullscreenElement&&a.top!==a&&b.getClientRects().length&&(g=Math.round(100*b.getBoundingClientRect()[c])),0>=g||null==g){if(g=Sa(b,c,h),(0>g||null==g)&&(g=b.style[c]),Oa.test(g))return g;f=i&&(l.boxSizingReliable()||g===b.style[c]),g=parseFloat(g)||0}return g+eb(b,c,e||(i?"border":"content"),f,h)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Sa(a,"opacity");return""===c?"1":c}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=U.exec(c))&&e[1]&&(c=X(a,b,e),f="number"),null!=c&&c===c&&("number"===f&&(c+=e&&e[3]||(n.cssNumber[h]?"":"px")),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=bb(h)||h),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Sa(a,b,d)),"normal"===f&&b in $a&&(f=$a[b]),""===c||c?(e=parseFloat(f),c===!0||isFinite(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?Xa.test(n.css(a,"display"))&&0===a.offsetWidth?Pa(a,Za,function(){return fb(a,b,d)}):fb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ra(a);return db(a,c,d?eb(a,b,d,l.boxSizing&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Wa.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Va,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Va.test(f)?f.replace(Va,e):f+" "+e)}}),n.cssHooks.marginRight=Ua(l.reliableMarginRight,function(a,b){return b?Pa(a,{display:"inline-block"},Sa,[a,"marginRight"]):void 0}),n.cssHooks.marginLeft=Ua(l.reliableMarginLeft,function(a,b){return b?(parseFloat(Sa(a,"marginLeft"))||(n.contains(a.ownerDocument,a)?a.getBoundingClientRect().left-Pa(a,{
+marginLeft:0},function(){return a.getBoundingClientRect().left}):0))+"px":void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+V[d]+b]=f[d]||f[d-2]||f[0];return e}},Na.test(a)||(n.cssHooks[a+b].set=db)}),n.fn.extend({css:function(a,b){return Y(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Ra(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return cb(this,!0)},hide:function(){return cb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){W(this)?n(this).show():n(this).hide()})}});function gb(a,b,c,d,e){return new gb.prototype.init(a,b,c,d,e)}n.Tween=gb,gb.prototype={constructor:gb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||n.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=gb.propHooks[this.prop];return a&&a.get?a.get(this):gb.propHooks._default.get(this)},run:function(a){var b,c=gb.propHooks[this.prop];return this.options.duration?this.pos=b=n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):gb.propHooks._default.set(this),this}},gb.prototype.init.prototype=gb.prototype,gb.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[n.cssProps[a.prop]]&&!n.cssHooks[a.prop]?a.elem[a.prop]=a.now:n.style(a.elem,a.prop,a.now+a.unit)}}},gb.propHooks.scrollTop=gb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},n.fx=gb.prototype.init,n.fx.step={};var hb,ib,jb=/^(?:toggle|show|hide)$/,kb=/queueHooks$/;function lb(){return a.setTimeout(function(){hb=void 0}),hb=n.now()}function mb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=V[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function nb(a,b,c){for(var d,e=(qb.tweeners[b]||[]).concat(qb.tweeners["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ob(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&W(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k="none"===j?n._data(a,"olddisplay")||Ma(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==Ma(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],jb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(o))"inline"===("none"===j?Ma(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=nb(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function pb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function qb(a,b,c){var d,e,f=0,g=qb.prefilters.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=hb||lb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{},easing:n.easing._default},c),originalProperties:b,originalOptions:c,startTime:hb||lb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?(h.notifyWith(a,[j,1,0]),h.resolveWith(a,[j,b])):h.rejectWith(a,[j,b]),this}}),k=j.props;for(pb(k,j.opts.specialEasing);g>f;f++)if(d=qb.prefilters[f].call(j,a,k,j.opts))return n.isFunction(d.stop)&&(n._queueHooks(j.elem,j.opts.queue).stop=n.proxy(d.stop,d)),d;return n.map(k,nb,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(qb,{tweeners:{"*":[function(a,b){var c=this.createTween(a,b);return X(c.elem,a,U.exec(b),c),c}]},tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.match(G);for(var c,d=0,e=a.length;e>d;d++)c=a[d],qb.tweeners[c]=qb.tweeners[c]||[],qb.tweeners[c].unshift(b)},prefilters:[ob],prefilter:function(a,b){b?qb.prefilters.unshift(a):qb.prefilters.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(W).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=qb(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&kb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(mb(b,!0),a,d,e)}}),n.each({slideDown:mb("show"),slideUp:mb("hide"),slideToggle:mb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(hb=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),hb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ib||(ib=a.setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){a.clearInterval(ib),ib=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(b,c){return b=n.fx?n.fx.speeds[b]||b:b,c=c||"fx",this.queue(c,function(c,d){var e=a.setTimeout(c,b);d.stop=function(){a.clearTimeout(e)}})},function(){var a,b=d.createElement("input"),c=d.createElement("div"),e=d.createElement("select"),f=e.appendChild(d.createElement("option"));c=d.createElement("div"),c.setAttribute("className","t"),c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],b.setAttribute("type","checkbox"),c.appendChild(b),a=c.getElementsByTagName("a")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==c.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=f.selected,l.enctype=!!d.createElement("form").enctype,e.disabled=!0,l.optDisabled=!f.disabled,b=d.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value}();var rb=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],(c.selected||i===e)&&(l.optDisabled?!c.disabled:null===c.getAttribute("disabled"))&&(!c.parentNode.disabled||!n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>-1:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb,tb,ub=n.expr.attrHandle,vb=/^(?:checked|selected)$/i,wb=l.getSetAttribute,xb=l.input;n.fn.extend({attr:function(a,b){return Y(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),e=n.attrHooks[b]||(n.expr.match.bool.test(b)?tb:sb)),void 0!==c?null===c?void n.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=n.find.attr(a,b),null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(G);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?xb&&wb||!vb.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(wb?c:d)}}),tb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):xb&&wb||!vb.test(c)?a.setAttribute(!wb&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ub[b]||n.find.attr;xb&&wb||!vb.test(b)?ub[b]=function(a,b,d){var e,f;return d||(f=ub[b],ub[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ub[b]=f),e}:ub[b]=function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),xb&&wb||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):sb&&sb.set(a,b,c)}}),wb||(sb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ub.id=ub.name=ub.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:sb.set},n.attrHooks.contenteditable={set:function(a,b,c){sb.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var yb=/^(?:input|select|textarea|button|object)$/i,zb=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return Y(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&n.isXMLDoc(a)||(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):yb.test(a.nodeName)||zb.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var Ab=/[\t\r\n\f]/g;function Bb(a){return n.attr(a,"class")||""}n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,Bb(this)))});if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,Bb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(G)||[];while(c=this[i++])if(e=Bb(c),d=1===c.nodeType&&(" "+e+" ").replace(Ab," ")){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=n.trim(d),e!==h&&n.attr(c,"class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):n.isFunction(a)?this.each(function(c){n(this).toggleClass(a.call(this,c,Bb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=n(this),f=a.match(G)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(void 0===a||"boolean"===c)&&(b=Bb(this),b&&n._data(this,"__className__",b),n.attr(this,"class",b||a===!1?"":n._data(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+Bb(c)+" ").replace(Ab," ").indexOf(b)>-1)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Cb=a.location,Db=n.now(),Eb=/\?/,Fb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(Fb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new a.DOMParser,c=d.parseFromString(b,"text/xml")):(c=new a.ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var Gb=/#.*$/,Hb=/([?&])_=[^&]*/,Ib=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Jb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kb=/^(?:GET|HEAD)$/,Lb=/^\/\//,Mb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Nb={},Ob={},Pb="*/".concat("*"),Qb=Cb.href,Rb=Mb.exec(Qb.toLowerCase())||[];function Sb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(G)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Tb(a,b,c,d){var e={},f=a===Ob;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ub(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Vb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Wb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Qb,type:"GET",isLocal:Jb.test(Rb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Pb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ub(Ub(a,n.ajaxSettings),b):Ub(n.ajaxSettings,a)},ajaxPrefilter:Sb(Nb),ajaxTransport:Sb(Ob),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var d,e,f,g,h,i,j,k,l=n.ajaxSetup({},c),m=l.context||l,o=l.context&&(m.nodeType||m.jquery)?n(m):n.event,p=n.Deferred(),q=n.Callbacks("once memory"),r=l.statusCode||{},s={},t={},u=0,v="canceled",w={readyState:0,getResponseHeader:function(a){var b;if(2===u){if(!k){k={};while(b=Ib.exec(g))k[b[1].toLowerCase()]=b[2]}b=k[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===u?g:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return u||(a=t[c]=t[c]||a,s[a]=b),this},overrideMimeType:function(a){return u||(l.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>u)for(b in a)r[b]=[r[b],a[b]];else w.always(a[w.status]);return this},abort:function(a){var b=a||v;return j&&j.abort(b),y(0,b),this}};if(p.promise(w).complete=q.add,w.success=w.done,w.error=w.fail,l.url=((b||l.url||Qb)+"").replace(Gb,"").replace(Lb,Rb[1]+"//"),l.type=c.method||c.type||l.method||l.type,l.dataTypes=n.trim(l.dataType||"*").toLowerCase().match(G)||[""],null==l.crossDomain&&(d=Mb.exec(l.url.toLowerCase()),l.crossDomain=!(!d||d[1]===Rb[1]&&d[2]===Rb[2]&&(d[3]||("http:"===d[1]?"80":"443"))===(Rb[3]||("http:"===Rb[1]?"80":"443")))),l.data&&l.processData&&"string"!=typeof l.data&&(l.data=n.param(l.data,l.traditional)),Tb(Nb,l,c,w),2===u)return w;i=n.event&&l.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),l.type=l.type.toUpperCase(),l.hasContent=!Kb.test(l.type),f=l.url,l.hasContent||(l.data&&(f=l.url+=(Eb.test(f)?"&":"?")+l.data,delete l.data),l.cache===!1&&(l.url=Hb.test(f)?f.replace(Hb,"$1_="+Db++):f+(Eb.test(f)?"&":"?")+"_="+Db++)),l.ifModified&&(n.lastModified[f]&&w.setRequestHeader("If-Modified-Since",n.lastModified[f]),n.etag[f]&&w.setRequestHeader("If-None-Match",n.etag[f])),(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&w.setRequestHeader("Content-Type",l.contentType),w.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+("*"!==l.dataTypes[0]?", "+Pb+"; q=0.01":""):l.accepts["*"]);for(e in l.headers)w.setRequestHeader(e,l.headers[e]);if(l.beforeSend&&(l.beforeSend.call(m,w,l)===!1||2===u))return w.abort();v="abort";for(e in{success:1,error:1,complete:1})w[e](l[e]);if(j=Tb(Ob,l,c,w)){if(w.readyState=1,i&&o.trigger("ajaxSend",[w,l]),2===u)return w;l.async&&l.timeout>0&&(h=a.setTimeout(function(){w.abort("timeout")},l.timeout));try{u=1,j.send(s,y)}catch(x){if(!(2>u))throw x;y(-1,x)}}else y(-1,"No Transport");function y(b,c,d,e){var k,s,t,v,x,y=c;2!==u&&(u=2,h&&a.clearTimeout(h),j=void 0,g=e||"",w.readyState=b>0?4:0,k=b>=200&&300>b||304===b,d&&(v=Vb(l,w,d)),v=Wb(l,v,w,k),k?(l.ifModified&&(x=w.getResponseHeader("Last-Modified"),x&&(n.lastModified[f]=x),x=w.getResponseHeader("etag"),x&&(n.etag[f]=x)),204===b||"HEAD"===l.type?y="nocontent":304===b?y="notmodified":(y=v.state,s=v.data,t=v.error,k=!t)):(t=y,(b||!y)&&(y="error",0>b&&(b=0))),w.status=b,w.statusText=(c||y)+"",k?p.resolveWith(m,[s,y,w]):p.rejectWith(m,[w,y,t]),w.statusCode(r),r=void 0,i&&o.trigger(k?"ajaxSuccess":"ajaxError",[w,l,k?s:t]),q.fireWith(m,[w,y]),i&&(o.trigger("ajaxComplete",[w,l]),--n.active||n.event.trigger("ajaxStop")))}return w},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax(n.extend({url:a,type:b,dataType:e,data:c,success:d},n.isPlainObject(a)&&a))}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return n.isFunction(a)?this.each(function(b){n(this).wrapInner(a.call(this,b))}):this.each(function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}});function Xb(a){return a.style&&a.style.display||n.css(a,"display")}function Yb(a){while(a&&1===a.nodeType){if("none"===Xb(a)||"hidden"===a.type)return!0;a=a.parentNode}return!1}n.expr.filters.hidden=function(a){return l.reliableHiddenOffsets()?a.offsetWidth<=0&&a.offsetHeight<=0&&!a.getClientRects().length:Yb(a)},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Zb=/%20/g,$b=/\[\]$/,_b=/\r?\n/g,ac=/^(?:submit|button|image|reset|file)$/i,bc=/^(?:input|select|textarea|keygen)/i;function cc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||$b.test(a)?d(a,e):cc(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)cc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)cc(c,a[c],b,e);return d.join("&").replace(Zb,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&bc.test(this.nodeName)&&!ac.test(a)&&(this.checked||!Z.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(_b,"\r\n")}}):{name:b.name,value:c.replace(_b,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return this.isLocal?hc():d.documentMode>8?gc():/^(get|post|head|put|delete|options)$/i.test(this.type)&&gc()||hc()}:gc;var dc=0,ec={},fc=n.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in ec)ec[a](void 0,!0)}),l.cors=!!fc&&"withCredentials"in fc,fc=l.ajax=!!fc,fc&&n.ajaxTransport(function(b){if(!b.crossDomain||l.cors){var c;return{send:function(d,e){var f,g=b.xhr(),h=++dc;if(g.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(f in b.xhrFields)g[f]=b.xhrFields[f];b.mimeType&&g.overrideMimeType&&g.overrideMimeType(b.mimeType),b.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest");for(f in d)void 0!==d[f]&&g.setRequestHeader(f,d[f]+"");g.send(b.hasContent&&b.data||null),c=function(a,d){var f,i,j;if(c&&(d||4===g.readyState))if(delete ec[h],c=void 0,g.onreadystatechange=n.noop,d)4!==g.readyState&&g.abort();else{j={},f=g.status,"string"==typeof g.responseText&&(j.text=g.responseText);try{i=g.statusText}catch(k){i=""}f||!b.isLocal||b.crossDomain?1223===f&&(f=204):f=j.text?200:404}j&&e(f,i,j,g.getAllResponseHeaders())},b.async?4===g.readyState?a.setTimeout(c):g.onreadystatechange=ec[h]=c:c()},abort:function(){c&&c(void 0,!0)}}}});function gc(){try{return new a.XMLHttpRequest}catch(b){}}function hc(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=d.head||n("head")[0]||d.documentElement;return{send:function(e,f){b=d.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||f(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ic=[],jc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ic.pop()||n.expando+"_"+Db++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(jc.test(b.url)?"url":"string"==typeof b.data&&0===(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&jc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(jc,"$1"+e):b.jsonp!==!1&&(b.url+=(Eb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){void 0===f?n(a).removeProp(e):a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ic.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),l.createHTMLDocument=function(){if(!d.implementation.createHTMLDocument)return!1;var a=d.implementation.createHTMLDocument("");return a.body.innerHTML="<form></form><form></form>",2===a.body.childNodes.length}(),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||(l.createHTMLDocument?d.implementation.createHTMLDocument(""):d);var e=x.exec(a),f=!c&&[];return e?[b.createElement(e[1])]:(e=ja([a],b,f),f&&f.length&&n(f).remove(),n.merge([],e.childNodes))};var kc=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&kc)return kc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>-1&&(d=n.trim(a.slice(h,a.length)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e||"GET",dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).always(c&&function(a,b){g.each(function(){c.apply(g,f||[a.responseText,b,a])})}),this},n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};function lc(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,n.extend({},h))),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?("undefined"!=typeof e.getBoundingClientRect&&(d=e.getBoundingClientRect()),c=lc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0)-a.scrollTop(),c.left+=n.css(a[0],"borderLeftWidth",!0)-a.scrollLeft()),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Qa})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return Y(this,function(a,d,e){var f=lc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){
+n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var mc=a.jQuery,nc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=nc),b&&a.jQuery===n&&(a.jQuery=mc),n},b||(a.jQuery=a.$=n),n});
diff --git a/html/js/moment.min.js b/html/js/moment.min.js
new file mode 100644
index 0000000..c63998f
--- /dev/null
+++ b/html/js/moment.min.js
@@ -0,0 +1,7 @@
+//! moment.js
+//! version : 2.11.1
+//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+//! license : MIT
+//! momentjs.com
+!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Uc.apply(null,arguments)}function b(a){Uc=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function f(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function g(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function h(a,b,c,d){return Da(a,b,c,d,!0).utc()}function i(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function j(a){return null==a._pf&&(a._pf=i()),a._pf}function k(a){if(null==a._isValid){var b=j(a);a._isValid=!(isNaN(a._d.getTime())||!(b.overflow<0)||b.empty||b.invalidMonth||b.invalidWeekday||b.nullInput||b.invalidFormat||b.userInvalidated),a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour)}return a._isValid}function l(a){var b=h(NaN);return null!=a?g(j(b),a):j(b).userInvalidated=!0,b}function m(a){return void 0===a}function n(a,b){var c,d,e;if(m(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),m(b._i)||(a._i=b._i),m(b._f)||(a._f=b._f),m(b._l)||(a._l=b._l),m(b._strict)||(a._strict=b._strict),m(b._tzm)||(a._tzm=b._tzm),m(b._isUTC)||(a._isUTC=b._isUTC),m(b._offset)||(a._offset=b._offset),m(b._pf)||(a._pf=j(b)),m(b._locale)||(a._locale=b._locale),Wc.length>0)for(c in Wc)d=Wc[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),Xc===!1&&(Xc=!0,a.updateOffset(this),Xc=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(){}function u(a){return a?a.toLowerCase().replace("_","-"):a}function v(a){for(var b,c,d,e,f=0;f<a.length;){for(e=u(a[f]).split("-"),b=e.length,c=u(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=w(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function w(a){var b=null;if(!Yc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Vc._abbr,require("./locale/"+a),x(b)}catch(c){}return Yc[a]}function x(a,b){var c;return a&&(c=m(b)?z(a):y(a,b),c&&(Vc=c)),Vc._abbr}function y(a,b){return null!==b?(b.abbr=a,Yc[a]=Yc[a]||new t,Yc[a].set(b),x(a),Yc[a]):(delete Yc[a],null)}function z(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Vc;if(!c(a)){if(b=w(a))return b;a=[a]}return v(a)}function A(a,b){var c=a.toLowerCase();Zc[c]=Zc[c+"s"]=Zc[b]=a}function B(a){return"string"==typeof a?Zc[a]||Zc[a.toLowerCase()]:void 0}function C(a){var b,c,d={};for(c in a)f(a,c)&&(b=B(c),b&&(d[b]=a[c]));return d}function D(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function E(b,c){return function(d){return null!=d?(G(this,b,d),a.updateOffset(this,c),this):F(this,b)}}function F(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function G(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function H(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=B(a),D(this[a]))return this[a](b);return this}function I(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function J(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(bd[a]=e),b&&(bd[b[0]]=function(){return I(e.apply(this,arguments),b[1],b[2])}),c&&(bd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function K(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function L(a){var b,c,d=a.match($c);for(b=0,c=d.length;c>b;b++)bd[d[b]]?d[b]=bd[d[b]]:d[b]=K(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function M(a,b){return a.isValid()?(b=N(b,a.localeData()),ad[b]=ad[b]||L(b),ad[b](a)):a.localeData().invalidDate()}function N(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(_c.lastIndex=0;d>=0&&_c.test(a);)a=a.replace(_c,c),_c.lastIndex=0,d-=1;return a}function O(a,b,c){td[a]=D(b)?b:function(a,d){return a&&c?c:b}}function P(a,b){return f(td,a)?td[a](b._strict,b._locale):new RegExp(Q(a))}function Q(a){return R(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function R(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function S(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;c<a.length;c++)ud[a[c]]=d}function T(a,b){S(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function U(a,b,c){null!=b&&f(ud,a)&&ud[a](b,c._a,c,a)}function V(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function W(a,b){return c(this._months)?this._months[a.month()]:this._months[Ed.test(b)?"format":"standalone"][a.month()]}function X(a,b){return c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[Ed.test(b)?"format":"standalone"][a.month()]}function Y(a,b,c){var d,e,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function Z(a,b){var c;return a.isValid()?"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),V(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a):a}function $(b){return null!=b?(Z(this,b),a.updateOffset(this,!0),this):F(this,"Month")}function _(){return V(this.year(),this.month())}function aa(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ba(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ca(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=R(d[b]),e[b]=R(e[b]),f[b]=R(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function da(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[wd]<0||c[wd]>11?wd:c[xd]<1||c[xd]>V(c[vd],c[wd])?xd:c[yd]<0||c[yd]>24||24===c[yd]&&(0!==c[zd]||0!==c[Ad]||0!==c[Bd])?yd:c[zd]<0||c[zd]>59?zd:c[Ad]<0||c[Ad]>59?Ad:c[Bd]<0||c[Bd]>999?Bd:-1,j(a)._overflowDayOfYear&&(vd>b||b>xd)&&(b=xd),j(a)._overflowWeeks&&-1===b&&(b=Cd),j(a)._overflowWeekday&&-1===b&&(b=Dd),j(a).overflow=b),a}function ea(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function fa(a,b){var c=!0;return g(function(){return c&&(ea(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ga(a,b){Jd[a]||(ea(b),Jd[a]=!0)}function ha(a){var b,c,d,e,f,g,h=a._i,i=Kd.exec(h)||Ld.exec(h);if(i){for(j(a).iso=!0,b=0,c=Nd.length;c>b;b++)if(Nd[b][1].exec(i[1])){e=Nd[b][0],d=Nd[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Od.length;c>b;b++)if(Od[b][1].exec(i[3])){f=(i[2]||" ")+Od[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Md.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),wa(a)}else a._isValid=!1}function ia(b){var c=Pd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ha(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ja(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ka(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function la(a){return ma(a)?366:365}function ma(a){return a%4===0&&a%100!==0||a%400===0}function na(){return ma(this.year())}function oa(a,b,c){var d=7+b-c,e=(7+ka(a,0,d).getUTCDay()-b)%7;return-e+d-1}function pa(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=oa(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=la(f)+j):j>la(a)?(f=a+1,g=j-la(a)):(f=a,g=j),{year:f,dayOfYear:g}}function qa(a,b,c){var d,e,f=oa(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+ra(e,b,c)):g>ra(a.year(),b,c)?(d=g-ra(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function ra(a,b,c){var d=oa(a,b,c),e=oa(a+1,b,c);return(la(a)-d+e)/7}function sa(a,b,c){return null!=a?a:null!=b?b:c}function ta(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function ua(a){var b,c,d,e,f=[];if(!a._d){for(d=ta(a),a._w&&null==a._a[xd]&&null==a._a[wd]&&va(a),a._dayOfYear&&(e=sa(a._a[vd],d[vd]),a._dayOfYear>la(e)&&(j(a)._overflowDayOfYear=!0),c=ka(e,0,a._dayOfYear),a._a[wd]=c.getUTCMonth(),a._a[xd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[yd]&&0===a._a[zd]&&0===a._a[Ad]&&0===a._a[Bd]&&(a._nextDay=!0,a._a[yd]=0),a._d=(a._useUTC?ka:ja).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[yd]=24)}}function va(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=sa(b.GG,a._a[vd],qa(Ea(),1,4).year),d=sa(b.W,1),e=sa(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=sa(b.gg,a._a[vd],qa(Ea(),f,g).year),d=sa(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>ra(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=pa(c,d,e,f,g),a._a[vd]=h.year,a._dayOfYear=h.dayOfYear)}function wa(b){if(b._f===a.ISO_8601)return void ha(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=N(b._f,b._locale).match($c)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(P(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),bd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),U(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[yd]<=12&&b._a[yd]>0&&(j(b).bigHour=void 0),b._a[yd]=xa(b._locale,b._a[yd],b._meridiem),ua(b),da(b)}function xa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function ya(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],wa(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}function za(a){if(!a._d){var b=C(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ua(a)}}function Aa(a){var b=new o(da(Ba(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ba(a){var b=a._i,e=a._f;return a._locale=a._locale||z(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(da(b)):(c(e)?ya(a):e?wa(a):d(b)?a._d=b:Ca(a),k(a)||(a._d=null),a))}function Ca(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?ia(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ua(b)):"object"==typeof f?za(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Da(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Aa(f)}function Ea(a,b,c,d){return Da(a,b,c,d,!1)}function Fa(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ea();for(d=b[0],e=1;e<b.length;++e)(!b[e].isValid()||b[e][a](d))&&(d=b[e]);return d}function Ga(){var a=[].slice.call(arguments,0);return Fa("isBefore",a)}function Ha(){var a=[].slice.call(arguments,0);return Fa("isAfter",a)}function Ia(a){var b=C(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=z(),this._bubble()}function Ja(a){return a instanceof Ia}function Ka(a,b){J(a,0,0,function(){var a=this.utcOffset(),c="+";return 0>a&&(a=-a,c="-"),c+I(~~(a/60),2)+b+I(~~a%60,2)})}function La(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(Ud)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Ma(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ea(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ea(b).local()}function Na(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Oa(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=La(qd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Na(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?cb(this,Za(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Na(this):null!=b?this:NaN}function Pa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Qa(a){return this.utcOffset(0,a)}function Ra(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Na(this),"m")),this}function Sa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(La(pd,this._i)),this}function Ta(a){return this.isValid()?(a=a?Ea(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function Ua(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Va(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ba(a),a._a){var b=a._isUTC?h(a._a):Ea(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wa(){return this.isValid()?!this._isUTC:!1}function Xa(){return this.isValid()?this._isUTC:!1}function Ya(){return this.isValid()?this._isUTC&&0===this._offset:!1}function Za(a,b){var c,d,e,g=a,h=null;return Ja(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=Vd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[xd])*c,h:r(h[yd])*c,m:r(h[zd])*c,s:r(h[Ad])*c,ms:r(h[Bd])*c}):(h=Wd.exec(a))?(c="-"===h[1]?-1:1,g={y:$a(h[2],c),M:$a(h[3],c),d:$a(h[4],c),h:$a(h[5],c),m:$a(h[6],c),s:$a(h[7],c),w:$a(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=ab(Ea(g.from),Ea(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ia(g),Ja(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function $a(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function _a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function ab(a,b){var c;return a.isValid()&&b.isValid()?(b=Ma(b,a),a.isBefore(b)?c=_a(a,b):(c=_a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function bb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ga(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Za(c,d),cb(this,e,a),this}}function cb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&G(b,"Date",F(b,"Date")+g*d),h&&Z(b,F(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function db(a,b){var c=a||Ea(),d=Ma(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(D(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ea(c)))}function eb(){return new o(this)}function fb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b)):!1}function gb(a,b){var c=p(a)?a:Ea(a);return this.isValid()&&c.isValid()?(b=B(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c):!1}function hb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ib(a,b){var c,d=p(a)?a:Ea(a);return this.isValid()&&d.isValid()?(b=B(b||"millisecond"),"millisecond"===b?+this===+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))):!1}function jb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function kb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function lb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ma(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=B(b),"year"===b||"month"===b||"quarter"===b?(g=mb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function mb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function nb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ob(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?D(Date.prototype.toISOString)?this.toDate().toISOString():M(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):M(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function pb(b){var c=M(this,b||a.defaultFormat);return this.localeData().postformat(c)}function qb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ea(a).isValid())?Za({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function rb(a){return this.from(Ea(),a)}function sb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ea(a).isValid())?Za({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function tb(a){return this.to(Ea(),a)}function ub(a){var b;return void 0===a?this._locale._abbr:(b=z(a),null!=b&&(this._locale=b),this)}function vb(){return this._locale}function wb(a){switch(a=B(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function xb(a){return a=B(a),void 0===a||"millisecond"===a?this:this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms")}function yb(){return+this._d-6e4*(this._offset||0)}function zb(){return Math.floor(+this/1e3)}function Ab(){return this._offset?new Date(+this):this._d}function Bb(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function Cb(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function Db(){return this.isValid()?this.toISOString():"null"}function Eb(){return k(this)}function Fb(){return g({},j(this))}function Gb(){return j(this).overflow}function Hb(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ib(a,b){J(0,[a,a.length],0,b)}function Jb(a){return Nb.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Kb(a){return Nb.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Lb(){return ra(this.year(),1,4)}function Mb(){var a=this.localeData()._week;return ra(this.year(),a.dow,a.doy)}function Nb(a,b,c,d,e){var f;return null==a?qa(this,d,e).year:(f=ra(a,d,e),b>f&&(b=f),Ob.call(this,a,b,c,d,e))}function Ob(a,b,c,d,e){var f=pa(a,b,c,d,e),g=ka(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Pb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Qb(a){return qa(a,this._week.dow,this._week.doy).week}function Rb(){return this._week.dow}function Sb(){return this._week.doy}function Tb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ub(a){var b=qa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Vb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Wb(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function Xb(a){return this._weekdaysShort[a.day()]}function Yb(a){return this._weekdaysMin[a.day()]}function Zb(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ea([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function $b(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Vb(a,this.localeData()),this.add(a-b,"d")):b}function _b(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ac(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function bc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function cc(){return this.hours()%12||12}function dc(a,b){J(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function ec(a,b){return b._meridiemParse}function fc(a){return"p"===(a+"").toLowerCase().charAt(0)}function gc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function hc(a,b){b[Bd]=r(1e3*("0."+a))}function ic(){return this._isUTC?"UTC":""}function jc(){return this._isUTC?"Coordinated Universal Time":""}function kc(a){return Ea(1e3*a)}function lc(){return Ea.apply(null,arguments).parseZone()}function mc(a,b,c){var d=this._calendar[a];return D(d)?d.call(b,c):d}function nc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function oc(){return this._invalidDate}function pc(a){return this._ordinal.replace("%d",a)}function qc(a){return a}function rc(a,b,c,d){var e=this._relativeTime[c];return D(e)?e(a,b,c,d):e.replace(/%d/i,a)}function sc(a,b){var c=this._relativeTime[a>0?"future":"past"];return D(c)?c(b):c.replace(/%s/i,b)}function tc(a){var b,c;for(c in a)b=a[c],D(b)?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function uc(a,b,c,d){var e=z(),f=h().set(d,b);return e[c](f,a)}function vc(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return uc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=uc(a,f,c,e);return g}function wc(a,b){return vc(a,b,"months",12,"month")}function xc(a,b){return vc(a,b,"monthsShort",12,"month")}function yc(a,b){return vc(a,b,"weekdays",7,"day")}function zc(a,b){return vc(a,b,"weekdaysShort",7,"day")}function Ac(a,b){return vc(a,b,"weekdaysMin",7,"day")}function Bc(){var a=this._data;return this._milliseconds=se(this._milliseconds),this._days=se(this._days),this._months=se(this._months),a.milliseconds=se(a.milliseconds),a.seconds=se(a.seconds),a.minutes=se(a.minutes),a.hours=se(a.hours),a.months=se(a.months),a.years=se(a.years),this}function Cc(a,b,c,d){var e=Za(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Dc(a,b){return Cc(this,a,b,1)}function Ec(a,b){return Cc(this,a,b,-1)}function Fc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Gc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Fc(Ic(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Hc(g)),h+=e,g-=Fc(Ic(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Hc(a){return 4800*a/146097}function Ic(a){return 146097*a/4800}function Jc(a){var b,c,d=this._milliseconds;if(a=B(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Hc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Ic(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Kc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Lc(a){return function(){return this.as(a)}}function Mc(a){return a=B(a),this[a+"s"]()}function Nc(a){return function(){return this._data[a]}}function Oc(){return q(this.days()/7)}function Pc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Qc(a,b,c){var d=Za(a).abs(),e=Ie(d.as("s")),f=Ie(d.as("m")),g=Ie(d.as("h")),h=Ie(d.as("d")),i=Ie(d.as("M")),j=Ie(d.as("y")),k=e<Je.s&&["s",e]||1>=f&&["m"]||f<Je.m&&["mm",f]||1>=g&&["h"]||g<Je.h&&["hh",g]||1>=h&&["d"]||h<Je.d&&["dd",h]||1>=i&&["M"]||i<Je.M&&["MM",i]||1>=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Pc.apply(null,k)}function Rc(a,b){return void 0===Je[a]?!1:void 0===b?Je[a]:(Je[a]=b,!0)}function Sc(a){var b=this.localeData(),c=Qc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Tc(){var a,b,c,d=Ke(this._milliseconds)/1e3,e=Ke(this._days),f=Ke(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Uc,Vc,Wc=a.momentProperties=[],Xc=!1,Yc={},Zc={},$c=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,_c=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ad={},bd={},cd=/\d/,dd=/\d\d/,ed=/\d{3}/,fd=/\d{4}/,gd=/[+-]?\d{6}/,hd=/\d\d?/,id=/\d\d\d\d?/,jd=/\d\d\d\d\d\d?/,kd=/\d{1,3}/,ld=/\d{1,4}/,md=/[+-]?\d{1,6}/,nd=/\d+/,od=/[+-]?\d+/,pd=/Z|[+-]\d\d:?\d\d/gi,qd=/Z|[+-]\d\d(?::?\d\d)?/gi,rd=/[+-]?\d+(\.\d{1,3})?/,sd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,td={},ud={},vd=0,wd=1,xd=2,yd=3,zd=4,Ad=5,Bd=6,Cd=7,Dd=8;J("M",["MM",2],"Mo",function(){return this.month()+1}),J("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),J("MMMM",0,0,function(a){return this.localeData().months(this,a)}),A("month","M"),O("M",hd),O("MM",hd,dd),O("MMM",function(a,b){return b.monthsShortRegex(a)}),O("MMMM",function(a,b){return b.monthsRegex(a)}),S(["M","MM"],function(a,b){b[wd]=r(a)-1}),S(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[wd]=e:j(c).invalidMonth=a});var Ed=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Fd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Gd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Hd=sd,Id=sd,Jd={};a.suppressDeprecationWarnings=!1;var Kd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ld=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Md=/Z|[+-]\d\d(?::?\d\d)?/,Nd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Od=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Pd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=fa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),J("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),A("year","y"),O("Y",od),O("YY",hd,dd),O("YYYY",ld,fd),O("YYYYY",md,gd),O("YYYYYY",md,gd),S(["YYYYY","YYYYYY"],vd),S("YYYY",function(b,c){c[vd]=2===b.length?a.parseTwoDigitYear(b):r(b)}),S("YY",function(b,c){c[vd]=a.parseTwoDigitYear(b)}),S("Y",function(a,b){b[vd]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Qd=E("FullYear",!1);a.ISO_8601=function(){};var Rd=fa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Sd=fa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Td=function(){return Date.now?Date.now():+new Date};Ka("Z",":"),Ka("ZZ",""),O("Z",qd),O("ZZ",qd),S(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=La(qd,a)});var Ud=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Vd=/(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Wd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;
+Za.fn=Ia.prototype;var Xd=bb(1,"add"),Yd=bb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Zd=fa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});J(0,["gg",2],0,function(){return this.weekYear()%100}),J(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ib("gggg","weekYear"),Ib("ggggg","weekYear"),Ib("GGGG","isoWeekYear"),Ib("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),O("G",od),O("g",od),O("GG",hd,dd),O("gg",hd,dd),O("GGGG",ld,fd),O("gggg",ld,fd),O("GGGGG",md,gd),O("ggggg",md,gd),T(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),T(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),J("Q",0,"Qo","quarter"),A("quarter","Q"),O("Q",cd),S("Q",function(a,b){b[wd]=3*(r(a)-1)}),J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),O("w",hd),O("ww",hd,dd),O("W",hd),O("WW",hd,dd),T(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var $d={dow:0,doy:6};J("D",["DD",2],"Do","date"),A("date","D"),O("D",hd),O("DD",hd,dd),O("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),S(["D","DD"],xd),S("Do",function(a,b){b[xd]=r(a.match(hd)[0],10)});var _d=E("Date",!0);J("d",0,"do","day"),J("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),J("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),J("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),O("d",hd),O("e",hd),O("E",hd),O("dd",sd),O("ddd",sd),O("dddd",sd),T(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),T(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var ae="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),be="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ce="Su_Mo_Tu_We_Th_Fr_Sa".split("_");J("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),O("DDD",kd),O("DDDD",ed),S(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),J("H",["HH",2],0,"hour"),J("h",["hh",2],0,cc),J("hmm",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)}),J("hmmss",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+I(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)}),dc("a",!0),dc("A",!1),A("hour","h"),O("a",ec),O("A",ec),O("H",hd),O("h",hd),O("HH",hd,dd),O("hh",hd,dd),O("hmm",id),O("hmmss",jd),O("Hmm",id),O("Hmmss",jd),S(["H","HH"],yd),S(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),S(["h","hh"],function(a,b,c){b[yd]=r(a),j(c).bigHour=!0}),S("hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d)),j(c).bigHour=!0}),S("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e)),j(c).bigHour=!0}),S("Hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d))}),S("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e))});var de=/[ap]\.?m?\.?/i,ee=E("Hours",!0);J("m",["mm",2],0,"minute"),A("minute","m"),O("m",hd),O("mm",hd,dd),S(["m","mm"],zd);var fe=E("Minutes",!1);J("s",["ss",2],0,"second"),A("second","s"),O("s",hd),O("ss",hd,dd),S(["s","ss"],Ad);var ge=E("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return 10*this.millisecond()}),J(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),J(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),J(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),J(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),J(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),O("S",kd,cd),O("SS",kd,dd),O("SSS",kd,ed);var he;for(he="SSSS";he.length<=9;he+="S")O(he,nd);for(he="S";he.length<=9;he+="S")S(he,hc);var ie=E("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var je=o.prototype;je.add=Xd,je.calendar=db,je.clone=eb,je.diff=lb,je.endOf=xb,je.format=pb,je.from=qb,je.fromNow=rb,je.to=sb,je.toNow=tb,je.get=H,je.invalidAt=Gb,je.isAfter=fb,je.isBefore=gb,je.isBetween=hb,je.isSame=ib,je.isSameOrAfter=jb,je.isSameOrBefore=kb,je.isValid=Eb,je.lang=Zd,je.locale=ub,je.localeData=vb,je.max=Sd,je.min=Rd,je.parsingFlags=Fb,je.set=H,je.startOf=wb,je.subtract=Yd,je.toArray=Bb,je.toObject=Cb,je.toDate=Ab,je.toISOString=ob,je.toJSON=Db,je.toString=nb,je.unix=zb,je.valueOf=yb,je.creationData=Hb,je.year=Qd,je.isLeapYear=na,je.weekYear=Jb,je.isoWeekYear=Kb,je.quarter=je.quarters=Pb,je.month=$,je.daysInMonth=_,je.week=je.weeks=Tb,je.isoWeek=je.isoWeeks=Ub,je.weeksInYear=Mb,je.isoWeeksInYear=Lb,je.date=_d,je.day=je.days=$b,je.weekday=_b,je.isoWeekday=ac,je.dayOfYear=bc,je.hour=je.hours=ee,je.minute=je.minutes=fe,je.second=je.seconds=ge,je.millisecond=je.milliseconds=ie,je.utcOffset=Oa,je.utc=Qa,je.local=Ra,je.parseZone=Sa,je.hasAlignedHourOffset=Ta,je.isDST=Ua,je.isDSTShifted=Va,je.isLocal=Wa,je.isUtcOffset=Xa,je.isUtc=Ya,je.isUTC=Ya,je.zoneAbbr=ic,je.zoneName=jc,je.dates=fa("dates accessor is deprecated. Use date instead.",_d),je.months=fa("months accessor is deprecated. Use month instead",$),je.years=fa("years accessor is deprecated. Use year instead",Qd),je.zone=fa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Pa);var ke=je,le={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},me={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},ne="Invalid date",oe="%d",pe=/\d{1,2}/,qe={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},re=t.prototype;re._calendar=le,re.calendar=mc,re._longDateFormat=me,re.longDateFormat=nc,re._invalidDate=ne,re.invalidDate=oc,re._ordinal=oe,re.ordinal=pc,re._ordinalParse=pe,re.preparse=qc,re.postformat=qc,re._relativeTime=qe,re.relativeTime=rc,re.pastFuture=sc,re.set=tc,re.months=W,re._months=Fd,re.monthsShort=X,re._monthsShort=Gd,re.monthsParse=Y,re._monthsRegex=Id,re.monthsRegex=ba,re._monthsShortRegex=Hd,re.monthsShortRegex=aa,re.week=Qb,re._week=$d,re.firstDayOfYear=Sb,re.firstDayOfWeek=Rb,re.weekdays=Wb,re._weekdays=ae,re.weekdaysMin=Yb,re._weekdaysMin=ce,re.weekdaysShort=Xb,re._weekdaysShort=be,re.weekdaysParse=Zb,re.isPM=fc,re._meridiemParse=de,re.meridiem=gc,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=fa("moment.lang is deprecated. Use moment.locale instead.",x),a.langData=fa("moment.langData is deprecated. Use moment.localeData instead.",z);var se=Math.abs,te=Lc("ms"),ue=Lc("s"),ve=Lc("m"),we=Lc("h"),xe=Lc("d"),ye=Lc("w"),ze=Lc("M"),Ae=Lc("y"),Be=Nc("milliseconds"),Ce=Nc("seconds"),De=Nc("minutes"),Ee=Nc("hours"),Fe=Nc("days"),Ge=Nc("months"),He=Nc("years"),Ie=Math.round,Je={s:45,m:45,h:22,d:26,M:11},Ke=Math.abs,Le=Ia.prototype;Le.abs=Bc,Le.add=Dc,Le.subtract=Ec,Le.as=Jc,Le.asMilliseconds=te,Le.asSeconds=ue,Le.asMinutes=ve,Le.asHours=we,Le.asDays=xe,Le.asWeeks=ye,Le.asMonths=ze,Le.asYears=Ae,Le.valueOf=Kc,Le._bubble=Gc,Le.get=Mc,Le.milliseconds=Be,Le.seconds=Ce,Le.minutes=De,Le.hours=Ee,Le.days=Fe,Le.weeks=Oc,Le.months=Ge,Le.years=He,Le.humanize=Sc,Le.toISOString=Tc,Le.toString=Tc,Le.toJSON=Tc,Le.locale=ub,Le.localeData=vb,Le.toIsoString=fa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tc),Le.lang=Zd,J("X",0,0,"unix"),J("x",0,0,"valueOf"),O("x",od),O("X",rd),S("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),S("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.11.1",b(Ea),a.fn=ke,a.min=Ga,a.max=Ha,a.now=Td,a.utc=h,a.unix=kc,a.months=wc,a.isDate=d,a.locale=x,a.invalid=l,a.duration=Za,a.isMoment=p,a.weekdays=yc,a.parseZone=lc,a.localeData=z,a.isDuration=Ja,a.monthsShort=xc,a.weekdaysMin=Ac,a.defineLocale=y,a.weekdaysShort=zc,a.normalizeUnits=B,a.relativeTimeThreshold=Rc,a.prototype=ke;var Me=a;return Me}); \ No newline at end of file
diff --git a/html/js/rickshaw.min.js b/html/js/rickshaw.min.js
new file mode 100644
index 0000000..bd57699
--- /dev/null
+++ b/html/js/rickshaw.min.js
@@ -0,0 +1,3 @@
+(function(root,factory){if(typeof define==="function"&&define.amd){define(["d3"],function(d3){return root.Rickshaw=factory(d3)})}else if(typeof exports==="object"){module.exports=factory(require("d3"))}else{root.Rickshaw=factory(d3)}})(this,function(d3){var Rickshaw={namespace:function(namespace,obj){var parts=namespace.split(".");var parent=Rickshaw;for(var i=1,length=parts.length;i<length;i++){var currentPart=parts[i];parent[currentPart]=parent[currentPart]||{};parent=parent[currentPart]}return parent},keys:function(obj){var keys=[];for(var key in obj)keys.push(key);return keys},extend:function(destination,source){for(var property in source){destination[property]=source[property]}return destination},clone:function(obj){return JSON.parse(JSON.stringify(obj))}};(function(globalContext){var _toString=Object.prototype.toString,NULL_TYPE="Null",UNDEFINED_TYPE="Undefined",BOOLEAN_TYPE="Boolean",NUMBER_TYPE="Number",STRING_TYPE="String",OBJECT_TYPE="Object",FUNCTION_CLASS="[object Function]";function isFunction(object){return _toString.call(object)===FUNCTION_CLASS}function extend(destination,source){for(var property in source)if(source.hasOwnProperty(property))destination[property]=source[property];return destination}function keys(object){if(Type(object)!==OBJECT_TYPE){throw new TypeError}var results=[];for(var property in object){if(object.hasOwnProperty(property)){results.push(property)}}return results}function Type(o){switch(o){case null:return NULL_TYPE;case void 0:return UNDEFINED_TYPE}var type=typeof o;switch(type){case"boolean":return BOOLEAN_TYPE;case"number":return NUMBER_TYPE;case"string":return STRING_TYPE}return OBJECT_TYPE}function isUndefined(object){return typeof object==="undefined"}var slice=Array.prototype.slice;function argumentNames(fn){var names=fn.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return names.length==1&&!names[0]?[]:names}function wrap(fn,wrapper){var __method=fn;return function(){var a=update([bind(__method,this)],arguments);return wrapper.apply(this,a)}}function update(array,args){var arrayLength=array.length,length=args.length;while(length--)array[arrayLength+length]=args[length];return array}function merge(array,args){array=slice.call(array,0);return update(array,args)}function bind(fn,context){if(arguments.length<2&&isUndefined(arguments[0]))return this;var __method=fn,args=slice.call(arguments,2);return function(){var a=merge(args,arguments);return __method.apply(context,a)}}var emptyFunction=function(){};var Class=function(){var IS_DONTENUM_BUGGY=function(){for(var p in{toString:1}){if(p==="toString")return false}return true}();function subclass(){}function create(){var parent=null,properties=[].slice.apply(arguments);if(isFunction(properties[0]))parent=properties.shift();function klass(){this.initialize.apply(this,arguments)}extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){subclass.prototype=parent.prototype;klass.prototype=new subclass;try{parent.subclasses.push(klass)}catch(e){}}for(var i=0,length=properties.length;i<length;i++)klass.addMethods(properties[i]);if(!klass.prototype.initialize)klass.prototype.initialize=emptyFunction;klass.prototype.constructor=klass;return klass}function addMethods(source){var ancestor=this.superclass&&this.superclass.prototype,properties=keys(source);if(IS_DONTENUM_BUGGY){if(source.toString!=Object.prototype.toString)properties.push("toString");if(source.valueOf!=Object.prototype.valueOf)properties.push("valueOf")}for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&isFunction(value)&&argumentNames(value)[0]=="$super"){var method=value;value=wrap(function(m){return function(){return ancestor[m].apply(this,arguments)}}(property),method);value.valueOf=bind(method.valueOf,method);value.toString=bind(method.toString,method)}this.prototype[property]=value}return this}return{create:create,Methods:{addMethods:addMethods}}}();if(globalContext.exports){globalContext.exports.Class=Class}else{globalContext.Class=Class}})(Rickshaw);Rickshaw.namespace("Rickshaw.Compat.ClassList");Rickshaw.Compat.ClassList=function(){if(typeof document!=="undefined"&&!("classList"in document.createElement("a"))){(function(view){"use strict";var classListProp="classList",protoProp="prototype",elemCtrProto=(view.HTMLElement||view.Element)[protoProp],objCtr=Object,strTrim=String[protoProp].trim||function(){return this.replace(/^\s+|\s+$/g,"")},arrIndexOf=Array[protoProp].indexOf||function(item){var i=0,len=this.length;for(;i<len;i++){if(i in this&&this[i]===item){return i}}return-1},DOMEx=function(type,message){this.name=type;this.code=DOMException[type];this.message=message},checkTokenAndGetIndex=function(classList,token){if(token===""){throw new DOMEx("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(token)){throw new DOMEx("INVALID_CHARACTER_ERR","String contains an invalid character")}return arrIndexOf.call(classList,token)},ClassList=function(elem){var trimmedClasses=strTrim.call(elem.className),classes=trimmedClasses?trimmedClasses.split(/\s+/):[],i=0,len=classes.length;for(;i<len;i++){this.push(classes[i])}this._updateClassName=function(){elem.className=this.toString()}},classListProto=ClassList[protoProp]=[],classListGetter=function(){return new ClassList(this)};DOMEx[protoProp]=Error[protoProp];classListProto.item=function(i){return this[i]||null};classListProto.contains=function(token){token+="";return checkTokenAndGetIndex(this,token)!==-1};classListProto.add=function(token){token+="";if(checkTokenAndGetIndex(this,token)===-1){this.push(token);this._updateClassName()}};classListProto.remove=function(token){token+="";var index=checkTokenAndGetIndex(this,token);if(index!==-1){this.splice(index,1);this._updateClassName()}};classListProto.toggle=function(token){token+="";if(checkTokenAndGetIndex(this,token)===-1){this.add(token)}else{this.remove(token)}};classListProto.toString=function(){return this.join(" ")};if(objCtr.defineProperty){var classListPropDesc={get:classListGetter,enumerable:true,configurable:true};try{objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc)}catch(ex){if(ex.number===-2146823252){classListPropDesc.enumerable=false;objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc)}}}else if(objCtr[protoProp].__defineGetter__){elemCtrProto.__defineGetter__(classListProp,classListGetter)}})(window)}};if(typeof RICKSHAW_NO_COMPAT!=="undefined"&&!RICKSHAW_NO_COMPAT||typeof RICKSHAW_NO_COMPAT==="undefined"){new Rickshaw.Compat.ClassList}Rickshaw.namespace("Rickshaw.Graph");Rickshaw.Graph=function(args){var self=this;this.initialize=function(args){if(!args.element)throw"Rickshaw.Graph needs a reference to an element";if(args.element.nodeType!==1)throw"Rickshaw.Graph element was defined but not an HTML element";this.element=args.element;this.series=args.series;this.window={};this.updateCallbacks=[];this.configureCallbacks=[];this.defaults={interpolation:"cardinal",offset:"zero",min:undefined,max:undefined,preserve:false,xScale:undefined,yScale:undefined,stack:true};this._loadRenderers();this.configure(args);this.validateSeries(args.series);this.series.active=function(){return self.series.filter(function(s){return!s.disabled})};this.setSize({width:args.width,height:args.height});this.element.classList.add("rickshaw_graph");this.vis=d3.select(this.element).append("svg:svg").attr("width",this.width).attr("height",this.height);this.discoverRange()};this._loadRenderers=function(){for(var name in Rickshaw.Graph.Renderer){if(!name||!Rickshaw.Graph.Renderer.hasOwnProperty(name))continue;var r=Rickshaw.Graph.Renderer[name];if(!r||!r.prototype||!r.prototype.render)continue;self.registerRenderer(new r({graph:self}))}};this.validateSeries=function(series){if(!Array.isArray(series)&&!(series instanceof Rickshaw.Series)){var seriesSignature=Object.prototype.toString.apply(series);throw"series is not an array: "+seriesSignature}var pointsCount;series.forEach(function(s){if(!(s instanceof Object)){throw"series element is not an object: "+s}if(!s.data){throw"series has no data: "+JSON.stringify(s)}if(!Array.isArray(s.data)){throw"series data is not an array: "+JSON.stringify(s.data)}if(s.data.length>0){var x=s.data[0].x;var y=s.data[0].y;if(typeof x!="number"||typeof y!="number"&&y!==null){throw"x and y properties of points should be numbers instead of "+typeof x+" and "+typeof y}}if(s.data.length>=3){if(s.data[2].x<s.data[1].x||s.data[1].x<s.data[0].x||s.data[s.data.length-1].x<s.data[0].x){throw"series data needs to be sorted on x values for series name: "+s.name}}},this)};this.dataDomain=function(){var data=this.series.map(function(s){return s.data});var min=d3.min(data.map(function(d){return d[0].x}));var max=d3.max(data.map(function(d){return d[d.length-1].x}));return[min,max]};this.discoverRange=function(){var domain=this.renderer.domain();this.x=(this.xScale||d3.scale.linear()).copy().domain(domain.x).range([0,this.width]);this.y=(this.yScale||d3.scale.linear()).copy().domain(domain.y).range([this.height,0]);this.x.magnitude=d3.scale.linear().domain([domain.x[0]-domain.x[0],domain.x[1]-domain.x[0]]).range([0,this.width]);this.y.magnitude=d3.scale.linear().domain([domain.y[0]-domain.y[0],domain.y[1]-domain.y[0]]).range([0,this.height])};this.render=function(){var stackedData=this.stackData();this.discoverRange();this.renderer.render();this.updateCallbacks.forEach(function(callback){callback()})};this.update=this.render;this.stackData=function(){var data=this.series.active().map(function(d){return d.data}).map(function(d){return d.filter(function(d){return this._slice(d)},this)},this);var preserve=this.preserve;if(!preserve){this.series.forEach(function(series){if(series.scale){preserve=true}})}data=preserve?Rickshaw.clone(data):data;this.series.active().forEach(function(series,index){if(series.scale){var seriesData=data[index];if(seriesData){seriesData.forEach(function(d){d.y=series.scale(d.y)})}}});this.stackData.hooks.data.forEach(function(entry){data=entry.f.apply(self,[data])});var stackedData;if(!this.renderer.unstack){this._validateStackable();var layout=d3.layout.stack();layout.offset(self.offset);stackedData=layout(data)}stackedData=stackedData||data;if(this.renderer.unstack){stackedData.forEach(function(seriesData){seriesData.forEach(function(d){d.y0=d.y0===undefined?0:d.y0})})}this.stackData.hooks.after.forEach(function(entry){stackedData=entry.f.apply(self,[data])});var i=0;this.series.forEach(function(series){if(series.disabled)return;series.stack=stackedData[i++]});this.stackedData=stackedData;return stackedData};this._validateStackable=function(){var series=this.series;var pointsCount;series.forEach(function(s){pointsCount=pointsCount||s.data.length;if(pointsCount&&s.data.length!=pointsCount){throw"stacked series cannot have differing numbers of points: "+pointsCount+" vs "+s.data.length+"; see Rickshaw.Series.fill()"}},this)};this.stackData.hooks={data:[],after:[]};this._slice=function(d){if(this.window.xMin||this.window.xMax){var isInRange=true;if(this.window.xMin&&d.x<this.window.xMin)isInRange=false;if(this.window.xMax&&d.x>this.window.xMax)isInRange=false;return isInRange}return true};this.onUpdate=function(callback){this.updateCallbacks.push(callback)};this.onConfigure=function(callback){this.configureCallbacks.push(callback)};this.registerRenderer=function(renderer){this._renderers=this._renderers||{};this._renderers[renderer.name]=renderer};this.configure=function(args){this.config=this.config||{};if(args.width||args.height){this.setSize(args)}Rickshaw.keys(this.defaults).forEach(function(k){this.config[k]=k in args?args[k]:k in this?this[k]:this.defaults[k]},this);Rickshaw.keys(this.config).forEach(function(k){this[k]=this.config[k]},this);if("stack"in args)args.unstack=!args.stack;var renderer=args.renderer||this.renderer&&this.renderer.name||"stack";this.setRenderer(renderer,args);this.configureCallbacks.forEach(function(callback){callback(args)})};this.setRenderer=function(r,args){if(typeof r=="function"){this.renderer=new r({graph:self});this.registerRenderer(this.renderer)}else{if(!this._renderers[r]){throw"couldn't find renderer "+r}this.renderer=this._renderers[r]}if(typeof args=="object"){this.renderer.configure(args)}};this.setSize=function(args){args=args||{};if(typeof window!==undefined){var style=window.getComputedStyle(this.element,null);var elementWidth=parseInt(style.getPropertyValue("width"),10);var elementHeight=parseInt(style.getPropertyValue("height"),10)}this.width=args.width||elementWidth||400;this.height=args.height||elementHeight||250;this.vis&&this.vis.attr("width",this.width).attr("height",this.height)};this.initialize(args)};Rickshaw.namespace("Rickshaw.Fixtures.Color");Rickshaw.Fixtures.Color=function(){this.schemes={};this.schemes.spectrum14=["#ecb796","#dc8f70","#b2a470","#92875a","#716c49","#d2ed82","#bbe468","#a1d05d","#e7cbe6","#d8aad6","#a888c2","#9dc2d3","#649eb9","#387aa3"].reverse();this.schemes.spectrum2000=["#57306f","#514c76","#646583","#738394","#6b9c7d","#84b665","#a7ca50","#bfe746","#e2f528","#fff726","#ecdd00","#d4b11d","#de8800","#de4800","#c91515","#9a0000","#7b0429","#580839","#31082b"];this.schemes.spectrum2001=["#2f243f","#3c2c55","#4a3768","#565270","#6b6b7c","#72957f","#86ad6e","#a1bc5e","#b8d954","#d3e04e","#ccad2a","#cc8412","#c1521d","#ad3821","#8a1010","#681717","#531e1e","#3d1818","#320a1b"];this.schemes.classic9=["#423d4f","#4a6860","#848f39","#a2b73c","#ddcb53","#c5a32f","#7d5836","#963b20","#7c2626","#491d37","#2f254a"].reverse();this.schemes.httpStatus={503:"#ea5029",502:"#d23f14",500:"#bf3613",410:"#efacea",409:"#e291dc",403:"#f457e8",408:"#e121d2",401:"#b92dae",405:"#f47ceb",404:"#a82a9f",400:"#b263c6",301:"#6fa024",302:"#87c32b",307:"#a0d84c",304:"#28b55c",200:"#1a4f74",206:"#27839f",201:"#52adc9",202:"#7c979f",203:"#a5b8bd",204:"#c1cdd1"};this.schemes.colorwheel=["#b5b6a9","#858772","#785f43","#96557e","#4682b4","#65b9ac","#73c03a","#cb513a"].reverse();this.schemes.cool=["#5e9d2f","#73c03a","#4682b4","#7bc3b8","#a9884e","#c1b266","#a47493","#c09fb5"];this.schemes.munin=["#00cc00","#0066b3","#ff8000","#ffcc00","#330099","#990099","#ccff00","#ff0000","#808080","#008f00","#00487d","#b35a00","#b38f00","#6b006b","#8fb300","#b30000","#bebebe","#80ff80","#80c9ff","#ffc080","#ffe680","#aa80ff","#ee00cc","#ff8080","#666600","#ffbfff","#00ffcc","#cc6699","#999900"]};Rickshaw.namespace("Rickshaw.Fixtures.RandomData");Rickshaw.Fixtures.RandomData=function(timeInterval){var addData;timeInterval=timeInterval||1;var lastRandomValue=200;var timeBase=Math.floor((new Date).getTime()/1e3);this.addData=function(data){var randomValue=Math.random()*100+15+lastRandomValue;var index=data[0].length;var counter=1;data.forEach(function(series){var randomVariance=Math.random()*20;var v=randomValue/25+counter++ +(Math.cos(index*counter*11/960)+2)*15+(Math.cos(index/7)+2)*7+(Math.cos(index/17)+2)*1;series.push({x:index*timeInterval+timeBase,y:v+randomVariance})});lastRandomValue=randomValue*.85};this.removeData=function(data){data.forEach(function(series){series.shift()});timeBase+=timeInterval}};Rickshaw.namespace("Rickshaw.Fixtures.Time");Rickshaw.Fixtures.Time=function(){var self=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.units=[{name:"decade",seconds:86400*365.25*10,formatter:function(d){return parseInt(d.getUTCFullYear()/10,10)*10}},{name:"year",seconds:86400*365.25,formatter:function(d){return d.getUTCFullYear()}},{name:"month",seconds:86400*30.5,formatter:function(d){return self.months[d.getUTCMonth()]}},{name:"week",seconds:86400*7,formatter:function(d){return self.formatDate(d)}},{name:"day",seconds:86400,formatter:function(d){return d.getUTCDate()}},{name:"6 hour",seconds:3600*6,formatter:function(d){return self.formatTime(d)}},{name:"hour",seconds:3600,formatter:function(d){return self.formatTime(d)}},{name:"15 minute",seconds:60*15,formatter:function(d){return self.formatTime(d)}},{name:"minute",seconds:60,formatter:function(d){return d.getUTCMinutes()}},{name:"15 second",seconds:15,formatter:function(d){return d.getUTCSeconds()+"s"}},{name:"second",seconds:1,formatter:function(d){return d.getUTCSeconds()+"s"}},{name:"decisecond",seconds:1/10,formatter:function(d){return d.getUTCMilliseconds()+"ms"}},{name:"centisecond",seconds:1/100,formatter:function(d){return d.getUTCMilliseconds()+"ms"}}];this.unit=function(unitName){return this.units.filter(function(unit){return unitName==unit.name}).shift()};this.formatDate=function(d){return d3.time.format("%b %e")(d)};this.formatTime=function(d){return d.toUTCString().match(/(\d+:\d+):/)[1]};this.ceil=function(time,unit){var date,floor,year;if(unit.name=="month"){date=new Date(time*1e3);floor=Date.UTC(date.getUTCFullYear(),date.getUTCMonth())/1e3;if(floor==time)return time;year=date.getUTCFullYear();var month=date.getUTCMonth();if(month==11){month=0;year=year+1}else{month+=1}return Date.UTC(year,month)/1e3}if(unit.name=="year"){date=new Date(time*1e3);floor=Date.UTC(date.getUTCFullYear(),0)/1e3;if(floor==time)return time;year=date.getUTCFullYear()+1;return Date.UTC(year,0)/1e3}return Math.ceil(time/unit.seconds)*unit.seconds}};Rickshaw.namespace("Rickshaw.Fixtures.Time.Local");Rickshaw.Fixtures.Time.Local=function(){var self=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.units=[{name:"decade",seconds:86400*365.25*10,formatter:function(d){return parseInt(d.getFullYear()/10,10)*10}},{name:"year",seconds:86400*365.25,formatter:function(d){return d.getFullYear()}},{name:"month",seconds:86400*30.5,formatter:function(d){return self.months[d.getMonth()]}},{name:"week",seconds:86400*7,formatter:function(d){return self.formatDate(d)}},{name:"day",seconds:86400,formatter:function(d){return d.getDate()}},{name:"6 hour",seconds:3600*6,formatter:function(d){return self.formatTime(d)}},{name:"hour",seconds:3600,formatter:function(d){return self.formatTime(d)}},{name:"15 minute",seconds:60*15,formatter:function(d){return self.formatTime(d)}},{name:"minute",seconds:60,formatter:function(d){return d.getMinutes()}},{name:"15 second",seconds:15,formatter:function(d){return d.getSeconds()+"s"}},{name:"second",seconds:1,formatter:function(d){return d.getSeconds()+"s"}},{name:"decisecond",seconds:1/10,formatter:function(d){return d.getMilliseconds()+"ms"}},{name:"centisecond",seconds:1/100,formatter:function(d){return d.getMilliseconds()+"ms"}}];this.unit=function(unitName){return this.units.filter(function(unit){return unitName==unit.name}).shift()};this.formatDate=function(d){return d3.time.format("%b %e")(d)};this.formatTime=function(d){return d.toString().match(/(\d+:\d+):/)[1]};this.ceil=function(time,unit){var date,floor,year;if(unit.name=="day"){var nearFuture=new Date((time+unit.seconds-1)*1e3);var rounded=new Date(0);rounded.setMilliseconds(0);rounded.setSeconds(0);rounded.setMinutes(0);rounded.setHours(0);rounded.setDate(nearFuture.getDate());rounded.setMonth(nearFuture.getMonth());rounded.setFullYear(nearFuture.getFullYear());return rounded.getTime()/1e3}if(unit.name=="month"){date=new Date(time*1e3);floor=new Date(date.getFullYear(),date.getMonth()).getTime()/1e3;if(floor==time)return time;year=date.getFullYear();var month=date.getMonth();if(month==11){month=0;year=year+1}else{month+=1}return new Date(year,month).getTime()/1e3}if(unit.name=="year"){date=new Date(time*1e3);floor=new Date(date.getUTCFullYear(),0).getTime()/1e3;if(floor==time)return time;year=date.getFullYear()+1;return new Date(year,0).getTime()/1e3}return Math.ceil(time/unit.seconds)*unit.seconds}};Rickshaw.namespace("Rickshaw.Fixtures.Number");Rickshaw.Fixtures.Number.formatKMBT=function(y){var abs_y=Math.abs(y);if(abs_y>=1e12){return y/1e12+"T"}else if(abs_y>=1e9){return y/1e9+"B"}else if(abs_y>=1e6){return y/1e6+"M"}else if(abs_y>=1e3){return y/1e3+"K"}else if(abs_y<1&&y>0){return y.toFixed(2)}else if(abs_y===0){return""}else{return y}};Rickshaw.Fixtures.Number.formatBase1024KMGTP=function(y){var abs_y=Math.abs(y);if(abs_y>=0x4000000000000){return y/0x4000000000000+"P"}else if(abs_y>=1099511627776){return y/1099511627776+"T"}else if(abs_y>=1073741824){return y/1073741824+"G"}else if(abs_y>=1048576){return y/1048576+"M"}else if(abs_y>=1024){return y/1024+"K"}else if(abs_y<1&&y>0){return y.toFixed(2)}else if(abs_y===0){return""}else{return y}};Rickshaw.namespace("Rickshaw.Color.Palette");Rickshaw.Color.Palette=function(args){var color=new Rickshaw.Fixtures.Color;args=args||{};this.schemes={};this.scheme=color.schemes[args.scheme]||args.scheme||color.schemes.colorwheel;this.runningIndex=0;this.generatorIndex=0;if(args.interpolatedStopCount){var schemeCount=this.scheme.length-1;var i,j,scheme=[];for(i=0;i<schemeCount;i++){scheme.push(this.scheme[i]);var generator=d3.interpolateHsl(this.scheme[i],this.scheme[i+1]);for(j=1;j<args.interpolatedStopCount;j++){scheme.push(generator(1/args.interpolatedStopCount*j))}}scheme.push(this.scheme[this.scheme.length-1]);this.scheme=scheme}this.rotateCount=this.scheme.length;this.color=function(key){return this.scheme[key]||this.scheme[this.runningIndex++]||this.interpolateColor()||"#808080"};this.interpolateColor=function(){if(!Array.isArray(this.scheme))return;var color;if(this.generatorIndex==this.rotateCount*2-1){color=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[0])(.5);this.generatorIndex=0;this.rotateCount*=2}else{color=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[this.generatorIndex+1])(.5);this.generatorIndex++}this.scheme.push(color);return color}};Rickshaw.namespace("Rickshaw.Graph.Ajax");Rickshaw.Graph.Ajax=Rickshaw.Class.create({initialize:function(args){this.dataURL=args.dataURL;this.onData=args.onData||function(d){return d};this.onComplete=args.onComplete||function(){};this.onError=args.onError||function(){};this.args=args;this.request()},request:function(){jQuery.ajax({url:this.dataURL,dataType:"json",success:this.success.bind(this),error:this.error.bind(this)})},error:function(){console.log("error loading dataURL: "+this.dataURL);this.onError(this)},success:function(data,status){data=this.onData(data);this.args.series=this._splice({data:data,series:this.args.series});this.graph=this.graph||new Rickshaw.Graph(this.args);this.graph.render();this.onComplete(this)},_splice:function(args){var data=args.data;var series=args.series;if(!args.series)return data;series.forEach(function(s){var seriesKey=s.key||s.name;if(!seriesKey)throw"series needs a key or a name";data.forEach(function(d){var dataKey=d.key||d.name;if(!dataKey)throw"data needs a key or a name";if(seriesKey==dataKey){var properties=["color","name","data"];properties.forEach(function(p){if(d[p])s[p]=d[p]})}})});return series}});Rickshaw.namespace("Rickshaw.Graph.Annotate");Rickshaw.Graph.Annotate=function(args){var graph=this.graph=args.graph;this.elements={timeline:args.element};var self=this;this.data={};this.elements.timeline.classList.add("rickshaw_annotation_timeline");this.add=function(time,content,end_time){self.data[time]=self.data[time]||{boxes:[]};self.data[time].boxes.push({content:content,end:end_time})};this.update=function(){Rickshaw.keys(self.data).forEach(function(time){var annotation=self.data[time];var left=self.graph.x(time);if(left<0||left>self.graph.x.range()[1]){if(annotation.element){annotation.line.classList.add("offscreen");annotation.element.style.display="none"}annotation.boxes.forEach(function(box){if(box.rangeElement)box.rangeElement.classList.add("offscreen")});return}if(!annotation.element){var element=annotation.element=document.createElement("div");element.classList.add("annotation");this.elements.timeline.appendChild(element);element.addEventListener("click",function(e){element.classList.toggle("active");annotation.line.classList.toggle("active");annotation.boxes.forEach(function(box){if(box.rangeElement)box.rangeElement.classList.toggle("active")})},false)}annotation.element.style.left=left+"px";annotation.element.style.display="block";annotation.boxes.forEach(function(box){var element=box.element;if(!element){element=box.element=document.createElement("div");element.classList.add("content");element.innerHTML=box.content;annotation.element.appendChild(element);annotation.line=document.createElement("div");annotation.line.classList.add("annotation_line");self.graph.element.appendChild(annotation.line);if(box.end){box.rangeElement=document.createElement("div");box.rangeElement.classList.add("annotation_range");self.graph.element.appendChild(box.rangeElement)}}if(box.end){var annotationRangeStart=left;var annotationRangeEnd=Math.min(self.graph.x(box.end),self.graph.x.range()[1]);if(annotationRangeStart>annotationRangeEnd){annotationRangeEnd=left;annotationRangeStart=Math.max(self.graph.x(box.end),self.graph.x.range()[0])}var annotationRangeWidth=annotationRangeEnd-annotationRangeStart;box.rangeElement.style.left=annotationRangeStart+"px";box.rangeElement.style.width=annotationRangeWidth+"px";box.rangeElement.classList.remove("offscreen")}annotation.line.classList.remove("offscreen");annotation.line.style.left=left+"px"})},this)};this.graph.onUpdate(function(){self.update()})};Rickshaw.namespace("Rickshaw.Graph.Axis.Time");Rickshaw.Graph.Axis.Time=function(args){var self=this;this.graph=args.graph;this.elements=[];this.ticksTreatment=args.ticksTreatment||"plain";this.fixedTimeUnit=args.timeUnit;var time=args.timeFixture||new Rickshaw.Fixtures.Time;this.appropriateTimeUnit=function(){var unit;var units=time.units;var domain=this.graph.x.domain();var rangeSeconds=domain[1]-domain[0];units.forEach(function(u){if(Math.floor(rangeSeconds/u.seconds)>=2){unit=unit||u}});return unit||time.units[time.units.length-1]};this.tickOffsets=function(){var domain=this.graph.x.domain();var unit=this.fixedTimeUnit||this.appropriateTimeUnit();var count=Math.ceil((domain[1]-domain[0])/unit.seconds);var runningTick=domain[0];var offsets=[];for(var i=0;i<count;i++){var tickValue=time.ceil(runningTick,unit);runningTick=tickValue+unit.seconds/2;offsets.push({value:tickValue,unit:unit})}return offsets};this.render=function(){this.elements.forEach(function(e){e.parentNode.removeChild(e)});this.elements=[];var offsets=this.tickOffsets();offsets.forEach(function(o){if(self.graph.x(o.value)>self.graph.x.range()[1])return;var element=document.createElement("div");element.style.left=self.graph.x(o.value)+"px";element.classList.add("x_tick");element.classList.add(self.ticksTreatment);var title=document.createElement("div");title.classList.add("title");title.innerHTML=o.unit.formatter(new Date(o.value*1e3));element.appendChild(title);self.graph.element.appendChild(element);self.elements.push(element)})};this.graph.onUpdate(function(){self.render()})};Rickshaw.namespace("Rickshaw.Graph.Axis.X");Rickshaw.Graph.Axis.X=function(args){var self=this;var berthRate=.1;this.initialize=function(args){this.graph=args.graph;this.orientation=args.orientation||"top";this.pixelsPerTick=args.pixelsPerTick||75;if(args.ticks)this.staticTicks=args.ticks;if(args.tickValues)this.tickValues=args.tickValues;this.tickSize=args.tickSize||4;this.ticksTreatment=args.ticksTreatment||"plain";if(args.element){this.element=args.element;this._discoverSize(args.element,args);this.vis=d3.select(args.element).append("svg:svg").attr("height",this.height).attr("width",this.width).attr("class","rickshaw_graph x_axis_d3");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:args.width,height:args.height})}else{this.vis=this.graph.vis}this.graph.onUpdate(function(){self.render()})};this.setSize=function(args){args=args||{};if(!this.element)return;this._discoverSize(this.element.parentNode,args);this.vis.attr("height",this.height).attr("width",this.width*(1+berthRate));var berth=Math.floor(this.width*berthRate/2);this.element.style.left=-1*berth+"px"};this.render=function(){if(this._renderWidth!==undefined&&this.graph.width!==this._renderWidth)this.setSize({auto:true});var axis=d3.svg.axis().scale(this.graph.x).orient(this.orientation);axis.tickFormat(args.tickFormat||function(x){return x});if(this.tickValues)axis.tickValues(this.tickValues);this.ticks=this.staticTicks||Math.floor(this.graph.width/this.pixelsPerTick);var berth=Math.floor(this.width*berthRate/2)||0;var transform;if(this.orientation=="top"){var yOffset=this.height||this.graph.height;transform="translate("+berth+","+yOffset+")"}else{transform="translate("+berth+", 0)"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["x_ticks_d3",this.ticksTreatment].join(" ")).attr("transform",transform).call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));var gridSize=(this.orientation=="bottom"?1:-1)*this.graph.height;this.graph.vis.append("svg:g").attr("class","x_grid_d3").call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize)).selectAll("text").each(function(){this.parentNode.setAttribute("data-x-value",this.textContent)});this._renderHeight=this.graph.height};this._discoverSize=function(element,args){if(typeof window!=="undefined"){var style=window.getComputedStyle(element,null);var elementHeight=parseInt(style.getPropertyValue("height"),10);if(!args.auto){var elementWidth=parseInt(style.getPropertyValue("width"),10)}}this.width=(args.width||elementWidth||this.graph.width)*(1+berthRate);this.height=args.height||elementHeight||40};this.initialize(args)};Rickshaw.namespace("Rickshaw.Graph.Axis.Y");Rickshaw.Graph.Axis.Y=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.orientation=args.orientation||"right";this.pixelsPerTick=args.pixelsPerTick||75;if(args.ticks)this.staticTicks=args.ticks;if(args.tickValues)this.tickValues=args.tickValues;this.tickSize=args.tickSize||4;this.ticksTreatment=args.ticksTreatment||"plain";this.tickFormat=args.tickFormat||function(y){return y};this.berthRate=.1;if(args.element){this.element=args.element;this.vis=d3.select(args.element).append("svg:svg").attr("class","rickshaw_graph y_axis");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:args.width,height:args.height})}else{this.vis=this.graph.vis}var self=this;this.graph.onUpdate(function(){self.render()})},setSize:function(args){args=args||{};if(!this.element)return;if(typeof window!=="undefined"){var style=window.getComputedStyle(this.element.parentNode,null);var elementWidth=parseInt(style.getPropertyValue("width"),10);if(!args.auto){var elementHeight=parseInt(style.getPropertyValue("height"),10)}}this.width=args.width||elementWidth||this.graph.width*this.berthRate;this.height=args.height||elementHeight||this.graph.height;this.vis.attr("width",this.width).attr("height",this.height*(1+this.berthRate));var berth=this.height*this.berthRate;if(this.orientation=="left"){this.element.style.top=-1*berth+"px"}},render:function(){if(this._renderHeight!==undefined&&this.graph.height!==this._renderHeight)this.setSize({auto:true});this.ticks=this.staticTicks||Math.floor(this.graph.height/this.pixelsPerTick);var axis=this._drawAxis(this.graph.y);this._drawGrid(axis);this._renderHeight=this.graph.height},_drawAxis:function(scale){var axis=d3.svg.axis().scale(scale).orient(this.orientation);axis.tickFormat(this.tickFormat);if(this.tickValues)axis.tickValues(this.tickValues);if(this.orientation=="left"){var berth=this.height*this.berthRate;var transform="translate("+this.width+", "+berth+")"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["y_ticks",this.ticksTreatment].join(" ")).attr("transform",transform).call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));return axis},_drawGrid:function(axis){var gridSize=(this.orientation=="right"?1:-1)*this.graph.width;this.graph.vis.append("svg:g").attr("class","y_grid").call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize)).selectAll("text").each(function(){this.parentNode.setAttribute("data-y-value",this.textContent)
+})}});Rickshaw.namespace("Rickshaw.Graph.Axis.Y.Scaled");Rickshaw.Graph.Axis.Y.Scaled=Rickshaw.Class.create(Rickshaw.Graph.Axis.Y,{initialize:function($super,args){if(typeof args.scale==="undefined"){throw new Error("Scaled requires scale")}this.scale=args.scale;if(typeof args.grid==="undefined"){this.grid=true}else{this.grid=args.grid}$super(args)},_drawAxis:function($super,scale){var domain=this.scale.domain();var renderDomain=this.graph.renderer.domain().y;var extents=[Math.min.apply(Math,domain),Math.max.apply(Math,domain)];var extentMap=d3.scale.linear().domain([0,1]).range(extents);var adjExtents=[extentMap(renderDomain[0]),extentMap(renderDomain[1])];var adjustment=d3.scale.linear().domain(extents).range(adjExtents);var adjustedScale=this.scale.copy().domain(domain.map(adjustment)).range(scale.range());return $super(adjustedScale)},_drawGrid:function($super,axis){if(this.grid){$super(axis)}}});Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Highlight");Rickshaw.Graph.Behavior.Series.Highlight=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;var colorSafe={};var activeLine=null;var disabledColor=args.disabledColor||function(seriesColor){return d3.interpolateRgb(seriesColor,d3.rgb("#d8d8d8"))(.8).toString()};this.addHighlightEvents=function(l){l.element.addEventListener("mouseover",function(e){if(activeLine)return;else activeLine=l;self.legend.lines.forEach(function(line){if(l===line){if(self.graph.renderer.unstack&&(line.series.renderer?line.series.renderer.unstack:true)){var seriesIndex=self.graph.series.indexOf(line.series);line.originalIndex=seriesIndex;var series=self.graph.series.splice(seriesIndex,1)[0];self.graph.series.push(series)}return}colorSafe[line.series.name]=colorSafe[line.series.name]||line.series.color;line.series.color=disabledColor(line.series.color)});self.graph.update()},false);l.element.addEventListener("mouseout",function(e){if(!activeLine)return;else activeLine=null;self.legend.lines.forEach(function(line){if(l===line&&line.hasOwnProperty("originalIndex")){var series=self.graph.series.pop();self.graph.series.splice(line.originalIndex,0,series);delete line.originalIndex}if(colorSafe[line.series.name]){line.series.color=colorSafe[line.series.name]}});self.graph.update()},false)};if(this.legend){this.legend.lines.forEach(function(l){self.addHighlightEvents(l)})}};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Order");Rickshaw.Graph.Behavior.Series.Order=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;if(typeof window.jQuery=="undefined"){throw"couldn't find jQuery at window.jQuery"}if(typeof window.jQuery.ui=="undefined"){throw"couldn't find jQuery UI at window.jQuery.ui"}jQuery(function(){jQuery(self.legend.list).sortable({containment:"parent",tolerance:"pointer",update:function(event,ui){var series=[];jQuery(self.legend.list).find("li").each(function(index,item){if(!item.series)return;series.push(item.series)});for(var i=self.graph.series.length-1;i>=0;i--){self.graph.series[i]=series.shift()}self.graph.update()}});jQuery(self.legend.list).disableSelection()});this.graph.onUpdate(function(){var h=window.getComputedStyle(self.legend.element).height;self.legend.element.style.height=h})};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Toggle");Rickshaw.Graph.Behavior.Series.Toggle=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;this.addAnchor=function(line){var anchor=document.createElement("a");anchor.innerHTML="&#10004;";anchor.classList.add("action");line.element.insertBefore(anchor,line.element.firstChild);anchor.onclick=function(e){if(line.series.disabled){line.series.enable();line.element.classList.remove("disabled")}else{if(this.graph.series.filter(function(s){return!s.disabled}).length<=1)return;line.series.disable();line.element.classList.add("disabled")}self.graph.update()}.bind(this);var label=line.element.getElementsByTagName("span")[0];label.onclick=function(e){var disableAllOtherLines=line.series.disabled;if(!disableAllOtherLines){for(var i=0;i<self.legend.lines.length;i++){var l=self.legend.lines[i];if(line.series===l.series){}else if(l.series.disabled){}else{disableAllOtherLines=true;break}}}if(disableAllOtherLines){line.series.enable();line.element.classList.remove("disabled");self.legend.lines.forEach(function(l){if(line.series===l.series){}else{l.series.disable();l.element.classList.add("disabled")}})}else{self.legend.lines.forEach(function(l){l.series.enable();l.element.classList.remove("disabled")})}self.graph.update()}};if(this.legend){var $=jQuery;if(typeof $!="undefined"&&$(this.legend.list).sortable){$(this.legend.list).sortable({start:function(event,ui){ui.item.bind("no.onclick",function(event){event.preventDefault()})},stop:function(event,ui){setTimeout(function(){ui.item.unbind("no.onclick")},250)}})}this.legend.lines.forEach(function(l){self.addAnchor(l)})}this._addBehavior=function(){this.graph.series.forEach(function(s){s.disable=function(){if(self.graph.series.length<=1){throw"only one series left"}s.disabled=true};s.enable=function(){s.disabled=false}})};this._addBehavior();this.updateBehaviour=function(){this._addBehavior()}};Rickshaw.namespace("Rickshaw.Graph.HoverDetail");Rickshaw.Graph.HoverDetail=Rickshaw.Class.create({initialize:function(args){var graph=this.graph=args.graph;this.xFormatter=args.xFormatter||function(x){return new Date(x*1e3).toUTCString()};this.yFormatter=args.yFormatter||function(y){return y===null?y:y.toFixed(2)};var element=this.element=document.createElement("div");element.className="detail";this.visible=true;graph.element.appendChild(element);this.lastEvent=null;this._addListeners();this.onShow=args.onShow;this.onHide=args.onHide;this.onRender=args.onRender;this.formatter=args.formatter||this.formatter},formatter:function(series,x,y,formattedX,formattedY,d){return series.name+":&nbsp;"+formattedY},update:function(e){e=e||this.lastEvent;if(!e)return;this.lastEvent=e;if(!e.target.nodeName.match(/^(path|svg|rect|circle)$/))return;var graph=this.graph;var eventX=e.offsetX||e.layerX;var eventY=e.offsetY||e.layerY;var j=0;var points=[];var nearestPoint;this.graph.series.active().forEach(function(series){var data=this.graph.stackedData[j++];if(!data.length)return;var domainX=graph.x.invert(eventX);var domainIndexScale=d3.scale.linear().domain([data[0].x,data.slice(-1)[0].x]).range([0,data.length-1]);var approximateIndex=Math.round(domainIndexScale(domainX));if(approximateIndex==data.length-1)approximateIndex--;var dataIndex=Math.min(approximateIndex||0,data.length-1);for(var i=approximateIndex;i<data.length-1;){if(!data[i]||!data[i+1])break;if(data[i].x<=domainX&&data[i+1].x>domainX){dataIndex=Math.abs(domainX-data[i].x)<Math.abs(domainX-data[i+1].x)?i:i+1;break}if(data[i+1].x<=domainX){i++}else{i--}}if(dataIndex<0)dataIndex=0;var value=data[dataIndex];var distance=Math.sqrt(Math.pow(Math.abs(graph.x(value.x)-eventX),2)+Math.pow(Math.abs(graph.y(value.y+value.y0)-eventY),2));var xFormatter=series.xFormatter||this.xFormatter;var yFormatter=series.yFormatter||this.yFormatter;var point={formattedXValue:xFormatter(value.x),formattedYValue:yFormatter(series.scale?series.scale.invert(value.y):value.y),series:series,value:value,distance:distance,order:j,name:series.name};if(!nearestPoint||distance<nearestPoint.distance){nearestPoint=point}points.push(point)},this);if(!nearestPoint)return;nearestPoint.active=true;var domainX=nearestPoint.value.x;var formattedXValue=nearestPoint.formattedXValue;this.element.innerHTML="";this.element.style.left=graph.x(domainX)+"px";this.visible&&this.render({points:points,detail:points,mouseX:eventX,mouseY:eventY,formattedXValue:formattedXValue,domainX:domainX})},hide:function(){this.visible=false;this.element.classList.add("inactive");if(typeof this.onHide=="function"){this.onHide()}},show:function(){this.visible=true;this.element.classList.remove("inactive");if(typeof this.onShow=="function"){this.onShow()}},render:function(args){var graph=this.graph;var points=args.points;var point=points.filter(function(p){return p.active}).shift();if(point.value.y===null)return;var formattedXValue=point.formattedXValue;var formattedYValue=point.formattedYValue;this.element.innerHTML="";this.element.style.left=graph.x(point.value.x)+"px";var xLabel=document.createElement("div");xLabel.className="x_label";xLabel.innerHTML=formattedXValue;this.element.appendChild(xLabel);var item=document.createElement("div");item.className="item";var series=point.series;var actualY=series.scale?series.scale.invert(point.value.y):point.value.y;item.innerHTML=this.formatter(series,point.value.x,actualY,formattedXValue,formattedYValue,point);item.style.top=this.graph.y(point.value.y0+point.value.y)+"px";this.element.appendChild(item);var dot=document.createElement("div");dot.className="dot";dot.style.top=item.style.top;dot.style.borderColor=series.color;this.element.appendChild(dot);if(point.active){item.classList.add("active");dot.classList.add("active")}var alignables=[xLabel,item];alignables.forEach(function(el){el.classList.add("left")});this.show();var leftAlignError=this._calcLayoutError(alignables);if(leftAlignError>0){alignables.forEach(function(el){el.classList.remove("left");el.classList.add("right")});var rightAlignError=this._calcLayoutError(alignables);if(rightAlignError>leftAlignError){alignables.forEach(function(el){el.classList.remove("right");el.classList.add("left")})}}if(typeof this.onRender=="function"){this.onRender(args)}},_calcLayoutError:function(alignables){var parentRect=this.element.parentNode.getBoundingClientRect();var error=0;var alignRight=alignables.forEach(function(el){var rect=el.getBoundingClientRect();if(!rect.width){return}if(rect.right>parentRect.right){error+=rect.right-parentRect.right}if(rect.left<parentRect.left){error+=parentRect.left-rect.left}});return error},_addListeners:function(){this.graph.element.addEventListener("mousemove",function(e){this.visible=true;this.update(e)}.bind(this),false);this.graph.onUpdate(function(){this.update()}.bind(this));this.graph.element.addEventListener("mouseout",function(e){if(e.relatedTarget&&!(e.relatedTarget.compareDocumentPosition(this.graph.element)&Node.DOCUMENT_POSITION_CONTAINS)){this.hide()}}.bind(this),false)}});Rickshaw.namespace("Rickshaw.Graph.JSONP");Rickshaw.Graph.JSONP=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){jQuery.ajax({url:this.dataURL,dataType:"jsonp",success:this.success.bind(this),error:this.error.bind(this)})}});Rickshaw.namespace("Rickshaw.Graph.Legend");Rickshaw.Graph.Legend=Rickshaw.Class.create({className:"rickshaw_legend",initialize:function(args){this.element=args.element;this.graph=args.graph;this.naturalOrder=args.naturalOrder;this.element.classList.add(this.className);this.list=document.createElement("ul");this.element.appendChild(this.list);this.render();this.graph.onUpdate(function(){})},render:function(){var self=this;while(this.list.firstChild){this.list.removeChild(this.list.firstChild)}this.lines=[];var series=this.graph.series.map(function(s){return s});if(!this.naturalOrder){series=series.reverse()}series.forEach(function(s){self.addLine(s)})},addLine:function(series){var line=document.createElement("li");line.className="line";if(series.disabled){line.className+=" disabled"}if(series.className){d3.select(line).classed(series.className,true)}var swatch=document.createElement("div");swatch.className="swatch";swatch.style.backgroundColor=series.color;line.appendChild(swatch);var label=document.createElement("span");label.className="label";label.innerHTML=series.name;line.appendChild(label);this.list.appendChild(line);line.series=series;if(series.noLegend){line.style.display="none"}var _line={element:line,series:series};if(this.shelving){this.shelving.addAnchor(_line);this.shelving.updateBehaviour()}if(this.highlighter){this.highlighter.addHighlightEvents(_line)}this.lines.push(_line);return line}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider");Rickshaw.Graph.RangeSlider=Rickshaw.Class.create({initialize:function(args){var element=this.element=args.element;var graph=this.graph=args.graph;this.slideCallbacks=[];this.build();graph.onUpdate(function(){this.update()}.bind(this))},build:function(){var element=this.element;var graph=this.graph;var $=jQuery;var domain=graph.dataDomain();var self=this;$(function(){$(element).slider({range:true,min:domain[0],max:domain[1],values:[domain[0],domain[1]],slide:function(event,ui){if(ui.values[1]<=ui.values[0])return;graph.window.xMin=ui.values[0];graph.window.xMax=ui.values[1];graph.update();var domain=graph.dataDomain();if(domain[0]==ui.values[0]){graph.window.xMin=undefined}if(domain[1]==ui.values[1]){graph.window.xMax=undefined}self.slideCallbacks.forEach(function(callback){callback(graph,graph.window.xMin,graph.window.xMax)})}})});$(element)[0].style.width=graph.width+"px"},update:function(){var element=this.element;var graph=this.graph;var $=jQuery;var values=$(element).slider("option","values");var domain=graph.dataDomain();$(element).slider("option","min",domain[0]);$(element).slider("option","max",domain[1]);if(graph.window.xMin==null){values[0]=domain[0]}if(graph.window.xMax==null){values[1]=domain[1]}$(element).slider("option","values",values)},onSlide:function(callback){this.slideCallbacks.push(callback)}});Rickshaw.namespace("Rickshaw.Graph.RangeSlider.Preview");Rickshaw.Graph.RangeSlider.Preview=Rickshaw.Class.create({initialize:function(args){if(!args.element)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an element";if(!args.graph&&!args.graphs)throw"Rickshaw.Graph.RangeSlider.Preview needs a reference to an graph or an array of graphs";this.element=args.element;this.element.style.position="relative";this.graphs=args.graph?[args.graph]:args.graphs;this.defaults={height:75,width:400,gripperColor:undefined,frameTopThickness:3,frameHandleThickness:10,frameColor:"#d4d4d4",frameOpacity:1,minimumFrameWidth:0,heightRatio:.2};this.heightRatio=args.heightRatio||this.defaults.heightRatio;this.defaults.gripperColor=d3.rgb(this.defaults.frameColor).darker().toString();this.configureCallbacks=[];this.slideCallbacks=[];this.previews=[];if(!args.width)this.widthFromGraph=true;if(!args.height)this.heightFromGraph=true;if(this.widthFromGraph||this.heightFromGraph){this.graphs[0].onConfigure(function(){this.configure(args);this.render()}.bind(this))}args.width=args.width||this.graphs[0].width||this.defaults.width;args.height=args.height||this.graphs[0].height*this.heightRatio||this.defaults.height;this.configure(args);this.render()},onSlide:function(callback){this.slideCallbacks.push(callback)},onConfigure:function(callback){this.configureCallbacks.push(callback)},configure:function(args){this.config=this.config||{};this.configureCallbacks.forEach(function(callback){callback(args)});Rickshaw.keys(this.defaults).forEach(function(k){this.config[k]=k in args?args[k]:k in this.config?this.config[k]:this.defaults[k]},this);if("width"in args||"height"in args){if(this.widthFromGraph){this.config.width=this.graphs[0].width}if(this.heightFromGraph){this.config.height=this.graphs[0].height*this.heightRatio;this.previewHeight=this.config.height}this.previews.forEach(function(preview){var height=this.previewHeight/this.graphs.length-this.config.frameTopThickness*2;var width=this.config.width-this.config.frameHandleThickness*2;preview.setSize({width:width,height:height});if(this.svg){var svgHeight=height+this.config.frameHandleThickness*2;var svgWidth=width+this.config.frameHandleThickness*2;this.svg.style("width",svgWidth+"px");this.svg.style("height",svgHeight+"px")}},this)}},render:function(){var self=this;this.svg=d3.select(this.element).selectAll("svg.rickshaw_range_slider_preview").data([null]);this.previewHeight=this.config.height-this.config.frameTopThickness*2;this.previewWidth=this.config.width-this.config.frameHandleThickness*2;this.currentFrame=[0,this.previewWidth];var buildGraph=function(parent,index){var graphArgs=Rickshaw.extend({},parent.config);var height=self.previewHeight/self.graphs.length;var renderer=parent.renderer.name;Rickshaw.extend(graphArgs,{element:this.appendChild(document.createElement("div")),height:height,width:self.previewWidth,series:parent.series,renderer:renderer});var graph=new Rickshaw.Graph(graphArgs);self.previews.push(graph);parent.onUpdate(function(){graph.render();self.render()});parent.onConfigure(function(args){delete args.height;args.width=args.width-self.config.frameHandleThickness*2;graph.configure(args);graph.render()});graph.render()};var graphContainer=d3.select(this.element).selectAll("div.rickshaw_range_slider_preview_container").data(this.graphs);var translateCommand="translate("+this.config.frameHandleThickness+"px, "+this.config.frameTopThickness+"px)";graphContainer.enter().append("div").classed("rickshaw_range_slider_preview_container",true).style("-webkit-transform",translateCommand).style("-moz-transform",translateCommand).style("-ms-transform",translateCommand).style("transform",translateCommand).each(buildGraph);graphContainer.exit().remove();var masterGraph=this.graphs[0];var domainScale=d3.scale.linear().domain([0,this.previewWidth]).range(masterGraph.dataDomain());var currentWindow=[masterGraph.window.xMin,masterGraph.window.xMax];this.currentFrame[0]=currentWindow[0]===undefined?0:Math.round(domainScale.invert(currentWindow[0]));if(this.currentFrame[0]<0)this.currentFrame[0]=0;this.currentFrame[1]=currentWindow[1]===undefined?this.previewWidth:domainScale.invert(currentWindow[1]);if(this.currentFrame[1]-this.currentFrame[0]<self.config.minimumFrameWidth){this.currentFrame[1]=(this.currentFrame[0]||0)+self.config.minimumFrameWidth}this.svg.enter().append("svg").classed("rickshaw_range_slider_preview",true).style("height",this.config.height+"px").style("width",this.config.width+"px").style("position","absolute").style("top",0);this._renderDimming();this._renderFrame();this._renderGrippers();this._renderHandles();this._renderMiddle();this._registerMouseEvents()},_renderDimming:function(){var element=this.svg.selectAll("path.dimming").data([null]);element.enter().append("path").attr("fill","white").attr("fill-opacity","0.7").attr("fill-rule","evenodd").classed("dimming",true);var path="";path+=" M "+this.config.frameHandleThickness+" "+this.config.frameTopThickness;path+=" h "+this.previewWidth;path+=" v "+this.previewHeight;path+=" h "+-this.previewWidth;path+=" z ";path+=" M "+Math.max(this.currentFrame[0],this.config.frameHandleThickness)+" "+this.config.frameTopThickness;path+=" H "+Math.min(this.currentFrame[1]+this.config.frameHandleThickness*2,this.previewWidth+this.config.frameHandleThickness);path+=" v "+this.previewHeight;path+=" H "+Math.max(this.currentFrame[0],this.config.frameHandleThickness);path+=" z";element.attr("d",path)},_renderFrame:function(){var element=this.svg.selectAll("path.frame").data([null]);element.enter().append("path").attr("stroke","white").attr("stroke-width","1px").attr("stroke-linejoin","round").attr("fill",this.config.frameColor).attr("fill-opacity",this.config.frameOpacity).attr("fill-rule","evenodd").classed("frame",true);var path="";path+=" M "+this.currentFrame[0]+" 0";path+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness*2);path+=" V "+this.config.height;path+=" H "+this.currentFrame[0];path+=" z";path+=" M "+(this.currentFrame[0]+this.config.frameHandleThickness)+" "+this.config.frameTopThickness;path+=" H "+(this.currentFrame[1]+this.config.frameHandleThickness);path+=" v "+this.previewHeight;path+=" H "+(this.currentFrame[0]+this.config.frameHandleThickness);path+=" z";element.attr("d",path)},_renderGrippers:function(){var gripper=this.svg.selectAll("path.gripper").data([null]);gripper.enter().append("path").attr("stroke",this.config.gripperColor).classed("gripper",true);var path="";[.4,.6].forEach(function(spacing){path+=" M "+Math.round(this.currentFrame[0]+this.config.frameHandleThickness*spacing)+" "+Math.round(this.config.height*.3);path+=" V "+Math.round(this.config.height*.7);path+=" M "+Math.round(this.currentFrame[1]+this.config.frameHandleThickness*(1+spacing))+" "+Math.round(this.config.height*.3);path+=" V "+Math.round(this.config.height*.7)}.bind(this));gripper.attr("d",path)},_renderHandles:function(){var leftHandle=this.svg.selectAll("rect.left_handle").data([null]);leftHandle.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("left_handle",true);leftHandle.attr("x",this.currentFrame[0]).attr("height",this.config.height);var rightHandle=this.svg.selectAll("rect.right_handle").data([null]);rightHandle.enter().append("rect").attr("width",this.config.frameHandleThickness).style("cursor","ew-resize").style("fill-opacity","0").classed("right_handle",true);rightHandle.attr("x",this.currentFrame[1]+this.config.frameHandleThickness).attr("height",this.config.height)},_renderMiddle:function(){var middleHandle=this.svg.selectAll("rect.middle_handle").data([null]);middleHandle.enter().append("rect").style("cursor","move").style("fill-opacity","0").classed("middle_handle",true);middleHandle.attr("width",Math.max(0,this.currentFrame[1]-this.currentFrame[0])).attr("x",this.currentFrame[0]+this.config.frameHandleThickness).attr("height",this.config.height)},_registerMouseEvents:function(){var element=d3.select(this.element);var drag={target:null,start:null,stop:null,left:false,right:false,rigid:false};var self=this;function onMousemove(datum,index){drag.stop=self._getClientXFromEvent(d3.event,drag);var distanceTraveled=drag.stop-drag.start;var frameAfterDrag=self.frameBeforeDrag.slice(0);var minimumFrameWidth=self.config.minimumFrameWidth;if(drag.rigid){minimumFrameWidth=self.frameBeforeDrag[1]-self.frameBeforeDrag[0]}if(drag.left){frameAfterDrag[0]=Math.max(frameAfterDrag[0]+distanceTraveled,0)}if(drag.right){frameAfterDrag[1]=Math.min(frameAfterDrag[1]+distanceTraveled,self.previewWidth)}var currentFrameWidth=frameAfterDrag[1]-frameAfterDrag[0];if(currentFrameWidth<=minimumFrameWidth){if(drag.left){frameAfterDrag[0]=frameAfterDrag[1]-minimumFrameWidth}if(drag.right){frameAfterDrag[1]=frameAfterDrag[0]+minimumFrameWidth}if(frameAfterDrag[0]<=0){frameAfterDrag[1]-=frameAfterDrag[0];frameAfterDrag[0]=0}if(frameAfterDrag[1]>=self.previewWidth){frameAfterDrag[0]-=frameAfterDrag[1]-self.previewWidth;frameAfterDrag[1]=self.previewWidth}}self.graphs.forEach(function(graph){var domainScale=d3.scale.linear().interpolate(d3.interpolateNumber).domain([0,self.previewWidth]).range(graph.dataDomain());var windowAfterDrag=[domainScale(frameAfterDrag[0]),domainScale(frameAfterDrag[1])];self.slideCallbacks.forEach(function(callback){callback(graph,windowAfterDrag[0],windowAfterDrag[1])});if(frameAfterDrag[0]===0){windowAfterDrag[0]=undefined}if(frameAfterDrag[1]===self.previewWidth){windowAfterDrag[1]=undefined}graph.window.xMin=windowAfterDrag[0];graph.window.xMax=windowAfterDrag[1];graph.update()})}function onMousedown(){drag.target=d3.event.target;drag.start=self._getClientXFromEvent(d3.event,drag);self.frameBeforeDrag=self.currentFrame.slice();d3.event.preventDefault?d3.event.preventDefault():d3.event.returnValue=false;d3.select(document).on("mousemove.rickshaw_range_slider_preview",onMousemove);d3.select(document).on("mouseup.rickshaw_range_slider_preview",onMouseup);d3.select(document).on("touchmove.rickshaw_range_slider_preview",onMousemove);d3.select(document).on("touchend.rickshaw_range_slider_preview",onMouseup);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",onMouseup)}function onMousedownLeftHandle(datum,index){drag.left=true;onMousedown()}function onMousedownRightHandle(datum,index){drag.right=true;onMousedown()}function onMousedownMiddleHandle(datum,index){drag.left=true;drag.right=true;drag.rigid=true;onMousedown()}function onMouseup(datum,index){d3.select(document).on("mousemove.rickshaw_range_slider_preview",null);d3.select(document).on("mouseup.rickshaw_range_slider_preview",null);d3.select(document).on("touchmove.rickshaw_range_slider_preview",null);d3.select(document).on("touchend.rickshaw_range_slider_preview",null);d3.select(document).on("touchcancel.rickshaw_range_slider_preview",null);delete self.frameBeforeDrag;drag.left=false;drag.right=false;drag.rigid=false}element.select("rect.left_handle").on("mousedown",onMousedownLeftHandle);element.select("rect.right_handle").on("mousedown",onMousedownRightHandle);element.select("rect.middle_handle").on("mousedown",onMousedownMiddleHandle);element.select("rect.left_handle").on("touchstart",onMousedownLeftHandle);element.select("rect.right_handle").on("touchstart",onMousedownRightHandle);element.select("rect.middle_handle").on("touchstart",onMousedownMiddleHandle)},_getClientXFromEvent:function(event,drag){switch(event.type){case"touchstart":case"touchmove":var touchList=event.changedTouches;var touch=null;for(var touchIndex=0;touchIndex<touchList.length;touchIndex++){if(touchList[touchIndex].target===drag.target){touch=touchList[touchIndex];break}}return touch!==null?touch.clientX:undefined;default:return event.clientX}}});Rickshaw.namespace("Rickshaw.Graph.Renderer");Rickshaw.Graph.Renderer=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.tension=args.tension||this.tension;this.configure(args)},seriesPathFactory:function(){},seriesStrokeFactory:function(){},defaults:function(){return{tension:.8,strokeWidth:2,unstack:true,padding:{top:.01,right:0,bottom:.01,left:0},stroke:false,fill:false}},domain:function(data){var stackedData=data||this.graph.stackedData||this.graph.stackData();var xMin=+Infinity;var xMax=-Infinity;var yMin=+Infinity;var yMax=-Infinity;stackedData.forEach(function(series){series.forEach(function(d){if(d.y==null)return;var y=d.y+d.y0;if(y<yMin)yMin=y;if(y>yMax)yMax=y});if(!series.length)return;if(series[0].x<xMin)xMin=series[0].x;if(series[series.length-1].x>xMax)xMax=series[series.length-1].x});xMin-=(xMax-xMin)*this.padding.left;xMax+=(xMax-xMin)*this.padding.right;yMin=this.graph.min==="auto"?yMin:this.graph.min||0;yMax=this.graph.max===undefined?yMax:this.graph.max;if(this.graph.min==="auto"||yMin<0){yMin-=(yMax-yMin)*this.padding.bottom}if(this.graph.max===undefined){yMax+=(yMax-yMin)*this.padding.top}return{x:[xMin,xMax],y:[yMin,yMax]}},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var pathNodes=vis.selectAll("path.path").data(data).enter().append("svg:path").classed("path",true).attr("d",this.seriesPathFactory());if(this.stroke){var strokeNodes=vis.selectAll("path.stroke").data(data).enter().append("svg:path").classed("stroke",true).attr("d",this.seriesStrokeFactory())}var i=0;series.forEach(function(series){if(series.disabled)return;series.path=pathNodes[0][i];if(this.stroke)series.stroke=strokeNodes[0][i];this._styleSeries(series);i++},this)},_styleSeries:function(series){var fill=this.fill?series.color:"none";var stroke=this.stroke?series.color:"none";series.path.setAttribute("fill",fill);series.path.setAttribute("stroke",stroke);series.path.setAttribute("stroke-width",this.strokeWidth);if(series.className){d3.select(series.path).classed(series.className,true)}if(series.className&&this.stroke){d3.select(series.stroke).classed(series.className,true)}},configure:function(args){args=args||{};Rickshaw.keys(this.defaults()).forEach(function(key){if(!args.hasOwnProperty(key)){this[key]=this[key]||this.graph[key]||this.defaults()[key];return}if(typeof this.defaults()[key]=="object"){Rickshaw.keys(this.defaults()[key]).forEach(function(k){this[key][k]=args[key][k]!==undefined?args[key][k]:this[key][k]!==undefined?this[key][k]:this.defaults()[key][k]},this)}else{this[key]=args[key]!==undefined?args[key]:this[key]!==undefined?this[key]:this.graph[key]!==undefined?this.graph[key]:this.defaults()[key]}},this)},setStrokeWidth:function(strokeWidth){if(strokeWidth!==undefined){this.strokeWidth=strokeWidth}},setTension:function(tension){if(tension!==undefined){this.tension=tension}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Line");Rickshaw.Graph.Renderer.Line=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"line",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Stack");Rickshaw.Graph.Renderer.Stack=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"stack",defaults:function($super){return Rickshaw.extend($super(),{fill:true,stroke:false,unstack:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Bar");Rickshaw.Graph.Renderer.Bar=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"bar",defaults:function($super){var defaults=Rickshaw.extend($super(),{gapSize:.05,unstack:false});delete defaults.tension;return defaults},initialize:function($super,args){args=args||{};this.gapSize=args.gapSize||this.gapSize;$super(args)},domain:function($super){var domain=$super();var frequentInterval=this._frequentInterval(this.graph.stackedData.slice(-1).shift());domain.x[1]+=Number(frequentInterval.magnitude);return domain},barWidth:function(series){var frequentInterval=this._frequentInterval(series.stack);var barWidth=this.graph.x.magnitude(frequentInterval.magnitude)*(1-this.gapSize);return barWidth},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var barWidth=this.barWidth(series.active()[0]);var barXOffset=0;var activeSeriesCount=series.filter(function(s){return!s.disabled}).length;var seriesBarWidth=this.unstack?barWidth/activeSeriesCount:barWidth;var transform=function(d){var matrix=[1,0,0,d.y<0?-1:1,0,d.y<0?graph.y.magnitude(Math.abs(d.y))*2:0];return"matrix("+matrix.join(",")+")"};series.forEach(function(series){if(series.disabled)return;var barWidth=this.barWidth(series);var nodes=vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:rect").attr("x",function(d){return graph.x(d.x)+barXOffset}).attr("y",function(d){return graph.y(d.y0+Math.abs(d.y))*(d.y<0?-1:1)}).attr("width",seriesBarWidth).attr("height",function(d){return graph.y.magnitude(Math.abs(d.y))}).attr("transform",transform);Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)});if(this.unstack)barXOffset+=seriesBarWidth},this)},_frequentInterval:function(data){var intervalCounts={};for(var i=0;i<data.length-1;i++){var interval=data[i+1].x-data[i].x;intervalCounts[interval]=intervalCounts[interval]||0;intervalCounts[interval]++}var frequentInterval={count:0,magnitude:1};Rickshaw.keys(intervalCounts).forEach(function(i){if(frequentInterval.count<intervalCounts[i]){frequentInterval={count:intervalCounts[i],magnitude:i}}});return frequentInterval}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Area");Rickshaw.Graph.Renderer.Area=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"area",defaults:function($super){return Rickshaw.extend($super(),{unstack:false,fill:false,stroke:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);
+factory.defined&&factory.defined(function(d){return d.y!==null});return factory},seriesStrokeFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;vis.selectAll("*").remove();var method=this.unstack?"append":"insert";var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var nodes=vis.selectAll("path").data(data).enter()[method]("svg:g","g");nodes.append("svg:path").attr("d",this.seriesPathFactory()).attr("class","area");if(this.stroke){nodes.append("svg:path").attr("d",this.seriesStrokeFactory()).attr("class","line")}var i=0;series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this)},_styleSeries:function(series){if(!series.path)return;d3.select(series.path).select(".area").attr("fill",series.color);if(this.stroke){d3.select(series.path).select(".line").attr("fill","none").attr("stroke",series.stroke||d3.interpolateRgb(series.color,"black")(.125)).attr("stroke-width",this.strokeWidth)}if(series.className){series.path.setAttribute("class",series.className)}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.ScatterPlot");Rickshaw.Graph.Renderer.ScatterPlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"scatterplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:true,stroke:false,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:4})},initialize:function($super,args){$super(args)},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;var dotSize=this.dotSize;vis.selectAll("*").remove();series.forEach(function(series){if(series.disabled)return;var nodes=vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:circle").attr("cx",function(d){return graph.x(d.x)}).attr("cy",function(d){return graph.y(d.y)}).attr("r",function(d){return"r"in d?d.r:dotSize});if(series.className){nodes.classed(series.className,true)}Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)})},this)}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Multi");Rickshaw.Graph.Renderer.Multi=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"multi",initialize:function($super,args){$super(args)},defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},configure:function($super,args){args=args||{};this.config=args;$super(args)},domain:function($super){this.graph.stackData();var domains=[];var groups=this._groups();this._stack(groups);groups.forEach(function(group){var data=group.series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});if(!data.length)return;var domain=null;if(group.renderer&&group.renderer.domain){domain=group.renderer.domain(data)}else{domain=$super(data)}domains.push(domain)});var xMin=d3.min(domains.map(function(d){return d.x[0]}));var xMax=d3.max(domains.map(function(d){return d.x[1]}));var yMin=d3.min(domains.map(function(d){return d.y[0]}));var yMax=d3.max(domains.map(function(d){return d.y[1]}));return{x:[xMin,xMax],y:[yMin,yMax]}},_groups:function(){var graph=this.graph;var renderGroups={};graph.series.forEach(function(series){if(series.disabled)return;if(!renderGroups[series.renderer]){var ns="http://www.w3.org/2000/svg";var vis=document.createElementNS(ns,"g");graph.vis[0][0].appendChild(vis);var renderer=graph._renderers[series.renderer];var config={};var defaults=[this.defaults(),renderer.defaults(),this.config,this.graph];defaults.forEach(function(d){Rickshaw.extend(config,d)});renderer.configure(config);renderGroups[series.renderer]={renderer:renderer,series:[],vis:d3.select(vis)}}renderGroups[series.renderer].series.push(series)},this);var groups=[];Object.keys(renderGroups).forEach(function(key){var group=renderGroups[key];groups.push(group)});return groups},_stack:function(groups){groups.forEach(function(group){var series=group.series.filter(function(series){return!series.disabled});var data=series.map(function(series){return series.stack});if(!group.renderer.unstack){var layout=d3.layout.stack();var stackedData=Rickshaw.clone(layout(data));series.forEach(function(series,index){series._stack=Rickshaw.clone(stackedData[index])})}},this);return groups},render:function(){this.graph.series.forEach(function(series){if(!series.renderer){throw new Error("Each series needs a renderer for graph 'multi' renderer")}});this.graph.vis.selectAll("*").remove();var groups=this._groups();groups=this._stack(groups);groups.forEach(function(group){var series=group.series.filter(function(series){return!series.disabled});series.active=function(){return series};group.renderer.render({series:series,vis:group.vis});series.forEach(function(s){s.stack=s._stack||s.stack||s.data})})}});Rickshaw.namespace("Rickshaw.Graph.Renderer.LinePlot");Rickshaw.Graph.Renderer.LinePlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"lineplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:3,strokeWidth:2})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},render:function(args){args=args||{};var graph=this.graph;var series=args.series||graph.series;var vis=args.vis||graph.vis;var dotSize=this.dotSize;vis.selectAll("*").remove();var data=series.filter(function(s){return!s.disabled}).map(function(s){return s.stack});var nodes=vis.selectAll("path").data(data).enter().append("svg:path").attr("d",this.seriesPathFactory());var i=0;series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this);series.forEach(function(series){if(series.disabled)return;var nodes=vis.selectAll("x").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:circle").attr("cx",function(d){return graph.x(d.x)}).attr("cy",function(d){return graph.y(d.y)}).attr("r",function(d){return"r"in d?d.r:dotSize});Array.prototype.forEach.call(nodes[0],function(n){if(!n)return;n.setAttribute("data-color",series.color);n.setAttribute("fill","white");n.setAttribute("stroke",series.color);n.setAttribute("stroke-width",this.strokeWidth)}.bind(this))},this)}});Rickshaw.namespace("Rickshaw.Graph.Smoother");Rickshaw.Graph.Smoother=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.element=args.element;this.aggregationScale=1;this.build();this.graph.stackData.hooks.data.push({name:"smoother",orderPosition:50,f:this.transformer.bind(this)})},build:function(){var self=this;var $=jQuery;if(this.element){$(function(){$(self.element).slider({min:1,max:100,slide:function(event,ui){self.setScale(ui.value)}})})}},setScale:function(scale){if(scale<1){throw"scale out of range: "+scale}this.aggregationScale=scale;this.graph.update()},transformer:function(data){if(this.aggregationScale==1)return data;var aggregatedData=[];data.forEach(function(seriesData){var aggregatedSeriesData=[];while(seriesData.length){var avgX=0,avgY=0;var slice=seriesData.splice(0,this.aggregationScale);slice.forEach(function(d){avgX+=d.x/slice.length;avgY+=d.y/slice.length});aggregatedSeriesData.push({x:avgX,y:avgY})}aggregatedData.push(aggregatedSeriesData)}.bind(this));return aggregatedData}});Rickshaw.namespace("Rickshaw.Graph.Socketio");Rickshaw.Graph.Socketio=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){var socket=io.connect(this.dataURL);var self=this;socket.on("rickshaw",function(data){self.success(data)})}});Rickshaw.namespace("Rickshaw.Series");Rickshaw.Series=Rickshaw.Class.create(Array,{initialize:function(data,palette,options){options=options||{};this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;var timeInterval=typeof options.timeInterval=="undefined"?1e3:options.timeInterval;this.setTimeInterval(timeInterval);if(data&&typeof data=="object"&&Array.isArray(data)){data.forEach(function(item){this.addItem(item)},this)}},addItem:function(item){if(typeof item.name==="undefined"){throw"addItem() needs a name"}item.color=item.color||this.palette.color(item.name);item.data=item.data||[];if(item.data.length===0&&this.length&&this.getIndex()>0){this[0].data.forEach(function(plot){item.data.push({x:plot.x,y:0})})}else if(item.data.length===0){item.data.push({x:this.timeBase-(this.timeInterval||0),y:0})}this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},addData:function(data,x){var index=this.getIndex();Rickshaw.keys(data).forEach(function(name){if(!this.itemByName(name)){this.addItem({name:name})}},this);this.forEach(function(item){item.data.push({x:x||(index*this.timeInterval||1)+this.timeBase,y:data[item.name]||0})},this)},getIndex:function(){return this[0]&&this[0].data&&this[0].data.length?this[0].data.length:0},itemByName:function(name){for(var i=0;i<this.length;i++){if(this[i].name==name)return this[i]}},setTimeInterval:function(iv){this.timeInterval=iv/1e3},setTimeBase:function(t){this.timeBase=t},dump:function(){var data={timeBase:this.timeBase,timeInterval:this.timeInterval,items:[]};this.forEach(function(item){var newItem={color:item.color,name:item.name,data:[]};item.data.forEach(function(plot){newItem.data.push({x:plot.x,y:plot.y})});data.items.push(newItem)});return data},load:function(data){if(data.timeInterval){this.timeInterval=data.timeInterval}if(data.timeBase){this.timeBase=data.timeBase}if(data.items){data.items.forEach(function(item){this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},this)}}});Rickshaw.Series.zeroFill=function(series){Rickshaw.Series.fill(series,0)};Rickshaw.Series.fill=function(series,fill){var x;var i=0;var data=series.map(function(s){return s.data});while(i<Math.max.apply(null,data.map(function(d){return d.length}))){x=Math.min.apply(null,data.filter(function(d){return d[i]}).map(function(d){return d[i].x}));data.forEach(function(d){if(!d[i]||d[i].x!=x){d.splice(i,0,{x:x,y:fill})}});i++}};Rickshaw.namespace("Rickshaw.Series.FixedDuration");Rickshaw.Series.FixedDuration=Rickshaw.Class.create(Rickshaw.Series,{initialize:function(data,palette,options){options=options||{};if(typeof options.timeInterval==="undefined"){throw new Error("FixedDuration series requires timeInterval")}if(typeof options.maxDataPoints==="undefined"){throw new Error("FixedDuration series requires maxDataPoints")}this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;this.setTimeInterval(options.timeInterval);if(this[0]&&this[0].data&&this[0].data.length){this.currentSize=this[0].data.length;this.currentIndex=this[0].data.length}else{this.currentSize=0;this.currentIndex=0}this.maxDataPoints=options.maxDataPoints;if(data&&typeof data=="object"&&Array.isArray(data)){data.forEach(function(item){this.addItem(item)},this);this.currentSize+=1;this.currentIndex+=1}this.timeBase-=(this.maxDataPoints-this.currentSize)*this.timeInterval;if(typeof this.maxDataPoints!=="undefined"&&this.currentSize<this.maxDataPoints){for(var i=this.maxDataPoints-this.currentSize-1;i>1;i--){this.currentSize+=1;this.currentIndex+=1;this.forEach(function(item){item.data.unshift({x:((i-1)*this.timeInterval||1)+this.timeBase,y:0,i:i})},this)}}},addData:function($super,data,x){$super(data,x);this.currentSize+=1;this.currentIndex+=1;if(this.maxDataPoints!==undefined){while(this.currentSize>this.maxDataPoints){this.dropData()}}},dropData:function(){this.forEach(function(item){item.data.splice(0,1)});this.currentSize-=1},getIndex:function(){return this.currentIndex}});return Rickshaw}); \ No newline at end of file
diff --git a/html/legend.css b/html/legend.css
new file mode 100644
index 0000000..a78eaae
--- /dev/null
+++ b/html/legend.css
@@ -0,0 +1,73 @@
+.rickshaw_legend {
+ font-family: Arial;
+ font-size: 12px;
+ color: white;
+ background: #404040;
+ display: inline-block;
+ padding: 12px 5px;
+ border-radius: 2px;
+ position: relative;
+}
+.rickshaw_legend:hover {
+ z-index: 10;
+}
+.rickshaw_legend .swatch {
+ width: 10px;
+ height: 10px;
+ border: 1px solid rgba(0, 0, 0, 0.2);
+}
+.rickshaw_legend .line {
+ clear: both;
+ line-height: 140%;
+ padding-right: 15px;
+}
+.rickshaw_legend .line .swatch {
+ display: inline-block;
+ margin-right: 3px;
+ border-radius: 2px;
+}
+.rickshaw_legend .label {
+ margin: 0;
+ white-space: nowrap;
+ display: inline;
+ font-size: inherit;
+ background-color: transparent;
+ color: inherit;
+ font-weight: normal;
+ line-height: normal;
+ padding: 0px;
+ text-shadow: none;
+}
+.rickshaw_legend .action:hover {
+ opacity: 0.6;
+}
+.rickshaw_legend .action {
+ margin-right: 0.2em;
+ font-size: 10px;
+ opacity: 0.2;
+ cursor: pointer;
+ font-size: 14px;
+}
+.rickshaw_legend .line.disabled {
+ opacity: 0.4;
+}
+.rickshaw_legend ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ margin: 2px;
+ cursor: pointer;
+}
+.rickshaw_legend li {
+ padding: 0 0 0 2px;
+ min-width: 80px;
+ white-space: nowrap;
+}
+.rickshaw_legend li:hover {
+ background: rgba(255, 255, 255, 0.08);
+ border-radius: 3px;
+}
+.rickshaw_legend li:active {
+ background: rgba(255, 255, 255, 0.2);
+ border-radius: 3px;
+}
diff --git a/html/lines.css b/html/lines.css
new file mode 100644
index 0000000..5210182
--- /dev/null
+++ b/html/lines.css
@@ -0,0 +1,21 @@
+div, span, p, td {
+ font-family: Arial, sans-serif;
+}
+#chart {
+ display: inline-block;
+}
+#legend {
+ display: inline-block;
+ position: relative;
+ left: 8px;
+}
+#legend_container {
+ position: absolute;
+ right: 0;
+ bottom: 26px;
+ width: 0;
+}
+.chart_container {
+ float: left;
+ position: relative;
+}
diff --git a/html/local.js b/html/local.js
new file mode 100644
index 0000000..cbf9534
--- /dev/null
+++ b/html/local.js
@@ -0,0 +1,275 @@
+"use strict";
+
+var gdata={}
+
+$(document).ready(function() {
+ $.ajaxSetup({ cache: false });
+
+ var qpsgraph = new Rickshaw.Graph( {
+ element: document.getElementById("qpschart"),
+ width: 400,
+ height: 200,
+ renderer: 'line',
+ series: new Rickshaw.Series.FixedDuration([{ name: 'servfailps' }, {name: 'qps'}], undefined, {
+ timeInterval: 1000,
+ maxDataPoints: 100,
+ timeBase: new Date().getTime() / 1000
+ })
+ } );
+ var y_ticks = new Rickshaw.Graph.Axis.Y( {
+ graph: qpsgraph,
+ orientation: 'left',
+ tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
+ element: document.getElementById('qpsy_axis')
+ } );
+
+ qpsgraph.render();
+
+ var cpugraph = new Rickshaw.Graph( {
+ element: document.getElementById("cpuchart"),
+ width: 400,
+ height: 200,
+ renderer: 'line',
+ series: new Rickshaw.Series.FixedDuration([{ name: 'one' }, {name: 'two'}], undefined, {
+ timeInterval: 1000,
+ maxDataPoints: 100,
+ timeBase: new Date().getTime() / 1000
+ })
+ } );
+ var y_ticks = new Rickshaw.Graph.Axis.Y( {
+ graph: cpugraph,
+ orientation: 'left',
+ tickFormat: Rickshaw.Fixtures.Number.formatKMBT,
+ element: document.getElementById('cpuy_axis')
+ } );
+
+ cpugraph.render();
+ var intervalcount=0;
+
+ function updateRingBuffers()
+ {
+ var filtered=$("#filter1").is(':checked')
+ var qstring='jsonstat?command=get-query-ring&name=queries';
+ if(filtered)
+ qstring=qstring+"&public-filtered=1";
+
+ $.getJSON(qstring,
+ function(data) {
+ console.log(data);
+ var bouw="<table><tr><th>Number</th><th>Domain</th><th>Type</th></tr>";
+ var num=0;
+ var total=0, rest=0;
+ $.each(data["entries"], function(a,b) {
+ total+=b[0];
+ if(num++ > 10) {
+ rest+=b[0];
+ return;
+ }
+ if(b[1].length > 25)
+ b[1]=b[1].substring(0,25);
+
+ bouw=bouw+("<tr><td>"+b[0]+"</td><td>"+b[1]+"</td><td>"+b[2]+"</td></tr>");
+ });
+ bouw+="<tr><td>"+rest+"</td><td>Rest</td></tr>";
+ bouw=bouw+"</table>";
+ $("#queryring").html(bouw);
+
+ });
+
+ filtered=$("#filter2").is(':checked')
+ qstring='jsonstat?command=get-query-ring&name=servfail-queries';
+ if(filtered)
+ qstring=qstring+"&public-filtered=1";
+
+ $.getJSON(qstring,
+ function(data) {
+ var bouw="<table><tr><th>Number</th><th>Servfail domain</th><th>Type</th></tr>";
+ var num=0, total=0, rest=0;
+ $.each(data["entries"], function(a,b) {
+ total+=b[0];
+ if(num++ > 10) {
+ rest+=b[0];
+ return;
+ }
+ if(b[1].length > 25)
+ b[1]=b[1].substring(0,25);
+ bouw=bouw+("<tr><td>"+b[0]+"</td><td>"+b[1]+"</td><td>"+b[2]+"</td></tr>");
+ });
+ bouw+="<tr><td>"+rest+"</td><td>Rest</td></tr>";
+ bouw=bouw+"</table>";
+ $("#servfailqueryring").html(bouw);
+
+ });
+
+ $.getJSON('jsonstat?command=get-remote-ring&name=remotes',
+ function(data) {
+ var bouw="<table><tr><th>Number</th><th>Remote</th></tr>";
+ var num=0, total=0, rest=0;
+ $.each(data["entries"], function(a,b) {
+ total+=b[0];
+ if(num++ > 10) {
+ rest +=b[0];
+ return;
+ }
+ bouw=bouw+("<tr><td>"+b[0]+"</td><td>"+b[1]+"</td></tr>");
+ });
+ bouw+="<tr><td>"+rest+"</td><td>Rest</td></tr>";
+ bouw=bouw+"</table>";
+ $("#remotering").html(bouw);
+
+ });
+
+ $.getJSON('jsonstat?command=get-remote-ring&name=servfail-remotes',
+ function(data) {
+ var bouw="<table><tr><th>Number</th><th>Servfail Remote</th></tr>";
+ var num=0, total=0, rest=0;
+ $.each(data["entries"], function(a,b) {
+ total+=b[0];
+ if(num++ > 10) {
+ rest += b[0];
+ return;
+ }
+ bouw=bouw+("<tr><td>"+b[0]+"</td><td>"+b[1]+"</td></tr>");
+ });
+ bouw+="<tr><td>"+rest+"</td><td>Rest</td></tr>";
+ bouw=bouw+"</table>";
+ $("#servfailremotering").html(bouw);
+ });
+ }
+
+ function update()
+ {
+ $.ajax({
+ url: 'jsonstat?command=stats',
+ type: 'GET',
+ dataType: 'json',
+ jsonp: false,
+ success: function(data, x, y) {
+ $("#questions").text(data["queries"]);
+ $("#acl-drops").text(data["acl-drops"]);
+ $("#dyn-drops").text(data["dyn-blocked"]);
+ $("#rule-drops").text(data["rule-drop"]);
+ $("#uptime").text(moment.duration(data["uptime"]*1000.0).humanize());
+ $("#latency").text((data["latency-avg10000"]/1000.0).toFixed(2));
+ if(!gdata["cpu-sys-msec"])
+ gdata=data;
+
+ var cpu=((1.0*data["cpu-sys-msec"]+1.0*data["cpu-user-msec"] - 1.0*gdata["cpu-sys-msec"]-1.0*gdata["cpu-user-msec"])/10.0);
+
+ $("#cpu").text(cpu.toFixed(2));
+ var qps=1.0*data["queries"]-1.0*gdata["queries"];
+ $("#qps").text(qps.toFixed(2));
+ $("#server-policy").text(data["server-policy"]);
+
+ var servfailps=1.0*data["servfail-responses"]-1.0*gdata["servfail-responses"];
+
+ var totpcache=1.0*data["cache-hits"]-1.0*gdata["cache-hits"]+1.0*data["cache-misses"]-1.0*gdata["cache-misses"];
+ var hitrate=0;
+ if(totpcache > 0) {
+ hitrate=100.0*(data["cache-hits"]-1.0*gdata["cache-hits"])/totpcache;
+ $("#phitrate").text(hitrate.toFixed(2));
+ }
+ else
+ $("#phitrate").text(0);
+
+ qpsgraph.series.addData({ qps: qps, servfailps: servfailps});
+ qpsgraph.render();
+
+ cpugraph.series.addData({ one: cpu, two: hitrate});
+ cpugraph.render();
+
+ gdata=data;
+ },
+ error: function() {
+
+ },
+ });
+
+ $.ajax({ url: 'api/v1/servers/localhost', type: 'GET', dataType: 'json', jsonp: false,
+ success: function(data) {
+ $("#version").text(data["daemon_type"]+" "+data["version"]);
+ $("#acl").text(data["acl"]);
+ $("#local").text(data["local"]);
+ var bouw='<table width="100%"><tr align=right><th>#</th><th align=left>Name</th><th align=left>Address</th><th>Status</th><th>Latency</th><th>Queries</th><th>Drops</th><th>QPS</th><th>Out</th><th>Weight</th><th>Order</th><th align=left>Pools</th></tr>';
+ $.each(data["servers"], function(a,b) {
+ bouw = bouw + ("<tr align=right><td>"+b["id"]+"</td><td align=left>"+b["name"]+"</td><td align=left>"+b["address"]+"</td><td>"+b["state"]+"</td>");
+ var latency = (b["latency"] === null) ? 0.0 : b["latency"];
+ bouw = bouw + ("<td>"+latency.toFixed(2)+"</td><td>"+b["queries"]+"</td><td>"+b["reuseds"]+"</td><td>"+(b["qps"]).toFixed(2)+"</td><td>"+b["outstanding"]+"</td>");
+ bouw = bouw + ("<td>"+b["weight"]+"</td><td>"+b["order"]+"</td><td align=left>"+b["pools"]+"</td></tr>");
+ });
+ bouw = bouw + "</table>";
+ $("#downstreams").html(bouw);
+
+ bouw='<table width="100%"><tr align=left><th>#</th><th align=left>Rule</th><th>Action</th><th>Matches</th></tr>';
+ if(data["rules"].length) {
+ $.each(data["rules"], function(a,b) {
+ bouw = bouw + ("<tr align=left><td>"+b["id"]+"</td><td align=left>"+b["rule"]+"</td><td>"+b["action"]+"</td>");
+ bouw = bouw + ("<td>"+b["matches"]+"</td></tr>");
+ });
+ }
+ else
+ bouw = bouw + '<tr><td align="center" colspan="4"><font color="#aaaaaa">No rules defined</font></td></tr>';
+ bouw = bouw + "</table>";
+ $("#rules").html(bouw);
+
+ bouw='<table width="100%"><tr align=left><th>#</th><th align=left>Response Rule</th><th>Action</th><th>Matches</th></tr>';
+ if(data["response-rules"].length) {
+ $.each(data["response-rules"], function(a,b) {
+ bouw = bouw + ("<tr align=left><td>"+b["id"]+"</td><td align=left>"+b["rule"]+"</td><td>"+b["action"]+"</td>");
+ bouw = bouw + ("<td>"+b["matches"]+"</td></tr>");
+ });
+ }
+ else
+ bouw = bouw + '<tr><td align="center" colspan="4"><font color="#aaaaaa">No response rules defined</font></td></tr>';
+ bouw = bouw + "</table>";
+ $("#response-rules").html(bouw);
+ }
+ });
+
+
+// if((intervalcount++)%5)
+ // return;
+ // updateRingBuffers();
+
+ $.ajax({ url: 'jsonstat?command=dynblocklist', type: 'GET', dataType: 'json', jsonp: false,
+ success: function(data) {
+ var bouw='<table width="100%"><tr align=left><th>Dyn blocked netmask</th><th>Seconds</th><th>Blocks</th><th align=left>Reason</th></tr>';
+ var gotsome=false;
+ $.each(data, function(a,b) {
+ bouw=bouw+("<tr><td>"+a+"</td><td>"+b.seconds+"</td><td>"+b.blocks+"</td><td>"+b.reason+"</td></tr>");
+ gotsome=true;
+ });
+
+ if(!gotsome)
+ bouw = bouw + '<tr><td align="center" colspan="4"><font color="#aaaaaa">No dynamic blocks active</font></td></tr>';
+
+ bouw=bouw+"</table>";
+ $("#dynblock").html(bouw);
+
+ }});
+
+ $.ajax({ url: 'jsonstat?command=ebpfblocklist', type: 'GET', dataType: 'json', jsonp: false,
+ success: function(data) {
+ var bouw='<table width="100%"><tr align=left><th>Kernel-based dyn blocked netmask</th><th>Seconds</th></th><th>Blocks</th></tr>';
+ var gotsome=false;
+ $.each(data, function(a,b) {
+ bouw=bouw+("<tr><td>"+a+"</td><td>"+b.seconds+"</td><td>"+b.blocks+"</td></tr>");
+ gotsome=true;
+ });
+
+ if(!gotsome)
+ bouw = bouw + '<tr><td align="center" colspan="4"><font color="#aaaaaa">No eBPF blocks active</font></td></tr>';
+
+ bouw=bouw+"</table>";
+ $("#ebpfblock").html(bouw);
+
+ }});
+
+ };
+
+ $("#filter1").click(updateRingBuffers);
+ $("#filter2").click(updateRingBuffers);
+
+ update();
+ setInterval(update, 1000);
+});
diff --git a/html/powerdns-logo-220px.png b/html/powerdns-logo-220px.png
new file mode 100644
index 0000000..7c299c0
--- /dev/null
+++ b/html/powerdns-logo-220px.png
Binary files differ
diff --git a/htmlfiles.h b/htmlfiles.h
new file mode 100644
index 0000000..0804a2a
--- /dev/null
+++ b/htmlfiles.h
@@ -0,0 +1,24743 @@
+static const unsigned char gdetail_cssData[] = {
+ 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20,
+ 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x7b, 0x0a, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x2d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b,
+ 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62, 0x73, 0x6f,
+ 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x09,
+ 0x7a, 0x2d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x20, 0x32, 0x3b, 0x0a, 0x09, 0x62, 0x61, 0x63,
+ 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c,
+ 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x29, 0x3b, 0x0a, 0x09, 0x62, 0x6f,
+ 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x09, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a,
+ 0x20, 0x31, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f,
+ 0x6e, 0x3a, 0x20, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x73,
+ 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x3b, 0x0a, 0x09, 0x2d, 0x6d, 0x6f, 0x7a, 0x2d, 0x74,
+ 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6f, 0x70, 0x61, 0x63, 0x69,
+ 0x74, 0x79, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x73, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x3b,
+ 0x0a, 0x09, 0x2d, 0x6f, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a,
+ 0x20, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x73, 0x20, 0x6c,
+ 0x69, 0x6e, 0x65, 0x61, 0x72, 0x3b, 0x0a, 0x09, 0x2d, 0x77, 0x65, 0x62, 0x6b, 0x69, 0x74, 0x2d,
+ 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6f, 0x70, 0x61, 0x63,
+ 0x69, 0x74, 0x79, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x73, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72,
+ 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x2e, 0x69, 0x6e, 0x61, 0x63,
+ 0x74, 0x69, 0x76, 0x65, 0x20, 0x7b, 0x0a, 0x09, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a,
+ 0x20, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x69,
+ 0x74, 0x65, 0x6d, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x7b, 0x0a, 0x09, 0x6f, 0x70,
+ 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74,
+ 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x78, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x20, 0x7b, 0x0a, 0x09,
+ 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a, 0x20, 0x41, 0x72, 0x69,
+ 0x61, 0x6c, 0x2c, 0x20, 0x73, 0x61, 0x6e, 0x73, 0x2d, 0x73, 0x65, 0x72, 0x69, 0x66, 0x3b, 0x0a,
+ 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20,
+ 0x33, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x36,
+ 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x20, 0x30, 0x2e,
+ 0x35, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20,
+ 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x23, 0x65, 0x30, 0x65, 0x30, 0x65, 0x30, 0x3b, 0x0a, 0x09,
+ 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x32, 0x70, 0x78, 0x3b,
+ 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62, 0x73, 0x6f,
+ 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e,
+ 0x64, 0x3a, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x77, 0x68, 0x69, 0x74, 0x65,
+ 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x20, 0x6e, 0x6f, 0x77, 0x72, 0x61, 0x70, 0x3b, 0x0a,
+ 0x09, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x2d, 0x32, 0x30, 0x70, 0x78, 0x3b, 0x20, 0x20, 0x2f, 0x2a,
+ 0x20, 0x61, 0x64, 0x64, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x2a, 0x2f, 0x0a, 0x7d, 0x0a, 0x2e,
+ 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e,
+ 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x78, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e,
+ 0x6c, 0x65, 0x66, 0x74, 0x20, 0x7b, 0x0a, 0x09, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x20, 0x30, 0x3b,
+ 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x78, 0x5f, 0x6c, 0x61,
+ 0x62, 0x65, 0x6c, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x7b, 0x0a, 0x09, 0x72, 0x69, 0x67,
+ 0x68, 0x74, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c,
+ 0x20, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x20, 0x7b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69,
+ 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x7a,
+ 0x2d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x20, 0x32, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64,
+ 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x33, 0x70, 0x78, 0x3b, 0x0a,
+ 0x09, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x65, 0x6d,
+ 0x3b, 0x0a, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x32,
+ 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79,
+ 0x3a, 0x20, 0x41, 0x72, 0x69, 0x61, 0x6c, 0x2c, 0x20, 0x73, 0x61, 0x6e, 0x73, 0x2d, 0x73, 0x65,
+ 0x72, 0x69, 0x66, 0x3b, 0x0a, 0x09, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x20, 0x30,
+ 0x3b, 0x0a, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x72,
+ 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x34,
+ 0x29, 0x3b, 0x0a, 0x09, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65,
+ 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73,
+ 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20,
+ 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x29, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e,
+ 0x2d, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x20, 0x31, 0x65, 0x6d, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x72,
+ 0x67, 0x69, 0x6e, 0x2d, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x65, 0x6d, 0x3b, 0x0a,
+ 0x09, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x2d, 0x31, 0x65,
+ 0x6d, 0x3b, 0x0a, 0x09, 0x77, 0x68, 0x69, 0x74, 0x65, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a,
+ 0x20, 0x6e, 0x6f, 0x77, 0x72, 0x61, 0x70, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74, 0x61,
+ 0x69, 0x6c, 0x20, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x20, 0x7b, 0x0a,
+ 0x09, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74,
+ 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20,
+ 0x7b, 0x0a, 0x09, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e,
+ 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e,
+ 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x61, 0x63, 0x74,
+ 0x69, 0x76, 0x65, 0x20, 0x7b, 0x0a, 0x09, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x20,
+ 0x31, 0x3b, 0x0a, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20,
+ 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e,
+ 0x38, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x69,
+ 0x74, 0x65, 0x6d, 0x3a, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x7b, 0x0a, 0x09, 0x70, 0x6f, 0x73,
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b,
+ 0x0a, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
+ 0x3b, 0x0a, 0x09, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x09, 0x68, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x65,
+ 0x6e, 0x74, 0x3a, 0x20, 0x22, 0x22, 0x3b, 0x0a, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
+ 0x3a, 0x20, 0x35, 0x70, 0x78, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x74, 0x72, 0x61, 0x6e,
+ 0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74, 0x61,
+ 0x69, 0x6c, 0x20, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x61, 0x66,
+ 0x74, 0x65, 0x72, 0x20, 0x7b, 0x0a, 0x09, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x31, 0x65, 0x6d, 0x3b,
+ 0x0a, 0x09, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x20, 0x2d, 0x35, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x6d,
+ 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x2d, 0x35, 0x70, 0x78, 0x3b,
+ 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x63,
+ 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c,
+ 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65,
+ 0x72, 0x2d, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x30, 0x3b,
+ 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x69, 0x74, 0x65, 0x6d,
+ 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x61, 0x66, 0x74, 0x65, 0x72, 0x20, 0x7b, 0x0a, 0x09,
+ 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x31, 0x65, 0x6d, 0x3b, 0x0a, 0x09, 0x72, 0x69, 0x67, 0x68, 0x74,
+ 0x3a, 0x20, 0x2d, 0x35, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d,
+ 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x2d, 0x35, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64,
+ 0x65, 0x72, 0x2d, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x72,
+ 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38,
+ 0x29, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x69, 0x67, 0x68, 0x74,
+ 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x64, 0x65,
+ 0x74, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x64, 0x6f, 0x74, 0x20, 0x7b, 0x0a, 0x09, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x3a, 0x20, 0x34, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x3a, 0x20, 0x34, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x6c,
+ 0x65, 0x66, 0x74, 0x3a, 0x20, 0x2d, 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x67,
+ 0x69, 0x6e, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x2d, 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x62,
+ 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x35, 0x70,
+ 0x78, 0x3b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62,
+ 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x78, 0x2d, 0x73, 0x68, 0x61,
+ 0x64, 0x6f, 0x77, 0x3a, 0x20, 0x30, 0x20, 0x30, 0x20, 0x32, 0x70, 0x78, 0x20, 0x72, 0x67, 0x62,
+ 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x36, 0x29, 0x3b,
+ 0x0a, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x77, 0x68,
+ 0x69, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x3a, 0x20, 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
+ 0x2d, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3a, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x3b, 0x0a, 0x09,
+ 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x09,
+ 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2d, 0x63, 0x6c, 0x69, 0x70, 0x3a,
+ 0x20, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2d, 0x62, 0x6f, 0x78, 0x3b, 0x0a, 0x7d, 0x0a,
+ 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20,
+ 0x2e, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x20, 0x2e, 0x64, 0x6f, 0x74, 0x2e, 0x61, 0x63, 0x74,
+ 0x69, 0x76, 0x65, 0x20, 0x7b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20,
+ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x7d, 0x0a,
+
+};
+static const unsigned char ggraph_cssData[] = {
+ 0x2f, 0x2a, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2a, 0x2f, 0x0a, 0x0a, 0x2e, 0x72, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x7b, 0x0a, 0x09,
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x73, 0x76, 0x67, 0x20, 0x7b, 0x0a, 0x09, 0x64, 0x69, 0x73,
+ 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x09, 0x0a, 0x09, 0x6f,
+ 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x3a, 0x20, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x3b,
+ 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2a, 0x20, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x20, 0x2a, 0x2f, 0x0a,
+ 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x20, 0x2e, 0x78, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x20, 0x7b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69,
+ 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a,
+ 0x09, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d,
+ 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x09, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x30, 0x70, 0x78,
+ 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x20,
+ 0x31, 0x70, 0x78, 0x20, 0x64, 0x6f, 0x74, 0x74, 0x65, 0x64, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28,
+ 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x29, 0x3b, 0x0a, 0x09,
+ 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x20,
+ 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x5f, 0x67, 0x72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, 0x0a, 0x2e, 0x72, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x7b, 0x0a, 0x09, 0x68, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64,
+ 0x65, 0x72, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73, 0x6f, 0x6c, 0x69,
+ 0x64, 0x20, 0x23, 0x65, 0x30, 0x65, 0x30, 0x65, 0x30, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x67,
+ 0x69, 0x6e, 0x2d, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x70,
+ 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x61,
+ 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69,
+ 0x6e, 0x65, 0x20, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7b,
+ 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62, 0x73, 0x6f,
+ 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x36,
+ 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x36, 0x70, 0x78, 0x3b,
+ 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x20, 0x2d,
+ 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x2d, 0x33, 0x70, 0x78, 0x3b,
+ 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a,
+ 0x20, 0x35, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e,
+ 0x64, 0x2d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c,
+ 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x29, 0x3b, 0x0a, 0x7d, 0x0a,
+ 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20,
+ 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65,
+ 0x20, 0x7b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62,
+ 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b,
+ 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x2d, 0x36, 0x70, 0x78, 0x3b, 0x0a,
+ 0x09, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x30, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x62, 0x6f,
+ 0x72, 0x64, 0x65, 0x72, 0x2d, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x20, 0x32, 0x70, 0x78, 0x20, 0x73,
+ 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20,
+ 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x33, 0x29, 0x3b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61,
+ 0x79, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x61, 0x6e, 0x6e, 0x6f,
+ 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x61, 0x63, 0x74, 0x69,
+ 0x76, 0x65, 0x20, 0x7b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x62,
+ 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a,
+ 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30,
+ 0x2e, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x69, 0x73,
+ 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62,
+ 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x2d, 0x36, 0x70, 0x78, 0x3b, 0x0a, 0x7d, 0x0a,
+ 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20,
+ 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67,
+ 0x65, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,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x61, 0x63, 0x6b, 0x3b, 0x0a, 0x09, 0x6f, 0x70, 0x61,
+ 0x63, 0x69, 0x74, 0x79, 0x3a, 0x20, 0x30, 0x2e, 0x39, 0x3b, 0x0a, 0x09, 0x70, 0x61, 0x64, 0x64,
+ 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x35, 0x70, 0x78, 0x20, 0x35, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x62,
+ 0x6f, 0x78, 0x2d, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x3a, 0x20, 0x30, 0x20, 0x30, 0x20, 0x32,
+ 0x70, 0x78, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c,
+ 0x20, 0x30, 0x2e, 0x38, 0x29, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72,
+ 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x33, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x70, 0x6f, 0x73,
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x3b,
+ 0x0a, 0x09, 0x7a, 0x2d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x20, 0x32, 0x30, 0x3b, 0x0a, 0x09,
+ 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x32, 0x70, 0x78, 0x3b,
+ 0x0a, 0x09, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x36, 0x70, 0x78, 0x20, 0x38,
+ 0x70, 0x78, 0x20, 0x38, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x31, 0x38,
+ 0x70, 0x78, 0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 0x6f, 0x72, 0x3a, 0x20, 0x77, 0x68,
+ 0x69, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x73, 0x68, 0x61, 0x64, 0x6f,
+ 0x77, 0x3a, 0x20, 0x30, 0x20, 0x2d, 0x31, 0x70, 0x78, 0x20, 0x31, 0x70, 0x78, 0x20, 0x72, 0x67,
+ 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29,
+ 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x61, 0x6e,
+ 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e,
+ 0x65, 0x20, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x61, 0x63,
+ 0x74, 0x69, 0x76, 0x65, 0x2c, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6c,
+ 0x69, 0x6e, 0x65, 0x20, 0x2e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a,
+ 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x7b, 0x0a, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f,
+ 0x75, 0x6e, 0x64, 0x2d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28,
+ 0x30, 0x2c,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,
+ 0x69, 0x63, 0x6b, 0x73, 0x20, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x2c, 0x0a, 0x2e, 0x72, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x78, 0x5f, 0x74,
+ 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x64, 0x33, 0x20, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x20, 0x7b, 0x0a,
+ 0x09, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3a, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c,
+ 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x36, 0x29, 0x3b, 0x0a, 0x09, 0x73,
+ 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x32, 0x70, 0x78,
+ 0x3b, 0x0a, 0x09, 0x73, 0x68, 0x61, 0x70, 0x65, 0x2d, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x69,
+ 0x6e, 0x67, 0x3a, 0x20, 0x63, 0x72, 0x69, 0x73, 0x70, 0x2d, 0x65, 0x64, 0x67, 0x65, 0x73, 0x3b,
+ 0x0a, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
+ 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x79, 0x5f, 0x67, 0x72, 0x69,
+ 0x64, 0x20, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x2c, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x78, 0x5f, 0x67, 0x72, 0x69, 0x64,
+ 0x5f, 0x64, 0x33, 0x20, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x20, 0x7b, 0x0a, 0x09, 0x7a, 0x2d, 0x69,
+ 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x20, 0x2d, 0x31, 0x3b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x6f, 0x6b,
+ 0x65, 0x3a, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c,
+ 0x20, 0x30, 0x2e, 0x32, 0x30, 0x29, 0x3b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x2d,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x73, 0x74, 0x72,
+ 0x6f, 0x6b, 0x65, 0x2d, 0x64, 0x61, 0x73, 0x68, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3a, 0x20, 0x31,
+ 0x20, 0x31, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x79, 0x5f, 0x67, 0x72, 0x69, 0x64, 0x20, 0x2e, 0x74,
+ 0x69, 0x63, 0x6b, 0x5b, 0x64, 0x61, 0x74, 0x61, 0x2d, 0x79, 0x2d, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x3d, 0x22, 0x30, 0x22, 0x5d, 0x20, 0x7b, 0x0a, 0x09, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x2d,
+ 0x64, 0x61, 0x73, 0x68, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3a, 0x20, 0x31, 0x20, 0x30, 0x3b, 0x0a,
+ 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x20, 0x2e, 0x79, 0x5f, 0x67, 0x72, 0x69, 0x64, 0x20, 0x70, 0x61, 0x74, 0x68, 0x2c, 0x0a,
+ 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20,
+ 0x2e, 0x78, 0x5f, 0x67, 0x72, 0x69, 0x64, 0x5f, 0x64, 0x33, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20,
+ 0x20, 0x7b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x6c, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a,
+ 0x09, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x7d,
+ 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x20, 0x2e, 0x79, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x20, 0x70, 0x61, 0x74, 0x68, 0x2c, 0x0a,
+ 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20,
+ 0x2e, 0x78, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x64, 0x33, 0x20, 0x70, 0x61, 0x74, 0x68,
+ 0x20, 0x7b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x6c, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a,
+ 0x09, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3a, 0x20, 0x23, 0x38, 0x30, 0x38, 0x30, 0x38, 0x30,
+ 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x20, 0x2e, 0x79, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x20, 0x74, 0x65, 0x78,
+ 0x74, 0x2c, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x20, 0x2e, 0x78, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x64, 0x33, 0x20, 0x74,
+ 0x65, 0x78, 0x74, 0x20, 0x7b, 0x0a, 0x09, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x20,
+ 0x30, 0x2e, 0x35, 0x3b, 0x0a, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69, 0x7a, 0x65, 0x3a,
+ 0x20, 0x31, 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2d,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x7d, 0x0a,
+ 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20,
+ 0x2e, 0x78, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x2e, 0x67, 0x6c, 0x6f, 0x77, 0x20, 0x2e, 0x74, 0x69,
+ 0x74, 0x6c, 0x65, 0x2c, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x79, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x2e, 0x67, 0x6c,
+ 0x6f, 0x77, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x7b, 0x0a, 0x09, 0x66, 0x69, 0x6c, 0x6c, 0x3a,
+ 0x20, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x3b, 0x0a, 0x09, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20,
+ 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x3b, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x73, 0x68, 0x61,
+ 0x64, 0x6f, 0x77, 0x3a, 0x20, 0x0a, 0x09, 0x09, 0x2d, 0x31, 0x70, 0x78, 0x20, 0x31, 0x70, 0x78,
+ 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35,
+ 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x31,
+ 0x70, 0x78, 0x20, 0x2d, 0x31, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32,
+ 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x30, 0x2e,
+ 0x31, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x31, 0x70, 0x78, 0x20, 0x31, 0x70, 0x78, 0x20, 0x30, 0x20,
+ 0x72, 0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32,
+ 0x35, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x30, 0x70, 0x78, 0x20,
+ 0x31, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20,
+ 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x29, 0x2c, 0x0a,
+ 0x09, 0x09, 0x30, 0x70, 0x78, 0x20, 0x2d, 0x31, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62,
+ 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c,
+ 0x20, 0x30, 0x2e, 0x31, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x31, 0x70, 0x78, 0x20, 0x30, 0x70, 0x78,
+ 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35,
+ 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x2d,
+ 0x31, 0x70, 0x78, 0x20, 0x30, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32,
+ 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x30, 0x2e,
+ 0x31, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x2d, 0x31, 0x70, 0x78, 0x20, 0x2d, 0x31, 0x70, 0x78, 0x20,
+ 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c,
+ 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x31, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x78,
+ 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x20, 0x2e, 0x74,
+ 0x69, 0x74, 0x6c, 0x65, 0x2c, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x2e, 0x79, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x2e, 0x69,
+ 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74, 0x20, 0x7b, 0x0a, 0x09, 0x66,
+ 0x69, 0x6c, 0x6c, 0x3a, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x63, 0x6f, 0x6c,
+ 0x6f, 0x72, 0x3a, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x74,
+ 0x2d, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x3a, 0x20, 0x0a, 0x09, 0x09, 0x2d, 0x31, 0x70, 0x78,
+ 0x20, 0x31, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20, 0x30,
+ 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x31, 0x70, 0x78,
+ 0x20, 0x2d, 0x31, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20,
+ 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x31, 0x70,
+ 0x78, 0x20, 0x31, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20,
+ 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x30, 0x70,
+ 0x78, 0x20, 0x31, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c, 0x20,
+ 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x30, 0x70,
+ 0x78, 0x20, 0x2d, 0x31, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c,
+ 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x31,
+ 0x70, 0x78, 0x20, 0x30, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30, 0x2c,
+ 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29, 0x2c, 0x0a, 0x09, 0x09, 0x2d,
+ 0x31, 0x70, 0x78, 0x20, 0x30, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x30,
+ 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29, 0x2c, 0x0a, 0x09, 0x09,
+ 0x2d, 0x31, 0x70, 0x78, 0x20, 0x2d, 0x31, 0x70, 0x78, 0x20, 0x30, 0x20, 0x72, 0x67, 0x62, 0x61,
+ 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x38, 0x29, 0x3b, 0x0a,
+ 0x7d, 0x0a,
+
+};
+static const unsigned char gindex_htmlData[] = {
+ 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45, 0x20, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0a,
+ 0x3c, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x6d, 0x65, 0x74, 0x61, 0x20, 0x63,
+ 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x3d, 0x22, 0x75, 0x74, 0x66, 0x2d, 0x38, 0x22, 0x20, 0x2f,
+ 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x73, 0x72, 0x63, 0x3d,
+ 0x22, 0x6a, 0x73, 0x2f, 0x6a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x6d, 0x69, 0x6e, 0x2e, 0x6a,
+ 0x73, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x3c,
+ 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x73, 0x72, 0x63, 0x3d, 0x22, 0x6a, 0x73, 0x2f, 0x64,
+ 0x33, 0x2e, 0x6d, 0x69, 0x6e, 0x2e, 0x6a, 0x73, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69,
+ 0x70, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x73, 0x72,
+ 0x63, 0x3d, 0x22, 0x6a, 0x73, 0x2f, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6d,
+ 0x69, 0x6e, 0x2e, 0x6a, 0x73, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3e,
+ 0x0a, 0x20, 0x20, 0x3c, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x73, 0x72, 0x63, 0x3d, 0x22,
+ 0x6a, 0x73, 0x2f, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x69, 0x6e, 0x2e, 0x6a, 0x73,
+ 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x23, 0x71, 0x70, 0x73, 0x63, 0x68,
+ 0x61, 0x72, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69,
+ 0x6f, 0x6e, 0x3a, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x20, 0x34, 0x30, 0x70, 0x78, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x23, 0x71, 0x70, 0x73, 0x79, 0x5f, 0x61, 0x78,
+ 0x69, 0x73, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
+ 0x6e, 0x3a, 0x20, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x74, 0x6f, 0x70, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x74,
+ 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74,
+ 0x68, 0x3a, 0x20, 0x34, 0x30, 0x70, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x23, 0x63, 0x70, 0x75, 0x63, 0x68, 0x61, 0x72, 0x74, 0x20, 0x7b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x72, 0x65,
+ 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x66, 0x74,
+ 0x3a, 0x20, 0x34, 0x30, 0x70, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x23, 0x63, 0x70, 0x75, 0x79, 0x5f, 0x61, 0x78, 0x69, 0x73, 0x20, 0x7b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62, 0x73,
+ 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x70, 0x3a, 0x20,
+ 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x30,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x34, 0x30, 0x70,
+ 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x74, 0x61,
+ 0x62, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2c, 0x20, 0x74, 0x61, 0x62, 0x6c,
+ 0x65, 0x2e, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3e, 0x74, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x74,
+ 0x72, 0x3e, 0x74, 0x64, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65,
+ 0x72, 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x62, 0x6c, 0x61,
+ 0x63, 0x6b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x63,
+ 0x6f, 0x6c, 0x6c, 0x61, 0x70, 0x73, 0x65, 0x3a, 0x20, 0x63, 0x6f, 0x6c, 0x6c, 0x61, 0x70, 0x73,
+ 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x3c, 0x2f, 0x73, 0x74, 0x79,
+ 0x6c, 0x65, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x6c, 0x69, 0x6e, 0x6b, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, 0x22, 0x20, 0x72, 0x65, 0x6c, 0x3d,
+ 0x22, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x73, 0x68, 0x65, 0x65, 0x74, 0x22, 0x20, 0x68, 0x72, 0x65,
+ 0x66, 0x3d, 0x22, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x63, 0x73, 0x73, 0x22, 0x3e, 0x0a, 0x20,
+ 0x20, 0x3c, 0x6c, 0x69, 0x6e, 0x6b, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x74, 0x65, 0x78,
+ 0x74, 0x2f, 0x63, 0x73, 0x73, 0x22, 0x20, 0x72, 0x65, 0x6c, 0x3d, 0x22, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x73, 0x68, 0x65, 0x65, 0x74, 0x22, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x64, 0x65,
+ 0x74, 0x61, 0x69, 0x6c, 0x2e, 0x63, 0x73, 0x73, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x6c, 0x69,
+ 0x6e, 0x6b, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73,
+ 0x73, 0x22, 0x20, 0x72, 0x65, 0x6c, 0x3d, 0x22, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x22, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64,
+ 0x2e, 0x63, 0x73, 0x73, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x6c, 0x69, 0x6e, 0x6b, 0x20, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x63, 0x73, 0x73, 0x22, 0x20, 0x72,
+ 0x65, 0x6c, 0x3d, 0x22, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x73, 0x68, 0x65, 0x65, 0x74, 0x22, 0x20,
+ 0x68, 0x72, 0x65, 0x66, 0x3d, 0x22, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x2e, 0x63, 0x73, 0x73, 0x22,
+ 0x3e, 0x0a, 0x0a, 0x20, 0x20, 0x3c, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x20, 0x73, 0x72, 0x63,
+ 0x3d, 0x22, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2e, 0x6a, 0x73, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x63,
+ 0x72, 0x69, 0x70, 0x74, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x2f, 0x68, 0x65, 0x61, 0x64, 0x3e, 0x0a,
+ 0x20, 0x20, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74,
+ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x30, 0x25,
+ 0x22, 0x20, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3d, 0x22, 0x30, 0x22, 0x3e, 0x3c, 0x74, 0x72,
+ 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x69, 0x6d, 0x67, 0x20, 0x73, 0x72, 0x63, 0x3d, 0x22, 0x70,
+ 0x6f, 0x77, 0x65, 0x72, 0x64, 0x6e, 0x73, 0x2d, 0x6c, 0x6f, 0x67, 0x6f, 0x2d, 0x32, 0x32, 0x30,
+ 0x70, 0x78, 0x2e, 0x70, 0x6e, 0x67, 0x22, 0x2f, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x64, 0x20, 0x73, 0x74, 0x79, 0x6c, 0x65,
+ 0x3d, 0x22, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x30, 0x70, 0x78, 0x20, 0x39,
+ 0x30, 0x70, 0x78, 0x20, 0x30, 0x70, 0x78, 0x20, 0x32, 0x30, 0x70, 0x78, 0x22, 0x3e, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x73, 0x70, 0x61, 0x6e,
+ 0x20, 0x69, 0x64, 0x3d, 0x22, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x3c, 0x2f,
+ 0x73, 0x70, 0x61, 0x6e, 0x3e, 0x3c, 0x62, 0x72, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x6e, 0x73, 0x64, 0x69, 0x73, 0x74, 0x20, 0x63,
+ 0x6f, 0x6d, 0x65, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x41, 0x42, 0x53, 0x4f, 0x4c, 0x55,
+ 0x54, 0x45, 0x4c, 0x59, 0x20, 0x4e, 0x4f, 0x20, 0x57, 0x41, 0x52, 0x52, 0x41, 0x4e, 0x54, 0x59,
+ 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x66, 0x72, 0x65, 0x65, 0x20, 0x73,
+ 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x79, 0x6f, 0x75,
+ 0x20, 0x61, 0x72, 0x65, 0x20, 0x77, 0x65, 0x6c, 0x63, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x6f, 0x20,
+ 0x72, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x69, 0x74, 0x20,
+ 0x61, 0x63, 0x63, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65,
+ 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x47, 0x50,
+ 0x4c, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x32, 0x2e, 0x3c, 0x62, 0x72, 0x2f,
+ 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65,
+ 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x55, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69, 0x64,
+ 0x3d, 0x22, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61, 0x6e,
+ 0x3e, 0x2c, 0x20, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20, 0x6f, 0x66, 0x20, 0x71, 0x75, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61,
+ 0x6e, 0x3e, 0x20, 0x28, 0x3c, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x71, 0x70,
+ 0x73, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x3e, 0x20, 0x71, 0x70, 0x73, 0x29, 0x2c,
+ 0x20, 0x41, 0x43, 0x4c, 0x20, 0x64, 0x72, 0x6f, 0x70, 0x73, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61,
+ 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x61, 0x63, 0x6c, 0x2d, 0x64, 0x72, 0x6f, 0x70, 0x73, 0x22,
+ 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x3e, 0x2c, 0x20, 0x44, 0x79, 0x6e, 0x61, 0x6d, 0x69,
+ 0x63, 0x20, 0x64, 0x72, 0x6f, 0x70, 0x73, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69,
+ 0x64, 0x3d, 0x22, 0x64, 0x79, 0x6e, 0x2d, 0x64, 0x72, 0x6f, 0x70, 0x73, 0x22, 0x3e, 0x3c, 0x2f,
+ 0x73, 0x70, 0x61, 0x6e, 0x3e, 0x2c, 0x20, 0x52, 0x75, 0x6c, 0x65, 0x20, 0x64, 0x72, 0x6f, 0x70,
+ 0x73, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x72, 0x75, 0x6c,
+ 0x65, 0x2d, 0x64, 0x72, 0x6f, 0x70, 0x73, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x3e,
+ 0x3c, 0x62, 0x72, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x41, 0x76, 0x65, 0x72,
+ 0x61, 0x67, 0x65, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x74, 0x69, 0x6d,
+ 0x65, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x6c, 0x61, 0x74,
+ 0x65, 0x6e, 0x63, 0x79, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x3e, 0x20, 0x6d, 0x73,
+ 0x2c, 0x20, 0x43, 0x50, 0x55, 0x20, 0x55, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x3c, 0x73, 0x70,
+ 0x61, 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x63, 0x70, 0x75, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70,
+ 0x61, 0x6e, 0x3e, 0x25, 0x2c, 0x20, 0x43, 0x61, 0x63, 0x68, 0x65, 0x20, 0x68, 0x69, 0x74, 0x72,
+ 0x61, 0x74, 0x65, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x70,
+ 0x68, 0x69, 0x74, 0x72, 0x61, 0x74, 0x65, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x3e,
+ 0x25, 0x2c, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61,
+ 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x70, 0x6f, 0x6c,
+ 0x69, 0x63, 0x79, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x3e, 0x3c, 0x62, 0x72, 0x2f,
+ 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x69, 0x6e,
+ 0x67, 0x20, 0x6f, 0x6e, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22,
+ 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x3e, 0x2c, 0x20,
+ 0x41, 0x43, 0x4c, 0x3a, 0x20, 0x3c, 0x73, 0x70, 0x61, 0x6e, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x61,
+ 0x63, 0x6c, 0x22, 0x3e, 0x3c, 0x2f, 0x73, 0x70, 0x61, 0x6e, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x3c, 0x2f, 0x70, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x30, 0x25, 0x22, 0x20, 0x63, 0x65, 0x6c,
+ 0x6c, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x22, 0x32, 0x30, 0x22, 0x3e, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x72, 0x20, 0x76, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d,
+ 0x22, 0x74, 0x6f, 0x70, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c,
+ 0x74, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74,
+ 0x61, 0x62, 0x6c, 0x65, 0x20, 0x63, 0x65, 0x6c, 0x6c, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67,
+ 0x3d, 0x22, 0x31, 0x32, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e,
+ 0x3d, 0x22, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x3e, 0x51, 0x50, 0x53, 0x20, 0x2f, 0x20,
+ 0x53, 0x45, 0x52, 0x56, 0x46, 0x41, 0x49, 0x4c, 0x50, 0x53, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c,
+ 0x2f, 0x74, 0x72, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22, 0x63, 0x68, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74,
+ 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x69,
+ 0x64, 0x3d, 0x22, 0x71, 0x70, 0x73, 0x79, 0x5f, 0x61, 0x78, 0x69, 0x73, 0x22, 0x3e, 0x3c, 0x2f,
+ 0x64, 0x69, 0x76, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3d, 0x22,
+ 0x71, 0x70, 0x73, 0x63, 0x68, 0x61, 0x72, 0x74, 0x22, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x72, 0x3e, 0x3c,
+ 0x74, 0x64, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x22, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72,
+ 0x22, 0x3e, 0x43, 0x41, 0x43, 0x48, 0x45, 0x20, 0x48, 0x49, 0x54, 0x52, 0x41, 0x54, 0x45, 0x20,
+ 0x2f, 0x20, 0x43, 0x50, 0x55, 0x20, 0x25, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72,
+ 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74,
+ 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x63, 0x6c, 0x61, 0x73,
+ 0x73, 0x3d, 0x22, 0x63, 0x68, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
+ 0x65, 0x72, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3d, 0x22,
+ 0x63, 0x70, 0x75, 0x79, 0x5f, 0x61, 0x78, 0x69, 0x73, 0x22, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76,
+ 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x63, 0x70, 0x75,
+ 0x63, 0x68, 0x61, 0x72, 0x74, 0x22, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f,
+ 0x64, 0x69, 0x76, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x0a, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x63, 0x65, 0x6c, 0x6c, 0x70,
+ 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x22, 0x31, 0x35, 0x22, 0x20, 0x77, 0x69, 0x64, 0x74,
+ 0x68, 0x3d, 0x22, 0x31, 0x30, 0x30, 0x25, 0x22, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x22,
+ 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x72, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x64, 0x69, 0x76,
+ 0x20, 0x69, 0x64, 0x3d, 0x22, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x73,
+ 0x22, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0x20, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x72, 0x3e,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x72,
+ 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x72, 0x75, 0x6c,
+ 0x65, 0x73, 0x22, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x72,
+ 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74,
+ 0x72, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x3c, 0x74, 0x64, 0x3e, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x72, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2d, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x3e, 0x3c, 0x2f,
+ 0x64, 0x69, 0x76, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x72, 0x3e, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x64, 0x3e, 0x3c,
+ 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x64, 0x79, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
+ 0x22, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x74, 0x72, 0x3e,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c,
+ 0x74, 0x64, 0x3e, 0x3c, 0x64, 0x69, 0x76, 0x20, 0x69, 0x64, 0x3d, 0x22, 0x65, 0x62, 0x70, 0x66,
+ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x3e, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0x3c, 0x2f, 0x74,
+ 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c,
+ 0x2f, 0x74, 0x72, 0x3e, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74,
+ 0x72, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x0a,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x64, 0x69, 0x76, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x3c, 0x62, 0x72, 0x2f, 0x3e, 0x3c, 0x62, 0x72, 0x2f, 0x3e, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x3c, 0x70, 0x3e, 0x3c, 0x2f, 0x70, 0x3e, 0x3c, 0x70, 0x3e, 0x3c, 0x2f, 0x70, 0x3e,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0x0a, 0x20, 0x20, 0x3c, 0x2f,
+ 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x0a, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x0a,
+
+};
+static const unsigned char gjs_d3_min_jsData[] = {
+ 0x21, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x26, 0x26, 0x28, 0x6e, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x6e, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x7c, 0x7c, 0x6e, 0x29, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x28,
+ 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x26, 0x26, 0x28, 0x6e, 0x2e,
+ 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 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 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x7b, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74,
+ 0x2c, 0x65, 0x2c, 0x72, 0x2c, 0x75, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x33, 0x26, 0x26,
+ 0x28, 0x72, 0x3d, 0x30, 0x29, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x34, 0x26, 0x26, 0x28, 0x75, 0x3d, 0x74, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x3b, 0x75, 0x3e, 0x72, 0x3b, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x69, 0x3d, 0x72, 0x2b, 0x75, 0x3e, 0x3e, 0x3e, 0x31, 0x3b, 0x6e, 0x28, 0x74, 0x5b, 0x69,
+ 0x5d, 0x2c, 0x65, 0x29, 0x3c, 0x30, 0x3f, 0x72, 0x3d, 0x69, 0x2b, 0x31, 0x3a, 0x75, 0x3d, 0x69,
+ 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x7d, 0x2c, 0x72, 0x69, 0x67, 0x68, 0x74,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x2c,
+ 0x75, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x61, 0x72, 0x67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6e, 0x20, 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x28,
+ 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x20, 0x69,
+ 0x6e, 0x20, 0x74, 0x29, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e,
+ 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x65, 0x2c, 0x7b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x74,
+ 0x5b, 0x65, 0x5d, 0x2c, 0x65, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x21,
+ 0x31, 0x7d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x28, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x3d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x28, 0x6e, 0x2b, 0x3d, 0x22, 0x22, 0x29, 0x3d, 0x3d, 0x3d, 0x78, 0x61, 0x7c, 0x7c, 0x6e, 0x5b,
+ 0x30, 0x5d, 0x3d, 0x3d, 0x3d, 0x62, 0x61, 0x3f, 0x62, 0x61, 0x2b, 0x6e, 0x3a, 0x6e, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x28, 0x6e, 0x2b, 0x3d, 0x22, 0x22, 0x29, 0x5b, 0x30, 0x5d, 0x3d, 0x3d, 0x3d,
+ 0x62, 0x61, 0x3f, 0x6e, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x31, 0x29, 0x3a, 0x6e, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x28, 0x6e, 0x29, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x28, 0x6e, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x6e, 0x3d, 0x73, 0x28, 0x6e, 0x29, 0x29, 0x69,
+ 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x26, 0x26, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x5b, 0x6e, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x5b, 0x5d,
+ 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x29, 0x6e, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x66, 0x28, 0x74, 0x29,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x76, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x30, 0x3b,
+ 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x29, 0x2b, 0x2b, 0x6e, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x28, 0x29, 0x7b, 0x66, 0x6f,
+ 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x21, 0x30, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x28, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x3d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x79, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4d, 0x28, 0x6e, 0x2c,
+ 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x65, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x3d, 0x3d, 0x3d, 0x74, 0x3f, 0x6e,
+ 0x3a, 0x72, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x78, 0x28, 0x6e,
+ 0x2c, 0x74, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x29, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x3b, 0x74, 0x3d, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x41,
+ 0x74, 0x28, 0x30, 0x29, 0x2e, 0x74, 0x6f, 0x55, 0x70, 0x70, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65,
+ 0x28, 0x29, 0x2b, 0x74, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x31, 0x29, 0x3b, 0x66, 0x6f,
+ 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x30, 0x2c, 0x72, 0x3d, 0x5f, 0x61, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x72, 0x3e, 0x65, 0x3b, 0x2b, 0x2b, 0x65, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x75, 0x3d, 0x5f, 0x61, 0x5b, 0x65, 0x5d, 0x2b, 0x74, 0x3b, 0x69, 0x66, 0x28,
+ 0x75, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x7d,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x28, 0x29, 0x7b, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5f, 0x28, 0x29, 0x7b, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x28, 0x6e, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x28, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20,
+ 0x74, 0x2c, 0x72, 0x3d, 0x65, 0x2c, 0x75, 0x3d, 0x2d, 0x31, 0x2c, 0x69, 0x3d, 0x72, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x2b, 0x2b, 0x75, 0x3c, 0x69, 0x3b, 0x29, 0x28, 0x74, 0x3d,
+ 0x72, 0x5b, 0x75, 0x5d, 0x2e, 0x6f, 0x6e, 0x29, 0x26, 0x26, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x6c,
+ 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x65,
+ 0x3d, 0x5b, 0x5d, 0x2c, 0x72, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x63, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x6f, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x74, 0x2c, 0x75, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x2c, 0x61, 0x3d, 0x72, 0x2e,
+ 0x67, 0x65, 0x74, 0x28, 0x74, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x32,
+ 0x3f, 0x61, 0x26, 0x26, 0x61, 0x2e, 0x6f, 0x6e, 0x3a, 0x28, 0x61, 0x26, 0x26, 0x28, 0x61, 0x2e,
+ 0x6f, 0x6e, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x65, 0x3d, 0x65, 0x2e, 0x73, 0x6c, 0x69, 0x63,
+ 0x65, 0x28, 0x30, 0x2c, 0x69, 0x3d, 0x65, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28,
+ 0x61, 0x29, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x65, 0x2e, 0x73, 0x6c, 0x69,
+ 0x63, 0x65, 0x28, 0x69, 0x2b, 0x31, 0x29, 0x29, 0x2c, 0x72, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x28, 0x74, 0x29, 0x29, 0x2c, 0x75, 0x26, 0x26, 0x65, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28,
+ 0x72, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x74, 0x2c, 0x7b, 0x6f, 0x6e, 0x3a, 0x75, 0x7d, 0x29, 0x29,
+ 0x2c, 0x6e, 0x29, 0x7d, 0x2c, 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x53, 0x28, 0x29, 0x7b, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65,
+ 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x28, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x28, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76,
+ 0x61, 0x72, 0x20, 0x6e, 0x2c, 0x74, 0x3d, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3b,
+ 0x6e, 0x3d, 0x74, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3b,
+ 0x29, 0x74, 0x3d, 0x6e, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e, 0x28, 0x6e, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28,
+ 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x5f, 0x2c, 0x65, 0x3d, 0x30, 0x2c,
+ 0x72, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x3b, 0x2b, 0x2b, 0x65, 0x3c, 0x72, 0x3b, 0x29, 0x74, 0x5b, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5b, 0x65, 0x5d, 0x5d, 0x3d, 0x77, 0x28, 0x74, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x6f, 0x66, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x75, 0x29, 0x7b, 0x74, 0x72, 0x79, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x75, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x76,
+ 0x65, 0x6e, 0x74, 0x3d, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3b, 0x75, 0x2e, 0x74,
+ 0x61, 0x72, 0x67, 0x65, 0x74, 0x3d, 0x6e, 0x2c, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
+ 0x3d, 0x75, 0x2c, 0x74, 0x5b, 0x75, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x5d, 0x2e, 0x61, 0x70, 0x70,
+ 0x6c, 0x79, 0x28, 0x65, 0x2c, 0x72, 0x29, 0x7d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x7b,
+ 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x69, 0x7d, 0x7d, 0x7d, 0x2c, 0x74, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x53, 0x61, 0x28, 0x6e, 0x2c, 0x41, 0x61, 0x29, 0x2c, 0x6e, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x3f, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6b, 0x61, 0x28,
+ 0x6e, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x43, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20,
+ 0x6e, 0x3f, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4e, 0x61, 0x28, 0x6e, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29,
+ 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7a, 0x28, 0x6e, 0x2c, 0x74,
+ 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x29, 0x7b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+ 0x75, 0x74, 0x65, 0x28, 0x6e, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x72, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41,
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x53, 0x28, 0x6e, 0x2e, 0x73, 0x70, 0x61,
+ 0x63, 0x65, 0x2c, 0x6e, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65,
+ 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x53,
+ 0x28, 0x6e, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x6e, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+ 0x2c, 0x74, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x28, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x65, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6d, 0x6f,
+ 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x6e, 0x29, 0x3a, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f,
+ 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29,
+ 0x3b, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x65, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65,
+ 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x53, 0x28,
+ 0x6e, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x6e, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x29,
+ 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+ 0x74, 0x65, 0x4e, 0x53, 0x28, 0x6e, 0x2e, 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0x20, 0x52, 0x65,
+ 0x67, 0x45, 0x78, 0x70, 0x28, 0x22, 0x28, 0x3f, 0x3a, 0x5e, 0x7c, 0x5c, 0x5c, 0x73, 0x2b, 0x29,
+ 0x22, 0x2b, 0x6f, 0x61, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x28, 0x6e, 0x29, 0x2b,
+ 0x22, 0x28, 0x3f, 0x3a, 0x5c, 0x5c, 0x73, 0x2b, 0x7c, 0x24, 0x29, 0x22, 0x2c, 0x22, 0x67, 0x22,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x28, 0x6e, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x6e, 0x2b, 0x22, 0x22, 0x29, 0x2e, 0x74, 0x72, 0x69,
+ 0x6d, 0x28, 0x29, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x2f, 0x5e, 0x7c, 0x5c, 0x73, 0x2b,
+ 0x2f, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x29, 0x7b,
+ 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x2d, 0x31, 0x3b, 0x2b, 0x2b, 0x65,
+ 0x3c, 0x75, 0x3b, 0x29, 0x6e, 0x5b, 0x65, 0x5d, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x74, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x29, 0x7b, 0x66, 0x6f,
+ 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x2d, 0x31, 0x2c, 0x72, 0x3d, 0x74, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x2b, 0x2b, 0x65, 0x3c, 0x75, 0x3b, 0x29, 0x6e, 0x5b, 0x65, 0x5d,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x72, 0x29, 0x7d, 0x6e, 0x3d, 0x54, 0x28, 0x6e, 0x29, 0x2e,
+ 0x6d, 0x61, 0x70, 0x28, 0x44, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x6e, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74,
+ 0x3f, 0x72, 0x3a, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x44, 0x28,
+ 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x71, 0x28, 0x6e, 0x29, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x2c,
+ 0x72, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x75, 0x3d, 0x65, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c,
+ 0x69, 0x73, 0x74, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x3f, 0x75, 0x2e, 0x61,
+ 0x64, 0x64, 0x28, 0x6e, 0x29, 0x3a, 0x75, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x6e,
+ 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x29, 0x7c,
+ 0x7c, 0x22, 0x22, 0x3b, 0x72, 0x3f, 0x28, 0x74, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x64,
+ 0x65, 0x78, 0x3d, 0x30, 0x2c, 0x74, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x75, 0x29, 0x7c, 0x7c,
+ 0x65, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x4c, 0x28, 0x75, 0x2b, 0x22, 0x20, 0x22, 0x2b, 0x6e,
+ 0x29, 0x29, 0x29, 0x3a, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+ 0x74, 0x65, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x4c, 0x28, 0x75, 0x2e, 0x72,
+ 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x74, 0x2c, 0x22, 0x20, 0x22, 0x29, 0x29, 0x29, 0x7d,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x50, 0x28, 0x6e, 0x2c, 0x74, 0x2c,
+ 0x65, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x6e, 0x29, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79,
+ 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x69, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x74, 0x2e, 0x61, 0x70, 0x70,
+ 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x29, 0x3b, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x72, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x70,
+ 0x65, 0x72, 0x74, 0x79, 0x28, 0x6e, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x79,
+ 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x6e,
+ 0x2c, 0x72, 0x2c, 0x65, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x3d, 0x3d, 0x74, 0x3f, 0x72, 0x3a, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x3f, 0x69, 0x3a, 0x75, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x29, 0x7b, 0x64, 0x65, 0x6c,
+ 0x65, 0x74, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6e, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6e, 0x5d,
+ 0x3d, 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x3d, 0x3d, 0x65, 0x3f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x5b, 0x6e, 0x5d, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6e, 0x5d, 0x3d, 0x65, 0x7d, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x74, 0x3f, 0x65, 0x3a,
+ 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65,
+ 0x6f, 0x66, 0x20, 0x74, 0x3f, 0x75, 0x3a, 0x72, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x55, 0x28, 0x6e, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x74, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f,
+ 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x65, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x55, 0x52, 0x49,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x3f, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x53, 0x28, 0x65, 0x2c, 0x6e, 0x29,
+ 0x3a, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x28, 0x6e, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x77, 0x6e,
+ 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x53, 0x28, 0x6e, 0x2e, 0x73, 0x70, 0x61,
+ 0x63, 0x65, 0x2c, 0x6e, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79,
+ 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x3f, 0x6e, 0x3a, 0x28, 0x6e, 0x3d, 0x6f, 0x61, 0x2e, 0x6e,
+ 0x73, 0x2e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x79, 0x28, 0x6e, 0x29, 0x29, 0x2e, 0x6c, 0x6f,
+ 0x63, 0x61, 0x6c, 0x3f, 0x65, 0x3a, 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x46, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x26, 0x26, 0x6e, 0x2e,
+ 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x48, 0x28, 0x6e, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x5f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x5f, 0x3a,
+ 0x6e, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x28, 0x6e, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x45, 0x61, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x6e, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x49,
+ 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7c, 0x7c, 0x28, 0x6e, 0x3d,
+ 0x65, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x26, 0x26, 0x65, 0x3f, 0x6e, 0x28, 0x74,
+ 0x2e, 0x5f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x5f, 0x2c, 0x65, 0x2e, 0x5f, 0x5f, 0x64, 0x61,
+ 0x74, 0x61, 0x5f, 0x5f, 0x29, 0x3a, 0x21, 0x74, 0x2d, 0x21, 0x65, 0x7d, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x59, 0x28,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,
+ 0x20, 0x61, 0x2c, 0x6f, 0x3d, 0x6e, 0x5b, 0x69, 0x5d, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x2c, 0x6c, 0x3d, 0x6f, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x66, 0x6f, 0x72, 0x28,
+ 0x69, 0x21, 0x3d, 0x65, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x69, 0x2c, 0x74, 0x3d, 0x30, 0x29, 0x2c,
+ 0x75, 0x3e, 0x3d, 0x74, 0x26, 0x26, 0x28, 0x74, 0x3d, 0x75, 0x2b, 0x31, 0x29, 0x3b, 0x21, 0x28,
+ 0x61, 0x3d, 0x6f, 0x5b, 0x74, 0x5d, 0x29, 0x26, 0x26, 0x2b, 0x2b, 0x74, 0x3c, 0x6c, 0x3b, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x58, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x5b, 0x61, 0x5d, 0x3b, 0x74, 0x26, 0x26, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74,
+ 0x65, 0x6e, 0x65, 0x72, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x74, 0x2e, 0x24, 0x29, 0x2c, 0x64, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x61, 0x5d, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x75,
+ 0x3d, 0x6c, 0x28, 0x74, 0x2c, 0x63, 0x61, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x29, 0x29, 0x3b, 0x72, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69,
+ 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x6e, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x61, 0x5d,
+ 0x3d, 0x75, 0x2c, 0x75, 0x2e, 0x24, 0x3d, 0x65, 0x29, 0x2c, 0x75, 0x2e, 0x5f, 0x3d, 0x74, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x74, 0x2c, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28,
+ 0x22, 0x5e, 0x5f, 0x5f, 0x6f, 0x6e, 0x28, 0x5b, 0x5e, 0x2e, 0x5d, 0x2b, 0x29, 0x22, 0x2b, 0x6f,
+ 0x61, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x6f, 0x74, 0x65, 0x28, 0x6e, 0x29, 0x2b, 0x22, 0x24, 0x22,
+ 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x74,
+ 0x68, 0x69, 0x73, 0x29, 0x69, 0x66, 0x28, 0x74, 0x3d, 0x72, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68,
+ 0x28, 0x65, 0x29, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b,
+ 0x72, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45, 0x76,
+ 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x74, 0x5b, 0x31, 0x5d,
+ 0x2c, 0x75, 0x2c, 0x75, 0x2e, 0x24, 0x29, 0x2c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x74,
+ 0x68, 0x69, 0x73, 0x5b, 0x72, 0x5d, 0x7d, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x22, 0x5f,
+ 0x5f, 0x6f, 0x6e, 0x22, 0x2b, 0x6e, 0x2c, 0x6f, 0x3d, 0x6e, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78,
+ 0x4f, 0x66, 0x28, 0x22, 0x2e, 0x22, 0x29, 0x2c, 0x6c, 0x3d, 0x24, 0x3b, 0x6f, 0x3e, 0x30, 0x26,
+ 0x26, 0x28, 0x6e, 0x3d, 0x6e, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x2c, 0x6f, 0x29,
+ 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x4c, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x28, 0x6e,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x26, 0x26, 0x28, 0x6e, 0x3d, 0x63,
+ 0x2c, 0x6c, 0x3d, 0x42, 0x29, 0x2c, 0x6f, 0x3f, 0x74, 0x3f, 0x75, 0x3a, 0x72, 0x3a, 0x74, 0x3f,
+ 0x62, 0x3a, 0x69, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x24, 0x28, 0x6e,
+ 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x6f, 0x61, 0x2e,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3b, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x65,
+ 0x2c, 0x74, 0x5b, 0x30, 0x5d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x5f, 0x64, 0x61, 0x74,
+ 0x61, 0x5f, 0x5f, 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x6e, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2c, 0x74, 0x29, 0x7d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x7b,
+ 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x72, 0x7d, 0x7d, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x42, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x65, 0x3d, 0x24, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x72, 0x3d, 0x6e, 0x2e, 0x72, 0x65, 0x6c, 0x61,
+ 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3b, 0x72, 0x26, 0x26, 0x28, 0x72, 0x3d,
+ 0x3d, 0x3d, 0x74, 0x7c, 0x7c, 0x38, 0x26, 0x72, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65,
+ 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x74, 0x29, 0x29, 0x7c, 0x7c, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x2c, 0x6e,
+ 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x57, 0x28, 0x65, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x22, 0x2e, 0x64, 0x72, 0x61, 0x67, 0x73, 0x75, 0x70,
+ 0x70, 0x72, 0x65, 0x73, 0x73, 0x2d, 0x22, 0x2b, 0x20, 0x2b, 0x2b, 0x54, 0x61, 0x2c, 0x75, 0x3d,
+ 0x22, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x22, 0x2b, 0x72, 0x2c, 0x69, 0x3d, 0x6f, 0x61, 0x2e, 0x73,
+ 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x28, 0x65, 0x29, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22,
+ 0x74, 0x6f, 0x75, 0x63, 0x68, 0x6d, 0x6f, 0x76, 0x65, 0x22, 0x2b, 0x72, 0x2c, 0x53, 0x29, 0x2e,
+ 0x6f, 0x6e, 0x28, 0x22, 0x64, 0x72, 0x61, 0x67, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x2b, 0x72,
+ 0x2c, 0x53, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x73, 0x74,
+ 0x61, 0x72, 0x74, 0x22, 0x2b, 0x72, 0x2c, 0x53, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x3d, 0x3d, 0x71, 0x61, 0x26, 0x26, 0x28, 0x71, 0x61, 0x3d, 0x22, 0x6f, 0x6e, 0x73, 0x65,
+ 0x6c, 0x65, 0x63, 0x74, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x69, 0x6e, 0x20, 0x65, 0x3f, 0x21,
+ 0x31, 0x3a, 0x78, 0x28, 0x65, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2c, 0x22, 0x75, 0x73, 0x65,
+ 0x72, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x22, 0x29, 0x29, 0x2c, 0x71, 0x61, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x61, 0x3d, 0x6e, 0x28, 0x65, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2c,
+ 0x6f, 0x3d, 0x61, 0x5b, 0x71, 0x61, 0x5d, 0x3b, 0x61, 0x5b, 0x71, 0x61, 0x5d, 0x3d, 0x22, 0x6e,
+ 0x6f, 0x6e, 0x65, 0x22, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x69, 0x2e, 0x6f, 0x6e, 0x28,
+ 0x72, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2c, 0x71, 0x61, 0x26, 0x26, 0x28, 0x61, 0x5b, 0x71,
+ 0x61, 0x5d, 0x3d, 0x6f, 0x29, 0x2c, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x69, 0x2e, 0x6f, 0x6e, 0x28, 0x75,
+ 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x7d, 0x3b, 0x69, 0x2e, 0x6f, 0x6e, 0x28, 0x75, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x53, 0x28, 0x29, 0x2c, 0x74, 0x28,
+ 0x29, 0x7d, 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75,
+ 0x74, 0x28, 0x74, 0x2c, 0x30, 0x29, 0x7d, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x4a, 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x7b, 0x65, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67,
+ 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x65, 0x2e,
+ 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x5b, 0x30,
+ 0x5d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x6e, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72,
+ 0x53, 0x56, 0x47, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x6e, 0x3b, 0x69, 0x66,
+ 0x28, 0x72, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x56, 0x47, 0x50, 0x6f, 0x69, 0x6e,
+ 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x72, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x53, 0x56, 0x47, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x30,
+ 0x3e, 0x52, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x74, 0x28, 0x6e, 0x29, 0x3b,
+ 0x69, 0x66, 0x28, 0x69, 0x2e, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x58, 0x7c, 0x7c, 0x69, 0x2e,
+ 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x59, 0x29, 0x7b, 0x72, 0x3d, 0x6f, 0x61, 0x2e, 0x73, 0x65,
+ 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x29, 0x2e, 0x61, 0x70, 0x70,
+ 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76, 0x67, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65,
+ 0x28, 0x7b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x62, 0x73, 0x6f,
+ 0x6c, 0x75, 0x74, 0x65, 0x22, 0x2c, 0x74, 0x6f, 0x70, 0x3a, 0x30, 0x2c, 0x6c, 0x65, 0x66, 0x74,
+ 0x3a, 0x30, 0x2c, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x30, 0x2c, 0x70, 0x61, 0x64, 0x64,
+ 0x69, 0x6e, 0x67, 0x3a, 0x30, 0x2c, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x22, 0x6e, 0x6f,
+ 0x6e, 0x65, 0x22, 0x7d, 0x2c, 0x22, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6e, 0x74, 0x22,
+ 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x72, 0x5b, 0x30, 0x5d, 0x5b, 0x30, 0x5d, 0x2e,
+ 0x67, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x43, 0x54, 0x4d, 0x28, 0x29, 0x3b, 0x52,
+ 0x61, 0x3d, 0x21, 0x28, 0x61, 0x2e, 0x66, 0x7c, 0x7c, 0x61, 0x2e, 0x65, 0x29, 0x2c, 0x72, 0x2e,
+ 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x7d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x52, 0x61, 0x3f, 0x28, 0x75, 0x2e, 0x78, 0x3d, 0x65, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x58,
+ 0x2c, 0x75, 0x2e, 0x79, 0x3d, 0x65, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x59, 0x29, 0x3a, 0x28, 0x75,
+ 0x2e, 0x78, 0x3d, 0x65, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x2c, 0x75, 0x2e, 0x79,
+ 0x3d, 0x65, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x59, 0x29, 0x2c, 0x75, 0x3d, 0x75, 0x2e,
+ 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x28,
+ 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x43, 0x54, 0x4d, 0x28, 0x29,
+ 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x65, 0x28, 0x29, 0x29, 0x2c, 0x5b, 0x75, 0x2e, 0x78,
+ 0x2c, 0x75, 0x2e, 0x79, 0x5d, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x6f, 0x3d, 0x6e, 0x2e, 0x67, 0x65,
+ 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52,
+ 0x65, 0x63, 0x74, 0x28, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x65, 0x2e, 0x63,
+ 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x2d, 0x6f, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0x6e, 0x2e,
+ 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x66, 0x74, 0x2c, 0x65, 0x2e, 0x63, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x59, 0x2d, 0x6f, 0x2e, 0x74, 0x6f, 0x70, 0x2d, 0x6e, 0x2e, 0x63, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x70, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x47, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x61, 0x2e, 0x65,
+ 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63,
+ 0x68, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65,
+ 0x72, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4b, 0x28, 0x6e, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3e, 0x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x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x28, 0x6e, 0x29, 0x26,
+ 0x26, 0x28, 0x6e, 0x3d, 0x30, 0x29, 0x2c, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x28, 0x74, 0x29, 0x26,
+ 0x26, 0x28, 0x74, 0x3d, 0x30, 0x29, 0x2c, 0x6e, 0x65, 0x77, 0x20, 0x68, 0x6e, 0x28, 0x65, 0x2c,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x6e, 0x2a, 0x3d, 0x4f, 0x61, 0x29, 0x2a,
+ 0x74, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x6e, 0x29, 0x2a, 0x74, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x6e, 0x28, 0x6e, 0x2c, 0x74,
+ 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20,
+ 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x6f, 0x66, 0x20, 0x68, 0x6e, 0x3f, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x3d, 0x2b, 0x6e, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x3d,
+ 0x2b, 0x74, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x3d, 0x2b,
+ 0x65, 0x29, 0x29, 0x3a, 0x61, 0x72, 0x67, 0x75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72, 0x6e, 0x20,
+ 0x75, 0x3d, 0x76, 0x6e, 0x28, 0x75, 0x29, 0x2a, 0x4b, 0x61, 0x2c, 0x72, 0x3d, 0x76, 0x6e, 0x28,
+ 0x72, 0x29, 0x2a, 0x51, 0x61, 0x2c, 0x69, 0x3d, 0x76, 0x6e, 0x28, 0x69, 0x29, 0x2a, 0x6e, 0x6f,
+ 0x2c, 0x6e, 0x65, 0x77, 0x20, 0x79, 0x6e, 0x28, 0x6d, 0x6e, 0x28, 0x33, 0x2e, 0x32, 0x34, 0x30,
+ 0x34, 0x35, 0x34, 0x32, 0x2a, 0x75, 0x2d, 0x31, 0x2e, 0x35, 0x33, 0x37, 0x31, 0x33, 0x38, 0x35,
+ 0x2a, 0x72, 0x2d, 0x2e, 0x34, 0x39, 0x38, 0x35, 0x33, 0x31, 0x34, 0x2a, 0x69, 0x29, 0x2c, 0x6d,
+ 0x6e, 0x28, 0x2d, 0x2e, 0x39, 0x36, 0x39, 0x32, 0x36, 0x36, 0x2a, 0x75, 0x2b, 0x31, 0x2e, 0x38,
+ 0x37, 0x36, 0x30, 0x31, 0x30, 0x38, 0x2a, 0x72, 0x2b, 0x2e, 0x30, 0x34, 0x31, 0x35, 0x35, 0x36,
+ 0x2a, 0x69, 0x29, 0x2c, 0x6d, 0x6e, 0x28, 0x2e, 0x30, 0x35, 0x35, 0x36, 0x34, 0x33, 0x34, 0x2a,
+ 0x75, 0x2d, 0x2e, 0x32, 0x30, 0x34, 0x30, 0x32, 0x35, 0x39, 0x2a, 0x72, 0x2b, 0x31, 0x2e, 0x30,
+ 0x35, 0x37, 0x32, 0x32, 0x35, 0x32, 0x2a, 0x69, 0x29, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3e, 0x30, 0x3f, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x6e, 0x28,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x74, 0x61, 0x6e, 0x32, 0x28, 0x65, 0x2c, 0x74, 0x29, 0x2a,
+ 0x49, 0x61, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28, 0x74, 0x2a, 0x74,
+ 0x2b, 0x65, 0x2a, 0x65, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x6e, 0x28,
+ 0x4e, 0x61, 0x4e, 0x2c, 0x4e, 0x61, 0x4e, 0x2c, 0x6e, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x76, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x3e, 0x2e, 0x32, 0x30, 0x36, 0x38, 0x39, 0x33, 0x30, 0x33, 0x34, 0x3f, 0x6e, 0x2a,
+ 0x6e, 0x2a, 0x6e, 0x3a, 0x28, 0x6e, 0x2d, 0x34, 0x2f, 0x32, 0x39, 0x29, 0x2f, 0x37, 0x2e, 0x37,
+ 0x38, 0x37, 0x30, 0x33, 0x37, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3e, 0x2e, 0x30,
+ 0x30, 0x38, 0x38, 0x35, 0x36, 0x3f, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x6e,
+ 0x2c, 0x31, 0x2f, 0x33, 0x29, 0x3a, 0x37, 0x2e, 0x37, 0x38, 0x37, 0x30, 0x33, 0x37, 0x2a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31, 0x5d, 0x29, 0x7b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x68, 0x73, 0x6c,
+ 0x22, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x28, 0x70, 0x61, 0x72, 0x73, 0x65,
+ 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x75, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x70, 0x61, 0x72, 0x73,
+ 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x75, 0x5b, 0x31, 0x5d, 0x29, 0x2f, 0x31, 0x30, 0x30,
+ 0x2c, 0x70, 0x61, 0x72, 0x73, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x75, 0x5b, 0x32, 0x5d,
+ 0x29, 0x2f, 0x31, 0x30, 0x30, 0x29, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x72, 0x67, 0x62, 0x22,
+ 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x28, 0x4e, 0x6e, 0x28, 0x75, 0x5b, 0x30,
+ 0x5d, 0x29, 0x2c, 0x4e, 0x6e, 0x28, 0x75, 0x5b, 0x31, 0x5d, 0x29, 0x2c, 0x4e, 0x6e, 0x28, 0x75,
+ 0x5b, 0x32, 0x5d, 0x29, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x69, 0x3d, 0x72,
+ 0x6f, 0x2e, 0x67, 0x65, 0x74, 0x28, 0x6e, 0x29, 0x29, 0x3f, 0x74, 0x28, 0x69, 0x2e, 0x72, 0x2c,
+ 0x69, 0x2e, 0x67, 0x2c, 0x69, 0x2e, 0x62, 0x29, 0x3a, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d,
+ 0x6e, 0x7c, 0x7c, 0x22, 0x23, 0x22, 0x21, 0x3d, 0x3d, 0x6e, 0x2e, 0x63, 0x68, 0x61, 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2e, 0x30, 0x31, 0x39, 0x33, 0x33, 0x33, 0x39, 0x2a, 0x6e, 0x2b, 0x2e, 0x31, 0x31, 0x39, 0x31,
+ 0x39, 0x32, 0x2a, 0x74, 0x2b, 0x2e, 0x39, 0x35, 0x30, 0x33, 0x30, 0x34, 0x31, 0x2a, 0x65, 0x29,
+ 0x2f, 0x6e, 0x6f, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x68, 0x6e, 0x28, 0x31,
+ 0x31, 0x36, 0x2a, 0x75, 0x2d, 0x31, 0x36, 0x2c, 0x35, 0x30, 0x30, 0x2a, 0x28, 0x72, 0x2d, 0x75,
+ 0x29, 0x2c, 0x32, 0x30, 0x30, 0x2a, 0x28, 0x75, 0x2d, 0x69, 0x29, 0x29, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x28, 0x6e, 0x2f, 0x3d, 0x32, 0x35, 0x35, 0x29, 0x3c, 0x3d, 0x2e, 0x30, 0x34, 0x30,
+ 0x34, 0x35, 0x3f, 0x6e, 0x2f, 0x31, 0x32, 0x2e, 0x39, 0x32, 0x3a, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x70, 0x6f, 0x77, 0x28, 0x28, 0x6e, 0x2b, 0x2e, 0x30, 0x35, 0x35, 0x29, 0x2f, 0x31, 0x2e, 0x30,
+ 0x35, 0x35, 0x2c, 0x32, 0x2e, 0x34, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x4e, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x70, 0x61, 0x72,
+ 0x73, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x6e, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x22, 0x25, 0x22, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x41, 0x74, 0x28,
+ 0x6e, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x29, 0x3f, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x32, 0x2e, 0x35, 0x35, 0x2a, 0x74, 0x29, 0x3a, 0x74,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x6e, 0x28, 0x6e, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22,
+ 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x3f, 0x6e, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x6e, 0x28, 0x6e, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x32,
+ 0x3d, 0x3d, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x26, 0x26, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d,
+ 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x65, 0x26, 0x26, 0x28, 0x72, 0x3d, 0x65, 0x2c,
+ 0x65, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2c, 0x43, 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x2c, 0x6e,
+ 0x2c, 0x72, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x6e,
+ 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x2c, 0x74, 0x3d, 0x6c,
+ 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x74, 0x26, 0x26, 0x4c,
+ 0x6e, 0x28, 0x6c, 0x29, 0x7c, 0x7c, 0x74, 0x3e, 0x3d, 0x32, 0x30, 0x30, 0x26, 0x26, 0x33, 0x30,
+ 0x30, 0x3e, 0x74, 0x7c, 0x7c, 0x33, 0x30, 0x34, 0x3d, 0x3d, 0x3d, 0x74, 0x29, 0x7b, 0x74, 0x72,
+ 0x79, 0x7b, 0x6e, 0x3d, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x69, 0x2c, 0x6c, 0x29, 0x7d,
+ 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x76, 0x6f, 0x69, 0x64, 0x20, 0x61, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x69, 0x2c, 0x72, 0x29, 0x7d, 0x61, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x69, 0x2c, 0x6e, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x61, 0x2e, 0x65,
+ 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x69, 0x2c, 0x6c, 0x29, 0x7d, 0x76,
+ 0x61, 0x72, 0x20, 0x69, 0x3d, 0x7b, 0x7d, 0x2c, 0x61, 0x3d, 0x6f, 0x61, 0x2e, 0x64, 0x69, 0x73,
+ 0x70, 0x61, 0x74, 0x63, 0x68, 0x28, 0x22, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x73, 0x65, 0x6e,
+ 0x64, 0x22, 0x2c, 0x22, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x6c,
+ 0x6f, 0x61, 0x64, 0x22, 0x2c, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x29, 0x2c, 0x6f, 0x3d,
+ 0x7b, 0x7d, 0x2c, 0x6c, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x58, 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2c, 0x63, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x58, 0x44, 0x6f, 0x6d, 0x61,
+ 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x7c, 0x7c, 0x22, 0x77, 0x69, 0x74, 0x68,
+ 0x43, 0x72, 0x65, 0x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74, 0x22, 0x5d, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61,
+ 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x69,
+ 0x5b, 0x6e, 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x2e, 0x61, 0x70, 0x70,
+ 0x6c, 0x79, 0x28, 0x69, 0x2c, 0x5b, 0x6e, 0x5d, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28,
+ 0x63, 0x61, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x29, 0x29, 0x7d,
+ 0x7d, 0x29, 0x2c, 0x69, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x65, 0x2c, 0x72, 0x2c, 0x75, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x32, 0x3d, 0x3d,
+ 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x26, 0x26, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x72, 0x26, 0x26, 0x28, 0x75, 0x3d, 0x72, 0x2c, 0x72, 0x3d,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2c, 0x6c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x65, 0x2c, 0x6e,
+ 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x74, 0x7c, 0x7c, 0x22, 0x61,
+ 0x63, 0x63, 0x65, 0x70, 0x74, 0x22, 0x69, 0x6e, 0x20, 0x6f, 0x7c, 0x7c, 0x28, 0x6f, 0x2e, 0x61,
+ 0x63, 0x63, 0x65, 0x70, 0x74, 0x3d, 0x74, 0x2b, 0x22, 0x2c, 0x2a, 0x2f, 0x2a, 0x22, 0x29, 0x2c,
+ 0x6c, 0x2e, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64,
+ 0x65, 0x72, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x73, 0x20, 0x69, 0x6e, 0x20,
+ 0x6f, 0x29, 0x6c, 0x2e, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65,
+ 0x61, 0x64, 0x65, 0x72, 0x28, 0x73, 0x2c, 0x6f, 0x5b, 0x73, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x74, 0x26, 0x26, 0x6c, 0x2e, 0x6f,
+ 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26,
+ 0x26, 0x6c, 0x2e, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x4d, 0x69, 0x6d, 0x65, 0x54,
+ 0x79, 0x70, 0x65, 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x63, 0x26, 0x26,
+ 0x28, 0x6c, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,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 0x3d, 0x3d,
+ 0x72, 0x26, 0x26, 0x22, 0x3d, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x29, 0x26, 0x26, 0x28, 0x63, 0x3d,
+ 0x72, 0x3d, 0x22, 0x30, 0x22, 0x2c, 0x61, 0x3d, 0x22, 0x3d, 0x22, 0x29, 0x2c, 0x67, 0x29, 0x7b,
+ 0x63, 0x61, 0x73, 0x65, 0x22, 0x6e, 0x22, 0x3a, 0x66, 0x3d, 0x21, 0x30, 0x2c, 0x67, 0x3d, 0x22,
+ 0x67, 0x22, 0x3b, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x25, 0x22,
+ 0x3a, 0x70, 0x3d, 0x31, 0x30, 0x30, 0x2c, 0x64, 0x3d, 0x22, 0x25, 0x22, 0x2c, 0x67, 0x3d, 0x22,
+ 0x66, 0x22, 0x3b, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x70, 0x22,
+ 0x3a, 0x70, 0x3d, 0x31, 0x30, 0x30, 0x2c, 0x64, 0x3d, 0x22, 0x25, 0x22, 0x2c, 0x67, 0x3d, 0x22,
+ 0x72, 0x22, 0x3b, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x62, 0x22,
+ 0x3a, 0x63, 0x61, 0x73, 0x65, 0x22, 0x6f, 0x22, 0x3a, 0x63, 0x61, 0x73, 0x65, 0x22, 0x78, 0x22,
+ 0x3a, 0x63, 0x61, 0x73, 0x65, 0x22, 0x58, 0x22, 0x3a, 0x22, 0x23, 0x22, 0x3d, 0x3d, 0x3d, 0x6c,
+ 0x26, 0x26, 0x28, 0x76, 0x3d, 0x22, 0x30, 0x22, 0x2b, 0x67, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77,
+ 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x29, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x63,
+ 0x22, 0x3a, 0x79, 0x3d, 0x21, 0x31, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x64, 0x22, 0x3a, 0x6d,
+ 0x3d, 0x21, 0x30, 0x2c, 0x68, 0x3d, 0x30, 0x3b, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x63, 0x61,
+ 0x73, 0x65, 0x22, 0x73, 0x22, 0x3a, 0x70, 0x3d, 0x2d, 0x31, 0x2c, 0x67, 0x3d, 0x22, 0x72, 0x22,
+ 0x7d, 0x22, 0x24, 0x22, 0x3d, 0x3d, 0x3d, 0x6c, 0x26, 0x26, 0x28, 0x76, 0x3d, 0x75, 0x5b, 0x30,
+ 0x5d, 0x2c, 0x64, 0x3d, 0x75, 0x5b, 0x31, 0x5d, 0x29, 0x2c, 0x22, 0x72, 0x22, 0x21, 0x3d, 0x67,
+ 0x7c, 0x7c, 0x68, 0x7c, 0x7c, 0x28, 0x67, 0x3d, 0x22, 0x67, 0x22, 0x29, 0x2c, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x21, 0x3d, 0x68, 0x26, 0x26, 0x28, 0x22, 0x67, 0x22, 0x3d, 0x3d, 0x67, 0x3f, 0x68, 0x3d,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x31, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x6d, 0x69, 0x6e, 0x28, 0x32, 0x31, 0x2c, 0x68, 0x29, 0x29, 0x3a, 0x28, 0x22, 0x65, 0x22, 0x3d,
+ 0x3d, 0x67, 0x7c, 0x7c, 0x22, 0x66, 0x22, 0x3d, 0x3d, 0x67, 0x29, 0x26, 0x26, 0x28, 0x68, 0x3d,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x30, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x6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 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x3a, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5b, 0x30, 0x5d,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x6e, 0x28, 0x6e, 0x2c,
+ 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28,
+ 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x72, 0x3d,
+ 0x69, 0x28, 0x65, 0x2c, 0x31, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x2d,
+ 0x74, 0x3e, 0x74, 0x2d, 0x65, 0x3f, 0x65, 0x3a, 0x72, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74,
+ 0x28, 0x65, 0x3d, 0x6e, 0x28, 0x6e, 0x65, 0x77, 0x20, 0x67, 0x6f, 0x28, 0x65, 0x2d, 0x31, 0x29,
+ 0x29, 0x2c, 0x31, 0x29, 0x2c, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x69, 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x28,
+ 0x6e, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x67, 0x6f, 0x28, 0x2b, 0x6e, 0x29, 0x2c, 0x65, 0x29, 0x2c,
+ 0x6e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x28, 0x6e, 0x2c, 0x72,
+ 0x2c, 0x69, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x75, 0x28, 0x6e, 0x29, 0x2c, 0x6f,
+ 0x3d, 0x5b, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x69, 0x3e, 0x31, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x3b,
+ 0x72, 0x3e, 0x61, 0x3b, 0x29, 0x65, 0x28, 0x61, 0x29, 0x25, 0x69, 0x7c, 0x7c, 0x6f, 0x2e, 0x70,
+ 0x75, 0x73, 0x68, 0x28, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x2b, 0x61, 0x29,
+ 0x29, 0x2c, 0x74, 0x28, 0x61, 0x2c, 0x31, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x66, 0x6f,
+ 0x72, 0x28, 0x3b, 0x72, 0x3e, 0x61, 0x3b, 0x29, 0x6f, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6e,
+ 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x2b, 0x61, 0x29, 0x29, 0x2c, 0x74, 0x28, 0x61,
+ 0x2c, 0x31, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x74,
+ 0x72, 0x79, 0x7b, 0x67, 0x6f, 0x3d, 0x48, 0x6e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x6e,
+ 0x65, 0x77, 0x20, 0x48, 0x6e, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x2e, 0x5f,
+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0x48, 0x6e, 0x3a, 0x67, 0x6f, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x6a, 0x22, 0x69, 0x6e, 0x20, 0x72, 0x3f, 0x61, 0x2e,
+ 0x73, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x72, 0x2e, 0x79, 0x2c,
+ 0x30, 0x2c, 0x72, 0x2e, 0x6a, 0x29, 0x3a, 0x22, 0x57, 0x22, 0x69, 0x6e, 0x20, 0x72, 0x7c, 0x7c,
+ 0x22, 0x55, 0x22, 0x69, 0x6e, 0x20, 0x72, 0x3f, 0x28, 0x22, 0x77, 0x22, 0x69, 0x6e, 0x20, 0x72,
+ 0x7c, 0x7c, 0x28, 0x72, 0x2e, 0x77, 0x3d, 0x22, 0x57, 0x22, 0x69, 0x6e, 0x20, 0x72, 0x3f, 0x31,
+ 0x3a, 0x30, 0x29, 0x2c, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61,
+ 0x72, 0x28, 0x72, 0x2e, 0x79, 0x2c, 0x30, 0x2c, 0x31, 0x29, 0x2c, 0x61, 0x2e, 0x73, 0x65, 0x74,
+ 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x72, 0x2e, 0x79, 0x2c, 0x30, 0x2c, 0x22,
+ 0x57, 0x22, 0x69, 0x6e, 0x20, 0x72, 0x3f, 0x28, 0x72, 0x2e, 0x77, 0x2b, 0x36, 0x29, 0x25, 0x37,
+ 0x2b, 0x37, 0x2a, 0x72, 0x2e, 0x57, 0x2d, 0x28, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x79,
+ 0x28, 0x29, 0x2b, 0x35, 0x29, 0x25, 0x37, 0x3a, 0x72, 0x2e, 0x77, 0x2b, 0x37, 0x2a, 0x72, 0x2e,
+ 0x55, 0x2d, 0x28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68, 0x2c, 0x63, 0x3d, 0x65, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x6c, 0x3e, 0x6f, 0x3b, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x72, 0x3e, 0x3d, 0x63, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2d, 0x31, 0x3b, 0x69, 0x66,
+ 0x28, 0x75, 0x3d, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28,
+ 0x6f, 0x2b, 0x2b, 0x29, 0x2c, 0x33, 0x37, 0x3d, 0x3d, 0x3d, 0x75, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x61, 0x3d, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x41, 0x74, 0x28, 0x6f, 0x2b, 0x2b, 0x29, 0x2c,
+ 0x69, 0x3d, 0x43, 0x5b, 0x61, 0x20, 0x69, 0x6e, 0x20, 0x76, 0x6f, 0x3f, 0x74, 0x2e, 0x63, 0x68,
+ 0x61, 0x72, 0x41, 0x74, 0x28, 0x6f, 0x2b, 0x2b, 0x29, 0x3a, 0x61, 0x5d, 0x2c, 0x21, 0x69, 0x7c,
+ 0x7c, 0x28, 0x72, 0x3d, 0x69, 0x28, 0x6e, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x29, 0x3c, 0x30, 0x29,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2d, 0x31, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66,
+ 0x28, 0x75, 0x21, 0x3d, 0x65, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74,
+ 0x28, 0x72, 0x2b, 0x2b, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2d, 0x31, 0x7d, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x72, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x5f, 0x2e, 0x6c, 0x61, 0x73, 0x74,
+ 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x5f, 0x2e,
+ 0x65, 0x78, 0x65, 0x63, 0x28, 0x74, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x65, 0x29, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x3f, 0x28, 0x6e, 0x2e, 0x77, 0x3d, 0x77,
+ 0x2e, 0x67, 0x65, 0x74, 0x28, 0x72, 0x5b, 0x30, 0x5d, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65,
+ 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x29, 0x2c, 0x65, 0x2b, 0x72, 0x5b, 0x30, 0x5d, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x3a, 0x2d, 0x31, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x78, 0x2e, 0x6c,
+ 0x61, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72,
+ 0x3d, 0x78, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x74, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28,
+ 0x65, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x3f, 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, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x30,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x53, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x74, 0x2e,
+ 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x65, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x72, 0x3f, 0x28, 0x6e, 0x2e, 0x6d, 0x3d, 0x6b, 0x2e, 0x67, 0x65, 0x74, 0x28, 0x72, 0x5b,
+ 0x30, 0x5d, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29,
+ 0x29, 0x2c, 0x65, 0x2b, 0x72, 0x5b, 0x30, 0x5d, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29,
+ 0x3a, 0x2d, 0x31, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x28, 0x6e,
+ 0x2c, 0x74, 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x28, 0x6e,
+ 0x2c, 0x41, 0x2e, 0x63, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x2c,
+ 0x74, 0x2c, 0x72, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x28,
+ 0x6e, 0x2c, 0x74, 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x28,
+ 0x6e, 0x2c, 0x41, 0x2e, 0x78, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67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x45, 0x3d, 0x58, 0x6e, 0x28, 0x79, 0x29, 0x3b, 0x70, 0x2e, 0x66, 0x6f, 0x72,
+ 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x4d, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x6e, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77,
+ 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2c, 0x74, 0x29, 0x7d, 0x29, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x41, 0x3d, 0x7b, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x5b, 0x6e, 0x2e, 0x67, 0x65,
+ 0x74, 0x44, 0x61, 0x79, 0x28, 0x29, 0x5d, 0x7d, 0x2c, 0x41, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x5b,
+ 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x79, 0x28, 0x29, 0x5d, 0x7d, 0x2c, 0x62, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x79, 0x5b, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29,
+ 0x5d, 0x7d, 0x2c, 0x42, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,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x28, 0x6e, 0x29, 0x2c, 0x74, 0x2c, 0x32, 0x29, 0x7d, 0x2c, 0x77, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x79, 0x28, 0x29, 0x7d, 0x2c, 0x57, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x5a, 0x6e, 0x28, 0x68, 0x6f, 0x2e, 0x6d, 0x6f, 0x6e, 0x64, 0x61, 0x79,
+ 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x28, 0x6e, 0x29, 0x2c, 0x74, 0x2c, 0x32, 0x29, 0x7d, 0x2c,
+ 0x78, 0x3a, 0x74, 0x28, 0x68, 0x29, 0x2c, 0x58, 0x3a, 0x74, 0x28, 0x67, 0x29, 0x2c, 0x79, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5a, 0x6e, 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c,
+ 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x25, 0x31, 0x30, 0x30, 0x2c, 0x74, 0x2c, 0x32, 0x29,
+ 0x7d, 0x2c, 0x59, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5a, 0x6e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0x7a,
+ 0x6f, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x2c, 0x65, 0x3d, 0x74, 0x3e,
+ 0x30, 0x3f, 0x22, 0x2d, 0x22, 0x3a, 0x22, 0x2b, 0x22, 0x2c, 0x72, 0x3d, 0x4d, 0x61, 0x28, 0x74,
+ 0x29, 0x2f, 0x36, 0x30, 0x7c, 0x30, 0x2c, 0x75, 0x3d, 0x4d, 0x61, 0x28, 0x74, 0x29, 0x25, 0x36,
+ 0x30, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2b, 0x5a, 0x6e, 0x28, 0x72, 0x2c,
+ 0x22, 0x30, 0x22, 0x2c, 0x32, 0x29, 0x2b, 0x5a, 0x6e, 0x28, 0x75, 0x2c, 0x22, 0x30, 0x22, 0x2c,
+ 0x32, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x74, 0x28, 0x6e,
+ 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x79, 0x6f, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e, 0x64,
+ 0x65, 0x78, 0x3d, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x79, 0x6f, 0x2e, 0x65, 0x78,
+ 0x65, 0x63, 0x28, 0x74, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x65, 0x2c, 0x65, 0x2b, 0x31,
+ 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x3f, 0x65, 0x2b, 0x72, 0x5b,
+ 0x30, 0x5d, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x2d, 0x31, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 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3d, 0x45, 0x74, 0x2c, 0x6a, 0x6f, 0x2e, 0x70, 0x6f, 0x69,
+ 0x6e, 0x74, 0x3d, 0x53, 0x74, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x43, 0x74, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x65, 0x28, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65,
+ 0x3d, 0x6e, 0x28, 0x65, 0x2c, 0x72, 0x29, 0x2c, 0x74, 0x28, 0x65, 0x5b, 0x30, 0x5d, 0x2c, 0x65,
+ 0x5b, 0x31, 0x5d, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x69, 0x6e,
+ 0x76, 0x65, 0x72, 0x74, 0x26, 0x26, 0x74, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x26, 0x26,
+ 0x28, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65,
+ 0x3d, 0x74, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x28, 0x65, 0x2c, 0x72, 0x29, 0x2c, 0x65,
+ 0x26, 0x26, 0x6e, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x28, 0x65, 0x5b, 0x30, 0x5d, 0x2c,
+ 0x65, 0x5b, 0x31, 0x5d, 0x29, 0x7d, 0x29, 0x2c, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,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0x72, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x78, 0x3d, 0x6e, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x7a,
+ 0x3d, 0x74, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x3d, 0x65, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x65, 0x3d, 0x72, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x3d, 0x21, 0x31, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x3d, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x74, 0x28, 0x6e, 0x2c,
+ 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x75, 0x2c, 0x69, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x72, 0x3d, 0x75, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x3b, 0x6e, 0x28, 0x74, 0x3d, 0x72, 0x5b, 0x30,
+ 0x5d, 0x2c, 0x65, 0x3d, 0x72, 0x5b, 0x31, 0x5d, 0x29, 0x26, 0x26, 0x69, 0x2e, 0x70, 0x6f, 0x69,
+ 0x6e, 0x74, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x6f, 0x28, 0x6e, 0x2c, 0x74,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, 0x62, 0x7c, 0x7c, 0x28, 0x69, 0x2e, 0x70, 0x6f, 0x6c, 0x79, 0x67,
+ 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29, 0x2c, 0x62, 0x3d, 0x21, 0x30, 0x29, 0x2c,
+ 0x69, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29, 0x3b, 0x2b, 0x2b,
+ 0x61, 0x3c, 0x72, 0x3b, 0x29, 0x69, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x28, 0x75, 0x3d,
+ 0x6e, 0x5b, 0x61, 0x5d, 0x29, 0x5b, 0x30, 0x5d, 0x2c, 0x75, 0x5b, 0x31, 0x5d, 0x29, 0x3b, 0x69,
+ 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x64, 0x28, 0x29, 0x7d, 0x7d, 0x65, 0x6c, 0x73, 0x65,
+ 0x20, 0x72, 0x3e, 0x31, 0x26, 0x26, 0x32, 0x26, 0x74, 0x26, 0x26, 0x65, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x28, 0x65, 0x2e, 0x70, 0x6f, 0x70, 0x28, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74,
+ 0x28, 0x65, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x29, 0x29, 0x2c, 0x67, 0x2e, 0x70,
+ 0x75, 0x73, 0x68, 0x28, 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x44, 0x74, 0x29,
+ 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x67, 0x2c, 0x70, 0x2c, 0x76, 0x2c, 0x64, 0x3d, 0x74, 0x28,
+ 0x69, 0x29, 0x2c, 0x6d, 0x3d, 0x75, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x28, 0x72,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 0x6c, 0x65, 0x61, 0x6e, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x32, 0x2d, 0x74, 0x7d, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x46, 0x74, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x75, 0x2c, 0x69, 0x2c, 0x61, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28,
+ 0x6e, 0x2d, 0x65, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x28, 0x61,
+ 0x29, 0x3e, 0x44, 0x61, 0x3f, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x74, 0x61, 0x6e, 0x28, 0x28,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x29, 0x2a, 0x28, 0x69, 0x3d, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x72, 0x29, 0x29, 0x2a, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x65, 0x29, 0x2d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e,
+ 0x28, 0x72, 0x29, 0x2a, 0x28, 0x75, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28,
+ 0x74, 0x29, 0x29, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x6e, 0x29, 0x29,
+ 0x2f, 0x28, 0x75, 0x2a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28, 0x68, 0x3d, 0x69, 0x29, 0x7d, 0x69, 0x66,
+ 0x28, 0x69, 0x3d, 0x65, 0x2d, 0x6c, 0x2c, 0x70, 0x7c, 0x7c, 0x21, 0x28, 0x30, 0x3e, 0x69, 0x29,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x69, 0x2f, 0x3d, 0x70, 0x2c, 0x30, 0x3e, 0x70, 0x29, 0x7b, 0x69,
+ 0x66, 0x28, 0x69, 0x3e, 0x67, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x69, 0x3e, 0x68,
+ 0x26, 0x26, 0x28, 0x68, 0x3d, 0x69, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28,
+ 0x70, 0x3e, 0x30, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x68, 0x3e, 0x69, 0x29, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x3b, 0x67, 0x3e, 0x69, 0x26, 0x26, 0x28, 0x67, 0x3d, 0x69, 0x29, 0x7d, 0x69, 0x66,
+ 0x28, 0x69, 0x3d, 0x74, 0x2d, 0x63, 0x2c, 0x76, 0x7c, 0x7c, 0x21, 0x28, 0x69, 0x3e, 0x30, 0x29,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x69, 0x2f, 0x3d, 0x76, 0x2c, 0x30, 0x3e, 0x76, 0x29, 0x7b, 0x69,
+ 0x66, 0x28, 0x68, 0x3e, 0x69, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x67, 0x3e, 0x69,
+ 0x26, 0x26, 0x28, 0x67, 0x3d, 0x69, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28,
+ 0x76, 0x3e, 0x30, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x69, 0x3e, 0x67, 0x29, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x3b, 0x69, 0x3e, 0x68, 0x26, 0x26, 0x28, 0x68, 0x3d, 0x69, 0x29, 0x7d, 0x69, 0x66,
+ 0x28, 0x69, 0x3d, 0x72, 0x2d, 0x63, 0x2c, 0x76, 0x7c, 0x7c, 0x21, 0x28, 0x30, 0x3e, 0x69, 0x29,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x69, 0x2f, 0x3d, 0x76, 0x2c, 0x30, 0x3e, 0x76, 0x29, 0x7b, 0x69,
+ 0x66, 0x28, 0x69, 0x3e, 0x67, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x69, 0x3e, 0x68,
+ 0x26, 0x26, 0x28, 0x68, 0x3d, 0x69, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28,
+ 0x76, 0x3e, 0x30, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x68, 0x3e, 0x69, 0x29, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x3b, 0x67, 0x3e, 0x69, 0x26, 0x26, 0x28, 0x67, 0x3d, 0x69, 0x29, 0x7d, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x68, 0x3e, 0x30, 0x26, 0x26, 0x28, 0x75, 0x2e, 0x61, 0x3d, 0x7b,
+ 0x78, 0x3a, 0x6c, 0x2b, 0x68, 0x2a, 0x70, 0x2c, 0x79, 0x3a, 0x63, 0x2b, 0x68, 0x2a, 0x76, 0x7d,
+ 0x29, 0x2c, 0x31, 0x3e, 0x67, 0x26, 0x26, 0x28, 0x75, 0x2e, 0x62, 0x3d, 0x7b, 0x78, 0x3a, 0x6c,
+ 0x2b, 0x67, 0x2a, 0x70, 0x2c, 0x79, 0x3a, 0x63, 0x2b, 0x67, 0x2a, 0x76, 0x7d, 0x29, 0x2c, 0x75,
+ 0x7d, 0x7d, 0x7d, 0x7d, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0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x20, 0x72, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x73, 0x69, 0x6e, 0x28, 0x6e, 0x29, 0x2c, 0x75, 0x3d, 0x28, 0x72, 0x2b, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x29, 0x29, 0x2f, 0x32, 0x2c, 0x69, 0x3d, 0x31, 0x2b, 0x72,
+ 0x2a, 0x28, 0x32, 0x2a, 0x75, 0x2d, 0x72, 0x29, 0x2c, 0x61, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x73, 0x71, 0x72, 0x74, 0x28, 0x69, 0x29, 0x2f, 0x75, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x61, 0x2d,
+ 0x74, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x74,
+ 0x61, 0x6e, 0x32, 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x2f, 0x75, 0x2c, 0x74, 0x6e, 0x28, 0x28, 0x69,
+ 0x2d, 0x28, 0x6e, 0x2a, 0x6e, 0x2b, 0x65, 0x2a, 0x65, 0x29, 0x2a, 0x75, 0x2a, 0x75, 0x29, 0x2f,
+ 0x28, 0x32, 0x2a, 0x75, 0x29, 0x29, 0x5d, 0x7d, 0x2c, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x24, 0x74, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x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0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65,
+ 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x65, 0x28, 0x74, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x65, 0x3d,
+ 0x6e, 0x28, 0x65, 0x2c, 0x72, 0x29, 0x2c, 0x74, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x65,
+ 0x5b, 0x30, 0x5d, 0x2c, 0x65, 0x5b, 0x31, 0x5d, 0x29, 0x7d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x65, 0x3d, 0x6e, 0x28, 0x65, 0x2c,
+ 0x72, 0x29, 0x2c, 0x74, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x65, 0x5b, 0x30, 0x5d, 0x2c,
+ 0x65, 0x5b, 0x31, 0x5d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72,
+ 0x28, 0x29, 0x7b, 0x4d, 0x3d, 0x4e, 0x61, 0x4e, 0x2c, 0x53, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74,
+ 0x3d, 0x69, 0x2c, 0x74, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x28, 0x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75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x6f, 0x3d, 0x28, 0x69, 0x3d, 0x6e, 0x2a, 0x6e, 0x29,
+ 0x3e, 0x30, 0x26, 0x26, 0x31, 0x36, 0x2c, 0x74, 0x29, 0x3a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73,
+ 0x71, 0x72, 0x74, 0x28, 0x69, 0x29, 0x7d, 0x2c, 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x72, 0x65, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x65,
+ 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x28, 0x5b, 0x74, 0x2a, 0x49, 0x61, 0x2c, 0x65,
+ 0x2a, 0x49, 0x61, 0x5d, 0x29, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x6c, 0x65, 0x28, 0x74, 0x28, 0x6e, 0x29, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x65, 0x28, 0x6e, 0x29, 0x7b, 0x74, 0x68, 0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x6e, 0x5b, 0x32, 0x5d, 0x25, 0x33, 0x36, 0x30,
+ 0x2a, 0x4f, 0x61, 0x3a, 0x30, 0x2c, 0x72, 0x28, 0x29, 0x29, 0x3a, 0x5b, 0x6d, 0x2a, 0x49, 0x61,
+ 0x2c, 0x4d, 0x2a, 0x49, 0x61, 0x2c, 0x78, 0x2a, 0x49, 0x61, 0x5d, 0x7d, 0x2c, 0x6f, 0x61, 0x2e,
+ 0x72, 0x65, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x74, 0x2c, 0x66, 0x2c, 0x22, 0x70, 0x72, 0x65, 0x63,
+ 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x3d, 0x6e, 0x2e, 0x61, 0x70,
+ 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x2c, 0x74, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d, 0x69, 0x2e, 0x69,
+ 0x6e, 0x76, 0x65, 0x72, 0x74, 0x26, 0x26, 0x65, 0x2c, 0x72, 0x28, 0x29, 0x7d, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x65, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x69, 0x65, 0x28, 0x6e, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x6e, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x74,
+ 0x2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0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x64, 0x74, 0x28, 0x74, 0x29, 0x3b, 0x65, 0x5b, 0x30,
+ 0x5d, 0x2d, 0x3d, 0x6e, 0x2c, 0x62, 0x74, 0x28, 0x65, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72,
+ 0x3d, 0x6e, 0x6e, 0x28, 0x2d, 0x65, 0x5b, 0x31, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x28, 0x28, 0x2d, 0x65, 0x5b, 0x32, 0x5d, 0x3c, 0x30, 0x3f, 0x2d, 0x72, 0x3a, 0x72, 0x29,
+ 0x2b, 0x32, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x50, 0x49, 0x2d, 0x44, 0x61, 0x29, 0x25, 0x28,
+ 0x32, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x50, 0x49, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x72, 0x3d, 0x6f, 0x61, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x6e, 0x2c, 0x74,
+ 0x2d, 0x44, 0x61, 0x2c, 0x65, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x74, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x2e, 0x6d, 0x61, 0x70,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x5b, 0x6e, 0x2c, 0x74, 0x5d, 0x7d, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x79, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x72, 0x3d, 0x6f, 0x61, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x6e, 0x2c,
+ 0x74, 0x2d, 0x44, 0x61, 0x2c, 0x65, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x74,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x2e, 0x6d, 0x61,
+ 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x74, 0x2c, 0x6e, 0x5d, 0x7d, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x78, 0x65, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x6e, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x74,
+ 0x29, 0x2c, 0x69, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x29, 0x2c,
+ 0x61, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x72, 0x29, 0x2c, 0x6f, 0x3d,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x72, 0x29, 0x2c, 0x6c, 0x3d, 0x75, 0x2a,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x6e, 0x29, 0x2c, 0x63, 0x3d, 0x75, 0x2a,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x6e, 0x29, 0x2c, 0x73, 0x3d, 0x61, 0x2a,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x65, 0x29, 0x2c, 0x66, 0x3d, 0x61, 0x2a,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x65, 0x29, 0x2c, 0x68, 0x3d, 0x32, 0x2a,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x73, 0x69, 0x6e, 0x28, 0x4d, 0x61, 0x74,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x2e,
+ 0x6c, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x64, 0x3d, 0x62, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x72, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x74, 0x29, 0x2c, 0x75, 0x3d,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x65, 0x29, 0x2c, 0x69, 0x3d, 0x6e, 0x28,
+ 0x72, 0x2a, 0x75, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x69, 0x2a, 0x75, 0x2a,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x69, 0x2a, 0x4d, 0x61,
+ 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x65, 0x29, 0x5d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28, 0x6e, 0x2a, 0x6e, 0x2b, 0x65, 0x2a, 0x65,
+ 0x29, 0x2c, 0x75, 0x3d, 0x74, 0x28, 0x72, 0x29, 0x2c, 0x69, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x73, 0x69, 0x6e, 0x28, 0x75, 0x29, 0x2c, 0x61, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f,
+ 0x73, 0x28, 0x75, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x61, 0x74, 0x61, 0x6e, 0x32, 0x28, 0x6e, 0x2a, 0x69, 0x2c, 0x72, 0x2a, 0x61, 0x29, 0x2c,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x73, 0x69, 0x6e, 0x28, 0x72, 0x26, 0x26, 0x65, 0x2a, 0x69,
+ 0x2f, 0x72, 0x29, 0x5d, 0x7d, 0x2c, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x53, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x61, 0x3e, 0x30, 0x3f, 0x2d, 0x48, 0x61,
+ 0x2b, 0x44, 0x61, 0x3e, 0x74, 0x26, 0x26, 0x28, 0x74, 0x3d, 0x2d, 0x48, 0x61, 0x2b, 0x44, 0x61,
+ 0x29, 0x3a, 0x74, 0x3e, 0x48, 0x61, 0x2d, 0x44, 0x61, 0x26, 0x26, 0x28, 0x74, 0x3d, 0x48, 0x61,
+ 0x2d, 0x44, 0x61, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x61, 0x2f, 0x4d, 0x61, 0x74,
+ 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x75, 0x28, 0x74, 0x29, 0x2c, 0x69, 0x29, 0x3b, 0x72, 0x65,
+ 0x74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, 0x69, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x69, 0x3f, 0x28, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65,
+ 0x3d, 0x61, 0x2d, 0x74, 0x2c, 0x72, 0x3d, 0x4b, 0x28, 0x69, 0x29, 0x2a, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28, 0x6e, 0x2a, 0x6e, 0x2b, 0x65, 0x2a, 0x65, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x74, 0x61, 0x6e, 0x32,
+ 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x2f, 0x69, 0x2c, 0x32, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61,
+ 0x74, 0x61, 0x6e, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x61, 0x2f, 0x72,
+ 0x2c, 0x31, 0x2f, 0x69, 0x29, 0x29, 0x2d, 0x48, 0x61, 0x5d, 0x7d, 0x2c, 0x65, 0x29, 0x3a, 0x4e,
+ 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x65, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x69, 0x2d, 0x74, 0x3b, 0x72, 0x65, 0x74,
+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x75, 0x2c, 0x69, 0x2d, 0x4b, 0x28, 0x75, 0x29, 0x2a,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28, 0x6e, 0x2a, 0x6e, 0x2b, 0x65, 0x2a,
+ 0x65, 0x29, 0x5d, 0x7d, 0x2c, 0x65, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x4e, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b,
+ 0x6e, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6c, 0x6f, 0x67, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x74, 0x61, 0x6e, 0x28, 0x6a, 0x61, 0x2f, 0x34, 0x2b, 0x74, 0x2f, 0x32, 0x29, 0x29, 0x5d, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x65, 0x28, 0x6e, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x74, 0x2c, 0x65, 0x3d, 0x61, 0x65, 0x28, 0x6e, 0x29, 0x2c, 0x72, 0x3d, 0x65,
+ 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2c, 0x75, 0x3d, 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73,
+ 0x6c, 0x61, 0x74, 0x65, 0x2c, 0x69, 0x3d, 0x65, 0x2e, 0x63, 0x6c, 0x69, 0x70, 0x45, 0x78, 0x74,
+ 0x65, 0x6e, 0x74, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x73, 0x63, 0x61,
+ 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x6e, 0x3d, 0x72, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x65, 0x2c, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x6e, 0x3d, 0x3d, 0x3d, 0x65, 0x3f, 0x74, 0x3f, 0x65, 0x2e, 0x63, 0x6c, 0x69, 0x70, 0x45, 0x78,
+ 0x74, 0x65, 0x6e, 0x74, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3a, 0x65, 0x3a, 0x6e, 0x7d, 0x2c,
+ 0x65, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x75, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x65, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3d, 0x3d, 0x3d, 0x65, 0x3f, 0x74,
+ 0x3f, 0x65, 0x2e, 0x63, 0x6c, 0x69, 0x70, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x28, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x29, 0x3a, 0x65, 0x3a, 0x6e, 0x7d, 0x2c, 0x65, 0x2e, 0x63, 0x6c, 0x69, 0x70, 0x45,
+ 0x78, 0x74, 0x65, 0x6e, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0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x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x50, 0x65, 0x28, 0x29, 0x7b, 0x72, 0x72, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x64, 0x67, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x73, 0x69, 0x74, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x69, 0x72, 0x63, 0x6c, 0x65,
+ 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a,
+ 0x65, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6c, 0x6c, 0x2e, 0x70, 0x6f,
+ 0x70, 0x28, 0x29, 0x7c, 0x7c, 0x6e, 0x65, 0x77, 0x20, 0x50, 0x65, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x3d, 0x6e, 0x2c, 0x74, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x55, 0x65, 0x28, 0x6e, 0x29, 0x7b, 0x42, 0x65, 0x28,
+ 0x6e, 0x29, 0x2c, 0x69, 0x6c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x6e, 0x29, 0x2c,
+ 0x6c, 0x6c, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6e, 0x29, 0x2c, 0x72, 0x72, 0x28, 0x6e, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x46, 0x65, 0x28, 0x6e, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x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 0x3f, 0x28, 0x74, 0x3d, 0x6f, 0x2c, 0x65, 0x3d, 0x6f,
+ 0x2e, 0x4e, 0x29, 0x3a, 0x74, 0x3d, 0x65, 0x3d, 0x6f, 0x3b, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x7d,
+ 0x69, 0x66, 0x28, 0x21, 0x6f, 0x2e, 0x52, 0x29, 0x7b, 0x74, 0x3d, 0x6f, 0x3b, 0x62, 0x72, 0x65,
+ 0x61, 0x6b, 0x7d, 0x6f, 0x3d, 0x6f, 0x2e, 0x52, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x3d, 0x6a,
+ 0x65, 0x28, 0x6e, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x69, 0x6c, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72,
+ 0x74, 0x28, 0x74, 0x2c, 0x6c, 0x29, 0x2c, 0x74, 0x7c, 0x7c, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x74, 0x3d, 0x3d, 0x3d, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x42, 0x65, 0x28,
+ 0x74, 0x29, 0x2c, 0x65, 0x3d, 0x6a, 0x65, 0x28, 0x74, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x29, 0x2c,
+ 0x69, 0x6c, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x28, 0x6c, 0x2c, 0x65, 0x29, 0x2c, 0x6c,
+ 0x2e, 0x65, 0x64, 0x67, 0x65, 0x3d, 0x65, 0x2e, 0x65, 0x64, 0x67, 0x65, 0x3d, 0x4b, 0x65, 0x28,
+ 0x74, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x2c, 0x6c, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x29, 0x2c, 0x24,
+ 0x65, 0x28, 0x74, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x24, 0x65, 0x28, 0x65, 0x29, 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 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x56, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74,
+ 0x2e, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x2d, 0x6e, 0x2e, 0x61, 0x6e, 0x67, 0x6c, 0x65, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x58, 0x65, 0x28, 0x29, 0x7b, 0x72, 0x72, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x78, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x79, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x72, 0x63, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x79, 0x3d, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x24, 0x65, 0x28,
+ 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6e, 0x2e, 0x50, 0x2c, 0x65, 0x3d, 0x6e,
+ 0x2e, 0x4e, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x26, 0x26, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x72, 0x3d, 0x74, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x2c, 0x75, 0x3d, 0x6e, 0x2e, 0x73, 0x69, 0x74,
+ 0x65, 0x2c, 0x69, 0x3d, 0x65, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x72, 0x21,
+ 0x3d, 0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2e, 0x62, 0x3d, 0x65, 0x2c, 0x21, 0x30, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x47, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x3d, 0x6e, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x3d, 0x74,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x3d, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4b, 0x65, 0x28,
+ 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x6e,
+ 0x65, 0x77, 0x20, 0x47, 0x65, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x72, 0x6c, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x75, 0x29, 0x2c, 0x65, 0x26, 0x26,
+ 0x6e, 0x72, 0x28, 0x75, 0x2c, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x2c, 0x72, 0x26, 0x26, 0x6e,
+ 0x72, 0x28, 0x75, 0x2c, 0x74, 0x2c, 0x6e, 0x2c, 0x72, 0x29, 0x2c, 0x75, 0x6c, 0x5b, 0x6e, 0x2e,
+ 0x69, 0x5d, 0x2e, 0x65, 0x64, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6e, 0x65,
+ 0x77, 0x20, 0x74, 0x72, 0x28, 0x75, 0x2c, 0x6e, 0x2c, 0x74, 0x29, 0x29, 0x2c, 0x75, 0x6c,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 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x6e, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x29, 0x2c, 0x69, 0x6c, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x65, 0x72, 0x2c, 0x6f, 0x6c,
+ 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x65, 0x72, 0x3b, 0x3b, 0x29, 0x69, 0x66, 0x28, 0x75, 0x3d, 0x61,
+ 0x6c, 0x2c, 0x69, 0x26, 0x26, 0x28, 0x21, 0x75, 0x7c, 0x7c, 0x69, 0x2e, 0x79, 0x3c, 0x75, 0x2e,
+ 0x79, 0x7c, 0x7c, 0x69, 0x2e, 0x79, 0x3d, 0x3d, 0x3d, 0x75, 0x2e, 0x79, 0x26, 0x26, 0x69, 0x2e,
+ 0x78, 0x3c, 0x75, 0x2e, 0x78, 0x29, 0x29, 0x28, 0x69, 0x2e, 0x78, 0x21, 0x3d, 0x3d, 0x65, 0x7c,
+ 0x7c, 0x69, 0x2e, 0x79, 0x21, 0x3d, 0x3d, 0x72, 0x29, 0x26, 0x26, 0x28, 0x75, 0x6c, 0x5b, 0x69,
+ 0x2e, 0x69, 0x5d, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x59, 0x65, 0x28, 0x69, 0x29, 0x2c, 0x48, 0x65,
+ 0x28, 0x69, 0x29, 0x2c, 0x65, 0x3d, 0x69, 0x2e, 0x78, 0x2c, 0x72, 0x3d, 0x69, 0x2e, 0x79, 0x29,
+ 0x2c, 0x69, 0x3d, 0x6e, 0x2e, 0x70, 0x6f, 0x70, 0x28, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x7b,
+ 0x69, 0x66, 0x28, 0x21, 0x75, 0x29, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x46, 0x65, 0x28, 0x75,
+ 0x2e, 0x61, 0x72, 0x63, 0x29, 0x7d, 0x74, 0x26, 0x26, 0x28, 0x57,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x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x2d,
+ 0x6e, 0x28, 0x31, 0x2d, 0x74, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x77, 0x72, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x2e, 0x35, 0x2a, 0x28, 0x2e, 0x35, 0x3e, 0x74, 0x3f, 0x6e, 0x28, 0x32, 0x2a, 0x74, 0x29, 0x3a,
+ 0x32, 0x2d, 0x6e, 0x28, 0x32, 0x2d, 0x32, 0x2a, 0x74, 0x29, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x72, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x2a, 0x6e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x6b, 0x72, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2a, 0x6e,
+ 0x2a, 0x6e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e, 0x72, 0x28, 0x6e,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x30, 0x3e, 0x3d, 0x6e, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x30, 0x3b, 0x69, 0x66, 0x28, 0x6e, 0x3e, 0x3d, 0x31, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x31, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6e, 0x2a, 0x6e, 0x2c, 0x65, 0x3d,
+ 0x74, 0x2a, 0x6e, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x34, 0x2a, 0x28, 0x2e, 0x35,
+ 0x3e, 0x6e, 0x3f, 0x65, 0x3a, 0x33, 0x2a, 0x28, 0x6e, 0x2d, 0x74, 0x29, 0x2b, 0x65, 0x2d, 0x2e,
+ 0x37, 0x35, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x72, 0x28,
+ 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x74,
+ 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x74, 0x2c, 0x6e, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x72, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x31, 0x2d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x6e, 0x2a, 0x48,
+ 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x72, 0x28, 0x6e,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f,
+ 0x77, 0x28, 0x32, 0x2c, 0x31, 0x30, 0x2a, 0x28, 0x6e, 0x2d, 0x31, 0x29, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7a, 0x72, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x31, 0x2d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28,
+ 0x31, 0x2d, 0x6e, 0x2a, 0x6e, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x4c, 0x72, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x32, 0x26, 0x26, 0x28, 0x74, 0x3d, 0x2e, 0x34, 0x35, 0x29,
+ 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3f, 0x65, 0x3d, 0x74, 0x2f, 0x55, 0x61, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x73,
+ 0x69, 0x6e, 0x28, 0x31, 0x2f, 0x6e, 0x29, 0x3a, 0x28, 0x6e, 0x3d, 0x31, 0x2c, 0x65, 0x3d, 0x74,
+ 0x2f, 0x34, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0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, 0x29, 0x2d, 0x32, 0x2c, 0x78, 0x3a, 0x6d, 0x72, 0x28,
+ 0x6e, 0x2c, 0x74, 0x29, 0x7d, 0x29, 0x29, 0x3a, 0x74, 0x26, 0x26, 0x65, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x28, 0x49, 0x72, 0x28, 0x65, 0x29, 0x2b, 0x22, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x28,
+ 0x22, 0x2b, 0x74, 0x2b, 0x22, 0x29, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x56, 0x72, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x6e, 0x21,
+ 0x3d, 0x3d, 0x74, 0x3f, 0x72, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x69, 0x3a, 0x65, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x49, 0x72, 0x28, 0x65, 0x29, 0x2b, 0x22, 0x73, 0x6b, 0x65, 0x77,
+ 0x58, 0x28, 0x22, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x22, 0x29, 0x22, 0x29, 0x2d, 0x32, 0x2c,
+ 0x78, 0x3a, 0x6d, 0x72, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7d, 0x29, 0x3a, 0x74, 0x26, 0x26, 0x65,
+ 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x49, 0x72, 0x28, 0x65, 0x29, 0x2b, 0x22, 0x73, 0x6b, 0x65,
+ 0x77, 0x58, 0x28, 0x22, 0x2b, 0x74, 0x2b, 0x22, 0x29, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x58, 0x72, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29,
+ 0x7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0x72, 0x3b, 0x29,
+ 0x75, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x69, 0x2c, 0x30, 0x2c, 0x65, 0x29, 0x2c,
+ 0x65, 0x3d, 0x65, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x75, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x47, 0x72, 0x28,
+ 0x6e, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x5b, 0x5d, 0x2c,
+ 0x65, 0x3d, 0x6e, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3b, 0x6e, 0x75, 0x6c, 0x6c, 0x21,
+ 0x3d, 0x65, 0x3b, 0x29, 0x74, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6e, 0x29, 0x2c, 0x6e, 0x3d,
+ 0x65, 0x2c, 0x65, 0x3d, 0x65, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6e, 0x29, 0x2c, 0x74, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4b, 0x72, 0x28, 0x6e, 0x2c, 0x74, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x6e, 0x3d, 0x3d, 0x3d, 0x74, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x47, 0x72, 0x28,
+ 0x6e, 0x29, 0x2c, 0x72, 0x3d, 0x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0x75,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72,
+ 0x20, 0x72, 0x2c, 0x75, 0x3b, 0x2d, 0x2d, 0x72, 0x3e, 0x3d, 0x30, 0x3b, 0x29, 0x65, 0x2e, 0x70,
+ 0x75, 0x73, 0x68, 0x28, 0x75, 0x5b, 0x72, 0x5d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x61, 0x75, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76,
+ 0x61, 0x72, 0x20, 0x65, 0x3d, 0x5b, 0x6e, 0x5d, 0x2c, 0x72, 0x3d, 0x5b, 0x5d, 0x3b, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x21, 0x3d, 0x28, 0x6e, 0x3d, 0x65, 0x2e, 0x70, 0x6f, 0x70, 0x28, 0x29, 0x29, 0x3b,
+ 0x29, 0x69, 0x66, 0x28, 0x72, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6e, 0x29, 0x2c, 0x28, 0x69,
+ 0x3d, 0x6e, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x29, 0x26, 0x26, 0x28, 0x75,
+ 0x3d, 0x69, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x76,
+ 0x61, 0x72, 0x20, 0x75, 0x2c, 0x69, 0x2c, 0x61, 0x3d, 0x2d, 0x31, 0x3b, 0x2b, 0x2b, 0x61, 0x3c,
+ 0x75, 0x3b, 0x29, 0x65, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x69, 0x5b, 0x61, 0x5d, 0x29, 0x3b,
+ 0x66, 0x6f, 0x72, 0x28, 0x3b, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x28, 0x6e, 0x3d, 0x72, 0x2e,
+ 0x70, 0x6f, 0x70, 0x28, 0x29, 0x29, 0x3b, 0x29, 0x74, 0x28, 0x6e, 0x29, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x75, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x75, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x75, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2d, 0x6e, 0x2e, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x75, 0x28,
+ 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x61, 0x2e, 0x6d, 0x65, 0x72,
+ 0x67, 0x65, 0x28, 0x6e, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x6e, 0x2e, 0x63, 0x68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0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2b, 0x74, 0x2e, 0x78, 0x7d, 0x2c, 0x30, 0x29, 0x2f, 0x6e, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x46, 0x75, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6e, 0x2e, 0x63, 0x68,
+ 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x26,
+ 0x26, 0x74, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x46, 0x75, 0x28, 0x74, 0x5b, 0x30,
+ 0x5d, 0x29, 0x3a, 0x6e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x48, 0x75,
+ 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x2c, 0x65, 0x3d, 0x6e, 0x2e, 0x63, 0x68,
+ 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x26,
+ 0x26, 0x28, 0x74, 0x3d, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x3f, 0x48, 0x75,
+ 0x28, 0x65, 0x5b, 0x74, 0x2d, 0x31, 0x5d, 0x29, 0x3a, 0x6e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x75, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0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 0x29, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73,
+ 0x65, 0x28, 0x29, 0x2c, 0x74, 0x3d, 0x74, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x29, 0x2e,
+ 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x28, 0x29, 0x29, 0x3b, 0x2b, 0x2b, 0x61, 0x3c, 0x3d,
+ 0x6f, 0x3b, 0x29, 0x75, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x65, 0x28, 0x6e, 0x5b, 0x61, 0x2d,
+ 0x31, 0x5d, 0x2c, 0x6e, 0x5b, 0x61, 0x5d, 0x29, 0x29, 0x2c, 0x69, 0x2e, 0x70, 0x75, 0x73, 0x68,
+ 0x28, 0x72, 0x28, 0x74, 0x5b, 0x61, 0x2d, 0x31, 0x5d, 0x2c, 0x74, 0x5b, 0x61, 0x5d, 0x29, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x6f, 0x61, 0x2e, 0x62, 0x69, 0x73,
+ 0x65, 0x63, 0x74, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x31, 0x2c, 0x6f, 0x29, 0x2d, 0x31, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x5b, 0x65, 0x5d, 0x28, 0x75, 0x5b, 0x65, 0x5d, 0x28,
+ 0x74, 0x29, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x57, 0x75,
+ 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f,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69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x6e, 0x3d, 0x74, 0x2e, 0x6d, 0x61, 0x70, 0x28,
+ 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x29, 0x2c, 0x75, 0x28, 0x29, 0x29, 0x3a, 0x6e, 0x7d, 0x2c,
+ 0x69, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x74, 0x3d, 0x6e,
+ 0x2c, 0x75, 0x28, 0x29, 0x29, 0x3a, 0x74, 0x7d, 0x2c, 0x69, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65,
+ 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65,
+ 0x28, 0x6e, 0x29, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x28,
+ 0x6a, 0x72, 0x29, 0x7d, 0x2c, 0x69, 0x2e, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3f, 0x28, 0x72, 0x3d, 0x6e, 0x2c, 0x75, 0x28, 0x29, 0x29, 0x3a, 0x72, 0x7d, 0x2c, 0x69, 0x2e,
+ 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f,
+ 0x28, 0x65, 0x3d, 0x6e, 0x2c, 0x75, 0x28, 0x29, 0x29, 0x3a, 0x65, 0x7d, 0x2c, 0x69, 0x2e, 0x74,
+ 0x69, 0x63, 0x6b, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x51, 0x75, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7d,
+ 0x2c, 0x69, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x69, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7d, 0x2c, 0x69, 0x2e,
+ 0x6e, 0x69, 0x63, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x47, 0x75, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x2c,
+ 0x75, 0x28, 0x29, 0x7d, 0x2c, 0x69, 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x57, 0x75,
+ 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7d, 0x2c, 0x75, 0x28, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4a, 0x75, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x61, 0x2e, 0x72, 0x65, 0x62, 0x69, 0x6e, 0x64,
+ 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x22, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x2c, 0x22, 0x72, 0x61,
+ 0x6e, 0x67, 0x65, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x2c, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72,
+ 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x22, 0x2c, 0x22, 0x63, 0x6c, 0x61, 0x6d, 0x70, 0x22, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x47, 0x75, 0x28, 0x6e, 0x2c, 0x74,
+ 0x29, 0x7b, 0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 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x73, 0x6f, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28,
+ 0x65, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x75, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x2c,
+ 0x22, 0x73, 0x22, 0x3d, 0x3d, 0x3d, 0x75, 0x5b, 0x38, 0x5d, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x69, 0x3d, 0x6f, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69,
+ 0x78, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x4d, 0x61, 0x28, 0x72, 0x5b,
+ 0x30, 0x5d, 0x29, 0x2c, 0x4d, 0x61, 0x28, 0x72, 0x5b, 0x31, 0x5d, 0x29, 0x29, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x5b, 0x37, 0x5d, 0x7c, 0x7c, 0x28, 0x75, 0x5b, 0x37,
+ 0x5d, 0x3d, 0x22, 0x2e, 0x22, 0x2b, 0x74, 0x69, 0x28, 0x69, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65,
+ 0x28, 0x72, 0x5b, 0x32, 0x5d, 0x29, 0x29, 0x29, 0x2c, 0x75, 0x5b, 0x38, 0x5d, 0x3d, 0x22, 0x66,
+ 0x22, 0x2c, 0x65, 0x3d, 0x6f, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, 0x75, 0x2e,
+ 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x22, 0x29, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0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x30, 0x3a, 0x2d, 0x6e, 0x29, 0x29, 0x2f, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x6c, 0x6f, 0x67, 0x28, 0x74, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x65, 0x3f, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x74, 0x2c, 0x6e, 0x29, 0x3a,
+ 0x2d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x74, 0x2c, 0x2d, 0x6e, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x28, 0x75, 0x28, 0x74, 0x29, 0x29, 0x7d, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x69, 0x28, 0x6e, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x28, 0x74, 0x29, 0x29, 0x7d, 0x2c,
+ 0x61, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x65, 0x3d,
+ 0x74, 0x5b, 0x30, 0x5d, 0x3e, 0x3d, 0x30, 0x2c, 0x6e, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
+ 0x28, 0x28, 0x72, 0x3d, 0x74, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
+ 0x29, 0x29, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x75, 0x29, 0x29, 0x2c, 0x61, 0x29, 0x3a, 0x72, 0x7d,
+ 0x2c, 0x61, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x74, 0x3d, 0x2b,
+ 0x65, 0x2c, 0x6e, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x72, 0x2e, 0x6d, 0x61, 0x70,
+ 0x28, 0x75, 0x29, 0x29, 0x2c, 0x61, 0x29, 0x3a, 0x74, 0x7d, 0x2c, 0x61, 0x2e, 0x6e, 0x69, 0x63,
+ 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x74, 0x3d, 0x58, 0x75, 0x28, 0x72, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x75, 0x29, 0x2c, 0x65,
+ 0x3f, 0x4d, 0x61, 0x74, 0x68, 0x3a, 0x4e, 0x6c, 0x29, 0x3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, 0x68, 0x2b, 0x2b, 0x29, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x69, 0x28, 0x63, 0x29,
+ 0x2a, 0x68, 0x29, 0x3b, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x69, 0x28, 0x63, 0x29, 0x29,
+ 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x28, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68,
+ 0x28, 0x69, 0x28, 0x63, 0x29, 0x29, 0x3b, 0x63, 0x2b, 0x2b, 0x3c, 0x73, 0x3b, 0x29, 0x66, 0x6f,
+ 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x68, 0x3d, 0x66, 0x2d, 0x31, 0x3b, 0x68, 0x3e, 0x30, 0x3b,
+ 0x68, 0x2d, 0x2d, 0x29, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x69, 0x28, 0x63, 0x29, 0x2a,
+ 0x68, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x63, 0x3d, 0x30, 0x3b, 0x61, 0x5b, 0x63, 0x5d, 0x3c,
+ 0x6f, 0x3b, 0x63, 0x2b, 0x2b, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x73, 0x3d, 0x61, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x61, 0x5b, 0x73, 0x2d, 0x31, 0x5d, 0x3e, 0x6c, 0x3b, 0x73,
+ 0x2d, 0x2d, 0x29, 0x3b, 0x61, 0x3d, 0x61, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x63, 0x2c,
+ 0x73, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x2c, 0x61, 0x2e, 0x74,
+ 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6b, 0x6c, 0x3b, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x32, 0x3f, 0x65, 0x3d, 0x6b, 0x6c, 0x3a, 0x22,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x65, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x6f, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61,
+ 0x74, 0x28, 0x65, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x31, 0x2c, 0x74, 0x2a, 0x6e, 0x2f, 0x61, 0x2e, 0x74, 0x69, 0x63,
+ 0x6b, 0x73, 0x28, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x6e, 0x2f, 0x69, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72,
+ 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x75, 0x28, 0x6e, 0x29, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x2d, 0x2e, 0x35, 0x3e, 0x61, 0x2a, 0x74, 0x26, 0x26, 0x28, 0x61, 0x2a,
+ 0x3d, 0x74, 0x29, 0x2c, 0x72, 0x3e, 0x3d, 0x61, 0x3f, 0x65, 0x28, 0x6e, 0x29, 0x3a, 0x22, 0x22,
+ 0x7d, 0x7d, 0x2c, 0x61, 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x69, 0x28, 0x6e,
+ 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x28, 0x29, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7d, 0x2c,
+ 0x4a, 0x75, 0x28, 0x61, 0x2c, 0x6e, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x75, 0x69, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x6e, 0x28, 0x75, 0x28, 0x74, 0x29, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x69, 0x69,
+ 0x28, 0x74, 0x29, 0x2c, 0x69, 0x3d, 0x69, 0x69, 0x28, 0x31, 0x2f, 0x74, 0x29, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x69, 0x28, 0x6e, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x28, 0x74, 0x29, 0x29, 0x7d,
+ 0x2c, 0x72, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x6e,
+ 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x28, 0x65, 0x3d, 0x74, 0x2e, 0x6d, 0x61, 0x70,
+ 0x28, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x29, 0x29, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x75, 0x29,
+ 0x29, 0x2c, 0x72, 0x29, 0x3a, 0x65, 0x7d, 0x2c, 0x72, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x51, 0x75, 0x28, 0x65, 0x2c, 0x6e, 0x29, 0x7d, 0x2c, 0x72, 0x2e, 0x74, 0x69,
+ 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x69,
+ 0x28, 0x65, 0x2c, 0x6e, 0x2c, 0x74, 0x29, 0x7d, 0x2c, 0x72, 0x2e, 0x6e, 0x69, 0x63, 0x65, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x72, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x47, 0x75, 0x28, 0x65,
+ 0x2c, 0x6e, 0x29, 0x29, 0x7d, 0x2c, 0x72, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x75, 0x3d, 0x69, 0x69, 0x28, 0x74, 0x3d, 0x61, 0x29, 0x2c,
+ 0x69, 0x3d, 0x69, 0x69, 0x28, 0x31, 0x2f, 0x74, 0x29, 0x2c, 0x6e, 0x2e, 0x64, 0x6f, 0x6d, 0x61,
+ 0x69, 0x6e, 0x28, 0x65, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x75, 0x29, 0x29, 0x2c, 0x72, 0x29, 0x3a,
+ 0x74, 0x7d, 0x2c, 0x72, 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x69, 0x28, 0x6e,
+ 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x28, 0x29, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7d, 0x2c, 0x4a, 0x75,
+ 0x28, 0x72, 0x2c, 0x6e, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69,
+ 0x69, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x30,
+ 0x3e, 0x74, 0x3f, 0x2d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x2d, 0x74, 0x2c,
+ 0x6e, 0x29, 0x3a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x74, 0x2c, 0x6e, 0x29,
+ 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x69, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x65, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x5b, 0x28, 0x28, 0x75, 0x2e, 0x67, 0x65,
+ 0x74, 0x28, 0x65, 0x29, 0x7c, 0x7c, 0x28, 0x22, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x3d, 0x3d,
+ 0x3d, 0x74, 0x2e, 0x74, 0x3f, 0x75, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x65, 0x2c, 0x6e, 0x2e, 0x70,
+ 0x75, 0x73, 0x68, 0x28, 0x65, 0x29, 0x29, 0x3a, 0x4e, 0x61, 0x4e, 0x29, 0x29, 0x2d, 0x31, 0x29,
+ 0x25, 0x69, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x6f, 0x61, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x6e, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x29, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2b, 0x65, 0x2a,
+ 0x6e, 0x7d, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x75, 0x2c, 0x69, 0x2c, 0x61, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x72, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3b, 0x6e, 0x3d, 0x5b, 0x5d, 0x2c, 0x75, 0x3d, 0x6e,
+ 0x65, 0x77, 0x20, 0x63, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x2c, 0x61,
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32, 0x2a, 0x6c, 0x29, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x3d, 0x72, 0x28, 0x73, 0x2b, 0x68, 0x2a, 0x6c, 0x2c, 0x68,
+ 0x29, 0x2c, 0x63, 0x26, 0x26, 0x69, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x28, 0x29,
+ 0x2c, 0x61, 0x3d, 0x68, 0x2a, 0x28, 0x31, 0x2d, 0x6f, 0x29, 0x2c, 0x74, 0x3d, 0x7b, 0x74, 0x3a,
+ 0x22, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x61, 0x6e, 0x64, 0x73, 0x22, 0x2c, 0x61, 0x3a, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x7d, 0x2c, 0x65, 0x7d, 0x2c, 0x65, 0x2e, 0x72,
+ 0x61, 0x6e, 0x67, 0x65, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x42, 0x61, 0x6e, 0x64, 0x73, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x75, 0x2c, 0x6f, 0x2c, 0x6c, 0x29, 0x7b, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c,
+ 0x32, 0x26, 0x26, 0x28, 0x6f, 0x3d, 0x30, 0x29, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x33, 0x26, 0x26, 0x28, 0x6c, 0x3d,
+ 0x6f, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x75, 0x5b, 0x31, 0x5d, 0x3c, 0x75, 0x5b,
+ 0x30, 0x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65, 0x3c, 0x72, 0x3b, 0x29, 0x6f, 0x5b, 0x65, 0x2d, 0x31, 0x5d, 0x3d, 0x6f, 0x61, 0x2e, 0x71,
+ 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c, 0x65, 0x28, 0x6e, 0x2c, 0x65, 0x2f, 0x72, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x61, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x73, 0x4e,
+ 0x61, 0x4e, 0x28, 0x6e, 0x3d, 0x2b, 0x6e, 0x29, 0x3f, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3a,
+ 0x74, 0x5b, 0x6f, 0x61, 0x2e, 0x62, 0x69, 0x73, 0x65, 0x63, 0x74, 0x28, 0x6f, 0x2c, 0x6e, 0x29,
+ 0x5d, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x6f, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x6e, 0x3d, 0x74,
+ 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x72, 0x29, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x75,
+ 0x29, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x28, 0x65, 0x29, 0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0x72, 0x74,
+ 0x45, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x3d, 0x65, 0x2e, 0x69, 0x6e,
+ 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28, 0x74, 0x29, 0x2c, 0x74, 0x3d, 0x30, 0x3e, 0x74, 0x3f, 0x4e,
+ 0x61, 0x4e, 0x3a, 0x74, 0x2f, 0x69, 0x2b, 0x6e, 0x2c, 0x5b, 0x74, 0x2c, 0x74, 0x2b, 0x31, 0x2f,
+ 0x69, 0x5d, 0x7d, 0x2c, 0x72, 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x69, 0x28,
+ 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7d, 0x2c, 0x75, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x69, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x65, 0x3e, 0x3d, 0x65, 0x3f, 0x74, 0x5b, 0x6f, 0x61, 0x2e, 0x62, 0x69, 0x73, 0x65,
+ 0x63, 0x74, 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x5d, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 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, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63,
+ 0x69, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7d, 0x2c, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x73, 0x69, 0x28, 0x6e, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x74, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2b, 0x6e, 0x7d,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d,
+ 0x74, 0x2c, 0x74, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x74, 0x2e, 0x72, 0x61, 0x6e,
+ 0x67, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x6e, 0x3d, 0x65, 0x2e, 0x6d, 0x61, 0x70, 0x28,
+ 0x74, 0x29, 0x2c, 0x74, 0x29, 0x3a, 0x6e, 0x7d, 0x2c, 0x74, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x51, 0x75, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7d, 0x2c, 0x74, 0x2e, 0x74,
+ 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x69, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7d, 0x2c, 0x74, 0x2e, 0x63, 0x6f, 0x70, 0x79,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x73, 0x69, 0x28, 0x6e, 0x29, 0x7d, 0x2c, 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x69, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x30, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x69, 0x28, 0x6e,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72,
+ 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x67, 0x69, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x6f,
+ 0x75, 0x74, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+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3d, 0x5b, 0x30, 0x5d, 0x3b, 0x2b, 0x2b, 0x72, 0x3c,
+ 0x33, 0x3b, 0x29, 0x74, 0x3d, 0x6e, 0x5b, 0x72, 0x5d, 0x2c, 0x69, 0x2e, 0x70, 0x75, 0x73, 0x68,
+ 0x28, 0x74, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x5b,
+ 0x31, 0x5d, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x52,
+ 0x69, 0x28, 0x44, 0x6c, 0x2c, 0x69, 0x29, 0x2b, 0x22, 0x2c, 0x22, 0x2b, 0x52, 0x69, 0x28, 0x44,
+ 0x6c, 0x2c, 0x61, 0x29, 0x29, 0x2c, 0x2d, 0x2d, 0x72, 0x3b, 0x2b, 0x2b, 0x72, 0x3c, 0x75, 0x3b,
+ 0x29, 0x74, 0x3d, 0x6e, 0x5b, 0x72, 0x5d, 0x2c, 0x69, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28,
+ 0x29, 0x2c, 0x69, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x61,
+ 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x2c, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28,
+ 0x74, 0x5b, 0x31, 0x5d, 0x29, 0x2c, 0x44, 0x69, 0x28, 0x65, 0x2c, 0x69, 0x2c, 0x61, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x22,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x71, 0x69, 0x28, 0x6e, 0x29,
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0x2c, 0x74, 0x2e, 0x78, 0x31, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f,
+ 0x28, 0x72, 0x3d, 0x6e, 0x2c, 0x74, 0x29, 0x3a, 0x72, 0x7d, 0x2c, 0x74, 0x2e, 0x79, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x3f, 0x28, 0x75, 0x3d, 0x69, 0x3d, 0x6e, 0x2c, 0x74, 0x29, 0x3a, 0x69, 0x7d, 0x2c,
+ 0x74, 0x2e, 0x79, 0x30, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x75, 0x3d, 0x6e, 0x2c, 0x74, 0x29,
+ 0x3a, 0x75, 0x7d, 0x2c, 0x74, 0x2e, 0x79, 0x31, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0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x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6e, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x65, 0x3d, 0x74, 0x5b, 0x30, 0x5d, 0x2c, 0x72, 0x3d, 0x74, 0x5b,
+ 0x31, 0x5d, 0x2d, 0x48, 0x61, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x65, 0x2a, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x72, 0x29, 0x2c, 0x65, 0x2a, 0x4d, 0x61, 0x74,
+ 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x72, 0x29, 0x5d, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x56, 0x69, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x36, 0x34, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x58, 0x69, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x63, 0x69, 0x72, 0x63, 0x6c, 0x65, 0x22, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x24, 0x69, 0x28, 0x6e, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x74, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28, 0x6e,
+ 0x2f, 0x6a, 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x4d, 0x30, 0x2c, 0x22,
+ 0x2b, 0x74, 0x2b, 0x22, 0x41, 0x22, 0x2b, 0x74, 0x2b, 0x22, 0x2c, 0x22, 0x2b, 0x74, 0x2b, 0x22,
+ 0x20, 0x30, 0x20, 0x31, 0x2c, 0x31, 0x20, 0x30, 0x2c, 0x22, 0x2b, 0x2d, 0x74, 0x2b, 0x22, 0x41,
+ 0x22, 0x2b, 0x74, 0x2b, 0x22, 0x2c, 0x22, 0x2b, 0x74, 0x2b, 0x22, 0x20, 0x30, 0x20, 0x31, 0x2c,
+ 0x31, 0x20, 0x30, 0x2c, 0x22, 0x2b, 0x74, 0x2b, 0x22, 0x5a, 0x22, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x42, 0x69, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x3b, 0x28, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6e,
+ 0x5d, 0x29, 0x26, 0x26, 0x28, 0x72, 0x3d, 0x74, 0x5b, 0x65, 0x3d, 0x74, 0x2e, 0x61, 0x63, 0x74,
+ 0x69, 0x76, 0x65, 0x5d, 0x29, 0x26, 0x26, 0x28, 0x72, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x2e,
+ 0x63, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x72, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x74,
+ 0x3d, 0x4e, 0x61, 0x4e, 0x2c, 0x2d, 0x2d, 0x74, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3f, 0x64,
+ 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x74, 0x5b, 0x65, 0x5d, 0x3a, 0x64, 0x65, 0x6c, 0x65, 0x74,
+ 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6e, 0x5d, 0x2c, 0x74, 0x2e, 0x61, 0x63, 0x74, 0x69,
+ 0x76, 0x65, 0x2b, 0x3d, 0x2e, 0x35, 0x2c, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x26, 0x26,
+ 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x75, 0x70,
+ 0x74, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x5f, 0x2c, 0x72, 0x2e, 0x69, 0x6e, 0x64, 0x65,
+ 0x78, 0x29, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x57, 0x69,
+ 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x53,
+ 0x61, 0x28, 0x6e, 0x2c, 0x49, 0x6c, 0x29, 0x2c, 0x6e, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
+ 0x61, 0x63, 0x65, 0x3d, 0x74, 0x2c, 0x6e, 0x2e, 0x69, 0x64, 0x3d, 0x65, 0x2c, 0x6e, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4a, 0x69, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65,
+ 0x2c, 0x72, 0x29, 0x7b, 0x76, 0x61, 0x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0x28, 0x22, 0x2b, 0x28, 0x69, 0x73, 0x46, 0x69, 0x6e, 0x69,
+ 0x74, 0x65, 0x28, 0x72, 0x29, 0x3f, 0x72, 0x3a, 0x65, 0x28, 0x6e, 0x29, 0x29, 0x2b, 0x22, 0x2c,
+ 0x30, 0x29, 0x22, 0x7d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74,
+ 0x61, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x6e, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28,
+ 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x74, 0x28,
+ 0x6e, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c,
+ 0x61, 0x74, 0x65, 0x28, 0x30, 0x2c, 0x22, 0x2b, 0x28, 0x69, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x74,
+ 0x65, 0x28, 0x72, 0x29, 0x3f, 0x72, 0x3a, 0x65, 0x28, 0x6e, 0x29, 0x29, 0x2b, 0x22, 0x29, 0x22,
+ 0x7d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x61, 0x28, 0x6e,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x74, 0x6f, 0x49, 0x53, 0x4f,
+ 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x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 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74,
+ 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x3b, 0x65, 0x28, 0x74, 0x3d, 0x6e, 0x2e, 0x66, 0x6c, 0x6f,
+ 0x6f, 0x72, 0x28, 0x74, 0x29, 0x29, 0x3b, 0x29, 0x74, 0x3d, 0x75, 0x61, 0x28, 0x74, 0x2d, 0x31,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x7d, 0x2c, 0x63, 0x65, 0x69, 0x6c,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x66, 0x6f, 0x72,
+ 0x28, 0x3b, 0x65, 0x28, 0x74, 0x3d, 0x6e, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x28, 0x74, 0x29, 0x29,
+ 0x3b, 0x29, 0x74, 0x3d, 0x75, 0x61, 0x28, 0x2b, 0x74, 0x2b, 0x31, 0x29, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x7d, 0x7d, 0x3a, 0x6e, 0x29, 0x29, 0x7d, 0x2c, 0x72, 0x2e, 0x74,
+ 0x69, 0x63, 0x6b, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x59, 0x75, 0x28, 0x72, 0x2e, 0x64, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x29, 0x2c, 0x69, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d,
+ 0x6e, 0x3f, 0x75, 0x28, 0x65, 0x2c, 0x31, 0x30, 0x29, 0x3a, 0x22, 0x6e, 0x75, 0x6d, 0x62, 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0x4a, 0x75, 0x28, 0x72, 0x2c, 0x6e, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x61, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x6e, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x61, 0x28, 0x6e, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65,
+ 0x28, 0x6e, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x65, 0x78, 0x74, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x61, 0x28, 0x6e, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x73, 0x61, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52,
+ 0x61, 0x6e, 0x67, 0x65, 0x28, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x73, 0x61, 0x2e, 0x62, 0x6f,
+ 0x64, 0x79, 0x29, 0x2c, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x6e,
+ 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x65, 0x78, 0x74, 0x29, 0x7d, 0x76,
+ 0x61, 0x72, 0x20, 0x6f, 0x61, 0x3d, 0x7b, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x22,
+ 0x33, 0x2e, 0x35, 0x2e, 0x31, 0x33, 0x22, 0x7d, 0x2c, 0x6c, 0x61, 0x3d, 0x5b, 0x5d, 0x2e, 0x73,
+ 0x6c, 0x69, 0x63, 0x65, 0x2c, 0x63, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x61, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x6e, 0x29, 0x7d, 0x2c, 0x73, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x3b, 0x69, 0x66, 0x28, 0x73, 0x61, 0x29, 0x74, 0x72,
+ 0x79, 0x7b, 0x63, 0x61, 0x28, 0x73, 0x61, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64,
+ 0x65, 0x73, 0x29, 0x5b, 0x30, 0x5d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7d,
+ 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x66, 0x61, 0x29, 0x7b, 0x63, 0x61, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72,
+ 0x20, 0x74, 0x3d, 0x6e, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x65, 0x3d, 0x6e, 0x65,
+ 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x74, 0x29, 0x3b, 0x74, 0x2d, 0x2d, 0x3b, 0x29,
+ 0x65, 0x5b, 0x74, 0x5d, 0x3d, 0x6e, 0x5b, 0x74, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x65, 0x7d, 0x7d, 0x69, 0x66, 0x28, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x6e, 0x6f, 0x77, 0x7c,
+ 0x7c, 0x28, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x6e, 0x6f, 0x77, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2b, 0x6e, 0x65, 0x77,
+ 0x20, 0x44, 0x61, 0x74, 0x65, 0x7d, 0x29, 0x2c, 0x73, 0x61, 0x29, 0x74, 0x72, 0x79, 0x7b, 0x73,
+ 0x61, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28,
+ 0x22, 0x44, 0x49, 0x56, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x74,
+ 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x22, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74,
+ 0x79, 0x22, 0x2c, 0x30, 0x2c, 0x22, 0x22, 0x29, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x68,
+ 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x45,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65,
+ 0x2c, 0x70, 0x61, 0x3d, 0x67, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+ 0x75, 0x74, 0x65, 0x2c, 0x76, 0x61, 0x3d, 0x67, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x53, 0x2c, 0x64, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x43, 0x53, 0x53, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x6d,
+ 0x61, 0x3d, 0x64, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79,
+ 0x3b, 0x67, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x70,
+ 0x61, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x2c, 0x74, 0x2b,
+ 0x22, 0x22, 0x29, 0x7d, 0x2c, 0x67, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69,
+ 0x62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x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3f, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28, 0x6e, 0x29, 0x3a, 0x6e, 0x7d, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x79, 0x61, 0x3d, 0x69, 0x28, 0x65, 0x29, 0x3b, 0x6f, 0x61, 0x2e, 0x62, 0x69,
+ 0x73, 0x65, 0x63, 0x74, 0x4c, 0x65, 0x66, 0x74, 0x3d, 0x79, 0x61, 0x2e, 0x6c, 0x65, 0x66, 0x74,
+ 0x2c, 0x6f, 0x61, 0x2e, 0x62, 0x69, 0x73, 0x65, 0x63, 0x74, 0x3d, 0x6f, 0x61, 0x2e, 0x62, 0x69,
+ 0x73, 0x65, 0x63, 0x74, 0x52, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x79, 0x61, 0x2e, 0x72, 0x69, 0x67,
+ 0x68, 0x74, 0x2c, 0x6f, 0x61, 0x2e, 0x62, 0x69, 0x73, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x69, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x2c, 0x72, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x28, 0x6e, 0x28, 0x74, 0x29, 0x2c,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c, 0x6f, 0x61, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x73, 0x65, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6f, 0x61, 0x2e, 0x7a, 0x69, 0x70, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x6f, 0x61,
+ 0x2c, 0x6e, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x5b,
+ 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6e,
+ 0x29, 0x74, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x65, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x74, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74,
+ 0x3d, 0x5b, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x20, 0x69, 0x6e,
+ 0x20, 0x6e, 0x29, 0x74, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6e, 0x5b, 0x65, 0x5d, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x7d, 0x2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69,
+ 0x66, 0x28, 0x6e, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x6f, 0x66, 0x20, 0x63,
+ 0x29, 0x6e, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x6e,
+ 0x2c, 0x74, 0x29, 0x7d, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x41, 0x72,
+ 0x72, 0x61, 0x79, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x6e, 0x29, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x72, 0x2c, 0x75, 0x3d, 0x2d, 0x31, 0x2c, 0x69, 0x3d, 0x6e, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x66, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x61, 0x72, 0x67,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x66, 0x6f,
+ 0x72, 0x28, 0x3b, 0x2b, 0x2b, 0x75, 0x3c, 0x69, 0x3b, 0x29, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x28,
+ 0x75, 0x2c, 0x6e, 0x5b, 0x75, 0x5d, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72,
+ 0x28, 0x3b, 0x2b, 0x2b, 0x75, 0x3c, 0x69, 0x3b, 0x29, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x74,
+ 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6e, 0x2c, 0x72, 0x3d, 0x6e, 0x5b, 0x75, 0x5d, 0x2c, 0x75,
+ 0x29, 0x2c, 0x72, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61,
+ 0x72, 0x20, 0x61, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x29, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x61,
+ 0x2c, 0x6e, 0x5b, 0x61, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x7d,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x78, 0x61, 0x3d, 0x22, 0x5f, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x5f, 0x5f, 0x22, 0x2c, 0x62, 0x61, 0x3d, 0x22, 0x5c, 0x78, 0x30, 0x30, 0x22, 0x3b, 0x6c, 0x28,
+ 0x63, 0x2c, 0x7b, 0x68, 0x61, 0x73, 0x3a, 0x68, 0x2c, 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x5b, 0x73, 0x28, 0x6e, 0x29, 0x5d, 0x7d, 0x2c, 0x73, 0x65,
+ 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x5b, 0x73, 0x28,
+ 0x6e, 0x29, 0x5d, 0x3d, 0x74, 0x7d, 0x2c, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x3a, 0x67, 0x2c,
+ 0x6b, 0x65, 0x79, 0x73, 0x3a, 0x70, 0x2c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x5b,
+ 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x29, 0x6e, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x5b, 0x74, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x7d, 0x2c, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x5b, 0x5d, 0x3b, 0x66, 0x6f,
+ 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x29, 0x6e, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x6b, 0x65, 0x79, 0x3a, 0x66, 0x28,
+ 0x74, 0x29, 0x2c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x5b,
+ 0x74, 0x5d, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x7d, 0x2c, 0x73,
+ 0x69, 0x7a, 0x65, 0x3a, 0x76, 0x2c, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x3a, 0x64, 0x2c, 0x66, 0x6f,
+ 0x72, 0x45, 0x61, 0x63, 0x68, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x29, 0x6e, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x66, 0x28, 0x74, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x5b, 0x74, 0x5d,
+ 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6f, 0x61, 0x2e, 0x6e, 0x65, 0x73, 0x74, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x6e, 0x28, 0x74, 0x2c, 0x61, 0x2c, 0x6f, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x6f, 0x3e, 0x3d,
+ 0x69, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x72, 0x3f, 0x72, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x75, 0x2c, 0x61, 0x29, 0x3a, 0x65, 0x3f,
+ 0x61, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x28, 0x65, 0x29, 0x3a, 0x61, 0x3b, 0x66, 0x6f, 0x72, 0x28,
+ 0x76, 0x61, 0x72, 0x20, 0x6c, 0x2c, 0x73, 0x2c, 0x66, 0x2c, 0x68, 0x2c, 0x67, 0x3d, 0x2d, 0x31,
+ 0x2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x6e, 0x5d, 0x2e, 0x6f, 0x6e, 0x28, 0x72, 0x2c, 0x74, 0x29, 0x3b, 0x69, 0x66,
+ 0x28, 0x32, 0x3d, 0x3d, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d,
+ 0x74, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x29,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65,
+ 0x72, 0x74, 0x79, 0x28, 0x6e, 0x29, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6e, 0x5d, 0x2e,
+ 0x6f, 0x6e, 0x28, 0x72, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e,
+ 0x74, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x6f, 0x61, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x6f, 0x74,
+ 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x77,
+ 0x61, 0x2c, 0x22, 0x5c, 0x5c, 0x24, 0x26, 0x22, 0x29, 0x7d, 0x3b, 0x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 0x6e,
+ 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x71,
+ 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28,
+ 0x6e, 0x29, 0x7d, 0x2c, 0x45, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x6e, 0x2e, 0x6d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x73, 0x7c, 0x7c, 0x6e, 0x5b, 0x78, 0x28, 0x6e, 0x2c, 0x22, 0x6d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x29, 0x5d, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x45, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65,
+ 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7d, 0x29, 0x28, 0x6e, 0x2c, 0x74,
+ 0x29, 0x7d, 0x3b, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x53, 0x69, 0x7a, 0x7a, 0x6c, 0x65, 0x26, 0x26, 0x28, 0x6b,
+ 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0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26, 0x26, 0x22, 0x78, 0x6d, 0x6c,
+ 0x6e, 0x73, 0x22, 0x21, 0x3d, 0x3d, 0x28, 0x65, 0x3d, 0x6e, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65,
+ 0x28, 0x30, 0x2c, 0x74, 0x29, 0x29, 0x26, 0x26, 0x28, 0x6e, 0x3d, 0x6e, 0x2e, 0x73, 0x6c, 0x69,
+ 0x63, 0x65, 0x28, 0x74, 0x2b, 0x31, 0x29, 0x29, 0x2c, 0x43, 0x61, 0x2e, 0x68, 0x61, 0x73, 0x4f,
+ 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x65, 0x29, 0x3f, 0x7b, 0x73,
+ 0x70, 0x61, 0x63, 0x65, 0x3a, 0x43, 0x61, 0x5b, 0x65, 0x5d, 0x2c, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+ 0x3a, 0x6e, 0x7d, 0x3a, 0x6e, 0x7d, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3c, 0x32, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22,
+ 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x28, 0x29, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3d, 0x6f, 0x61, 0x2e, 0x6e, 0x73, 0x2e, 0x71, 0x75, 0x61,
+ 0x6c, 0x69, 0x66, 0x79, 0x28, 0x6e, 0x29, 0x2c, 0x6e, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x3f,
+ 0x65, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x53,
+ 0x28, 0x6e, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x6e, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+ 0x29, 0x3a, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x28, 0x6e, 0x29, 0x7d, 0x66, 0x6f, 0x72, 0x28, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x29, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x7a, 0x28, 0x74, 0x2c, 0x6e, 0x5b, 0x74,
+ 0x5d, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x7a, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x65, 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x32, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65,
+ 0x28, 0x29, 0x2c, 0x72, 0x3d, 0x28, 0x6e, 0x3d, 0x54, 0x28, 0x6e, 0x29, 0x29, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x75, 0x3d, 0x2d, 0x31, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x3d, 0x65,
+ 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28,
+ 0x3b, 0x2b, 0x2b, 0x75, 0x3c, 0x72, 0x3b, 0x29, 0x69, 0x66, 0x28, 0x21, 0x74, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x28, 0x6e, 0x5b, 0x75, 0x5d, 0x29, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x21, 0x31, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x28, 0x74,
+ 0x3d, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28,
+ 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x29, 0x3b, 0x2b, 0x2b, 0x75, 0x3c, 0x72, 0x3b, 0x29,
+ 0x69, 0x66, 0x28, 0x21, 0x71, 0x28, 0x6e, 0x5b, 0x75, 0x5d, 0x29, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x28, 0x74, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x21, 0x30, 0x7d, 0x66, 0x6f, 0x72, 0x28, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x6e,
+ 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x52, 0x28, 0x74, 0x2c, 0x6e,
+ 0x5b, 0x74, 0x5d, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61,
+ 0x63, 0x68, 0x28, 0x52, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c,
+ 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x66, 0x28, 0x33,
+ 0x3e, 0x75, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x21,
+ 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x29, 0x7b, 0x32, 0x3e, 0x75, 0x26, 0x26,
+ 0x28, 0x65, 0x3d, 0x22, 0x22, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x72, 0x20, 0x69, 0x6e, 0x20,
+ 0x6e, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x50, 0x28, 0x72, 0x2c,
+ 0x6e, 0x5b, 0x72, 0x5d, 0x2c, 0x65, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x7d, 0x69, 0x66, 0x28, 0x32, 0x3e, 0x75, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x69, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x28, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x28, 0x69, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x43, 0x6f,
+ 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x69, 0x2c, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56,
+ 0x61, 0x6c, 0x75, 0x65, 0x28, 0x6e, 0x29, 0x7d, 0x72, 0x3d, 0x22, 0x22, 0x7d, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x50, 0x28,
+ 0x6e, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x70,
+ 0x65, 0x72, 0x74, 0x79, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x32, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x29,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65,
+ 0x28, 0x29, 0x5b, 0x6e, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x6e,
+ 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x6a, 0x28, 0x74, 0x2c, 0x6e,
+ 0x5b, 0x74, 0x5d, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61,
+ 0x63, 0x68, 0x28, 0x6a, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x74,
+ 0x65, 0x78, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63,
+ 0x68, 0x28, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79,
+ 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6e, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
+ 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x74, 0x3f, 0x22, 0x22, 0x3a, 0x74, 0x7d, 0x3a, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x6e, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65,
+ 0x6e, 0x74, 0x3d, 0x22, 0x22, 0x7d, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65,
+ 0x6e, 0x74, 0x3d, 0x6e, 0x7d, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65,
+ 0x28, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x7d, 0x2c,
+ 0x41, 0x61, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22,
+ 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6e, 0x2e, 0x61, 0x70,
+ 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54,
+ 0x4d, 0x4c, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x74, 0x3f, 0x22, 0x22, 0x3a, 0x74, 0x7d,
+ 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x6e, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54,
+ 0x4d, 0x4c, 0x3d, 0x22, 0x22, 0x7d, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c,
+ 0x3d, 0x6e, 0x7d, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x28, 0x29,
+ 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x61,
+ 0x70, 0x70, 0x65, 0x6e, 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3d, 0x55, 0x28, 0x6e, 0x29, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x6e,
+ 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x69, 0x6e,
+ 0x73, 0x65, 0x72, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3d, 0x55, 0x28, 0x6e, 0x29,
+ 0x2c, 0x74, 0x3d, 0x41, 0x28, 0x74, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72,
+ 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28, 0x6e, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c,
+ 0x74, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7c, 0x7c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x7d, 0x29,
+ 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x46, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74,
+ 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x6e, 0x2c, 0x65,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x2c, 0x75, 0x2c, 0x69, 0x2c, 0x61, 0x3d, 0x6e, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x66, 0x3d, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x2c, 0x68, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x61, 0x2c, 0x66,
+ 0x29, 0x2c, 0x67, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x66, 0x29,
+ 0x2c, 0x70, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x66, 0x29, 0x2c,
+ 0x76, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x61, 0x29, 0x3b, 0x69,
+ 0x66, 0x28, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x6d, 0x3d, 0x6e, 0x65, 0x77,
+ 0x20, 0x63, 0x2c, 0x79, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x61,
+ 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x72, 0x3d, 0x2d, 0x31, 0x3b, 0x2b, 0x2b, 0x72, 0x3c, 0x61,
+ 0x3b, 0x29, 0x28, 0x75, 0x3d, 0x6e, 0x5b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61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x3d, 0x76, 0x2e, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x3d, 0x6e, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2c, 0x6f, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x70, 0x29, 0x2c,
+ 0x6c, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x67, 0x29, 0x2c, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68,
+ 0x28, 0x76, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x72, 0x2c, 0x75, 0x2c, 0x69, 0x3d, 0x2d, 0x31,
+ 0x2c, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69,
+ 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x6e, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x41,
+ 0x72, 0x72, 0x61, 0x79, 0x28, 0x61, 0x3d, 0x28, 0x72, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30,
+ 0x5d, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x3b, 0x2b, 0x2b, 0x69, 0x3c, 0x61,
+ 0x3b, 0x29, 0x28, 0x75, 0x3d, 0x72, 0x5b, 0x69, 0x5d, 0x29, 0x26, 0x26, 0x28, 0x6e, 0x5b, 0x69,
+ 0x5d, 0x3d, 0x75, 0x2e, 0x5f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x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0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x7d, 0x2c, 0x6c, 0x2e, 0x65, 0x78, 0x69, 0x74,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x73, 0x7d, 0x2c, 0x6c, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x64, 0x61, 0x74, 0x75,
+ 0x6d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65,
+ 0x72, 0x74, 0x79, 0x28, 0x22, 0x5f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x5f, 0x22, 0x2c, 0x6e,
+ 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28,
+ 0x22, 0x5f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x5f, 0x22, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e,
+ 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x2c, 0x75, 0x3d, 0x5b,
+ 0x5d, 0x3b, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,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d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x45, 0x28, 0x75, 0x29, 0x7d, 0x2c, 0x41,
+ 0x61, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x2d, 0x31, 0x2c,
+ 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x2b, 0x2b,
+ 0x6e, 0x3c, 0x74, 0x3b, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x2c, 0x72,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6e, 0x5d, 0x2c, 0x75, 0x3d, 0x72, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x2d, 0x31, 0x2c, 0x69, 0x3d, 0x72, 0x5b, 0x75, 0x5d, 0x3b, 0x2d, 0x2d, 0x75,
+ 0x3e, 0x3d, 0x30, 0x3b, 0x29, 0x28, 0x65, 0x3d, 0x72, 0x5b, 0x75, 0x5d, 0x29, 0x26, 0x26, 0x28,
+ 0x69, 0x26, 0x26, 0x69, 0x21, 0x3d, 0x3d, 0x65, 0x2e, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x69, 0x62,
+ 0x6c, 0x69, 0x6e, 0x67, 0x26, 0x26, 0x69, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f,
+ 0x64, 0x65, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28,
+ 0x65, 0x2c, 0x69, 0x29, 0x2c, 0x69, 0x3d, 0x65, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x6e, 0x3d, 0x49, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x2d,
+ 0x31, 0x2c, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b,
+ 0x2b, 0x2b, 0x74, 0x3c, 0x65, 0x3b, 0x29, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x74, 0x5d, 0x2e, 0x73,
+ 0x6f, 0x72, 0x74, 0x28, 0x6e, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x28, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x65,
+ 0x61, 0x63, 0x68, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x59, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x6e, 0x2e,
+ 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x2c, 0x74, 0x2e, 0x5f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f,
+ 0x5f, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x74, 0x3d, 0x63, 0x61, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79,
+ 0x28, 0x74, 0x5b, 0x30, 0x5d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x74, 0x29, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x28, 0x29, 0x7d, 0x2c, 0x41, 0x61, 0x2e, 0x6e,
+ 0x6f, 0x64, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66,
+ 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x30, 0x2c, 0x74, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x74, 0x3e, 0x6e, 0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0x68,
+ 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x45, 0x28,
+ 0x61, 0x29, 0x7d, 0x2c, 0x7a, 0x61, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3c, 0x32, 0x26, 0x26, 0x28, 0x74, 0x3d, 0x56, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x29, 0x2c, 0x41, 0x61, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x2c, 0x74, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22,
+ 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20,
+ 0x74, 0x3f, 0x28, 0x65, 0x3d, 0x5b, 0x6b, 0x61, 0x28, 0x74, 0x2c, 0x73, 0x61, 0x29, 0x5d, 0x2c,
+ 0x65, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e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65, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2c, 0x45, 0x28, 0x5b, 0x74, 0x5d, 0x29, 0x7d, 0x2c,
+ 0x41, 0x61, 0x2e, 0x6f, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x66, 0x28,
+ 0x33, 0x3e, 0x72, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22,
+ 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x29, 0x7b, 0x32, 0x3e, 0x72, 0x26,
+ 0x26, 0x28, 0x74, 0x3d, 0x21, 0x31, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x20, 0x69, 0x6e,
+ 0x20, 0x6e, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x58, 0x28, 0x65,
+ 0x2c, 0x6e, 0x5b, 0x65, 0x5d, 0x2c, 0x74, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x69, 0x66, 0x28, 0x32, 0x3e, 0x72, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x28, 0x72, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x28,
+ 0x29, 0x5b, 0x22, 0x5f, 0x5f, 0x6f, 0x6e, 0x22, 0x2b, 0x6e, 0x5d, 0x29, 0x26, 0x26, 0x72, 0x2e,
+ 0x5f, 0x3b, 0x65, 0x3d, 0x21, 0x31, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x58, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29,
+ 0x29, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x4c, 0x61, 0x3d, 0x6f, 0x61, 0x2e, 0x6d, 0x61, 0x70,
+ 0x28, 0x7b, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3a, 0x22, 0x6d, 0x6f,
+ 0x75, 0x73, 0x65, 0x6f, 0x76, 0x65, 0x72, 0x22, 0x2c, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6c, 0x65,
+ 0x61, 0x76, 0x65, 0x3a, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x7d, 0x29,
+ 0x3b, 0x73, 0x61, 0x26, 0x26, 0x4c, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x22, 0x6f, 0x6e, 0x22,
+ 0x2b, 0x6e, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x61, 0x26, 0x26, 0x4c, 0x61, 0x2e, 0x72, 0x65, 0x6d,
+ 0x6f, 0x76, 0x65, 0x28, 0x6e, 0x29, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x71, 0x61, 0x2c,
+ 0x54, 0x61, 0x3d, 0x30, 0x3b, 0x6f, 0x61, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x4a, 0x28, 0x6e, 0x2c, 0x6b, 0x28, 0x29, 0x29, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x52,
+ 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61, 0x76, 0x69, 0x67, 0x61, 0x74, 0x6f, 0x72,
+ 0x26, 0x26, 0x2f, 0x57, 0x65, 0x62, 0x4b, 0x69, 0x74, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61, 0x76, 0x69, 0x67, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x75,
+ 0x73, 0x65, 0x72, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x29, 0x3f, 0x2d, 0x31, 0x3a, 0x30, 0x3b, 0x6f,
+ 0x61, 0x2e, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x33, 0x26, 0x26, 0x28,
+ 0x65, 0x3d, 0x74, 0x2c, 0x74, 0x3d, 0x6b, 0x28, 0x29, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65,
+ 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x29, 0x2c, 0x74, 0x29, 0x66, 0x6f, 0x72, 0x28,
+ 0x76, 0x61, 0x72, 0x20, 0x72, 0x2c, 0x75, 0x3d, 0x30, 0x2c, 0x69, 0x3d, 0x74, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x3e, 0x75, 0x3b, 0x2b, 0x2b, 0x75, 0x29, 0x69, 0x66, 0x28,
+ 0x28, 0x72, 0x3d, 0x74, 0x5b, 0x75, 0x5d, 0x29, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66,
+ 0x69, 0x65, 0x72, 0x3d, 0x3d, 0x3d, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4a,
+ 0x28, 0x6e, 0x2c, 0x72, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69,
+ 0x6f, 0x72, 0x2e, 0x64, 0x72, 0x61, 0x67, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f,
+ 0x77, 0x6e, 0x2e, 0x64, 0x72, 0x61, 0x67, 0x22, 0x2c, 0x69, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22,
+ 0x74, 0x6f, 0x75, 0x63, 0x68, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2e, 0x64, 0x72, 0x61, 0x67, 0x22,
+ 0x2c, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x6e,
+ 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x69, 0x2c, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x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 0x63, 0x3d, 0x75, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x73, 0x2c, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x63, 0x3d, 0x5b, 0x63, 0x2e, 0x78,
+ 0x2d, 0x4d, 0x5b, 0x30, 0x5d, 0x2c, 0x63, 0x2e, 0x79, 0x2d, 0x4d, 0x5b, 0x31, 0x5d, 0x5d, 0x29,
+ 0x3a, 0x63, 0x3d, 0x5b, 0x30, 0x2c, 0x30, 0x5d, 0x2c, 0x67, 0x28, 0x7b, 0x74, 0x79, 0x70, 0x65,
+ 0x3a, 0x22, 0x64, 0x72, 0x61, 0x67, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x7d, 0x29, 0x7d, 0x7d,
+ 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x4e, 0x28, 0x6e, 0x2c, 0x22, 0x64, 0x72, 0x61, 0x67, 0x22,
+ 0x2c, 0x22, 0x64, 0x72, 0x61, 0x67, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x2c, 0x22, 0x64, 0x72,
+ 0x61, 0x67, 0x65, 0x6e, 0x64, 0x22, 0x29, 0x2c, 0x75, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x69,
+ 0x3d, 0x65, 0x28, 0x62, 0x2c, 0x6f, 0x61, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x2c, 0x74, 0x2c,
+ 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x22, 0x2c, 0x22, 0x6d, 0x6f, 0x75,
+ 0x73, 0x65, 0x75, 0x70, 0x22, 0x29, 0x2c, 0x61, 0x3d, 0x65, 0x28, 0x47, 0x2c, 0x6f, 0x61, 0x2e,
+ 0x74, 0x6f, 0x75, 0x63, 0x68, 0x2c, 0x79, 0x2c, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x6d, 0x6f,
+ 0x76, 0x65, 0x22, 0x2c, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x6e, 0x64, 0x22, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3f, 0x28, 0x75, 0x3d, 0x74, 0x2c, 0x6e, 0x29, 0x3a, 0x75, 0x7d, 0x2c, 0x6f,
+ 0x61, 0x2e, 0x72, 0x65, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x6e, 0x2c, 0x72, 0x2c, 0x22, 0x6f, 0x6e,
+ 0x22, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x32, 0x26, 0x26, 0x28, 0x74, 0x3d, 0x6b, 0x28, 0x29, 0x2e, 0x74,
+ 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x29, 0x2c, 0x74, 0x3f, 0x63, 0x61, 0x28, 0x74, 0x29, 0x2e,
+ 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x4a, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72,
+ 0x3d, 0x74, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x2c, 0x65, 0x7d,
+ 0x29, 0x3a, 0x5b, 0x5d, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x44, 0x61, 0x3d, 0x31, 0x65, 0x2d,
+ 0x36, 0x2c, 0x50, 0x61, 0x3d, 0x44, 0x61, 0x2a, 0x44, 0x61, 0x2c, 0x6a, 0x61, 0x3d, 0x4d, 0x61,
+ 0x74, 0x68, 0x2e, 0x50, 0x49, 0x2c, 0x55, 0x61, 0x3d, 0x32, 0x2a, 0x6a, 0x61, 0x2c, 0x46, 0x61,
+ 0x3d, 0x55, 0x61, 0x2d, 0x44, 0x61, 0x2c, 0x48, 0x61, 0x3d, 0x6a, 0x61, 0x2f, 0x32, 0x2c, 0x4f,
+ 0x61, 0x3d, 0x6a, 0x61, 0x2f, 0x31, 0x38, 0x30, 0x2c, 0x49, 0x61, 0x3d, 0x31, 0x38, 0x30, 0x2f,
+ 0x6a, 0x61, 0x2c, 0x59, 0x61, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x53, 0x51, 0x52, 0x54, 0x32,
+ 0x2c, 0x5a, 0x61, 0x3d, 0x32, 0x2c, 0x56, 0x61, 0x3d, 0x34, 0x3b, 0x6f, 0x61, 0x2e, 0x69, 0x6e,
+ 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x5a, 0x6f, 0x6f, 0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x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x28,
+ 0x70, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x3d, 0x6b, 0x2e, 0x6b, 0x2c,
+ 0x6e, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x6e, 0x2e, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69,
+ 0x65, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x26, 0x26, 0x28, 0x64, 0x5b, 0x6e, 0x2e, 0x69, 0x64,
+ 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5d, 0x3d, 0x65, 0x28, 0x6e, 0x29, 0x29, 0x7d,
+ 0x29, 0x2c, 0x6e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x28, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e,
+ 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3b, 0x6f, 0x61, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
+ 0x28, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x78, 0x2c, 0x72, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x62,
+ 0x2c, 0x6f, 0x29, 0x2c, 0x5f, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x29, 0x3b, 0x66, 0x6f,
+ 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
+ 0x2e, 0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6c, 0x2c, 0x69, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x2c, 0x63, 0x28, 0x76, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x28, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x6f,
+ 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20,
+ 0x74, 0x3d, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67,
+ 0x65, 0x64, 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x2c, 0x65, 0x3d, 0x30, 0x2c, 0x72, 0x3d,
+ 0x74, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x72, 0x3e, 0x65, 0x3b, 0x2b, 0x2b, 0x65,
+ 0x29, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x64, 0x5b, 0x74, 0x5b, 0x65, 0x5d, 0x2e, 0x69,
+ 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76,
+ 0x61, 0x72, 0x20, 0x75, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6e, 0x28, 0x29, 0x7d, 0x6f, 0x61, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x5f, 0x29, 0x2e, 0x6f, 0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x28, 0x70, 0x29, 0x3b, 0x74, 0x28, 0x29, 0x2c, 0x6c, 0x28, 0x76, 0x29, 0x2c, 0x77, 0x2e,
+ 0x6f, 0x6e, 0x28, 0x4c, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x52, 0x2c,
+ 0x74, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x28, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x44, 0x2e, 0x6f, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x79, 0x3f, 0x63, 0x6c, 0x65,
+ 0x61, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x79, 0x29, 0x3a, 0x28, 0x4f, 0x6c,
+ 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x76, 0x3d, 0x65, 0x28,
+ 0x64, 0x3d, 0x6d, 0x7c, 0x7c, 0x6f, 0x61, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x29, 0x29, 0x2c, 0x6c, 0x28, 0x6e, 0x29, 0x29, 0x2c, 0x79, 0x3d, 0x73, 0x65, 0x74,
+ 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x79, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x73, 0x28, 0x6e, 0x29, 0x7d, 0x2c,
+ 0x35, 0x30, 0x29, 0x2c, 0x53, 0x28, 0x29, 0x2c, 0x75, 0x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x69, 0x6e, 0x20, 0x73, 0x61, 0x3f, 0x28, 0x58, 0x61, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2d,
+ 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x59, 0x2a,
+ 0x28, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x4d,
+ 0x6f, 0x64, 0x65, 0x3f, 0x31, 0x32, 0x30, 0x3a, 0x31, 0x29, 0x7d, 0x2c, 0x22, 0x77, 0x68, 0x65,
+ 0x65, 0x6c, 0x22, 0x29, 0x3a, 0x22, 0x6f, 0x6e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x77, 0x68, 0x65,
+ 0x65, 0x6c, 0x22, 0x69, 0x6e, 0x20, 0x73, 0x61, 0x3f, 0x28, 0x58, 0x61, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f,
+ 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x44, 0x65, 0x6c,
+ 0x74, 0x61, 0x7d, 0x2c, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x77, 0x68, 0x65, 0x65, 0x6c, 0x22,
+ 0x29, 0x3a, 0x28, 0x58, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2d, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 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x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x72, 0x67, 0x62, 0x28, 0x29, 0x2b, 0x22, 0x22, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x68, 0x73,
+ 0x6c, 0x3d, 0x6c, 0x6e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x57, 0x61, 0x3d, 0x6c, 0x6e, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x6f, 0x6e, 0x3b,
+ 0x57, 0x61, 0x2e, 0x62, 0x72, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x2e, 0x37, 0x2c, 0x61, 0x72, 0x67,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x6e, 0x3a,
+ 0x31, 0x29, 0x2c, 0x6e, 0x65, 0x77, 0x20, 0x6c, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x2f, 0x6e,
+ 0x29, 0x7d, 0x2c, 0x57, 0x61, 0x2e, 0x64, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65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x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x73,
+ 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x2c,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x31, 0x30, 0x30, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6c, 0x2b, 0x47, 0x61, 0x2a, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x6e, 0x3a, 0x31, 0x29, 0x29, 0x29, 0x7d,
+ 0x2c, 0x4a, 0x61, 0x2e, 0x64, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65,
+ 0x77, 0x20, 0x73, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x63, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x30, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6c, 0x2d, 0x47, 0x61, 0x2a, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x6e, 0x3a, 0x31, 0x29, 0x29, 0x29,
+ 0x7d, 0x2c, 0x4a, 0x61, 0x2e, 0x72, 0x67, 0x62, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x6e, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x68, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6c, 0x29, 0x2e, 0x72, 0x67, 0x62, 0x28, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x6c, 0x61,
+ 0x62, 0x3d, 0x68, 0x6e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x47, 0x61, 0x3d, 0x31, 0x38, 0x2c, 0x4b,
+ 0x61, 0x3d, 0x2e, 0x39, 0x35, 0x30, 0x34, 0x37, 0x2c, 0x51, 0x61, 0x3d, 0x31, 0x2c, 0x6e, 0x6f,
+ 0x3d, 0x31, 0x2e, 0x30, 0x38, 0x38, 0x38, 0x33, 0x2c, 0x74, 0x6f, 0x3d, 0x68, 0x6e, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x6f, 0x6e, 0x3b,
+ 0x74, 0x6f, 0x2e, 0x62, 0x72, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x65, 0x77, 0x20, 0x68, 0x6e, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x31,
+ 0x30, 0x30, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x2b, 0x47, 0x61, 0x2a, 0x28, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x6e,
+ 0x3a, 0x31, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x62, 0x29, 0x7d, 0x2c, 0x74, 0x6f, 0x2e, 0x64, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x68, 0x6e, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61,
+ 0x78, 0x28, 0x30, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x2d, 0x47, 0x61, 0x2a, 0x28, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f,
+ 0x6e, 0x3a, 0x31, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x62, 0x29, 0x7d, 0x2c, 0x74, 0x6f, 0x2e, 0x72, 0x67, 0x62, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67,
+ 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x72, 0x67, 0x62, 0x3d,
+ 0x79, 0x6e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x6f, 0x3d, 0x79, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x6f, 0x6e, 0x3b, 0x65, 0x6f,
+ 0x2e, 0x62, 0x72, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x6e, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77,
+ 0x28, 0x2e, 0x37, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x6e, 0x3a, 0x31, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x2c, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x2c,
+ 0x72, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x2c, 0x75, 0x3d, 0x33, 0x30, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x7c, 0x7c, 0x65, 0x7c, 0x7c, 0x72, 0x3f, 0x28, 0x74, 0x26,
+ 0x26, 0x75, 0x3e, 0x74, 0x26, 0x26, 0x28, 0x74, 0x3d, 0x75, 0x29, 0x2c, 0x65, 0x26, 0x26, 0x75,
+ 0x3e, 0x65, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x75, 0x29, 0x2c, 0x72, 0x26, 0x26, 0x75, 0x3e, 0x72,
+ 0x26, 0x26, 0x28, 0x72, 0x3d, 0x75, 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x2e, 0x68, 0x73,
+ 0x6c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x77, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x67, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x29, 0x7d, 0x2c, 0x65, 0x6f,
+ 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x23, 0x22, 0x2b, 0x62,
+ 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x29, 0x2b, 0x62, 0x6e, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x67, 0x29, 0x2b, 0x62, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x29, 0x7d,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x6f, 0x3d, 0x6f, 0x61, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x7b,
+ 0x61, 0x6c, 0x69, 0x63, 0x65, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x31, 0x35, 0x37, 0x39, 0x32, 0x33,
+ 0x38, 0x33, 0x2c, 0x61, 0x6e, 0x74, 0x69, 0x71, 0x75, 0x65, 0x77, 0x68, 0x69, 0x74, 0x65, 0x3a,
+ 0x31, 0x36, 0x34, 0x34, 0x34, 0x33, 0x37, 0x35, 0x2c, 0x61, 0x71, 0x75, 0x61, 0x3a, 0x36, 0x35,
+ 0x35, 0x33, 0x35, 0x2c, 0x61, 0x71, 0x75, 0x61, 0x6d, 0x61, 0x72, 0x69, 0x6e, 0x65, 0x3a, 0x38,
+ 0x33, 0x38, 0x38, 0x35, 0x36, 0x34, 0x2c, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x3a, 0x31, 0x35, 0x37,
+ 0x39, 0x34, 0x31, 0x37, 0x35, 0x2c, 0x62, 0x65, 0x69, 0x67, 0x65, 0x3a, 0x31, 0x36, 0x31, 0x31,
+ 0x39, 0x32, 0x36, 0x30, 0x2c, 0x62, 0x69, 0x73, 0x71, 0x75, 0x65, 0x3a, 0x31, 0x36, 0x37, 0x37,
+ 0x30, 0x32, 0x34, 0x34, 0x2c, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x3a, 0x30, 0x2c, 0x62, 0x6c, 0x61,
+ 0x6e, 0x63, 0x68, 0x65, 0x64, 0x61, 0x6c, 0x6d, 0x6f, 0x6e, 0x64, 0x3a, 0x31, 0x36, 0x37, 0x37,
+ 0x32, 0x30, 0x34, 0x35, 0x2c, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x32, 0x35, 0x35, 0x2c, 0x62, 0x6c,
+ 0x75, 0x65, 0x76, 0x69, 0x6f, 0x6c, 0x65, 0x74, 0x3a, 0x39, 0x30, 0x35, 0x35, 0x32, 0x30, 0x32,
+ 0x2c, 0x62, 0x72, 0x6f, 0x77, 0x6e, 0x3a, 0x31, 0x30, 0x38, 0x32, 0x34, 0x32, 0x33, 0x34, 0x2c,
+ 0x62, 0x75, 0x72, 0x6c, 0x79, 0x77, 0x6f, 0x6f, 0x64, 0x3a, 0x31, 0x34, 0x35, 0x39, 0x36, 0x32,
+ 0x33, 0x31, 0x2c, 0x63, 0x61, 0x64, 0x65, 0x74, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x36, 0x32, 0x36,
+ 0x36, 0x35, 0x32, 0x38, 0x2c, 0x63, 0x68, 0x61, 0x72, 0x74, 0x72, 0x65, 0x75, 0x73, 0x65, 0x3a,
+ 0x38, 0x33, 0x38, 0x38, 0x33, 0x35, 0x32, 0x2c, 0x63, 0x68, 0x6f, 0x63, 0x6f, 0x6c, 0x61, 0x74,
+ 0x65, 0x3a, 0x31, 0x33, 0x37, 0x38, 0x39, 0x34, 0x37, 0x30, 0x2c, 0x63, 0x6f, 0x72, 0x61, 0x6c,
+ 0x3a, 0x31, 0x36, 0x37, 0x34, 0x34, 0x32, 0x37, 0x32, 0x2c, 0x63, 0x6f, 0x72, 0x6e, 0x66, 0x6c,
+ 0x6f, 0x77, 0x65, 0x72, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x36, 0x35, 0x39, 0x31, 0x39, 0x38, 0x31,
+ 0x2c, 0x63, 0x6f, 0x72, 0x6e, 0x73, 0x69, 0x6c, 0x6b, 0x3a, 0x31, 0x36, 0x37, 0x37, 0x35, 0x33,
+ 0x38, 0x38, 0x2c, 0x63, 0x72, 0x69, 0x6d, 0x73, 0x6f, 0x6e, 0x3a, 0x31, 0x34, 0x34, 0x32, 0x33,
+ 0x31, 0x30, 0x30, 0x2c, 0x63, 0x79, 0x61, 0x6e, 0x3a, 0x36, 0x35, 0x35, 0x33, 0x35, 0x2c, 0x64,
+ 0x61, 0x72, 0x6b, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x31, 0x33, 0x39, 0x2c, 0x64, 0x61, 0x72, 0x6b,
+ 0x63, 0x79, 0x61, 0x6e, 0x3a, 0x33, 0x35, 0x37, 0x32, 0x33, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x67,
+ 0x6f, 0x6c, 0x64, 0x65, 0x6e, 0x72, 0x6f, 0x64, 0x3a, 0x31, 0x32, 0x30, 0x39, 0x32, 0x39, 0x33,
+ 0x39, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x67, 0x72, 0x61, 0x79, 0x3a, 0x31, 0x31, 0x31, 0x31, 0x39,
+ 0x30, 0x31, 0x37, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x32, 0x35,
+ 0x36, 0x30, 0x30, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x67, 0x72, 0x65, 0x79, 0x3a, 0x31, 0x31, 0x31,
+ 0x31, 0x39, 0x30, 0x31, 0x37, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x6b, 0x68, 0x61, 0x6b, 0x69, 0x3a,
+ 0x31, 0x32, 0x34, 0x33, 0x33, 0x32, 0x35, 0x39, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x6d, 0x61, 0x67,
+ 0x65, 0x6e, 0x74, 0x61, 0x3a, 0x39, 0x31, 0x30, 0x39, 0x36, 0x34, 0x33, 0x2c, 0x64, 0x61, 0x72,
+ 0x6b, 0x6f, 0x6c, 0x69, 0x76, 0x65, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x35, 0x35, 0x39, 0x37,
+ 0x39, 0x39, 0x39, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x6f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x3a, 0x31,
+ 0x36, 0x37, 0x34, 0x37, 0x35, 0x32, 0x30, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x6f, 0x72, 0x63, 0x68,
+ 0x69, 0x64, 0x3a, 0x31, 0x30, 0x30, 0x34, 0x30, 0x30, 0x31, 0x32, 0x2c, 0x64, 0x61, 0x72, 0x6b,
+ 0x72, 0x65, 0x64, 0x3a, 0x39, 0x31, 0x30, 0x39, 0x35, 0x30, 0x34, 0x2c, 0x64, 0x61, 0x72, 0x6b,
+ 0x73, 0x61, 0x6c, 0x6d, 0x6f, 0x6e, 0x3a, 0x31, 0x35, 0x33, 0x30, 0x38, 0x34, 0x31, 0x30, 0x2c,
+ 0x64, 0x61, 0x72, 0x6b, 0x73, 0x65, 0x61, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x39, 0x34, 0x31,
+ 0x39, 0x39, 0x31, 0x39, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x62, 0x6c,
+ 0x75, 0x65, 0x3a, 0x34, 0x37, 0x33, 0x34, 0x33, 0x34, 0x37, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x73,
+ 0x6c, 0x61, 0x74, 0x65, 0x67, 0x72, 0x61, 0x79, 0x3a, 0x33, 0x31, 0x30, 0x30, 0x34, 0x39, 0x35,
+ 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x67, 0x72, 0x65, 0x79, 0x3a, 0x33,
+ 0x31, 0x30, 0x30, 0x34, 0x39, 0x35, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x74, 0x75, 0x72, 0x71, 0x75,
+ 0x6f, 0x69, 0x73, 0x65, 0x3a, 0x35, 0x32, 0x39, 0x34, 0x35, 0x2c, 0x64, 0x61, 0x72, 0x6b, 0x76,
+ 0x69, 0x6f, 0x6c, 0x65, 0x74, 0x3a, 0x39, 0x36, 0x39, 0x39, 0x35, 0x33, 0x39, 0x2c, 0x64, 0x65,
+ 0x65, 0x70, 0x70, 0x69, 0x6e, 0x6b, 0x3a, 0x31, 0x36, 0x37, 0x31, 0x36, 0x39, 0x34, 0x37, 0x2c,
+ 0x64, 0x65, 0x65, 0x70, 0x73, 0x6b, 0x79, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x34, 0x39, 0x31, 0x35,
+ 0x31, 0x2c, 0x64, 0x69, 0x6d, 0x67, 0x72, 0x61, 0x79, 0x3a, 0x36, 0x39, 0x30, 0x38, 0x32, 0x36,
+ 0x35, 0x2c, 0x64, 0x69, 0x6d, 0x67, 0x72, 0x65, 0x79, 0x3a, 0x36, 0x39, 0x30, 0x38, 0x32, 0x36,
+ 0x35, 0x2c, 0x64, 0x6f, 0x64, 0x67, 0x65, 0x72, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x32, 0x30, 0x30,
+ 0x33, 0x31, 0x39, 0x39, 0x2c, 0x66, 0x69, 0x72, 0x65, 0x62, 0x72, 0x69, 0x63, 0x6b, 0x3a, 0x31,
+ 0x31, 0x36, 0x37, 0x34, 0x31, 0x34, 0x36, 0x2c, 0x66, 0x6c, 0x6f, 0x72, 0x61, 0x6c, 0x77, 0x68,
+ 0x69, 0x74, 0x65, 0x3a, 0x31, 0x36, 0x37, 0x37, 0x35, 0x39, 0x32, 0x30, 0x2c, 0x66, 0x6f, 0x72,
+ 0x65, 0x73, 0x74, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x32, 0x32, 0x36, 0x33, 0x38, 0x34, 0x32,
+ 0x2c, 0x66, 0x75, 0x63, 0x68, 0x73, 0x69, 0x61, 0x3a, 0x31, 0x36, 0x37, 0x31, 0x31, 0x39, 0x33,
+ 0x35, 0x2c, 0x67, 0x61, 0x69, 0x6e, 0x73, 0x62, 0x6f, 0x72, 0x6f, 0x3a, 0x31, 0x34, 0x34, 0x37,
+ 0x34, 0x34, 0x36, 0x30, 0x2c, 0x67, 0x68, 0x6f, 0x73, 0x74, 0x77, 0x68, 0x69, 0x74, 0x65, 0x3a,
+ 0x31, 0x36, 0x33, 0x31, 0x36, 0x36, 0x37, 0x31, 0x2c, 0x67, 0x6f, 0x6c, 0x64, 0x3a, 0x31, 0x36,
+ 0x37, 0x36, 0x36, 0x37, 0x32, 0x30, 0x2c, 0x67, 0x6f, 0x6c, 0x64, 0x65, 0x6e, 0x72, 0x6f, 0x64,
+ 0x3a, 0x31, 0x34, 0x33, 0x32, 0x39, 0x31, 0x32, 0x30, 0x2c, 0x67, 0x72, 0x61, 0x79, 0x3a, 0x38,
+ 0x34, 0x32, 0x31, 0x35, 0x30, 0x34, 0x2c, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x33, 0x32, 0x37,
+ 0x36, 0x38, 0x2c, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x3a, 0x31,
+ 0x31, 0x34, 0x30, 0x33, 0x30, 0x35, 0x35, 0x2c, 0x67, 0x72, 0x65, 0x79, 0x3a, 0x38, 0x34, 0x32,
+ 0x31, 0x35, 0x30, 0x34, 0x2c, 0x68, 0x6f, 0x6e, 0x65, 0x79, 0x64, 0x65, 0x77, 0x3a, 0x31, 0x35,
+ 0x37, 0x39, 0x34, 0x31, 0x36, 0x30, 0x2c, 0x68, 0x6f, 0x74, 0x70, 0x69, 0x6e, 0x6b, 0x3a, 0x31,
+ 0x36, 0x37, 0x33, 0x38, 0x37, 0x34, 0x30, 0x2c, 0x69, 0x6e, 0x64, 0x69, 0x61, 0x6e, 0x72, 0x65,
+ 0x64, 0x3a, 0x31, 0x33, 0x34, 0x35, 0x38, 0x35, 0x32, 0x34, 0x2c, 0x69, 0x6e, 0x64, 0x69, 0x67,
+ 0x6f, 0x3a, 0x34, 0x39, 0x31, 0x35, 0x33, 0x33, 0x30, 0x2c, 0x69, 0x76, 0x6f, 0x72, 0x79, 0x3a,
+ 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x30, 0x30, 0x2c, 0x6b, 0x68, 0x61, 0x6b, 0x69, 0x3a, 0x31,
+ 0x35, 0x37, 0x38, 0x37, 0x36, 0x36, 0x30, 0x2c, 0x6c, 0x61, 0x76, 0x65, 0x6e, 0x64, 0x65, 0x72,
+ 0x3a, 0x31, 0x35, 0x31, 0x33, 0x32, 0x34, 0x31, 0x30, 0x2c, 0x6c, 0x61, 0x76, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x62, 0x6c, 0x75, 0x73, 0x68, 0x3a, 0x31, 0x36, 0x37, 0x37, 0x33, 0x33, 0x36, 0x35,
+ 0x2c, 0x6c, 0x61, 0x77, 0x6e, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x38, 0x31, 0x39, 0x30, 0x39,
+ 0x37, 0x36, 0x2c, 0x6c, 0x65, 0x6d, 0x6f, 0x6e, 0x63, 0x68, 0x69, 0x66, 0x66, 0x6f, 0x6e, 0x3a,
+ 0x31, 0x36, 0x37, 0x37, 0x35, 0x38, 0x38, 0x35, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x62, 0x6c,
+ 0x75, 0x65, 0x3a, 0x31, 0x31, 0x33, 0x39, 0x33, 0x32, 0x35, 0x34, 0x2c, 0x6c, 0x69, 0x67, 0x68,
+ 0x74, 0x63, 0x6f, 0x72, 0x61, 0x6c, 0x3a, 0x31, 0x35, 0x37, 0x36, 0x31, 0x35, 0x33, 0x36, 0x2c,
+ 0x6c, 0x69, 0x67, 0x68, 0x74, 0x63, 0x79, 0x61, 0x6e, 0x3a, 0x31, 0x34, 0x37, 0x34, 0x35, 0x35,
+ 0x39, 0x39, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x67, 0x6f, 0x6c, 0x64, 0x65, 0x6e, 0x72, 0x6f,
+ 0x64, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x3a, 0x31, 0x36, 0x34, 0x34, 0x38, 0x32, 0x31, 0x30,
+ 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x67, 0x72, 0x61, 0x79, 0x3a, 0x31, 0x33, 0x38, 0x38, 0x32,
+ 0x33, 0x32, 0x33, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x39,
+ 0x34, 0x39, 0x38, 0x32, 0x35, 0x36, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x67, 0x72, 0x65, 0x79,
+ 0x3a, 0x31, 0x33, 0x38, 0x38, 0x32, 0x33, 0x32, 0x33, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x70,
+ 0x69, 0x6e, 0x6b, 0x3a, 0x31, 0x36, 0x37, 0x35, 0x38, 0x34, 0x36, 0x35, 0x2c, 0x6c, 0x69, 0x67,
+ 0x68, 0x74, 0x73, 0x61, 0x6c, 0x6d, 0x6f, 0x6e, 0x3a, 0x31, 0x36, 0x37, 0x35, 0x32, 0x37, 0x36,
+ 0x32, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x65, 0x61, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a,
+ 0x32, 0x31, 0x34, 0x32, 0x38, 0x39, 0x30, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x6b, 0x79,
+ 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x38, 0x39, 0x30, 0x30, 0x33, 0x34, 0x36, 0x2c, 0x6c, 0x69, 0x67,
+ 0x68, 0x74, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x67, 0x72, 0x61, 0x79, 0x3a, 0x37, 0x38, 0x33, 0x33,
+ 0x37, 0x35, 0x33, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x67, 0x72,
+ 0x65, 0x79, 0x3a, 0x37, 0x38, 0x33, 0x33, 0x37, 0x35, 0x33, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74,
+ 0x73, 0x74, 0x65, 0x65, 0x6c, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x31, 0x31, 0x35, 0x38, 0x34, 0x37,
+ 0x33, 0x34, 0x2c, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x3a, 0x31,
+ 0x36, 0x37, 0x37, 0x37, 0x31, 0x38, 0x34, 0x2c, 0x6c, 0x69, 0x6d, 0x65, 0x3a, 0x36, 0x35, 0x32,
+ 0x38, 0x30, 0x2c, 0x6c, 0x69, 0x6d, 0x65, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x33, 0x33, 0x32,
+ 0x39, 0x33, 0x33, 0x30, 0x2c, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x3a, 0x31, 0x36, 0x34, 0x34, 0x35,
+ 0x36, 0x37, 0x30, 0x2c, 0x6d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x61, 0x3a, 0x31, 0x36, 0x37, 0x31,
+ 0x31, 0x39, 0x33, 0x35, 0x2c, 0x6d, 0x61, 0x72, 0x6f, 0x6f, 0x6e, 0x3a, 0x38, 0x33, 0x38, 0x38,
+ 0x36, 0x30, 0x38, 0x2c, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x61, 0x71, 0x75, 0x61, 0x6d, 0x61,
+ 0x72, 0x69, 0x6e, 0x65, 0x3a, 0x36, 0x37, 0x33, 0x37, 0x33, 0x32, 0x32, 0x2c, 0x6d, 0x65, 0x64,
+ 0x69, 0x75, 0x6d, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x32, 0x30, 0x35, 0x2c, 0x6d, 0x65, 0x64, 0x69,
+ 0x75, 0x6d, 0x6f, 0x72, 0x63, 0x68, 0x69, 0x64, 0x3a, 0x31, 0x32, 0x32, 0x31, 0x31, 0x36, 0x36,
+ 0x37, 0x2c, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x75, 0x72, 0x70, 0x6c, 0x65, 0x3a, 0x39,
+ 0x36, 0x36, 0x32, 0x36, 0x38, 0x33, 0x2c, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x73, 0x65, 0x61,
+ 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x33, 0x39, 0x37, 0x38, 0x30, 0x39, 0x37, 0x2c, 0x6d, 0x65,
+ 0x64, 0x69, 0x75, 0x6d, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x38, 0x30,
+ 0x38, 0x37, 0x37, 0x39, 0x30, 0x2c, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x73, 0x70, 0x72, 0x69,
+ 0x6e, 0x67, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x36, 0x34, 0x31, 0x35, 0x34, 0x2c, 0x6d, 0x65,
+ 0x64, 0x69, 0x75, 0x6d, 0x74, 0x75, 0x72, 0x71, 0x75, 0x6f, 0x69, 0x73, 0x65, 0x3a, 0x34, 0x37,
+ 0x37, 0x32, 0x33, 0x30, 0x30, 0x2c, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x76, 0x69, 0x6f, 0x6c,
+ 0x65, 0x74, 0x72, 0x65, 0x64, 0x3a, 0x31, 0x33, 0x30, 0x34, 0x37, 0x31, 0x37, 0x33, 0x2c, 0x6d,
+ 0x69, 0x64, 0x6e, 0x69, 0x67, 0x68, 0x74, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x31, 0x36, 0x34, 0x34,
+ 0x39, 0x31, 0x32, 0x2c, 0x6d, 0x69, 0x6e, 0x74, 0x63, 0x72, 0x65, 0x61, 0x6d, 0x3a, 0x31, 0x36,
+ 0x31, 0x32, 0x31, 0x38, 0x35, 0x30, 0x2c, 0x6d, 0x69, 0x73, 0x74, 0x79, 0x72, 0x6f, 0x73, 0x65,
+ 0x3a, 0x31, 0x36, 0x37, 0x37, 0x30, 0x32, 0x37, 0x33, 0x2c, 0x6d, 0x6f, 0x63, 0x63, 0x61, 0x73,
+ 0x69, 0x6e, 0x3a, 0x31, 0x36, 0x37, 0x37, 0x30, 0x32, 0x32, 0x39, 0x2c, 0x6e, 0x61, 0x76, 0x61,
+ 0x6a, 0x6f, 0x77, 0x68, 0x69, 0x74, 0x65, 0x3a, 0x31, 0x36, 0x37, 0x36, 0x38, 0x36, 0x38, 0x35,
+ 0x2c, 0x6e, 0x61, 0x76, 0x79, 0x3a, 0x31, 0x32, 0x38, 0x2c, 0x6f, 0x6c, 0x64, 0x6c, 0x61, 0x63,
+ 0x65, 0x3a, 0x31, 0x36, 0x36, 0x34, 0x33, 0x35, 0x35, 0x38, 0x2c, 0x6f, 0x6c, 0x69, 0x76, 0x65,
+ 0x3a, 0x38, 0x34, 0x32, 0x31, 0x33, 0x37, 0x36, 0x2c, 0x6f, 0x6c, 0x69, 0x76, 0x65, 0x64, 0x72,
+ 0x61, 0x62, 0x3a, 0x37, 0x30, 0x34, 0x38, 0x37, 0x33, 0x39, 0x2c, 0x6f, 0x72, 0x61, 0x6e, 0x67,
+ 0x65, 0x3a, 0x31, 0x36, 0x37, 0x35, 0x33, 0x39, 0x32, 0x30, 0x2c, 0x6f, 0x72, 0x61, 0x6e, 0x67,
+ 0x65, 0x72, 0x65, 0x64, 0x3a, 0x31, 0x36, 0x37, 0x32, 0x39, 0x33, 0x34, 0x34, 0x2c, 0x6f, 0x72,
+ 0x63, 0x68, 0x69, 0x64, 0x3a, 0x31, 0x34, 0x33, 0x31, 0x35, 0x37, 0x33, 0x34, 0x2c, 0x70, 0x61,
+ 0x6c, 0x65, 0x67, 0x6f, 0x6c, 0x64, 0x65, 0x6e, 0x72, 0x6f, 0x64, 0x3a, 0x31, 0x35, 0x36, 0x35,
+ 0x37, 0x31, 0x33, 0x30, 0x2c, 0x70, 0x61, 0x6c, 0x65, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x31,
+ 0x30, 0x30, 0x32, 0x35, 0x38, 0x38, 0x30, 0x2c, 0x70, 0x61, 0x6c, 0x65, 0x74, 0x75, 0x72, 0x71,
+ 0x75, 0x6f, 0x69, 0x73, 0x65, 0x3a, 0x31, 0x31, 0x35, 0x32, 0x39, 0x39, 0x36, 0x36, 0x2c, 0x70,
+ 0x61, 0x6c, 0x65, 0x76, 0x69, 0x6f, 0x6c, 0x65, 0x74, 0x72, 0x65, 0x64, 0x3a, 0x31, 0x34, 0x33,
+ 0x38, 0x31, 0x32, 0x30, 0x33, 0x2c, 0x70, 0x61, 0x70, 0x61, 0x79, 0x61, 0x77, 0x68, 0x69, 0x70,
+ 0x3a, 0x31, 0x36, 0x37, 0x37, 0x33, 0x30, 0x37, 0x37, 0x2c, 0x70, 0x65, 0x61, 0x63, 0x68, 0x70,
+ 0x75, 0x66, 0x66, 0x3a, 0x31, 0x36, 0x37, 0x36, 0x37, 0x36, 0x37, 0x33, 0x2c, 0x70, 0x65, 0x72,
+ 0x75, 0x3a, 0x31, 0x33, 0x34, 0x36, 0x38, 0x39, 0x39, 0x31, 0x2c, 0x70, 0x69, 0x6e, 0x6b, 0x3a,
+ 0x31, 0x36, 0x37, 0x36, 0x31, 0x30, 0x33, 0x35, 0x2c, 0x70, 0x6c, 0x75, 0x6d, 0x3a, 0x31, 0x34,
+ 0x35, 0x32, 0x34, 0x36, 0x33, 0x37, 0x2c, 0x70, 0x6f, 0x77, 0x64, 0x65, 0x72, 0x62, 0x6c, 0x75,
+ 0x65, 0x3a, 0x31, 0x31, 0x35, 0x39, 0x31, 0x39, 0x31, 0x30, 0x2c, 0x70, 0x75, 0x72, 0x70, 0x6c,
+ 0x65, 0x3a, 0x38, 0x33, 0x38, 0x38, 0x37, 0x33, 0x36, 0x2c, 0x72, 0x65, 0x62, 0x65, 0x63, 0x63,
+ 0x61, 0x70, 0x75, 0x72, 0x70, 0x6c, 0x65, 0x3a, 0x36, 0x36, 0x39, 0x37, 0x38, 0x38, 0x31, 0x2c,
+ 0x72, 0x65, 0x64, 0x3a, 0x31, 0x36, 0x37, 0x31, 0x31, 0x36, 0x38, 0x30, 0x2c, 0x72, 0x6f, 0x73,
+ 0x79, 0x62, 0x72, 0x6f, 0x77, 0x6e, 0x3a, 0x31, 0x32, 0x33, 0x35, 0x37, 0x35, 0x31, 0x39, 0x2c,
+ 0x72, 0x6f, 0x79, 0x61, 0x6c, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x34, 0x32, 0x38, 0x36, 0x39, 0x34,
+ 0x35, 0x2c, 0x73, 0x61, 0x64, 0x64, 0x6c, 0x65, 0x62, 0x72, 0x6f, 0x77, 0x6e, 0x3a, 0x39, 0x31,
+ 0x32, 0x37, 0x31, 0x38, 0x37, 0x2c, 0x73, 0x61, 0x6c, 0x6d, 0x6f, 0x6e, 0x3a, 0x31, 0x36, 0x34,
+ 0x31, 0x36, 0x38, 0x38, 0x32, 0x2c, 0x73, 0x61, 0x6e, 0x64, 0x79, 0x62, 0x72, 0x6f, 0x77, 0x6e,
+ 0x3a, 0x31, 0x36, 0x30, 0x33, 0x32, 0x38, 0x36, 0x34, 0x2c, 0x73, 0x65, 0x61, 0x67, 0x72, 0x65,
+ 0x65, 0x6e, 0x3a, 0x33, 0x30, 0x35, 0x30, 0x33, 0x32, 0x37, 0x2c, 0x73, 0x65, 0x61, 0x73, 0x68,
+ 0x65, 0x6c, 0x6c, 0x3a, 0x31, 0x36, 0x37, 0x37, 0x34, 0x36, 0x33, 0x38, 0x2c, 0x73, 0x69, 0x65,
+ 0x6e, 0x6e, 0x61, 0x3a, 0x31, 0x30, 0x35, 0x30, 0x36, 0x37, 0x39, 0x37, 0x2c, 0x73, 0x69, 0x6c,
+ 0x76, 0x65, 0x72, 0x3a, 0x31, 0x32, 0x36, 0x33, 0x32, 0x32, 0x35, 0x36, 0x2c, 0x73, 0x6b, 0x79,
+ 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x38, 0x39, 0x30, 0x30, 0x33, 0x33, 0x31, 0x2c, 0x73, 0x6c, 0x61,
+ 0x74, 0x65, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x36, 0x39, 0x37, 0x30, 0x30, 0x36, 0x31, 0x2c, 0x73,
+ 0x6c, 0x61, 0x74, 0x65, 0x67, 0x72, 0x61, 0x79, 0x3a, 0x37, 0x33, 0x37, 0x32, 0x39, 0x34, 0x34,
+ 0x2c, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x67, 0x72, 0x65, 0x79, 0x3a, 0x37, 0x33, 0x37, 0x32, 0x39,
+ 0x34, 0x34, 0x2c, 0x73, 0x6e, 0x6f, 0x77, 0x3a, 0x31, 0x36, 0x37, 0x37, 0x35, 0x39, 0x33, 0x30,
+ 0x2c, 0x73, 0x70, 0x72, 0x69, 0x6e, 0x67, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x36, 0x35, 0x34,
+ 0x30, 0x37, 0x2c, 0x73, 0x74, 0x65, 0x65, 0x6c, 0x62, 0x6c, 0x75, 0x65, 0x3a, 0x34, 0x36, 0x32,
+ 0x30, 0x39, 0x38, 0x30, 0x2c, 0x74, 0x61, 0x6e, 0x3a, 0x31, 0x33, 0x38, 0x30, 0x38, 0x37, 0x38,
+ 0x30, 0x2c, 0x74, 0x65, 0x61, 0x6c, 0x3a, 0x33, 0x32, 0x38, 0x39, 0x36, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x74, 0x6c, 0x65, 0x3a, 0x31, 0x34, 0x32, 0x30, 0x34, 0x38, 0x38, 0x38, 0x2c, 0x74, 0x6f,
+ 0x6d, 0x61, 0x74, 0x6f, 0x3a, 0x31, 0x36, 0x37, 0x33, 0x37, 0x30, 0x39, 0x35, 0x2c, 0x74, 0x75,
+ 0x72, 0x71, 0x75, 0x6f, 0x69, 0x73, 0x65, 0x3a, 0x34, 0x32, 0x35, 0x31, 0x38, 0x35, 0x36, 0x2c,
+ 0x76, 0x69, 0x6f, 0x6c, 0x65, 0x74, 0x3a, 0x31, 0x35, 0x36, 0x33, 0x31, 0x30, 0x38, 0x36, 0x2c,
+ 0x77, 0x68, 0x65, 0x61, 0x74, 0x3a, 0x31, 0x36, 0x31, 0x31, 0x33, 0x33, 0x33, 0x31, 0x2c, 0x77,
+ 0x68, 0x69, 0x74, 0x65, 0x3a, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x35, 0x2c, 0x77, 0x68,
+ 0x69, 0x74, 0x65, 0x73, 0x6d, 0x6f, 0x6b, 0x65, 0x3a, 0x31, 0x36, 0x31, 0x31, 0x39, 0x32, 0x38,
+ 0x35, 0x2c, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x3a, 0x31, 0x36, 0x37, 0x37, 0x36, 0x39, 0x36,
+ 0x30, 0x2c, 0x79, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x67, 0x72, 0x65, 0x65, 0x6e, 0x3a, 0x31, 0x30,
+ 0x31, 0x34, 0x35, 0x30, 0x37, 0x34, 0x7d, 0x29, 0x3b, 0x72, 0x6f, 0x2e, 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 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x61, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x28, 0x65, 0x3d, 0x6e, 0x29, 0x3f, 0x72, 0x3a,
+ 0x75, 0x28, 0x6e, 0x29, 0x29, 0x3a, 0x65, 0x7d, 0x2c, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x65, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x28, 0x6e, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x54, 0x65, 0x78, 0x74, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x75, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x65, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x28, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x54, 0x65, 0x78, 0x74, 0x2c, 0x6e, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x61, 0x29, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x6e, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x28, 0x6e, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x6e, 0x29, 0x3f,
+ 0x27, 0x22, 0x27, 0x2b, 0x6e, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x2f, 0x5c,
+ 0x22, 0x2f, 0x67, 0x2c, 0x27, 0x22, 0x22, 0x27, 0x29, 0x2b, 0x27, 0x22, 0x27, 0x3a, 0x6e, 0x7d,
+ 0x76, 0x61, 0x72, 0x20, 0x6f, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70,
+ 0x28, 0x27, 0x5b, 0x22, 0x27, 0x2b, 0x6e, 0x2b, 0x22, 0x5c, 0x6e, 0x5d, 0x22, 0x29, 0x2c, 0x6c,
+ 0x3d, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x30, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x72, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x70, 0x61, 0x72,
+ 0x73, 0x65, 0x52, 0x6f, 0x77, 0x73, 0x28, 0x6e, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x72, 0x29, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x72, 0x28, 0x6e, 0x2c, 0x65, 0x2d, 0x31, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x75, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x22,
+ 0x64, 0x22, 0x2c, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x7b, 0x22, 0x2b, 0x6e, 0x2e,
+ 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x2e, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x69, 0x66, 0x79, 0x28, 0x6e, 0x29, 0x2b, 0x22, 0x3a, 0x20, 0x64, 0x5b,
+ 0x22, 0x2b, 0x74, 0x2b, 0x22, 0x5d, 0x22, 0x7d, 0x29, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22,
+ 0x2c, 0x22, 0x29, 0x2b, 0x22, 0x7d, 0x22, 0x29, 0x3b, 0x72, 0x3d, 0x74, 0x3f, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x74, 0x28, 0x75, 0x28, 0x6e, 0x29, 0x2c, 0x65, 0x29, 0x7d, 0x3a, 0x75, 0x7d, 0x29,
+ 0x7d, 0x2c, 0x65, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x52, 0x6f, 0x77, 0x73, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x3e, 0x3d, 0x63,
+ 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3b, 0x69, 0x66, 0x28, 0x75, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x3d, 0x21, 0x31, 0x2c, 0x69, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x74, 0x3d, 0x73, 0x3b, 0x69, 0x66, 0x28, 0x33, 0x34, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x63,
+ 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x74, 0x29, 0x29, 0x7b, 0x66, 0x6f,
+ 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x74, 0x3b, 0x65, 0x2b, 0x2b, 0x3c, 0x63, 0x3b,
+ 0x29, 0x69, 0x66, 0x28, 0x33, 0x34, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x43,
+ 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x65, 0x29, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x33, 0x34, 0x21,
+ 0x3d, 0x3d, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x65,
+ 0x2b, 0x31, 0x29, 0x29, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x2b, 0x2b, 0x65, 0x7d, 0x73, 0x3d,
+ 0x65, 0x2b, 0x32, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x72,
+ 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x65, 0x2b, 0x31, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x31, 0x33, 0x3d, 0x3d, 0x3d, 0x72, 0x3f, 0x28, 0x75, 0x3d, 0x21, 0x30, 0x2c,
+ 0x31, 0x30, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41,
+ 0x74, 0x28, 0x65, 0x2b, 0x32, 0x29, 0x26, 0x26, 0x2b, 0x2b, 0x73, 0x29, 0x3a, 0x31, 0x30, 0x3d,
+ 0x3d, 0x3d, 0x72, 0x26, 0x26, 0x28, 0x75, 0x3d, 0x21, 0x30, 0x29, 0x2c, 0x6e, 0x2e, 0x73, 0x6c,
+ 0x69, 0x63, 0x65, 0x28, 0x74, 0x2b, 0x31, 0x2c, 0x65, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61,
+ 0x63, 0x65, 0x28, 0x2f, 0x22, 0x22, 0x2f, 0x67, 0x2c, 0x27, 0x22, 0x27, 0x29, 0x7d, 0x66, 0x6f,
+ 0x72, 0x28, 0x3b, 0x63, 0x3e, 0x73, 0x3b, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x6e,
+ 0x2e, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x41, 0x74, 0x28, 0x73, 0x2b, 0x2b, 0x29,
+ 0x2c, 0x6f, 0x3d, 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, 0x29, 0x21, 0x3d, 0x3d, 0x61,
+ 0x3b, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x68, 0x3d, 0x5b, 0x5d, 0x3b,
+ 0x72, 0x21, 0x3d, 0x3d, 0x69, 0x26, 0x26, 0x72, 0x21, 0x3d, 0x3d, 0x61, 0x3b, 0x29, 0x68, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x72, 0x29, 0x2c, 0x72, 0x3d, 0x65, 0x28, 0x29, 0x3b, 0x74, 0x26,
+ 0x26, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x28, 0x68, 0x3d, 0x74, 0x28, 0x68, 0x2c, 0x66, 0x2b,
+ 0x2b, 0x29, 0x29, 0x7c, 0x7c, 0x6f, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x68, 0x29, 0x7d, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x7d, 0x2c, 0x65, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61,
+ 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x74,
+ 0x5b, 0x30, 0x5d, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x52, 0x6f, 0x77, 0x73, 0x28, 0x74, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x72, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x6d, 0x2c, 0x75, 0x3d, 0x5b, 0x5d, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61,
+ 0x72, 0x20, 0x74, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x29, 0x72, 0x2e, 0x68, 0x61, 0x73, 0x28, 0x74,
+ 0x29, 0x7c, 0x7c, 0x75, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x72, 0x2e, 0x61, 0x64, 0x64, 0x28,
+ 0x74, 0x29, 0x29, 0x7d, 0x29, 0x2c, 0x5b, 0x75, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x61, 0x29, 0x2e,
+ 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x6e, 0x29, 0x5d, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28,
+ 0x74, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x61, 0x28, 0x74, 0x5b, 0x6e, 0x5d, 0x29, 0x7d, 0x29, 0x2e, 0x6a, 0x6f, 0x69, 0x6e,
+ 0x28, 0x6e, 0x29, 0x7d, 0x29, 0x29, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x5c, 0x6e, 0x22,
+ 0x29, 0x7d, 0x2c, 0x65, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x6f, 0x77, 0x73, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x69, 0x29, 0x2e, 0x6a, 0x6f, 0x69, 0x6e,
+ 0x28, 0x22, 0x5c, 0x6e, 0x22, 0x29, 0x7d, 0x2c, 0x65, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x63, 0x73,
+ 0x76, 0x3d, 0x6f, 0x61, 0x2e, 0x64, 0x73, 0x76, 0x28, 0x22, 0x2c, 0x22, 0x2c, 0x22, 0x74, 0x65,
+ 0x78, 0x74, 0x2f, 0x63, 0x73, 0x76, 0x22, 0x29, 0x2c, 0x6f, 0x61, 0x2e, 0x74, 0x73, 0x76, 0x3d,
+ 0x6f, 0x61, 0x2e, 0x64, 0x73, 0x76, 0x28, 0x22, 0x09, 0x22, 0x2c, 0x22, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x74, 0x61, 0x62, 0x2d, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x76,
+ 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x6f, 0x2c, 0x69,
+ 0x6f, 0x2c, 0x61, 0x6f, 0x2c, 0x6f, 0x6f, 0x2c, 0x6c, 0x6f, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b,
+ 0x78, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x41,
+ 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x22, 0x29, 0x5d,
+ 0x7c, 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x73, 0x65,
+ 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x6e, 0x2c, 0x31, 0x37, 0x29, 0x7d, 0x3b,
+ 0x6f, 0x61, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x71, 0x6e, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d, 0x2c, 0x6f, 0x61,
+ 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x52, 0x6e, 0x28, 0x29, 0x2c, 0x44, 0x6e, 0x28,
+ 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x3f, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x6e, 0x2a,
+ 0x28, 0x74, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x31, 0x30, 0x2c, 0x74,
+ 0x29, 0x29, 0x29, 0x2f, 0x74, 0x3a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 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f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e,
+ 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x31, 0x36, 0x29, 0x2e, 0x74, 0x6f, 0x55,
+ 0x70, 0x70, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x7d, 0x2c, 0x67, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x74, 0x6f, 0x50, 0x72, 0x65, 0x63, 0x69, 0x73, 0x69, 0x6f, 0x6e,
+ 0x28, 0x74, 0x29, 0x7d, 0x2c, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x74, 0x6f,
+ 0x45, 0x78, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x28, 0x74, 0x29, 0x7d, 0x2c,
+ 0x66, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78, 0x65, 0x64,
+ 0x28, 0x74, 0x29, 0x7d, 0x2c, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x6e, 0x3d, 0x6f, 0x61,
+ 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x6e, 0x2c, 0x50, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29,
+ 0x29, 0x29, 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78, 0x65, 0x64, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x6d, 0x61, 0x78, 0x28, 0x30, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x32,
+ 0x30, 0x2c, 0x50, 0x6e, 0x28, 0x6e, 0x2a, 0x28, 0x31, 0x2b, 0x31, 0x65, 0x2d, 0x31, 0x35, 0x29,
+ 0x2c, 0x74, 0x29, 0x29, 0x29, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x68, 0x6f, 0x3d, 0x6f, 0x61, 0x2e,
+ 0x74, 0x69, 0x6d, 0x65, 0x3d, 0x7b, 0x7d, 0x2c, 0x67, 0x6f, 0x3d, 0x44, 0x61, 0x74, 0x65, 0x3b,
+ 0x48, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x7b, 0x67, 0x65,
+ 0x74, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2e, 0x67,
+ 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x2c, 0x67, 0x65, 0x74,
+ 0x44, 0x61, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2e, 0x67, 0x65, 0x74,
+ 0x55, 0x54, 0x43, 0x44, 0x61, 0x79, 0x28, 0x29, 0x7d, 0x2c, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c,
+ 0x6c, 0x59, 0x65, 0x61, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2e, 0x67,
+ 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x7d,
+ 0x2c, 0x67, 0x65, 0x74, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x28, 0x29,
+ 0x7d, 0x2c, 0x67, 0x65, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,
+ 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54,
+ 0x43, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x7d,
+ 0x2c, 0x67, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x69, 0x6e, 0x75, 0x74,
+ 0x65, 0x73, 0x28, 0x29, 0x7d, 0x2c, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x28, 0x29, 0x7d, 0x2c, 0x67, 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64,
+ 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54,
+ 0x43, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x7d, 0x2c, 0x67, 0x65, 0x74, 0x54,
+ 0x69, 0x6d, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2e, 0x67, 0x65, 0x74,
+ 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x7d, 0x2c, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x7a,
+ 0x6f, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x30, 0x7d, 0x2c, 0x76,
+ 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2e,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x28, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x44, 0x61,
+ 0x74, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x70, 0x6f,
+ 0x2e, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c,
+ 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x44, 0x61, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x70, 0x6f, 0x2e, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43,
+ 0x44, 0x61, 0x79, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x74,
+ 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x70, 0x6f, 0x2e, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c,
+ 0x6c, 0x59, 0x65, 0x61, 0x72, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d, 0x2c, 0x73,
+ 0x65, 0x74, 0x48, 0x6f, 0x75, 0x72, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x70, 0x6f, 0x2e, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x48, 0x6f, 0x75, 0x72,
+ 0x73, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2c, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x4d, 0x69,
+ 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x70, 0x6f, 0x2e, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d,
+ 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x6c,
+ 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x70, 0x6f, 0x2e, 0x73, 0x65,
+ 0x74, 0x55, 0x54, 0x43, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x6c,
+ 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x70, 0x6f, 0x2e, 0x73, 0x65, 0x74, 0x55,
+ 0x54, 0x43, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d,
+ 0x2c, 0x73, 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x70, 0x6f, 0x2e, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43,
+ 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d,
+ 0x2c, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x70, 0x6f, 0x2e, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x2c, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x70, 0x6f, 0x3d,
+ 0x44, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3b, 0x68,
+ 0x6f, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x3d, 0x4f, 0x6e, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x3d, 0x68,
+ 0x6f, 0x2e, 0x64, 0x61, 0x79, 0x28, 0x6e, 0x29, 0x2c, 0x6e, 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x28, 0x30, 0x2c, 0x31, 0x29, 0x2c, 0x6e, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x6e, 0x2e, 0x73, 0x65, 0x74, 0x46,
+ 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c,
+ 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2b, 0x74, 0x29, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x2e, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x7d, 0x29,
+ 0x2c, 0x68, 0x6f, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x73, 0x3d, 0x68, 0x6f, 0x2e, 0x79, 0x65, 0x61,
+ 0x72, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x68, 0x6f, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x73,
+ 0x2e, 0x75, 0x74, 0x63, 0x3d, 0x68, 0x6f, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x2e, 0x75, 0x74, 0x63,
+ 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x68, 0x6f, 0x2e, 0x64, 0x61, 0x79, 0x3d, 0x4f, 0x6e,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x74, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x67, 0x6f, 0x28, 0x32, 0x65, 0x33, 0x2c, 0x30, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x73, 0x65, 0x74, 0x46, 0x75, 0x6c,
+ 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59,
+ 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68,
+ 0x28, 0x29, 0x2c, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x29, 0x2c,
+ 0x74, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29,
+ 0x7b, 0x6e, 0x2e, 0x73, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74,
+ 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x2b, 0x74, 0x29, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e,
+ 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x2d, 0x31, 0x7d, 0x29, 0x2c, 0x68, 0x6f,
+ 0x2e, 0x64, 0x61, 0x79, 0x73, 0x3d, 0x68, 0x6f, 0x2e, 0x64, 0x61, 0x79, 0x2e, 0x72, 0x61, 0x6e,
+ 0x67, 0x65, 0x2c, 0x68, 0x6f, 0x2e, 0x64, 0x61, 0x79, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x3d, 0x68,
+ 0x6f, 0x2e, 0x64, 0x61, 0x79, 0x2e, 0x75, 0x74, 0x63, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c,
+ 0x68, 0x6f, 0x2e, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x68,
+ 0x6f, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x6e, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x28, 0x6e, 0x2d, 0x74,
+ 0x2d, 0x36, 0x65, 0x34, 0x2a, 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x7a,
+ 0x6f, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x2d, 0x74, 0x2e, 0x67, 0x65,
+ 0x74, 0x54, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28,
+ 0x29, 0x29, 0x29, 0x2f, 0x38, 0x36, 0x34, 0x65, 0x35, 0x29, 0x7d, 0x2c, 0x5b, 0x22, 0x73, 0x75,
+ 0x6e, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x6d, 0x6f, 0x6e, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22,
+ 0x74, 0x75, 0x65, 0x73, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x77, 0x65, 0x64, 0x6e, 0x65, 0x73,
+ 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x74, 0x68, 0x75, 0x72, 0x73, 0x64, 0x61, 0x79, 0x22, 0x2c,
+ 0x22, 0x66, 0x72, 0x69, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x73, 0x61, 0x74, 0x75, 0x72, 0x64,
+ 0x61, 0x79, 0x22, 0x5d, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x74, 0x3d, 0x37, 0x2d, 0x74,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x68, 0x6f, 0x5b, 0x6e, 0x5d, 0x3d, 0x4f, 0x6e, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x28, 0x6e, 0x3d, 0x68, 0x6f, 0x2e, 0x64, 0x61, 0x79, 0x28, 0x6e, 0x29, 0x29, 0x2e,
+ 0x73, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74,
+ 0x65, 0x28, 0x29, 0x2d, 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x79, 0x28, 0x29, 0x2b,
+ 0x74, 0x29, 0x25, 0x37, 0x29, 0x2c, 0x6e, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x6e, 0x2e, 0x73, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65,
+ 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x2b, 0x37, 0x2a, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x74, 0x29, 0x29, 0x7d, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65,
+ 0x3d, 0x68, 0x6f, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x6e, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x44,
+ 0x61, 0x79, 0x28, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x28, 0x68, 0x6f, 0x2e, 0x64, 0x61, 0x79, 0x4f, 0x66,
+ 0x59, 0x65, 0x61, 0x72, 0x28, 0x6e, 0x29, 0x2b, 0x28, 0x65, 0x2b, 0x74, 0x29, 0x25, 0x37, 0x29,
+ 0x2f, 0x37, 0x29, 0x2d, 0x28, 0x65, 0x21, 0x3d, 0x3d, 0x74, 0x29, 0x7d, 0x29, 0x3b, 0x68, 0x6f,
+ 0x5b, 0x6e, 0x2b, 0x22, 0x73, 0x22, 0x5d, 0x3d, 0x65, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c,
+ 0x68, 0x6f, 0x5b, 0x6e, 0x2b, 0x22, 0x73, 0x22, 0x5d, 0x2e, 0x75, 0x74, 0x63, 0x3d, 0x65, 0x2e,
+ 0x75, 0x74, 0x63, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x68, 0x6f, 0x5b, 0x6e, 0x2b, 0x22,
+ 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x22, 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x68, 0x6f, 0x2e, 0x79, 0x65,
+ 0x61, 0x72, 0x28, 0x6e, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x79, 0x28, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72,
+ 0x28, 0x28, 0x68, 0x6f, 0x2e, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x28, 0x6e,
+ 0x29, 0x2b, 0x28, 0x65, 0x2b, 0x74, 0x29, 0x25, 0x37, 0x29, 0x2f, 0x37, 0x29, 0x7d, 0x7d, 0x29,
+ 0x2c, 0x68, 0x6f, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x3d, 0x68, 0x6f, 0x2e, 0x73, 0x75, 0x6e, 0x64,
+ 0x61, 0x79, 0x2c, 0x68, 0x6f, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x73, 0x3d, 0x68, 0x6f, 0x2e, 0x73,
+ 0x75, 0x6e, 0x64, 0x61, 0x79, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x68, 0x6f, 0x2e, 0x77,
+ 0x65, 0x65, 0x6b, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x3d, 0x68, 0x6f, 0x2e, 0x73, 0x75, 0x6e, 0x64,
+ 0x61, 0x79, 0x2e, 0x75, 0x74, 0x63, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x68, 0x6f, 0x2e,
+ 0x77, 0x65, 0x65, 0x6b, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x3d, 0x68, 0x6f, 0x2e, 0x73, 0x75,
+ 0x6e, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x76,
+ 0x6f, 0x3d, 0x7b, 0x22, 0x2d, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x5f, 0x3a, 0x22, 0x20, 0x22, 0x2c,
+ 0x30, 0x3a, 0x22, 0x30, 0x22, 0x7d, 0x2c, 0x6d, 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58, 0x20,
+ 0x25, 0x59, 0x22, 0x2c, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x22, 0x25, 0x6d, 0x2f, 0x25, 0x64, 0x2f,
+ 0x25, 0x59, 0x22, 0x2c, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x22, 0x25, 0x48, 0x3a, 0x25, 0x4d, 0x3a,
+ 0x25, 0x53, 0x22, 0x2c, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x73, 0x3a, 0x5b, 0x22, 0x41, 0x4d,
+ 0x22, 0x2c, 0x22, 0x50, 0x4d, 0x22, 0x5d, 0x2c, 0x64, 0x61, 0x79, 0x73, 0x3a, 0x5b, 0x22, 0x53,
+ 0x75, 0x6e, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x4d, 0x6f, 0x6e, 0x64, 0x61, 0x79, 0x22, 0x2c,
+ 0x22, 0x54, 0x75, 0x65, 0x73, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x57, 0x65, 0x64, 0x6e, 0x65,
+ 0x73, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x54, 0x68, 0x75, 0x72, 0x73, 0x64, 0x61, 0x79, 0x22,
+ 0x2c, 0x22, 0x46, 0x72, 0x69, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x53, 0x61, 0x74, 0x75, 0x72,
+ 0x64, 0x61, 0x79, 0x22, 0x5d, 0x2c, 0x0a, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x44, 0x61, 0x79, 0x73,
+ 0x3a, 0x5b, 0x22, 0x53, 0x75, 0x6e, 0x22, 0x2c, 0x22, 0x4d, 0x6f, 0x6e, 0x22, 0x2c, 0x22, 0x54,
+ 0x75, 0x65, 0x22, 0x2c, 0x22, 0x57, 0x65, 0x64, 0x22, 0x2c, 0x22, 0x54, 0x68, 0x75, 0x22, 0x2c,
+ 0x22, 0x46, 0x72, 0x69, 0x22, 0x2c, 0x22, 0x53, 0x61, 0x74, 0x22, 0x5d, 0x2c, 0x6d, 0x6f, 0x6e,
+ 0x74, 0x68, 0x73, 0x3a, 0x5b, 0x22, 0x4a, 0x61, 0x6e, 0x75, 0x61, 0x72, 0x79, 0x22, 0x2c, 0x22,
+ 0x46, 0x65, 0x62, 0x72, 0x75, 0x61, 0x72, 0x79, 0x22, 0x2c, 0x22, 0x4d, 0x61, 0x72, 0x63, 0x68,
+ 0x22, 0x2c, 0x22, 0x41, 0x70, 0x72, 0x69, 0x6c, 0x22, 0x2c, 0x22, 0x4d, 0x61, 0x79, 0x22, 0x2c,
+ 0x22, 0x4a, 0x75, 0x6e, 0x65, 0x22, 0x2c, 0x22, 0x4a, 0x75, 0x6c, 0x79, 0x22, 0x2c, 0x22, 0x41,
+ 0x75, 0x67, 0x75, 0x73, 0x74, 0x22, 0x2c, 0x22, 0x53, 0x65, 0x70, 0x74, 0x65, 0x6d, 0x62, 0x65,
+ 0x72, 0x22, 0x2c, 0x22, 0x4f, 0x63, 0x74, 0x6f, 0x62, 0x65, 0x72, 0x22, 0x2c, 0x22, 0x4e, 0x6f,
+ 0x76, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x2c, 0x22, 0x44, 0x65, 0x63, 0x65, 0x6d, 0x62, 0x65,
+ 0x72, 0x22, 0x5d, 0x2c, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x3a,
+ 0x5b, 0x22, 0x4a, 0x61, 0x6e, 0x22, 0x2c, 0x22, 0x46, 0x65, 0x62, 0x22, 0x2c, 0x22, 0x4d, 0x61,
+ 0x72, 0x22, 0x2c, 0x22, 0x41, 0x70, 0x72, 0x22, 0x2c, 0x22, 0x4d, 0x61, 0x79, 0x22, 0x2c, 0x22,
+ 0x4a, 0x75, 0x6e, 0x22, 0x2c, 0x22, 0x4a, 0x75, 0x6c, 0x22, 0x2c, 0x22, 0x41, 0x75, 0x67, 0x22,
+ 0x2c, 0x22, 0x53, 0x65, 0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, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x3d, 0x30, 0x7d, 0x2c, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x7d, 0x7d,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x78, 0x6f, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x74, 0x3b, 0x6f,
+ 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x6e, 0x26, 0x26, 0x62, 0x6f,
+ 0x2e, 0x68, 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28,
+ 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x29, 0x3f, 0x62, 0x6f, 0x5b, 0x6e, 0x2e, 0x74, 0x79, 0x70,
+ 0x65, 0x5d, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x3a, 0x68, 0x74, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7d,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x6f, 0x3d, 0x7b, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x68,
+ 0x74, 0x28, 0x6e, 0x2e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2c, 0x69, 0x3d, 0x5b, 0x75, 0x5b, 0x31, 0x5d, 0x2c,
+ 0x2d, 0x75, 0x5b, 0x30, 0x5d, 0x2c, 0x30, 0x5d, 0x2c, 0x61, 0x3d, 0x79, 0x74, 0x28, 0x69, 0x2c,
+ 0x75, 0x29, 0x3b, 0x62, 0x74, 0x28, 0x61, 0x29, 0x2c, 0x61, 0x3d, 0x5f, 0x74, 0x28, 0x61, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x3d, 0x74, 0x2d, 0x70, 0x2c, 0x63, 0x3d, 0x6c, 0x3e, 0x30,
+ 0x3f, 0x31, 0x3a, 0x2d, 0x31, 0x2c, 0x76, 0x3d, 0x61, 0x5b, 0x30, 0x5d, 0x2a, 0x49, 0x61, 0x2a,
+ 0x63, 0x2c, 0x64, 0x3d, 0x4d, 0x61, 0x28, 0x6c, 0x29, 0x3e, 0x31, 0x38, 0x30, 0x3b, 0x69, 0x66,
+ 0x28, 0x64, 0x5e, 0x28, 0x76, 0x3e, 0x63, 0x2a, 0x70, 0x26, 0x26, 0x63, 0x2a, 0x74, 0x3e, 0x76,
+ 0x29, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x79, 0x3d, 0x61, 0x5b, 0x31, 0x5d, 0x2a, 0x49, 0x61,
+ 0x3b, 0x79, 0x3e, 0x67, 0x26, 0x26, 0x28, 0x67, 0x3d, 0x79, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65,
+ 0x20, 0x69, 0x66, 0x28, 0x76, 0x3d, 0x28, 0x76, 0x2b, 0x33, 0x36, 0x30, 0x29, 0x25, 0x33, 0x36,
+ 0x30, 0x2d, 0x31, 0x38, 0x30, 0x2c, 0x64, 0x5e, 0x28, 0x76, 0x3e, 0x63, 0x2a, 0x70, 0x26, 0x26,
+ 0x63, 0x2a, 0x74, 0x3e, 0x76, 0x29, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x79, 0x3d, 0x2d, 0x61,
+ 0x5b, 0x31, 0x5d, 0x2a, 0x49, 0x61, 0x3b, 0x66, 0x3e, 0x79, 0x26, 0x26, 0x28, 0x66, 0x3d, 0x79,
+ 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x66, 0x3e, 0x65, 0x26, 0x26, 0x28, 0x66, 0x3d, 0x65,
+ 0x29, 0x2c, 0x65, 0x3e, 0x67, 0x26, 0x26, 0x28, 0x67, 0x3d, 0x65, 0x29, 0x3b, 0x64, 0x3f, 0x70,
+ 0x3e, 0x74, 0x3f, 0x6f, 0x28, 0x73, 0x2c, 0x74, 0x29, 0x3e, 0x6f, 0x28, 0x73, 0x2c, 0x68, 0x29,
+ 0x26, 0x26, 0x28, 0x68, 0x3d, 0x74, 0x29, 0x3a, 0x6f, 0x28, 0x74, 0x2c, 0x68, 0x29, 0x3e, 0x6f,
+ 0x28, 0x73, 0x2c, 0x68, 0x29, 0x26, 0x26, 0x28, 0x73, 0x3d, 0x74, 0x29, 0x3a, 0x68, 0x3e, 0x3d,
+ 0x73, 0x3f, 0x28, 0x73, 0x3e, 0x74, 0x26, 0x26, 0x28, 0x73, 0x3d, 0x74, 0x29, 0x2c, 0x74, 0x3e,
+ 0x68, 0x26, 0x26, 0x28, 0x68, 0x3d, 0x74, 0x29, 0x29, 0x3a, 0x74, 0x3e, 0x70, 0x3f, 0x6f, 0x28,
+ 0x73, 0x2c, 0x74, 0x29, 0x3e, 0x6f, 0x28, 0x73, 0x2c, 0x68, 0x29, 0x26, 0x26, 0x28, 0x68, 0x3d,
+ 0x74, 0x29, 0x3a, 0x6f, 0x28, 0x74, 0x2c, 0x68, 0x29, 0x3e, 0x6f, 0x28, 0x73, 0x2c, 0x68, 0x29,
+ 0x26, 0x26, 0x28, 0x73, 0x3d, 0x74, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x6e, 0x28, 0x74,
+ 0x2c, 0x65, 0x29, 0x3b, 0x6d, 0x3d, 0x72, 0x2c, 0x70, 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 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x28, 0x5b, 0x5b, 0x30, 0x2c, 0x30, 0x5d, 0x2c, 0x5b,
+ 0x39, 0x36, 0x30, 0x2c, 0x35, 0x30, 0x30, 0x5d, 0x5d, 0x29, 0x7d, 0x2c, 0x28, 0x6f, 0x61, 0x2e,
+ 0x67, 0x65, 0x6f, 0x2e, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x41, 0x72,
+ 0x65, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x56, 0x74, 0x28, 0x58, 0x74, 0x29, 0x7d, 0x29, 0x2e, 0x72, 0x61,
+ 0x77, 0x3d, 0x58, 0x74, 0x2c, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x61, 0x6c, 0x62, 0x65,
+ 0x72, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x63, 0x6f, 0x6e, 0x69,
+ 0x63, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x61, 0x28, 0x29, 0x2e, 0x72, 0x6f, 0x74,
+ 0x61, 0x74, 0x65, 0x28, 0x5b, 0x39, 0x36, 0x2c, 0x30, 0x5d, 0x29, 0x2e, 0x63, 0x65, 0x6e, 0x74,
+ 0x65, 0x72, 0x28, 0x5b, 0x2d, 0x2e, 0x36, 0x2c, 0x33, 0x38, 0x2e, 0x37, 0x5d, 0x29, 0x2e, 0x70,
+ 0x61, 0x72, 0x61,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6d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x69, 0x2e, 0x73,
+ 0x74, 0x72, 0x65, 0x61, 0x6d, 0x28, 0x6e, 0x29, 0x2c, 0x65, 0x3d, 0x61, 0x2e, 0x73, 0x74, 0x72,
+ 0x65, 0x61, 0x6d, 0x28, 0x6e, 0x29, 0x2c, 0x72, 0x3d, 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61,
+ 0x6d, 0x28, 0x6e, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x70, 0x6f, 0x69, 0x6e,
+ 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x75, 0x29, 0x7b,
+ 0x74, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x6e, 0x2c, 0x75, 0x29, 0x2c, 0x65, 0x2e, 0x70,
+ 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x6e, 0x2c, 0x75, 0x29, 0x2c, 0x72, 0x2e, 0x70, 0x6f, 0x69, 0x6e,
+ 0x74, 0x28, 0x6e, 0x2c, 0x75, 0x29, 0x7d, 0x2c, 0x73, 0x70, 0x68, 0x65, 0x72, 0x65, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x2e, 0x73, 0x70, 0x68, 0x65,
+ 0x72, 0x65, 0x28, 0x29, 0x2c, 0x65, 0x2e, 0x73, 0x70, 0x68, 0x65, 0x72, 0x65, 0x28, 0x29, 0x2c,
+ 0x72, 0x2e, 0x73, 0x70, 0x68, 0x65, 0x72, 0x65, 0x28, 0x29, 0x7d, 0x2c, 0x6c, 0x69, 0x6e, 0x65,
+ 0x53, 0x74, 0x61, 0x72, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x74, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29, 0x2c, 0x65,
+ 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29, 0x2c, 0x72, 0x2e, 0x6c,
+ 0x69, 0x6e, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29, 0x7d, 0x2c, 0x6c, 0x69, 0x6e, 0x65,
+ 0x45, 0x6e, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74,
+ 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x64, 0x28, 0x29, 0x2c, 0x65, 0x2e, 0x6c, 0x69, 0x6e,
+ 0x65, 0x45, 0x6e, 0x64, 0x28, 0x29, 0x2c, 0x72, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x45, 0x6e, 0x64,
+ 0x28, 0x29, 0x7d, 0x2c, 0x70, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x2e, 0x70, 0x6f,
+ 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29, 0x2c, 0x65, 0x2e, 0x70,
+ 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29, 0x2c, 0x72, 0x2e,
+ 0x70, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0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 0x28, 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3f, 0x28, 0x69, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x74, 0x29, 0x2c, 0x61, 0x2e,
+ 0x73, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x2e, 0x33, 0x35, 0x2a, 0x74, 0x29, 0x2c, 0x6f, 0x2e, 0x73,
+ 0x63, 0x61, 0x6c, 0x65, 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c,
+ 0x61, 0x74, 0x65, 0x28, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x28,
+ 0x29, 0x29, 0x29, 0x3a, 0x69, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x29, 0x7d, 0x2c, 0x6e,
+ 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x69, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0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, 0x3d, 0x47, 0x74, 0x2c, 0x42, 0x6f, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x53,
+ 0x74, 0x61, 0x72, 0x74, 0x3d, 0x4b, 0x74, 0x2c, 0x42, 0x6f, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x45,
+ 0x6e, 0x64, 0x3d, 0x51, 0x74, 0x7d, 0x7d, 0x3b, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x70,
+ 0x61, 0x74, 0x68, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x26, 0x26, 0x28, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x26, 0x26, 0x69, 0x2e,
+ 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x28, 0x2b, 0x6f, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x29, 0x29, 0x2c, 0x61, 0x26, 0x26, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64,
+ 0x7c, 0x7c, 0x28, 0x61, 0x3d, 0x75, 0x28, 0x69, 0x29, 0x29, 0x2c, 0x6f, 0x61, 0x2e, 0x67, 0x65,
+ 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x28, 0x6e, 0x2c, 0x61, 0x29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 0x26, 0x26, 0x69, 0x2e, 0x70,
+ 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x28, 0x6f, 0x29, 0x2c, 0x74, 0x28,
+ 0x29, 0x29, 0x3a, 0x72, 0x7d, 0x2c, 0x6e, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x61, 0x64,
+ 0x69, 0x75, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x6f, 0x3d, 0x22, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x3f,
+ 0x74, 0x3a, 0x28, 0x69, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73,
+ 0x28, 0x2b, 0x74, 0x29, 0x2c, 0x2b, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x6f, 0x7d, 0x2c, 0x6e,
+ 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6f, 0x61, 0x2e, 0x67,
+ 0x65, 0x6f, 0x2e, 0x61, 0x6c, 0x62, 0x65, 0x72, 0x73, 0x55, 0x73, 0x61, 0x28, 0x29, 0x29, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x7d, 0x2c, 0x6f,
+ 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20,
+ 0x75, 0x65, 0x28, 0x74, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x72, 0x20,
+ 0x69, 0x6e, 0x20, 0x6e, 0x29, 0x65, 0x5b, 0x72, 0x5d, 0x3d, 0x6e, 0x5b, 0x72, 0x5d, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x7d, 0x7d, 0x7d, 0x2c, 0x75, 0x65, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x7b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x28, 0x6e,
+ 0x2c, 0x74, 0x29, 0x7d, 0x2c, 0x73, 0x70, 0x68, 0x65, 0x72, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65,
+ 0x61, 0x6d, 0x2e, 0x73, 0x70, 0x68, 0x65, 0x72, 0x65, 0x28, 0x29, 0x7d, 0x2c, 0x6c, 0x69, 0x6e,
+ 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x6c, 0x69,
+ 0x6e, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29, 0x7d, 0x2c, 0x6c, 0x69, 0x6e, 0x65, 0x45,
+ 0x6e, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x45, 0x6e,
+ 0x64, 0x28, 0x29, 0x7d, 0x2c, 0x70, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72,
+ 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x70, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e,
+ 0x53, 0x74, 0x61, 0x72, 0x74, 0x28, 0x29, 0x7d, 0x2c, 0x70, 0x6f, 0x6c, 0x79, 0x67, 0x6f, 0x6e,
+ 0x45, 0x6e, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x70, 0x6f, 0x6c, 0x79, 0x67,
+ 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x28, 0x29, 0x7d, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f,
+ 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x61, 0x65, 0x2c, 0x6f,
+ 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x4d, 0x75, 0x74, 0x61, 0x74, 0x6f, 0x72, 0x3d, 0x6f, 0x65, 0x2c, 0x28, 0x6f, 0x61, 0x2e, 0x67,
+ 0x65, 0x6f, 0x2e, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x63, 0x74, 0x61, 0x6e, 0x67, 0x75, 0x6c,
+ 0x61, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x65, 0x28, 0x63, 0x65, 0x29, 0x7d, 0x29, 0x2e, 0x72, 0x61,
+ 0x77, 0x3d, 0x63, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d, 0x63, 0x65, 0x2c, 0x6f,
+ 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x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x74, 0x69, 0x63, 0x75,
+ 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x4c, 0x69, 0x6e,
+ 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x69, 0x6e,
+ 0x61, 0x74, 0x65, 0x73, 0x3a, 0x74, 0x28, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x74, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x61,
+ 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c,
+ 0x28, 0x69, 0x2f, 0x64, 0x29, 0x2a, 0x64, 0x2c, 0x75, 0x2c, 0x64, 0x29, 0x2e, 0x6d, 0x61, 0x70,
+ 0x28, 0x68, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x6f, 0x61, 0x2e, 0x72, 0x61,
+ 0x6e, 0x67, 0x65, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x28, 0x63, 0x2f,
+ 0x6d, 0x29, 0x2a, 0x6d, 0x2c, 0x6c, 0x2c, 0x6d, 0x29, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x67, 0x29,
+ 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x6f, 0x61, 0x2e, 0x72, 0x61, 0x6e, 0x67,
+ 0x65, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x28, 0x72, 0x2f, 0x70, 0x29,
+ 0x2a, 0x70, 0x2c, 0x65, 0x2c, 0x70, 0x29, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x4d, 0x61, 0x28, 0x6e, 0x25, 0x64, 0x29, 0x3e, 0x44, 0x61, 0x7d, 0x29, 0x2e, 0x6d,
+ 0x61, 0x70, 0x28, 0x73, 0x29, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x6f, 0x61,
+ 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c,
+ 0x28, 0x6f, 0x2f, 0x76, 0x29, 0x2a, 0x76, 0x2c, 0x61, 0x2c, 0x76, 0x29, 0x2e, 0x66, 0x69, 0x6c,
+ 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x28, 0x6e, 0x25, 0x6d, 0x29, 0x3e, 0x44,
+ 0x61, 0x7d, 0x29, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x29, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20,
+ 0x65, 0x2c, 0x72, 0x2c, 0x75, 0x2c, 0x69, 0x2c, 0x61, 0x2c, 0x6f, 0x2c, 0x6c, 0x2c, 0x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, 0x65, 0x73, 0x3a, 0x5b, 0x68, 0x28, 0x69, 0x29, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x67, 0x28, 0x6c, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65,
+ 0x28, 0x31, 0x29, 0x2c, 0x68, 0x28, 0x75, 0x29, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65,
+ 0x28, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x31, 0x29, 0x2c, 0x67, 0x28, 0x63, 0x29,
+ 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x28, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65,
+ 0x28, 0x31, 0x29, 0x29, 0x5d, 0x7d, 0x7d, 0x2c, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x6e, 0x2e, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65,
+ 0x6e, 0x74, 0x28, 0x74, 0x29, 0x2e, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65, 0x6e,
+ 0x74, 0x28, 0x74, 0x29, 0x3a, 0x6e, 0x2e, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x45, 0x78, 0x74, 0x65,
+ 0x6e, 0x74, 0x28, 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x45, 0x78, 0x74,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, 0x2d, 0x38, 0x30, 0x2d, 0x44, 0x61, 0x5d, 0x2c, 0x5b, 0x31,
+ 0x38, 0x30, 0x2c, 0x38, 0x30, 0x2b, 0x44, 0x61, 0x5d, 0x5d, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e,
+ 0x67, 0x65, 0x6f, 0x2e, 0x67, 0x72, 0x65, 0x61, 0x74, 0x41, 0x72, 0x63, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x74, 0x79, 0x70, 0x65,
+ 0x3a, 0x22, 0x4c, 0x69, 0x6e, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x63, 0x6f,
+ 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x73, 0x3a, 0x5b, 0x74, 0x7c, 0x7c, 0x72, 0x2e,
+ 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x65, 0x7c, 0x7c, 0x75, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29,
+ 0x5d, 0x7d, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x3d, 0x4d, 0x65, 0x2c,
+ 0x75, 0x3d, 0x78, 0x65, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x64, 0x69,
+ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e,
+ 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x28, 0x74, 0x7c, 0x7c, 0x72, 0x2e, 0x61, 0x70,
+ 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x2c, 0x65, 0x7c, 0x7c, 0x75, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x29, 0x7d,
+ 0x2c, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x72,
+ 0x3d, 0x65, 0x2c, 0x74, 0x3d, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d,
+ 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x65, 0x3f, 0x6e, 0x75, 0x6c, 0x6c, 0x3a, 0x65,
+ 0x2c, 0x6e, 0x29, 0x3a, 0x72, 0x7d, 0x2c, 0x6e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65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x71, 0x72,
+ 0x74, 0x28, 0x32, 0x2f, 0x28, 0x31, 0x2b, 0x6e, 0x29, 0x29, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x32,
+ 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x73, 0x69, 0x6e, 0x28, 0x6e, 0x2f, 0x32, 0x29, 0x7d,
+ 0x29, 0x3b, 0x28, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x61, 0x7a, 0x69, 0x6d, 0x75, 0x74,
+ 0x68, 0x61, 0x6c, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x41, 0x72, 0x65, 0x61, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x65, 0x28, 0x47, 0x6f, 0x29, 0x7d, 0x29, 0x2e, 0x72, 0x61, 0x77, 0x3d, 0x47, 0x6f, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x4b, 0x6f, 0x3d, 0x77, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x61, 0x63, 0x6f, 0x73, 0x28, 0x6e, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74,
+ 0x26, 0x26, 0x74, 0x2f, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x29, 0x7d,
+ 0x2c, 0x79, 0x29, 0x3b, 0x28, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x61, 0x7a, 0x69, 0x6d,
+ 0x75, 0x74, 0x68, 0x61, 0x6c, 0x45, 0x71, 0x75, 0x69, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x74,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x65, 0x28, 0x4b, 0x6f, 0x29, 0x7d, 0x29, 0x2e, 0x72, 0x61, 0x77, 0x3d,
+ 0x4b, 0x6f, 0x2c, 0x28, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x63, 0x6f, 0x6e, 0x69, 0x63,
+ 0x43, 0x6f, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x56, 0x74, 0x28, 0x53,
+ 0x65, 0x29, 0x7d, 0x29, 0x2e, 0x72, 0x61, 0x77, 0x3d, 0x53, 0x65, 0x2c, 0x28, 0x6f, 0x61, 0x2e,
+ 0x67, 0x65, 0x6f, 0x2e, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x45, 0x71, 0x75, 0x69, 0x64, 0x69, 0x73,
+ 0x74, 0x61, 0x6e, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0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x6d, 0x65,
+ 0x72, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x45, 0x65, 0x28, 0x4e, 0x65, 0x29, 0x7d,
+ 0x29, 0x2e, 0x72, 0x61, 0x77, 0x3d, 0x4e, 0x65, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x6c, 0x3d,
+ 0x77, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x7d, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x73, 0x69,
+ 0x6e, 0x29, 0x3b, 0x28, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x6f, 0x72, 0x74, 0x68, 0x6f,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x65, 0x28, 0x6e, 0x6c, 0x29,
+ 0x7d, 0x29, 0x2e, 0x72, 0x61, 0x77, 0x3d, 0x6e, 0x6c, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x6c,
+ 0x3d, 0x77, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x2f, 0x28, 0x31, 0x2b, 0x6e, 0x29, 0x7d, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x32, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x74, 0x61, 0x6e, 0x28, 0x6e,
+ 0x29, 0x7d, 0x29, 0x3b, 0x28, 0x6f, 0x61, 0x2e, 0x67, 0x65, 0x6f, 0x2e, 0x73, 0x74, 0x65, 0x72,
+ 0x65, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x65, 0x28, 0x74,
+ 0x6c, 0x29, 0x7d, 0x29, 0x2e, 0x72, 0x61, 0x77, 0x3d, 0x74, 0x6c, 0x2c, 0x41, 0x65, 0x2e, 0x69,
+ 0x6e, 0x76, 0x65, 0x72, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x2d, 0x74, 0x2c, 0x32, 0x2a,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x74, 0x61, 0x6e, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x65,
+ 0x78, 0x70, 0x28, 0x6e, 0x29, 0x29, 0x2d, 0x48, 0x61, 0x5d, 0x7d, 0x2c, 0x28, 0x6f, 0x61, 0x2e,
+ 0x67, 0x65, 0x6f, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x76, 0x65, 0x72, 0x73, 0x65, 0x4d, 0x65,
+ 0x72, 0x63, 0x61, 0x74, 0x6f, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0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+ 0x28, 0x65, 0x2c, 0x31, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x73,
+ 0x6f, 0x72, 0x74, 0x28, 0x56, 0x65, 0x29, 0x2c, 0x74, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x7d, 0x2c, 0x74, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x7b,
+ 0x73, 0x74, 0x61, 0x72, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x64, 0x67,
+ 0x65, 0x2e, 0x6c, 0x3d, 0x3d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x3f,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x61, 0x3a, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x62, 0x7d, 0x2c, 0x65, 0x6e, 0x64, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x64, 0x67, 0x65, 0x2e, 0x6c, 0x3d, 0x3d, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x69, 0x74, 0x65, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x64, 0x67, 0x65,
+ 0x2e, 0x62, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x64, 0x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+ 0x5c, 0x64, 0x2b, 0x29, 0x3f, 0x2f, 0x67, 0x2c, 0x68, 0x6c, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52,
+ 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x66, 0x6c, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2c,
+ 0x22, 0x67, 0x22, 0x29, 0x3b, 0x6f, 0x61, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c,
+ 0x61, 0x74, 0x65, 0x3d, 0x4d, 0x72, 0x2c, 0x6f, 0x61, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70,
+ 0x6f, 0x6c, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x3d, 0x5b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x74, 0x79, 0x70,
+ 0x65, 0x6f, 0x66, 0x20, 0x74, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x22, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x3d, 0x65, 0x3f, 0x72, 0x6f, 0x2e, 0x68, 0x61, 0x73,
+ 0x28, 0x74, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29,
+ 0x29, 0x7c, 0x7c, 0x2f, 0x5e, 0x28, 0x23, 0x7c, 0x72, 0x67, 0x62, 0x5c, 0x28, 0x7c, 0x68, 0x73,
+ 0x6c, 0x5c, 0x28, 0x29, 0x2f, 0x69, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x74, 0x29, 0x3f, 0x76,
+ 0x72, 0x3a, 0x79, 0x72, 0x3a, 0x74, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x6f,
+ 0x66, 0x20, 0x6f, 0x6e, 0x3f, 0x76, 0x72, 0x3a, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x69, 0x73,
+ 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x74, 0x29, 0x3f, 0x78, 0x72, 0x3a, 0x22, 0x6f, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x65, 0x26, 0x26, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x28,
+ 0x74, 0x29, 0x3f, 0x64, 0x72, 0x3a, 0x6d, 0x72, 0x29, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7d, 0x5d,
+ 0x2c, 0x6f, 0x61, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x41,
+ 0x72, 0x72, 0x61, 0x79, 0x3d, 0x78, 0x72, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x6c, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x79, 0x7d, 0x2c, 0x70, 0x6c, 0x3d, 0x6f, 0x61, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x7b, 0x6c,
+ 0x69, 0x6e, 0x65, 0x61, 0x72, 0x3a, 0x67, 0x6c, 0x2c, 0x70, 0x6f, 0x6c, 0x79, 0x3a, 0x45, 0x72,
+ 0x2c, 0x71, 0x75, 0x61, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x53, 0x72, 0x7d, 0x2c, 0x63, 0x75, 0x62, 0x69,
+ 0x63, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6b, 0x72, 0x7d, 0x2c, 0x73, 0x69, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x41, 0x72,
+ 0x7d, 0x2c, 0x65, 0x78, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x43, 0x72, 0x7d, 0x2c, 0x63, 0x69, 0x72, 0x63,
+ 0x6c, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x7a, 0x72, 0x7d, 0x2c, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63,
+ 0x3a, 0x4c, 0x72, 0x2c, 0x62, 0x61, 0x63, 0x6b, 0x3a, 0x71, 0x72, 0x2c, 0x62, 0x6f, 0x75, 0x6e,
+ 0x63, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x54, 0x72, 0x7d, 0x7d, 0x29, 0x2c, 0x76, 0x6c, 0x3d, 0x6f, 0x61,
+ 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x7b, 0x22, 0x69, 0x6e, 0x22, 0x3a, 0x79, 0x2c, 0x6f, 0x75, 0x74,
+ 0x3a, 0x5f, 0x72, 0x2c, 0x22, 0x69, 0x6e, 0x2d, 0x6f, 0x75,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c, 0x79, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x6c, 0x61, 0x2e, 0x63, 0x61, 0x6c, 0x6c,
+ 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x31, 0x29, 0x29, 0x29, 0x29,
+ 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65,
+ 0x48, 0x63, 0x6c, 0x3d, 0x52, 0x72, 0x2c, 0x6f, 0x61, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70,
+ 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x73, 0x6c, 0x3d, 0x44, 0x72, 0x2c, 0x6f, 0x61, 0x2e, 0x69,
+ 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x4c, 0x61, 0x62, 0x3d, 0x50, 0x72,
+ 0x2c, 0x6f, 0x61, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x52,
+ 0x6f, 0x75, 0x6e, 0x64, 0x3d, 0x6a, 0x72, 0x2c, 0x6f, 0x61, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73,
+ 0x66, 0x6f, 0x72, 0x6d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x73, 0x61, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x53, 0x28, 0x6f, 0x61, 0x2e, 0x6e, 0x73, 0x2e,
+ 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x2e, 0x73, 0x76, 0x67, 0x2c, 0x22, 0x67, 0x22, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x6f, 0x61, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66,
+ 0x6f, 0x72, 0x6d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b,
+ 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x6e, 0x29, 0x7b, 0x74, 0x2e, 0x73, 0x65,
+ 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x74, 0x72, 0x61, 0x6e,
+ 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x2c, 0x6e, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d,
+ 0x74, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x62, 0x61, 0x73, 0x65,
+ 0x56, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x28,
+ 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x55, 0x72, 0x28,
+ 0x65, 0x3f, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x3a, 0x64, 0x6c, 0x29, 0x7d, 0x29,
+ 0x28, 0x6e, 0x29, 0x7d, 0x2c, 0x55, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70,
+ 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x74, 0x72, 0x61,
+ 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x72,
+ 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x2b, 0x22, 0x29, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65,
+ 0x28, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x2b, 0x22,
+ 0x29, 0x73, 0x6b, 0x65, 0x77, 0x58, 0x28, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x6b,
+ 0x65, 0x77, 0x2b, 0x22, 0x29, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x22, 0x2b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2b, 0x22, 0x29, 0x22, 0x7d, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x6c, 0x3d, 0x7b, 0x61, 0x3a, 0x31, 0x2c, 0x62, 0x3a, 0x30, 0x2c, 0x63, 0x3a, 0x30,
+ 0x2c, 0x64, 0x3a, 0x31, 0x2c, 0x65, 0x3a, 0x30, 0x2c, 0x66, 0x3a, 0x30, 0x7d, 0x3b, 0x6f, 0x61,
+ 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e,
+ 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x3d, 0x24, 0x72, 0x2c, 0x6f, 0x61, 0x2e, 0x6c, 0x61, 0x79, 0x6f,
+ 0x75, 0x74, 0x3d, 0x7b, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x6c, 0x61, 0x79, 0x6f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c, 0x53, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3f, 0x7b, 0x73, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x3a, 0x53, 0x2c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3a, 0x77, 0x7d, 0x3a, 0x7b, 0x73,
+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3a, 0x77, 0x2c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3a, 0x53,
+ 0x7d, 0x29, 0x7d, 0x6c, 0x26, 0x26, 0x74, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x74, 0x28, 0x29, 0x7b, 0x65, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6c, 0x28, 0x28, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76,
+ 0x61, 0x6c, 0x75, 0x65, 0x2b, 0x6e, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x29, 0x2f, 0x32, 0x2c, 0x28, 0x74, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2b, 0x74, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x2f, 0x32, 0x29, 0x7d, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20,
+ 0x65, 0x2c, 0x72, 0x2c, 0x75, 0x2c, 0x69, 0x2c, 0x61, 0x2c, 0x6f, 0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31, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x74,
+ 0x3d, 0x30, 0x3b, 0x75, 0x3e, 0x74, 0x3b, 0x2b, 0x2b, 0x74, 0x29, 0x28, 0x72, 0x3d, 0x4d, 0x5b,
+ 0x74, 0x5d, 0x29, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x74, 0x2c, 0x72, 0x2e, 0x77, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x3d, 0x30, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x74, 0x3d, 0x30, 0x3b, 0x63,
+ 0x3e, 0x74, 0x3b, 0x2b, 0x2b, 0x74, 0x29, 0x72, 0x3d, 0x78, 0x5b, 0x74, 0x5d, 0x2c, 0x22, 0x6e,
+ 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x72,
+ 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x26, 0x26, 0x28, 0x72, 0x2e, 0x73, 0x6f, 0x75, 0x72,
+ 0x63, 0x65, 0x3d, 0x4d, 0x5b, 0x72, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5d, 0x29, 0x2c,
+ 0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x72, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x26, 0x26, 0x28, 0x72, 0x2e, 0x74, 0x61,
+ 0x72, 0x67, 0x65, 0x74, 0x3d, 0x4d, 0x5b, 0x72, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5d,
+ 0x29, 0x2c, 0x2b, 0x2b, 0x72, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x77, 0x65, 0x69,
+ 0x67, 0x68, 0x74, 0x2c, 0x2b, 0x2b, 0x72, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x77,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x74, 0x3d, 0x30, 0x3b, 0x75, 0x3e,
+ 0x74, 0x3b, 0x2b, 0x2b, 0x74, 0x29, 0x72, 0x3d, 0x4d, 0x5b, 0x74, 0x5d, 0x2c, 0x69, 0x73, 0x4e,
+ 0x61, 0x4e, 0x28, 0x72, 0x2e, 0x78, 0x29, 0x26, 0x26, 0x28, 0x72, 0x2e, 0x78, 0x3d, 0x6e, 0x28,
+ 0x22, 0x78, 0x22, 0x2c, 0x66, 0x29, 0x29, 0x2c, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x28, 0x72, 0x2e,
+ 0x79, 0x29, 0x26, 0x26, 0x28, 0x72, 0x2e, 0x79, 0x3d, 0x6e, 0x28, 0x22, 0x79, 0x22, 0x2c, 0x76,
+ 0x29, 0x29, 0x2c, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x28, 0x72, 0x2e, 0x70, 0x78, 0x29, 0x26, 0x26,
+ 0x28, 0x72, 0x2e, 0x70, 0x78, 0x3d, 0x72, 0x2e, 0x78, 0x29, 0x2c, 0x69, 0x73, 0x4e, 0x61, 0x4e,
+ 0x28, 0x72, 0x2e, 0x70, 0x79, 0x29, 0x26, 0x26, 0x28, 0x72, 0x2e, 0x70, 0x79, 0x3d, 0x72, 0x2e,
+ 0x79, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x69, 0x3d, 0x5b, 0x5d, 0x2c, 0x22, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x68, 0x29,
+ 0x66, 0x6f, 0x72, 0x28, 0x74, 0x3d, 0x30, 0x3b, 0x63, 0x3e, 0x74,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x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x7c, 0x7c, 0x28, 0x72, 0x3d, 0x6f, 0x61, 0x2e, 0x62, 0x65,
+ 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x64, 0x72, 0x61, 0x67, 0x28, 0x29, 0x2e, 0x6f, 0x72,
+ 0x69, 0x67, 0x69, 0x6e, 0x28, 0x79, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x64, 0x72, 0x61, 0x67,
+ 0x73, 0x74, 0x61, 0x72, 0x74, 0x2e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x2c, 0x51, 0x72, 0x29,
+ 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22,
+ 0x2c, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x64, 0x72, 0x61, 0x67, 0x65, 0x6e, 0x64, 0x2e,
+ 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x2c, 0x6e, 0x75, 0x29, 0x29, 0x2c, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x76, 0x6f, 0x69,
+ 0x64, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65,
+ 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x2c, 0x74, 0x75, 0x29, 0x2e,
+ 0x6f, 0x6e, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6f, 0x75, 0x74, 0x2e, 0x66, 0x6f, 0x72,
+ 0x63, 0x65, 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0x2e, 0x64, 0x65, 0x70, 0x74, 0x68, 0x29,
+ 0x29, 0x26, 0x26, 0x28, 0x6c, 0x3d, 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x29,
+ 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x2c, 0x63, 0x2c, 0x73, 0x3b, 0x2d,
+ 0x2d, 0x6c, 0x3e, 0x3d, 0x30, 0x3b, 0x29, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x73, 0x3d,
+ 0x63, 0x5b, 0x6c, 0x5d, 0x29, 0x2c, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x69,
+ 0x2c, 0x73, 0x2e, 0x64, 0x65, 0x70, 0x74, 0x68, 0x3d, 0x69, 0x2e, 0x64, 0x65, 0x70, 0x74, 0x68,
+ 0x2b, 0x31, 0x3b, 0x72, 0x26, 0x26, 0x28, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x30,
+ 0x29, 0x2c, 0x69, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x3d, 0x63, 0x7d, 0x65,
+ 0x6c, 0x73, 0x65, 0x20, 0x72, 0x26, 0x26, 0x28, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d,
+ 0x2b, 0x72, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6e, 0x2c, 0x69, 0x2c, 0x69, 0x2e, 0x64, 0x65,
+ 0x70, 0x74, 0x68, 0x29, 0x7c, 0x7c, 0x30, 0x29, 0x2c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20,
+ 0x69, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x61, 0x75, 0x28, 0x75, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x2c, 0x75, 0x3b, 0x74, 0x26, 0x26, 0x28, 0x65,
+ 0x3d, 0x6e, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x29, 0x26, 0x26, 0x65, 0x2e,
+ 0x73, 0x6f, 0x72, 0x74, 0x28, 0x74, 0x29, 0x2c, 0x72, 0x26, 0x26, 0x28, 0x75, 0x3d, 0x6e, 0x2e,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x29, 0x26, 0x26, 0x28, 0x75, 0x2e, 0x76, 0x61, 0x6c, 0x75,
+ 0x65, 0x2b, 0x3d, 0x6e, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x7d, 0x29, 0x2c, 0x6f, 0x7d,
+ 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x63, 0x75, 0x2c, 0x65, 0x3d, 0x6f, 0x75, 0x2c, 0x72, 0x3d,
+ 0x6c, 0x75, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x73, 0x6f, 0x72, 0x74,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x74, 0x3d, 0x65, 0x2c, 0x6e, 0x29, 0x3a, 0x74, 0x7d, 0x2c,
+ 0x6e, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28,
+ 0x65, 0x3d, 0x74, 0x2c, 0x6e, 0x29, 0x3a, 0x65, 0x7d, 0x2c, 0x6e, 0x2e, 0x76, 0x61, 0x6c, 0x75,
+ 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x72, 0x3d, 0x74, 0x2c, 0x6e, 0x29, 0x3a, 0x72, 0x7d,
+ 0x2c, 0x6e, 0x2e, 0x72, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x26,
+ 0x26, 0x28, 0x69, 0x75, 0x28, 0x74, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x29, 0x7b, 0x6e, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x26, 0x26, 0x28,
+ 0x6e, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x30, 0x29, 0x7d, 0x29, 0x2c, 0x61, 0x75, 0x28,
+ 0x74, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x65, 0x3b, 0x74, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x7c, 0x7c,
+ 0x28, 0x74, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x2b, 0x72, 0x2e, 0x63, 0x61, 0x6c, 0x6c,
+ 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x74, 0x2e, 0x64, 0x65, 0x70, 0x74, 0x68, 0x29, 0x7c, 0x7c, 0x30,
+ 0x29, 0x2c, 0x28, 0x65, 0x3d, 0x74, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x29, 0x26, 0x26,
+ 0x28, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2b, 0x3d, 0x74, 0x2e, 0x76, 0x61, 0x6c, 0x75,
+ 0x65, 0x29, 0x7d, 0x29, 0x29, 0x2c, 0x74, 0x7d, 0x2c, 0x6e, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x6c,
+ 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x70, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x2c, 0x75, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x69, 0x3d, 0x74, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x3b,
+ 0x69, 0x66, 0x28, 0x74, 0x2e, 0x78, 0x3d, 0x65, 0x2c, 0x74, 0x2e, 0x79, 0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 0x20, 0x75, 0x2c, 0x69, 0x3d, 0x2d, 0x31, 0x3b, 0x2b, 0x2b, 0x69, 0x3c, 0x75,
+ 0x3b, 0x29, 0x72, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x72, 0x2c, 0x74,
+ 0x28, 0x65, 0x5b, 0x69, 0x5d, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31,
+ 0x2b, 0x72, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x65, 0x2c,
+ 0x69, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x72, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2c, 0x65, 0x2c, 0x69, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x28, 0x61, 0x5b, 0x30, 0x5d, 0x2c, 0x30, 0x2c, 0x75, 0x5b, 0x30, 0x5d, 0x2c, 0x75,
+ 0x5b, 0x31, 0x5d, 0x2f, 0x74, 0x28, 0x61, 0x5b, 0x30, 0x5d, 0x29, 0x29, 0x2c, 0x61, 0x7d, 0x76,
+ 0x61, 0x72, 0x20, 0x72, 0x3d, 0x6f, 0x61, 0x2e, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x68,
+ 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x79, 0x28, 0x29, 0x2c, 0x75, 0x3d, 0x5b, 0x31, 0x2c,
+ 0x31, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x73, 0x69, 0x7a, 0x65,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29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2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3a, 0x72,
+ 0x29, 0x2c, 0x66, 0x3d, 0x28, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d,
+ 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x75, 0x3f, 0x75, 0x2e, 0x61, 0x70, 0x70, 0x6c,
+ 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x29, 0x3a, 0x75, 0x29, 0x2d, 0x73, 0x2c, 0x68, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69,
+ 0x6e, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x66, 0x29, 0x2f, 0x6c, 0x2c,
+ 0x2b, 0x28, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79,
+ 0x70, 0x65, 0x6f, 0x66, 0x20, 0x69, 0x3f, 0x69, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3a, 0x69,
+ 0x29, 0x29, 0x2c, 0x67, 0x3d, 0x68, 0x2a, 0x28, 0x30, 0x3e, 0x66, 0x3f, 0x2d, 0x31, 0x3a, 0x31,
+ 0x29, 0x2c, 0x70, 0x3d, 0x6f, 0x61, 0x2e, 0x73, 0x75, 0x6d, 0x28, 0x63, 0x29, 0x2c, 0x76, 0x3d,
+ 0x70, 0x3f, 0x28, 0x66, 0x2d, 0x6c, 0x2a, 0x67, 0x29, 0x2f, 0x70, 0x3a, 0x30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6c, 0x3d, 0x7b, 0x7d, 0x3b, 0x6f, 0x61, 0x2e, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x73,
+ 0x74, 0x61, 0x63, 0x6b, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x6f, 0x2c, 0x6c, 0x29, 0x7b,
+ 0x69, 0x66, 0x28, 0x21, 0x28, 0x68, 0x3d, 0x6f, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29,
+ 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d,
+ 0x6f, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65,
+ 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x6e, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7d, 0x29, 0x2c, 0x73, 0x3d, 0x63, 0x2e, 0x6d,
+ 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x5b, 0x69, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6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e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x65, 0x3d, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x3f, 0x74, 0x3a,
+ 0x62, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x28, 0x74, 0x29, 0x7c, 0x7c, 0x70, 0x75, 0x2c, 0x6e, 0x29,
+ 0x3a, 0x65, 0x7d, 0x2c, 0x6e, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3f, 0x28, 0x72, 0x3d, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x3f, 0x74, 0x3a, 0x5f, 0x6c, 0x2e, 0x67, 0x65,
+ 0x74, 0x28, 0x74, 0x29, 0x7c, 0x7c, 0x76, 0x75, 0x2c, 0x6e, 0x29, 0x3a, 0x72, 0x7d, 0x2c, 0x6e,
+ 0x2e, 0x78, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0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6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x72, 0x3d, 0x45, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e,
+ 0x29, 0x3a, 0x72, 0x7d, 0x2c, 0x6e, 0x2e, 0x62, 0x69, 0x6e, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f,
+ 0x28, 0x75, 0x3d, 0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70,
+ 0x65, 0x6f, 0x66, 0x20, 0x74, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x78, 0x75, 0x28, 0x6e, 0x2c, 0x74, 0x29,
+ 0x7d, 0x3a, 0x45, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x75, 0x7d, 0x2c, 0x6e, 0x2e,
+ 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x79, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67,
+ 0x75, 0x6d, 0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x29,
+ 0x2c, 0x6f, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6f, 0x61, 0x2e, 0x6c, 0x61, 0x79, 0x6f,
+ 0x75, 0x74, 0x2e, 0x68, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x79, 0x28, 0x29, 0x2e, 0x73,
+ 0x6f, 0x72, 0x74, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x28,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2c, 0x65, 0x3d, 0x4c, 0x75, 0x2c, 0x72, 0x3d, 0x5b, 0x31, 0x2c,
+ 0x31, 0x5d, 0x2c, 0x75, 0x3d, 0x21, 0x31, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x2e, 0x73, 0x65, 0x70, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f,
+ 0x28, 0x65, 0x3d, 0x74, 0x2c, 0x6e, 0x29, 0x3a, 0x65, 0x7d, 0x2c, 0x6e, 0x2e, 0x73, 0x69, 0x7a,
+ 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0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0x3a, 0x22, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x2d, 0x64, 0x69, 0x63, 0x65,
+ 0x22, 0x3d, 0x3d, 0x3d, 0x67, 0x3f, 0x31, 0x26, 0x65, 0x2e, 0x64, 0x65, 0x70, 0x74, 0x68, 0x3f,
+ 0x63, 0x2e, 0x64, 0x79, 0x3a, 0x63, 0x2e, 0x64, 0x78, 0x3a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d,
+ 0x69, 0x6e, 0x28, 0x63, 0x2e, 0x64, 0x78, 0x2c, 0x63, 0x2e, 0x64, 0x79, 0x29, 0x3b, 0x66, 0x6f,
+ 0x72, 0x28, 0x6e, 0x28, 0x68, 0x2c, 0x63, 0x2e, 0x64, 0x78, 0x2a, 0x63, 0x2e, 0x64, 0x79, 0x2f,
+ 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x2c, 0x73, 0x2e, 0x61, 0x72, 0x65, 0x61, 0x3d,
+ 0x30, 0x3b, 0x28, 0x6c, 0x3d, 0x68, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x3e, 0x30,
+ 0x3b, 0x29, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x61, 0x3d, 0x68, 0x5b, 0x6c, 0x2d, 0x31,
+ 0x5d, 0x29, 0x2c, 0x73, 0x2e, 0x61, 0x72, 0x65, 0x61, 0x2b, 0x3d, 0x61, 0x2e, 0x61, 0x72, 0x65,
+ 0x61, 0x2c, 0x22, 0x73, 0x71, 0x75, 0x61, 0x72, 0x69, 0x66, 0x79, 0x22, 0x21, 0x3d, 0x3d, 0x67,
+ 0x7c, 0x7c, 0x28, 0x6f, 0x3d, 0x72, 0x28, 0x73, 0x2c, 0x76, 0x29, 0x29, 0x3c, 0x3d, 0x70, 0x3f,
+ 0x28, 0x68, 0x2e, 0x70, 0x6f, 0x70, 0x28, 0x29, 0x2c, 0x70, 0x3d, 0x6f, 0x29, 0x3a, 0x28, 0x73,
+ 0x2e, 0x61, 0x72, 0x65, 0x61, 0x2d, 0x3d, 0x73, 0x2e, 0x70, 0x6f, 0x70, 0x28, 0x29, 0x2e, 0x61,
+ 0x72, 0x65, 0x61, 0x2c, 0x75, 0x28, 0x73, 0x2c, 0x76, 0x2c, 0x63, 0x2c, 0x21, 0x31, 0x29, 0x2c,
+ 0x76, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x63, 0x2e, 0x64, 0x78, 0x2c,
+ 0x63, 0x2e, 0x64, 0x79, 0x29, 0x2c, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3d, 0x73,
+ 0x2e, 0x61, 0x72, 0x65, 0x61, 0x3d, 0x30, 0x2c, 0x70, 0x3d, 0x31, 0x2f, 0x30, 0x29, 0x3b, 0x73,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x28, 0x75, 0x28, 0x73, 0x2c, 0x76, 0x2c,
+ 0x63, 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3d, 0x73,
+ 0x2e, 0x61, 0x72, 0x65, 0x61, 0x3d, 0x30, 0x29, 0x2c, 0x69, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61,
+ 0x63, 0x68, 0x28, 0x74, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x65, 0x28, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x74, 0x2e, 0x63, 0x68, 0x69,
+ 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x3b, 0x69, 0x66, 0x28, 0x72, 0x26, 0x26, 0x72, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x29, 0x7b,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0x61, 0x72,
+ 0x20, 0x75, 0x3d, 0x61, 0x7c, 0x7c, 0x6f, 0x28, 0x72, 0x29, 0x2c, 0x69, 0x3d, 0x75, 0x5b, 0x30,
+ 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x2e, 0x78, 0x3d, 0x69, 0x2e, 0x79,
+ 0x3d, 0x30, 0x2c, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3f, 0x28, 0x69, 0x2e, 0x64, 0x78,
+ 0x3d, 0x63, 0x5b, 0x30, 0x5d, 0x2c, 0x69, 0x2e, 0x64, 0x79, 0x3d, 0x63, 0x5b, 0x31, 0x5d, 0x29,
+ 0x3a, 0x69, 0x2e, 0x64, 0x78, 0x3d, 0x69, 0x2e, 0x64, 0x79, 0x3d, 0x30, 0x2c, 0x61, 0x26, 0x26,
+ 0x6f, 0x2e, 0x72, 0x65, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x69, 0x29, 0x2c, 0x6e, 0x28, 0x5b,
+ 0x69, 0x5d, 0x2c, 0x69, 0x2e, 0x64, 0x78, 0x2a, 0x69, 0x2e, 0x64, 0x79, 0x2f, 0x69, 0x2e, 0x76,
+ 0x61, 0x6c, 0x75, 0x65, 0x29, 0x2c, 0x28, 0x61, 0x3f, 0x65, 0x3a, 0x74, 0x29, 0x28, 0x69, 0x29,
+ 0x2c, 0x68, 0x26, 0x26, 0x28, 0x61, 0x3d, 0x75, 0x29, 0x2c, 0x75, 0x7d, 0x76, 0x61, 0x72, 0x20,
+ 0x61, 0x2c, 0x6f, 0x3d, 0x6f, 0x61, 0x2e, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x68, 0x69,
+ 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x79, 0x28, 0x29, 0x2c, 0x6c, 0x3d, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2c, 0x63, 0x3d, 0x5b, 0x31, 0x2c, 0x31, 0x5d, 0x2c, 0x73,
+ 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x66, 0x3d, 0x4f, 0x75, 0x2c, 0x68, 0x3d, 0x21, 0x31, 0x2c,
+ 0x67, 0x3d, 0x22, 0x73, 0x71, 0x75, 0x61, 0x72, 0x69, 0x66, 0x79, 0x22, 0x2c, 0x70, 0x3d, 0x2e,
+ 0x35, 0x2a, 0x28, 0x31, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28, 0x35,
+ 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x2e, 0x73, 0x69, 0x7a, 0x65,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x63, 0x3d, 0x6e, 0x2c, 0x69, 0x29, 0x3a, 0x63, 0x7d, 0x2c,
+ 0x69, 0x2e, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74,
+ 0x28, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x6e, 0x2e, 0x63, 0x61, 0x6c, 0x6c,
+ 0x28, 0x69, 0x2c, 0x74, 0x2c, 0x74, 0x2e, 0x64, 0x65, 0x70, 0x74, 0x68, 0x29, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x65, 0x3f, 0x4f, 0x75, 0x28,
+ 0x74, 0x29, 0x3a, 0x49, 0x75, 0x28, 0x74, 0x2c, 0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22,
+ 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x65, 0x3f, 0x5b, 0x65, 0x2c, 0x65, 0x2c,
+ 0x65, 0x2c, 0x65, 0x5d, 0x3a, 0x65, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x65, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x49, 0x75, 0x28,
+ 0x74, 0x2c, 0x6e, 0x29, 0x7d, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x66, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x28, 0x73, 0x3d, 0x6e, 0x29, 0x3f, 0x4f, 0x75,
+ 0x3a, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x28, 0x72, 0x3d,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x29, 0x3f, 0x74, 0x3a, 0x22, 0x6e, 0x75, 0x6d,
+ 0x62, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x3d,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 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79,
+ 0x28, 0x6f, 0x61, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x65, 0x78, 0x70,
+ 0x28, 0x6e, 0x28, 0x29, 0x29, 0x7d, 0x7d, 0x2c, 0x62, 0x61, 0x74, 0x65, 0x73, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d,
+ 0x6f, 0x61, 0x2e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x2e, 0x69, 0x72, 0x77, 0x69, 0x6e, 0x48,
+ 0x61, 0x6c, 0x6c, 0x28, 0x6e, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x28, 0x29, 0x2f, 0x6e, 0x7d, 0x7d, 0x2c, 0x69, 0x72, 0x77, 0x69, 0x6e, 0x48, 0x61, 0x6c,
+ 0x6c, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x66, 0x6f, 0x72,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, 0x6f, 0x61, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x63,
+ 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x31, 0x30, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x61, 0x2e, 0x73,
+ 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x28, 0x29, 0x2e, 0x72,
+ 0x61, 0x6e, 0x67, 0x65, 0x28, 0x45, 0x6c, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x73, 0x63, 0x61,
+ 0x6c, 0x65, 0x2e, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x32, 0x30, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x6f, 0x61, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c,
+ 0x28, 0x29, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x41, 0x6c, 0x29, 0x7d, 0x2c, 0x6f, 0x61,
+ 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x32,
+ 0x30, 0x62, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x61, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6f, 0x72,
+ 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x28, 0x29, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x43, 0x6c,
+ 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x63, 0x61, 0x74, 0x65,
+ 0x67, 0x6f, 0x72, 0x79, 0x32, 0x30, 0x63, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x61, 0x2e, 0x73, 0x63, 0x61,
+ 0x6c, 0x65, 0x2e, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x28, 0x29, 0x2e, 0x72, 0x61, 0x6e,
+ 0x67, 0x65, 0x28, 0x7a, 0x6c, 0x29, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x45, 0x6c, 0x3d, 0x5b,
+ 0x32, 0x30, 0x36, 0x32, 0x32, 0x36, 0x30, 0x2c, 0x31, 0x36, 0x37, 0x34, 0x34, 0x32, 0x30, 0x36,
+ 0x2c, 0x32, 0x39, 0x32, 0x34, 0x35, 0x38, 0x38, 0x2c, 0x31, 0x34, 0x30, 0x33, 0x34, 0x37, 0x32,
+ 0x38, 0x2c, 0x39, 0x37, 0x32, 0x35, 0x38, 0x38, 0x35, 0x2c, 0x39, 0x31, 0x39, 0x37, 0x31, 0x33,
+ 0x31, 0x2c, 0x31, 0x34, 0x39, 0x30, 0x37, 0x33, 0x33, 0x30, 0x2c, 0x38, 0x33, 0x35, 0x35, 0x37,
+ 0x31, 0x31, 0x2c, 0x31, 0x32, 0x33, 0x36, 0x39, 0x31, 0x38, 0x36, 0x2c, 0x31, 0x35, 0x35, 0x36,
+ 0x31, 0x37, 0x35, 0x5d, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x78, 0x6e, 0x29, 0x2c, 0x41, 0x6c, 0x3d,
+ 0x5b, 0x32, 0x30, 0x36, 0x32, 0x32, 0x36, 0x30, 0x2c, 0x31, 0x31, 0x34, 0x35, 0x34, 0x34, 0x34,
+ 0x30, 0x2c, 0x31, 0x36, 0x37, 0x34, 0x34, 0x32, 0x30, 0x36, 0x2c, 0x31, 0x36, 0x37, 0x35, 0x39,
+ 0x36, 0x37, 0x32, 0x2c, 0x32, 0x39, 0x32, 0x34, 0x35, 0x38, 0x38, 0x2c, 0x31, 0x30, 0x30, 0x31,
+ 0x38, 0x36, 0x39, 0x38, 0x2c, 0x31, 0x34, 0x30, 0x33, 0x34, 0x37, 0x32, 0x38, 0x2c, 0x31, 0x36,
+ 0x37, 0x35, 0x30, 0x37, 0x34, 0x32, 0x2c, 0x39, 0x37, 0x32, 0x35, 0x38, 0x38, 0x35, 0x2c, 0x31,
+ 0x32, 0x39, 0x35, 0x35, 0x38, 0x36, 0x31, 0x2c, 0x39, 0x31, 0x39, 0x37, 0x31, 0x33, 0x31, 0x2c,
+ 0x31, 0x32, 0x38, 0x38, 0x35, 0x31, 0x34, 0x30, 0x2c, 0x31, 0x34, 0x39, 0x30, 0x37, 0x33, 0x33,
+ 0x30, 0x2c, 0x31, 0x36, 0x32, 0x33, 0x34, 0x31, 0x39, 0x34, 0x2c, 0x38, 0x33, 0x35, 0x35, 0x37,
+ 0x31, 0x31, 0x2c, 0x31, 0x33, 0x30, 0x39, 0x32, 0x38, 0x30, 0x37, 0x2c, 0x31, 0x32, 0x33, 0x36,
+ 0x39, 0x31, 0x38, 0x36, 0x2c, 0x31, 0x34, 0x34, 0x30, 0x38, 0x35, 0x38, 0x39, 0x2c, 0x31, 0x35,
+ 0x35, 0x36, 0x31, 0x37, 0x35, 0x2c, 0x31, 0x30, 0x34, 0x31, 0x30, 0x37, 0x32, 0x35, 0x5d, 0x2e,
+ 0x6d, 0x61, 0x70, 0x28, 0x78, 0x6e, 0x29, 0x2c, 0x43, 0x6c, 0x3d, 0x5b, 0x33, 0x37, 0x35, 0x30,
+ 0x37, 0x37, 0x37, 0x2c, 0x35, 0x33, 0x39, 0x35, 0x36, 0x31, 0x39, 0x2c, 0x37, 0x30, 0x34, 0x30,
+ 0x37, 0x31, 0x39, 0x2c, 0x31, 0x30, 0x32, 0x36, 0x34, 0x32, 0x38, 0x36, 0x2c, 0x36, 0x35, 0x31,
+ 0x39, 0x30, 0x39, 0x37, 0x2c, 0x39, 0x32, 0x31, 0x36, 0x35, 0x39, 0x34, 0x2c, 0x31, 0x31, 0x39,
+ 0x31, 0x35, 0x31, 0x31, 0x35, 0x2c, 0x31, 0x33, 0x35, 0x35, 0x36, 0x36, 0x33, 0x36, 0x2c, 0x39,
+ 0x32, 0x30, 0x32, 0x39, 0x39, 0x33, 0x2c, 0x31, 0x32, 0x34, 0x32, 0x36, 0x38, 0x30, 0x39, 0x2c,
+ 0x31, 0x35, 0x31, 0x38, 0x36, 0x35, 0x31, 0x34, 0x2c, 0x31, 0x35, 0x31, 0x39, 0x30, 0x39, 0x33,
+ 0x32, 0x2c, 0x38, 0x36, 0x36, 0x36, 0x31, 0x36, 0x39, 0x2c, 0x31, 0x31, 0x33, 0x35, 0x36, 0x34,
+ 0x39, 0x30, 0x2c, 0x31, 0x34, 0x30, 0x34, 0x39, 0x36, 0x34, 0x33, 0x2c, 0x31, 0x35, 0x31, 0x37,
+ 0x37, 0x33, 0x37, 0x32, 0x2c, 0x38, 0x30, 0x37, 0x37, 0x36, 0x38, 0x33, 0x2c, 0x31, 0x30, 0x38,
+ 0x33, 0x34, 0x33, 0x32, 0x34, 0x2c, 0x31, 0x33, 0x35, 0x32, 0x38, 0x35, 0x30, 0x39, 0x2c, 0x31,
+ 0x34, 0x35, 0x38, 0x39, 0x36, 0x35, 0x34, 0x5d, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x78, 0x6e, 0x29,
+ 0x2c, 0x7a, 0x6c, 0x3d, 0x5b, 0x33, 0x32, 0x34, 0x34, 0x37, 0x33, 0x33, 0x2c, 0x37, 0x30, 0x35,
+ 0x37, 0x31, 0x31, 0x30, 0x2c, 0x31, 0x30, 0x34, 0x30, 0x36, 0x36, 0x32, 0x35, 0x2c, 0x31, 0x33,
+ 0x30, 0x33, 0x32, 0x34, 0x33, 0x31, 0x2c, 0x31, 0x35, 0x30, 0x39, 0x35, 0x30, 0x35, 0x33, 0x2c,
+ 0x31, 0x36, 0x36, 0x31, 0x36, 0x37, 0x36, 0x34, 0x2c, 0x31, 0x36, 0x36, 0x32, 0x35, 0x32, 0x35,
+ 0x39, 0x2c, 0x31, 0x36, 0x36, 0x33, 0x34, 0x30, 0x31, 0x38, 0x2c, 0x33, 0x32, 0x35, 0x33, 0x30,
+ 0x37, 0x36, 0x2c, 0x37, 0x36, 0x35, 0x32, 0x34, 0x37, 0x30, 0x2c, 0x31, 0x30, 0x36, 0x30, 0x37,
+ 0x30, 0x30, 0x33, 0x2c, 0x31, 0x33, 0x31, 0x30, 0x31, 0x35, 0x30, 0x34, 0x2c, 0x37, 0x36, 0x39,
+ 0x35, 0x32, 0x38, 0x31, 0x2c, 0x31, 0x30, 0x33, 0x39, 0x34, 0x33, 0x31, 0x32, 0x2c, 0x31, 0x32,
+ 0x33, 0x36, 0x39, 0x33, 0x37, 0x32, 0x2c, 0x31, 0x34, 0x33, 0x34, 0x32, 0x38, 0x39, 0x31, 0x2c,
+ 0x36, 0x35, 0x31, 0x33, 0x35, 0x30, 0x37, 0x2c, 0x39, 0x38, 0x36, 0x38, 0x39, 0x35, 0x30, 0x2c,
+ 0x31, 0x32, 0x34, 0x33, 0x34, 0x38, 0x37, 0x37, 0x2c, 0x31, 0x34, 0x32, 0x37, 0x37, 0x30, 0x38,
+ 0x31, 0x5d, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x78, 0x6e, 0x29, 0x3b, 0x6f, 0x61, 0x2e, 0x73, 0x63,
+ 0x61, 0x6c, 0x65, 0x2e, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x6c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 0x61, 0x2e, 0x73, 0x76, 0x67, 0x3d, 0x7b, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x73, 0x76,
+ 0x67, 0x2e, 0x61, 0x72, 0x63, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x6e, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x30, 0x2c, 0x2b,
+ 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x29, 0x2c, 0x63, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x6d, 0x61, 0x78, 0x28, 0x30, 0x2c, 0x2b, 0x72, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x29, 0x2c,
+ 0x73, 0x3d, 0x61, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2d, 0x48, 0x61, 0x2c, 0x66, 0x3d, 0x6f,
+ 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2d, 0x48, 0x61, 0x2c, 0x68, 0x3d,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, 0x73, 0x71, 0x72, 0x74, 0x28, 0x6e, 0x2a, 0x6e, 0x2b, 0x63, 0x2a, 0x63, 0x29, 0x3a,
+ 0x2b, 0x69, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x67, 0x7c, 0x7c, 0x28, 0x45, 0x2a, 0x3d,
+ 0x2d, 0x31, 0x29, 0x2c, 0x63, 0x26, 0x26, 0x28, 0x45, 0x3d, 0x74, 0x6e, 0x28, 0x64, 0x2f, 0x63,
+ 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x6d, 0x29, 0x29, 0x29, 0x2c, 0x6e,
+ 0x26, 0x26, 0x28, 0x4e, 0x3d, 0x74, 0x6e, 0x28, 0x64, 0x2f, 0x6e, 0x2a, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x6d, 0x29, 0x29, 0x29, 0x29, 0x2c, 0x63, 0x29, 0x7b, 0x79, 0x3d,
+ 0x63, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x73, 0x2b, 0x45, 0x29, 0x2c,
+ 0x4d, 0x3d, 0x63, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x73, 0x2b, 0x45,
+ 0x29, 0x2c, 0x78, 0x3d, 0x63, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x66,
+ 0x2d, 0x45, 0x29, 0x2c, 0x62, 0x3d, 0x63, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e,
+ 0x28, 0x66, 0x2d, 0x45, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,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 0x69, 0x6e, 0x6e, 0x65, 0x72,
+ 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x65, 0x3d, 0x45, 0x6e,
+ 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x65, 0x7d, 0x2c, 0x6e, 0x2e, 0x6f, 0x75, 0x74, 0x65,
+ 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x72, 0x3d, 0x45,
+ 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x72, 0x7d, 0x2c, 0x6e, 0x2e, 0x63, 0x6f, 0x72,
+ 0x6e, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x75,
+ 0x3d, 0x45, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x75, 0x7d, 0x2c, 0x6e, 0x2e, 0x70,
+ 0x61, 0x64, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x69, 0x3d,
+ 0x74, 0x3d, 0x3d, 0x4c, 0x6c, 0x3f, 0x4c, 0x6c, 0x3a, 0x45, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e,
+ 0x29, 0x3a, 0x69, 0x7d, 0x2c, 0x6e, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, 0x6e, 0x67, 0x6c,
+ 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x61, 0x3d, 0x45, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e,
+ 0x29, 0x3a, 0x61, 0x7d, 0x2c, 0x6e, 0x2e, 0x65, 0x6e, 0x64, 0x41, 0x6e, 0x67, 0x6c, 0x65, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3f, 0x28, 0x6f, 0x3d, 0x45, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a,
+ 0x6f, 0x7d, 0x2c, 0x6e, 0x2e, 0x70, 0x61, 0x64, 0x41, 0x6e, 0x67, 0x6c, 0x65, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3f, 0x28, 0x6c, 0x3d, 0x45, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x6c, 0x7d,
+ 0x2c, 0x6e, 0x2e, 0x63, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x69, 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x28, 0x2b, 0x65,
+ 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2b, 0x20, 0x2b, 0x72, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29,
+ 0x29, 0x2f, 0x32, 0x2c, 0x74, 0x3d, 0x28, 0x2b, 0x61, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2b,
+ 0x20, 0x2b, 0x6f, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x29, 0x2f, 0x32, 0x2d, 0x48, 0x61, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28,
+ 0x74, 0x29, 0x2a, 0x6e, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x69, 0x6e, 0x28, 0x74, 0x29,
+ 0x2a, 0x6e, 0x5d, 0x7d, 0x2c, 0x6e, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x4c, 0x6c, 0x3d, 0x22,
+ 0x61, 0x75, 0x74, 0x6f, 0x22, 0x3b, 0x6f, 0x61, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x6c, 0x69, 0x6e,
+ 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x69, 0x28, 0x79, 0x29, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x71,
+ 0x6c, 0x3d, 0x6f, 0x61, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x7b, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72,
+ 0x3a, 0x78, 0x69, 0x2c, 0x22, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x2d, 0x63, 0x6c, 0x6f, 0x73,
+ 0x65, 0x64, 0x22, 0x3a, 0x62, 0x69, 0x2c, 0x73, 0x74, 0x65, 0x70, 0x3a, 0x5f, 0x69, 0x2c, 0x22,
+ 0x73, 0x74, 0x65, 0x70, 0x2d, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x22, 0x3a, 0x77, 0x69, 0x2c,
+ 0x22, 0x73, 0x74, 0x65, 0x70, 0x2d, 0x61, 0x66, 0x74, 0x65, 0x72, 0x22, 0x3a, 0x53, 0x69, 0x2c,
+ 0x62, 0x61, 0x73, 0x69, 0x73, 0x3a, 0x7a, 0x69, 0x2c, 0x22, 0x62, 0x61, 0x73, 0x69, 0x73, 0x2d,
+ 0x6f, 0x70, 0x65, 0x6e, 0x22, 0x3a, 0x4c, 0x69, 0x2c, 0x22, 0x62, 0x61, 0x73, 0x69, 0x73, 0x2d,
+ 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x22, 0x3a, 0x71, 0x69, 0x2c, 0x62, 0x75, 0x6e, 0x64, 0x6c,
+ 0x65, 0x3a, 0x54, 0x69, 0x2c, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x3a, 0x45, 0x69,
+ 0x2c, 0x22, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x2d, 0x6f, 0x70, 0x65, 0x6e, 0x22,
+ 0x3a, 0x6b, 0x69, 0x2c, 0x22, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x2d, 0x63, 0x6c,
+ 0x6f, 0x73, 0x65, 0x64, 0x22, 0x3a, 0x4e, 0x69, 0x2c, 0x6d, 0x6f, 0x6e, 0x6f, 0x74, 0x6f, 0x6e,
+ 0x65, 0x3a, 0x46, 0x69, 0x7d, 0x29, 0x3b, 0x71, 0x6c, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63,
+ 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b,
+ 0x74, 0x2e, 0x6b, 0x65, 0x79,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65, 0x20, 0x6e, 0x2e, 0x79, 0x2c,
+ 0x6e, 0x7d, 0x2c, 0x77, 0x69, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x3d, 0x53, 0x69,
+ 0x2c, 0x53, 0x69, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x3d, 0x77, 0x69, 0x2c, 0x6f,
+ 0x61, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x61, 0x72, 0x65, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4f, 0x69, 0x28,
+ 0x79, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x61, 0x72, 0x65, 0x61, 0x2e,
+ 0x72, 0x61, 0x64, 0x69, 0x61, 0x6c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x4f, 0x69, 0x28, 0x48, 0x69, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3d, 0x6e,
+ 0x2e, 0x78, 0x2c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x6e, 0x2e, 0x78, 0x2c, 0x6e, 0x2e,
+ 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3d, 0x6e, 0x2e, 0x78, 0x30,
+ 0x2c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x6e, 0x2e, 0x78, 0x30, 0x2c, 0x6e, 0x2e, 0x6f,
+ 0x75, 0x74, 0x65, 0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31, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x72, 0x28, 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22,
+ 0x41, 0x22, 0x2b, 0x6e, 0x2b, 0x22, 0x2c, 0x22, 0x2b, 0x6e, 0x2b, 0x22, 0x20, 0x30, 0x20, 0x22,
+ 0x2b, 0x20, 0x2b, 0x28, 0x65, 0x3e, 0x6a, 0x61, 0x29, 0x2b, 0x22, 0x2c, 0x31, 0x20, 0x22, 0x2b,
+ 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x6e, 0x2c, 0x74,
+ 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x51, 0x20, 0x30,
+ 0x2c, 0x30, 0x20, 0x22, 0x2b, 0x72, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x4d, 0x65, 0x2c,
+ 0x61, 0x3d, 0x78, 0x65, 0x2c, 0x6f, 0x3d, 0x49, 0x69, 0x2c, 0x6c, 0x3d, 0x70, 0x69, 0x2c, 0x63,
+ 0x3d, 0x76, 0x69, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x72, 0x61, 0x64,
+ 0x69, 0x75, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x6f, 0x3d, 0x45, 0x6e, 0x28, 0x74, 0x29,
+ 0x2c, 0x6e, 0x29, 0x3a, 0x6f, 0x7d, 0x2c, 0x6e, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3f, 0x28, 0x69, 0x3d, 0x45, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a,
+ 0x69, 0x7d, 0x2c, 0x6e, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f,
+ 0x28, 0x61, 0x3d, 0x45, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x61, 0x7d, 0x2c, 0x6e,
+ 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x41, 0x6e, 0x67, 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f,
+ 0x28, 0x6c, 0x3d, 0x45, 0x6e, 0x28, 0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65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x2e, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f,
+ 0x65, 0x28, 0x5a, 0x69, 0x28, 0x74, 0x3d, 0x6e, 0x29, 0x29, 0x3a, 0x74, 0x7d, 0x2c, 0x6e, 0x7d,
+ 0x2c, 0x6f, 0x61, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x6e, 0x2c, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x28, 0x50, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x28, 0x74, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x2c, 0x72, 0x29, 0x29, 0x7c, 0x7c, 0x24, 0x69, 0x29, 0x28, 0x65,
+ 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x2c, 0x72, 0x29, 0x29,
+ 0x7d, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x58, 0x69, 0x2c, 0x65, 0x3d, 0x56, 0x69, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3f, 0x28, 0x74, 0x3d, 0x45, 0x6e, 0x28, 0x65, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x74, 0x7d, 0x2c,
+ 0x6e, 0x2e, 0x73, 0x69, 0x7a, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x65, 0x3d, 0x45, 0x6e,
+ 0x28, 0x74, 0x29, 0x2c, 0x6e, 0x29, 0x3a, 0x65, 0x7d, 0x2c, 0x6e, 0x7d, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x50, 0x6c, 0x3d, 0x6f, 0x61, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x7b, 0x63, 0x69, 0x72, 0x63,
+ 0x6c, 0x65, 0x3a, 0x24, 0x69, 0x2c, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x4d, 0x61,
+ 0x74, 0x68, 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28, 0x6e, 0x2f,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 0x29, 0x7b, 0x69, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x3d, 0x5b, 0x5d,
+ 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x5b, 0x6f, 0x5d, 0x2c, 0x73, 0x3d, 0x2d, 0x31, 0x2c, 0x66, 0x3d, 0x63, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3b, 0x2b, 0x2b, 0x73, 0x3c, 0x66, 0x3b, 0x29, 0x28, 0x65, 0x3d, 0x63, 0x5b,
+ 0x73, 0x5d, 0x29, 0x26, 0x26, 0x51, 0x69, 0x28, 0x65, 0x2c, 0x73, 0x2c, 0x75, 0x2c, 0x72, 0x2c,
+ 0x61, 0x29, 0x2c, 0x74, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x65, 0x29, 0x7d, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x57, 0x69, 0x28, 0x69, 0x2c, 0x75, 0x2c, 0x72, 0x29, 0x7d, 0x2c, 0x41,
+ 0x61, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x72, 0x75, 0x70, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x6e,
+ 0x3f, 0x4f, 0x6c, 0x3a, 0x42, 0x69, 0x28, 0x4b, 0x69, 0x28, 0x6e, 0x29, 0x29, 0x29, 0x7d, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x46, 0x6c, 0x2c, 0x48, 0x6c, 0x2c, 0x4f, 0x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x5b, 0x5d, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20,
+ 0x70, 0x3d, 0x2d, 0x31, 0x2c, 0x76, 0x3d, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b,
+ 0x2b, 0x2b, 0x70, 0x3c, 0x76, 0x3b, 0x29, 0x28, 0x75, 0x3d, 0x65, 0x5b, 0x70, 0x5d, 0x29, 0x26,
+ 0x26, 0x51, 0x69, 0x28, 0x75, 0x2c, 0x70, 0x2c, 0x6f, 0x2c, 0x61, 0x2c, 0x69, 0x29, 0x2c, 0x74,
+ 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x75, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x57, 0x69, 0x28, 0x6c, 0x2c, 0x6f, 0x2c, 0x61, 0x29, 0x7d, 0x2c, 0x49, 0x6c, 0x2e, 0x66, 0x69,
+ 0x6c, 0x74, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x2c, 0x75, 0x3d, 0x5b, 0x5d, 0x3b,
+ 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65,
+ 0x6f, 0x66, 0x20, 0x6e, 0x26, 0x26, 0x28, 0x6e, 0x3d, 0x4f, 0x28, 0x6e, 0x29, 0x29, 0x3b, 0x66,
+ 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x30, 0x2c, 0x61, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x61, 0x3e, 0x69, 0x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75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6d, 0x6f,
+ 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x6f, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x4e, 0x53, 0x28, 0x6f, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x6f, 0x2e, 0x6c, 0x6f, 0x63,
+ 0x61, 0x6c, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x6e,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x6e,
+ 0x3f, 0x65, 0x3a, 0x28, 0x6e, 0x2b, 0x3d, 0x22, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x2c, 0x65, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x6f,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x21, 0x3d, 0x3d, 0x6e, 0x26, 0x26,
+ 0x28, 0x74, 0x3d, 0x61, 0x28, 0x65, 0x2c, 0x6e, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x6f, 0x2c, 0x74, 0x28, 0x6e, 0x29, 0x29, 0x7d,
+ 0x29, 0x7d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x28, 0x6e,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x6e,
+ 0x3f, 0x72, 0x3a, 0x28, 0x6e, 0x2b, 0x3d, 0x22, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x2c, 0x65, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x53,
+ 0x28, 0x6f, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x6f, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x21, 0x3d, 0x3d, 0x6e, 0x26, 0x26,
+ 0x28, 0x74, 0x3d, 0x61, 0x28, 0x65, 0x2c, 0x6e, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x53, 0x28, 0x6f, 0x2e, 0x73, 0x70, 0x61, 0x63,
+ 0x65, 0x2c, 0x6f, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2c, 0x74, 0x28, 0x6e, 0x29, 0x29, 0x7d,
+ 0x29, 0x7d, 0x29, 0x7d, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x32, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x74,
+ 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28,
+ 0x74, 0x2c, 0x6e, 0x5b, 0x74, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74,
+ 0x68, 0x69, 0x73, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73,
+ 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x3d, 0x3d, 0x6e, 0x3f, 0x24, 0x72, 0x3a, 0x4d, 0x72, 0x2c, 0x6f,
+ 0x3d, 0x6f, 0x61, 0x2e, 0x6e, 0x73, 0x2e, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x66, 0x79, 0x28, 0x6e,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4a, 0x69, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2c, 0x22, 0x61, 0x74, 0x74, 0x72, 0x2e, 0x22, 0x2b, 0x6e, 0x2c, 0x74, 0x2c, 0x6f, 0x2e, 0x6c,
+ 0x6f, 0x63, 0x61, 0x6c, 0x3f, 0x69, 0x3a, 0x75, 0x29, 0x7d, 0x2c, 0x49, 0x6c, 0x2e, 0x61, 0x74,
+ 0x74, 0x72, 0x54, 0x77, 0x65, 0x65, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65,
+ 0x28, 0x6e, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x74, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x2c, 0x65, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x75, 0x29,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x26, 0x26, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74,
+ 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x75, 0x2c, 0x72, 0x28, 0x6e, 0x29,
+ 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x6e, 0x2c,
+ 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x3d, 0x74, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x2c, 0x65, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65,
+ 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x53, 0x28, 0x75, 0x2e, 0x73,
+ 0x70, 0x61, 0x63, 0x65, 0x2c, 0x75, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x29, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x26, 0x26, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x53, 0x28, 0x75, 0x2e, 0x73, 0x70, 0x61, 0x63, 0x65,
+ 0x2c, 0x75, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x2c, 0x72, 0x28, 0x6e, 0x29, 0x29, 0x7d, 0x7d,
+ 0x76, 0x61, 0x72, 0x20, 0x75, 0x3d, 0x6f, 0x61, 0x2e, 0x6e, 0x73, 0x2e, 0x71, 0x75, 0x61, 0x6c,
+ 0x69, 0x66, 0x79, 0x28, 0x6e, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x28, 0x22, 0x61, 0x74, 0x74, 0x72, 0x2e, 0x22,
+ 0x2b, 0x6e, 0x2c, 0x75, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x3f, 0x72, 0x3a, 0x65, 0x29, 0x7d,
+ 0x2c, 0x49, 0x6c, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79,
+ 0x28, 0x6e, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x28, 0x65,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x65,
+ 0x3f, 0x75, 0x3a, 0x28, 0x65, 0x2b, 0x3d, 0x22, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x2c, 0x69, 0x3d, 0x74, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64,
+ 0x53, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29,
+ 0x2e, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75,
+ 0x65, 0x28, 0x6e, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x21, 0x3d, 0x3d,
+ 0x65, 0x26, 0x26, 0x28, 0x75, 0x3d, 0x4d, 0x72, 0x28, 0x69, 0x2c, 0x65, 0x29, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79,
+ 0x28, 0x6e, 0x2c, 0x75, 0x28, 0x74, 0x29, 0x2c, 0x72, 0x29, 0x7d, 0x29, 0x7d, 0x29, 0x7d, 0x76,
+ 0x61, 0x72, 0x20, 0x61, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x66, 0x28, 0x33, 0x3e, 0x61, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x6e, 0x29, 0x7b, 0x32, 0x3e, 0x61, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x22, 0x22, 0x29,
+ 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x72, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x29, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x72, 0x2c, 0x6e, 0x5b, 0x72, 0x5d, 0x2c, 0x65, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x72, 0x3d, 0x22,
+ 0x22, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4a, 0x69, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2c, 0x22, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x22, 0x2b, 0x6e, 0x2c, 0x65, 0x2c, 0x69, 0x29,
+ 0x7d, 0x2c, 0x49, 0x6c, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x54, 0x77, 0x65, 0x65, 0x6e, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x65, 0x2c, 0x72, 0x29, 0x7b,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x28, 0x75, 0x2c, 0x69, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x75, 0x2c, 0x69, 0x2c, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x67, 0x65,
+ 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f,
+ 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x6e, 0x29, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x26, 0x26, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e,
+ 0x73, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x6e, 0x2c, 0x61, 0x28,
+ 0x74, 0x29, 0x2c, 0x72, 0x29, 0x7d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x33,
+ 0x26, 0x26, 0x28, 0x72, 0x3d, 0x22, 0x22, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x77,
+ 0x65, 0x65, 0x6e, 0x28, 0x22, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x22, 0x2b, 0x6e, 0x2c, 0x75,
+ 0x29, 0x7d, 0x2c, 0x49, 0x6c, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4a, 0x69,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x74, 0x65, 0x78, 0x74, 0x22, 0x2c, 0x6e, 0x2c, 0x47,
+ 0x69, 0x29, 0x7d, 0x2c, 0x49, 0x6c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x22,
+ 0x65, 0x6e, 0x64, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6e, 0x5d, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3c, 0x32,
+ 0x26, 0x26, 0x28, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x4e, 0x6f, 0x64, 0x65, 0x29, 0x26, 0x26, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43,
+ 0x68, 0x69, 0x6c, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x49, 0x6c,
+ 0x2e, 0x65, 0x61, 0x73, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x64, 0x2c,
+ 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x31, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6e, 0x6f, 0x64, 0x65, 0x28, 0x29, 0x5b, 0x65, 0x5d, 0x5b, 0x74, 0x5d, 0x2e, 0x65, 0x61, 0x73,
+ 0x65, 0x3a, 0x28, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x21, 0x3d, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x26, 0x26, 0x28, 0x6e, 0x3d, 0x6f, 0x61, 0x2e, 0x65,
+ 0x61, 0x73, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x6f, 0x61, 0x2c, 0x61, 0x72, 0x67,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x29, 0x2c, 0x59, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x72, 0x29, 0x7b, 0x72, 0x5b, 0x65, 0x5d,
+ 0x5b, 0x74, 0x5d, 0x2e, 0x65, 0x61, 0x73, 0x65, 0x3d, 0x6e, 0x7d, 0x29, 0x29, 0x7d, 0x2c, 0x49,
+ 0x6c, 0x2e, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69,
+ 0x64, 0x2c, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
+ 0x63, 0x65, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x31, 0x3f, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x28, 0x29, 0x5b, 0x65, 0x5d, 0x5b, 0x74, 0x5d, 0x2e, 0x64,
+ 0x65, 0x6c, 0x61, 0x79, 0x3a, 0x59, 0x28, 0x74, 0x68, 0x69, 0x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0x2c,
+ 0x46, 0x6c, 0x3d, 0x69, 0x7d, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x59, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x75, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x69, 0x3d, 0x75, 0x5b, 0x72, 0x5d, 0x5b, 0x65, 0x5d, 0x3b, 0x28, 0x69, 0x2e, 0x65,
+ 0x76, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x28, 0x69, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x6f,
+ 0x61, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x28, 0x22, 0x73, 0x74, 0x61, 0x72,
+ 0x74, 0x22, 0x2c, 0x22, 0x65, 0x6e, 0x64, 0x22, 0x2c, 0x22, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x72,
+ 0x75, 0x70, 0x74, 0x22, 0x29, 0x29, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7d,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x49,
+ 0x6c, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20,
+ 0x6e, 0x2c, 0x74, 0x2c, 0x65, 0x2c, 0x72, 0x2c, 0x75, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69,
+ 0x64, 0x2c, 0x69, 0x3d, 0x2b, 0x2b, 0x59, 0x6c, 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, 0x6f,
+ 0x6e, 0x2c, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x72, 0x2e, 0x64, 0x75, 0x72,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x29, 0x29, 0x2c, 0x6e, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28,
+ 0x65, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x57, 0x69, 0x28, 0x6f, 0x2c, 0x61,
+ 0x2c, 0x69, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x61, 0x78, 0x69, 0x73,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x6e, 0x2c, 0x63, 0x3d, 0x6f, 0x61, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x29, 0x2c, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x5f, 0x63, 0x68, 0x61,
+ 0x72, 0x74, 0x5f, 0x5f, 0x7c, 0x7c, 0x65, 0x2c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x5f, 0x63, 0x68, 0x61, 0x72, 0x74, 0x5f, 0x5f, 0x3d, 0x65, 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x28,
+ 0x29, 0x2c, 0x68, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x6c, 0x3f, 0x66, 0x2e, 0x74, 0x69,
+ 0x63, 0x6b, 0x73, 0x3f, 0x66, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x6c,
+ 0x79, 0x28, 0x66, 0x2c, 0x6f, 0x29, 0x3a, 0x66, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28,
+ 0x29, 0x3a, 0x6c, 0x2c, 0x67, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x74, 0x3f, 0x66, 0x2e,
+ 0x74, 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3f, 0x66, 0x2e, 0x74, 0x69, 0x63,
+ 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x66, 0x2c,
+ 0x6f, 0x29, 0x3a, 0x79, 0x3a, 0x74, 0x2c, 0x70, 0x3d, 0x63, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63,
+ 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x22, 0x29, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x28, 0x68, 0x2c, 0x66, 0x29, 0x2c, 0x76, 0x3d, 0x70, 0x2e, 0x65, 0x6e, 0x74, 0x65,
+ 0x72, 0x28, 0x29, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x28, 0x22, 0x67, 0x22, 0x2c, 0x22,
+ 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x74, 0x69, 0x63, 0x6b, 0x22, 0x29, 0x2e, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x44,
+ 0x61, 0x29, 0x2c, 0x64, 0x3d, 0x6f, 0x61, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x70, 0x2e, 0x65, 0x78, 0x69, 0x74, 0x28, 0x29, 0x29, 0x2e, 0x73, 0x74, 0x79,
+ 0x6c, 0x65, 0x28, 0x22, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x44, 0x61, 0x29,
+ 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x2c, 0x6d, 0x3d, 0x6f, 0x61, 0x2e, 0x74,
+ 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x70, 0x2e, 0x6f, 0x72, 0x64, 0x65,
+ 0x72, 0x28, 0x29, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x6f, 0x70, 0x61, 0x63,
+ 0x69, 0x74, 0x79, 0x22, 0x2c, 0x31, 0x29, 0x2c, 0x4d, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d,
+ 0x61, 0x78, 0x28, 0x75, 0x2c, 0x30, 0x29, 0x2b, 0x61, 0x2c, 0x78, 0x3d, 0x5a, 0x75, 0x28, 0x66,
+ 0x29, 0x2c, 0x62, 0x3d, 0x63, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28,
+ 0x22, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28,
+ 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x5f, 0x3d, 0x28, 0x62, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28,
+ 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x64,
+ 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x29, 0x2c, 0x6f, 0x61, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73,
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x29, 0x3b, 0x76, 0x2e, 0x61, 0x70, 0x70, 0x65,
+ 0x6e, 0x64, 0x28, 0x22, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x29, 0x2c, 0x76, 0x2e, 0x61, 0x70, 0x70,
+ 0x65, 0x6e, 0x64, 0x28, 0x22, 0x74, 0x65, 0x78, 0x74, 0x22, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x77, 0x2c, 0x53, 0x2c, 0x6b, 0x2c, 0x4e, 0x2c, 0x45, 0x3d, 0x76, 0x2e, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x28, 0x22, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x29, 0x2c, 0x41, 0x3d, 0x6d, 0x2e, 0x73,
+ 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x29, 0x2c, 0x43, 0x3d,
+ 0x70, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x74, 0x65, 0x78, 0x74, 0x22, 0x29,
+ 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x67, 0x29, 0x2c, 0x7a, 0x3d, 0x76, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x28, 0x22, 0x74, 0x65, 0x78, 0x74, 0x22, 0x29, 0x2c, 0x4c, 0x3d, 0x6d, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x74, 0x65, 0x78, 0x74, 0x22, 0x29, 0x2c, 0x71,
+ 0x3d, 0x22, 0x74, 0x6f, 0x70, 0x22, 0x3d, 0x3d, 0x3d, 0x72, 0x7c, 0x7c, 0x22, 0x6c, 0x65, 0x66,
+ 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x72, 0x3f, 0x2d, 0x31, 0x3a, 0x31, 0x3b, 0x69, 0x66, 0x28, 0x22,
+ 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x22, 0x3d, 0x3d, 0x3d, 0x72, 0x7c, 0x7c, 0x22, 0x74, 0x6f,
+ 0x70, 0x22, 0x3d, 0x3d, 0x3d, 0x72, 0x3f, 0x28, 0x6e, 0x3d, 0x6e, 0x61, 0x2c, 0x77, 0x3d, 0x22,
+ 0x78, 0x22, 0x2c, 0x6b, 0x3d, 0x22, 0x79, 0x22, 0x2c, 0x53, 0x3d, 0x22, 0x78, 0x32, 0x22, 0x2c,
+ 0x4e, 0x3d, 0x22, 0x79, 0x32, 0x22, 0x2c, 0x43, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x64,
+ 0x79, 0x22, 0x2c, 0x30, 0x3e, 0x71, 0x3f, 0x22, 0x30, 0x65, 0x6d, 0x22, 0x3a, 0x22, 0x2e, 0x37,
+ 0x31, 0x65, 0x6d, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x74, 0x65, 0x78,
+ 0x74, 0x2d, 0x61, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x22, 0x2c, 0x22, 0x6d, 0x69, 0x64, 0x64, 0x6c,
+ 0x65, 0x22, 0x29, 0x2c, 0x5f, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x64, 0x22, 0x2c, 0x22,
+ 0x4d, 0x22, 0x2b, 0x78, 0x5b, 0x30, 0x5d, 0x2b, 0x22, 0x2c, 0x22, 0x2b, 0x71, 0x2a, 0x69, 0x2b,
+ 0x22, 0x56, 0x30, 0x48, 0x22, 0x2b, 0x78, 0x5b, 0x31, 0x5d, 0x2b, 0x22, 0x56, 0x22, 0x2b, 0x71,
+ 0x2a, 0x69, 0x29, 0x29, 0x3a, 0x28, 0x6e, 0x3d, 0x74, 0x61, 0x2c, 0x77, 0x3d, 0x22, 0x79, 0x22,
+ 0x2c, 0x6b, 0x3d, 0x22, 0x78, 0x22, 0x2c, 0x53, 0x3d, 0x22, 0x79, 0x32, 0x22, 0x2c, 0x4e, 0x3d,
+ 0x22, 0x78, 0x32, 0x22, 0x2c, 0x43, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x64, 0x79, 0x22,
+ 0x2c, 0x22, 0x2e, 0x33, 0x32, 0x65, 0x6d, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28,
+ 0x22, 0x74, 0x65, 0x78, 0x74, 0x2d, 0x61, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x22, 0x2c, 0x30, 0x3e,
+ 0x71, 0x3f, 0x22, 0x65, 0x6e, 0x64, 0x22, 0x3a, 0x22, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x29,
+ 0x2c, 0x5f, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x64, 0x22, 0x2c, 0x22, 0x4d, 0x22, 0x2b,
+ 0x71, 0x2a, 0x69, 0x2b, 0x22, 0x2c, 0x22, 0x2b, 0x78, 0x5b, 0x30, 0x5d, 0x2b, 0x22, 0x48, 0x30,
+ 0x56, 0x22, 0x2b, 0x78, 0x5b, 0x31, 0x5d, 0x2b, 0x22, 0x48, 0x22, 0x2b, 0x71, 0x2a, 0x69, 0x29,
+ 0x29, 0x2c, 0x45, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x4e, 0x2c, 0x71, 0x2a, 0x75, 0x29, 0x2c,
+ 0x7a, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x6b, 0x2c, 0x71, 0x2a, 0x4d, 0x29, 0x2c, 0x41, 0x2e,
+ 0x61, 0x74, 0x74, 0x72, 0x28, 0x53, 0x2c, 0x30, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x4e,
+ 0x2c, 0x71, 0x2a, 0x75, 0x29, 0x2c, 0x4c, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x77, 0x2c, 0x30,
+ 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x6b, 0x2c, 0x71, 0x2a, 0x4d, 0x29, 0x2c, 0x66, 0x2e,
+ 0x72, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x61, 0x6e, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x54,
+ 0x3d, 0x66, 0x2c, 0x52, 0x3d, 0x54, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x42, 0x61, 0x6e, 0x64,
+ 0x28, 0x29, 0x2f, 0x32, 0x3b, 0x73, 0x3d, 0x66, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x54, 0x28, 0x6e, 0x29,
+ 0x2b, 0x52, 0x7d, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x73, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65,
+ 0x42, 0x61, 0x6e, 0x64, 0x3f, 0x73, 0x3d, 0x66, 0x3a, 0x64, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28,
+ 0x6e, 0x2c, 0x66, 0x2c, 0x73, 0x29, 0x3b, 0x76, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0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, 0x2e, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x53, 0x69, 0x7a, 0x65,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x28, 0x69, 0x3d, 0x2b, 0x74, 0x2c, 0x6e, 0x29, 0x3a, 0x69, 0x7d,
+ 0x2c, 0x6e, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x3f, 0x28, 0x61, 0x3d, 0x2b, 0x74, 0x2c, 0x6e, 0x29, 0x3a, 0x61, 0x7d, 0x2c, 0x6e,
+ 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x64, 0x69, 0x76, 0x69, 0x64, 0x65, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x26, 0x26, 0x6e, 0x7d, 0x2c, 0x6e, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x5a, 0x6c, 0x3d,
+ 0x22, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x22, 0x2c, 0x56, 0x6c, 0x3d, 0x7b, 0x74, 0x6f, 0x70,
+ 0x3a, 0x31, 0x2c, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x31, 0x2c, 0x62, 0x6f, 0x74, 0x74, 0x6f,
+ 0x6d, 0x3a, 0x31, 0x2c, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x31, 0x7d, 0x3b, 0x6f, 0x61, 0x2e, 0x73,
+ 0x76, 0x67, 0x2e, 0x62, 0x72, 0x75, 0x73, 0x68, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x74,
+ 0x29, 0x7b, 0x74, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6f, 0x61, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28,
+ 0x22, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x2d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22,
+ 0x2c, 0x22, 0x61, 0x6c, 0x6c, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x2d,
+ 0x77, 0x65, 0x62, 0x6b, 0x69, 0x74, 0x2d, 0x74, 0x61, 0x70, 0x2d, 0x68, 0x69, 0x67, 0x68, 0x6c,
+ 0x69, 0x67, 0x68, 0x74, 0x2d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x22, 0x2c, 0x22, 0x72, 0x67, 0x62,
+ 0x61, 0x28, 0x30, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x30, 0x29, 0x22, 0x29, 0x2e, 0x6f, 0x6e, 0x28,
+ 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x62, 0x72, 0x75, 0x73, 0x68,
+ 0x22, 0x2c, 0x69, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x73, 0x74,
+ 0x61, 0x72, 0x74, 0x2e, 0x62, 0x72, 0x75, 0x73, 0x68, 0x22, 0x2c, 0x69, 0x29, 0x2c, 0x61, 0x3d,
+ 0x74, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2e, 0x62, 0x61,
+ 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28,
+ 0x5b, 0x30, 0x5d, 0x29, 0x3b, 0x61, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61,
+ 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x22, 0x29, 0x2e, 0x61, 0x74,
+ 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x62, 0x61, 0x63, 0x6b,
+ 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22,
+ 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x22, 0x68, 0x69, 0x64,
+ 0x64, 0x65, 0x6e, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x63, 0x75, 0x72,
+ 0x73, 0x6f, 0x72, 0x22, 0x2c, 0x22, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x68, 0x61, 0x69, 0x72, 0x22,
+ 0x29, 0x2c, 0x74, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2e,
+ 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x5b, 0x30,
+ 0x5d, 0x29, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e,
+ 0x64, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x29,
+ 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x2c,
+ 0x22, 0x6d, 0x6f, 0x76, 0x65, 0x22, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6f, 0x3d, 0x74, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2e, 0x72, 0x65, 0x73, 0x69,
+ 0x7a, 0x65, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x76, 0x2c, 0x79, 0x29, 0x3b, 0x6f,
+ 0x2e, 0x65, 0x78, 0x69, 0x74, 0x28, 0x29, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29,
+ 0x2c, 0x6f, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e,
+ 0x64, 0x28, 0x22, 0x67, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x22, 0x2b,
+ 0x6e, 0x7d, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x63, 0x75, 0x72, 0x73, 0x6f,
+ 0x72, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x58, 0x6c, 0x5b, 0x6e, 0x5d, 0x7d, 0x29, 0x2e, 0x61, 0x70,
+ 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74,
+ 0x72, 0x28, 0x22, 0x78, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2f, 0x5b, 0x65, 0x77, 0x5d, 0x24, 0x2f, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x28, 0x6e, 0x29, 0x3f, 0x2d, 0x33, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x7d,
+ 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x79, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2f, 0x5e, 0x5b,
+ 0x6e, 0x73, 0x5d, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x6e, 0x29, 0x3f, 0x2d, 0x33, 0x3a,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x22, 0x2c, 0x36, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65, 0x69,
+ 0x67, 0x68, 0x74, 0x22, 0x2c, 0x36, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x76,
+ 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x22, 0x68, 0x69, 0x64, 0x64,
+ 0x65, 0x6e, 0x22, 0x29, 0x2c, 0x6f, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x64, 0x69,
+ 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0x2c, 0x6e, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x28, 0x29,
+ 0x3f, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x6c, 0x2c, 0x66, 0x3d, 0x6f, 0x61, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x69, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x2c, 0x68, 0x3d, 0x6f, 0x61, 0x2e, 0x74, 0x72, 0x61, 0x6e,
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x3b, 0x63, 0x26, 0x26, 0x28, 0x6c, 0x3d,
+ 0x5a, 0x75, 0x28, 0x63, 0x29, 0x2c, 0x68, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x78, 0x22,
+ 0x2c, 0x6c, 0x5b, 0x30, 0x5d, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x22, 0x2c, 0x6c, 0x5b, 0x31, 0x5d, 0x2d, 0x6c, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x72,
+ 0x28, 0x66, 0x29, 0x29, 0x2c, 0x73, 0x26, 0x26, 0x28, 0x6c, 0x3d, 0x5a, 0x75, 0x28, 0x73, 0x29,
+ 0x2c, 0x68, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x79, 0x22, 0x2c, 0x6c, 0x5b, 0x30, 0x5d,
+ 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c,
+ 0x6c, 0x5b, 0x31, 0x5d, 0x2d, 0x6c, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x75, 0x28, 0x66, 0x29, 0x29,
+ 0x2c, 0x65, 0x28, 0x66, 0x29, 0x7d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x65, 0x28, 0x6e, 0x29, 0x7b, 0x6e, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c,
+ 0x6c, 0x28, 0x22, 0x2e, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74,
+ 0x72, 0x28, 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x22, 0x2b, 0x66, 0x5b, 0x2b,
+ 0x2f, 0x65, 0x24, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x6e, 0x29, 0x5d, 0x2b, 0x22, 0x2c,
+ 0x22, 0x2b, 0x68, 0x5b, 0x2b, 0x2f, 0x5e, 0x73, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x6e,
+ 0x29, 0x5d, 0x2b, 0x22, 0x29, 0x22, 0x7d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x72, 0x28, 0x6e, 0x29, 0x7b, 0x6e, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28,
+ 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28,
+ 0x22, 0x78, 0x22, 0x2c, 0x66, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x6e, 0x2e, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x2c, 0x2e,
+ 0x6e, 0x3e, 0x72, 0x65, 0x63, 0x74, 0x2c, 0x2e, 0x73, 0x3e, 0x72, 0x65, 0x63, 0x74, 0x22, 0x29,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x66, 0x5b,
+ 0x31, 0x5d, 0x2d, 0x66, 0x5b, 0x30, 0x5d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x75, 0x28, 0x6e, 0x29, 0x7b, 0x6e, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28,
+ 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28,
+ 0x22, 0x79, 0x22, 0x2c, 0x68, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x6e, 0x2e, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x2c, 0x2e,
+ 0x65, 0x3e, 0x72, 0x65, 0x63, 0x74, 0x2c, 0x2e, 0x77, 0x3e, 0x72, 0x65, 0x63, 0x74, 0x22, 0x29,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c, 0x68,
+ 0x5b, 0x31, 0x5d, 0x2d, 0x68, 0x5b, 0x30, 0x5d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x69, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x69, 0x28, 0x29, 0x7b, 0x33, 0x32, 0x3d, 0x3d, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
+ 0x2e, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x26, 0x26, 0x28, 0x43, 0x7c, 0x7c, 0x28, 0x4d,
+ 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x4c, 0x5b, 0x30, 0x5d, 0x2d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 0x79, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x62, 0x72,
+ 0x75, 0x73, 0x68, 0x22, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6b,
+ 0x65, 0x79, 0x75, 0x70, 0x2e, 0x62, 0x72, 0x75, 0x73, 0x68, 0x22, 0x2c, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x29, 0x2c, 0x7a, 0x28, 0x29, 0x2c, 0x77, 0x28, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x62,
+ 0x72, 0x75, 0x73, 0x68, 0x65, 0x6e, 0x64, 0x22, 0x7d, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x4d,
+ 0x2c, 0x78, 0x2c, 0x62, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x5f, 0x3d, 0x6f, 0x61, 0x2e, 0x73,
+ 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74,
+ 0x61, 0x72, 0x67, 0x65, 0x74, 0x29, 0x2c, 0x77, 0x3d, 0x6c, 0x2e, 0x6f, 0x66, 0x28, 0x62, 0x2c,
+ 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x6b, 0x3d, 0x6f, 0x61, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x62, 0x29, 0x2c, 0x4e, 0x3d, 0x5f, 0x2e, 0x64, 0x61,
+ 0x74, 0x75, 0x6d, 0x28, 0x29, 0x2c, 0x45, 0x3d, 0x21, 0x2f, 0x5e, 0x28, 0x6e, 0x7c, 0x73, 0x29,
+ 0x24, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x4e, 0x29, 0x26, 0x26, 0x63, 0x2c, 0x41, 0x3d,
+ 0x21, 0x2f, 0x5e, 0x28, 0x65, 0x7c, 0x77, 0x29, 0x24, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28,
+ 0x4e, 0x29, 0x26, 0x26, 0x73, 0x2c, 0x43, 0x3d, 0x5f, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65,
+ 0x64, 0x28, 0x22, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x29, 0x2c, 0x7a, 0x3d, 0x57, 0x28,
+ 0x62, 0x29, 0x2c, 0x4c, 0x3d, 0x6f, 0x61, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x28, 0x62, 0x29,
+ 0x2c, 0x71, 0x3d, 0x6f, 0x61, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x28, 0x62,
+ 0x29, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6b, 0x65, 0x79, 0x64, 0x6f, 0x77, 0x6e, 0x2e, 0x62,
+ 0x72, 0x75, 0x73, 0x68, 0x22, 0x2c, 0x69, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6b, 0x65, 0x79,
+ 0x75, 0x70, 0x2e, 0x62, 0x72, 0x75, 0x73, 0x68, 0x22, 0x2c, 0x76, 0x29, 0x3b, 0x69, 0x66, 0x28,
+ 0x6f, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64,
+ 0x54, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x3f, 0x71, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x74, 0x6f,
+ 0x75, 0x63, 0x68, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x62, 0x72, 0x75, 0x73, 0x68, 0x22, 0x2c, 0x64,
+ 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x74, 0x6f, 0x75, 0x63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65, 0x28, 0x22, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72,
+ 0x22, 0x2c, 0x5f, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x63, 0x75, 0x72, 0x73, 0x6f,
+ 0x72, 0x22, 0x29, 0x29, 0x2c, 0x77, 0x28, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x62, 0x72,
+ 0x75, 0x73, 0x68, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x7d, 0x29, 0x2c, 0x64, 0x28, 0x29, 0x7d,
+ 0x76, 0x61, 0x72, 0x20, 0x61, 0x2c, 0x6f, 0x2c, 0x6c, 0x3d, 0x4e, 0x28, 0x6e, 0x2c, 0x22, 0x62,
+ 0x72, 0x75, 0x73, 0x68, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x2c, 0x22, 0x62, 0x72, 0x75, 0x73,
+ 0x68, 0x22, 0x2c, 0x22, 0x62, 0x72, 0x75, 0x73, 0x68, 0x65, 0x6e, 0x64, 0x22, 0x29, 0x2c, 0x63,
+ 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x73, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x66, 0x3d, 0x5b,
+ 0x30, 0x2c, 0x30, 0x5d, 0x2c, 0x68, 0x3d, 0x5b, 0x30, 0x2c, 0x30, 0x5d, 0x2c, 0x67, 0x3d, 0x21,
+ 0x30, 0x2c, 0x70, 0x3d, 0x21, 0x30, 0x2c, 0x76, 0x3d, 0x24, 0x6c, 0x5b, 0x30, 0x5d, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 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, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x62,
+ 0x72, 0x75, 0x73, 0x68, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x7d, 0x29, 0x7d, 0x29, 0x2e, 0x74,
+ 0x77, 0x65, 0x65, 0x6e, 0x28, 0x22, 0x62, 0x72, 0x75, 0x73, 0x68, 0x3a, 0x62, 0x72, 0x75, 0x73,
+ 0x68, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x65, 0x3d, 0x78, 0x72, 0x28, 0x66, 0x2c, 0x74, 0x2e, 0x78, 0x29, 0x2c, 0x72, 0x3d,
+ 0x78, 0x72, 0x28, 0x68, 0x2c, 0x74, 0x2e, 0x79, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x3d, 0x6f, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x75, 0x29, 0x7b, 0x66, 0x3d, 0x74, 0x2e, 0x78, 0x3d, 0x65, 0x28, 0x75, 0x29,
+ 0x2c, 0x68, 0x3d, 0x74, 0x2e, 0x79, 0x3d, 0x72, 0x28, 0x75, 0x29, 0x2c, 0x6e, 0x28, 0x7b, 0x74,
+ 0x79, 0x70, 0x65, 0x3a, 0x22, 0x62, 0x72, 0x75, 0x73, 0x68, 0x22, 0x2c, 0x6d, 0x6f, 0x64, 0x65,
+ 0x3a, 0x22, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x2e, 0x65,
+ 0x61, 0x63, 0x68, 0x28, 0x22, 0x65, 0x6e, 0x64, 0x2e, 0x62, 0x72, 0x75, 0x73, 0x68, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x61, 0x3d, 0x74, 0x2e, 0x69,
+ 0x2c, 0x6f, 0x3d, 0x74, 0x2e, 0x6a, 0x2c, 0x6e, 0x28, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22,
+ 0x62, 0x72, 0x75, 0x73, 0x68, 0x22, 0x2c, 0x6d, 0x6f, 0x64, 0x65, 0x3a, 0x22, 0x72, 0x65, 0x73,
+ 0x69, 0x7a, 0x65, 0x22, 0x7d, 0x29, 0x2c, 0x6e, 0x28, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22,
+ 0x62, 0x72, 0x75, 0x73, 0x68, 0x65, 0x6e, 0x64, 0x22, 0x7d, 0x29, 0x7d, 0x29, 0x3a, 0x28, 0x6e,
+ 0x28, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x62, 0x72, 0x75, 0x73, 0x68, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x22, 0x7d, 0x29, 0x2c, 0x6e, 0x28, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x62,
+ 0x72, 0x75, 0x73, 0x68, 0x22, 0x2c, 0x6d, 0x6f, 0x64, 0x65, 0x3a, 0x22, 0x72, 0x65, 0x73, 0x69,
+ 0x7a, 0x65, 0x22, 0x7d, 0x29, 0x2c, 0x6e, 0x28, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x62,
+ 0x72, 0x75, 0x73, 0x68, 0x65, 0x6e, 0x64, 0x22, 0x7d, 0x29, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x6e,
+ 0x2e, 0x78, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0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d, 0x7b, 0x6e,
+ 0x3a, 0x22, 0x6e, 0x73, 0x2d, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x2c, 0x65, 0x3a, 0x22,
+ 0x65, 0x77, 0x2d, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x2c, 0x73, 0x3a, 0x22, 0x6e, 0x73,
+ 0x2d, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x2c, 0x77, 0x3a, 0x22, 0x65, 0x77, 0x2d, 0x72,
+ 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x2c, 0x6e, 0x77, 0x3a, 0x22, 0x6e, 0x77, 0x73, 0x65, 0x2d,
+ 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x2c, 0x6e, 0x65, 0x3a, 0x22, 0x6e, 0x65, 0x73, 0x77,
+ 0x2d, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x2c, 0x73, 0x65, 0x3a, 0x22, 0x6e, 0x77, 0x73,
+ 0x65, 0x2d, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x2c, 0x73, 0x77, 0x3a, 0x22, 0x6e, 0x65,
+ 0x73, 0x77, 0x2d, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x7d, 0x2c, 0x24, 0x6c, 0x3d, 0x5b,
+ 0x5b, 0x22, 0x6e, 0x22, 0x2c, 0x22, 0x65, 0x22, 0x2c, 0x22, 0x73, 0x22, 0x2c, 0x22, 0x77, 0x22,
+ 0x2c, 0x22, 0x6e, 0x77, 0x22, 0x2c, 0x22, 0x6e, 0x65, 0x22, 0x2c, 0x22, 0x73, 0x65, 0x22, 0x2c,
+ 0x22, 0x73, 0x77, 0x22, 0x5d, 0x2c, 0x5b, 0x22, 0x65, 0x22, 0x2c, 0x22, 0x77, 0x22, 0x5d, 0x2c,
+ 0x5b, 0x22, 0x6e, 0x22, 0x2c, 0x22,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0x54, 0x69, 0x6d,
+ 0x65, 0x28, 0x29, 0x2b, 0x36, 0x65, 0x34, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f,
+ 0x6f, 0x72, 0x28, 0x74, 0x29, 0x29, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74,
+ 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x68, 0x6f, 0x2e, 0x6d,
+ 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x3d, 0x68, 0x6f, 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65,
+ 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x68, 0x6f, 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65,
+ 0x73, 0x2e, 0x75, 0x74, 0x63, 0x3d, 0x68, 0x6f, 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x2e,
+ 0x75, 0x74, 0x63, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c, 0x68, 0x6f, 0x2e, 0x68, 0x6f, 0x75,
+ 0x72, 0x3d, 0x4f, 0x6e, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x3d, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65,
+ 0x7a, 0x6f, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x2f, 0x36, 0x30, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x67, 0x6f, 0x28, 0x33, 0x36,
+ 0x65, 0x35, 0x2a, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x6e,
+ 0x2f, 0x33, 0x36, 0x65, 0x35, 0x2d, 0x74, 0x29, 0x2b, 0x74, 0x29, 0x29, 0x7d, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x6e, 0x2e, 0x73, 0x65,
+ 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28,
+ 0x29, 0x2b, 0x33, 0x36, 0x65, 0x35, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f,
+ 0x72, 0x28, 0x74, 0x29, 0x29, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x48,
+ 0x6f, 0x75, 0x72, 0x73, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x68, 0x6f, 0x2e, 0x68, 0x6f, 0x75, 0x72,
+ 0x73, 0x3d, 0x68, 0x6f, 0x2e, 0x68, 0x6f, 0x75, 0x72, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x2c,
+ 0x68, 0x6f, 0x2e, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x3d, 0x68, 0x6f, 0x2e,
+ 0x68, 0x6f, 0x75, 0x72, 0x2e, 0x75, 0x74, 0x63, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x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x6e, 0x74, 0x68, 0x2e, 0x75, 0x74, 0x63, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x47, 0x6c, 0x3d, 0x5b, 0x31, 0x65, 0x33, 0x2c, 0x35, 0x65, 0x33, 0x2c,
+ 0x31, 0x35, 0x65, 0x33, 0x2c, 0x33, 0x65, 0x34, 0x2c, 0x36, 0x65, 0x34, 0x2c, 0x33, 0x65, 0x35,
+ 0x2c, 0x39, 0x65, 0x35, 0x2c, 0x31, 0x38, 0x65, 0x35, 0x2c, 0x33, 0x36, 0x65, 0x35, 0x2c, 0x31,
+ 0x30, 0x38, 0x65, 0x35, 0x2c, 0x32, 0x31, 0x36, 0x65, 0x35, 0x2c, 0x34, 0x33, 0x32, 0x65, 0x35,
+ 0x2c, 0x38, 0x36, 0x34, 0x65, 0x35, 0x2c, 0x31, 0x37, 0x32, 0x38, 0x65, 0x35, 0x2c, 0x36, 0x30,
+ 0x34, 0x38, 0x65, 0x35, 0x2c, 0x32, 0x35, 0x39, 0x32, 0x65, 0x36, 0x2c, 0x37, 0x37, 0x37, 0x36,
+ 0x65, 0x36, 0x2c, 0x33, 0x31, 0x35, 0x33, 0x36, 0x65, 0x36, 0x5d, 0x2c, 0x4b, 0x6c, 0x3d, 0x5b,
+ 0x5b, 0x68, 0x6f, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x2c, 0x31, 0x5d, 0x2c, 0x5b, 0x68,
+ 0x6f, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x2c, 0x35, 0x5d, 0x2c, 0x5b, 0x68, 0x6f, 0x2e,
+ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x2c, 0x31, 0x35, 0x5d, 0x2c, 0x5b, 0x68, 0x6f, 0x2e, 0x73,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x2c, 0x33, 0x30, 0x5d, 0x2c, 0x5b, 0x68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 0x6f, 0x75, 0x72, 0x73, 0x28, 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22,
+ 0x25, 0x61, 0x20, 0x25, 0x64, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x44,
+ 0x61, 0x79, 0x28, 0x29, 0x26, 0x26, 0x31, 0x21, 0x3d, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61,
+ 0x74, 0x65, 0x28, 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22, 0x25, 0x62, 0x20, 0x25, 0x64, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x31, 0x21, 0x3d, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28,
+ 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22, 0x25, 0x42, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67,
+ 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22, 0x25, 0x59,
+ 0x22, 0x2c, 0x7a, 0x74, 0x5d, 0x5d, 0x29, 0x2c, 0x6e, 0x63, 0x3d, 0x7b, 0x72, 0x61, 0x6e, 0x67,
+ 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74,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e, 0x5b, 0x31, 0x5d, 0x5d, 0x7d, 0x29, 0x2c, 0x65, 0x63, 0x3d, 0x57,
+ 0x6c, 0x2e, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x28, 0x5b, 0x5b, 0x22, 0x2e, 0x25, 0x4c, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x69, 0x6c, 0x6c, 0x69,
+ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22, 0x3a, 0x25,
+ 0x53, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x53, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22, 0x25, 0x49, 0x3a, 0x25,
+ 0x4d, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x69,
+ 0x6e, 0x75, 0x74, 0x65, 0x73, 0x28, 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22, 0x25, 0x49, 0x20, 0x25,
+ 0x70, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x48, 0x6f,
+ 0x75, 0x72, 0x73, 0x28, 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22, 0x25, 0x61, 0x20, 0x25, 0x64, 0x22,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61, 0x79, 0x28,
+ 0x29, 0x26, 0x26, 0x31, 0x21, 0x3d, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61,
+ 0x74, 0x65, 0x28, 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22, 0x25, 0x62, 0x20, 0x25, 0x64, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x31, 0x21, 0x3d, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61,
+ 0x74, 0x65, 0x28, 0x29, 0x7d, 0x5d, 0x2c, 0x5b, 0x22, 0x25, 0x42, 0x22, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x7d,
+ 0x5d, 0x2c, 0x5b, 0x22, 0x25, 0x59, 0x22, 0x2c, 0x7a, 0x74, 0x5d, 0x5d, 0x29, 0x3b, 0x74, 0x63,
+ 0x2e, 0x79, 0x65, 0x61, 0x72, 0x3d, 0x68, 0x6f, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x2e, 0x75, 0x74,
+ 0x63, 0x2c, 0x68, 0x6f, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x75, 0x74, 0x63, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x72, 0x61, 0x28, 0x6f, 0x61, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6c, 0x69, 0x6e,
+ 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x74, 0x63, 0x2c, 0x65, 0x63, 0x29, 0x7d, 0x2c, 0x6f, 0x61,
+ 0x2e, 0x74, 0x65, 0x78, 0x74, 0x3d, 0x41, 0x6e, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x72, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x65, 0x78, 0x74, 0x7d, 0x29, 0x2c, 0x6f, 0x61, 0x2e,
+ 0x6a, 0x73, 0x6f, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c,
+ 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x43, 0x6e, 0x28, 0x6e, 0x2c, 0x22,
+ 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x73, 0x6f, 0x6e,
+ 0x22, 0x2c, 0x69, 0x61, 0x2c, 0x74, 0x29, 0x7d, 0x2c, 0x6f, 0x61, 0x2e, 0x68, 0x74, 0x6d, 0x6c,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x2c, 0x74, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x43, 0x6e, 0x28, 0x6e, 0x2c, 0x22, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x2c, 0x61, 0x61, 0x2c, 0x74, 0x29, 0x7d, 0x2c, 0x6f, 0x61,
+ 0x2e, 0x78, 0x6d, 0x6c, 0x3d, 0x41, 0x6e, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x72, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x58, 0x4d, 0x4c, 0x7d, 0x29, 0x2c, 0x22, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x64, 0x65,
+ 0x66, 0x69, 0x6e, 0x65, 0x26, 0x26, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x2e, 0x61, 0x6d, 0x64,
+ 0x3f, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x33, 0x3d, 0x6f, 0x61, 0x2c, 0x64, 0x65, 0x66,
+ 0x69, 0x6e, 0x65, 0x28, 0x6f, 0x61, 0x29, 0x29, 0x3a, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
+ 0x26, 0x26, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73,
+ 0x3f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x3d,
+ 0x6f, 0x61, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x33, 0x3d, 0x6f, 0x61, 0x7d, 0x28, 0x29,
+ 0x3b,
+
+};
+static const unsigned char gjs_jquery_min_jsData[] = {
+ 0x2f, 0x2a, 0x21, 0x20, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x20, 0x76, 0x31, 0x2e, 0x31, 0x32,
+ 0x2e, 0x30, 0x20, 0x7c, 0x20, 0x28, 0x63, 0x29, 0x20, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x20,
+ 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7c, 0x20, 0x6a, 0x71, 0x75,
+ 0x65, 0x72, 0x79, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20,
+ 0x2a, 0x2f, 0x0a, 0x21, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65,
+ 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x26, 0x26, 0x22, 0x6f, 0x62, 0x6a, 0x65,
+ 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x64, 0x75,
+ 0x6c, 0x65, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x3f, 0x6d, 0x6f, 0x64, 0x75, 0x6c,
+ 0x65, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x3d, 0x61, 0x2e, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x3f, 0x62, 0x28, 0x61, 0x2c, 0x21, 0x30, 0x29, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x2e, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x6e, 0x65,
+ 0x77, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x20,
+ 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x73, 0x20, 0x61, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f,
+ 0x77, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x61, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x22, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x28, 0x61, 0x29, 0x7d,
+ 0x3a, 0x62, 0x28, 0x61, 0x29, 0x7d, 0x28, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f,
+ 0x77, 0x3f, 0x77, 0x69, 0x6e, 0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69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e,
+ 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c, 0x67, 0x65, 0x74, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x3f, 0x30, 0x3e, 0x61, 0x3f, 0x74,
+ 0x68, 0x69, 0x73, 0x5b, 0x61, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x5d, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x61, 0x5d, 0x3a, 0x65, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c, 0x70, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61,
+ 0x63, 0x6b, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6e, 0x2e, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x28, 0x29, 0x2c,
+ 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x2e, 0x70, 0x72, 0x65, 0x76,
+ 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x62, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x74, 0x65, 0x78, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65,
+ 0x78, 0x74, 0x2c, 0x62, 0x7d, 0x2c, 0x65, 0x61, 0x63, 0x68, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e,
+ 0x65, 0x61, 0x63, 0x68, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29, 0x7d, 0x2c, 0x6d, 0x61,
+ 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x53, 0x74,
+ 0x61, 0x63, 0x6b, 0x28, 0x6e, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x62, 0x2c, 0x63, 0x2c, 0x62,
+ 0x29, 0x7d, 0x29, 0x29, 0x7d, 0x2c, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x28, 0x65, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x29, 0x29, 0x7d, 0x2c, 0x66, 0x69, 0x72, 0x73, 0x74, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x71, 0x28, 0x30, 0x29, 0x7d, 0x2c, 0x6c, 0x61, 0x73, 0x74, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x71, 0x28, 0x2d, 0x31, 0x29, 0x7d, 0x2c, 0x65,
+ 0x71, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x62, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c,
+ 0x63, 0x3d, 0x2b, 0x61, 0x2b, 0x28, 0x30, 0x3e, 0x61, 0x3f, 0x62, 0x3a, 0x30, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x53,
+ 0x74, 0x61, 0x63, 0x6b, 0x28, 0x63, 0x3e, 0x3d, 0x30, 0x26, 0x26, 0x62, 0x3e, 0x63, 0x3f, 0x5b,
+ 0x74, 0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 0x3d, 0x67, 0x5b, 0x64, 0x5d, 0x2c, 0x63, 0x3d, 0x65, 0x5b, 0x64, 0x5d, 0x2c, 0x67, 0x21, 0x3d,
+ 0x3d, 0x63, 0x26, 0x26, 0x28, 0x6a, 0x26, 0x26, 0x63, 0x26, 0x26, 0x28, 0x6e, 0x2e, 0x69, 0x73,
+ 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x28, 0x63, 0x29, 0x7c, 0x7c,
+ 0x28, 0x62, 0x3d, 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x63, 0x29, 0x29,
+ 0x29, 0x3f, 0x28, 0x62, 0x3f, 0x28, 0x62, 0x3d, 0x21, 0x31, 0x2c, 0x66, 0x3d, 0x61, 0x26, 0x26,
+ 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x61, 0x29, 0x3f, 0x61, 0x3a, 0x5b,
+ 0x5d, 0x29, 0x3a, 0x66, 0x3d, 0x61, 0x26, 0x26, 0x6e, 0x2e, 0x69, 0x73, 0x50, 0x6c, 0x61, 0x69,
+ 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x28, 0x61, 0x29, 0x3f, 0x61, 0x3a, 0x7b, 0x7d, 0x2c,
+ 0x67, 0x5b, 0x64, 0x5d, 0x3d, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x6a, 0x2c,
+ 0x66, 0x2c, 0x63, 0x29, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x63,
+ 0x26, 0x26, 0x28, 0x67, 0x5b, 0x64, 0x5d, 0x3d, 0x63, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x67, 0x7d, 0x2c, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b,
+ 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f, 0x3a, 0x22, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x22,
+ 0x2b, 0x28, 0x6d, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x28,
+ 0x29, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x2f, 0x5c, 0x44, 0x2f, 0x67,
+ 0x2c, 0x22, 0x22, 0x29, 0x2c, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x79, 0x3a, 0x21, 0x30, 0x2c,
+ 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x45, 0x72, 0x72, 0x6f,
+ 0x72, 0x28, 0x61, 0x29, 0x7d, 0x2c, 0x6e, 0x6f, 0x6f, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x7d, 0x2c, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x28, 0x61, 0x29, 0x7d, 0x2c, 0x69, 0x73, 0x41,
+ 0x72, 0x72, 0x61, 0x79, 0x3a, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72,
+ 0x61, 0x79, 0x7c, 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x61, 0x72, 0x72, 0x61, 0x79, 0x22, 0x3d, 0x3d, 0x3d,
+ 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x28, 0x61, 0x29, 0x7d, 0x2c, 0x69, 0x73, 0x57, 0x69, 0x6e,
+ 0x64, 0x6f, 0x77, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x26, 0x26,
+ 0x61, 0x3d, 0x3d, 0x61, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x7d, 0x2c, 0x69, 0x73, 0x4e,
+ 0x75, 0x6d, 0x65, 0x72, 0x69, 0x63, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x61, 0x26, 0x26, 0x61, 0x2e, 0x74, 0x6f,
+ 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21,
+ 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x61, 0x29, 0x26, 0x26, 0x62, 0x2d,
+ 0x70, 0x61, 0x72, 0x73, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x62, 0x29, 0x2b, 0x31, 0x3e,
+ 0x3d, 0x30, 0x7d, 0x2c, 0x69, 0x73, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4f, 0x62, 0x6a, 0x65, 0x63,
+ 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x62, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x62, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x30,
+ 0x7d, 0x2c, 0x69, 0x73, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x62, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x7c, 0x7c, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x22, 0x21, 0x3d, 0x3d, 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x28, 0x61, 0x29, 0x7c, 0x7c, 0x61,
+ 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x6e, 0x2e, 0x69, 0x73, 0x57,
+ 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21,
+ 0x31, 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x74,
+ 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x26, 0x26, 0x21, 0x6b, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28,
+ 0x61, 0x2c, 0x22, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x29,
+ 0x26, 0x26, 0x21, 0x6b, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x2e, 0x63, 0x6f, 0x6e, 0x73,
+ 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70,
+ 0x65, 0x2c, 0x22, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x4f, 0x66,
+ 0x22, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x7d, 0x63, 0x61, 0x74, 0x63,
+ 0x68, 0x28, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x7d, 0x69, 0x66,
+ 0x28, 0x21, 0x6c, 0x2e, 0x6f, 0x77, 0x6e, 0x46, 0x69, 0x72, 0x73, 0x74, 0x29, 0x66, 0x6f, 0x72,
+ 0x28, 0x62, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6b,
+ 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x62,
+ 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x6f,
+ 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x62, 0x7c, 0x7c, 0x6b, 0x2e, 0x63, 0x61, 0x6c, 0x6c,
+ 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7d, 0x2c, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x3f, 0x61, 0x2b, 0x22, 0x22, 0x3a, 0x22, 0x6f, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x7c, 0x7c,
+ 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65,
+ 0x6f, 0x66, 0x20, 0x61, 0x3f, 0x69, 0x5b, 0x6a, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x29,
+ 0x5d, 0x7c, 0x7c, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3a, 0x74, 0x79, 0x70, 0x65,
+ 0x6f, 0x66, 0x20, 0x61, 0x7d, 0x2c, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x45, 0x76, 0x61, 0x6c,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x62, 0x26, 0x26,
+ 0x6e, 0x2e, 0x74, 0x72, 0x69, 0x6d, 0x28, 0x62, 0x29, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x65, 0x78,
+ 0x65, 0x63, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x7c, 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x61, 0x2e, 0x65, 0x76, 0x61, 0x6c, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7d, 0x29, 0x28, 0x62, 0x29, 0x7d, 0x2c, 0x63, 0x61, 0x6d,
+ 0x65, 0x6c, 0x43, 0x61, 0x73, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c,
+ 0x61, 0x63, 0x65, 0x28, 0x70, 0x2c, 0x22, 0x6d, 0x73, 0x2d, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70,
+ 0x6c, 0x61, 0x63, 0x65, 0x28, 0x71, 0x2c, 0x72, 0x29, 0x7d, 0x2c, 0x6e, 0x6f, 0x64, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x26, 0x26, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2e,
+ 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x3d, 0x3d, 0x3d,
+ 0x62, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x7d,
+ 0x2c, 0x65, 0x61, 0x63, 0x68, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x30, 0x3b, 0x69, 0x66,
+ 0x28, 0x73, 0x28, 0x61, 0x29, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x63, 0x3d, 0x61, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x63, 0x3e, 0x64, 0x3b, 0x64, 0x2b, 0x2b, 0x29, 0x69, 0x66,
+ 0x28, 0x62, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x5b, 0x64, 0x5d, 0x2c, 0x64, 0x2c, 0x61,
+ 0x5b, 0x64, 0x5d, 0x29, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x29, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x7d,
+ 0x65, 0x6c, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29,
+ 0x69, 0x66, 0x28, 0x62, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x5b, 0x64, 0x5d, 0x2c, 0x64,
+ 0x2c, 0x61, 0x5b, 0x64, 0x5d, 0x29, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x29, 0x62, 0x72, 0x65, 0x61,
+ 0x6b, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x2c, 0x74, 0x72, 0x69, 0x6d,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x3f, 0x22, 0x22, 0x3a, 0x28,
+ 0x61, 0x2b, 0x22, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x6f, 0x2c,
+ 0x22, 0x22, 0x29, 0x7d, 0x2c, 0x6d, 0x61, 0x6b, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x63, 0x3d, 0x62, 0x7c, 0x7c, 0x5b, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x26, 0x26, 0x28, 0x73, 0x28, 0x4f, 0x62, 0x6a, 0x65,
+ 0x63, 0x74, 0x28, 0x61, 0x29, 0x29, 0x3f, 0x6e, 0x2e, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x28, 0x63,
+ 0x2c, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x61, 0x3f, 0x5b, 0x61, 0x5d, 0x3a, 0x61, 0x29, 0x3a, 0x67, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x63, 0x2c, 0x61, 0x29, 0x29, 0x2c, 0x63, 0x7d, 0x2c, 0x69, 0x6e, 0x41, 0x72, 0x72,
+ 0x61, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c,
+ 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x62, 0x29, 0x7b, 0x69,
+ 0x66, 0x28, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x68, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x62, 0x2c, 0x61, 0x2c, 0x63, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x3d, 0x62,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x63, 0x3d, 0x63, 0x3f, 0x30, 0x3e, 0x63, 0x3f,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x30, 0x2c, 0x64, 0x2b, 0x63, 0x29, 0x3a,
+ 0x63, 0x3a, 0x30, 0x3b, 0x64, 0x3e, 0x63, 0x3b, 0x63, 0x2b, 0x2b, 0x29, 0x69, 0x66, 0x28, 0x63,
+ 0x20, 0x69, 0x6e, 0x20, 0x62, 0x26, 0x26, 0x62, 0x5b, 0x63, 0x5d, 0x3d, 0x3d, 0x3d, 0x61, 0x29,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2d,
+ 0x31, 0x7d, 0x2c, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x2b, 0x62, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x64, 0x3d, 0x30, 0x2c, 0x65, 0x3d, 0x61, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x63, 0x3e, 0x64, 0x29,
+ 0x61, 0x5b, 0x65, 0x2b, 0x2b, 0x5d, 0x3d, 0x62, 0x5b, 0x64, 0x2b, 0x2b, 0x5d, 0x3b, 0x69, 0x66,
+ 0x28, 0x63, 0x21, 0x3d, 0x3d, 0x63, 0x29, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x76, 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0x67, 0x3d, 0x30, 0x2c, 0x68, 0x3d, 0x5b, 0x5d, 0x3b, 0x69, 0x66,
+ 0x28, 0x73, 0x28, 0x61, 0x29, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x3d, 0x61, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x64, 0x3e, 0x67, 0x3b, 0x67, 0x2b, 0x2b, 0x29, 0x65, 0x3d, 0x62,
+ 0x28, 0x61, 0x5b, 0x67, 0x5d, 0x2c, 0x67, 0x2c, 0x63, 0x29, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x21,
+ 0x3d, 0x65, 0x26, 0x26, 0x68, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x65, 0x29, 0x3b, 0x65, 0x6c,
+ 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x28, 0x67, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29, 0x65, 0x3d,
+ 0x62, 0x28, 0x61, 0x5b, 0x67, 0x5d, 0x2c, 0x67, 0x2c, 0x63, 0x29, 0x2c, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x21, 0x3d, 0x65, 0x26, 0x26, 0x68, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x65, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x5b, 0x5d,
+ 0x2c, 0x68, 0x29, 0x7d, 0x2c, 0x67, 0x75, 0x69, 0x64, 0x3a, 0x31, 0x2c, 0x70, 0x72, 0x6f, 0x78,
+ 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c, 0x66, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x62, 0x26, 0x26, 0x28, 0x66, 0x3d, 0x61, 0x5b, 0x62, 0x5d, 0x2c, 0x62, 0x3d, 0x61, 0x2c,
+ 0x61, 0x3d, 0x66, 0x29, 0x2c, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x29, 0x3f, 0x28, 0x63, 0x3d, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x32, 0x29, 0x2c, 0x64, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x61, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x62, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x63, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28,
+ 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x29, 0x29, 0x7d, 0x2c, 0x64, 0x2e,
+ 0x67, 0x75, 0x69, 0x64, 0x3d, 0x61, 0x2e, 0x67, 0x75, 0x69, 0x64, 0x3d, 0x61, 0x2e, 0x67, 0x75,
+ 0x69, 0x64, 0x7c, 0x7c, 0x6e, 0x2e, 0x67, 0x75, 0x69, 0x64, 0x2b, 0x2b, 0x2c, 0x64, 0x29, 0x3a,
+ 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x2c, 0x6e, 0x6f, 0x77, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2b, 0x6e, 0x65,
+ 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x7d, 0x2c, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x3a,
+ 0x6c, 0x7d, 0x29, 0x2c, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x26, 0x26, 0x28,
+ 0x6e, 0x2e, 0x66, 0x6e, 0x5b, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x2e, 0x69, 0x74, 0x65, 0x72,
+ 0x61, 0x74, 0x6f, 0x72, 0x5d, 0x3d, 0x63, 0x5b, 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x2e, 0x69,
+ 0x74, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x22, 0x42, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x20, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
+ 0x20, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x20, 0x44, 0x61, 0x74, 0x65, 0x20, 0x52, 0x65, 0x67, 0x45,
+ 0x78, 0x70, 0x20, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x20,
+ 0x53, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x22, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x22, 0x20,
+ 0x22, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7b, 0x69, 0x5b, 0x22, 0x5b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x22, 0x2b, 0x62, 0x2b,
+ 0x22, 0x5d, 0x22, 0x5d, 0x3d, 0x62, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61,
+ 0x73, 0x65, 0x28, 0x29, 0x7d, 0x29, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x73, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x21, 0x21, 0x61, 0x26, 0x26,
+ 0x22, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x69, 0x6e, 0x20, 0x61, 0x26, 0x26, 0x61, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x63, 0x3d, 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x28,
+ 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x7c, 0x7c, 0x6e, 0x2e, 0x69, 0x73, 0x57, 0x69, 0x6e,
+ 0x64, 0x6f, 0x77, 0x28, 0x61, 0x29, 0x3f, 0x21, 0x31, 0x3a, 0x22, 0x61, 0x72, 0x72, 0x61, 0x79,
+ 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x7c, 0x7c, 0x30, 0x3d, 0x3d, 0x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0x47, 0x3a, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67,
+ 0x45, 0x78, 0x70, 0x28, 0x22, 0x5e, 0x28, 0x22, 0x2b, 0x4d, 0x2b, 0x22, 0x7c, 0x5b, 0x2a, 0x5d,
+ 0x29, 0x22, 0x29, 0x2c, 0x41, 0x54, 0x54, 0x52, 0x3a, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67,
+ 0x45, 0x78, 0x70, 0x28, 0x22, 0x5e, 0x22, 0x2b, 0x4e, 0x29, 0x2c, 0x50, 0x53, 0x45, 0x55, 0x44,
+ 0x4f, 0x3a, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x22, 0x5e, 0x22,
+ 0x2b, 0x4f, 0x29, 0x2c, 0x43, 0x48, 0x49, 0x4c, 0x44, 0x3a, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65,
+ 0x67, 0x45, 0x78, 0x70, 0x28, 0x22, 0x5e, 0x3a, 0x28, 0x6f, 0x6e, 0x6c, 0x79, 0x7c, 0x66, 0x69,
+ 0x72, 0x73, 0x74, 0x7c, 0x6c, 0x61, 0x73, 0x74, 0x7c, 0x6e, 0x74, 0x68, 0x7c, 0x6e, 0x74, 0x68,
+ 0x2d, 0x6c, 0x61, 0x73, 0x74, 0x29, 0x2d, 0x28, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x7c, 0x6f, 0x66,
+ 0x2d, 0x74, 0x79, 0x70, 0x65, 0x29, 0x28, 0x3f, 0x3a, 0x5c, 0x5c, 0x28, 0x22, 0x2b, 0x4c, 0x2b,
+ 0x22, 0x2a, 0x28, 0x65, 0x76, 0x65, 0x6e, 0x7c, 0x6f, 0x64, 0x64, 0x7c, 0x28, 0x28, 0x5b, 0x2b,
+ 0x2d, 0x5d, 0x7c, 0x29, 0x28, 0x5c, 0x5c, 0x64, 0x2a, 0x29, 0x6e, 0x7c, 0x29, 0x22, 0x2b, 0x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, 0x22, 0x5c, 0x5c, 0x5c, 0x5c, 0x28, 0x5b, 0x5c, 0x5c,
+ 0x64, 0x61, 0x2d, 0x66, 0x5d, 0x7b, 0x31, 0x2c, 0x36, 0x7d, 0x22, 0x2b, 0x4c, 0x2b, 0x22, 0x3f,
+ 0x7c, 0x28, 0x22, 0x2b, 0x4c, 0x2b, 0x22, 0x29, 0x7c, 0x2e, 0x29, 0x22, 0x2c, 0x22, 0x69, 0x67,
+ 0x22, 0x29, 0x2c, 0x63, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x22, 0x30, 0x78, 0x22,
+ 0x2b, 0x62, 0x2d, 0x36, 0x35, 0x35, 0x33, 0x36, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x64, 0x21, 0x3d, 0x3d, 0x64, 0x7c, 0x7c, 0x63, 0x3f, 0x62, 0x3a, 0x30, 0x3e, 0x64, 0x3f, 0x53,
+ 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x66, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x43, 0x6f,
+ 0x64, 0x65, 0x28, 0x64, 0x2b, 0x36, 0x35, 0x35, 0x33, 0x36, 0x29, 0x3a, 0x53, 0x74, 0x72, 0x69,
+ 0x6e, 0x67, 0x2e, 0x66, 0x72, 0x6f, 0x6d, 0x43, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x28,
+ 0x64, 0x3e, 0x3e, 0x31, 0x30, 0x7c, 0x35, 0x35, 0x32, 0x39, 0x36, 0x2c, 0x31, 0x30, 0x32, 0x33,
+ 0x26, 0x64, 0x7c, 0x35, 0x36, 0x33, 0x32, 0x30, 0x29, 0x7d, 0x2c, 0x64, 0x61, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6d, 0x28, 0x29, 0x7d, 0x3b, 0x74, 0x72,
+ 0x79, 0x7b, 0x48, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x45, 0x3d, 0x49, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x76, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x29,
+ 0x2c, 0x76, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x29, 0x2c, 0x45,
+ 0x5b, 0x76, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x5d, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7d, 0x63,
+ 0x61, 0x74, 0x63, 0x68, 0x28, 0x65, 0x61, 0x29, 0x7b, 0x48, 0x3d, 0x7b, 0x61, 0x70, 0x70, 0x6c,
+ 0x79, 0x3a, 0x45, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x47, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79,
+ 0x28, 0x61, 0x2c, 0x49, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x62, 0x29, 0x29, 0x7d, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x63, 0x3d, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 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x72,
+ 0x6e, 0x20, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x65, 0x26, 0x26, 0x28, 0x28, 0x62, 0x3f, 0x62,
+ 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c,
+ 0x62, 0x3a, 0x76, 0x29, 0x21, 0x3d, 0x3d, 0x6e, 0x26, 0x26, 0x6d, 0x28, 0x62, 0x29, 0x2c, 0x62,
+ 0x3d, 0x62, 0x7c, 0x7c, 0x6e, 0x2c, 0x70, 0x29, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x31, 0x31, 0x21,
+ 0x3d, 0x3d, 0x78, 0x26, 0x26, 0x28, 0x6f, 0x3d, 0x24, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x61,
+ 0x29, 0x29, 0x29, 0x69, 0x66, 0x28, 0x66, 0x3d, 0x6f, 0x5b, 0x31, 0x5d, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x39, 0x3d, 0x3d, 0x3d, 0x78, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x28, 0x6a, 0x3d, 0x62,
+ 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28,
+ 0x66, 0x29, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3b, 0x69, 0x66, 0x28,
+ 0x6a, 0x2e, 0x69, 0x64, 0x3d, 0x3d, 0x3d, 0x66, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x64, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6a, 0x29, 0x2c, 0x64, 0x7d, 0x65, 0x6c, 0x73, 0x65,
+ 0x20, 0x69, 0x66, 0x28, 0x77, 0x26, 0x26, 0x28, 0x6a, 0x3d, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x45,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x66, 0x29, 0x29, 0x26, 0x26,
+ 0x74, 0x28, 0x62, 0x2c, 0x6a, 0x29, 0x26, 0x26, 0x6a, 0x2e, 0x69, 0x64, 0x3d, 0x3d, 0x3d, 0x66,
+ 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6a,
+ 0x29, 0x2c, 0x64, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x69, 0x66, 0x28, 0x6f, 0x5b, 0x32, 0x5d,
+ 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x48, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28,
+ 0x64, 0x2c, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42,
+ 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x61, 0x29, 0x29, 0x2c, 0x64, 0x3b, 0x69,
+ 0x66, 0x28, 0x28, 0x66, 0x3d, 0x6f, 0x5b, 0x33, 0x5d, 0x29, 0x26, 0x26, 0x63, 0x2e, 0x67, 0x65,
+ 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73,
+ 0x4e, 0x61, 0x6d, 0x65, 0x26, 0x26, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x42, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x48, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x64, 0x2c,
+ 0x62, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x43,
+ 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x66, 0x29, 0x29, 0x2c, 0x64, 0x7d, 0x69,
+ 0x66, 0x28, 0x63, 0x2e, 0x71, 0x73, 0x61, 0x26, 0x26, 0x21, 0x41, 0x5b, 0x61, 0x2b, 0x22, 0x20,
+ 0x22, 0x5d, 0x26, 0x26, 0x28, 0x21, 0x71, 0x7c, 0x7c, 0x21, 0x71, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x28, 0x61, 0x29, 0x29, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x31, 0x21, 0x3d, 0x3d, 0x78, 0x29, 0x77,
+ 0x3d, 0x62, 0x2c, 0x73, 0x3d, 0x61, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x22,
+ 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x21, 0x3d, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65,
+ 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65,
+ 0x28, 0x29, 0x29, 0x7b, 0x28, 0x6b, 0x3d, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x69, 0x64, 0x22, 0x29, 0x29, 0x3f, 0x6b, 0x3d, 0x6b,
+ 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x61, 0x61, 0x2c, 0x22, 0x5c, 0x5c, 0x24,
+ 0x26, 0x22, 0x29, 0x3a, 0x62, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+ 0x74, 0x65, 0x28, 0x22, 0x69, 0x64, 0x22, 0x2c, 0x6b, 0x3d, 0x75, 0x29, 0x2c, 0x72, 0x3d, 0x67,
+ 0x28, 0x61, 0x29, 0x2c, 0x68, 0x3d, 0x72, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x6c,
+ 0x3d, 0x56, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x6b, 0x29, 0x3f, 0x22, 0x23, 0x22, 0x2b, 0x6b,
+ 0x3a, 0x22, 0x5b, 0x69, 0x64, 0x3d, 0x27, 0x22, 0x2b, 0x6b, 0x2b, 0x22, 0x27, 0x5d, 0x22, 0x3b,
+ 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x68, 0x2d, 0x2d, 0x29, 0x72, 0x5b, 0x68, 0x5d, 0x3d, 0x6c,
+ 0x2b, 0x22, 0x20, 0x22, 0x2b, 0x71, 0x61, 0x28, 0x72, 0x5b, 0x68, 0x5d, 0x29, 0x3b, 0x73, 0x3d,
+ 0x72, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2c, 0x22, 0x29, 0x2c, 0x77, 0x3d, 0x5f, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x26, 0x26, 0x6f, 0x61, 0x28, 0x62, 0x2e, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x29, 0x7c, 0x7c, 0x62, 0x7d, 0x69, 0x66, 0x28,
+ 0x73, 0x29, 0x74, 0x72, 0x79, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x48, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x64, 0x2c, 0x77, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65,
+ 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x73, 0x29, 0x29, 0x2c, 0x64, 0x7d,
+ 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x79, 0x29, 0x7b, 0x7d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x6c,
+ 0x79, 0x7b, 0x6b, 0x3d, 0x3d, 0x3d, 0x75, 0x26, 0x26, 0x62, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x69, 0x64, 0x22, 0x29,
+ 0x7d, 0x7d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x28, 0x61, 0x2e, 0x72, 0x65,
+ 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x51, 0x2c, 0x22, 0x24, 0x31, 0x22, 0x29, 0x2c, 0x62, 0x2c,
+ 0x64, 0x2c, 0x65, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x61,
+ 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x5b, 0x5d, 0x3b, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x28, 0x63, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63, 0x2b, 0x22, 0x20, 0x22, 0x29,
+ 0x3e, 0x64, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26,
+ 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x62, 0x5b, 0x61, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74,
+ 0x28, 0x29, 0x5d, 0x2c, 0x62, 0x5b, 0x63, 0x2b, 0x22, 0x20, 0x22, 0x5d, 0x3d, 0x65, 0x7d, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x68, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x5b,
+ 0x75, 0x5d, 0x3d, 0x21, 0x30, 0x2c, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x69, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6e, 0x2e, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69,
+ 0x76, 0x22, 0x29, 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x21,
+ 0x61, 0x28, 0x62, 0x29, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x63, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x7d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x7b, 0x62,
+ 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x26, 0x26, 0x62, 0x2e, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65,
+ 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x62, 0x29, 0x2c, 0x62, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x61, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28,
+ 0x22, 0x7c, 0x22, 0x29, 0x2c, 0x65, 0x3d, 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b,
+ 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x65, 0x2d, 0x2d, 0x29, 0x64, 0x2e, 0x61, 0x74, 0x74, 0x72,
+ 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x5b, 0x63, 0x5b, 0x65, 0x5d, 0x5d, 0x3d, 0x62, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x62, 0x26, 0x26, 0x61, 0x2c, 0x64, 0x3d, 0x63, 0x26, 0x26,
+ 0x31, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26,
+ 0x31, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26,
+ 0x28, 0x7e, 0x62, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x7c,
+ 0x7c, 0x43, 0x29, 0x2d, 0x28, 0x7e, 0x61, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x6e,
+ 0x64, 0x65, 0x78, 0x7c, 0x7c, 0x43, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x64, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x63, 0x29, 0x77, 0x68, 0x69, 0x6c, 0x65,
+ 0x28, 0x63, 0x3d, 0x63, 0x2e, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67,
+ 0x29, 0x69, 0x66, 0x28, 0x63, 0x3d, 0x3d, 0x3d, 0x62, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x2d, 0x31, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3f, 0x31, 0x3a, 0x2d, 0x31,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x61, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x63, 0x26, 0x26, 0x62, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x3d, 0x3d, 0x61, 0x7d,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x61, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x63, 0x7c, 0x7c, 0x22, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x22, 0x3d, 0x3d,
+ 0x3d, 0x63, 0x29, 0x26, 0x26, 0x62, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x3d, 0x3d, 0x61, 0x7d,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x61, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x68, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3d, 0x2b,
+ 0x62, 0x2c, 0x68, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x2c,
+ 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x2c, 0x66, 0x3d, 0x61, 0x28, 0x5b, 0x5d, 0x2c,
+ 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x62, 0x29, 0x2c, 0x67, 0x3d, 0x66, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x67, 0x2d, 0x2d,
+ 0x29, 0x63, 0x5b, 0x65, 0x3d, 0x66, 0x5b, 0x67, 0x5d, 0x5d, 0x26, 0x26, 0x28, 0x63, 0x5b, 0x65,
+ 0x5d, 0x3d, 0x21, 0x28, 0x64, 0x5b, 0x65, 0x5d, 0x3d, 0x63, 0x5b, 0x65, 0x5d, 0x29, 0x29, 0x7d,
+ 0x29, 0x7d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x61, 0x28,
+ 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x26, 0x26, 0x22, 0x75, 0x6e,
+ 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79,
+ 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x26, 0x26, 0x61, 0x7d, 0x63, 0x3d, 0x66, 0x61, 0x2e,
+ 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x3d, 0x7b, 0x7d, 0x2c, 0x66, 0x3d, 0x66, 0x61, 0x2e,
+ 0x69, 0x73, 0x58, 0x4d, 0x4c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x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0x74, 0x3f, 0x28,
+ 0x6e, 0x3d, 0x67, 0x2c, 0x6f, 0x3d, 0x6e, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x70, 0x3d, 0x21, 0x66, 0x28, 0x6e, 0x29, 0x2c,
+ 0x28, 0x65, 0x3d, 0x6e, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x69, 0x65, 0x77,
+ 0x29, 0x26, 0x26, 0x65, 0x2e, 0x74, 0x6f, 0x70, 0x21, 0x3d, 0x3d, 0x65, 0x26, 0x26, 0x28, 0x65,
+ 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65,
+ 0x72, 0x3f, 0x65, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74,
+ 0x65, 0x6e, 0x65, 0x72, 0x28, 0x22, 0x75, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x2c, 0x64, 0x61,
+ 0x2c, 0x21, 0x31, 0x29, 0x3a, 0x65, 0x2e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x45, 0x76, 0x65,
+ 0x6e, 0x74, 0x26, 0x26, 0x65, 0x2e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e,
+ 0x74, 0x28, 0x22, 0x6f, 0x6e, 0x75, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x2c, 0x64, 0x61, 0x29,
+ 0x29, 0x2c, 0x63, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x3d, 0x69,
+ 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x22, 0x69, 0x22, 0x2c, 0x21, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x22,
+ 0x29, 0x7d, 0x29, 0x2c, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x61, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x6e,
+ 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22,
+ 0x22, 0x29, 0x29, 0x2c, 0x21, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x22, 0x2a, 0x22, 0x29,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7d, 0x29, 0x2c, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x45,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x5a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x45,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61,
+ 0x6d, 0x65, 0x29, 0x2c, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x79, 0x49, 0x64, 0x3d, 0x69, 0x61,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c,
+ 0x64, 0x28, 0x61, 0x29, 0x2e, 0x69, 0x64, 0x3d, 0x75, 0x2c, 0x21, 0x6e, 0x2e, 0x67, 0x65, 0x74,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x7c, 0x7c,
+ 0x21, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79,
+ 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x75, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7d, 0x29,
+ 0x2c, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x79, 0x49, 0x64, 0x3f, 0x28, 0x64, 0x2e, 0x66, 0x69,
+ 0x6e, 0x64, 0x2e, 0x49, 0x44, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x2e, 0x67, 0x65, 0x74,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x26, 0x26, 0x70, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x63, 0x3f, 0x5b, 0x63, 0x5d, 0x3a, 0x5b, 0x5d, 0x7d, 0x7d, 0x2c, 0x64, 0x2e, 0x66, 0x69,
+ 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x49, 0x44, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c,
+ 0x61, 0x63, 0x65, 0x28, 0x62, 0x61, 0x2c, 0x63, 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+ 0x75, 0x74, 0x65, 0x28, 0x22, 0x69, 0x64, 0x22, 0x29, 0x3d, 0x3d, 0x3d, 0x62, 0x7d, 0x7d, 0x29,
+ 0x3a, 0x28, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x64, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x2e,
+ 0x49, 0x44, 0x2c, 0x64, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x2e, 0x49, 0x44, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62,
+ 0x3d, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x62, 0x61, 0x2c, 0x63, 0x61,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65,
+ 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61,
+ 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x6f, 0x64,
+ 0x65, 0x26, 0x26, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x22, 0x69, 0x64, 0x22, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x63, 0x26, 0x26, 0x63, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x3d, 0x3d,
+ 0x62, 0x7d, 0x7d, 0x29, 0x2c, 0x64, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x2e, 0x54, 0x41, 0x47, 0x3d,
+ 0x63, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54,
+ 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x75, 0x6e, 0x64, 0x65,
+ 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62,
+ 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61,
+ 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x3f, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x61, 0x29, 0x3a,
+ 0x63, 0x2e, 0x71, 0x73, 0x61, 0x3f, 0x62, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x61, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x7d, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x5b, 0x5d, 0x2c, 0x65, 0x3d, 0x30,
+ 0x2c, 0x66, 0x3d, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x61, 0x29, 0x3b, 0x69, 0x66, 0x28,
+ 0x22, 0x2a, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x29, 0x7b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x63,
+ 0x3d, 0x66, 0x5b, 0x65, 0x2b, 0x2b, 0x5d, 0x29, 0x31, 0x3d, 0x3d, 0x3d, 0x63, 0x2e, 0x6e, 0x6f,
+ 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x64, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x66, 0x7d, 0x2c, 0x64, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x2e, 0x43, 0x4c, 0x41, 0x53,
+ 0x53, 0x3d, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42,
+ 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x26, 0x26, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70,
+ 0x65, 0x6f, 0x66, 0x20, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x42, 0x79, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x26, 0x26, 0x70, 0x3f,
+ 0x62, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x43,
+ 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x61, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x7d, 0x2c, 0x72, 0x3d, 0x5b, 0x5d, 0x2c, 0x71, 0x3d, 0x5b, 0x5d, 0x2c, 0x28, 0x63,
+ 0x2e, 0x71, 0x73, 0x61, 0x3d, 0x5a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x6e, 0x2e, 0x71, 0x75,
+ 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x29, 0x29,
+ 0x26, 0x26, 0x28, 0x69, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x6f, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28,
+ 0x61, 0x29, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x22, 0x3c, 0x61,
+ 0x20, 0x69, 0x64, 0x3d, 0x27, 0x22, 0x2b, 0x75, 0x2b, 0x22, 0x27, 0x3e, 0x3c, 0x2f, 0x61, 0x3e,
+ 0x3c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x69, 0x64, 0x3d, 0x27, 0x22, 0x2b, 0x75, 0x2b,
+ 0x22, 0x2d, 0x5c, 0x72, 0x5c, 0x5c, 0x27, 0x20, 0x6d, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x63,
+ 0x61, 0x70, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x27, 0x27, 0x3e, 0x3c, 0x6f, 0x70, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x3d, 0x27, 0x27, 0x3e, 0x3c, 0x2f,
+ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3e, 0x3c, 0x2f, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x3e,
+ 0x22, 0x2c, 0x61, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f,
+ 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x5b, 0x6d, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x63, 0x61,
+ 0x70, 0x74, 0x75, 0x72, 0x65, 0x5e, 0x3d, 0x27, 0x27, 0x5d, 0x22, 0x29, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x26, 0x26, 0x71, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x22, 0x5b, 0x2a, 0x5e,
+ 0x24, 0x5d, 0x3d, 0x22, 0x2b, 0x4c, 0x2b, 0x22, 0x2a, 0x28, 0x3f, 0x3a, 0x27, 0x27, 0x7c, 0x5c,
+ 0x22, 0x5c, 0x22, 0x29, 0x22, 0x29, 0x2c, 0x61, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65,
+ 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x5b, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x65, 0x64, 0x5d, 0x22, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7c, 0x7c,
+ 0x71, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x22, 0x5c, 0x5c, 0x5b, 0x22, 0x2b, 0x4c, 0x2b, 0x22,
+ 0x2a, 0x28, 0x3f, 0x3a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x7c, 0x22, 0x2b, 0x4b, 0x2b, 0x22, 0x29,
+ 0x22, 0x29, 0x2c, 0x61, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74,
+ 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x5b, 0x69, 0x64, 0x7e, 0x3d, 0x22, 0x2b, 0x75, 0x2b,
+ 0x22, 0x2d, 0x5d, 0x22, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7c, 0x7c, 0x71, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x22, 0x7e, 0x3d, 0x22, 0x29, 0x2c, 0x61, 0x2e, 0x71, 0x75, 0x65,
+ 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x3a,
+ 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x7c, 0x7c, 0x71, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x22, 0x3a, 0x63, 0x68, 0x65, 0x63, 0x6b,
+ 0x65, 0x64, 0x22, 0x29, 0x2c, 0x61, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x61, 0x23, 0x22, 0x2b, 0x75, 0x2b, 0x22,
+ 0x2b, 0x2a, 0x22, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7c, 0x7c, 0x71, 0x2e, 0x70,
+ 0x75, 0x73, 0x68, 0x28, 0x22, 0x2e, 0x23, 0x2e, 0x2b, 0x5b, 0x2b, 0x7e, 0x5d, 0x22, 0x29, 0x7d,
+ 0x29, 0x2c, 0x69, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6e, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x3b,
+ 0x62, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22,
+ 0x74, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x22, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x22, 0x29, 0x2c,
+ 0x61, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x62, 0x29,
+ 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x6e,
+ 0x61, 0x6d, 0x65, 0x22, 0x2c, 0x22, 0x44, 0x22, 0x29, 0x2c, 0x61, 0x2e, 0x71, 0x75, 0x65, 0x72,
+ 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x5b, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3d, 0x64, 0x5d, 0x22, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26,
+ 0x26, 0x71, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2b, 0x4c,
+ 0x2b, 0x22, 0x2a, 0x5b, 0x2a, 0x5e, 0x24, 0x7c, 0x21, 0x7e, 0x5d, 0x3f, 0x3d, 0x22, 0x29, 0x2c,
+ 0x61, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41,
+ 0x6c, 0x6c, 0x28, 0x22, 0x3a, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x29, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7c, 0x7c, 0x71, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x22, 0x3a,
+ 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x2c, 0x22, 0x3a, 0x64, 0x69, 0x73, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x22, 0x29, 0x2c, 0x61, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2a, 0x2c, 0x3a, 0x78, 0x22, 0x29,
+ 0x2c, 0x71, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x22, 0x2c, 0x2e, 0x2a, 0x3a, 0x22, 0x29, 0x7d,
+ 0x29, 0x29, 0x2c, 0x28, 0x63, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x3d, 0x5a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x73, 0x3d, 0x6f,
+ 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x7c, 0x7c, 0x6f, 0x2e, 0x77, 0x65, 0x62, 0x6b,
+ 0x69, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f,
+ 0x72, 0x7c, 0x7c, 0x6f, 0x2e, 0x6d, 0x6f, 0x7a, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53,
+ 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x7c, 0x7c, 0x6f, 0x2e, 0x6f, 0x4d, 0x61, 0x74, 0x63,
+ 0x68, 0x65, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x7c, 0x7c, 0x6f, 0x2e, 0x6d,
+ 0x73, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72,
+ 0x29, 0x29, 0x26, 0x26, 0x69, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x63, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65,
+ 0x64, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x3d, 0x73, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x2c,
+ 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x2c, 0x73, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x2c,
+ 0x22, 0x5b, 0x73, 0x21, 0x3d, 0x27, 0x27, 0x5d, 0x3a, 0x78, 0x22, 0x29, 0x2c, 0x72, 0x2e, 0x70,
+ 0x75, 0x73, 0x68, 0x28, 0x22, 0x21, 0x3d, 0x22, 0x2c, 0x4f, 0x29, 0x7d, 0x29, 0x2c, 0x71, 0x3d,
+ 0x71, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65,
+ 0x67, 0x45, 0x78, 0x70, 0x28, 0x71, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x7c, 0x22, 0x29,
+ 0x29, 0x2c, 0x72, 0x3d, 0x72, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x6e, 0x65,
+ 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x72, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28,
+ 0x22, 0x7c, 0x22, 0x29, 0x29, 0x2c, 0x62, 0x3d, 0x5a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x6f,
+ 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x2c, 0x74, 0x3d, 0x62, 0x7c, 0x7c, 0x5a,
+ 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x6f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73,
+ 0x29, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x39, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65,
+ 0x54, 0x79, 0x70, 0x65, 0x3f, 0x61, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x45,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x61, 0x2c, 0x64, 0x3d, 0x62, 0x26, 0x26, 0x62, 0x2e,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x61, 0x3d, 0x3d, 0x3d, 0x64, 0x7c, 0x7c, 0x21, 0x28, 0x21, 0x64, 0x7c, 0x7c, 0x31,
+ 0x21, 0x3d, 0x3d, 0x64, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x21,
+ 0x28, 0x63, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x3f, 0x63, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x28, 0x64, 0x29, 0x3a, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x70,
+ 0x61, 0x72, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74,
+ 0x69, 0x6f, 0x6e, 0x26, 0x26, 0x31, 0x36, 0x26, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72,
+ 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x64, 0x29, 0x29, 0x29, 0x7d, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x62, 0x29, 0x77, 0x68, 0x69, 0x6c, 0x65,
+ 0x28, 0x62, 0x3d, 0x62, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x29,
+ 0x69, 0x66, 0x28, 0x62, 0x3d, 0x3d, 0x3d, 0x61, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21,
+ 0x30, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x7d, 0x2c, 0x42, 0x3d, 0x62, 0x3f,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x61, 0x3d, 0x3d, 0x3d, 0x62, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x3d,
+ 0x21, 0x30, 0x2c, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x21, 0x61, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x70, 0x61, 0x72, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x73,
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x21, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65,
+ 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3f, 0x64, 0x3a, 0x28, 0x64, 0x3d, 0x28,
+ 0x61, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c,
+ 0x7c, 0x61, 0x29, 0x3d, 0x3d, 0x3d, 0x28, 0x62, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x62, 0x29, 0x3f, 0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20,
+ 0x66, 0x61, 0x28, 0x61, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x62,
+ 0x29, 0x7d, 0x2c, 0x66, 0x61, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x28, 0x61, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x61, 0x29, 0x21, 0x3d, 0x3d, 0x6e, 0x26,
+ 0x26, 0x6d, 0x28, 0x61, 0x29, 0x2c, 0x62, 0x3d, 0x62, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63,
+ 0x65, 0x28, 0x54, 0x2c, 0x22, 0x3d, 0x27, 0x24, 0x31, 0x27, 0x5d, 0x22, 0x29, 0x2c, 0x63, 0x2e,
+ 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x26,
+ 0x26, 0x70, 0x26, 0x26, 0x21, 0x41, 0x5b, 0x62, 0x2b, 0x22, 0x20, 0x22, 0x5d, 0x26, 0x26, 0x28,
+ 0x21, 0x72, 0x7c, 0x7c, 0x21, 0x72, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x62, 0x29, 0x29, 0x26,
+ 0x26, 0x28, 0x21, 0x71, 0x7c, 0x7c, 0x21, 0x71, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x62, 0x29,
+ 0x29, 0x29, 0x74, 0x72, 0x79, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x73, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x64, 0x7c, 0x7c, 0x63, 0x2e,
+ 0x64, 0x69, 0x73, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x65, 0x64, 0x4d, 0x61, 0x74, 0x63,
+ 0x68, 0x7c, 0x7c, 0x61, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x26, 0x26, 0x31,
+ 0x31, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6e,
+ 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64,
+ 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x65, 0x29, 0x7b, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x66, 0x61, 0x28, 0x62, 0x2c, 0x6e, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x5b, 0x61,
+ 0x5d, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x30, 0x7d, 0x2c, 0x66, 0x61, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x61, 0x2e,
+ 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x61,
+ 0x29, 0x21, 0x3d, 0x3d, 0x6e, 0x26, 0x26, 0x6d, 0x28, 0x61, 0x29, 0x2c, 0x74, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7d, 0x2c, 0x66, 0x61, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x28, 0x61, 0x2e, 0x6f, 0x77, 0x6e,
+ 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x61, 0x29, 0x21, 0x3d,
+ 0x3d, 0x6e, 0x26, 0x26, 0x6d, 0x28, 0x61, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x64,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x5b, 0x62, 0x2e, 0x74, 0x6f,
+ 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x5d, 0x2c, 0x66, 0x3d, 0x65,
+ 0x26, 0x26, 0x44, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x64, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x48,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x2c, 0x62, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43,
+ 0x61, 0x73, 0x65, 0x28, 0x29, 0x29, 0x3f, 0x65, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x21, 0x70, 0x29,
+ 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76,
+ 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x66, 0x3f, 0x66, 0x3a, 0x63, 0x2e, 0x61, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x7c, 0x7c, 0x21, 0x70, 0x3f, 0x61, 0x2e, 0x67,
+ 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x62, 0x29, 0x3a, 0x28,
+ 0x66, 0x3d, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x62, 0x29, 0x29, 0x26, 0x26, 0x66, 0x2e, 0x73, 0x70, 0x65, 0x63,
+ 0x69, 0x66, 0x69, 0x65, 0x64, 0x3f, 0x66, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x7d, 0x2c, 0x66, 0x61, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x6e,
+ 0x65, 0x77, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x53, 0x79, 0x6e, 0x74, 0x61, 0x78,
+ 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x20, 0x75, 0x6e, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e,
+ 0x69, 0x7a, 0x65, 0x64, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x3a,
+ 0x20, 0x22, 0x2b, 0x61, 0x29, 0x7d, 0x2c, 0x66, 0x61, 0x2e, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65,
+ 0x53, 0x6f, 0x72, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x64, 0x3d, 0x5b, 0x5d, 0x2c, 0x65, 0x3d, 0x30, 0x2c,
+ 0x66, 0x3d, 0x30, 0x3b, 0x69, 0x66, 0x28, 0x6c, 0x3d, 0x21, 0x63, 0x2e, 0x64, 0x65, 0x74, 0x65,
+ 0x63, 0x74, 0x44, 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x2c, 0x6b, 0x3d, 0x21,
+ 0x63, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x26, 0x26, 0x61, 0x2e,
+ 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x29, 0x2c, 0x61, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x28,
+ 0x42, 0x29, 0x2c, 0x6c, 0x29, 0x7b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x62, 0x3d, 0x61, 0x5b,
+ 0x66, 0x2b, 0x2b, 0x5d, 0x29, 0x62, 0x3d, 0x3d, 0x3d, 0x61, 0x5b, 0x66, 0x5d, 0x26, 0x26, 0x28,
+ 0x65, 0x3d, 0x64, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x66, 0x29, 0x29, 0x3b, 0x77, 0x68, 0x69,
+ 0x6c, 0x65, 0x28, 0x65, 0x2d, 0x2d, 0x29, 0x61, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28,
+ 0x64, 0x5b, 0x65, 0x5d, 0x2c, 0x31, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6b,
+ 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x61, 0x7d, 0x2c, 0x65, 0x3d, 0x66, 0x61, 0x2e, 0x67, 0x65,
+ 0x74, 0x54, 0x65, 0x78, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x3d, 0x22, 0x22, 0x2c, 0x64, 0x3d, 0x30,
+ 0x2c, 0x66, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x69, 0x66,
+ 0x28, 0x66, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x66, 0x7c, 0x7c, 0x39, 0x3d,
+ 0x3d, 0x3d, 0x66, 0x7c, 0x7c, 0x31, 0x31, 0x3d, 0x3d, 0x3d, 0x66, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x61, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x61, 0x3d, 0x61, 0x2e, 0x66, 0x69, 0x72, 0x73,
+ 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x3b, 0x61, 0x3b, 0x61, 0x3d, 0x61, 0x2e, 0x6e, 0x65, 0x78,
+ 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x29, 0x63, 0x2b, 0x3d, 0x65, 0x28, 0x61, 0x29,
+ 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x33, 0x3d, 0x3d, 0x3d, 0x66, 0x7c, 0x7c,
+ 0x34, 0x3d, 0x3d, 0x3d, 0x66, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x6e,
+ 0x6f, 0x64, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x77, 0x68,
+ 0x69, 0x6c, 0x65, 0x28, 0x62, 0x3d, 0x61, 0x5b, 0x64, 0x2b, 0x2b, 0x5d, 0x29, 0x63, 0x2b, 0x3d,
+ 0x65, 0x28, 0x62, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x7d, 0x2c, 0x64,
+ 0x3d, 0x66, 0x61, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x73, 0x3d, 0x7b, 0x63,
+ 0x61, 0x63, 0x68, 0x65, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x35, 0x30, 0x2c, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x3a, 0x68, 0x61, 0x2c, 0x6d, 0x61,
+ 0x74, 0x63, 0x68, 0x3a, 0x57, 0x2c, 0x61, 0x74, 0x74, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65,
+ 0x3a, 0x7b, 0x7d, 0x2c, 0x66, 0x69, 0x6e, 0x64, 0x3a, 0x7b, 0x7d, 0x2c, 0x72, 0x65, 0x6c, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x3a, 0x7b, 0x22, 0x3e, 0x22, 0x3a, 0x7b, 0x64, 0x69, 0x72, 0x3a, 0x22,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x22, 0x2c, 0x66, 0x69, 0x72, 0x73,
+ 0x74, 0x3a, 0x21, 0x30, 0x7d, 0x2c, 0x22, 0x20, 0x22, 0x3a, 0x7b, 0x64, 0x69, 0x72, 0x3a, 0x22,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x22, 0x7d, 0x2c, 0x22, 0x2b, 0x22,
+ 0x3a, 0x7b, 0x64, 0x69, 0x72, 0x3a, 0x22, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x53,
+ 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x66, 0x69, 0x72, 0x73, 0x74, 0x3a, 0x21, 0x30,
+ 0x7d, 0x2c, 0x22, 0x7e, 0x22, 0x3a, 0x7b, 0x64, 0x69, 0x72, 0x3a, 0x22, 0x70, 0x72, 0x65, 0x76,
+ 0x69, 0x6f, 0x75, 0x73, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x7d, 0x7d, 0x2c, 0x70,
+ 0x72, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3a, 0x7b, 0x41, 0x54, 0x54, 0x52, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x61, 0x5b, 0x31, 0x5d, 0x3d, 0x61, 0x5b, 0x31, 0x5d, 0x2e, 0x72, 0x65, 0x70, 0x6c,
+ 0x61, 0x63, 0x65, 0x28, 0x62, 0x61, 0x2c, 0x63, 0x61, 0x29, 0x2c, 0x61, 0x5b, 0x33, 0x5d, 0x3d,
+ 0x28, 0x61, 0x5b, 0x33, 0x5d, 0x7c, 0x7c, 0x61, 0x5b, 0x34, 0x5d, 0x7c, 0x7c, 0x61, 0x5b, 0x35,
+ 0x5d, 0x7c, 0x7c, 0x22, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x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x63, 0x26, 0x26, 0x55, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x28, 0x63, 0x29, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x67, 0x28, 0x63, 0x2c, 0x21, 0x30,
+ 0x29, 0x29, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x63, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66,
+ 0x28, 0x22, 0x29, 0x22, 0x2c, 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x62, 0x29,
+ 0x2d, 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x26, 0x26, 0x28, 0x61, 0x5b, 0x30,
+ 0x5d, 0x3d, 0x61, 0x5b, 0x30, 0x5d, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x2c, 0x62,
+ 0x29, 0x2c, 0x61, 0x5b, 0x32, 0x5d, 0x3d, 0x63, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30,
+ 0x2c, 0x62, 0x29, 0x29, 0x2c, 0x61, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x2c, 0x33,
+ 0x29, 0x29, 0x7d, 0x7d, 0x2c, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3a, 0x7b, 0x54, 0x41, 0x47,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x62, 0x3d, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x62, 0x61, 0x2c,
+ 0x63, 0x61, 0x29, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x2a, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x3f,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x21, 0x30, 0x7d, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61,
+ 0x6d, 0x65, 0x26, 0x26, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x74,
+ 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x3d, 0x3d, 0x3d, 0x62,
+ 0x7d, 0x7d, 0x2c, 0x43, 0x4c, 0x41, 0x53, 0x53, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x79, 0x5b, 0x61, 0x2b, 0x22,
+ 0x20, 0x22, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x7c, 0x7c, 0x28, 0x62,
+ 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x22, 0x28, 0x5e, 0x7c,
+ 0x22, 0x2b, 0x4c, 0x2b, 0x22, 0x29, 0x22, 0x2b, 0x61, 0x2b, 0x22, 0x28, 0x22, 0x2b, 0x4c, 0x2b,
+ 0x22, 0x7c, 0x24, 0x29, 0x22, 0x29, 0x29, 0x26, 0x26, 0x79, 0x28, 0x61, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d,
+ 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e,
+ 0x61, 0x6d, 0x65, 0x26, 0x26, 0x61, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65,
+ 0x7c, 0x7c, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x65, 0x26, 0x26, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x29, 0x7c, 0x7c, 0x22,
+ 0x22, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x41, 0x54, 0x54, 0x52, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x65, 0x3d, 0x66, 0x61, 0x2e, 0x61, 0x74, 0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x20, 0x31, 0x3d, 0x3d, 0x3d, 0x64, 0x26, 0x26, 0x30, 0x3d,
+ 0x3d, 0x3d, 0x65, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x21, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x4e, 0x6f, 0x64, 0x65, 0x7d, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62,
+ 0x2c, 0x63, 0x2c, 0x69, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6a, 0x2c, 0x6b, 0x2c, 0x6c, 0x2c,
+ 0x6d, 0x2c, 0x6e, 0x2c, 0x6f, 0x2c, 0x70, 0x3d, 0x66, 0x21, 0x3d, 0x3d, 0x67, 0x3f, 0x22, 0x6e,
+ 0x65, 0x78, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x3a, 0x22, 0x70, 0x72, 0x65,
+ 0x76, 0x69, 0x6f, 0x75, 0x73, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x71, 0x3d,
+ 0x62, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2c, 0x72, 0x3d, 0x68,
+ 0x26, 0x26, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x74, 0x6f, 0x4c,
+ 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2c, 0x73, 0x3d, 0x21, 0x69, 0x26,
+ 0x26, 0x21, 0x68, 0x2c, 0x74, 0x3d, 0x21, 0x31, 0x3b, 0x69, 0x66, 0x28, 0x71, 0x29, 0x7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0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x65, 0x3d,
+ 0x64, 0x2e, 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x73, 0x5b, 0x61, 0x5d, 0x7c, 0x7c, 0x64, 0x2e,
+ 0x73, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x5b, 0x61, 0x2e, 0x74, 0x6f, 0x4c,
+ 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x5d, 0x7c, 0x7c, 0x66, 0x61, 0x2e,
+ 0x65, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74,
+ 0x65, 0x64, 0x20, 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x3a, 0x20, 0x22, 0x2b, 0x61, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x5b, 0x75, 0x5d, 0x3f, 0x65, 0x28, 0x62, 0x29,
+ 0x3a, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x31, 0x3f, 0x28, 0x63, 0x3d, 0x5b,
+ 0x61, 0x2c, 0x61, 0x2c, 0x22, 0x22, 0x2c, 0x62, 0x5d, 0x2c, 0x64, 0x2e, 0x73, 0x65, 0x74, 0x46,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f,
+ 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x61, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43,
+ 0x61, 0x73, 0x65, 0x28, 0x29, 0x29, 0x3f, 0x68, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x66, 0x3d,
+ 0x65, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x2c, 0x67, 0x3d, 0x66, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x67, 0x2d, 0x2d, 0x29, 0x64, 0x3d, 0x4a, 0x28,
+ 0x61, 0x2c, 0x66, 0x5b, 0x67, 0x5d, 0x29, 0x2c, 0x61, 0x5b, 0x64, 0x5d, 0x3d, 0x21, 0x28, 0x63,
+ 0x5b, 0x64, 0x5d, 0x3d, 0x66, 0x5b, 0x67, 0x5d, 0x29, 0x7d, 0x29, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65,
+ 0x28, 0x61, 0x2c, 0x30, 0x2c, 0x63, 0x29, 0x7d, 0x29, 0x3a, 0x65, 0x7d, 0x7d, 0x2c, 0x70, 0x73,
+ 0x65, 0x75, 0x64, 0x6f, 0x73, 0x3a, 0x7b, 0x6e, 0x6f, 0x74, 0x3a, 0x68, 0x61, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d,
+ 0x5b, 0x5d, 0x2c, 0x63, 0x3d, 0x5b, 0x5d, 0x2c, 0x64, 0x3d, 0x68, 0x28, 0x61, 0x2e, 0x72, 0x65,
+ 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x51, 0x2c, 0x22, 0x24, 0x31, 0x22, 0x29, 0x29, 0x3b, 0x72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, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x30, 0x7d, 0x7d, 0x29, 0x2c, 0x63, 0x6f, 0x6e, 0x74,
+ 0x61, 0x69, 0x6e, 0x73, 0x3a, 0x68, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x61, 0x2e, 0x72,
+ 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x62, 0x61, 0x2c, 0x63, 0x61, 0x29, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x28, 0x62, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x7c, 0x7c,
+ 0x62, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x65, 0x78, 0x74, 0x7c, 0x7c, 0x65, 0x28, 0x62,
+ 0x29, 0x29, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28, 0x61, 0x29, 0x3e, 0x2d, 0x31,
+ 0x7d, 0x7d, 0x29, 0x2c, 0x6c, 0x61, 0x6e, 0x67, 0x3a, 0x68, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x56,
+ 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x7c, 0x7c, 0x22, 0x22, 0x29, 0x7c, 0x7c, 0x66, 0x61,
+ 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x75, 0x6e, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72,
+ 0x74, 0x65, 0x64, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x3a, 0x20, 0x22, 0x2b, 0x61, 0x29, 0x2c, 0x61,
+ 0x3d, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x62, 0x61, 0x2c, 0x63, 0x61,
+ 0x29, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x63, 0x3b, 0x64, 0x6f, 0x20, 0x69, 0x66, 0x28, 0x63, 0x3d, 0x70, 0x3f, 0x62, 0x2e, 0x6c, 0x61,
+ 0x6e, 0x67, 0x3a, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x28, 0x22, 0x78, 0x6d, 0x6c, 0x3a, 0x6c, 0x61, 0x6e, 0x67, 0x22, 0x29, 0x7c, 0x7c, 0x62,
+ 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x6c,
+ 0x61, 0x6e, 0x67, 0x22, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3d, 0x63,
+ 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2c, 0x63,
+ 0x3d, 0x3d, 0x3d, 0x61, 0x7c, 0x7c, 0x30, 0x3d, 0x3d, 0x3d, 0x63, 0x2e, 0x69, 0x6e, 0x64, 0x65,
+ 0x78, 0x4f, 0x66, 0x28, 0x61, 0x2b, 0x22, 0x2d, 0x22, 0x29, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65,
+ 0x28, 0x28, 0x62, 0x3d, 0x62, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65,
+ 0x29, 0x26, 0x26, 0x31, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70,
+ 0x65, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x7d, 0x7d, 0x29, 0x2c, 0x74,
+ 0x61, 0x72, 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x61, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x26, 0x26, 0x61, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x68,
+ 0x61, 0x73, 0x68, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x26, 0x26, 0x63, 0x2e,
+ 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x31, 0x29, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x69, 0x64, 0x7d,
+ 0x2c, 0x72, 0x6f, 0x6f, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x3d, 0x3d, 0x6f, 0x7d, 0x2c,
+ 0x66, 0x6f, 0x63, 0x75, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x61,
+ 0x63, 0x74, 0x69, 0x76, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x26, 0x26, 0x28, 0x21,
+ 0x6e, 0x2e, 0x68, 0x61, 0x73, 0x46, 0x6f, 0x63, 0x75, 0x73, 0x7c, 0x7c, 0x6e, 0x2e, 0x68, 0x61,
+ 0x73, 0x46, 0x6f, 0x63, 0x75, 0x73, 0x28, 0x29, 0x29, 0x26, 0x26, 0x21, 0x21, 0x28, 0x61, 0x2e,
+ 0x74, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x61, 0x2e, 0x68, 0x72, 0x65, 0x66, 0x7c, 0x7c, 0x7e, 0x61,
+ 0x2e, 0x74, 0x61, 0x62, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x7d, 0x2c, 0x65, 0x6e, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
+ 0x64, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x7d, 0x2c, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3d, 0x3d,
+ 0x3d, 0x21, 0x30, 0x7d, 0x2c, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x61,
+ 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65,
+ 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x69,
+ 0x6e, 0x70, 0x75, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x21, 0x21, 0x61, 0x2e, 0x63,
+ 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x7c, 0x7c, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x21, 0x21, 0x61, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
+ 0x65, 0x64, 0x7d, 0x2c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x61, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x26, 0x26, 0x61, 0x2e,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63,
+ 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2c, 0x61, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63,
+ 0x74, 0x65, 0x64, 0x3d, 0x3d, 0x3d, 0x21, 0x30, 0x7d, 0x2c, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28,
+ 0x61, 0x3d, 0x61, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x3b, 0x61,
+ 0x3b, 0x61, 0x3d, 0x61, 0x2e, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67,
+ 0x29, 0x69, 0x66, 0x28, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3c, 0x36,
+ 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x21, 0x30, 0x7d, 0x2c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x64, 0x2e,
+ 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x73, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x28, 0x61, 0x29,
+ 0x7d, 0x2c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x59, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x28, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x7d, 0x2c,
+ 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x58, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28,
+ 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x7d, 0x2c, 0x62, 0x75, 0x74,
+ 0x74, 0x6f, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65,
+ 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x62,
+ 0x26, 0x26, 0x22, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x74,
+ 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x22, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x3d,
+ 0x62, 0x7d, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65,
+ 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65,
+ 0x28, 0x29, 0x26, 0x26, 0x22, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x74,
+ 0x79, 0x70, 0x65, 0x26, 0x26, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x28, 0x62, 0x3d, 0x61,
+ 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x74,
+ 0x79, 0x70, 0x65, 0x22, 0x29, 0x29, 0x7c, 0x7c, 0x22, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3d, 0x3d,
+ 0x3d, 0x62, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29,
+ 0x29, 0x7d, 0x2c, 0x66, 0x69, 0x72, 0x73, 0x74, 0x3a, 0x6e, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x30, 0x5d,
+ 0x7d, 0x29, 0x2c, 0x6c, 0x61, 0x73, 0x74, 0x3a, 0x6e, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b,
+ 0x62, 0x2d, 0x31, 0x5d, 0x7d, 0x29, 0x2c, 0x65, 0x71, 0x3a, 0x6e, 0x61, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x5b, 0x30, 0x3e, 0x63, 0x3f, 0x63, 0x2b, 0x62, 0x3a, 0x63, 0x5d, 0x7d, 0x29,
+ 0x2c, 0x65, 0x76, 0x65, 0x6e, 0x3a, 0x6e, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x63,
+ 0x3d, 0x30, 0x3b, 0x62, 0x3e, 0x63, 0x3b, 0x63, 0x2b, 0x3d, 0x32, 0x29, 0x61, 0x2e, 0x70, 0x75,
+ 0x73, 0x68, 0x28, 0x63, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x29,
+ 0x2c, 0x6f, 0x64, 0x64, 0x3a, 0x6e, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d,
+ 0x31, 0x3b, 0x62, 0x3e, 0x63, 0x3b, 0x63, 0x2b, 0x3d, 0x32, 0x29, 0x61, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x28, 0x63, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x29, 0x2c,
+ 0x6c, 0x74, 0x3a, 0x6e, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d,
+ 0x30, 0x3e, 0x63, 0x3f, 0x63, 0x2b, 0x62, 0x3a, 0x63, 0x3b, 0x2d, 0x2d, 0x64, 0x3e, 0x3d, 0x30,
+ 0x3b, 0x29, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x64, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x29, 0x2c, 0x67, 0x74, 0x3a, 0x6e, 0x61, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x66, 0x6f, 0x72,
+ 0x28, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x30, 0x3e, 0x63, 0x3f, 0x63, 0x2b, 0x62, 0x3a, 0x63,
+ 0x3b, 0x2b, 0x2b, 0x64, 0x3c, 0x62, 0x3b, 0x29, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x64,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x29, 0x7d, 0x7d, 0x2c, 0x64,
+ 0x2e, 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x73, 0x2e, 0x6e, 0x74, 0x68, 0x3d, 0x64, 0x2e, 0x70,
+ 0x73, 0x65, 0x75, 0x64, 0x6f, 0x73, 0x2e, 0x65, 0x71, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x62, 0x20,
+ 0x69, 0x6e, 0x7b, 0x72, 0x61, 0x64, 0x69, 0x6f, 0x3a, 0x21, 0x30, 0x2c, 0x63, 0x68, 0x65, 0x63,
+ 0x6b, 0x62, 0x6f, 0x78, 0x3a, 0x21, 0x30, 0x2c, 0x66, 0x69, 0x6c, 0x65, 0x3a, 0x21, 0x30, 0x2c,
+ 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x3a, 0x21, 0x30, 0x2c, 0x69, 0x6d, 0x61, 0x67,
+ 0x65, 0x3a, 0x21, 0x30, 0x7d, 0x29, 0x64, 0x2e, 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x73, 0x5b,
+ 0x62, 0x5d, 0x3d, 0x6c, 0x61, 0x28, 0x62, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x62, 0x20, 0x69,
+ 0x6e, 0x7b, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x3a, 0x21, 0x30, 0x2c, 0x72, 0x65, 0x73, 0x65,
+ 0x74, 0x3a, 0x21, 0x30, 0x7d, 0x29, 0x64, 0x2e, 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x73, 0x5b,
+ 0x62, 0x5d, 0x3d, 0x6d, 0x61, 0x28, 0x62, 0x29, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x70, 0x61, 0x28, 0x29, 0x7b, 0x7d, 0x70, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x74, 0x79, 0x70, 0x65, 0x3d, 0x64, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x3d, 0x64,
+ 0x2e, 0x70, 0x73, 0x65, 0x75, 0x64, 0x6f, 0x73, 0x2c, 0x64, 0x2e, 0x73, 0x65, 0x74, 0x46, 0x69,
+ 0x6c, 0x74, 0x65, 0x72, 0x73, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x70, 0x61, 0x2c, 0x67, 0x3d, 0x66,
+ 0x61, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x69, 0x7a, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x65,
+ 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x2c, 0x69, 0x2c, 0x6a, 0x2c, 0x6b, 0x3d, 0x7a, 0x5b, 0x61,
+ 0x2b, 0x22, 0x20, 0x22, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x6b, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x62, 0x3f, 0x30, 0x3a, 0x6b, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x29,
+ 0x3b, 0x68, 0x3d, 0x61, 0x2c, 0x69, 0x3d, 0x5b, 0x5d, 0x2c, 0x6a, 0x3d, 0x64, 0x2e, 0x70, 0x72,
+ 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x68, 0x29,
+ 0x7b, 0x28, 0x21, 0x63, 0x7c, 0x7c, 0x28, 0x65, 0x3d, 0x52, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28,
+ 0x68, 0x29, 0x29, 0x29, 0x26, 0x26, 0x28, 0x65, 0x26, 0x26, 0x28, 0x68, 0x3d, 0x68, 0x2e, 0x73,
+ 0x6c, 0x69, 0x63, 0x65, 0x28, 0x65, 0x5b, 0x30, 0x5d, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x29, 0x7c, 0x7c, 0x68, 0x29, 0x2c, 0x69, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x66, 0x3d, 0x5b,
+ 0x5d, 0x29, 0x29, 0x2c, 0x63, 0x3d, 0x21, 0x31, 0x2c, 0x28, 0x65, 0x3d, 0x53, 0x2e, 0x65, 0x78,
+ 0x65, 0x63, 0x28, 0x68, 0x29, 0x29, 0x26, 0x26, 0x28, 0x63, 0x3d, 0x65, 0x2e, 0x73, 0x68, 0x69,
+ 0x66, 0x74, 0x28, 0x29, 0x2c, 0x66, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x3a, 0x63, 0x2c, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x65, 0x5b, 0x30, 0x5d, 0x2e, 0x72,
+ 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x51, 0x2c, 0x22, 0x20, 0x22, 0x29, 0x7d, 0x29, 0x2c,
+ 0x68, 0x3d, 0x68, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x29, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x67, 0x20, 0x69, 0x6e, 0x20, 0x64, 0x2e,
+ 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x29, 0x21, 0x28, 0x65, 0x3d, 0x57, 0x5b, 0x67, 0x5d, 0x2e,
+ 0x65, 0x78, 0x65, 0x63, 0x28, 0x68, 0x29, 0x29, 0x7c, 0x7c, 0x6a, 0x5b, 0x67, 0x5d, 0x26, 0x26,
+ 0x21, 0x28, 0x65, 0x3d, 0x6a, 0x5b, 0x67, 0x5d, 0x28, 0x65, 0x29, 0x29, 0x7c, 0x7c, 0x28, 0x63,
+ 0x3d, 0x65, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x2c, 0x66, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x28, 0x7b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x63, 0x2c, 0x74, 0x79, 0x70, 0x65, 0x3a,
+ 0x67, 0x2c, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x3a, 0x65, 0x7d, 0x29, 0x2c, 0x68, 0x3d,
+ 0x68, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x29, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x63, 0x29, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x7d, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3f, 0x68, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3a, 0x68, 0x3f, 0x66, 0x61, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x61, 0x29, 0x3a, 0x7a,
+ 0x28, 0x61, 0x2c, 0x69, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x29, 0x7d, 0x3b,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x71, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x66,
+ 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x30, 0x2c, 0x63, 0x3d, 0x61, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x64, 0x3d, 0x22, 0x22, 0x3b, 0x63, 0x3e, 0x62, 0x3b, 0x62,
+ 0x2b, 0x2b, 0x29, 0x64, 0x2b, 0x3d, 0x61, 0x5b, 0x62, 0x5d, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x72, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x3d, 0x62, 0x2e, 0x64, 0x69, 0x72, 0x2c, 0x65, 0x3d, 0x63, 0x26, 0x26, 0x22, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x22, 0x3d, 0x3d, 0x3d, 0x64, 0x2c, 0x66,
+ 0x3d, 0x78, 0x2b, 0x2b, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x2e, 0x66, 0x69,
+ 0x72, 0x73, 0x74, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x63,
+ 0x2c, 0x66, 0x29, 0x7b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x62, 0x3d, 0x62, 0x5b, 0x64, 0x5d,
+ 0x29, 0x69, 0x66, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79,
+ 0x70, 0x65, 0x7c, 0x7c, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x28, 0x62,
+ 0x2c, 0x63, 0x2c, 0x66, 0x29, 0x7d, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x62, 0x2c, 0x63, 0x2c, 0x67, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x68, 0x2c, 0x69, 0x2c, 0x6a,
+ 0x2c, 0x6b, 0x3d, 0x5b, 0x77, 0x2c, 0x66, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x67, 0x29, 0x7b, 0x77,
+ 0x68, 0x69, 0x6c, 0x65, 0x28, 0x62, 0x3d, 0x62, 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3d,
+ 0x68, 0x5b, 0x32, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x69, 0x5b, 0x64, 0x5d, 0x3d, 0x6b, 0x2c, 0x6b,
+ 0x5b, 0x32, 0x5d, 0x3d, 0x61, 0x28, 0x62, 0x2c, 0x63, 0x2c, 0x67, 0x29, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x21, 0x30, 0x7d, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x73, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x31, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x61,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x65, 0x2d,
+ 0x2d, 0x29, 0x69, 0x66, 0x28, 0x21, 0x61, 0x5b, 0x65, 0x5d, 0x28, 0x62, 0x2c, 0x63, 0x2c, 0x64,
+ 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x21, 0x30, 0x7d, 0x3a, 0x61, 0x5b, 0x30, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x74, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x66, 0x6f, 0x72,
+ 0x28, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x30, 0x2c, 0x65, 0x3d, 0x62, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3b, 0x65, 0x3e, 0x64, 0x3b, 0x64, 0x2b, 0x2b, 0x29, 0x66, 0x61, 0x28, 0x61,
+ 0x2c, 0x62, 0x5b, 0x64, 0x5d, 0x2c, 0x63, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x63, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x61, 0x28, 0x61, 0x2c,
+ 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72,
+ 0x20, 0x66, 0x2c, 0x67, 0x3d, 0x5b, 0x5d, 0x2c, 0x68, 0x3d, 0x30, 0x2c, 0x69, 0x3d, 0x61, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x6a, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x62,
+ 0x3b, 0x69, 0x3e, 0x68, 0x3b, 0x68, 0x2b, 0x2b, 0x29, 0x28, 0x66, 0x3d, 0x61, 0x5b, 0x68, 0x5d,
+ 0x29, 0x26, 0x26, 0x28, 0x21, 0x63, 0x7c, 0x7c, 0x63, 0x28, 0x66, 0x2c, 0x64, 0x2c, 0x65, 0x29,
+ 0x29, 0x26, 0x26, 0x28, 0x67, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x66, 0x29, 0x2c, 0x6a, 0x26,
+ 0x26, 0x62, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x68, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x67, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x76, 0x61,
+ 0x28,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x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x65, 0x2c,
+ 0x66, 0x3d, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x67, 0x3d, 0x64, 0x2e, 0x72,
+ 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5b, 0x61, 0x5b, 0x30, 0x5d, 0x2e, 0x74, 0x79, 0x70,
+ 0x65, 0x5d, 0x2c, 0x68, 0x3d, 0x67, 0x7c, 0x7c, 0x64, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x5b, 0x22, 0x20, 0x22, 0x5d, 0x2c, 0x69, 0x3d, 0x67, 0x3f, 0x31, 0x3a, 0x30, 0x2c,
+ 0x6b, 0x3d, 0x72, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x3d, 0x3d, 0x62, 0x7d, 0x2c, 0x68,
+ 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x6c, 0x3d, 0x72, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4a, 0x28, 0x62,
+ 0x2c, 0x61, 0x29, 0x3e, 0x2d, 0x31, 0x7d, 0x2c, 0x68, 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x6d, 0x3d,
+ 0x5b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x63, 0x2c, 0x64, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x21, 0x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+ 0x65, 0x3d, 0x2b, 0x2b, 0x69, 0x3b, 0x66, 0x3e, 0x65, 0x3b, 0x65, 0x2b, 0x2b, 0x29, 0x69, 0x66,
+ 0x28, 0x64, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5b, 0x61, 0x5b, 0x65, 0x5d,
+ 0x2e, 0x74, 0x79, 0x70, 0x65, 0x5d, 0x29, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x76, 0x61, 0x28, 0x69, 0x3e, 0x31, 0x26, 0x26, 0x73, 0x61, 0x28, 0x6d,
+ 0x29, 0x2c, 0x69, 0x3e, 0x31, 0x26, 0x26, 0x71, 0x61, 0x28, 0x61, 0x2e, 0x73, 0x6c, 0x69, 0x63,
+ 0x65, 0x28, 0x30, 0x2c, 0x69, 0x2d, 0x31, 0x29, 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28,
+ 0x7b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x22, 0x20, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x5b, 0x69,
+ 0x2d, 0x32, 0x5d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3f, 0x22, 0x2a, 0x22, 0x3a, 0x22, 0x22, 0x7d,
+ 0x29, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x51, 0x2c, 0x22, 0x24, 0x31,
+ 0x22, 0x29, 0x2c, 0x63, 0x2c, 0x65, 0x3e, 0x69, 0x26, 0x26, 0x77, 0x61, 0x28, 0x61, 0x2e, 0x73,
+ 0x6c, 0x69, 0x63, 0x65, 0x28, 0x69, 0x2c, 0x65, 0x29, 0x29, 0x2c, 0x66, 0x3e, 0x65, 0x26, 0x26,
+ 0x77, 0x61, 0x28, 0x61, 0x3d, 0x61, 0x2e, 0x73, 0x6c, 0x69, 0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7d, 0x6b, 0x26, 0x26, 0x28, 0x77, 0x3d, 0x79, 0x29, 0x7d, 0x63,
+ 0x26, 0x26, 0x28, 0x28, 0x6c, 0x3d, 0x21, 0x71, 0x26, 0x26, 0x6c, 0x29, 0x26, 0x26, 0x72, 0x2d,
+ 0x2d, 0x2c, 0x66, 0x26, 0x26, 0x74, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6c, 0x29, 0x29, 0x7d,
+ 0x69, 0x66, 0x28, 0x72, 0x2b, 0x3d, 0x73, 0x2c, 0x63, 0x26, 0x26, 0x73, 0x21, 0x3d, 0x3d, 0x72,
+ 0x29, 0x7b, 0x6f, 0x3d, 0x30, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x71, 0x3d, 0x62, 0x5b,
+ 0x6f, 0x2b, 0x2b, 0x5d, 0x29, 0x71, 0x28, 0x74, 0x2c, 0x75, 0x2c, 0x67, 0x2c, 0x68, 0x29, 0x3b,
+ 0x69, 0x66, 0x28, 0x66, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x72, 0x3e, 0x30, 0x29, 0x77, 0x68, 0x69,
+ 0x6c, 0x65, 0x28, 0x73, 0x2d, 0x2d, 0x29, 0x74, 0x5b, 0x73, 0x5d, 0x7c, 0x7c, 0x75, 0x5b, 0x73,
+ 0x5d, 0x7c, 0x7c, 0x28, 0x75, 0x5b, 0x73, 0x5d, 0x3d, 0x46, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28,
+ 0x69, 0x29, 0x29, 0x3b, 0x75, 0x3d, 0x75, 0x61, 0x28, 0x75, 0x29, 0x7d, 0x48, 0x2e, 0x61, 0x70,
+ 0x70, 0x6c, 0x79, 0x28, 0x69, 0x2c, 0x75, 0x29, 0x2c, 0x6b, 0x26, 0x26, 0x21, 0x66, 0x26, 0x26,
+ 0x75, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x30, 0x26, 0x26, 0x72, 0x2b, 0x62, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x31, 0x26, 0x26, 0x66, 0x61, 0x2e, 0x75, 0x6e, 0x69,
+ 0x71, 0x75, 0x65, 0x53, 0x6f, 0x72, 0x74, 0x28, 0x69, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x6b, 0x26, 0x26, 0x28, 0x77, 0x3d, 0x79, 0x2c, 0x6a, 0x3d, 0x76, 0x29, 0x2c, 0x74,
+ 0x7d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3f, 0x68, 0x61, 0x28, 0x66, 0x29,
+ 0x3a, 0x66, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x68, 0x3d, 0x66, 0x61, 0x2e, 0x63,
+ 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x5b, 0x5d, 0x2c,
+ 0x65, 0x3d, 0x5b, 0x5d, 0x2c, 0x66, 0x3d, 0x41, 0x5b, 0x61, 0x2b, 0x22, 0x20, 0x22, 0x5d, 0x3b,
+ 0x69, 0x66, 0x28, 0x21, 0x66, 0x29, 0x7b, 0x62, 0x7c, 0x7c, 0x28, 0x62, 0x3d, 0x67, 0x28, 0x61,
+ 0x29, 0x29, 0x2c, 0x63, 0x3d, 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x77, 0x68,
+ 0x69, 0x6c, 0x65, 0x28, 0x63, 0x2d, 0x2d, 0x29, 0x66, 0x3d, 0x77, 0x61, 0x28, 0x62, 0x5b, 0x63,
+ 0x5d, 0x29, 0x2c, 0x66, 0x5b, 0x75, 0x5d, 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 0x6f,
+ 0x5b, 0x30, 0x5d, 0x3d, 0x6f, 0x5b, 0x30, 0x5d, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30,
+ 0x29, 0x2c, 0x6a, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x32, 0x26, 0x26, 0x22, 0x49,
+ 0x44, 0x22, 0x3d, 0x3d, 0x3d, 0x28, 0x6b, 0x3d, 0x6a, 0x5b, 0x30, 0x5d, 0x29, 0x2e, 0x74, 0x79,
+ 0x70, 0x65, 0x26, 0x26, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x79, 0x49, 0x64, 0x26, 0x26, 0x39,
+ 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x70,
+ 0x26, 0x26, 0x64, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5b, 0x6a, 0x5b, 0x31,
+ 0x5d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x5d, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x62, 0x3d, 0x28, 0x64,
+ 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x2e, 0x49, 0x44, 0x28, 0x6b, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68,
+ 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x62, 0x61,
+ 0x2c, 0x63, 0x61, 0x29, 0x2c, 0x62, 0x29, 0x7c, 0x7c, 0x5b, 0x5d, 0x29, 0x5b, 0x30, 0x5d, 0x2c,
+ 0x21, 0x62, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x3b, 0x6e, 0x26, 0x26, 0x28,
+ 0x62, 0x3d, 0x62, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x29, 0x2c,
+ 0x61, 0x3d, 0x61, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x6a, 0x2e, 0x73, 0x68, 0x69, 0x66,
+ 0x74, 0x28, 0x29, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x29, 0x7d, 0x69, 0x3d, 0x57, 0x2e, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x65,
+ 0x78, 0x74, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x3f, 0x30, 0x3a, 0x6a, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x69, 0x2d, 0x2d, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x6b, 0x3d, 0x6a, 0x5b, 0x69, 0x5d, 0x2c, 0x64, 0x2e, 0x72, 0x65, 0x6c,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x5b, 0x6c, 0x3d, 0x6b, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x5d, 0x29,
+ 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x69, 0x66, 0x28, 0x28, 0x6d, 0x3d, 0x64, 0x2e, 0x66, 0x69,
+ 0x6e, 0x64, 0x5b, 0x6c, 0x5d, 0x29, 0x26, 0x26, 0x28, 0x66, 0x3d, 0x6d, 0x28, 0x6b, 0x2e, 0x6d,
+ 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63,
+ 0x65, 0x28, 0x62, 0x61, 0x2c, 0x63, 0x61, 0x29, 0x2c, 0x5f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28,
+ 0x6a, 0x5b, 0x30, 0x5d, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x29, 0x26, 0x26, 0x6f, 0x61, 0x28, 0x62,
+ 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x29, 0x7c, 0x7c, 0x62, 0x29,
+ 0x29, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x6a, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x69,
+ 0x2c, 0x31, 0x29, 0x2c, 0x61, 0x3d, 0x66, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26,
+ 0x71, 0x61, 0x28, 0x6a, 0x29, 0x2c, 0x21, 0x61, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x48, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x65, 0x2c, 0x66, 0x29, 0x2c, 0x65, 0x3b, 0x62,
+ 0x72, 0x65, 0x61, 0x6b, 0x7d, 0x7d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x6e, 0x7c,
+ 0x7c, 0x68, 0x28, 0x61, 0x2c, 0x6f, 0x29, 0x29, 0x28, 0x66, 0x2c, 0x62, 0x2c, 0x21, 0x70, 0x2c,
+ 0x65, 0x2c, 0x21, 0x62, 0x7c, 0x7c, 0x5f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x26,
+ 0x26, 0x6f, 0x61, 0x28, 0x62, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65,
+ 0x29, 0x7c, 0x7c, 0x62, 0x29, 0x2c, 0x65, 0x7d, 0x2c, 0x63, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x53,
+ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3d, 0x75, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x22, 0x22,
+ 0x29, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x28, 0x42, 0x29, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22,
+ 0x22, 0x29, 0x3d, 0x3d, 0x3d, 0x75, 0x2c, 0x63, 0x2e, 0x64, 0x65, 0x74, 0x65, 0x63, 0x74, 0x44,
+ 0x75, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x65, 0x73, 0x3d, 0x21, 0x21, 0x6c, 0x2c, 0x6d, 0x28,
+ 0x29, 0x2c, 0x63, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64,
+ 0x3d, 0x69, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x26, 0x61, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x61,
+ 0x72, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x6e, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x29, 0x7d, 0x29, 0x2c, 0x69, 0x61, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x22,
+ 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x27, 0x23, 0x27, 0x3e, 0x3c, 0x2f, 0x61, 0x3e,
+ 0x22, 0x2c, 0x22, 0x23, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43,
+ 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x28, 0x22, 0x68, 0x72, 0x65, 0x66, 0x22, 0x29, 0x7d, 0x29, 0x7c, 0x7c, 0x6a, 0x61, 0x28,
+ 0x22, 0x74, 0x79, 0x70, 0x65, 0x7c, 0x68, 0x72, 0x65, 0x66, 0x7c, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x7c, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x63, 0x3f, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3a, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x62, 0x2c, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65,
+ 0x28, 0x29, 0x3f, 0x31, 0x3a, 0x32, 0x29, 0x7d, 0x29, 0x2c, 0x63, 0x2e, 0x61, 0x74, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x26, 0x26, 0x69, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e,
+ 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x22, 0x3c, 0x69, 0x6e, 0x70, 0x75,
+ 0x74, 0x2f, 0x3e, 0x22, 0x2c, 0x61, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c,
+ 0x64, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x22, 0x22, 0x29, 0x2c, 0x22, 0x22, 0x3d, 0x3d, 0x3d,
+ 0x61, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x67, 0x65, 0x74,
+ 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x22, 0x29, 0x7d, 0x29, 0x7c, 0x7c, 0x6a, 0x61, 0x28, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x7c, 0x7c, 0x22, 0x69, 0x6e, 0x70, 0x75,
+ 0x74, 0x22, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2e,
+ 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x3f, 0x76, 0x6f,
+ 0x69, 0x64, 0x20, 0x30, 0x3a, 0x61, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61,
+ 0x6c, 0x75, 0x65, 0x7d, 0x29, 0x2c, 0x69, 0x61, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x3d, 0x3d, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x28, 0x22, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x29, 0x7d, 0x29, 0x7c, 0x7c,
+ 0x6a, 0x61, 0x28, 0x4b, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c,
+ 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x63, 0x3f, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3a, 0x61, 0x5b, 0x62, 0x5d, 0x3d,
+ 0x3d, 0x3d, 0x21, 0x30, 0x3f, 0x62, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61,
+ 0x73, 0x65, 0x28, 0x29, 0x3a, 0x28, 0x64, 0x3d, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x62, 0x29, 0x29, 0x26, 0x26,
+ 0x64, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69,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x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x64, 0x3d, 0x5b, 0x5d, 0x2c, 0x65, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d,
+ 0x63, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x28, 0x61, 0x3d, 0x61, 0x5b, 0x62, 0x5d, 0x29,
+ 0x26, 0x26, 0x39, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65,
+ 0x29, 0x69, 0x66, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79,
+ 0x70, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x65, 0x26, 0x26, 0x6e, 0x28, 0x61, 0x29, 0x2e, 0x69,
+ 0x73, 0x28, 0x63, 0x29, 0x29, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x64, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x28, 0x61, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x7d, 0x2c, 0x76,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x66,
+ 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x5b, 0x5d, 0x3b, 0x61, 0x3b, 0x61, 0x3d,
+ 0x61, 0x2e, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x29, 0x31, 0x3d,
+ 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0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, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x21, 0x21, 0x62, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x2c, 0x64, 0x2c,
+ 0x61, 0x29, 0x21, 0x3d, 0x3d, 0x63, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x62, 0x2e, 0x6e, 0x6f,
+ 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e,
+ 0x67, 0x72, 0x65, 0x70, 0x28, 0x61, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x3d, 0x3d, 0x62, 0x21,
+ 0x3d, 0x3d, 0x63, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x79, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x62, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x62, 0x2c, 0x61, 0x2c, 0x63, 0x29,
+ 0x3b, 0x62, 0x3d, 0x6e, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x62, 0x2c, 0x61, 0x29,
+ 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x28, 0x61,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x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 0x72, 0x65, 0x70, 0x28, 0x62, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x6e,
+ 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7d, 0x29, 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x66, 0x6e,
+ 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x66, 0x69, 0x6e, 0x64, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c,
+ 0x63, 0x3d, 0x5b, 0x5d, 0x2c, 0x64, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x65, 0x3d, 0x64, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e,
+ 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61,
+ 0x63, 0x6b, 0x28, 0x6e, 0x28, 0x61, 0x29, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x62, 0x3d,
+ 0x30, 0x3b, 0x65, 0x3e, 0x62, 0x3b, 0x62, 0x2b, 0x2b, 0x29, 0x69, 0x66, 0x28, 0x6e, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x28, 0x64, 0x5b, 0x62, 0x5d, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x30, 0x7d, 0x29, 0x29, 0x3b, 0x66,
+ 0x6f, 0x72, 0x28, 0x62, 0x3d, 0x30, 0x3b, 0x65, 0x3e, 0x62, 0x3b, 0x62, 0x2b, 0x2b, 0x29, 0x6e,
+ 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x28, 0x61, 0x2c, 0x64, 0x5b, 0x62, 0x5d, 0x2c, 0x63, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75,
+ 0x73, 0x68, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x28, 0x65, 0x3e, 0x31, 0x3f, 0x6e, 0x2e, 0x75, 0x6e,
+ 0x69, 0x71, 0x75, 0x65, 0x28, 0x63, 0x29, 0x3a, 0x63, 0x29, 0x2c, 0x63, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63,
+ 0x74, 0x6f, 0x72, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f,
+ 0x72, 0x2b, 0x22, 0x20, 0x22, 0x2b, 0x61, 0x3a, 0x61, 0x2c, 0x63, 0x7d, 0x2c, 0x66, 0x69, 0x6c,
+ 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68,
+ 0x53, 0x74, 0x61, 0x63, 0x6b, 0x28, 0x7a, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x7c, 0x7c,
+ 0x5b, 0x5d, 0x2c, 0x21, 0x31, 0x29, 0x29, 0x7d, 0x2c, 0x6e, 0x6f, 0x74, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x28, 0x7a,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x7c, 0x7c, 0x5b, 0x5d, 0x2c, 0x21, 0x30, 0x29, 0x29,
+ 0x7d, 0x2c, 0x69, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x21, 0x7a, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x61, 0x26, 0x26, 0x77, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x3f, 0x6e, 0x28,
+ 0x61, 0x29, 0x3a, 0x61, 0x7c, 0x7c, 0x5b, 0x5d, 0x2c, 0x21, 0x31, 0x29, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x7d, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x41, 0x2c, 0x42, 0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e, 0x3d, 0x33, 0x3f, 0x5b, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x61,
+ 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x5d, 0x3a, 0x42, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x61, 0x29,
+ 0x2c, 0x21, 0x65, 0x7c, 0x7c, 0x21, 0x65, 0x5b, 0x31, 0x5d, 0x26, 0x26, 0x62, 0x29, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x21, 0x62, 0x7c, 0x7c, 0x62, 0x2e, 0x6a, 0x71, 0x75, 0x65, 0x72, 0x79,
+ 0x3f, 0x28, 0x62, 0x7c, 0x7c, 0x63, 0x29, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x28, 0x61, 0x29, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72,
+ 0x28, 0x62, 0x29, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x28, 0x61, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x65,
+ 0x5b, 0x31, 0x5d, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x62, 0x3d, 0x62, 0x20, 0x69, 0x6e, 0x73, 0x74,
+ 0x61, 0x6e, 0x63, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x3f, 0x62, 0x5b, 0x30, 0x5d, 0x3a, 0x62, 0x2c,
+ 0x6e, 0x2e, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x2e, 0x70,
+ 0x61, 0x72, 0x73, 0x65, 0x48, 0x54, 0x4d, 0x4c, 0x28, 0x65, 0x5b, 0x31, 0x5d, 0x2c, 0x62, 0x26,
+ 0x26, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3f, 0x62, 0x2e, 0x6f, 0x77,
+ 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x62, 0x3a, 0x64,
+ 0x2c, 0x21, 0x30, 0x29, 0x29, 0x2c, 0x78, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x65, 0x5b, 0x31,
+ 0x5d, 0x29, 0x26, 0x26, 0x6e, 0x2e, 0x69, 0x73, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x28, 0x62, 0x29, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x20, 0x69, 0x6e, 0x20,
+ 0x62, 0x29, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x5b, 0x65, 0x5d, 0x29, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x65, 0x5d, 0x28,
+ 0x62, 0x5b, 0x65, 0x5d, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28,
+ 0x65, 0x2c, 0x62, 0x5b, 0x65, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74,
+ 0x68, 0x69, 0x73, 0x7d, 0x69, 0x66, 0x28, 0x66, 0x3d, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x65, 0x5b, 0x32, 0x5d, 0x29, 0x2c,
+ 0x66, 0x26, 0x26, 0x66, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x66, 0x2e, 0x69, 0x64, 0x21, 0x3d, 0x3d, 0x65, 0x5b, 0x32, 0x5d, 0x29,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x41, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x28, 0x61, 0x29,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3d, 0x31, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x3d, 0x66, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x3d, 0x64, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x3d, 0x61, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x6e, 0x6f, 0x64,
+ 0x65, 0x54, 0x79, 0x70, 0x65, 0x3f, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
+ 0x65, 0x78, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x3d, 0x61, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3d, 0x31, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x3a, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x3f, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x63, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x3f, 0x63, 0x2e,
+ 0x72, 0x65, 0x61, 0x64, 0x79, 0x28, 0x61, 0x29, 0x3a, 0x61, 0x28, 0x6e, 0x29, 0x3a, 0x28, 0x76,
+ 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
+ 0x6f, 0x72, 0x26, 0x26, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
+ 0x6f, 0x72, 0x3d, 0x61, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x3d, 0x61, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x74, 0x65, 0x78, 0x74, 0x29, 0x2c, 0x6e, 0x2e, 0x6d, 0x61, 0x6b, 0x65, 0x41, 0x72, 0x72, 0x61,
+ 0x79, 0x28, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x7d, 0x3b, 0x43, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x6e, 0x2e, 0x66, 0x6e, 0x2c, 0x41, 0x3d, 0x6e,
+ 0x28, 0x64, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x44, 0x3d, 0x2f, 0x5e, 0x28, 0x3f, 0x3a, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x7c, 0x70, 0x72, 0x65, 0x76, 0x28, 0x3f, 0x3a, 0x55, 0x6e,
+ 0x74, 0x69, 0x6c, 0x7c, 0x41, 0x6c, 0x6c, 0x29, 0x29, 0x2f, 0x2c, 0x45, 0x3d, 0x7b, 0x63, 0x68,
+ 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x3a, 0x21, 0x30, 0x2c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
+ 0x74, 0x73, 0x3a, 0x21, 0x30, 0x2c, 0x6e, 0x65, 0x78, 0x74, 0x3a, 0x21, 0x30, 0x2c, 0x70, 0x72,
+ 0x65, 0x76, 0x3a, 0x21, 0x30, 0x7d, 0x3b, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65,
+ 0x6e, 0x64, 0x28, 0x7b, 0x68, 0x61, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x3d, 0x6e, 0x28, 0x61, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x64, 0x3d, 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x69, 0x6c,
+ 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66,
+ 0x6f, 0x72, 0x28, 0x62, 0x3d, 0x30, 0x3b, 0x64, 0x3e, 0x62, 0x3b, 0x62, 0x2b, 0x2b, 0x29, 0x69,
+ 0x66, 0x28, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x63, 0x5b, 0x62, 0x5d, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x30,
+ 0x7d, 0x29, 0x7d, 0x2c, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61,
+ 0x72, 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x30, 0x2c, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x66, 0x3d, 0x5b, 0x5d, 0x2c, 0x67, 0x3d, 0x77, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x7c, 0x7c, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22,
+ 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x3f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x29, 0x3a,
+ 0x30, 0x3b, 0x65, 0x3e, 0x64, 0x3b, 0x64, 0x2b, 0x2b, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x63, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x5b, 0x64, 0x5d, 0x3b, 0x63, 0x26, 0x26, 0x63, 0x21, 0x3d, 0x3d, 0x62,
+ 0x3b, 0x63, 0x3d, 0x63, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x29,
+ 0x69, 0x66, 0x28, 0x63, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3c, 0x31, 0x31,
+ 0x26, 0x26, 0x28, 0x67, 0x3f, 0x67, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x28, 0x63, 0x29, 0x3e,
+ 0x2d, 0x31, 0x3a, 0x31, 0x3d, 0x3d, 0x3d, 0x63, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70,
+ 0x65, 0x26, 0x26, 0x6e, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65,
+ 0x73, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x28, 0x63, 0x2c, 0x61, 0x29, 0x29, 0x29,
+ 0x7b, 0x66, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63, 0x29, 0x3b, 0x62, 0x72, 0x65, 0x61, 0x6b,
+ 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x28, 0x66, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e,
+ 0x31, 0x3f, 0x6e, 0x2e, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x53, 0x6f, 0x72, 0x74, 0x28, 0x66,
+ 0x29, 0x3a, 0x66, 0x29, 0x7d, 0x2c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x3f, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x61, 0x3f, 0x6e, 0x2e, 0x69, 0x6e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2c, 0x6e, 0x28, 0x61, 0x29, 0x29, 0x3a, 0x6e, 0x2e, 0x69, 0x6e,
+ 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x61, 0x2e, 0x6a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x3f, 0x61,
+ 0x5b, 0x30, 0x5d, 0x3a, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73,
+ 0x5b, 0x30, 0x5d, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x69, 0x72,
+ 0x73, 0x74, 0x28, 0x29, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x41, 0x6c, 0x6c, 0x28, 0x29, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x2d, 0x31, 0x7d, 0x2c, 0x61, 0x64, 0x64, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61, 0x63,
+ 0x6b, 0x28, 0x6e, 0x2e, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x53, 0x6f, 0x72, 0x74, 0x28, 0x6e,
+ 0x2e, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x28,
+ 0x29, 0x2c, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x29, 0x29, 0x29, 0x7d, 0x2c, 0x61, 0x64, 0x64,
+ 0x42, 0x61, 0x63, 0x6b, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x64, 0x64,
+ 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72,
+ 0x65, 0x76, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72,
+ 0x65, 0x76, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28,
+ 0x61, 0x29, 0x29, 0x7d, 0x7d, 0x29, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x46, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x64, 0x6f, 0x20, 0x61, 0x3d, 0x61, 0x5b, 0x62, 0x5d,
+ 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x61, 0x26, 0x26, 0x31, 0x21, 0x3d, 0x3d, 0x61, 0x2e,
+ 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x7d, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x62, 0x3d, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x26, 0x26, 0x31, 0x31, 0x21, 0x3d, 0x3d,
+ 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3f, 0x62, 0x3a, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x7d, 0x2c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x28,
+ 0x61, 0x2c, 0x22, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x22, 0x29, 0x7d,
+ 0x2c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x73, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x28, 0x61, 0x2c, 0x22, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x4e, 0x6f, 0x64, 0x65, 0x22, 0x2c, 0x63, 0x29, 0x7d, 0x2c, 0x6e, 0x65, 0x78, 0x74, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x46, 0x28, 0x61, 0x2c, 0x22, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69,
+ 0x6e, 0x67, 0x22, 0x29, 0x7d, 0x2c, 0x70, 0x72, 0x65, 0x76, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x46, 0x28,
+ 0x61, 0x2c, 0x22, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x53, 0x69, 0x62, 0x6c, 0x69,
+ 0x6e, 0x67, 0x22, 0x29, 0x7d, 0x2c, 0x6e, 0x65, 0x78, 0x74, 0x41, 0x6c, 0x6c, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x75, 0x28, 0x61, 0x2c, 0x22, 0x6e, 0x65, 0x78, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e,
+ 0x67, 0x22, 0x29, 0x7d, 0x2c, 0x70, 0x72, 0x65, 0x76, 0x41, 0x6c, 0x6c, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x75, 0x28, 0x61, 0x2c, 0x22, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x53, 0x69, 0x62,
+ 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x7d, 0x2c, 0x6e, 0x65, 0x78, 0x74, 0x55, 0x6e, 0x74, 0x69,
+ 0x6c, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x28, 0x61, 0x2c, 0x22, 0x6e, 0x65,
+ 0x78, 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x63, 0x29, 0x7d, 0x2c, 0x70,
+ 0x72, 0x65, 0x76, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x75, 0x28, 0x61, 0x2c, 0x22, 0x70, 0x72, 0x65, 0x76, 0x69, 0x6f, 0x75, 0x73, 0x53, 0x69, 0x62,
+ 0x6c, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x63, 0x29, 0x7d, 0x2c, 0x73, 0x69, 0x62, 0x6c, 0x69, 0x6e,
+ 0x67, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x28, 0x28, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x7c, 0x7c, 0x7b, 0x7d, 0x29, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74,
+ 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2c, 0x61, 0x29, 0x7d, 0x2c, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72,
+ 0x65, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x28, 0x61, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43,
+ 0x68, 0x69, 0x6c, 0x64, 0x29, 0x7d, 0x2c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0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x69, 0x6c, 0x22, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x73, 0x6c, 0x69,
+ 0x63, 0x65, 0x28, 0x2d, 0x35, 0x29, 0x26, 0x26, 0x28, 0x64, 0x3d, 0x63, 0x29, 0x2c, 0x64, 0x26,
+ 0x26, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x64, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x6e, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72,
+ 0x28, 0x64, 0x2c, 0x65, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x3e, 0x31, 0x26, 0x26, 0x28, 0x45, 0x5b, 0x61, 0x5d, 0x7c, 0x7c, 0x28, 0x65, 0x3d,
+ 0x6e, 0x2e, 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x53, 0x6f, 0x72, 0x74, 0x28, 0x65, 0x29, 0x29,
+ 0x2c, 0x44, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x65,
+ 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x28, 0x29, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x28, 0x65, 0x29, 0x7d, 0x7d,
+ 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x47, 0x3d, 0x2f, 0x5c, 0x53, 0x2b, 0x2f, 0x67, 0x3b, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x48, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20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21, 0x30, 0x3b, 0x67, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x3b, 0x68, 0x3d, 0x2d, 0x31, 0x29, 0x7b, 0x63, 0x3d, 0x67, 0x2e, 0x73, 0x68, 0x69,
+ 0x66, 0x74, 0x28, 0x29, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x2b, 0x2b, 0x68, 0x3c, 0x66,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x66, 0x5b, 0x68, 0x5d, 0x2e, 0x61, 0x70, 0x70,
+ 0x6c, 0x79, 0x28, 0x63, 0x5b, 0x30, 0x5d, 0x2c, 0x63, 0x5b, 0x31, 0x5d, 0x29, 0x3d, 0x3d, 0x3d,
+ 0x21, 0x31, 0x26, 0x26, 0x61, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x4f, 0x6e, 0x46, 0x61, 0x6c, 0x73,
+ 0x65, 0x26, 0x26, 0x28, 0x68, 0x3d, 0x66, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x63,
+ 0x3d, 0x21, 0x31, 0x29, 0x7d, 0x61, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x7c, 0x7c, 0x28,
+ 0x63, 0x3d, 0x21, 0x31, 0x29, 0x2c, 0x62, 0x3d, 0x21, 0x31, 0x2c, 0x65, 0x26, 0x26, 0x28, 0x66,
+ 0x3d, 0x63, 0x3f, 0x5b, 0x5d, 0x3a, 0x22, 0x22, 0x29, 0x7d, 0x2c, 0x6a, 0x3d, 0x7b, 0x61, 0x64,
+ 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x66, 0x26, 0x26, 0x28, 0x63, 0x26, 0x26, 0x21, 0x62, 0x26, 0x26, 0x28,
+ 0x68, 0x3d, 0x66, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x2c, 0x67, 0x2e, 0x70,
+ 0x75, 0x73, 0x68, 0x28, 0x63, 0x29, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x64, 0x28, 0x62, 0x29, 0x7b, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x62, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x6e, 0x2e, 0x69,
+ 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x3f, 0x61, 0x2e, 0x75,
+ 0x6e, 0x69, 0x71, 0x75, 0x65, 0x26, 0x26, 0x6a, 0x2e, 0x68, 0x61, 0x73, 0x28, 0x63, 0x29, 0x7c,
+ 0x7c, 0x66, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63, 0x29, 0x3a, 0x63, 0x26, 0x26, 0x63, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22,
+ 0x21, 0x3d, 0x3d, 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x28, 0x63, 0x29, 0x26, 0x26, 0x64, 0x28,
+ 0x63, 0x29, 0x7d, 0x29, 0x7d, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29,
+ 0x2c, 0x63, 0x26, 0x26, 0x21, 0x62, 0x26, 0x26, 0x69, 0x28, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x7d, 0x2c, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x65, 0x61,
+ 0x63, 0x68, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63,
+ 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x28, 0x63, 0x3d, 0x6e, 0x2e, 0x69, 0x6e, 0x41, 0x72,
+ 0x72, 0x61, 0x79, 0x28, 0x62, 0x2c, 0x66, 0x2c, 0x63, 0x29, 0x29, 0x3e, 0x2d, 0x31, 0x29, 0x66,
+ 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x63, 0x2c, 0x31, 0x29, 0x2c, 0x68, 0x3e, 0x3d,
+ 0x63, 0x26, 0x26, 0x68, 0x2d, 0x2d, 0x7d, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x68,
+ 0x61, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3f, 0x6e, 0x2e, 0x69, 0x6e, 0x41, 0x72, 0x72, 0x61,
+ 0x79, 0x28, 0x61, 0x2c, 0x66, 0x29, 0x3e, 0x2d, 0x31, 0x3a, 0x66, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x3e, 0x30, 0x7d, 0x2c, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x26,
+ 0x26, 0x28, 0x66, 0x3d, 0x5b, 0x5d, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x64, 0x69,
+ 0x73, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x3d, 0x67, 0x3d, 0x5b, 0x5d, 0x2c, 0x66,
+ 0x3d, 0x63, 0x3d, 0x22, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x64, 0x69, 0x73, 0x61,
+ 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x66, 0x7d, 0x2c, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x65, 0x3d, 0x21, 0x30, 0x2c, 0x63, 0x7c, 0x7c, 0x6a, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62,
+ 0x6c, 0x65, 0x28, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x6c, 0x6f, 0x63, 0x6b, 0x65,
+ 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x21, 0x21, 0x65, 0x7d, 0x2c, 0x66, 0x69, 0x72, 0x65, 0x57, 0x69, 0x74, 0x68,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x63, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x7c, 0x7c, 0x28, 0x63, 0x3d, 0x63, 0x7c, 0x7c, 0x5b,
+ 0x5d, 0x2c, 0x63, 0x3d, 0x5b, 0x61, 0x2c, 0x63, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x3f, 0x63,
+ 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x29, 0x3a, 0x63, 0x5d, 0x2c, 0x67, 0x2e, 0x70, 0x75,
+ 0x73, 0x68, 0x28, 0x63, 0x29, 0x2c, 0x62, 0x7c, 0x7c, 0x69, 0x28, 0x29, 0x29, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x7d, 0x2c, 0x66, 0x69, 0x72, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6a, 0x2e, 0x66, 0x69, 0x72,
+ 0x65, 0x57, 0x69, 0x74, 0x68, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x66, 0x69, 0x72, 0x65,
+ 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x21, 0x21, 0x64, 0x7d, 0x7d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x6a, 0x7d, 0x2c, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x44, 0x65, 0x66,
+ 0x65, 0x72, 0x72, 0x65, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x5b, 0x5b, 0x22, 0x72, 0x65, 0x73, 0x6f, 0x6c,
+ 0x76, 0x65, 0x22, 0x2c, 0x22, 0x64, 0x6f, 0x6e, 0x65, 0x22, 0x2c, 0x6e, 0x2e, 0x43, 0x61, 0x6c,
+ 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x28, 0x22, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x6d,
+ 0x6f, 0x72, 0x79, 0x22, 0x29, 0x2c, 0x22, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x22,
+ 0x5d, 0x2c, 0x5b, 0x22, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x2c, 0x22, 0x66, 0x61, 0x69,
+ 0x6c, 0x22, 0x2c, 0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x28, 0x22,
+ 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x22, 0x29, 0x2c, 0x22, 0x72,
+ 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x22, 0x5d, 0x2c, 0x5b, 0x22, 0x6e, 0x6f, 0x74, 0x69,
+ 0x66, 0x79, 0x22, 0x2c, 0x22, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x2c, 0x6e,
+ 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x28, 0x22, 0x6d, 0x65, 0x6d, 0x6f,
+ 0x72, 0x79, 0x22, 0x29, 0x5d, 0x5d, 0x2c, 0x63, 0x3d, 0x22, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e,
+ 0x67, 0x22, 0x2c, 0x64, 0x3d, 0x7b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x7d,
+ 0x2c, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x64, 0x6f, 0x6e, 0x65,
+ 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2e, 0x66, 0x61, 0x69, 0x6c,
+ 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x7d, 0x2c, 0x74, 0x68, 0x65, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x44, 0x65, 0x66, 0x65, 0x72,
+ 0x72, 0x65, 0x64, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x7b,
+ 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x62, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x62, 0x2c, 0x66, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x3d, 0x6e, 0x2e, 0x69,
+ 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x5b, 0x62, 0x5d, 0x29, 0x26,
+ 0x26, 0x61, 0x5b, 0x62, 0x5d, 0x3b, 0x65, 0x5b, 0x66, 0x5b, 0x31, 0x5d, 0x5d, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x67,
+ 0x26, 0x26, 0x67, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x61, 0x26, 0x26, 0x6e, 0x2e, 0x69,
+ 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x6d,
+ 0x69, 0x73, 0x65, 0x29, 0x3f, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65, 0x28, 0x29,
+ 0x2e, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x28, 0x63, 0x2e, 0x6e, 0x6f, 0x74, 0x69,
+ 0x66, 0x79, 0x29, 0x2e, 0x64, 0x6f, 0x6e, 0x65, 0x28, 0x63, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c,
+ 0x76, 0x65, 0x29, 0x2e, 0x66, 0x61, 0x69, 0x6c, 0x28, 0x63, 0x2e, 0x72, 0x65, 0x6a, 0x65, 0x63,
+ 0x74, 0x29, 0x3a, 0x63, 0x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x57, 0x69, 0x74, 0x68, 0x7d, 0x29, 0x2c, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x6d,
+ 0x69, 0x73, 0x65, 0x28, 0x65, 0x29, 0x2c, 0x61, 0x26, 0x26, 0x61, 0x2e, 0x63, 0x61, 0x6c, 0x6c,
+ 0x28, 0x65, 0x2c, 0x65, 0x29, 0x2c, 0x65, 0x7d, 0x2c, 0x77, 0x68, 0x65, 0x6e, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d,
+ 0x30, 0x2c, 0x63, 0x3d, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x64, 0x3d, 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x2c, 0x66, 0x3d, 0x31, 0x21, 0x3d, 0x3d, 0x64, 0x7c, 0x7c, 0x61, 0x26, 0x26, 0x6e, 0x2e, 0x69,
+ 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x6d,
+ 0x69, 0x73, 0x65, 0x29, 0x3f, 0x64, 0x3a, 0x30, 0x2c, 0x67, 0x3d, 0x31, 0x3d, 0x3d, 0x3d, 0x66,
+ 0x3f, 0x61, 0x3a, 0x6e, 0x2e, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x28, 0x29, 0x2c,
+ 0x68, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x62, 0x5b, 0x61, 0x5d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x63,
+ 0x5b, 0x61, 0x5d, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x31, 0x3f, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3a, 0x64, 0x2c, 0x63, 0x3d, 0x3d, 0x3d, 0x69,
+ 0x3f, 0x67, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x57, 0x69, 0x74, 0x68, 0x28, 0x62, 0x2c,
+ 0x63, 0x29, 0x3a, 0x2d, 0x2d, 0x66, 0x7c, 0x7c, 0x67, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76,
+ 0x65, 0x57, 0x69, 0x74, 0x68, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x7d, 0x7d, 0x2c, 0x69, 0x2c, 0x6a,
+ 0x2c, 0x6b, 0x3b, 0x69, 0x66, 0x28, 0x64, 0x3e, 0x31, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x69, 0x3d,
+ 0x6e, 0x65, 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x64, 0x29, 0x2c, 0x6a, 0x3d, 0x6e,
+ 0x65, 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x64, 0x29, 0x2c, 0x6b, 0x3d, 0x6e, 0x65,
+ 0x77, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x64, 0x29, 0x3b, 0x64, 0x3e, 0x62, 0x3b, 0x62,
+ 0x2b, 0x2b, 0x29, 0x63, 0x5b, 0x62, 0x5d, 0x26, 0x26, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x5b, 0x62, 0x5d, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x69,
+ 0x73, 0x65, 0x29, 0x3f, 0x63, 0x5b, 0x62, 0x5d, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65,
+ 0x28, 0x29, 0x2e, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x28, 0x68, 0x28, 0x62, 0x2c,
+ 0x6a, 0x2c, 0x69, 0x29, 0x29, 0x2e, 0x64, 0x6f, 0x6e, 0x65, 0x28, 0x68, 0x28, 0x62, 0x2c, 0x6b,
+ 0x2c, 0x63, 0x29, 0x29, 0x2e, 0x66, 0x61, 0x69, 0x6c, 0x28, 0x67, 0x2e, 0x72, 0x65, 0x6a, 0x65,
+ 0x63, 0x74, 0x29, 0x3a, 0x2d, 0x2d, 0x66, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66,
+ 0x7c, 0x7c, 0x67, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, 0x69, 0x74, 0x68, 0x28,
+ 0x6b, 0x2c, 0x63, 0x29, 0x2c, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65, 0x28, 0x29,
+ 0x7d, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x49, 0x3b, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x72,
+ 0x65, 0x61, 0x64, 0x79, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x2e,
+ 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65, 0x28, 0x29, 0x2e, 0x64, 0x6f, 0x6e, 0x65, 0x28, 0x61,
+ 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64,
+ 0x28, 0x7b, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x79, 0x3a, 0x21, 0x31, 0x2c, 0x72, 0x65, 0x61,
+ 0x64, 0x79, 0x57, 0x61, 0x69, 0x74, 0x3a, 0x31, 0x2c, 0x68, 0x6f, 0x6c, 0x64, 0x52, 0x65, 0x61,
+ 0x64, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x61,
+ 0x3f, 0x6e, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x57, 0x61, 0x69, 0x74, 0x2b, 0x2b, 0x3a, 0x6e,
+ 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x28, 0x21, 0x30, 0x29, 0x7d, 0x2c, 0x72, 0x65, 0x61, 0x64,
+ 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x28, 0x61,
+ 0x3d, 0x3d, 0x3d, 0x21, 0x30, 0x3f, 0x2d, 0x2d, 0x6e, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x57,
+ 0x61, 0x69, 0x74, 0x3a, 0x6e, 0x2e, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x79, 0x29, 0x7c, 0x7c,
+ 0x28, 0x6e, 0x2e, 0x69, 0x73, 0x52, 0x65, 0x61, 0x64, 0x79, 0x3d, 0x21, 0x30, 0x2c, 0x61, 0x21,
+ 0x3d, 0x3d, 0x21, 0x30, 0x26, 0x26, 0x2d, 0x2d, 0x6e, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x57,
+ 0x61, 0x69, 0x74, 0x3e, 0x30, 0x7c, 0x7c, 0x28, 0x49, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76,
+ 0x65, 0x57, 0x69, 0x74, 0x68, 0x28, 0x64, 0x2c, 0x5b, 0x6e, 0x5d, 0x29, 0x2c, 0x6e, 0x2e, 0x66,
+ 0x6e, 0x2e, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72,
+ 0x26, 0x26, 0x28, 0x6e, 0x28, 0x64, 0x29, 0x2e, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x48,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x28, 0x22, 0x72, 0x65, 0x61, 0x64, 0x79, 0x22, 0x29, 0x2c,
+ 0x6e, 0x28, 0x64, 0x29, 0x2e, 0x6f, 0x66, 0x66, 0x28, 0x22, 0x72, 0x65, 0x61, 0x64, 0x79, 0x22,
+ 0x29, 0x29, 0x29, 0x29, 0x7d, 0x7d, 0x29, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x4a, 0x28, 0x29, 0x7b, 0x64, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c,
+ 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x3f, 0x28, 0x64, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x22,
+ 0x44, 0x4f, 0x4d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64,
+ 0x22, 0x2c, 0x4b, 0x29, 0x2c, 0x61, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45, 0x76, 0x65,
+ 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x22, 0x6c, 0x6f, 0x61, 0x64,
+ 0x22, 0x2c, 0x4b, 0x29, 0x29, 0x3a, 0x28, 0x64, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x45,
+ 0x76, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x6f, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x73, 0x74, 0x61,
+ 0x74, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x2c, 0x4b, 0x29, 0x2c, 0x61, 0x2e, 0x64,
+ 0x65, 0x74, 0x61, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x6f, 0x6e, 0x6c, 0x6f,
+ 0x61, 0x64, 0x22, 0x2c, 0x4b, 0x29, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x4b, 0x28, 0x29, 0x7b, 0x28, 0x64, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74,
+ 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x7c, 0x7c, 0x22, 0x6c, 0x6f, 0x61, 0x64, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x7c,
+ 0x7c, 0x22, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22, 0x3d, 0x3d, 0x3d, 0x64, 0x2e,
+ 0x72, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x29, 0x26, 0x26, 0x28, 0x4a, 0x28,
+ 0x29, 0x2c, 0x6e, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x28, 0x29, 0x29, 0x7d, 0x6e, 0x2e, 0x72,
+ 0x65, 0x61, 0x64, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x49, 0x29, 0x69,
+ 0x66, 0x28, 0x49, 0x3d, 0x6e, 0x2e, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x28, 0x29,
+ 0x2c, 0x22, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22, 0x3d, 0x3d, 0x3d, 0x64, 0x2e,
+ 0x72, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x29, 0x61, 0x2e, 0x73, 0x65, 0x74,
+ 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x6e, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x29,
+ 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x64, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76,
+ 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x29, 0x64, 0x2e, 0x61, 0x64,
+ 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x22,
+ 0x44, 0x4f, 0x4d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x61, 0x64, 0x65, 0x64,
+ 0x22, 0x2c, 0x4b, 0x29, 0x2c, 0x61, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c,
+ 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x22, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x2c, 0x4b,
+ 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x64, 0x2e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x45,
+ 0x76, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x6f, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x73, 0x74, 0x61,
+ 0x74, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x2c, 0x4b, 0x29, 0x2c, 0x61, 0x2e, 0x61,
+ 0x74, 0x74, 0x61, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x6f, 0x6e, 0x6c, 0x6f,
+ 0x61, 0x64, 0x22, 0x2c, 0x4b, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x21, 0x31, 0x3b,
+ 0x74, 0x72, 0x79, 0x7b, 0x63, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x2e, 0x66, 0x72,
+ 0x61, 0x6d, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x26, 0x26, 0x64, 0x2e, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x7d, 0x63, 0x61,
+ 0x74, 0x63, 0x68, 0x28, 0x65, 0x29, 0x7b, 0x7d, 0x63, 0x26, 0x26, 0x63, 0x2e, 0x64, 0x6f, 0x53,
+ 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x26, 0x26, 0x21, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x66, 0x28, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x6e, 0x2e, 0x69, 0x73, 0x52, 0x65, 0x61,
+ 0x64, 0x79, 0x29, 0x7b, 0x74, 0x72, 0x79, 0x7b, 0x63, 0x2e, 0x64, 0x6f, 0x53, 0x63, 0x72, 0x6f,
+ 0x6c, 0x6c, 0x28, 0x22, 0x6c, 0x65, 0x66, 0x74, 0x22, 0x29, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68,
+ 0x28, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x73, 0x65, 0x74,
+ 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x66, 0x2c, 0x35, 0x30, 0x29, 0x7d, 0x4a, 0x28,
+ 0x29, 0x2c, 0x6e, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x28, 0x29, 0x7d, 0x7d, 0x28, 0x29, 0x7d,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x49, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65,
+ 0x28, 0x62, 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x2e, 0x70, 0x72, 0x6f,
+ 0x6d, 0x69, 0x73, 0x65, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x4c, 0x3b, 0x66, 0x6f, 0x72,
+ 0x28, 0x4c, 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x28, 0x6c, 0x29, 0x29, 0x62, 0x72, 0x65, 0x61, 0x6b,
+ 0x3b, 0x6c, 0x2e, 0x6f, 0x77, 0x6e, 0x46, 0x69, 0x72, 0x73, 0x74, 0x3d, 0x22, 0x30, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x4c, 0x2c, 0x6c, 0x2e, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63,
+ 0x6b, 0x4e, 0x65, 0x65, 0x64, 0x73, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x3d, 0x21, 0x31, 0x2c,
+ 0x6e, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x65, 0x3b, 0x63, 0x3d, 0x64, 0x2e, 0x67, 0x65, 0x74,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d,
+ 0x65, 0x28, 0x22, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x29, 0x5b, 0x30, 0x5d, 0x2c, 0x63, 0x26, 0x26,
+ 0x63, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x64, 0x2e, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76,
+ 0x22, 0x29, 0x2c, 0x65, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x2c, 0x65, 0x2e, 0x73, 0x74,
+ 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x54, 0x65, 0x78, 0x74, 0x3d, 0x22, 0x70, 0x6f, 0x73,
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x62,
+ 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x30, 0x3b, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x30, 0x3b,
+ 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x30, 0x3b, 0x74, 0x6f, 0x70, 0x3a, 0x30, 0x3b, 0x6c,
+ 0x65, 0x66, 0x74, 0x3a, 0x2d, 0x39, 0x39, 0x39, 0x39, 0x70, 0x78, 0x22, 0x2c, 0x63, 0x2e, 0x61,
+ 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x65, 0x29, 0x2e, 0x61, 0x70,
+ 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x62, 0x29, 0x2c, 0x22, 0x75, 0x6e,
+ 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x62, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x7a, 0x6f, 0x6f, 0x6d, 0x26, 0x26, 0x28,
+ 0x62, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x54, 0x65, 0x78, 0x74, 0x3d,
+ 0x22, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x3b,
+ 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x30, 0x3b, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a,
+ 0x30, 0x3b, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x31, 0x70, 0x78, 0x3b, 0x77, 0x69,
+ 0x64, 0x74, 0x68, 0x3a, 0x31, 0x70, 0x78, 0x3b, 0x7a, 0x6f, 0x6f, 0x6d, 0x3a, 0x31, 0x22, 0x2c,
+ 0x6c, 0x2e, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x65, 0x65,
+ 0x64, 0x73, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x3d, 0x61, 0x3d, 0x33, 0x3d, 0x3d, 0x3d, 0x62,
+ 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x61, 0x26, 0x26,
+ 0x28, 0x63, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x7a, 0x6f, 0x6f, 0x6d, 0x3d, 0x31, 0x29,
+ 0x29, 0x2c, 0x63, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28,
+ 0x65, 0x29, 0x29, 0x7d, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x3b, 0x6c, 0x2e,
+ 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f, 0x3d, 0x21, 0x30,
+ 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x62, 0x29, 0x7b, 0x6c, 0x2e, 0x64, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0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, 0x5b, 0x5b, 0x5c, 0x77, 0x5c, 0x57, 0x5d, 0x2a, 0x5c, 0x5d, 0x29, 0x24, 0x2f, 0x2c, 0x4f,
+ 0x3d, 0x2f, 0x28, 0x5b, 0x41, 0x2d, 0x5a, 0x5d, 0x29, 0x2f, 0x67, 0x3b, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x50, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x63, 0x26, 0x26, 0x31, 0x3d, 0x3d,
+ 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x3d, 0x22, 0x64, 0x61, 0x74, 0x61, 0x2d, 0x22, 0x2b, 0x62, 0x2e, 0x72, 0x65, 0x70,
+ 0x6c, 0x61, 0x63, 0x65, 0x28, 0x4f, 0x2c, 0x22, 0x2d, 0x24, 0x31, 0x22, 0x29, 0x2e, 0x74, 0x6f,
+ 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x63,
+ 0x3d, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28,
+ 0x64, 0x29, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70,
+ 0x65, 0x6f, 0x66, 0x20, 0x63, 0x29, 0x7b, 0x74, 0x72, 0x79, 0x7b, 0x63, 0x3d, 0x22, 0x74, 0x72,
+ 0x75, 0x65, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x3f, 0x21, 0x30, 0x3a, 0x22, 0x66, 0x61, 0x6c, 0x73,
+ 0x65, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x3f, 0x21, 0x31, 0x3a, 0x22, 0x6e, 0x75, 0x6c, 0x6c, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x63, 0x3f, 0x6e, 0x75, 0x6c, 0x6c, 0x3a, 0x2b, 0x63, 0x2b, 0x22, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x63, 0x3f, 0x2b, 0x63, 0x3a, 0x4e, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x63, 0x29,
+ 0x3f, 0x6e, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x28, 0x63, 0x29, 0x3a,
+ 0x63, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x65, 0x29, 0x7b, 0x7d, 0x6e, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x63,
+ 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x51, 0x28, 0x61, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x62, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x62, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29,
+ 0x69, 0x66, 0x28, 0x28, 0x22, 0x64, 0x61, 0x74, 0x61, 0x22, 0x21, 0x3d, 0x3d, 0x62, 0x7c, 0x7c,
+ 0x21, 0x6e, 0x2e, 0x69, 0x73, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x28, 0x61, 0x5b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62, 0x29,
+ 0x29, 0x2c, 0x67, 0x3d, 0x6a, 0x5b, 0x6b, 0x5d, 0x2c, 0x65, 0x7c, 0x7c, 0x28, 0x67, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x7c, 0x7c, 0x28, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x7b, 0x7d, 0x29,
+ 0x2c, 0x67, 0x3d, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x20,
+ 0x30, 0x21, 0x3d, 0x3d, 0x64, 0x26, 0x26, 0x28, 0x67, 0x5b, 0x6e, 0x2e, 0x63, 0x61, 0x6d, 0x65,
+ 0x6c, 0x43, 0x61, 0x73, 0x65, 0x28, 0x62, 0x29, 0x5d, 0x3d, 0x64, 0x29, 0x2c, 0x22, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x3f,
+ 0x28, 0x66, 0x3d, 0x67, 0x5b, 0x62, 0x5d, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x66, 0x26,
+ 0x26, 0x28, 0x66, 0x3d, 0x67, 0x5b, 0x6e, 0x2e, 0x63, 0x61, 0x6d, 0x65, 0x6c, 0x43, 0x61, 0x73,
+ 0x65, 0x28, 0x62, 0x29, 0x5d, 0x29, 0x29, 0x3a, 0x66, 0x3d, 0x67, 0x2c, 0x66, 0x7d, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x4d, 0x28, 0x61, 0x29, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c,
+ 0x65, 0x2c, 0x66, 0x3d, 0x61, 0x2e, 0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x28, 0x22,
+ 0x20, 0x22, 0x29, 0x29, 0x2c, 0x65, 0x3d, 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b,
+ 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x65, 0x2d, 0x2d, 0x29, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x20, 0x64, 0x5b, 0x62, 0x5b, 0x65, 0x5d, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x63, 0x3f, 0x21, 0x51,
+ 0x28, 0x64, 0x29, 0x3a, 0x21, 0x6e, 0x2e, 0x69, 0x73, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4f, 0x62,
+ 0x6a, 0x65, 0x63, 0x74, 0x28, 0x64, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7d, 0x28,
+ 0x63, 0x7c, 0x7c, 0x28, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x67, 0x5b, 0x68, 0x5d, 0x2e,
+ 0x64, 0x61, 0x74, 0x61, 0x2c, 0x51, 0x28, 0x67, 0x5b, 0x68, 0x5d, 0x29, 0x29, 0x29, 0x26, 0x26,
+ 0x28, 0x66, 0x3f, 0x6e, 0x2e, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x5b,
+ 0x61, 0x5d, 0x2c, 0x21, 0x30, 0x29, 0x3a, 0x6c, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45,
+ 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f, 0x7c, 0x7c, 0x67, 0x21, 0x3d, 0x67, 0x2e, 0x77, 0x69, 0x6e,
+ 0x64, 0x6f, 0x77, 0x3f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x67, 0x5b, 0x68, 0x5d, 0x3a,
+ 0x67, 0x5b, 0x68, 0x5d, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x29, 0x7d, 0x7d, 0x7d, 0x6e,
+ 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x63, 0x61, 0x63, 0x68, 0x65, 0x3a, 0x7b,
+ 0x7d, 0x2c, 0x6e, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x7b, 0x22, 0x61, 0x70, 0x70, 0x6c, 0x65,
+ 0x74, 0x20, 0x22, 0x3a, 0x21, 0x30, 0x2c, 0x22, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x20, 0x22, 0x3a,
+ 0x21, 0x30, 0x2c, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x22, 0x3a, 0x22, 0x63, 0x6c,
+ 0x73, 0x69, 0x64, 0x3a, 0x44, 0x32, 0x37, 0x43, 0x44, 0x42, 0x36, 0x45, 0x2d, 0x41, 0x45, 0x36,
+ 0x44, 0x2d, 0x31, 0x31, 0x63, 0x66, 0x2d, 0x39, 0x36, 0x42, 0x38, 0x2d, 0x34, 0x34, 0x34, 0x35,
+ 0x35, 0x33, 0x35, 0x34, 0x30, 0x30, 0x30, 0x30, 0x22, 0x7d, 0x2c, 0x68, 0x61, 0x73, 0x44, 0x61,
+ 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79,
+ 0x70, 0x65, 0x3f, 0x6e, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5b, 0x61, 0x5b, 0x6e, 0x2e, 0x65,
+ 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f, 0x5d, 0x5d, 0x3a, 0x61, 0x5b, 0x6e, 0x2e, 0x65, 0x78, 0x70,
+ 0x61, 0x6e, 0x64, 0x6f, 0x5d, 0x2c, 0x21, 0x21, 0x61, 0x26, 0x26, 0x21, 0x51, 0x28, 0x61, 0x29,
+ 0x7d, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x52, 0x28,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7d, 0x2c, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x61,
+ 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x53, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7d, 0x2c,
+ 0x5f, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x52, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x21, 0x30, 0x29, 0x7d, 0x2c, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x53, 0x28, 0x61, 0x2c, 0x62,
+ 0x2c, 0x21, 0x30, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74,
+ 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c,
+ 0x65, 0x2c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2c, 0x67, 0x3d, 0x66, 0x26,
+ 0x26, 0x66, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x3b, 0x69, 0x66,
+ 0x28, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x28, 0x65, 0x3d,
+ 0x6e, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x66, 0x29, 0x2c, 0x31, 0x3d, 0x3d, 0x3d, 0x66, 0x2e,
+ 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x21, 0x6e, 0x2e, 0x5f, 0x64, 0x61,
+ 0x74, 0x61, 0x28, 0x66, 0x2c, 0x22, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64, 0x41, 0x74, 0x74, 0x72,
+ 0x73, 0x22, 0x29, 0x29, 0x29, 0x7b, 0x63, 0x3d, 0x67, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x63, 0x2d, 0x2d, 0x29, 0x67, 0x5b, 0x63, 0x5d, 0x26,
+ 0x26, 0x28, 0x64, 0x3d, 0x67, 0x5b, 0x63, 0x5d, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x30, 0x3d,
+ 0x3d, 0x3d, 0x64, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28, 0x22, 0x64, 0x61, 0x74,
+ 0x61, 0x2d, 0x22, 0x29, 0x26, 0x26, 0x28, 0x64, 0x3d, 0x6e, 0x2e, 0x63, 0x61, 0x6d, 0x65, 0x6c,
+ 0x43, 0x61, 0x73, 0x65, 0x28, 0x64, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x35, 0x29, 0x29,
+ 0x2c, 0x50, 0x28, 0x66, 0x2c, 0x64, 0x2c, 0x65, 0x5b, 0x64, 0x5d, 0x29, 0x29, 0x29, 0x3b, 0x6e,
+ 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x66, 0x2c, 0x22, 0x70, 0x61, 0x72, 0x73, 0x65, 0x64,
+ 0x41, 0x74, 0x74, 0x72, 0x73, 0x22, 0x2c, 0x21, 0x30, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x65, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63,
+ 0x74, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x3f, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x6e, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29,
+ 0x7d, 0x29, 0x3a, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3e, 0x31, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6e, 0x2e, 0x64, 0x61, 0x74,
+ 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x2c, 0x62, 0x29, 0x7d, 0x29, 0x3a, 0x66, 0x3f,
+ 0x50, 0x28, 0x66, 0x2c, 0x61, 0x2c, 0x6e, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x66, 0x2c, 0x61,
+ 0x29, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x2c, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61,
+ 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6e, 0x2e,
+ 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x61, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64,
+ 0x28, 0x7b, 0x71, 0x75, 0x65, 0x75, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3f, 0x28, 0x62, 0x3d, 0x28, 0x62, 0x7c, 0x7c, 0x22, 0x66,
+ 0x78, 0x22, 0x29, 0x2b, 0x22, 0x71, 0x75, 0x65, 0x75, 0x65, 0x22, 0x2c, 0x64, 0x3d, 0x6e, 0x2e,
+ 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x2c, 0x63, 0x26, 0x26, 0x28, 0x21,
+ 0x64, 0x7c, 0x7c, 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x63, 0x29, 0x3f,
+ 0x64, 0x3d, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x6e, 0x2e,
+ 0x6d, 0x61, 0x6b, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x63, 0x29, 0x29, 0x3a, 0x64, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x63, 0x29, 0x29, 0x2c, 0x64, 0x7c, 0x7c, 0x5b, 0x5d, 0x29, 0x3a,
+ 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x2c, 0x64, 0x65, 0x71, 0x75, 0x65, 0x75, 0x65, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x62, 0x3d,
+ 0x62, 0x7c, 0x7c, 0x22, 0x66, 0x78, 0x22, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x6e, 0x2e,
+ 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x2c, 0x64, 0x3d, 0x63, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x65, 0x3d, 0x63, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28,
+ 0x29, 0x2c, 0x66, 0x3d, 0x6e, 0x2e, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x48, 0x6f, 0x6f, 0x6b,
+ 0x73, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x2c, 0x67, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x6e, 0x2e, 0x64, 0x65, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7d, 0x3b, 0x22, 0x69, 0x6e, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x65, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x63, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74,
+ 0x28, 0x29, 0x2c, 0x64, 0x2d, 0x2d, 0x29, 0x2c, 0x65, 0x26, 0x26, 0x28, 0x22, 0x66, 0x78, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x63, 0x2e, 0x75, 0x6e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28,
+ 0x22, 0x69, 0x6e, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x29, 0x2c, 0x64, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 0x20, 0x66, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x2c, 0x65, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x61, 0x2c, 0x67, 0x2c, 0x66, 0x29, 0x29, 0x2c, 0x21, 0x64, 0x26, 0x26, 0x66,
+ 0x26, 0x26, 0x66, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x66, 0x69, 0x72, 0x65, 0x28, 0x29,
+ 0x7d, 0x2c, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x63, 0x3d, 0x62, 0x2b, 0x22, 0x71, 0x75, 0x65, 0x75, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x22,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28,
+ 0x61, 0x2c, 0x63, 0x29, 0x7c, 0x7c, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x61, 0x2c,
+ 0x63, 0x2c, 0x7b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x3a, 0x6e, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x62,
+ 0x61, 0x63, 0x6b, 0x73, 0x28, 0x22, 0x6f, 0x6e, 0x63, 0x65, 0x20, 0x6d, 0x65, 0x6d, 0x6f, 0x72,
+ 0x79, 0x22, 0x29, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x6e, 0x2e, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x61,
+ 0x28, 0x61, 0x2c, 0x62, 0x2b, 0x22, 0x71, 0x75, 0x65, 0x75, 0x65, 0x22, 0x29, 0x2c, 0x6e, 0x2e,
+ 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x61, 0x2c, 0x63, 0x29,
+ 0x7d, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74,
+ 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x71, 0x75, 0x65, 0x75, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x32,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x21,
+ 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x61, 0x2c,
+ 0x61, 0x3d, 0x22, 0x66, 0x78, 0x22, 0x2c, 0x63, 0x2d, 0x2d, 0x29, 0x2c, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x63, 0x3f, 0x6e,
+ 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2c, 0x61,
+ 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x74, 0x68, 0x69,
+ 0x73, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x6e, 0x2e, 0x71,
+ 0x75, 0x65, 0x75, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x2c, 0x62, 0x29, 0x3b, 0x6e,
+ 0x2e, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x61, 0x29, 0x2c, 0x22, 0x66, 0x78, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x26, 0x26, 0x22,
+ 0x69, 0x6e, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x22, 0x21, 0x3d, 0x3d, 0x63, 0x5b,
+ 0x30, 0x5d, 0x26, 0x26, 0x6e, 0x2e, 0x64, 0x65, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2c, 0x61, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x64, 0x65, 0x71, 0x75, 0x65, 0x75, 0x65,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6e, 0x2e, 0x64, 0x65, 0x71, 0x75, 0x65,
+ 0x75, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x63, 0x6c,
+ 0x65, 0x61, 0x72, 0x51, 0x75, 0x65, 0x75, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x61, 0x7c, 0x7c, 0x22, 0x66, 0x78, 0x22, 0x2c, 0x5b,
+ 0x5d, 0x29, 0x7d, 0x2c, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c,
+ 0x64, 0x3d, 0x31, 0x2c, 0x65, 0x3d, 0x6e, 0x2e, 0x44, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64,
+ 0x28, 0x29, 0x2c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x67, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x68, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x2d, 0x2d, 0x64, 0x7c, 0x7c, 0x65, 0x2e, 0x72, 0x65, 0x73, 0x6f,
+ 0x6c, 0x76, 0x65, 0x57, 0x69, 0x74, 0x68, 0x28, 0x66, 0x2c, 0x5b, 0x66, 0x5d, 0x29, 0x7d, 0x3b,
+ 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x61, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x61, 0x2c, 0x61, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20,
+ 0x30, 0x29, 0x2c, 0x61, 0x3d, 0x61, 0x7c, 0x7c, 0x22, 0x66, 0x78, 0x22, 0x3b, 0x77, 0x68, 0x69,
+ 0x6c, 0x65, 0x28, 0x67, 0x2d, 0x2d, 0x29, 0x63, 0x3d, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61,
+ 0x28, 0x66, 0x5b, 0x67, 0x5d, 0x2c, 0x61, 0x2b, 0x22, 0x71, 0x75, 0x65, 0x75, 0x65, 0x48, 0x6f,
+ 0x6f, 0x6b, 0x73, 0x22, 0x29, 0x2c, 0x63, 0x26, 0x26, 0x63, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79,
+ 0x26, 0x26, 0x28, 0x64, 0x2b, 0x2b, 0x2c, 0x63, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x61,
+ 0x64, 0x64, 0x28, 0x68, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x68, 0x28,
+ 0x29, 0x2c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65, 0x28, 0x62, 0x29, 0x7d, 0x7d,
+ 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x61, 0x3b, 0x6c, 0x2e, 0x73, 0x68, 0x72, 0x69, 0x6e, 0x6b, 0x57, 0x72, 0x61, 0x70, 0x42,
+ 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x29, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x3b, 0x61, 0x3d, 0x21, 0x31, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c,
+ 0x63, 0x2c, 0x65, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3d, 0x64, 0x2e, 0x67,
+ 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e,
+ 0x61, 0x6d, 0x65, 0x28, 0x22, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x29, 0x5b, 0x30, 0x5d, 0x2c, 0x63,
+ 0x26, 0x26, 0x63, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3f, 0x28, 0x62, 0x3d, 0x64, 0x2e, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69,
+ 0x76, 0x22, 0x29, 0x2c, 0x65, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x2c, 0x65, 0x2e, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73, 0x54, 0x65, 0x78, 0x74, 0x3d, 0x22, 0x70, 0x6f,
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b,
+ 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x30, 0x3b, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x30,
+ 0x3b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x30, 0x3b, 0x74, 0x6f, 0x70, 0x3a, 0x30, 0x3b,
+ 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x2d, 0x39, 0x39, 0x39, 0x39, 0x70, 0x78, 0x22, 0x2c, 0x63, 0x2e,
+ 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x65, 0x29, 0x2e, 0x61,
+ 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x62, 0x29, 0x2c, 0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3a, 0x31, 0x70, 0x78, 0x3b, 0x7a, 0x6f, 0x6f, 0x6d, 0x3a, 0x31,
+ 0x22, 0x2c, 0x62, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28,
+ 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28,
+ 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x77, 0x69,
+ 0x64, 0x74, 0x68, 0x3d, 0x22, 0x35, 0x70, 0x78, 0x22, 0x2c, 0x61, 0x3d, 0x33, 0x21, 0x3d, 0x3d,
+ 0x62, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x29, 0x2c, 0x63,
+ 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x65, 0x29, 0x2c,
+ 0x61, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x7d, 0x28, 0x29, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x54, 0x3d, 0x2f, 0x5b, 0x2b, 0x2d, 0x5d, 0x3f, 0x28, 0x3f, 0x3a, 0x5c, 0x64, 0x2a,
+ 0x5c, 0x2e, 0x7c, 0x29, 0x5c, 0x64, 0x2b, 0x28, 0x3f, 0x3a, 0x5b, 0x65, 0x45, 0x5d, 0x5b, 0x2b,
+ 0x2d, 0x5d, 0x3f, 0x5c, 0x64, 0x2b, 0x7c, 0x29, 0x2f, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x2c, 0x55, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28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b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x2c, 0x66, 0x3d, 0x31, 0x2c, 0x67,
+ 0x3d, 0x32, 0x30, 0x2c, 0x68, 0x3d, 0x64, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x63, 0x75, 0x72, 0x28,
+ 0x29, 0x7d, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x22,
+ 0x22, 0x29, 0x7d, 0x2c, 0x69, 0x3d, 0x68, 0x28, 0x29, 0x2c, 0x6a, 0x3d, 0x63, 0x26, 0x26, 0x63,
+ 0x5b, 0x33, 0x5d, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65,
+ 0x72, 0x5b, 0x62, 0x5d, 0x3f, 0x22, 0x22, 0x3a, 0x22, 0x70, 0x78, 0x22, 0x29, 0x2c, 0x6b, 0x3d,
+ 0x28, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5b, 0x62, 0x5d, 0x7c,
+ 0x7c, 0x22, 0x70, 0x78, 0x22, 0x21, 0x3d, 0x3d, 0x6a, 0x26, 0x26, 0x2b, 0x69, 0x29, 0x26, 0x26,
+ 0x55, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x6b, 0x26, 0x26, 0x6b, 0x5b, 0x33, 0x5d, 0x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64, 0x3d, 0x65, 0x29, 0x29, 0x2c, 0x65, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x59, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65,
+ 0x2c, 0x66, 0x2c, 0x67, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x68, 0x3d, 0x30, 0x2c, 0x69, 0x3d,
+ 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x6a, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d,
+ 0x3d, 0x63, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d,
+ 0x3d, 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x28, 0x63, 0x29, 0x29, 0x7b, 0x65, 0x3d, 0x21, 0x30,
+ 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x68, 0x20, 0x69, 0x6e, 0x20, 0x63, 0x29, 0x59, 0x28, 0x61, 0x2c,
+ 0x62, 0x2c, 0x68, 0x2c, 0x63, 0x5b, 0x68, 0x5d, 0x2c, 0x21, 0x30, 0x2c, 0x66, 0x2c, 0x67, 0x29,
+ 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21,
+ 0x3d, 0x3d, 0x64, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x21, 0x30, 0x2c, 0x6e, 0x2e, 0x69, 0x73, 0x46,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7c, 0x7c, 0x28, 0x67, 0x3d, 0x21,
+ 0x30, 0x29, 0x2c, 0x6a, 0x26, 0x26, 0x28, 0x67, 0x3f, 0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c, 0x6e, 0x61, 0x76, 0x7c, 0x6f, 0x75, 0x74, 0x70,
+ 0x75, 0x74, 0x7c, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x7c, 0x70, 0x72, 0x6f, 0x67, 0x72,
+ 0x65, 0x73, 0x73, 0x7c, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x7c, 0x73, 0x75, 0x6d, 0x6d,
+ 0x61, 0x72, 0x79, 0x7c, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x7c, 0x74, 0x69, 0x6d,
+ 0x65, 0x7c, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x22, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x63, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x62, 0x61,
+ 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x22, 0x7c, 0x22, 0x29, 0x2c, 0x63, 0x3d, 0x61, 0x2e,
+ 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x46, 0x72,
+ 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x63, 0x2e, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x77, 0x68, 0x69, 0x6c,
+ 0x65, 0x28, 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x63, 0x2e, 0x63, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x62, 0x2e, 0x70, 0x6f, 0x70,
+ 0x28, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x7d, 0x21, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x64,
+ 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22,
+ 0x64, 0x69, 0x76, 0x22, 0x29, 0x2c, 0x62, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74,
+ 0x28, 0x29, 0x2c, 0x63, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x3b, 0x61, 0x2e,
+ 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x22, 0x20, 0x20, 0x3c, 0x6c, 0x69,
+ 0x6e, 0x6b, 0x2f, 0x3e, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x3c, 0x2f, 0x74, 0x61, 0x62,
+ 0x6c, 0x65, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x27, 0x2f, 0x61, 0x27, 0x3e,
+ 0x61, 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x27, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x27, 0x2f, 0x3e, 0x22, 0x2c, 0x6c,
+ 0x2e, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x57, 0x68, 0x69, 0x74, 0x65, 0x73, 0x70, 0x61,
+ 0x63, 0x65, 0x3d, 0x33, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68,
+ 0x69, 0x6c, 0x64, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x2c, 0x6c, 0x2e, 0x74,
+ 0x62, 0x6f, 0x64, 0x79, 0x3d, 0x21, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x22, 0x74, 0x62,
+ 0x6f, 0x64, 0x79, 0x22, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x6c, 0x2e, 0x68,
+ 0x74, 0x6d, 0x6c, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3d, 0x21, 0x21, 0x61,
+ 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61,
+ 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x22, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x29, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x6c, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x35, 0x43, 0x6c, 0x6f, 0x6e,
+ 0x65, 0x3d, 0x22, 0x3c, 0x3a, 0x6e, 0x61, 0x76, 0x3e, 0x3c, 0x2f, 0x3a, 0x6e, 0x61, 0x76, 0x3e,
+ 0x22, 0x21, 0x3d, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x28, 0x22, 0x6e, 0x61, 0x76, 0x22, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65,
+ 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x21, 0x30, 0x29, 0x2e, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x48, 0x54,
+ 0x4d, 0x4c, 0x2c, 0x63, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x63, 0x68, 0x65, 0x63, 0x6b,
+ 0x62, 0x6f, 0x78, 0x22, 0x2c, 0x63, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x3d, 0x21,
+ 0x30, 0x2c, 0x62, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28,
+ 0x63, 0x29, 0x2c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b,
+ 0x65, 0x64, 0x3d, 0x63, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x2c, 0x61, 0x2e, 0x69,
+ 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x22, 0x3c, 0x74, 0x65, 0x78, 0x74, 0x61,
+ 0x72, 0x65, 0x61, 0x3e, 0x78, 0x3c, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61, 0x3e,
+ 0x22, 0x2c, 0x6c, 0x2e, 0x6e, 0x6f, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b,
+ 0x65, 0x64, 0x3d, 0x21, 0x21, 0x61, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x4e, 0x6f, 0x64, 0x65,
+ 0x28, 0x21, 0x30, 0x29, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x64,
+ 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2c, 0x62, 0x2e, 0x61, 0x70,
+ 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x61, 0x29, 0x2c, 0x63, 0x3d, 0x64,
+ 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22,
+ 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x2c, 0x63, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x22, 0x72,
+ 0x61, 0x64, 0x69, 0x6f, 0x22, 0x29, 0x2c, 0x63, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x2c,
+ 0x22, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x29, 0x2c, 0x63, 0x2e, 0x73, 0x65, 0x74,
+ 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22,
+ 0x2c, 0x22, 0x74, 0x22, 0x29, 0x2c, 0x61, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68,
+ 0x69, 0x6c, 0x64, 0x28, 0x63, 0x29, 0x2c, 0x6c, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6c,
+ 0x6f, 0x6e, 0x65, 0x3d, 0x61, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x28,
+ 0x21, 0x30, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x21, 0x30,
+ 0x29, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x63, 0x68, 0x65, 0x63,
+ 0x6b, 0x65, 0x64, 0x2c, 0x6c, 0x2e, 0x6e, 0x6f, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x45, 0x76, 0x65,
+ 0x6e, 0x74, 0x3d, 0x21, 0x21, 0x61, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c,
+ 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x2c, 0x61, 0x5b, 0x6e, 0x2e, 0x65, 0x78, 0x70, 0x61,
+ 0x6e, 0x64, 0x6f, 0x5d, 0x3d, 0x31, 0x2c, 0x6c, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+ 0x74, 0x65, 0x73, 0x3d, 0x21, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+ 0x75, 0x74, 0x65, 0x28, 0x6e, 0x2e, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f, 0x29, 0x7d, 0x28,
+ 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x3d, 0x7b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3a, 0x5b, 0x31, 0x2c, 0x22, 0x3c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x6d, 0x75, 0x6c,
+ 0x74, 0x69, 0x70, 0x6c, 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0x22,
+ 0x3c, 0x2f, 0x64, 0x69, 0x76, 0x3e, 0x22, 0x5d, 0x7d, 0x3b, 0x64, 0x61, 0x2e, 0x6f, 0x70, 0x74,
+ 0x67, 0x72, 0x6f, 0x75, 0x70, 0x3d, 0x64, 0x61, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c,
+ 0x64, 0x61, 0x2e, 0x74, 0x62, 0x6f, 0x64, 0x79, 0x3d, 0x64, 0x61, 0x2e, 0x74, 0x66, 0x6f, 0x6f,
+ 0x74, 0x3d, 0x64, 0x61, 0x2e, 0x63, 0x6f, 0x6c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x3d, 0x64, 0x61,
+ 0x2e, 0x63, 0x61, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x64, 0x61, 0x2e, 0x74, 0x68, 0x65, 0x61,
+ 0x64, 0x2c, 0x64, 0x61, 0x2e, 0x74, 0x68, 0x3d, 0x64, 0x61, 0x2e, 0x74, 0x64, 0x3b, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x3d, 0x30, 0x2c, 0x66, 0x3d, 0x22, 0x75, 0x6e,
+ 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79,
+ 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x3f, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x62,
+ 0x7c, 0x7c, 0x22, 0x2a, 0x22, 0x29, 0x3a, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x2e, 0x71, 0x75, 0x65,
+ 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c, 0x3f, 0x61, 0x2e,
+ 0x71, 0x75, 0x65, 0x72, 0x79, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x41, 0x6c, 0x6c,
+ 0x28, 0x62, 0x7c, 0x7c, 0x22, 0x2a, 0x22, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3b,
+ 0x69, 0x66, 0x28, 0x21, 0x66, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x66, 0x3d, 0x5b, 0x5d, 0x2c, 0x63,
+ 0x3d, 0x61, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x7c, 0x7c, 0x61,
+ 0x3b, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x28, 0x64, 0x3d, 0x63, 0x5b, 0x65, 0x5d, 0x29, 0x3b,
+ 0x65, 0x2b, 0x2b, 0x29, 0x21, 0x62, 0x7c, 0x7c, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61,
+ 0x6d, 0x65, 0x28, 0x64, 0x2c, 0x62, 0x29, 0x3f, 0x66, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x64,
+ 0x29, 0x3a, 0x6e, 0x2e, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x28, 0x66, 0x2c, 0x65, 0x61, 0x28, 0x64,
+ 0x2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, 0x68, 0x61, 0x3d, 0x2f, 0x3c, 0x74, 0x62, 0x6f,
+ 0x64, 0x79, 0x2f, 0x69, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x61,
+ 0x28, 0x61, 0x29, 0x7b, 0x5a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x2e, 0x74, 0x79, 0x70,
+ 0x65, 0x29, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x43, 0x68,
+ 0x65, 0x63, 0x6b, 0x65, 0x64, 0x3d, 0x61, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x28, 0x61, 0x2c, 0x62,
+ 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20,
+ 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x2c, 0x69, 0x2c, 0x6a, 0x2c, 0x6b, 0x2c, 0x6d, 0x2c, 0x6f, 0x3d,
+ 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x70, 0x3d, 0x63, 0x61, 0x28, 0x62, 0x29,
+ 0x2c, 0x71, 0x3d, 0x5b, 0x5d, 0x2c, 0x72, 0x3d, 0x30, 0x3b, 0x6f, 0x3e, 0x72, 0x3b, 0x72, 0x2b,
+ 0x2b, 0x29, 0x69, 0x66, 0x28, 0x67, 0x3d, 0x61, 0x5b, 0x72, 0x5d, 0x2c, 0x67, 0x7c, 0x7c, 0x30,
+ 0x3d, 0x3d, 0x3d, 0x67, 0x29, 0x69, 0x66, 0x28, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x28, 0x67, 0x29, 0x29, 0x6e, 0x2e, 0x6d,
+ 0x65, 0x72, 0x67, 0x65, 0x28, 0x71, 0x2c, 0x67, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70,
+ 0x65, 0x3f, 0x5b, 0x67, 0x5d, 0x3a, 0x67, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66,
+ 0x28, 0x67, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x67, 0x29, 0x29, 0x7b, 0x69, 0x3d, 0x69,
+ 0x7c, 0x7c, 0x70, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28,
+ 0x62, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28,
+ 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x29, 0x2c, 0x6a, 0x3d, 0x28, 0x24, 0x2e, 0x65, 0x78, 0x65,
+ 0x63, 0x28, 0x67, 0x29, 0x7c, 0x7c, 0x5b, 0x22, 0x22, 0x2c, 0x22, 0x22, 0x5d, 0x29, 0x5b, 0x31,
+ 0x5d, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2c,
+ 0x6d, 0x3d, 0x64, 0x61, 0x5b, 0x6a, 0x5d, 0x7c, 0x7c, 0x64, 0x61, 0x2e, 0x5f, 0x64, 0x65, 0x66,
+ 0x61, 0x75, 0x6c, 0x74, 0x2c, 0x69, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c,
+ 0x3d, 0x6d, 0x5b, 0x31, 0x5d, 0x2b, 0x6e, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x50, 0x72, 0x65, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x67, 0x29, 0x2b, 0x6d, 0x5b, 0x32, 0x5d, 0x2c, 0x66, 0x3d,
+ 0x6d, 0x5b, 0x30, 0x5d, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x2d, 0x2d, 0x29, 0x69,
+ 0x3d, 0x69, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x3b, 0x69, 0x66, 0x28,
+ 0x21, 0x6c, 0x2e, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x57, 0x68, 0x69, 0x74, 0x65, 0x73,
+ 0x70, 0x61, 0x63, 0x65, 0x26, 0x26, 0x61, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x67, 0x29,
+ 0x26, 0x26, 0x71, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x62, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x54, 0x65, 0x78, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x61, 0x61, 0x2e, 0x65, 0x78, 0x65,
+ 0x63, 0x28, 0x67, 0x29, 0x5b, 0x30, 0x5d, 0x29, 0x29, 0x2c, 0x21, 0x6c, 0x2e, 0x74, 0x62, 0x6f,
+ 0x64, 0x79, 0x29, 0x7b, 0x67, 0x3d, 0x22, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x21, 0x3d, 0x3d,
+ 0x6a, 0x7c, 0x7c, 0x68, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x67, 0x29, 0x3f, 0x22, 0x3c,
+ 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x22, 0x21, 0x3d, 0x3d, 0x6d, 0x5b, 0x31, 0x5d, 0x7c, 0x7c,
+ 0x68, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x67, 0x29, 0x3f, 0x30, 0x3a, 0x69, 0x3a, 0x69,
+ 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2c, 0x66, 0x3d, 0x67, 0x26,
+ 0x26, 0x67, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x2d, 0x2d, 0x29, 0x6e,
+ 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x6b, 0x3d, 0x67, 0x2e, 0x63, 0x68,
+ 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x5b, 0x66, 0x5d, 0x2c, 0x22, 0x74, 0x62, 0x6f,
+ 0x64, 0x79, 0x22, 0x29, 0x26, 0x26, 0x21, 0x6b, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f,
+ 0x64, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x67, 0x2e, 0x72, 0x65,
+ 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x6b, 0x29, 0x7d, 0x6e, 0x2e, 0x6d,
+ 0x65, 0x72, 0x67, 0x65, 0x28, 0x71, 0x2c, 0x69, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f,
+ 0x64, 0x65, 0x73, 0x29, 0x2c, 0x69, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65,
+ 0x6e, 0x74, 0x3d, 0x22, 0x22, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x69, 0x2e, 0x66, 0x69,
+ 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x29, 0x69, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x69, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68,
+ 0x69, 0x6c, 0x64, 0x29, 0x3b, 0x69, 0x3d, 0x70, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x43, 0x68, 0x69,
+ 0x6c, 0x64, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x71, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x62,
+ 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x78, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x28,
+ 0x67, 0x29, 0x29, 0x3b, 0x69, 0x26, 0x26, 0x70, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43,
+ 0x68, 0x69, 0x6c, 0x64, 0x28, 0x69, 0x29, 0x2c, 0x6c, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64,
+ 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x7c, 0x7c, 0x6e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x28,
+ 0x65, 0x61, 0x28, 0x71, 0x2c, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x2c, 0x69, 0x61,
+ 0x29, 0x2c, 0x72, 0x3d, 0x30, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x67, 0x3d, 0x71, 0x5b,
+ 0x72, 0x2b, 0x2b, 0x5d, 0x29, 0x69, 0x66, 0x28, 0x64, 0x26, 0x26, 0x6e, 0x2e, 0x69, 0x6e, 0x41,
+ 0x72, 0x72, 0x61, 0x79, 0x28, 0x67, 0x2c, 0x64, 0x29, 0x3e, 0x2d, 0x31, 0x29, 0x65, 0x26, 0x26,
+ 0x65, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x67, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69,
+ 0x66, 0x28, 0x68, 0x3d, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x28, 0x67,
+ 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x67,
+ 0x29, 0x2c, 0x69, 0x3d, 0x65, 0x61, 0x28, 0x70, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43,
+ 0x68, 0x69, 0x6c, 0x64, 0x28, 0x67, 0x29, 0x2c, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22,
+ 0x29, 0x2c, 0x68, 0x26, 0x26, 0x66, 0x61, 0x28, 0x69, 0x29, 0x2c, 0x63, 0x29, 0x7b, 0x66, 0x3d,
+ 0x30, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x67, 0x3d, 0x69, 0x5b, 0x66, 0x2b, 0x2b, 0x5d,
+ 0x29, 0x5f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x67, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x7c, 0x7c,
+ 0x22, 0x22, 0x29, 0x26, 0x26, 0x63, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x67, 0x29, 0x7d, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x70, 0x7d, 0x21,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62,
+ 0x2c, 0x63, 0x2c, 0x65, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28,
+ 0x62, 0x20, 0x69, 0x6e, 0x7b, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x3a, 0x21, 0x30, 0x2c, 0x63,
+ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x3a, 0x21, 0x30, 0x2c, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x69, 0x6e,
+ 0x3a, 0x21, 0x30, 0x7d, 0x29, 0x63, 0x3d, 0x22, 0x6f, 0x6e, 0x22, 0x2b, 0x62, 0x2c, 0x28, 0x6c,
+ 0x5b, 0x62, 0x5d, 0x3d, 0x63, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29, 0x7c, 0x7c, 0x28, 0x65, 0x2e,
+ 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x63, 0x2c, 0x22,
+ 0x74, 0x22, 0x29, 0x2c, 0x6c, 0x5b, 0x62, 0x5d, 0x3d, 0x65, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x65, 0x73, 0x5b, 0x63, 0x5d, 0x2e, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f,
+ 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x29, 0x3b, 0x65, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x28, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6b, 0x61, 0x3d, 0x2f, 0x5e, 0x28, 0x3f, 0x3a, 0x69, 0x6e, 0x70,
+ 0x75, 0x74, 0x7c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x7c, 0x74,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 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x61, 0x28, 0x29, 0x7b, 0x74,
+ 0x72, 0x79, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x61, 0x63, 0x74, 0x69,
+ 0x76, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28,
+ 0x61, 0x29, 0x7b, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x61,
+ 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x67, 0x2c, 0x68, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x29, 0x7b, 0x22, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x63, 0x26,
+ 0x26, 0x28, 0x64, 0x3d, 0x64, 0x7c, 0x7c, 0x63, 0x2c, 0x63, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20,
+ 0x30, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x68, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x29, 0x73, 0x61,
+ 0x28, 0x61, 0x2c, 0x68, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x62, 0x5b, 0x68, 0x5d, 0x2c, 0x66, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x3d, 0x3d, 0x64, 0x26, 0x26, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x65, 0x3f, 0x28, 0x65,
+ 0x3d, 0x63, 0x2c, 0x64, 0x3d, 0x63, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x29, 0x3a, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x65, 0x26, 0x26, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x63, 0x3f, 0x28, 0x65, 0x3d, 0x64,
+ 0x2c, 0x64, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x29, 0x3a, 0x28, 0x65, 0x3d, 0x64, 0x2c,
+ 0x64, 0x3d, 0x63, 0x2c, 0x63, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x29, 0x29, 0x2c, 0x65,
+ 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x29, 0x65, 0x3d, 0x71, 0x61, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20,
+ 0x69, 0x66, 0x28, 0x21, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x3d, 0x3d, 0x3d, 0x66, 0x26, 0x26, 0x28, 0x67, 0x3d,
+ 0x65, 0x2c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x28, 0x29, 0x2e, 0x6f, 0x66, 0x66, 0x28, 0x61,
+ 0x29, 0x2c, 0x67, 0x2e, 0x61, 0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b, 0x69, 0x66, 0x28,
+ 0x72, 0x29, 0x7b, 0x63, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x26, 0x26, 0x28, 0x69,
+ 0x3d, 0x63, 0x2c, 0x63, 0x3d, 0x69, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2c, 0x65,
+ 0x3d, 0x69, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x29, 0x2c, 0x63, 0x2e, 0x67,
+ 0x75, 0x69, 0x64, 0x7c, 0x7c, 0x28, 0x63, 0x2e, 0x67, 0x75, 0x69, 0x64, 0x3d, 0x6e, 0x2e, 0x67,
+ 0x75, 0x69, 0x64, 0x2b, 0x2b, 0x29, 0x2c, 0x28, 0x67, 0x3d, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x7c, 0x7c, 0x28, 0x67, 0x3d, 0x72, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
+ 0x3d, 0x7b, 0x7d, 0x29, 0x2c, 0x28, 0x6b, 0x3d, 0x72, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65,
+ 0x29, 0x7c, 0x7c, 0x28, 0x6b, 0x3d, 0x72, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x3d, 0x3d, 0x74, 0x79,
+ 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6e, 0x7c, 0x7c, 0x61, 0x26, 0x26, 0x6e, 0x2e, 0x65, 0x76, 0x65,
+ 0x6e, 0x74, 0x2e, 0x74, 0x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0x61, 0x74, 0x63, 0x68, 0x2e, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x78, 0x74, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x65, 0x29, 0x2c, 0x6e, 0x61, 0x6d, 0x65,
+ 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x70, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2e, 0x22,
+ 0x29, 0x7d, 0x2c, 0x69, 0x29, 0x2c, 0x28, 0x6d, 0x3d, 0x67, 0x5b, 0x6f, 0x5d, 0x29, 0x7c, 0x7c,
+ 0x28, 0x6d, 0x3d, 0x67, 0x5b, 0x6f, 0x5d, 0x3d, 0x5b, 0x5d, 0x2c, 0x6d, 0x2e, 0x64, 0x65, 0x6c,
+ 0x65, 0x67, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x3d, 0x30, 0x2c, 0x6a, 0x2e, 0x73,
+ 0x65, 0x74, 0x75, 0x70, 0x26, 0x26, 0x6a, 0x2e, 0x73, 0x65, 0x74, 0x75, 0x70, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x61, 0x2c, 0x64, 0x2c, 0x70, 0x2c, 0x6b, 0x29, 0x21, 0x3d, 0x3d, 0x21, 0x31,
+ 0x7c, 0x7c, 0x28, 0x61, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73,
+ 0x74, 0x65, 0x6e, 0x65, 0x72, 0x3f, 0x61, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74,
+ 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x6f, 0x2c, 0x6b, 0x2c, 0x21, 0x31, 0x29,
+ 0x3a, 0x61, 0x2e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x45, 0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x5b, 0x66, 0x5d, 0x2c, 0x21,
+ 0x65, 0x26, 0x26, 0x71, 0x21, 0x3d, 0x3d, 0x67, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x54, 0x79, 0x70,
+ 0x65, 0x7c, 0x7c, 0x63, 0x26, 0x26, 0x63, 0x2e, 0x67, 0x75, 0x69, 0x64, 0x21, 0x3d, 0x3d, 0x67,
+ 0x2e, 0x67, 0x75, 0x69, 0x64, 0x7c, 0x7c, 0x68, 0x26, 0x26, 0x21, 0x68, 0x2e, 0x74, 0x65, 0x73,
+ 0x74, 0x28, 0x67, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x29, 0x7c, 0x7c,
+ 0x64, 0x26, 0x26, 0x64, 0x21, 0x3d, 0x3d, 0x67, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f,
+ 0x72, 0x26, 0x26, 0x28, 0x22, 0x2a, 0x2a, 0x22, 0x21, 0x3d, 0x3d, 0x64, 0x7c, 0x7c, 0x21, 0x67,
+ 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x29, 0x7c, 0x7c, 0x28, 0x6d, 0x2e, 0x73,
+ 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x66, 0x2c, 0x31, 0x29, 0x2c, 0x67, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x6f, 0x72, 0x26, 0x26, 0x6d, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74,
+ 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2d, 0x2d, 0x2c, 0x6c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x26, 0x26, 0x6c, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c,
+ 0x28, 0x61, 0x2c, 0x67,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33, 0x21, 0x3d, 0x3d, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65,
+ 0x26, 0x26, 0x38, 0x21, 0x3d, 0x3d, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65,
+ 0x26, 0x26, 0x21, 0x6e, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x71, 0x2b, 0x6e, 0x2e, 0x65,
+ 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x65, 0x64, 0x29, 0x26,
+ 0x26, 0x28, 0x71, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28, 0x22, 0x2e, 0x22, 0x29,
+ 0x3e, 0x2d, 0x31, 0x26, 0x26, 0x28, 0x72, 0x3d, 0x71, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28,
+ 0x22, 0x2e, 0x22, 0x29, 0x2c, 0x71, 0x3d, 0x72, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29,
+ 0x2c, 0x72, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x28, 0x29, 0x29, 0x2c, 0x68, 0x3d, 0x71, 0x2e, 0x69,
+ 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28, 0x22, 0x3a, 0x22, 0x29, 0x3c, 0x30, 0x26, 0x26, 0x22,
+ 0x6f, 0x6e, 0x22, 0x2b, 0x71, 0x2c, 0x62, 0x3d, 0x62, 0x5b, 0x6e, 0x2e, 0x65, 0x78, 0x70, 0x61,
+ 0x6e, 0x64, 0x6f, 0x5d, 0x3f, 0x62, 0x3a, 0x6e, 0x65, 0x77, 0x20, 0x6e, 0x2e, 0x45, 0x76, 0x65,
+ 0x6e, 0x74, 0x28, 0x71, 0x2c, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22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6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x69, 0x2c, 0x22, 0x65, 0x76,
+ 0x65, 0x6e, 0x74, 0x73, 0x22, 0x29, 0x7c, 0x7c, 0x7b, 0x7d, 0x29, 0x5b, 0x62, 0x2e, 0x74, 0x79,
+ 0x70, 0x65, 0x5d, 0x26, 0x26, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x69, 0x2c, 0x22,
+ 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x29, 0x2c, 0x67, 0x26, 0x26, 0x67, 0x2e, 0x61, 0x70,
+ 0x70, 0x6c, 0x79, 0x28, 0x69, 0x2c, 0x63, 0x29, 0x2c, 0x67, 0x3d, 0x68, 0x26, 0x26, 0x69, 0x5b,
+ 0x68, 0x5d, 0x2c, 0x67, 0x26, 0x26, 0x67, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x26, 0x26, 0x4d,
+ 0x28, 0x69, 0x29, 0x26, 0x26, 0x28, 0x62, 0x2e, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x3d, 0x67,
+ 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x69, 0x2c, 0x63, 0x29, 0x2c, 0x62, 0x2e, 0x72, 0x65,
+ 0x73, 0x75, 0x6c, 0x74, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x26, 0x26, 0x62, 0x2e, 0x70, 0x72, 0x65,
+ 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x28, 0x29, 0x29, 0x3b, 0x69,
+ 0x66, 0x28, 0x62, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x71, 0x2c, 0x21, 0x66, 0x26, 0x26, 0x21,
+ 0x62, 0x2e, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x72, 0x65, 0x76, 0x65,
+ 0x6e, 0x74, 0x65, 0x64, 0x28, 0x29, 0x26, 0x26, 0x28, 0x21, 0x6c, 0x2e, 0x5f, 0x64, 0x65, 0x66,
+ 0x61, 0x75, 0x6c, 0x74, 0x7c, 0x7c, 0x6c, 0x2e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
+ 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x70, 0x2e, 0x70, 0x6f, 0x70, 0x28, 0x29, 0x2c, 0x63,
+ 0x29, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x29, 0x26, 0x26, 0x4d, 0x28, 0x65, 0x29, 0x26, 0x26, 0x68,
+ 0x26, 0x26, 0x65, 0x5b, 0x71, 0x5d, 0x26, 0x26, 0x21, 0x6e, 0x2e, 0x69, 0x73, 0x57, 0x69, 0x6e,
+ 0x64, 0x6f, 0x77, 0x28, 0x65, 0x29, 0x29, 0x7b, 0x6d, 0x3d, 0x65, 0x5b, 0x68, 0x5d, 0x2c, 0x6d,
+ 0x26, 0x26, 0x28, 0x65, 0x5b, 0x68, 0x5d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2c, 0x6e, 0x2e,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x65, 0x64, 0x3d,
+ 0x71, 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x65, 0x5b, 0x71, 0x5d, 0x28, 0x29, 0x7d, 0x63, 0x61, 0x74,
+ 0x63, 0x68, 0x28, 0x73, 0x29, 0x7b, 0x7d, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74,
+ 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x65, 0x64, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x2c,
+ 0x6d, 0x26, 0x26, 0x28, 0x65, 0x5b, 0x68, 0x5d, 0x3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
+ 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x21, 0x6b, 0x2e, 0x70, 0x72, 0x65, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74,
+ 0x63, 0x68, 0x7c, 0x7c, 0x6b, 0x2e, 0x70, 0x72, 0x65, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63,
+ 0x68, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29, 0x21, 0x3d,
+ 0x3d, 0x21, 0x31, 0x29, 0x7b, 0x68, 0x3d, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x68,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x61, 0x2c, 0x6a, 0x29, 0x2c, 0x62, 0x3d, 0x30, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65,
+ 0x28, 0x28, 0x66, 0x3d, 0x68, 0x5b, 0x62, 0x2b, 0x2b, 0x5d, 0x29, 0x26, 0x26, 0x21, 0x61, 0x2e,
+ 0x69, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f,
+ 0x70, 0x70, 0x65, 0x64, 0x28, 0x29, 0x29, 0x7b, 0x61, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
+ 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3d, 0x66, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x2c, 0x63,
+ 0x3d, 0x30, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x28, 0x67, 0x3d, 0x66, 0x2e, 0x68, 0x61,
+ 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x5b, 0x63, 0x2b, 0x2b, 0x5d, 0x29, 0x26, 0x26, 0x21, 0x61,
+ 0x2e, 0x69, 0x73, 0x49, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70,
+ 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x28, 0x29,
+ 0x29, 0x28, 0x21, 0x61, 0x2e, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x7c,
+ 0x7c, 0x61, 0x2e, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x28, 0x67, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x29, 0x29,
+ 0x26, 0x26, 0x28, 0x61, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x3d, 0x67,
+ 0x2c, 0x61, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x64,
+ 0x3d, 0x28, 0x28, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69,
+ 0x61, 0x6c, 0x5b, 0x67, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x54, 0x79, 0x70, 0x65, 0x5d, 0x7c, 0x7c,
+ 0x7b, 0x7d, 0x29, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x7c, 0x7c, 0x67, 0x2e, 0x68, 0x61,
+ 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x66, 0x2e, 0x65,
+ 0x6c, 0x65, 0x6d, 0x2c, 0x69, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d,
+ 0x64, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x3d, 0x64, 0x29, 0x3d,
+ 0x3d, 0x3d, 0x21, 0x31, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74,
+ 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x28, 0x29, 0x2c, 0x61, 0x2e, 0x73, 0x74, 0x6f, 0x70,
+ 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x29, 0x29, 0x7d,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6b, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x44, 0x69, 0x73,
+ 0x70, 0x61, 0x74, 0x63, 0x68, 0x26, 0x26, 0x6b, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x44, 0x69, 0x73,
+ 0x70, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x61, 0x29, 0x2c, 0x61, 0x2e, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x7d, 0x7d, 0x2c, 0x68, 0x61,
+ 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66,
+ 0x2c, 0x67, 0x3d, 0x5b, 0x5d, 0x2c, 0x68, 0x3d, 0x62, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61,
+ 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2c, 0x69, 0x3d, 0x61, 0x2e, 0x74, 0x61, 0x72, 0x67,
+ 0x65, 0x74, 0x3b, 0x69, 0x66, 0x28, 0x68, 0x26, 0x26, 0x69, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54,
+ 0x79, 0x70, 0x65, 0x26, 0x26, 0x28, 0x22, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x22, 0x21, 0x3d, 0x3d,
+ 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x28, 0x61, 0x2e,
+ 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x29, 0x7c, 0x7c, 0x61, 0x2e, 0x62, 0x75, 0x74, 0x74, 0x6f,
+ 0x6e, 0x3c, 0x31, 0x29, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x3b, 0x69, 0x21, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x3b, 0x69, 0x3d, 0x69, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65,
+ 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x69, 0x66, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x69, 0x2e,
+ 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x28, 0x69, 0x2e, 0x64, 0x69, 0x73,
+ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x21, 0x3d, 0x3d, 0x21, 0x30, 0x7c, 0x7c, 0x22, 0x63, 0x6c, 0x69,
+ 0x63, 0x6b, 0x22, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x74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0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x3a, 0x64, 0x7d, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x68, 0x3c, 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x67,
+ 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x65, 0x6c, 0x65, 0x6d, 0x3a, 0x74, 0x68, 0x69, 0x73,
+ 0x2c, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x73, 0x3a, 0x62, 0x2e, 0x73, 0x6c, 0x69, 0x63,
+ 0x65, 0x28, 0x68, 0x29, 0x7d, 0x29, 0x2c, 0x67, 0x7d, 0x2c, 0x66, 0x69, 0x78, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x5b, 0x6e,
+ 0x2e, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f, 0x5d, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x65, 0x2c, 0x66, 0x3d, 0x61,
+ 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x67, 0x3d, 0x61, 0x2c, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x66, 0x69, 0x78, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x5b, 0x66, 0x5d, 0x3b, 0x68, 0x7c, 0x7c,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x69, 0x78, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x5b, 0x66,
+ 0x5d, 0x3d, 0x68, 0x3d, 0x6d, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x66, 0x29, 0x3f, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x6c,
+ 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x66, 0x29, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6b,
+ 0x65, 0x79, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x7b, 0x7d, 0x29, 0x2c, 0x65, 0x3d, 0x68, 0x2e,
+ 0x70, 0x72, 0x6f, 0x70, 0x73, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x73,
+ 0x2e, 0x63, 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x29,
+ 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x2c, 0x61, 0x3d, 0x6e, 0x65,
+ 0x77, 0x20, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x28, 0x67, 0x29, 0x2c, 0x62, 0x3d, 0x65,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x62, 0x2d,
+ 0x2d, 0x29, 0x63, 0x3d, 0x65, 0x5b, 0x62, 0x5d, 0x2c, 0x61, 0x5b, 0x63, 0x5d, 0x3d, 0x67, 0x5b,
+ 0x63, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x74, 0x61, 0x72, 0x67,
+ 0x65, 0x74, 0x7c, 0x7c, 0x28, 0x61, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3d, 0x67, 0x2e,
+ 0x73, 0x72, 0x63, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x64, 0x29, 0x2c, 0x33,
+ 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x6e, 0x6f, 0x64, 0x65,
+ 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3d,
+ 0x61, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e,
+ 0x6f, 0x64, 0x65, 0x29, 0x2c, 0x61, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x3d, 0x21,
+ 0x21, 0x61, 0x2e, 0x6d, 0x65, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x2c, 0x68, 0x2e, 0x66, 0x69, 0x6c,
+ 0x74, 0x65, 0x72, 0x3f, 0x68, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x61, 0x2c, 0x67,
+ 0x29, 0x3a, 0x61, 0x7d, 0x2c, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x3a, 0x22, 0x61, 0x6c, 0x74, 0x4b,
+ 0x65, 0x79, 0x20, 0x62, 0x75, 0x62, 0x62, 0x6c, 0x65, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x63, 0x65,
+ 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x63, 0x74, 0x72, 0x6c, 0x4b, 0x65, 0x79, 0x20, 0x63, 0x75,
+ 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x20, 0x64, 0x65, 0x74, 0x61,
+ 0x69, 0x6c, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x50, 0x68, 0x61, 0x73, 0x65, 0x20, 0x6d, 0x65,
+ 0x74, 0x61, 0x4b, 0x65, 0x79, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72,
+ 0x67, 0x65, 0x74, 0x20, 0x73, 0x68, 0x69, 0x66, 0x74, 0x4b, 0x65, 0x79, 0x20, 0x74, 0x61, 0x72,
+ 0x67, 0x65, 0x74, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x20, 0x76, 0x69,
+ 0x65, 0x77, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x22, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28,
+ 0x22, 0x20, 0x22, 0x29, 0x2c, 0x66, 0x69, 0x78, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x7b, 0x7d,
+ 0x2c, 0x6b, 0x65, 0x79, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x73,
+ 0x3a, 0x22, 0x63, 0x68, 0x61, 0x72, 0x20, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x20,
+ 0x6b, 0x65, 0x79, 0x20, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x22, 0x2e, 0x73, 0x70, 0x6c,
+ 0x69, 0x74, 0x28, 0x22, 0x20, 0x22, 0x29, 0x2c, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x2e, 0x77, 0x68, 0x69, 0x63,
+ 0x68, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x77, 0x68, 0x69, 0x63, 0x68, 0x3d, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x21, 0x3d, 0x62, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x3f, 0x62, 0x2e, 0x63,
+ 0x68, 0x61, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x3a, 0x62, 0x2e, 0x6b, 0x65, 0x79, 0x43, 0x6f, 0x64,
+ 0x65, 0x29, 0x2c, 0x61, 0x7d, 0x7d, 0x2c, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x48, 0x6f, 0x6f, 0x6b,
+ 0x73, 0x3a, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x73, 0x3a, 0x22, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e,
+ 0x20, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x73, 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58,
+ 0x20, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x59, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x45, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x58, 0x20, 0x6f, 0x66, 0x66,
+ 0x73, 0x65, 0x74, 0x59, 0x20, 0x70, 0x61, 0x67, 0x65, 0x58, 0x20, 0x70, 0x61, 0x67, 0x65, 0x59,
+ 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x58, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x59,
+ 0x20, 0x74, 0x6f, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x2e, 0x73, 0x70, 0x6c, 0x69,
+ 0x74, 0x28, 0x22, 0x20, 0x22, 0x29, 0x2c, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6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63, 0x72, 0x6f, 0x6c,
+ 0x6c, 0x4c, 0x65, 0x66, 0x74, 0x7c, 0x7c, 0x30, 0x29, 0x2d, 0x28, 0x66, 0x26, 0x26, 0x66, 0x2e,
+ 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x66, 0x74, 0x7c, 0x7c, 0x63, 0x26, 0x26, 0x63,
+ 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x65, 0x66, 0x74, 0x7c, 0x7c, 0x30, 0x29, 0x2c,
+ 0x61, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x59, 0x3d, 0x62, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+ 0x59, 0x2b, 0x28, 0x66, 0x26, 0x26, 0x66, 0x2e, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x54, 0x6f,
+ 0x70, 0x7c, 0x7c, 0x63, 0x26, 0x26, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x54, 0x6f,
+ 0x70, 0x7c, 0x7c, 0x30, 0x29, 0x2d, 0x28, 0x66, 0x26, 0x26, 0x66, 0x2e, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x54, 0x6f, 0x70, 0x7c, 0x7c, 0x63, 0x26, 0x26, 0x63, 0x2e, 0x63, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x54, 0x6f, 0x70, 0x7c, 0x7c, 0x30, 0x29, 0x29, 0x2c, 0x21, 0x61, 0x2e, 0x72, 0x65,
+ 0x6c, 0x61, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x26, 0x26, 0x68, 0x26, 0x26,
+ 0x28, 0x61, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74,
+ 0x3d, 0x68, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3f, 0x62, 0x2e,
+ 0x74, 0x6f, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x68, 0x29, 0x2c, 0x61, 0x2e, 0x77,
+ 0x68, 0x69, 0x63, 0x68, 0x7c, 0x7c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x67,
+ 0x7c, 0x7c, 0x28, 0x61, 0x2e, 0x77, 0x68, 0x69, 0x63, 0x68, 0x3d, 0x31, 0x26, 0x67, 0x3f, 0x31,
+ 0x3a, 0x32, 0x26, 0x67, 0x3f, 0x33, 0x3a, 0x34, 0x26, 0x67, 0x3f, 0x32, 0x3a, 0x30, 0x29, 0x2c,
+ 0x61, 0x7d, 0x7d, 0x2c, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x3a, 0x7b, 0x6c, 0x6f, 0x61,
+ 0x64, 0x3a, 0x7b, 0x6e, 0x6f, 0x42, 0x75, 0x62, 0x62, 0x6c, 0x65, 0x3a, 0x21, 0x30, 0x7d, 0x2c,
+ 0x66, 0x6f, 0x63, 0x75, 0x73, 0x3a, 0x7b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x21, 0x3d, 0x3d, 0x72, 0x61, 0x28, 0x29, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66,
+ 0x6f, 0x63, 0x75, 0x73, 0x29, 0x74, 0x72, 0x79, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x28, 0x29, 0x2c, 0x21, 0x31, 0x7d,
+ 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x61, 0x29, 0x7b, 0x7d, 0x7d, 0x2c, 0x64, 0x65, 0x6c, 0x65,
+ 0x67, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x69,
+ 0x6e, 0x22, 0x7d, 0x2c, 0x62, 0x6c, 0x75, 0x72, 0x3a, 0x7b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65,
+ 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x3d, 0x3d, 0x3d, 0x72, 0x61, 0x28, 0x29, 0x26,
+ 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x6c, 0x75, 0x72, 0x3f, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x62, 0x6c, 0x75, 0x72, 0x28, 0x29, 0x2c, 0x21, 0x31, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x7d, 0x2c, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65,
+ 0x3a, 0x22, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x6f, 0x75, 0x74, 0x22, 0x7d, 0x2c, 0x63, 0x6c, 0x69,
+ 0x63, 0x6b, 0x3a, 0x7b, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e,
+ 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x69,
+ 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x26, 0x26, 0x22, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f,
+ 0x78, 0x22, 0x3d, 0x3d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x26, 0x26,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x3f, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x28, 0x29, 0x2c, 0x21, 0x31, 0x29, 0x3a, 0x76, 0x6f, 0x69,
+ 0x64, 0x20, 0x30, 0x7d, 0x2c, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x61, 0x2e, 0x74, 0x61,
+ 0x72, 0x67, 0x65, 0x74, 0x2c, 0x22, 0x61, 0x22, 0x29, 0x7d, 0x7d, 0x2c, 0x62, 0x65, 0x66, 0x6f,
+ 0x72, 0x65, 0x75, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x7b, 0x70, 0x6f, 0x73, 0x74, 0x44, 0x69,
+ 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x72, 0x65,
+ 0x73, 0x75, 0x6c, 0x74, 0x26, 0x26, 0x61, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c,
+ 0x45, 0x76, 0x65, 0x6e, 0x74, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e,
+ 0x61, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61,
+ 0x6c, 0x75, 0x65, 0x3d, 0x61, 0x2e, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x29, 0x7d, 0x7d, 0x7d,
+ 0x2c, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d,
+ 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x6e, 0x65, 0x77, 0x20, 0x6e, 0x2e, 0x45,
+ 0x76, 0x65, 0x6e, 0x74, 0x2c, 0x63, 0x2c, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x61, 0x2c, 0x69,
+ 0x73, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x21, 0x30, 0x7d, 0x29, 0x3b,
+ 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x28,
+ 0x64, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x62, 0x29, 0x2c, 0x64, 0x2e, 0x69, 0x73, 0x44, 0x65,
+ 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x28, 0x29,
+ 0x26, 0x26, 0x63, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75,
+ 0x6c, 0x74, 0x28, 0x29, 0x7d, 0x7d, 0x2c, 0x6e, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45,
+ 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x64, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45, 0x76, 0x65,
+ 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x61, 0x2e, 0x72, 0x65, 0x6d,
+ 0x6f, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72,
+ 0x26, 0x26, 0x61, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c,
+ 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x7d, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x64, 0x3d, 0x22, 0x6f, 0x6e, 0x22, 0x2b, 0x62, 0x3b, 0x61, 0x2e, 0x64, 0x65, 0x74,
+ 0x61, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x26, 0x26, 0x28, 0x22, 0x75, 0x6e, 0x64, 0x65,
+ 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61,
+ 0x5b, 0x64, 0x5d, 0x26, 0x26, 0x28, 0x61, 0x5b, 0x64, 0x5d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x29,
+ 0x2c, 0x61, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x28, 0x64,
+ 0x2c, 0x63, 0x29, 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
+ 0x6f, 0x66, 0x20, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3f, 0x28, 0x61, 0x26, 0x26, 0x61,
+ 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3f, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x67,
+ 0x69, 0x6e, 0x61, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x72, 0x65, 0x76, 0x65,
+ 0x6e, 0x74, 0x65, 0x64, 0x3d, 0x61, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x72,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x7c, 0x7c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d,
+ 0x3d, 0x3d, 0x61, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x72, 0x65, 0x76, 0x65,
+ 0x6e, 0x74, 0x65, 0x64, 0x26, 0x26, 0x61, 0x2e, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61,
+ 0x6c, 0x75, 0x65, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x3f, 0x70, 0x61, 0x3a, 0x71, 0x61, 0x29, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x61, 0x2c, 0x62, 0x26, 0x26, 0x6e,
+ 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x62, 0x29, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x3d, 0x61,
+ 0x26, 0x26, 0x61, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x6d, 0x70, 0x7c, 0x7c, 0x6e,
+ 0x2e, 0x6e, 0x6f, 0x77, 0x28, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x5b, 0x6e, 0x2e, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f, 0x5d, 0x3d, 0x21, 0x30, 0x29, 0x29,
+ 0x3a, 0x6e, 0x65, 0x77, 0x20, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x74, 0x79, 0x70, 0x65, 0x3d, 0x7b, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f,
+ 0x72, 0x3a, 0x6e, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2c, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61,
+ 0x75, 0x6c, 0x74, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x3a, 0x71, 0x61, 0x2c,
+ 0x69, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f,
+ 0x70, 0x70, 0x65, 0x64, 0x3a, 0x71, 0x61, 0x2c, 0x69, 0x73, 0x49, 0x6d, 0x6d, 0x65, 0x64, 0x69,
+ 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74,
+ 0x6f, 0x70, 0x70, 0x65, 0x64, 0x3a, 0x71, 0x61, 0x2c, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74,
+ 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72,
+ 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x69, 0x73, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e,
+ 0x74, 0x65, 0x64, 0x3d, 0x70, 0x61, 0x2c, 0x61, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x70, 0x72, 0x65,
+ 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3f, 0x61, 0x2e, 0x70, 0x72,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x28, 0x29, 0x3a, 0x61,
+ 0x2e, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x21, 0x31, 0x29,
+ 0x7d, 0x2c, 0x73, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c,
+ 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x50, 0x72, 0x6f,
+ 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x3d,
+ 0x70, 0x61, 0x2c, 0x61, 0x26, 0x26, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x53, 0x69,
+ 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x73, 0x74, 0x6f, 0x70,
+ 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x26, 0x26, 0x61, 0x2e, 0x73,
+ 0x74, 0x6f, 0x70, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x2c, 0x61, 0x2e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x42, 0x75, 0x62, 0x62, 0x6c, 0x65, 0x3d,
+ 0x21, 0x30, 0x29, 0x7d, 0x2c, 0x73, 0x74, 0x6f, 0x70, 0x49, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61,
+ 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x45, 0x76, 0x65, 0x6e,
+ 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x49, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61,
+ 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f,
+ 0x70, 0x70, 0x65, 0x64, 0x3d, 0x70, 0x61, 0x2c, 0x61, 0x26, 0x26, 0x61, 0x2e, 0x73, 0x74, 0x6f,
+ 0x70, 0x49, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x26, 0x26, 0x61, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x49, 0x6d, 0x6d,
+ 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x50, 0x72, 0x6f,
+ 0x70, 0x61, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7d, 0x7d, 0x2c, 0x6e, 0x2e, 0x65,
+ 0x61, 0x63, 0x68, 0x28, 0x7b, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3a,
+ 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6f, 0x76, 0x65, 0x72, 0x22, 0x2c, 0x6d, 0x6f, 0x75, 0x73,
+ 0x65, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x3a, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6f, 0x75, 0x74,
+ 0x22, 0x2c, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x3a, 0x22,
+ 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x22, 0x2c, 0x70, 0x6f, 0x69,
+ 0x6e, 0x74, 0x65, 0x72, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x3a, 0x22, 0x70, 0x6f, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x6f, 0x75, 0x74, 0x22, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70,
+ 0x65, 0x63, 0x69, 0x61, 0x6c, 0x5b, 0x61, 0x5d, 0x3d, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61,
+ 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x62, 0x2c, 0x62, 0x69, 0x6e, 0x64, 0x54, 0x79, 0x70,
+ 0x65, 0x3a, 0x62, 0x2c, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x65, 0x3d, 0x61, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x54,
+ 0x61, 0x72, 0x67, 0x65, 0x74, 0x2c, 0x66, 0x3d, 0x61, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65,
+ 0x4f, 0x62, 0x6a, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28, 0x21, 0x65, 0x7c, 0x7c, 0x65,
+ 0x21, 0x3d, 0x3d, 0x64, 0x26, 0x26, 0x21, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
+ 0x73, 0x28, 0x64, 0x2c, 0x65, 0x29, 0x29, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x66, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x54, 0x79, 0x70, 0x65, 0x2c, 0x63, 0x3d, 0x66, 0x2e,
+ 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x61, 0x2e,
+ 0x74, 0x79, 0x70, 0x65, 0x3d, 0x62, 0x29, 0x2c, 0x63, 0x7d, 0x7d, 0x7d, 0x29, 0x2c, 0x6c, 0x2e,
+ 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
+ 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x2e, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x3d,
+ 0x7b, 0x73, 0x65, 0x74, 0x75, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x29,
+ 0x3f, 0x21, 0x31, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
+ 0x2e, 0x61, 0x64, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x63, 0x6c, 0x69, 0x63, 0x6b,
+ 0x2e, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x20, 0x6b, 0x65, 0x79, 0x70, 0x72, 0x65, 0x73,
+ 0x73, 0x2e, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x61, 0x2e, 0x74,
+ 0x61, 0x72, 0x67, 0x65, 0x74, 0x2c, 0x63, 0x3d, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61,
+ 0x6d, 0x65, 0x28, 0x62, 0x2c, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x7c, 0x7c, 0x6e,
+ 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x62, 0x2c, 0x22, 0x62, 0x75, 0x74,
+ 0x74, 0x6f, 0x6e, 0x22, 0x29, 0x3f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x28, 0x62, 0x2c, 0x22,
+ 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3b, 0x63, 0x26,
+ 0x26, 0x21, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x63, 0x2c, 0x22, 0x73, 0x75, 0x62,
+ 0x6d, 0x69, 0x74, 0x22, 0x29, 0x26, 0x26, 0x28, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e,
+ 0x61, 0x64, 0x64, 0x28, 0x63, 0x2c, 0x22, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x2e, 0x5f, 0x73,
+ 0x75, 0x62, 0x6d, 0x69, 0x74, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x61, 0x2e, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x75, 0x62, 0x62,
+ 0x6c, 0x65, 0x3d, 0x21, 0x30, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28,
+ 0x63, 0x2c, 0x22, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x22, 0x2c, 0x21, 0x30, 0x29, 0x29, 0x7d,
+ 0x29, 0x7d, 0x2c, 0x70, 0x6f, 0x73, 0x74, 0x44, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x61, 0x2e, 0x5f, 0x73,
+ 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x75, 0x62, 0x62, 0x6c, 0x65, 0x26, 0x26, 0x28, 0x64, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x2e, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x42, 0x75,
+ 0x62, 0x62, 0x6c, 0x65, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x4e, 0x6f, 0x64, 0x65, 0x26, 0x26, 0x21, 0x61, 0x2e, 0x69, 0x73, 0x54, 0x72, 0x69, 0x67, 0x67,
+ 0x65, 0x72, 0x26, 0x26, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x69, 0x6d, 0x75,
+ 0x6c, 0x61, 0x74, 0x65, 0x28, 0x22, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x22, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2c, 0x61, 0x29,
+ 0x29, 0x7d, 0x2c, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f, 0x77, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e,
+ 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x66,
+ 0x6f, 0x72, 0x6d, 0x22, 0x29, 0x3f, 0x21, 0x31, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x6e, 0x2e,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x22, 0x2e, 0x5f, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x22, 0x29, 0x7d, 0x7d, 0x29,
+ 0x2c, 0x6c, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x65, 0x76,
+ 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x2e, 0x63, 0x68, 0x61, 0x6e,
+ 0x67, 0x65, 0x3d, 0x7b, 0x73, 0x65, 0x74, 0x75, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6b, 0x61, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d,
+ 0x65, 0x29, 0x3f, 0x28, 0x28, 0x22, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x22, 0x72, 0x61,
+ 0x64, 0x69, 0x6f, 0x22, 0x3d, 0x3d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65,
+ 0x29, 0x26, 0x26, 0x28, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x63, 0x68,
+ 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x22, 0x63, 0x68, 0x65, 0x63, 0x6b,
+ 0x65, 0x64, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c,
+ 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x4e, 0x61,
+ 0x6d, 0x65, 0x26, 0x26, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x43,
+ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x3d, 0x21, 0x30, 0x29, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65,
+ 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x63,
+ 0x6c, 0x69, 0x63, 0x6b, 0x2e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x6a, 0x75, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x26, 0x26, 0x21, 0x61, 0x2e,
+ 0x69, 0x73, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x26, 0x26, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x6a, 0x75, 0x73, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x3d, 0x21, 0x31,
+ 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61,
+ 0x74, 0x65, 0x28, 0x22, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2c, 0x61, 0x29, 0x7d, 0x29, 0x29, 0x2c, 0x21, 0x31, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20,
+ 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2c, 0x22, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65,
+ 0x2e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x61, 0x2e, 0x74, 0x61,
+ 0x72, 0x67, 0x65, 0x74, 0x3b, 0x6b, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x62, 0x2e, 0x6e,
+ 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x26, 0x26, 0x21, 0x6e, 0x2e, 0x5f, 0x64, 0x61,
+ 0x74, 0x61, 0x28, 0x62, 0x2c, 0x22, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x29, 0x26, 0x26,
+ 0x28, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x62, 0x2c, 0x22,
+ 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x21, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x7c, 0x7c, 0x61, 0x2e,
+ 0x69, 0x73, 0x53, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x7c, 0x7c, 0x61, 0x2e, 0x69,
+ 0x73, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x7c, 0x7c, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e,
+ 0x74, 0x2e, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x22, 0x63, 0x68, 0x61, 0x6e,
+ 0x67, 0x65, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e,
+ 0x6f, 0x64, 0x65, 0x2c, 0x61, 0x29, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61,
+ 0x28, 0x62, 0x2c, 0x22, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x22, 0x2c, 0x21, 0x30, 0x29, 0x29,
+ 0x7d, 0x29, 0x7d, 0x2c, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x61, 0x2e, 0x74,
+ 0x61, 0x72, 0x67, 0x65, 0x74, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x21, 0x3d, 0x3d, 0x62, 0x7c, 0x7c, 0x61, 0x2e, 0x69, 0x73, 0x53, 0x69, 0x6d, 0x75, 0x6c,
+ 0x61, 0x74, 0x65, 0x64, 0x7c, 0x7c, 0x61, 0x2e, 0x69, 0x73, 0x54, 0x72, 0x69, 0x67, 0x67, 0x65,
+ 0x72, 0x7c, 0x7c, 0x22, 0x72, 0x61, 0x64, 0x69, 0x6f, 0x22, 0x21, 0x3d, 0x3d, 0x62, 0x2e, 0x74,
+ 0x79, 0x70, 0x65, 0x26, 0x26, 0x22, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x22, 0x21,
+ 0x3d, 0x3d, 0x62, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3f, 0x61, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c,
+ 0x65, 0x4f, 0x62, 0x6a, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x70,
+ 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x2c, 0x74, 0x65, 0x61, 0x72, 0x64,
+ 0x6f, 0x77, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65,
+ 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x2e, 0x5f, 0x63, 0x68, 0x61,
+ 0x6e, 0x67, 0x65, 0x22, 0x29, 0x2c, 0x21, 0x6b, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x7d, 0x7d, 0x29,
+ 0x2c, 0x6c, 0x2e, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x69, 0x6e, 0x7c, 0x7c, 0x6e, 0x2e, 0x65, 0x61,
+ 0x63, 0x68, 0x28, 0x7b, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x3a, 0x22, 0x66, 0x6f, 0x63, 0x75, 0x73,
+ 0x69, 0x6e, 0x22, 0x2c, 0x62, 0x6c, 0x75, 0x72, 0x3a, 0x22, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x6f,
+ 0x75, 0x74, 0x22, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x69, 0x6d,
+ 0x75, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x62, 0x2c, 0x61, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74,
+ 0x2c, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x66, 0x69, 0x78, 0x28, 0x61, 0x29, 0x29,
+ 0x7d, 0x3b, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61,
+ 0x6c, 0x5b, 0x62, 0x5d, 0x3d, 0x7b, 0x73, 0x65, 0x74, 0x75, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c,
+ 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x65, 0x3d, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28,
+ 0x64, 0x2c, 0x62, 0x29, 0x3b, 0x65, 0x7c, 0x7c, 0x64, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65,
+ 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x61, 0x2c, 0x63, 0x2c, 0x21,
+ 0x30, 0x29, 0x2c, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x64, 0x2c, 0x62, 0x2c, 0x28,
+ 0x65, 0x7c, 0x7c, 0x30, 0x29, 0x2b, 0x31, 0x29, 0x7d, 0x2c, 0x74, 0x65, 0x61, 0x72, 0x64, 0x6f,
+ 0x77, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x64, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x65, 0x3d, 0x6e,
+ 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x64, 0x2c, 0x62, 0x29, 0x2d, 0x31, 0x3b, 0x65, 0x3f,
+ 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x64, 0x2c, 0x62, 0x2c, 0x65, 0x29, 0x3a, 0x28,
+ 0x64, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73,
+ 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x61, 0x2c, 0x63, 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x6e, 0x2e,
+ 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x64, 0x2c, 0x62, 0x29,
+ 0x29, 0x7d, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e,
+ 0x64, 0x28, 0x7b, 0x6f, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73,
+ 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7d,
+ 0x2c, 0x6f, 0x6e, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c,
+ 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x61,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x31, 0x29,
+ 0x7d, 0x2c, 0x6f, 0x66, 0x66, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x3b, 0x69, 0x66,
+ 0x28, 0x61, 0x26, 0x26, 0x61, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66,
+ 0x61, 0x75, 0x6c, 0x74, 0x26, 0x26, 0x61, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x4f, 0x62,
+ 0x6a, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3d, 0x61, 0x2e, 0x68, 0x61, 0x6e,
+ 0x64, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x2c, 0x6e, 0x28, 0x61, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x67,
+ 0x61, 0x74, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x29, 0x2e, 0x6f, 0x66, 0x66, 0x28, 0x64,
+ 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3f, 0x64, 0x2e, 0x6f, 0x72, 0x69,
+ 0x67, 0x54, 0x79, 0x70, 0x65, 0x2b, 0x22, 0x2e, 0x22, 0x2b, 0x64, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x64, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x54, 0x79, 0x70, 0x65,
+ 0x2c, 0x64, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2c, 0x64, 0x2e, 0x68, 0x61,
+ 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x69, 0x66, 0x28, 0x22,
+ 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20,
+ 0x61, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6f, 0x66, 0x66, 0x28, 0x65, 0x2c, 0x62, 0x2c, 0x61, 0x5b, 0x65, 0x5d, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x28, 0x62, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x7c, 0x7c, 0x22, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62,
+ 0x29, 0x26, 0x26, 0x28, 0x63, 0x3d, 0x62, 0x2c, 0x62, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30,
+ 0x29, 0x2c, 0x63, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x26, 0x26, 0x28, 0x63, 0x3d, 0x71, 0x61, 0x29,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65,
+ 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x2c, 0x63, 0x2c, 0x62, 0x29,
+ 0x7d, 0x29, 0x7d, 0x2c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x72,
+ 0x69, 0x67, 0x67, 0x65, 0x72, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d,
+ 0x29, 0x7d, 0x2c, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65,
+ 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3f, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74,
+ 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x21, 0x30, 0x29,
+ 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74,
+ 0x61, 0x3d, 0x2f, 0x20, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x5c, 0x64, 0x2b, 0x3d, 0x22, 0x28,
+ 0x3f, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x7c, 0x5c, 0x64, 0x2b, 0x29, 0x22, 0x2f, 0x67, 0x2c, 0x75,
+ 0x61, 0x3d, 0x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54, 0x79,
+ 0x70, 0x65, 0x3f, 0x62, 0x3a, 0x62, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c,
+ 0x64, 0x2c, 0x22, 0x74, 0x72, 0x22, 0x29, 0x3f, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x22,
+ 0x74, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x29, 0x5b, 0x30, 0x5d, 0x7c, 0x7c, 0x61, 0x2e, 0x61, 0x70,
+ 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x61, 0x2e, 0x6f, 0x77, 0x6e, 0x65,
+ 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x74, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x29,
+ 0x29, 0x3a, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x44, 0x61, 0x28,
+ 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x3d, 0x6e, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x2e,
+ 0x61, 0x74, 0x74, 0x72, 0x28, 0x61, 0x2c, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x29, 0x29, 0x2b,
+ 0x22, 0x2f, 0x22, 0x2b, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x61, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x62, 0x3d, 0x79, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3f, 0x61, 0x2e, 0x74, 0x79, 0x70,
+ 0x65, 0x3d, 0x62, 0x5b, 0x31, 0x5d, 0x3a, 0x61, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41,
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x29,
+ 0x2c, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x46, 0x61, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64,
+ 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x6e, 0x2e, 0x68, 0x61, 0x73, 0x44, 0x61, 0x74, 0x61,
+ 0x28, 0x61, 0x29, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66,
+ 0x3d, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x61, 0x29, 0x2c, 0x67, 0x3d, 0x6e, 0x2e,
+ 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x62, 0x2c, 0x66, 0x29, 0x2c, 0x68, 0x3d, 0x66, 0x2e, 0x65,
+ 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3b, 0x69, 0x66, 0x28, 0x68, 0x29, 0x7b, 0x64, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x20, 0x67, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x2c, 0x67, 0x2e, 0x65, 0x76,
+ 0x65, 0x6e, 0x74, 0x73, 0x3d, 0x7b, 0x7d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x63, 0x20, 0x69, 0x6e,
+ 0x20, 0x68, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x3d, 0x30, 0x2c, 0x65, 0x3d, 0x68, 0x5b, 0x63,
+ 0x5d, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x65, 0x3e, 0x64, 0x3b, 0x64, 0x2b, 0x2b,
+ 0x29, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x62, 0x2c, 0x63,
+ 0x2c, 0x68, 0x5b, 0x63, 0x5d, 0x5b, 0x64, 0x5d, 0x29, 0x7d, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61,
+ 0x26, 0x26, 0x28, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65,
+ 0x6e, 0x64, 0x28, 0x7b, 0x7d, 0x2c, 0x67, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x29, 0x29, 0x7d, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x47, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x31, 0x3d,
+ 0x3d, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x63, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x74, 0x6f,
+ 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2c, 0x21, 0x6c, 0x2e, 0x6e,
+ 0x6f, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x26, 0x26, 0x62, 0x5b, 0x6e,
+ 0x2e, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f, 0x5d, 0x29, 0x7b, 0x65, 0x3d, 0x6e, 0x2e, 0x5f,
+ 0x64, 0x61, 0x74, 0x61, 0x28, 0x62, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x20, 0x69, 0x6e,
+ 0x20, 0x65, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x6e, 0x2e, 0x72, 0x65, 0x6d, 0x6f,
+ 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x28, 0x62, 0x2c, 0x64, 0x2c, 0x65, 0x2e, 0x68, 0x61,
+ 0x6e, 0x64, 0x6c, 0x65, 0x29, 0x3b, 0x62, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74,
+ 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x6e, 0x2e, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64,
+ 0x6f, 0x29, 0x7d, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x26,
+ 0x26, 0x62, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x74, 0x65, 0x78, 0x74,
+ 0x3f, 0x28, 0x44, 0x61, 0x28, 0x62, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x3d, 0x61, 0x2e, 0x74,
+ 0x65, 0x78, 0x74, 0x2c, 0x45, 0x61, 0x28, 0x62, 0x29, 0x29, 0x3a, 0x22, 0x6f, 0x62, 0x6a, 0x65,
+ 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x3f, 0x28, 0x62, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x26, 0x26, 0x28, 0x62, 0x2e, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x48,
+ 0x54, 0x4d, 0x4c, 0x3d, 0x61, 0x2e, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x29,
+ 0x2c, 0x6c, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x35, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x26, 0x26, 0x61,
+ 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x26, 0x26, 0x21, 0x6e, 0x2e, 0x74,
+ 0x72, 0x69, 0x6d, 0x28, 0x62, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x29,
+ 0x26, 0x26, 0x28, 0x62, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x61,
+ 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x29, 0x29, 0x3a, 0x22, 0x69, 0x6e,
+ 0x70, 0x75, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x26, 0x26, 0x5a, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x28, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x29, 0x3f, 0x28, 0x62, 0x2e, 0x64, 0x65, 0x66, 0x61,
+ 0x75, 0x6c, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x3d, 0x62, 0x2e, 0x63, 0x68, 0x65,
+ 0x63, 0x6b, 0x65, 0x64, 0x3d, 0x61, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x2c, 0x62,
+ 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x26, 0x26, 0x28, 0x62, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x61, 0x2e, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x29, 0x29, 0x3a, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x3d,
+ 0x63, 0x3f, 0x62, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63,
+ 0x74, 0x65, 0x64, 0x3d, 0x62, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x3d, 0x61,
+ 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64,
+ 0x3a, 0x28, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x7c, 0x7c, 0x22,
+ 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x29, 0x26, 0x26,
+ 0x28, 0x62, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3d,
+ 0x61, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x7d,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x48, 0x61, 0x28, 0x61, 0x2c, 0x62,
+ 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x62, 0x3d, 0x66, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28,
+ 0x5b, 0x5d, 0x2c, 0x62, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x2c, 0x67, 0x2c, 0x68, 0x2c,
+ 0x69, 0x2c, 0x6a, 0x2c, 0x6b, 0x2c, 0x6d, 0x3d, 0x30, 0x2c, 0x6f, 0x3d, 0x61, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x70, 0x3d, 0x6f, 0x2d, 0x31, 0x2c, 0x71, 0x3d, 0x62, 0x5b, 0x30,
+ 0x5d, 0x2c, 0x72, 0x3d, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x71, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x72, 0x7c, 0x7c, 0x6f, 0x3e, 0x31, 0x26, 0x26, 0x22,
+ 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20,
+ 0x71, 0x26, 0x26, 0x21, 0x6c, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x43, 0x6c, 0x6f, 0x6e, 0x65,
+ 0x26, 0x26, 0x78, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x71, 0x29, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x3d, 0x61, 0x2e, 0x65,
+ 0x71, 0x28, 0x65, 0x29, 0x3b, 0x72, 0x26, 0x26, 0x28, 0x62, 0x5b, 0x30, 0x5d, 0x3d, 0x71, 0x2e,
+ 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x65, 0x2c, 0x66, 0x2e, 0x68, 0x74,
+ 0x6d, 0x6c, 0x28, 0x29, 0x29, 0x29, 0x2c, 0x48, 0x61, 0x28, 0x66, 0x2c, 0x62, 0x2c, 0x63, 0x2c,
+ 0x64, 0x29, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x6f, 0x26, 0x26, 0x28, 0x6b, 0x3d, 0x6a, 0x61,
+ 0x28, 0x62, 0x2c, 0x61, 0x5b, 0x30, 0x5d, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x21, 0x31, 0x2c, 0x61, 0x2c, 0x64, 0x29, 0x2c, 0x65, 0x3d,
+ 0x6b, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2c, 0x31, 0x3d, 0x3d,
+ 0x3d, 0x6b, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x28, 0x6b, 0x3d, 0x65, 0x29, 0x2c, 0x65, 0x7c, 0x7c, 0x64,
+ 0x29, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x69, 0x3d, 0x6e, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x65,
+ 0x61, 0x28, 0x6b, 0x2c, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74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 0x67, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x22, 0x22, 0x29, 0x26, 0x26, 0x21, 0x6e, 0x2e,
+ 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x67, 0x2c, 0x22, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x45,
+ 0x76, 0x61, 0x6c, 0x22, 0x29, 0x26, 0x26, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e,
+ 0x73, 0x28, 0x6a, 0x2c, 0x67, 0x29, 0x26, 0x26, 0x28, 0x67, 0x2e, 0x73, 0x72, 0x63, 0x3f, 0x6e,
+ 0x2e, 0x5f, 0x65, 0x76, 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x26, 0x26, 0x6e, 0x2e, 0x5f, 0x65, 0x76,
+ 0x61, 0x6c, 0x55, 0x72, 0x6c, 0x28, 0x67, 0x2e, 0x73, 0x72, 0x63, 0x29, 0x3a, 0x6e, 0x2e, 0x67,
+ 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x45, 0x76, 0x61, 0x6c, 0x28, 0x28, 0x67, 0x2e, 0x74, 0x65, 0x78,
+ 0x74, 0x7c, 0x7c, 0x67, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
+ 0x7c, 0x7c, 0x67, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x7c, 0x7c, 0x22,
+ 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x7a, 0x61, 0x2c, 0x22, 0x22,
+ 0x29, 0x29, 0x29, 0x3b, 0x6b, 0x3d, 0x65, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x49,
+ 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x2c, 0x65, 0x3d, 0x62, 0x3f, 0x6e, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28,
+ 0x62, 0x2c, 0x61, 0x29, 0x3a, 0x61, 0x2c, 0x66, 0x3d, 0x30, 0x3b, 0x6e, 0x75, 0x6c, 0x6c, 0x21,
+ 0x3d, 0x28, 0x64, 0x3d, 0x65, 0x5b, 0x66, 0x5d, 0x29, 0x3b, 0x66, 0x2b, 0x2b, 0x29, 0x63, 0x7c,
+ 0x7c, 0x31, 0x21, 0x3d, 0x3d, 0x64, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7c,
+ 0x7c, 0x6e, 0x2e, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x65, 0x61, 0x28,
+ 0x64, 0x29, 0x29, 0x2c, 0x64, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65,
+ 0x26, 0x26, 0x28, 0x63, 0x26, 0x26, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73,
+ 0x28, 0x64, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2c, 0x64, 0x29, 0x26, 0x26, 0x66, 0x61, 0x28, 0x65, 0x61, 0x28, 0x64, 0x2c, 0x22, 0x73, 0x63,
+ 0x72, 0x69, 0x70, 0x74, 0x22, 0x29, 0x29, 0x2c, 0x64, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64,
+ 0x28, 0x64, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x6e, 0x2e,
+ 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x68, 0x74, 0x6d, 0x6c, 0x50, 0x72, 0x65, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61,
+ 0x63, 0x65, 0x28, 0x76, 0x61, 0x2c, 0x22, 0x3c, 0x24, 0x31, 0x3e, 0x3c, 0x2f, 0x24, 0x32, 0x3e,
+ 0x22, 0x29, 0x7d, 0x2c, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c,
+ 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x2c, 0x69, 0x3d, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
+ 0x61, 0x69, 0x6e, 0x73, 0x28, 0x61, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x61, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x6c, 0x2e, 0x68, 0x74, 0x6d,
+ 0x6c, 0x35, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x7c, 0x7c, 0x6e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 0x54, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x6e, 0x2e, 0x69, 0x73, 0x58, 0x4d, 0x4c, 0x44, 0x6f,
+ 0x63, 0x28, 0x61, 0x29, 0x29, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x3d, 0x65, 0x61, 0x28, 0x66,
+ 0x29, 0x2c, 0x68, 0x3d, 0x65, 0x61, 0x28, 0x61, 0x29, 0x2c, 0x67, 0x3d, 0x30, 0x3b, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x21, 0x3d, 0x28, 0x65, 0x3d, 0x68, 0x5b, 0x67, 0x5d, 0x29, 0x3b, 0x2b, 0x2b, 0x67,
+ 0x29, 0x64, 0x5b, 0x67, 0x5d, 0x26, 0x26, 0x47, 0x61, 0x28, 0x65, 0x2c, 0x64, 0x5b, 0x67, 0x5d,
+ 0x29, 0x3b, 0x69, 0x66, 0x28, 0x62, 0x29, 0x69, 0x66, 0x28, 0x63, 0x29, 0x66, 0x6f, 0x72, 0x28,
+ 0x68, 0x3d, 0x68, 0x7c, 0x7c, 0x65, 0x61, 0x28, 0x61, 0x29, 0x2c, 0x64, 0x3d, 0x64, 0x7c, 0x7c,
+ 0x65, 0x61, 0x28, 0x66, 0x29, 0x2c, 0x67, 0x3d, 0x30, 0x3b, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d,
+ 0x28, 0x65, 0x3d, 0x68, 0x5b, 0x67, 0x5d, 0x29, 0x3b, 0x67, 0x2b, 0x2b, 0x29, 0x46, 0x61, 0x28,
+ 0x65, 0x2c, 0x64, 0x5b, 0x67, 0x5d, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x46, 0x61, 0x28,
+ 0x61, 0x2c, 0x66, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3d, 0x65, 0x61,
+ 0x28, 0x66, 0x2c, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x29, 0x2c, 0x64, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x30, 0x26, 0x26, 0x66, 0x61, 0x28, 0x64, 0x2c, 0x21, 0x69,
+ 0x26, 0x26, 0x65, 0x61, 0x28, 0x61, 0x2c, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x29,
+ 0x29, 0x2c, 0x64, 0x3d, 0x68, 0x3d, 0x65, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x66, 0x7d, 0x2c,
+ 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20,
+ 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x3d, 0x30, 0x2c, 0x69, 0x3d, 0x6e, 0x2e,
+ 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x6f, 0x2c, 0x6a, 0x3d, 0x6e, 0x2e, 0x63, 0x61, 0x63, 0x68,
+ 0x65, 0x2c, 0x6b, 0x3d, 0x6c, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
+ 0x2c, 0x6d, 0x3d, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69,
+ 0x61, 0x6c, 0x3b, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x28, 0x64, 0x3d, 0x61, 0x5b, 0x68, 0x5d,
+ 0x29, 0x3b, 0x68, 0x2b, 0x2b, 0x29, 0x69, 0x66, 0x28, 0x28, 0x62, 0x7c, 0x7c, 0x4d, 0x28, 0x64,
+ 0x29, 0x29, 0x26, 0x26, 0x28, 0x66, 0x3d, 0x64, 0x5b, 0x69, 0x5d, 0x2c, 0x67, 0x3d, 0x66, 0x26,
+ 0x26, 0x6a, 0x5b, 0x66, 0x5d, 0x29, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x67, 0x2e, 0x65, 0x76, 0x65,
+ 0x6e, 0x74, 0x73, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x67, 0x2e, 0x65,
+ 0x76, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x6d, 0x5b, 0x65, 0x5d, 0x3f, 0x6e, 0x2e, 0x65, 0x76, 0x65,
+ 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x64, 0x2c, 0x65, 0x29, 0x3a, 0x6e,
+ 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x28, 0x64, 0x2c, 0x65,
+ 0x2c, 0x67, 0x2e, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x29, 0x3b, 0x6a, 0x5b, 0x66, 0x5d, 0x26,
+ 0x26, 0x28, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x6a, 0x5b, 0x66, 0x5d, 0x2c, 0x6b, 0x7c,
+ 0x7c, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x3d, 0x3d, 0x74, 0x79,
+ 0x70, 0x65, 0x6f, 0x66, 0x20, 0x64, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x3f, 0x64, 0x5b, 0x69, 0x5d, 0x3d, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x3a, 0x64, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x69, 0x29, 0x2c, 0x63, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x66,
+ 0x29, 0x29, 0x7d, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65,
+ 0x6e, 0x64, 0x28, 0x7b, 0x64, 0x6f, 0x6d, 0x4d, 0x61, 0x6e, 0x69, 0x70, 0x3a, 0x48, 0x61, 0x2c,
+ 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x49, 0x61, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x61, 0x2c, 0x21, 0x30, 0x29, 0x7d, 0x2c, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x49, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29, 0x7d, 0x2c, 0x74,
+ 0x65, 0x78, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x59, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x3f, 0x6e, 0x2e, 0x74, 0x65,
+ 0x78, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6d,
+ 0x70, 0x74, 0x79, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x6f,
+ 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x64, 0x29,
+ 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x65, 0x78, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x28,
+ 0x61, 0x29, 0x29, 0x7d, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x61, 0x2c, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x7d, 0x2c, 0x61,
+ 0x70, 0x70, 0x65, 0x6e, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x48, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x31, 0x31, 0x3d, 0x3d,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7c, 0x7c,
+ 0x39, 0x3d, 0x3d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70,
+ 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x43, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2c, 0x61, 0x29, 0x3b, 0x62, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c,
+ 0x64, 0x28, 0x61, 0x29, 0x7d, 0x7d, 0x29, 0x7d, 0x2c, 0x70, 0x72, 0x65, 0x70, 0x65, 0x6e, 0x64,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x48, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64,
+ 0x65, 0x54, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x31, 0x31, 0x3d, 0x3d, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x39, 0x3d, 0x3d, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x62, 0x3d, 0x43, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29, 0x3b, 0x62,
+ 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28, 0x61, 0x2c,
+ 0x62, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x29, 0x7d, 0x7d, 0x29,
+ 0x7d, 0x2c, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x48, 0x61, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74,
+ 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x29,
+ 0x7d, 0x2c, 0x61, 0x66, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x48, 0x61, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42,
+ 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x65, 0x78,
+ 0x74, 0x53, 0x69, 0x62, 0x6c, 0x69, 0x6e, 0x67, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x65, 0x6d, 0x70,
+ 0x74, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x6f,
+ 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x61, 0x2c, 0x62, 0x3d, 0x30, 0x3b, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x21, 0x3d, 0x28, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x62, 0x5d, 0x29, 0x3b, 0x62, 0x2b,
+ 0x2b, 0x29, 0x7b, 0x31, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70,
+ 0x65, 0x26, 0x26, 0x6e, 0x2e, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x65,
+ 0x61, 0x28, 0x61, 0x2c, 0x21, 0x31, 0x29, 0x29, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x61,
+ 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x29, 0x61, 0x2e, 0x72, 0x65,
+ 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x61, 0x2e, 0x66, 0x69, 0x72, 0x73,
+ 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x29, 0x3b, 0x61, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
+ 0x73, 0x26, 0x26, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x61, 0x2c,
+ 0x22, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x22, 0x29, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x6f, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3d, 0x30, 0x29, 0x7d,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x63, 0x6c, 0x6f,
+ 0x6e, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d,
+ 0x61, 0x3f, 0x21, 0x31, 0x3a, 0x61, 0x2c, 0x62, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x62,
+ 0x3f, 0x61, 0x3a, 0x62, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x6e, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x2c, 0x62,
+ 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x68, 0x74, 0x6d, 0x6c, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x59, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x7c, 0x7c, 0x7b,
+ 0x7d, 0x2c, 0x63, 0x3d, 0x30, 0x2c, 0x64, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3b, 0x69, 0x66, 0x28, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d,
+ 0x61, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x6e,
+ 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3f, 0x62, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48,
+ 0x54, 0x4d, 0x4c, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x74, 0x61, 0x2c, 0x22,
+ 0x22, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x26,
+ 0x26, 0x21, 0x77, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x26, 0x26, 0x28, 0x6c,
+ 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x7c, 0x7c,
+ 0x21, 0x75, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x29, 0x26, 0x26, 0x28, 0x6c,
+ 0x2e, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x57, 0x68, 0x69, 0x74, 0x65, 0x73, 0x70, 0x61,
+ 0x63, 0x65, 0x7c, 0x7c, 0x21, 0x61, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x29,
+ 0x26, 0x26, 0x21, 0x64, 0x61, 0x5b, 0x28, 0x24, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x61, 0x29,
+ 0x7c, 0x7c, 0x5b, 0x22, 0x22, 0x2c, 0x22, 0x22, 0x5d, 0x29, 0x5b, 0x31, 0x5d, 0x2e, 0x74, 0x6f,
+ 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x5d, 0x29, 0x7b, 0x61, 0x3d,
+ 0x6e, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x50, 0x72, 0x65, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28,
+ 0x61, 0x29, 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x3b, 0x64, 0x3e, 0x63, 0x3b,
+ 0x63, 0x2b, 0x2b, 0x29, 0x62, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x63, 0x5d, 0x7c, 0x7c, 0x7b,
+ 0x7d, 0x2c, 0x31, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65,
+ 0x26, 0x26, 0x28, 0x6e, 0x2e, 0x63, 0x6c, 0x65, 0x61, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x65,
+ 0x61, 0x28, 0x62, 0x2c, 0x21, 0x31, 0x29, 0x29, 0x2c, 0x62, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72,
+ 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x61, 0x29, 0x3b, 0x62, 0x3d, 0x30, 0x7d, 0x63, 0x61, 0x74, 0x63,
+ 0x68, 0x28, 0x65, 0x29, 0x7b, 0x7d, 0x7d, 0x62, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65,
+ 0x6d, 0x70, 0x74, 0x79, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x61, 0x29,
+ 0x7d, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x61, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x7d, 0x2c, 0x72, 0x65, 0x70, 0x6c,
+ 0x61, 0x63, 0x65, 0x57, 0x69, 0x74, 0x68, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x5b, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x48, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x65,
+ 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x3b, 0x6e, 0x2e, 0x69, 0x6e, 0x41, 0x72, 0x72, 0x61, 0x79,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29, 0x3c, 0x30, 0x26, 0x26, 0x28, 0x6e, 0x2e, 0x63,
+ 0x6c, 0x65, 0x61, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x65, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x29, 0x2c, 0x63, 0x26, 0x26, 0x63, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x43,
+ 0x68, 0x69, 0x6c, 0x64, 0x28, 0x62, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x7d, 0x2c, 0x61,
+ 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x7b, 0x61, 0x70, 0x70,
+ 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x3a, 0x22, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x22, 0x2c, 0x70,
+ 0x72, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x3a, 0x22, 0x70, 0x72, 0x65, 0x70, 0x65, 0x6e,
+ 0x64, 0x22, 0x2c, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x3a,
+ 0x22, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x22, 0x2c, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x41,
+ 0x66, 0x74, 0x65, 0x72, 0x3a, 0x22, 0x61, 0x66, 0x74, 0x65, 0x72, 0x22, 0x2c, 0x72, 0x65, 0x70,
+ 0x6c, 0x61, 0x63, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x22, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65,
+ 0x57, 0x69, 0x74, 0x68, 0x22, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x6e, 0x2e, 0x66, 0x6e, 0x5b, 0x61, 0x5d, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72,
+ 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x30, 0x2c, 0x65, 0x3d, 0x5b, 0x5d, 0x2c, 0x66, 0x3d, 0x6e, 0x28,
+ 0x61, 0x29, 0x2c, 0x68, 0x3d, 0x66, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x3b,
+ 0x68, 0x3e, 0x3d, 0x64, 0x3b, 0x64, 0x2b, 0x2b, 0x29, 0x63, 0x3d, 0x64, 0x3d, 0x3d, 0x3d, 0x68,
+ 0x3f, 0x74, 0x68, 0x69, 0x73, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65,
+ 0x28, 0x21, 0x30, 0x29, 0x2c, 0x6e, 0x28, 0x66, 0x5b, 0x64, 0x5d, 0x29, 0x5b, 0x62, 0x5d, 0x28,
+ 0x63, 0x29, 0x2c, 0x67, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x65, 0x2c, 0x63, 0x2e, 0x67,
+ 0x65, 0x74, 0x28, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x28, 0x65, 0x29, 0x7d, 0x7d,
+ 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x4a, 0x61, 0x2c, 0x4b, 0x61, 0x3d, 0x7b, 0x48, 0x54, 0x4d,
+ 0x4c, 0x3a, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x2c, 0x42, 0x4f, 0x44, 0x59, 0x3a, 0x22,
+ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x7d, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x4c, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x6e,
+ 0x28, 0x62, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x28, 0x61, 0x29, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x28, 0x62, 0x2e,
+ 0x62, 0x6f, 0x64, 0x79, 0x29, 0x2c, 0x64, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x63, 0x5b,
+ 0x30, 0x5d, 0x2c, 0x22, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0x29, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x2e, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x28, 0x29, 0x2c,
+ 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4d, 0x61, 0x28, 0x61, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x64, 0x2c, 0x63, 0x3d, 0x4b, 0x61, 0x5b, 0x61, 0x5d,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x7c, 0x7c, 0x28, 0x63, 0x3d, 0x4c, 0x61,
+ 0x28, 0x61, 0x2c, 0x62, 0x29, 0x2c, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x21, 0x3d, 0x3d, 0x63,
+ 0x26, 0x26, 0x63, 0x7c, 0x7c, 0x28, 0x4a, 0x61, 0x3d, 0x28, 0x4a, 0x61, 0x7c, 0x7c, 0x6e, 0x28,
+ 0x22, 0x3c, 0x69, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x20, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x62, 0x6f,
+ 0x72, 0x64, 0x65, 0x72, 0x3d, 0x27, 0x30, 0x27, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x27,
+ 0x30, 0x27, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x27, 0x30, 0x27, 0x2f, 0x3e, 0x22,
+ 0x29, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x54, 0x6f, 0x28, 0x62, 0x2e, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2c, 0x62,
+ 0x3d, 0x28, 0x4a, 0x61, 0x5b, 0x30, 0x5d, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,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 0x28, 0x21, 0x30, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65,
+ 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6c, 0x69, 0x70, 0x3d,
+ 0x22, 0x22, 0x2c, 0x6c, 0x2e, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x43, 0x6c, 0x6f, 0x6e, 0x65, 0x53,
+ 0x74, 0x79, 0x6c, 0x65, 0x3d, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x62, 0x6f,
+ 0x78, 0x22, 0x3d, 0x3d, 0x3d, 0x6a, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x62, 0x61, 0x63,
+ 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x43, 0x6c, 0x69, 0x70, 0x2c, 0x69, 0x3d, 0x64, 0x2e,
+ 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64,
+ 0x69, 0x76, 0x22, 0x29, 0x2c, 0x69, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73, 0x73,
+ 0x54, 0x65, 0x78, 0x74, 0x3d, 0x22, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x30, 0x3b, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x3a, 0x38, 0x70, 0x78, 0x3b, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a,
+ 0x30, 0x3b, 0x74, 0x6f, 0x70, 0x3a, 0x30, 0x3b, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x2d, 0x39, 0x39,
+ 0x39, 0x39, 0x70, 0x78, 0x3b, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x30, 0x3b, 0x6d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, 0x6e, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x6b, 0x28, 0x29, 0x2c, 0x66, 0x7d,
+ 0x2c, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x6c, 0x69, 0x61, 0x62,
+ 0x6c, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x6b, 0x28,
+ 0x29, 0x2c, 0x65, 0x7d, 0x2c, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x4d, 0x61, 0x72, 0x67, 0x69, 0x6e,
+ 0x52, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x62, 0x26,
+ 0x26, 0x6b, 0x28, 0x29, 0x2c, 0x63, 0x7d, 0x2c, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x50, 0x6f, 0x73,
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d,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x65, 0x2e, 0x63, 0x73, 0x73, 0x54, 0x65, 0x78, 0x74, 0x3d, 0x22,
+ 0x2d, 0x77, 0x65, 0x62, 0x6b, 0x69, 0x74, 0x2d, 0x62, 0x6f, 0x78, 0x2d, 0x73, 0x69, 0x7a, 0x69,
+ 0x6e, 0x67, 0x3a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x78, 0x3b, 0x62, 0x6f,
+ 0x78, 0x2d, 0x73, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x3a, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d,
+ 0x62, 0x6f, 0x78, 0x3b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x72, 0x65, 0x6c,
+ 0x61, 0x74, 0x69, 0x76, 0x65, 0x3b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x62, 0x6c,
+ 0x6f, 0x63, 0x6b, 0x3b, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x61, 0x75, 0x74, 0x6f, 0x3b,
+ 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x31, 0x70, 0x78, 0x3b, 0x70, 0x61, 0x64, 0x64, 0x69,
+ 0x6e, 0x67, 0x3a, 0x31, 0x70, 0x78, 0x3b, 0x74, 0x6f, 0x70, 0x3a, 0x31, 0x25, 0x3b, 0x77, 0x69,
+ 0x64, 0x74, 0x68, 0x3a, 0x35, 0x30, 0x25, 0x22, 0x2c, 0x62, 0x3d, 0x65, 0x3d, 0x68, 0x3d, 0x21,
+ 0x31, 0x2c, 0x63, 0x3d, 0x67, 0x3d, 0x21, 0x30, 0x2c, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x43, 0x6f,
+ 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x26, 0x26, 0x28, 0x6c,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x3b, 0x70,
+ 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x30, 0x22, 0x2c, 0x6b, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x2e, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x52, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x6b, 0x2e,
+ 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x30, 0x22, 0x2c,
+ 0x6a, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31,
+ 0x70, 0x78, 0x22, 0x2c, 0x67, 0x3d, 0x21, 0x70, 0x61, 0x72, 0x73, 0x65, 0x46, 0x6c, 0x6f, 0x61,
+ 0x74, 0x28, 0x28, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64,
+ 0x53, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x6b, 0x29, 0x7c, 0x7c, 0x7b, 0x7d, 0x29, 0x2e, 0x6d, 0x61,
+ 0x72, 0x67, 0x69, 0x6e, 0x52, 0x69, 0x67, 0x68, 0x74, 0x29, 0x2c, 0x6a, 0x2e, 0x72, 0x65, 0x6d,
+ 0x6f, 0x76, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x6b, 0x29, 0x29, 0x2c, 0x6a, 0x2e, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3d, 0x22, 0x6e, 0x6f,
+ 0x6e, 0x65, 0x22, 0x2c, 0x66, 0x3d, 0x30, 0x3d, 0x3d, 0x3d, 0x6a, 0x2e, 0x67, 0x65, 0x74, 0x43,
+ 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 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79, 0x6c, 0x65, 0x3f, 0x28, 0x52, 0x61, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d,
+ 0x62, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x69, 0x65, 0x77, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x63, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x65, 0x72, 0x7c, 0x7c, 0x28, 0x63, 0x3d,
+ 0x61, 0x29, 0x2c, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64,
+ 0x53, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x62, 0x29, 0x7d, 0x2c, 0x53, 0x61, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x3d, 0x61, 0x2e, 0x73, 0x74, 0x79,
+ 0x6c, 0x65, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3d, 0x63, 0x7c, 0x7c, 0x52,
+ 0x61, 0x28, 0x61, 0x29, 0x2c, 0x67, 0x3d, 0x63, 0x3f, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x72,
+ 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x62, 0x29, 0x7c, 0x7c,
+ 0x63, 0x5b, 0x62, 0x5d, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x2c, 0x63, 0x26, 0x26, 0x28,
+ 0x22, 0x22, 0x21, 0x3d, 0x3d, 0x67, 0x7c, 0x7c, 0x6e, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
+ 0x6e, 0x73, 0x28, 0x61, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2c, 0x61, 0x29, 0x7c, 0x7c, 0x28, 0x67, 0x3d, 0x6e, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x29, 0x2c, 0x21, 0x6c, 0x2e, 0x70, 0x69, 0x78, 0x65, 0x6c,
+ 0x4d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x52, 0x69, 0x67, 0x68, 0x74, 0x28, 0x29, 0x26, 0x26, 0x4f,
+ 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x67, 0x29, 0x26, 0x26, 0x4e, 0x61, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x28, 0x62, 0x29, 0x26, 0x26, 0x28, 0x64, 0x3d, 0x68, 0x2e, 0x77, 0x69, 0x64, 0x74,
+ 0x68, 0x2c, 0x65, 0x3d, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x66,
+ 0x3d, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x68, 0x2e, 0x6d, 0x69,
+ 0x6e, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x57, 0x69, 0x64, 0x74,
+ 0x68, 0x3d, 0x68, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x67, 0x2c, 0x67, 0x3d, 0x63, 0x2e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x68, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x64, 0x2c,
+ 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x65, 0x2c, 0x68, 0x2e, 0x6d,
+ 0x61, 0x78, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x66, 0x29, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x67, 0x3f, 0x67, 0x3a, 0x67, 0x2b, 0x22, 0x22, 0x7d, 0x29, 0x3a,
+ 0x51, 0x61, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x26,
+ 0x26, 0x28, 0x52, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
+ 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x7d, 0x2c, 0x53, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64,
+ 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x3d, 0x61, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3d, 0x63, 0x7c, 0x7c, 0x52, 0x61, 0x28,
+ 0x61, 0x29, 0x2c, 0x67, 0x3d, 0x63, 0x3f, 0x63, 0x5b, 0x62, 0x5d, 0x3a, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x67, 0x26, 0x26, 0x68, 0x26, 0x26, 0x68,
+ 0x5b, 0x62, 0x5d, 0x26, 0x26, 0x28, 0x67, 0x3d, 0x68, 0x5b, 0x62, 0x5d, 0x29, 0x2c, 0x4f, 0x61,
+ 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x67, 0x29, 0x26, 0x26, 0x21, 0x54, 0x61, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x28, 0x62, 0x29, 0x26, 0x26, 0x28, 0x64, 0x3d, 0x68, 0x2e, 0x6c, 0x65, 0x66, 0x74,
+ 0x2c, 0x65, 0x3d, 0x61, 0x2e, 0x72, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x79, 0x6c,
+ 0x65, 0x2c, 0x66, 0x3d, 0x65, 0x26, 0x26, 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x2c, 0x66, 0x26,
+ 0x26, 0x28, 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x61, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65,
+ 0x6e, 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x29, 0x2c, 0x68, 0x2e,
+ 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x22, 0x66, 0x6f, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x62, 0x3f, 0x22, 0x31, 0x65, 0x6d, 0x22, 0x3a, 0x67, 0x2c, 0x67, 0x3d, 0x68, 0x2e,
+ 0x70, 0x69, 0x78, 0x65, 0x6c, 0x4c, 0x65, 0x66, 0x74, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x2c, 0x68,
+ 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x64, 0x2c, 0x66, 0x26, 0x26, 0x28, 0x65, 0x2e, 0x6c, 0x65,
+ 0x66, 0x74, 0x3d, 0x66, 0x29, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d,
+ 0x67, 0x3f, 0x67, 0x3a, 0x67, 0x2b, 0x22, 0x22, 0x7c, 0x7c, 0x22, 0x61, 0x75, 0x74, 0x6f, 0x22,
+ 0x7d, 0x29, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x55, 0x61, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x67, 0x65, 0x74, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x28, 0x29, 0x3f, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x3a, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x67, 0x65, 0x74, 0x3d, 0x62, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d, 0x7d, 0x7d, 0x76,
+ 0x61, 0x72, 0x20, 0x56, 0x61, 0x3d, 0x2f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x28, 0x5b, 0x5e,
+ 0x29, 0x5d, 0x2a, 0x5c, 0x29, 0x2f, 0x69, 0x2c, 0x57, 0x61, 0x3d, 0x2f, 0x6f, 0x70, 0x61, 0x63,
+ 0x69, 0x74, 0x79, 0x5c, 0x73, 0x2a, 0x3d, 0x5c, 0x73, 0x2a, 0x28, 0x5b, 0x5e, 0x29, 0x5d, 0x2a,
+ 0x29, 0x2f, 0x69, 0x2c, 0x58, 0x61, 0x3d, 0x2f, 0x5e, 0x28, 0x6e, 0x6f, 0x6e, 0x65, 0x7c, 0x74,
+ 0x61, 0x62, 0x6c, 0x65, 0x28, 0x3f, 0x21, 0x2d, 0x63, 0x5b, 0x65, 0x61, 0x5d, 0x29, 0x2e, 0x2b,
+ 0x29, 0x2f, 0x2c, 0x59, 0x61, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70,
+ 0x28, 0x22, 0x5e, 0x28, 0x22, 0x2b, 0x54, 0x2b, 0x22, 0x29, 0x28, 0x2e, 0x2a, 0x29, 0x24, 0x22,
+ 0x2c, 0x22, 0x69, 0x22, 0x29, 0x2c, 0x5a, 0x61, 0x3d, 0x7b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69,
+ 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x22, 0x2c, 0x76, 0x69,
+ 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x3a, 0x22, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e,
+ 0x22, 0x2c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x22, 0x62, 0x6c, 0x6f, 0x63, 0x6b,
+ 0x22, 0x7d, 0x2c, 0x24, 0x61, 0x3d, 0x7b, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x72, 0x53, 0x70, 0x61,
+ 0x63, 0x69, 0x6e, 0x67, 0x3a, 0x22, 0x30, 0x22, 0x2c, 0x66, 0x6f, 0x6e, 0x74, 0x57, 0x65, 0x69,
+ 0x67, 0x68, 0x74, 0x3a, 0x22, 0x34, 0x30, 0x30, 0x22, 0x7d, 0x2c, 0x5f, 0x61, 0x3d, 0x5b, 0x22,
+ 0x57, 0x65, 0x62, 0x6b, 0x69, 0x74, 0x22, 0x2c, 0x22, 0x4f, 0x22, 0x2c, 0x22, 0x4d, 0x6f, 0x7a,
+ 0x22, 0x2c, 0x22, 0x6d, 0x73, 0x22, 0x5d, 0x2c, 0x61, 0x62, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22,
+ 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x62, 0x62, 0x28, 0x61, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x20, 0x69, 0x6e, 0x20, 0x61,
+ 0x62, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62,
+ 0x3d, 0x61, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x41, 0x74, 0x28, 0x30, 0x29, 0x2e, 0x74, 0x6f, 0x55,
+ 0x70, 0x70, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2b, 0x61, 0x2e, 0x73, 0x6c, 0x69,
+ 0x63, 0x65, 0x28, 0x31, 0x29, 0x2c, 0x63, 0x3d, 0x5f, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x63, 0x2d, 0x2d, 0x29, 0x69, 0x66, 0x28, 0x61,
+ 0x3d, 0x5f, 0x61, 0x5b, 0x63, 0x5d, 0x2b, 0x62, 0x2c, 0x61, 0x20, 0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 0x3d, 0x64, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x70,
+ 0x6c, 0x61, 0x79, 0x26, 0x26, 0x57, 0x28, 0x64, 0x29, 0x26, 0x26, 0x28, 0x66, 0x5b, 0x67, 0x5d,
+ 0x3d, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x64, 0x2c, 0x22, 0x6f, 0x6c, 0x64, 0x64,
+ 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0x2c, 0x4d, 0x61, 0x28, 0x64, 0x2e, 0x6e, 0x6f, 0x64,
+ 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x29, 0x29, 0x29, 0x3a, 0x28, 0x65, 0x3d, 0x57, 0x28, 0x64,
+ 0x29, 0x2c, 0x28, 0x63, 0x26, 0x26, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x21, 0x3d, 0x3d, 0x63,
+ 0x7c, 0x7c, 0x21, 0x65, 0x29, 0x26, 0x26, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x64,
+ 0x2c, 0x22, 0x6f, 0x6c, 0x64, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0x2c, 0x65, 0x3f,
+ 0x63, 0x3a, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x64, 0x2c, 0x22, 0x64, 0x69, 0x73, 0x70, 0x6c,
+ 0x61, 0x79, 0x22, 0x29, 0x29, 0x29, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x67, 0x3d, 0x30, 0x3b,
+ 0x68, 0x3e, 0x67, 0x3b, 0x67, 0x2b, 0x2b, 0x29, 0x64, 0x3d, 0x61, 0x5b, 0x67, 0x5d, 0x2c, 0x64,
+ 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x26, 0x26, 0x28, 0x62, 0x26, 0x26, 0x22, 0x6e, 0x6f, 0x6e,
+ 0x65, 0x22, 0x21, 0x3d, 0x3d, 0x64, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x64, 0x69, 0x73,
+ 0x70, 0x6c, 0x61, 0x79, 0x26, 0x26, 0x22, 0x22, 0x21, 0x3d, 0x3d, 0x64, 0x2e, 0x73, 0x74, 0x79,
+ 0x6c, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x7c, 0x7c, 0x28, 0x64, 0x2e, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3d, 0x62, 0x3f, 0x66,
+ 0x5b, 0x67, 0x5d, 0x7c, 0x7c, 0x22, 0x22, 0x3a, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x29, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x64, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x3d, 0x59, 0x61, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x62, 0x29, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3f, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x28,
+ 0x30, 0x2c, 0x64, 0x5b, 0x31, 0x5d, 0x2d, 0x28, 0x63, 0x7c, 0x7c, 0x30, 0x29, 0x29, 0x2b, 0x28,
+ 0x64, 0x5b, 0x32, 0x5d, 0x7c, 0x7c, 0x22, 0x70, 0x78, 0x22, 0x29, 0x3a, 0x62, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c,
+ 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x66, 0x3d, 0x63,
+ 0x3d, 0x3d, 0x3d, 0x28, 0x64, 0x3f, 0x22, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x3a, 0x22,
+ 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x29, 0x3f, 0x34, 0x3a, 0x22, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x31, 0x3a, 0x30, 0x2c, 0x67, 0x3d, 0x30, 0x3b,
+ 0x34, 0x3e, 0x66, 0x3b, 0x66, 0x2b, 0x3d, 0x32, 0x29, 0x22, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e,
+ 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x26, 0x26, 0x28, 0x67, 0x2b, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73,
+ 0x28, 0x61, 0x2c, 0x63, 0x2b, 0x56, 0x5b, 0x66, 0x5d, 0x2c, 0x21, 0x30, 0x2c, 0x65, 0x29, 0x29,
+ 0x2c, 0x64, 0x3f, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x3d, 0x3d, 0x3d,
+ 0x63, 0x26, 0x26, 0x28, 0x67, 0x2d, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x2c, 0x22,
+ 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x2b, 0x56, 0x5b, 0x66, 0x5d, 0x2c, 0x21, 0x30,
+ 0x2c, 0x65, 0x29, 0x29, 0x2c, 0x22, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x22, 0x21, 0x3d, 0x3d,
+ 0x63, 0x26, 0x26, 0x28, 0x67, 0x2d, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x2c, 0x22,
+ 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x2b, 0x56, 0x5b, 0x66, 0x5d, 0x2b, 0x22, 0x57, 0x69,
+ 0x64, 0x74, 0x68, 0x22, 0x2c, 0x21, 0x30, 0x2c, 0x65, 0x29, 0x29, 0x29, 0x3a, 0x28, 0x67, 0x2b,
+ 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x2c, 0x22, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e,
+ 0x67, 0x22, 0x2b, 0x56, 0x5b, 0x66, 0x5d, 0x2c, 0x21, 0x30, 0x2c, 0x65, 0x29, 0x2c, 0x22, 0x70,
+ 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x21, 0x3d, 0x3d, 0x63, 0x26, 0x26, 0x28, 0x67, 0x2b,
+ 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x2c, 0x22, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
+ 0x22, 0x2b, 0x56, 0x5b, 0x66, 0x5d, 0x2b, 0x22, 0x57, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x21,
+ 0x30, 0x2c, 0x65, 0x29, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x62, 0x28, 0x62, 0x2c, 0x63, 0x2c,
+ 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x3d, 0x21, 0x30, 0x2c, 0x67, 0x3d, 0x22, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x3f, 0x62, 0x2e, 0x6f, 0x66, 0x66, 0x73,
+ 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x62, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74,
+ 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x68, 0x3d, 0x52, 0x61, 0x28, 0x62, 0x29, 0x2c, 0x69,
+ 0x3d, 0x6c, 0x2e, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x26, 0x26, 0x22, 0x62,
+ 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x78, 0x22, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x63,
+ 0x73, 0x73, 0x28, 0x62, 0x2c, 0x22, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x22,
+ 0x2c, 0x21, 0x31, 0x2c, 0x68, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x64, 0x2e, 0x6d, 0x73, 0x46, 0x75,
+ 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x26,
+ 0x26, 0x61, 0x2e, 0x74, 0x6f, 0x70, 0x21, 0x3d, 0x3d, 0x61, 0x26, 0x26, 0x62, 0x2e, 0x67, 0x65,
+ 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x73, 0x28, 0x29, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x28, 0x67, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72,
+ 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x31, 0x30, 0x30, 0x2a, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x6f,
+ 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74,
+ 0x28, 0x29, 0x5b, 0x63, 0x5d, 0x29, 0x29, 0x2c, 0x30, 0x3e, 0x3d, 0x67, 0x7c, 0x7c, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x3d, 0x3d, 0x67, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x67, 0x3d, 0x53, 0x61, 0x28, 0x62,
+ 0x2c, 0x63, 0x2c, 0x68, 0x29, 0x2c, 0x28, 0x30, 0x3e, 0x67, 0x7c, 0x7c, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x3d, 0x3d, 0x67, 0x29, 0x26, 0x26, 0x28, 0x67, 0x3d, 0x62, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65,
+ 0x5b, 0x63, 0x5d, 0x29, 0x2c, 0x4f, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x67, 0x29, 0x29,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x3b, 0x66, 0x3d, 0x69, 0x26, 0x26, 0x28, 0x6c,
+ 0x2e, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x6c, 0x69, 0x61, 0x62,
+ 0x6c, 0x65, 0x28, 0x29, 0x7c, 0x7c, 0x67, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x5b, 0x63, 0x5d, 0x29, 0x2c, 0x67, 0x3d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x46, 0x6c, 0x6f,
+ 0x61, 0x74, 0x28, 0x67, 0x29, 0x7c, 0x7c, 0x30, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x67, 0x2b, 0x65, 0x62, 0x28, 0x62, 0x2c, 0x63, 0x2c, 0x65, 0x7c, 0x7c, 0x28, 0x69, 0x3f, 0x22,
+ 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x3a, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
+ 0x22, 0x29, 0x2c, 0x66, 0x2c, 0x68, 0x29, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x7d, 0x6e, 0x2e, 0x65,
+ 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x63, 0x73, 0x73, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x3a,
+ 0x7b, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x7b, 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x62,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x53, 0x61, 0x28, 0x61, 0x2c, 0x22, 0x6f, 0x70,
+ 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x63, 0x3f, 0x22, 0x31, 0x22, 0x3a, 0x63, 0x7d, 0x7d, 0x7d, 0x7d, 0x2c, 0x63,
+ 0x73, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3a, 0x7b, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x49, 0x74, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x75, 0x6e,
+ 0x74, 0x3a, 0x21, 0x30, 0x2c, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74,
+ 0x3a, 0x21, 0x30, 0x2c, 0x66, 0x69, 0x6c, 0x6c, 0x4f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a,
+ 0x21, 0x30, 0x2c, 0x66, 0x6c, 0x65, 0x78, 0x47, 0x72, 0x6f, 0x77, 0x3a, 0x21, 0x30, 0x2c, 0x66,
+ 0x6c, 0x65, 0x78, 0x53, 0x68, 0x72, 0x69, 0x6e, 0x6b, 0x3a, 0x21, 0x30, 0x2c, 0x66, 0x6f, 0x6e,
+ 0x74, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x21, 0x30, 0x2c, 0x6c, 0x69, 0x6e, 0x65, 0x48,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x21, 0x30, 0x2c, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79,
+ 0x3a, 0x21, 0x30, 0x2c, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x21, 0x30, 0x2c, 0x6f, 0x72, 0x70,
+ 0x68, 0x61, 0x6e, 0x73, 0x3a, 0x21, 0x30, 0x2c, 0x77, 0x69, 0x64, 0x6f, 0x77, 0x73, 0x3a, 0x21,
+ 0x30, 0x2c, 0x7a, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x21, 0x30, 0x2c, 0x7a, 0x6f, 0x6f, 0x6d,
+ 0x3a, 0x21, 0x30, 0x7d, 0x2c, 0x63, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x3a, 0x7b, 0x22,
+ 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x22, 0x3a, 0x6c, 0x2e, 0x63, 0x73, 0x73, 0x46, 0x6c, 0x6f, 0x61,
+ 0x74, 0x3f, 0x22, 0x63, 0x73, 0x73, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x22, 0x3a, 0x22, 0x73, 0x74,
+ 0x79, 0x6c, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x22, 0x7d, 0x2c, 0x73, 0x74, 0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, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x63, 0x29, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x26, 0x26, 0x22, 0x67, 0x65, 0x74, 0x22, 0x69, 0x6e, 0x20,
+ 0x67, 0x26, 0x26, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x28, 0x65, 0x3d, 0x67,
+ 0x2e, 0x67, 0x65, 0x74, 0x28, 0x61, 0x2c, 0x21, 0x31, 0x2c, 0x64, 0x29, 0x29, 0x3f, 0x65, 0x3a,
+ 0x69, 0x5b, 0x62, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x66, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x63, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x3d, 0x66, 0x26,
+ 0x26, 0x28, 0x65, 0x3d, 0x55, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x63, 0x29, 0x29, 0x26, 0x26,
+ 0x65, 0x5b, 0x31, 0x5d, 0x26, 0x26, 0x28, 0x63, 0x3d, 0x58, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x65,
+ 0x29, 0x2c, 0x66, 0x3d, 0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x29, 0x2c, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x21, 0x3d, 0x63, 0x26, 0x26, 0x63, 0x3d, 0x3d, 0x3d, 0x63, 0x26, 0x26, 0x28, 0x22,
+ 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x3d, 0x66, 0x26, 0x26, 0x28, 0x63, 0x2b,
+ 0x3d, 0x65, 0x26, 0x26, 0x65, 0x5b, 0x33, 0x5d, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x63, 0x73, 0x73,
+ 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x5b, 0x68, 0x5d, 0x3f, 0x22, 0x22, 0x3a, 0x22, 0x70, 0x78,
+ 0x22, 0x29, 0x29, 0x2c, 0x6c, 0x2e, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x43, 0x6c, 0x6f, 0x6e, 0x65,
+ 0x53, 0x74, 0x79, 0x6c, 0x65, 0x7c, 0x7c, 0x22, 0x22, 0x21, 0x3d, 0x3d, 0x63, 0x7c, 0x7c, 0x30,
+ 0x21, 0x3d, 0x3d, 0x62, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28, 0x22, 0x62, 0x61,
+ 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x29, 0x7c, 0x7c, 0x28, 0x69, 0x5b, 0x62,
+ 0x5d, 0x3d, 0x22, 0x69, 0x6e, 0x68, 0x65, 0x72, 0x69, 0x74, 0x22, 0x29, 0x2c, 0x21, 0x28, 0x67,
+ 0x26, 0x26, 0x22, 0x73, 0x65, 0x74, 0x22, 0x69, 0x6e, 0x20, 0x67, 0x26, 0x26, 0x76, 0x6f, 0x69,
+ 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x28, 0x63, 0x3d, 0x67, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x61,
+ 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x29, 0x29, 0x29, 0x29, 0x74, 0x72, 0x79, 0x7b, 0x69, 0x5b, 0x62,
+ 0x5d, 0x3d, 0x63, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x6a, 0x29, 0x7b, 0x7d, 0x7d, 0x7d,
+ 0x2c, 0x63, 0x73, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c,
+ 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x2c, 0x66, 0x2c, 0x67,
+ 0x2c, 0x68, 0x3d, 0x6e, 0x2e, 0x63, 0x61, 0x6d, 0x65, 0x6c, 0x43, 0x61, 0x73, 0x65, 0x28, 0x62,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73,
+ 0x50, 0x72, 0x6f, 0x70, 0x73, 0x5b, 0x68, 0x5d, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x63, 0x73, 0x73,
+ 0x50, 0x72, 0x6f, 0x70, 0x73, 0x5b, 0x68, 0x5d, 0x3d, 0x62, 0x62, 0x28, 0x68, 0x29, 0x7c, 0x7c,
+ 0x68, 0x29, 0x2c, 0x67, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x5b,
+ 0x62, 0x5d, 0x7c, 0x7c, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x5b, 0x68,
+ 0x5d, 0x2c, 0x67, 0x26, 0x26, 0x22, 0x67, 0x65, 0x74, 0x22, 0x69, 0x6e, 0x20, 0x67, 0x26, 0x26,
+ 0x28, 0x66, 0x3d, 0x67, 0x2e, 0x67, 0x65, 0x74, 0x28, 0x61, 0x2c, 0x21, 0x30, 0x2c, 0x63, 0x29,
+ 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x66, 0x26, 0x26, 0x28, 0x66,
+ 0x3d, 0x53, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x64, 0x29, 0x29, 0x2c, 0x22, 0x6e, 0x6f, 0x72,
+ 0x6d, 0x61, 0x6c, 0x22, 0x3d, 0x3d, 0x3d, 0x66, 0x26, 0x26, 0x62, 0x20, 0x69, 0x6e, 0x20, 0x24,
+ 0x61, 0x26, 0x26, 0x28, 0x66, 0x3d, 0x24, 0x61, 0x5b, 0x62, 0x5d, 0x29, 0x2c, 0x22, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x63, 0x7c, 0x7c, 0x63, 0x3f, 0x28, 0x65, 0x3d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x46,
+ 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x66, 0x29, 0x2c, 0x63, 0x3d, 0x3d, 0x3d, 0x21, 0x30, 0x7c, 0x7c,
+ 0x69, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x28, 0x65, 0x29, 0x3f, 0x65, 0x7c, 0x7c, 0x30,
+ 0x3a, 0x66, 0x29, 0x3a, 0x66, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28,
+ 0x5b, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7b, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x5b, 0x62, 0x5d, 0x3d, 0x7b,
+ 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x63,
+ 0x2c, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3f, 0x58, 0x61, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x28, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x2c, 0x22, 0x64, 0x69,
+ 0x73, 0x70, 0x6c, 0x61, 0x79, 0x22, 0x29, 0x29, 0x26, 0x26, 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x2e,
+ 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3f, 0x50, 0x61, 0x28, 0x61,
+ 0x2c, 0x5a, 0x61, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x64, 0x29, 0x7d,
+ 0x29, 0x3a, 0x66, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x64, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x64, 0x26,
+ 0x26, 0x52, 0x61, 0x28, 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x62,
+ 0x28, 0x61, 0x2c, 0x63, 0x2c, 0x64, 0x3f, 0x65, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x64, 0x2c,
+ 0x6c, 0x2e, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x26, 0x26, 0x22, 0x62, 0x6f,
+ 0x72, 0x64, 0x65, 0x72, 0x2d, 0x62, 0x6f, 0x78, 0x22, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x63, 0x73,
+ 0x73, 0x28, 0x61, 0x2c, 0x22, 0x62, 0x6f, 0x78, 0x53, 0x69, 0x7a, 0x69, 0x6e, 0x67, 0x22, 0x2c,
+ 0x21, 0x31, 0x2c, 0x65, 0x29, 0x2c, 0x65, 0x29, 0x3a, 0x30, 0x29, 0x7d, 0x7d, 0x7d, 0x29, 0x2c,
+ 0x6c, 0x2e, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x63, 0x73,
+ 0x73, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3d, 0x7b,
+ 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x57, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x28, 0x28, 0x62, 0x26, 0x26, 0x61, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x74,
+ 0x79, 0x6c, 0x65, 0x3f, 0x61, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x79,
+ 0x6c, 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3a, 0x61, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x29, 0x7c, 0x7c, 0x22, 0x22, 0x29, 0x3f, 0x2e,
+ 0x30, 0x31, 0x2a, 0x70, 0x61, 0x72, 0x73, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x52, 0x65,
+ 0x67, 0x45, 0x78, 0x70, 0x2e, 0x24, 0x31, 0x29, 0x2b, 0x22, 0x22, 0x3a, 0x62, 0x3f, 0x22, 0x31,
+ 0x22, 0x3a, 0x22, 0x22, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x61, 0x2e,
+ 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2c, 0x64, 0x3d, 0x61, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
+ 0x74, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x2c, 0x65, 0x3d, 0x6e, 0x2e, 0x69, 0x73, 0x4e, 0x75, 0x6d,
+ 0x65, 0x72, 0x69, 0x63, 0x28, 0x62, 0x29, 0x3f, 0x22, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x28, 0x6f,
+ 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3d, 0x22, 0x2b, 0x31, 0x30, 0x30, 0x2a, 0x62, 0x2b, 0x22,
+ 0x29, 0x22, 0x3a, 0x22, 0x22, 0x2c, 0x66, 0x3d, 0x64, 0x26, 0x26, 0x64, 0x2e, 0x66, 0x69, 0x6c,
+ 0x74, 0x65, 0x72, 0x7c, 0x7c, 0x63, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x7c, 0x7c, 0x22,
+ 0x22, 0x3b, 0x63, 0x2e, 0x7a, 0x6f, 0x6f, 0x6d, 0x3d, 0x31, 0x2c, 0x28, 0x62, 0x3e, 0x3d, 0x31,
+ 0x7c, 0x7c, 0x22, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x29, 0x26, 0x26, 0x22, 0x22, 0x3d, 0x3d, 0x3d,
+ 0x6e, 0x2e, 0x74, 0x72, 0x69, 0x6d, 0x28, 0x66, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65,
+ 0x28, 0x56, 0x61, 0x2c, 0x22, 0x22, 0x29, 0x29, 0x26, 0x26, 0x63, 0x2e, 0x72, 0x65, 0x6d, 0x6f,
+ 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x26, 0x26, 0x28, 0x63, 0x2e,
+ 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28,
+ 0x22, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x29, 0x2c, 0x22, 0x22, 0x3d, 0x3d, 0x3d, 0x62,
+ 0x7c, 0x7c, 0x64, 0x26, 0x26, 0x21, 0x64, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x29, 0x7c,
+ 0x7c, 0x28, 0x63, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3d, 0x56, 0x61, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x28, 0x66, 0x29, 0x3f, 0x66, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28,
+ 0x56, 0x61, 0x2c, 0x65, 0x29, 0x3a, 0x66, 0x2b, 0x22, 0x20, 0x22, 0x2b, 0x65, 0x29, 0x7d, 0x7d,
+ 0x29, 0x2c, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x6d, 0x61, 0x72,
+ 0x67, 0x69, 0x6e, 0x52, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x55, 0x61, 0x28, 0x6c, 0x2e, 0x72, 0x65,
+ 0x6c, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x52, 0x69, 0x67, 0x68,
+ 0x74, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3f, 0x50, 0x61, 0x28, 0x61, 0x2c, 0x7b, 0x64,
+ 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x22, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x62,
+ 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x7d, 0x2c, 0x53, 0x61, 0x2c, 0x5b, 0x61, 0x2c, 0x22, 0x6d, 0x61,
+ 0x72, 0x67, 0x69, 0x6e, 0x52, 0x69, 0x67, 0x68, 0x74, 0x22, 0x5d, 0x29, 0x3a, 0x76, 0x6f, 0x69,
+ 0x64, 0x20, 0x30, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x48, 0x6f, 0x6f, 0x6b, 0x73,
+ 0x2e, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x4c, 0x65, 0x66, 0x74, 0x3d, 0x55, 0x61, 0x28, 0x6c,
+ 0x2e, 0x72, 0x65, 0x6c, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x4c,
+ 0x65, 0x66, 0x74, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3f, 0x28, 0x70, 0x61, 0x72, 0x73,
+ 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x53, 0x61, 0x28, 0x61, 0x2c, 0x22, 0x6d, 0x61, 0x72,
+ 0x67, 0x69, 0x6e, 0x4c, 0x65, 0x66, 0x74, 0x22, 0x29, 0x29, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x28, 0x61, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x61, 0x29, 0x3f, 0x61, 0x2e, 0x67, 0x65, 0x74,
+ 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65,
+ 0x63, 0x74, 0x28, 0x29, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0x50, 0x61, 0x28, 0x61, 0x2c, 0x7b,
+ 0x0a, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x4c, 0x65, 0x66, 0x74, 0x3a, 0x30, 0x7d, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6c,
+ 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x28, 0x29, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x7d,
+ 0x29, 0x3a, 0x30, 0x29, 0x29, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20,
+ 0x30, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x7b, 0x6d, 0x61, 0x72, 0x67,
+ 0x69, 0x6e, 0x3a, 0x22, 0x22, 0x2c, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x22, 0x22,
+ 0x2c, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x22, 0x57, 0x69, 0x64, 0x74, 0x68, 0x22, 0x7d,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x6e,
+ 0x2e, 0x63, 0x73, 0x73, 0x48, 0x6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 0x6e, 0x64, 0x28, 0x7b,
+ 0x63, 0x73, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x59, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x3d, 0x7b, 0x7d, 0x2c, 0x67, 0x3d, 0x30,
+ 0x3b, 0x69, 0x66, 0x28, 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x62, 0x29,
+ 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x3d, 0x52, 0x61, 0x28, 0x61, 0x29, 0x2c, 0x65, 0x3d,
+ 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x65, 0x3e, 0x67, 0x3b, 0x67, 0x2b, 0x2b,
+ 0x29, 0x66, 0x5b, 0x62, 0x5b, 0x67, 0x5d, 0x5d, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61,
+ 0x2c, 0x62, 0x5b, 0x67, 0x5d, 0x2c, 0x21, 0x31, 0x2c, 0x64, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x66, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x63, 0x3f, 0x6e, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x3a, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7d, 0x2c, 0x61, 0x2c, 0x62, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x31, 0x29, 0x7d, 0x2c, 0x73, 0x68, 0x6f, 0x77, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x63, 0x62, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x21, 0x30, 0x29, 0x7d, 0x2c, 0x68,
+ 0x69, 0x64, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x62, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c,
+ 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61,
+ 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x3f, 0x61, 0x3f, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x68, 0x6f, 0x77, 0x28, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x68, 0x69, 0x64, 0x65, 0x28, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x57, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x29, 0x3f, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x73, 0x68, 0x6f, 0x77,
+ 0x28, 0x29, 0x3a, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x68, 0x69, 0x64, 0x65, 0x28,
+ 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x67, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x67, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63,
+ 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7d, 0x6e, 0x2e, 0x54, 0x77, 0x65, 0x65, 0x6e, 0x3d, 0x67, 0x62,
+ 0x2c, 0x67, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x7b, 0x63,
+ 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x3a, 0x67, 0x62, 0x2c, 0x69, 0x6e,
+ 0x69, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c,
+ 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c,
+ 0x65, 0x6d, 0x3d, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x3d, 0x63,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x3d, 0x65, 0x7c, 0x7c,
+ 0x6e, 0x2e, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
+ 0x74, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3d, 0x62,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6e, 0x6f, 0x77, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x28, 0x29, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6e, 0x64, 0x3d, 0x64, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x75, 0x6e, 0x69, 0x74, 0x3d, 0x66, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x4e, 0x75,
+ 0x6d, 0x62, 0x65, 0x72, 0x5b, 0x63, 0x5d, 0x3f, 0x22, 0x22, 0x3a, 0x22, 0x70, 0x78, 0x22, 0x29,
+ 0x7d, 0x2c, 0x63, 0x75, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x67, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x48, 0x6f,
+ 0x6f, 0x6b, 0x73, 0x5b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x5d, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x26, 0x26, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x3f, 0x61,
+ 0x2e, 0x67, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3a, 0x67, 0x62, 0x2e, 0x70, 0x72,
+ 0x6f, 0x70, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
+ 0x2e, 0x67, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c, 0x72, 0x75, 0x6e, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x62, 0x2c, 0x63, 0x3d, 0x67, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x48, 0x6f, 0x6f, 0x6b, 0x73,
+ 0x5b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
+ 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x6f,
+ 0x73, 0x3d, 0x62, 0x3d, 0x6e, 0x2e, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x5b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x5d, 0x28, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2a, 0x61, 0x2c, 0x30, 0x2c, 0x31, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x3a, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x70, 0x6f, 0x73, 0x3d, 0x62, 0x3d, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6e, 0x6f, 0x77, 0x3d, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6e, 0x64, 0x2d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x29, 0x2a, 0x62, 0x2b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x73, 0x74, 0x65, 0x70, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x73, 0x74, 0x65, 0x70, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6e, 0x6f, 0x77, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x63, 0x26, 0x26, 0x63, 0x2e,
+ 0x73, 0x65, 0x74, 0x3f, 0x63, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3a,
+ 0x67, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x5f, 0x64, 0x65,
+ 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x7d, 0x7d, 0x2c, 0x67, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74,
+ 0x79, 0x70, 0x65, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x67, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2c,
+ 0x67, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x3d, 0x7b, 0x5f, 0x64,
+ 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x7b, 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x2e,
+ 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d,
+ 0x61, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x5b, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x5d, 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 0x2e, 0x73, 0x74, 0x65, 0x70, 0x3d, 0x7b, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x68, 0x62, 0x2c,
+ 0x69, 0x62, 0x2c, 0x6a, 0x62, 0x3d, 0x2f, 0x5e, 0x28, 0x3f, 0x3a, 0x74, 0x6f, 0x67, 0x67, 0x6c,
+ 0x65, 0x7c, 0x73, 0x68, 0x6f, 0x77, 0x7c, 0x68, 0x69, 0x64, 0x65, 0x29, 0x24, 0x2f, 0x2c, 0x6b,
+ 0x62, 0x3d, 0x2f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x24, 0x2f, 0x3b,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75,
+ 0x74, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x68, 0x62, 0x3d,
+ 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x29, 0x2c, 0x68, 0x62, 0x3d, 0x6e, 0x2e, 0x6e, 0x6f,
+ 0x77, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x62, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x7b, 0x68, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x3a, 0x61, 0x7d, 0x2c, 0x65, 0x3d, 0x30, 0x3b, 0x66, 0x6f, 0x72, 0x28,
+ 0x62, 0x3d, 0x62, 0x3f, 0x31, 0x3a, 0x30, 0x3b, 0x34, 0x3e, 0x65, 0x3b, 0x65, 0x2b, 0x3d, 0x32,
+ 0x2d, 0x62, 0x29, 0x63, 0x3d, 0x56, 0x5b, 0x65, 0x5d, 0x2c, 0x64, 0x5b, 0x22, 0x6d, 0x61, 0x72,
+ 0x67, 0x69, 0x6e, 0x22, 0x2b, 0x63, 0x5d, 0x3d, 0x64, 0x5b, 0x22, 0x70, 0x61, 0x64, 0x64, 0x69,
+ 0x6e, 0x67, 0x22, 0x2b, 0x63, 0x5d, 0x3d, 0x61, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x62, 0x26, 0x26, 0x28, 0x64, 0x2e, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3d, 0x64, 0x2e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x61, 0x29, 0x2c, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x66, 0x6f,
+ 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x3d, 0x28, 0x71, 0x62, 0x2e, 0x74, 0x77,
+ 0x65, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x5b, 0x62, 0x5d, 0x7c, 0x7c, 0x5b, 0x5d, 0x29, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x63, 0x61, 0x74, 0x28, 0x71, 0x62, 0x2e, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x65, 0x72,
+ 0x73, 0x5b, 0x22, 0x2a, 0x22, 0x5d, 0x29, 0x2c, 0x66, 0x3d, 0x30, 0x2c, 0x67, 0x3d, 0x65, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x67, 0x3e, 0x66, 0x3b, 0x66, 0x2b, 0x2b, 0x29, 0x69,
+ 0x66, 0x28, 0x64, 0x3d, 0x65, 0x5b, 0x66, 0x5d, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x63, 0x2c,
+ 0x62, 0x2c, 0x61, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x2c, 0x69,
+ 0x2c, 0x6a, 0x2c, 0x6b, 0x2c, 0x6d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6f, 0x3d, 0x7b, 0x7d,
+ 0x2c, 0x70, 0x3d, 0x61, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2c, 0x71, 0x3d, 0x61, 0x2e, 0x6e,
+ 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x57, 0x28, 0x61, 0x29, 0x2c, 0x72, 0x3d,
+ 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x61, 0x2c, 0x22, 0x66, 0x78, 0x73, 0x68, 0x6f,
+ 0x77, 0x22, 0x29, 0x3b, 0x63, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x7c, 0x7c, 0x28, 0x68, 0x3d,
+ 0x6e, 0x2e, 0x5f, 0x71, 0x75, 0x65, 0x75, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x28, 0x61, 0x2c,
+ 0x22, 0x66, 0x78, 0x22, 0x29, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x68, 0x2e, 0x75, 0x6e,
+ 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x26, 0x26, 0x28, 0x68, 0x2e, 0x75, 0x6e, 0x71, 0x75, 0x65,
+ 0x75, 0x65, 0x64, 0x3d, 0x30, 0x2c, 0x69, 0x3d, 0x68, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e,
+ 0x66, 0x69, 0x72, 0x65, 0x2c, 0x68, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x66, 0x69, 0x72,
+ 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x68, 0x2e, 0x75,
+ 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x7c, 0x7c, 0x69, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x68,
+ 0x2e, 0x75, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x2b, 0x2b, 0x2c, 0x6d, 0x2e, 0x61, 0x6c,
+ 0x77, 0x61, 0x79, 0x73, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x6d, 0x2e, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x68, 0x2e, 0x75, 0x6e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x64, 0x2d, 0x2d,
+ 0x2c, 0x6e, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x61, 0x2c, 0x22, 0x66, 0x78, 0x22, 0x29,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7c, 0x7c, 0x68, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79,
+ 0x2e, 0x66, 0x69, 0x72, 0x65, 0x28, 0x29, 0x7d, 0x29, 0x7d, 0x29, 0x29, 0x2c, 0x31, 0x3d, 0x3d,
+ 0x3d, 0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 0x64,
+ 0x64, 0x65, 0x6e, 0x29, 0x3a, 0x72, 0x3d, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x61,
+ 0x2c, 0x22, 0x66, 0x78, 0x73, 0x68, 0x6f, 0x77, 0x22, 0x2c, 0x7b, 0x7d, 0x29, 0x2c, 0x66, 0x26,
+ 0x26, 0x28, 0x72, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x3d, 0x21, 0x71, 0x29, 0x2c, 0x71,
+ 0x3f, 0x6e, 0x28, 0x61, 0x29, 0x2e, 0x73, 0x68, 0x6f, 0x77, 0x28, 0x29, 0x3a, 0x6d, 0x2e, 0x64,
+ 0x6f, 0x6e, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6e,
+ 0x28, 0x61, 0x29, 0x2e, 0x68, 0x69, 0x64, 0x65, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x6d, 0x2e, 0x64,
+ 0x6f, 0x6e, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x62, 0x3b, 0x6e, 0x2e, 0x5f, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x61,
+ 0x74, 0x61, 0x28, 0x61, 0x2c, 0x22, 0x66, 0x78, 0x73, 0x68, 0x6f, 0x77, 0x22, 0x29, 0x3b, 0x66,
+ 0x6f, 0x72, 0x28, 0x62, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x29, 0x6e, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x6f, 0x5b, 0x62, 0x5d, 0x29, 0x7d, 0x29, 0x3b, 0x66, 0x6f,
+ 0x72, 0x28, 0x64, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x29, 0x67, 0x3d, 0x6e, 0x62, 0x28, 0x71, 0x3f,
+ 0x72, 0x5b, 0x64, 0x5d, 0x3a, 0x30, 0x2c, 0x64, 0x2c, 0x6d, 0x29, 0x2c, 0x64, 0x20, 0x69, 0x6e,
+ 0x20, 0x72, 0x7c, 0x7c, 0x28, 0x72, 0x5b, 0x64, 0x5d, 0x3d, 0x67, 0x2e, 0x73, 0x74, 0x61, 0x72,
+ 0x74, 0x2c, 0x71, 0x26, 0x26, 0x28, 0x67, 0x2e, 0x65, 0x6e, 0x64, 0x3d, 0x67, 0x2e, 0x73, 0x74,
+ 0x61, 0x72, 0x74, 0x2c, 0x67, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3d, 0x22, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x22, 0x3d, 0x3d, 0x3d, 0x64, 0x7c, 0x7c, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x22, 0x3d, 0x3d, 0x3d, 0x64, 0x3f, 0x31, 0x3a, 0x30, 0x29, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x3b, 0x66, 0x6f, 0x72, 0x28,
+ 0x63, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29, 0x69, 0x66, 0x28, 0x64, 0x3d, 0x6e, 0x2e, 0x63, 0x61,
+ 0x6d, 0x65, 0x6c, 0x43, 0x61, 0x73, 0x65, 0x28, 0x63, 0x29, 0x2c, 0x65, 0x3d, 0x62, 0x5b, 0x64,
+ 0x5d, 0x2c, 0x66, 0x3d, 0x61, 0x5b, 0x63, 0x5d, 0x2c, 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72,
+ 0x61, 0x79, 0x28, 0x66, 0x29, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x66, 0x5b, 0x31, 0x5d, 0x2c, 0x66,
+ 0x3d, 0x61, 0x5b, 0x63, 0x5d, 0x3d, 0x66, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x63, 0x21, 0x3d, 0x3d,
+ 0x64, 0x26, 0x26, 0x28, 0x61, 0x5b, 0x64, 0x5d, 0x3d, 0x66, 0x2c, 0x64, 0x65, 0x6c, 0x65, 0x74,
+ 0x65, 0x20, 0x61, 0x5b, 0x63, 0x5d, 0x29, 0x2c, 0x67, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x48,
+ 0x6f, 0x6f, 0x6b, 0x73, 0x5b, 0x64, 0x5d, 0x2c, 0x67, 0x26, 0x26, 0x22, 0x65, 0x78, 0x70, 0x61,
+ 0x6e, 0x64, 0x22, 0x69, 0x6e, 0x20, 0x67, 0x29, 0x7b, 0x66, 0x3d, 0x67, 0x2e, 0x65, 0x78, 0x70,
+ 0x61, 0x6e, 0x64, 0x28, 0x66, 0x29, 0x2c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x5b,
+ 0x64, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x63, 0x20, 0x69, 0x6e, 0x20, 0x66, 0x29, 0x63, 0x20,
+ 0x69, 0x6e, 0x20, 0x61, 0x7c, 0x7c, 0x28, 0x61, 0x5b, 0x63, 0x5d, 0x3d, 0x66, 0x5b, 0x63, 0x5d,
+ 0x2c, 0x62, 0x5b, 0x63, 0x5d, 0x3d, 0x65, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x62, 0x5b,
+ 0x64, 0x5d, 0x3d, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x71, 0x62,
+ 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x2c,
+ 0x66, 0x3d, 0x30, 0x2c, 0x67, 0x3d, 0x71, 0x62, 0x2e, 0x70, 0x72, 0x65, 0x66, 0x69, 0x6c, 0x74,
+ 0x65, 0x72, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x68, 0x3d, 0x6e, 0x2e, 0x44,
+ 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x64, 0x28, 0x29, 0x2e, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x64, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x20, 0x69, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x7d, 0x29, 0x2c, 0x69, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x65, 0x29, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x62,
+ 0x3d, 0x68, 0x62, 0x7c, 0x7c, 0x6c, 0x62, 0x28, 0x29, 0x2c, 0x63, 0x3d, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x30, 0x2c, 0x6a, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69,
+ 0x6d, 0x65, 0x2b, 0x6a, 0x2e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2d, 0x62, 0x29,
+ 0x2c, 0x64, 0x3d, 0x63, 0x2f, 0x6a, 0x2e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7c,
+ 0x7c, 0x30,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 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x45,
+ 0x61, 0x73, 0x69, 0x6e, 0x67, 0x3a, 0x7b, 0x7d, 0x2c, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x3a,
+ 0x6e, 0x2e, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
+ 0x74, 0x7d, 0x2c, 0x63, 0x29, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x50, 0x72,
+ 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x3a, 0x62, 0x2c, 0x6f, 0x72, 0x69, 0x67, 0x69,
+ 0x6e, 0x61, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x63, 0x2c, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x3a, 0x68, 0x62, 0x7c, 0x7c, 0x6c, 0x62, 0x28, 0x29, 0x2c,
+ 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x63, 0x2e, 0x64, 0x75, 0x72, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x2c, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x73, 0x3a, 0x5b, 0x5d, 0x2c, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x54, 0x77, 0x65, 0x65, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x6e, 0x2e,
+ 0x54, 0x77, 0x65, 0x65, 0x6e, 0x28, 0x61, 0x2c, 0x6a, 0x2e, 0x6f, 0x70, 0x74, 0x73, 0x2c, 0x62,
+ 0x2c, 0x63, 0x2c, 0x6a, 0x2e, 0x6f, 0x70, 0x74, 0x73, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61,
+ 0x6c, 0x45, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x5b, 0x62, 0x5d, 0x7c, 0x7c, 0x6a, 0x2e, 0x6f, 0x70,
+ 0x74, 0x73, 0x2e, 0x65, 0x61, 0x73, 0x69, 0x6e, 0x67, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x6a, 0x2e, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28,
+ 0x64, 0x29, 0x2c, 0x64, 0x7d, 0x2c, 0x73, 0x74, 0x6f, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x30, 0x2c, 0x64,
+ 0x3d, 0x62, 0x3f, 0x6a, 0x2e, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x3a, 0x30, 0x3b, 0x69, 0x66, 0x28, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x3d, 0x21, 0x30, 0x3b, 0x64,
+ 0x3e, 0x63, 0x3b, 0x63, 0x2b, 0x2b, 0x29, 0x6a, 0x2e, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x73, 0x5b,
+ 0x63, 0x5d, 0x2e, 0x72, 0x75, 0x6e, 0x28, 0x31, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x62, 0x3f, 0x28, 0x68, 0x2e, 0x6e, 0x6f, 0x74, 0x69, 0x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, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x77, 0x65, 0x65, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x58, 0x28, 0x63, 0x2e, 0x65, 0x6c, 0x65,
+ 0x6d, 0x2c, 0x61, 0x2c, 0x55, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x62, 0x29, 0x2c, 0x63, 0x29,
+ 0x2c, 0x63, 0x7d, 0x5d, 0x7d, 0x2c, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x65, 0x72, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x6e, 0x2e, 0x69, 0x73,
+ 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x3f, 0x28, 0x62, 0x3d, 0x61,
+ 0x2c, 0x61, 0x3d, 0x5b, 0x22, 0x2a, 0x22, 0x5d, 0x29, 0x3a, 0x61, 0x3d, 0x61, 0x2e, 0x6d, 0x61,
+ 0x74, 0x63, 0x68, 0x28, 0x47, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x63,
+ 0x2c, 0x64, 0x3d, 0x30, 0x2c, 0x65, 0x3d, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b,
+ 0x65, 0x3e, 0x64, 0x3b, 0x64, 0x2b, 0x2b, 0x29, 0x63, 0x3d, 0x61, 0x5b, 0x64, 0x5d, 0x2c, 0x71,
+ 0x62, 0x2e, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x5b, 0x63, 0x5d, 0x3d, 0x71, 0x62,
+ 0x2e, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x5b, 0x63, 0x5d, 0x7c, 0x7c, 0x5b, 0x5d,
+ 0x2c, 0x71, 0x62, 0x2e, 0x74, 0x77, 0x65, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x5b, 0x63, 0x5d, 0x2e,
+ 0x75, 0x6e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x62, 0x29, 0x7d, 0x2c, 0x70, 0x72, 0x65, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x5b, 0x6f, 0x62, 0x5d, 0x2c, 0x70, 0x72, 0x65, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x62, 0x3f, 0x71, 0x62, 0x2e, 0x70, 0x72, 0x65, 0x66, 0x69, 0x6c, 0x74,
+ 0x65, 0x72, 0x73, 0x2e, 0x75, 0x6e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x61, 0x29, 0x3a, 0x71,
+ 0x62, 0x2e, 0x70, 0x72, 0x65, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x28, 0x61, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x73, 0x70, 0x65, 0x65, 0x64, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x61, 0x26, 0x26, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x3f, 0x6e, 0x2e, 0x65, 0x78,
+ 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x7d, 0x2c, 0x61, 0x29, 0x3a, 0x7b, 0x63, 0x6f, 0x6d, 0x70,
+ 0x6c, 0x65, 0x74, 0x65, 0x3a, 0x63, 0x7c, 0x7c, 0x21, 0x63, 0x26, 0x26, 0x62, 0x7c, 0x7c, 0x6e,
+ 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x26, 0x26,
+ 0x61, 0x2c, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x61, 0x2c, 0x65, 0x61, 0x73,
+ 0x69, 0x6e, 0x67, 0x3a, 0x63, 0x26, 0x26, 0x62, 0x7c, 0x7c, 0x62, 0x26, 0x26, 0x21, 0x6e, 0x2e,
+ 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x26, 0x26, 0x62,
+ 0x7d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x64, 0x75, 0x72, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x3d, 0x6e, 0x2e, 0x66, 0x78, 0x2e, 0x6f, 0x66, 0x66, 0x3f, 0x30, 0x3a, 0x22,
+ 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20,
+ 0x64, 0x2e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3f, 0x64, 0x2e, 0x64, 0x75, 0x72,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x64, 0x2e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x69, 0x6e, 0x20, 0x6e, 0x2e, 0x66, 0x78, 0x2e, 0x73, 0x70, 0x65, 0x65, 0x64, 0x73, 0x3f,
+ 0x6e, 0x2e, 0x66, 0x78, 0x2e, 0x73, 0x70, 0x65, 0x65, 0x64, 0x73, 0x5b, 0x64, 0x2e, 0x64, 0x75,
+ 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x3a, 0x6e, 0x2e, 0x66, 0x78, 0x2e, 0x73, 0x70, 0x65,
+ 0x65, 0x64, 0x73, 0x2e, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2c, 0x28, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x3d, 0x3d, 0x64, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x7c, 0x7c, 0x64, 0x2e, 0x71,
+ 0x75, 0x65, 0x75, 0x65, 0x3d, 0x3d, 0x3d, 0x21, 0x30, 0x29, 0x26, 0x26, 0x28, 0x64, 0x2e, 0x71,
+ 0x75, 0x65, 0x75, 0x65, 0x3d, 0x22, 0x66, 0x78, 0x22, 0x29, 0x2c, 0x64, 0x2e, 0x6f, 0x6c, 0x64,
+ 0x3d, 0x64, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x2c, 0x64, 0x2e, 0x63, 0x6f,
+ 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x2e, 0x6f, 0x6c, 0x64, 0x29, 0x26, 0x26, 0x64, 0x2e, 0x6f, 0x6c, 0x64, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x64, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x26,
+ 0x26, 0x6e, 0x2e, 0x64, 0x65, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x64, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x29, 0x7d, 0x2c, 0x64, 0x7d, 0x2c, 0x6e, 0x2e, 0x66,
+ 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x66, 0x61, 0x64, 0x65, 0x54, 0x6f,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c,
+ 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x57, 0x29, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x22, 0x6f, 0x70,
+ 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x30, 0x29, 0x2e, 0x73, 0x68, 0x6f, 0x77, 0x28, 0x29,
+ 0x2e, 0x65, 0x6e, 0x64, 0x28, 0x29, 0x2e, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x28, 0x7b,
+ 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x62, 0x7d, 0x2c, 0x61, 0x2c, 0x63, 0x2c, 0x64,
+ 0x29, 0x7d, 0x2c, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x65, 0x3d, 0x6e, 0x2e, 0x69, 0x73, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4f, 0x62, 0x6a, 0x65,
+ 0x63, 0x74, 0x28, 0x61, 0x29, 0x2c, 0x66, 0x3d, 0x6e, 0x2e, 0x73, 0x70, 0x65, 0x65, 0x64, 0x28,
+ 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x2c, 0x67, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x71, 0x62, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x7d, 0x2c, 0x61, 0x29,
+ 0x2c, 0x66, 0x29, 0x3b, 0x28, 0x65, 0x7c, 0x7c, 0x6e, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x22, 0x29, 0x29, 0x26,
+ 0x26, 0x62, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x28, 0x21, 0x30, 0x29, 0x7d, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x67, 0x2e, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x3d, 0x67, 0x2c, 0x65,
+ 0x7c, 0x7c, 0x66, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x3f, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x67, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x66, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x2c, 0x67,
+ 0x29, 0x7d, 0x2c, 0x73, 0x74, 0x6f, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d,
+ 0x61, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x3b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x2e,
+ 0x73, 0x74, 0x6f, 0x70, 0x2c, 0x62, 0x28, 0x63, 0x29, 0x7d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x61, 0x26, 0x26, 0x28, 0x63, 0x3d, 0x62, 0x2c, 0x62, 0x3d, 0x61, 0x2c, 0x61, 0x3d,
+ 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x29, 0x2c, 0x62, 0x26, 0x26, 0x61, 0x21, 0x3d, 0x3d, 0x21,
+ 0x31, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x61, 0x7c,
+ 0x7c, 0x22, 0x66, 0x78, 0x22, 0x2c, 0x5b, 0x5d, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65,
+ 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x62, 0x3d, 0x21, 0x30, 0x2c, 0x65, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d,
+ 0x61, 0x26, 0x26, 0x61, 0x2b, 0x22, 0x71, 0x75, 0x65, 0x75, 0x65, 0x48, 0x6f, 0x6f, 0x6b, 0x73,
+ 0x22, 0x2c, 0x66, 0x3d, 0x6e, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x73, 0x2c, 0x67, 0x3d, 0x6e,
+ 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3b, 0x69, 0x66, 0x28,
+ 0x65, 0x29, 0x67, 0x5b, 0x65, 0x5d, 0x26, 0x26, 0x67, 0x5b, 0x65, 0x5d, 0x2e, 0x73, 0x74, 0x6f,
+ 0x70, 0x26, 0x26, 0x64, 0x28, 0x67, 0x5b, 0x65, 0x5d, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20,
+ 0x66, 0x6f, 0x72, 0x28, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x67, 0x29, 0x67, 0x5b, 0x65, 0x5d, 0x26,
+ 0x26, 0x67, 0x5b, 0x65, 0x5d, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x26, 0x26, 0x6b, 0x62, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x28, 0x65, 0x29, 0x26, 0x26, 0x64, 0x28, 0x67, 0x5b, 0x65, 0x5d, 0x29, 0x3b,
+ 0x66, 0x6f, 0x72, 0x28, 0x65, 0x3d, 0x66, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x65,
+ 0x2d, 0x2d, 0x3b, 0x29, 0x66, 0x5b, 0x65, 0x5d, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x21, 0x3d, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x7c, 0x7c, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x26, 0x26, 0x66,
+ 0x5b, 0x65, 0x5d, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x21, 0x3d, 0x3d, 0x61, 0x7c, 0x7c, 0x28,
+ 0x66, 0x5b, 0x65, 0x5d, 0x2e, 0x61, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x28, 0x63,
+ 0x29, 0x2c, 0x62, 0x3d, 0x21, 0x31, 0x2c, 0x66, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28,
+ 0x65, 0x2c, 0x31, 0x29, 0x29, 0x3b, 0x28, 0x62, 0x7c, 0x7c, 0x21, 0x63, 0x29, 0x26, 0x26, 0x6e,
+ 0x2e, 0x64, 0x65, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29,
+ 0x7d, 0x29, 0x7d, 0x2c, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x21,
+ 0x3d, 0x3d, 0x21, 0x31, 0x26, 0x26, 0x28, 0x61, 0x3d, 0x61, 0x7c, 0x7c, 0x22, 0x66, 0x78, 0x22,
+ 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x3d, 0x6e,
+ 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x64, 0x3d, 0x63,
+ 0x5b, 0x61, 0x2b, 0x22, 0x71, 0x75, 0x65, 0x75, 0x65, 0x22, 0x5d, 0x2c, 0x65, 0x3d, 0x63, 0x5b,
+ 0x61, 0x2b, 0x22, 0x71, 0x75, 0x65, 0x75, 0x65, 0x48,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0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x22, 0x3d, 0x3d,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x3f, 0x63, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29,
+ 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x28, 0x6d, 0x62,
+ 0x28, 0x62, 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x61, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7d, 0x7d, 0x29,
+ 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x7b, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x44, 0x6f,
+ 0x77, 0x6e, 0x3a, 0x6d, 0x62, 0x28, 0x22, 0x73, 0x68, 0x6f, 0x77, 0x22, 0x29, 0x2c, 0x73, 0x6c,
+ 0x69, 0x64, 0x65, 0x55, 0x70, 0x3a, 0x6d, 0x62, 0x28, 0x22, 0x68, 0x69, 0x64, 0x65, 0x22, 0x29,
+ 0x2c, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x3a, 0x6d, 0x62, 0x28,
+ 0x22, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x22, 0x29, 0x2c, 0x66, 0x61, 0x64, 0x65, 0x49, 0x6e,
+ 0x3a, 0x7b, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x3a, 0x22, 0x73, 0x68, 0x6f, 0x77, 0x22,
+ 0x7d, 0x2c, 0x66, 0x61, 0x64, 0x65, 0x4f, 0x75, 0x74, 0x3a, 0x7b, 0x6f, 0x70, 0x61, 0x63, 0x69,
+ 0x74, 0x79, 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x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x69, 0x62, 0x7c, 0x7c, 0x28,
+ 0x69, 0x62, 0x3d, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,
+ 0x28, 0x6e, 0x2e, 0x66, 0x78, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x2c, 0x6e, 0x2e, 0x66, 0x78, 0x2e,
+ 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x29, 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x66, 0x78,
+ 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x61, 0x2e, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,
+ 0x28, 0x69, 0x62, 0x29, 0x2c, 0x69, 0x62, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x2c, 0x6e, 0x2e,
+ 0x66, 0x78, 0x2e, 0x73, 0x70, 0x65, 0x65, 0x64, 0x73, 0x3d, 0x7b, 0x73, 0x6c, 0x6f, 0x77, 0x3a,
+ 0x36, 0x30, 0x30, 0x2c, 0x66, 0x61, 0x73, 0x74, 0x3a, 0x32, 0x30, 0x30, 0x2c, 0x5f, 0x64, 0x65,
+ 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x34, 0x30, 0x30, 0x7d, 0x2c, 0x6e, 0x2e, 0x66, 0x6e, 0x2e,
+ 0x64, 0x65, 0x6c, 0x61, 0x79, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62,
+ 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3d, 0x6e, 0x2e, 0x66,
+ 0x78, 0x3f, 0x6e, 0x2e, 0x66, 0x78, 0x2e, 0x73, 0x70, 0x65, 0x65, 0x64, 0x73, 0x5b, 0x62, 0x5d,
+ 0x7c, 0x7c, 0x62, 0x3a, 0x62, 0x2c, 0x63, 0x3d, 0x63, 0x7c, 0x7c, 0x22, 0x66, 0x78, 0x22, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x71, 0x75, 0x65, 0x75, 0x65, 0x28, 0x63, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65,
+ 0x3d, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x63, 0x2c,
+ 0x62, 0x29, 0x3b, 0x64, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x61, 0x2e, 0x63, 0x6c, 0x65, 0x61, 0x72, 0x54, 0x69, 0x6d, 0x65,
+ 0x6f, 0x75, 0x74, 0x28, 0x65, 0x29, 0x7d, 0x7d, 0x29, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x2c, 0x62, 0x3d, 0x64, 0x2e,
+ 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x69,
+ 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x2c, 0x63, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x2c,
+ 0x65, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x28, 0x22, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x22, 0x29, 0x2c, 0x66, 0x3d, 0x65, 0x2e,
+ 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x64, 0x2e, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x6f, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x29, 0x3b, 0x63, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x2c,
+ 0x63, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x2c, 0x22, 0x74, 0x22, 0x29, 0x2c,
+ 0x63, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x22, 0x20, 0x20, 0x3c,
+ 0x6c, 0x69, 0x6e, 0x6b, 0x2f, 0x3e, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x3c, 0x2f, 0x74,
+ 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x3c, 0x61, 0x20, 0x68, 0x72, 0x65, 0x66, 0x3d, 0x27, 0x2f, 0x61,
+ 0x27, 0x3e, 0x61, 0x3c, 0x2f, 0x61, 0x3e, 0x3c, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x74, 0x79,
+ 0x70, 0x65, 0x3d, 0x27, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x27, 0x2f, 0x3e, 0x22,
+ 0x2c, 0x61, 0x3d, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x22, 0x61, 0x22, 0x29, 0x5b, 0x30,
+ 0x5d, 0x2c, 0x62, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x28, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x22, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f,
+ 0x78, 0x22, 0x29, 0x2c, 0x63, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c,
+ 0x64, 0x28, 0x62, 0x29, 0x2c, 0x61, 0x3d, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x22, 0x61,
+ 0x22, 0x29, 0x5b, 0x30, 0x5d, 0x2c, 0x61, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x63, 0x73,
+ 0x73, 0x54, 0x65, 0x78, 0x74, 0x3d, 0x22, 0x74, 0x6f, 0x70, 0x3a, 0x31, 0x70, 0x78, 0x22, 0x2c,
+ 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x3d, 0x22, 0x74, 0x22, 0x21, 0x3d, 0x3d, 0x63, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e,
+ 0x61, 0x6d, 0x65, 0x2c, 0x6c, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3d, 0x2f, 0x74, 0x6f, 0x70,
+ 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x22, 0x29, 0x29, 0x2c,
+ 0x6c, 0x2e, 0x68, 0x72, 0x65, 0x66, 0x4e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64,
+ 0x3d, 0x22, 0x2f, 0x61, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x68, 0x72, 0x65, 0x66, 0x22, 0x29, 0x2c, 0x6c,
+ 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x4f, 0x6e, 0x3d, 0x21, 0x21, 0x62, 0x2e, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x2c, 0x6c, 0x2e, 0x6f, 0x70, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64,
+ 0x3d, 0x66, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x2c, 0x6c, 0x2e, 0x65, 0x6e,
+ 0x63, 0x74, 0x79, 0x70, 0x65, 0x3d, 0x21, 0x21, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x29, 0x2e,
+ 0x65, 0x6e, 0x63, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c,
+ 0x65, 0x64, 0x3d, 0x21, 0x30, 0x2c, 0x6c, 0x2e, 0x6f, 0x70, 0x74, 0x44, 0x69, 0x73, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x3d, 0x21, 0x66, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x2c,
+ 0x62, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x28, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x2c, 0x62, 0x2e, 0x73, 0x65, 0x74,
+ 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x22, 0x2c, 0x22, 0x22, 0x29, 0x2c, 0x6c, 0x2e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3d, 0x22, 0x22,
+ 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x28, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x2c, 0x62, 0x2e, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x3d, 0x22, 0x74, 0x22, 0x2c, 0x62, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x22, 0x72, 0x61,
+ 0x64, 0x69, 0x6f, 0x22, 0x29, 0x2c, 0x6c, 0x2e, 0x72, 0x61, 0x64, 0x69, 0x6f, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x3d, 0x22, 0x74, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x7d, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x62, 0x3d, 0x2f, 0x5c, 0x72, 0x2f, 0x67,
+ 0x3b, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x76, 0x61,
+ 0x6c, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30,
+ 0x5d, 0x3b, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3d,
+ 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3b, 0x31, 0x3d, 0x3d, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65,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2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65,
+ 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x5d, 0x2c, 0x62, 0x26, 0x26, 0x22, 0x73, 0x65, 0x74,
+ 0x22, 0x69, 0x6e, 0x20, 0x62, 0x26, 0x26, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d,
+ 0x62, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x65, 0x2c, 0x22, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x22, 0x29, 0x7c, 0x7c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x3d, 0x65, 0x29, 0x29, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x65, 0x29, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3d, 0x6e, 0x2e, 0x76, 0x61, 0x6c, 0x48, 0x6f, 0x6f, 0x6b,
+ 0x73, 0x5b, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x5d, 0x7c, 0x7c, 0x6e, 0x2e, 0x76, 0x61, 0x6c,
+ 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x5b, 0x65, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65,
+ 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x5d, 0x2c,
+ 0x62, 0x26, 0x26, 0x22, 0x67, 0x65, 0x74, 0x22, 0x69, 0x6e, 0x20, 0x62, 0x26, 0x26, 0x76, 0x6f,
+ 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x28, 0x63, 0x3d, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x28,
+ 0x65, 0x2c, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x29, 0x3f, 0x63, 0x3a, 0x28, 0x63,
+ 0x3d, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2c, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x63, 0x3f, 0x63, 0x2e, 0x72, 0x65,
+ 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x72, 0x62, 0x2c, 0x22, 0x22, 0x29, 0x3a, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x3d, 0x3d, 0x63, 0x3f, 0x22, 0x22, 0x3a, 0x63, 0x29, 0x7d, 0x7d, 0x7d, 0x29, 0x2c, 0x6e,
+ 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x76, 0x61, 0x6c, 0x48, 0x6f, 0x6f, 0x6b,
+ 0x73, 0x3a, 0x7b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x7b, 0x67, 0x65, 0x74, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62,
+ 0x3d, 0x6e, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x61, 0x2c, 0x22,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x62, 0x3f, 0x62, 0x3a, 0x6e, 0x2e, 0x74, 0x72, 0x69, 0x6d, 0x28,
+ 0x6e, 0x2e, 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0x3d, 0x65, 0x29, 0x26, 0x26, 0x28, 0x6c,
+ 0x2e, 0x6f, 0x70, 0x74, 0x44, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3f, 0x21, 0x63, 0x2e,
+ 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x3d,
+ 0x63, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22,
+ 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x29, 0x29, 0x26, 0x26, 0x28, 0x21, 0x63,
+ 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x61,
+ 0x62, 0x6c, 0x65, 0x64, 0x7c, 0x7c, 0x21, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d,
+ 0x65, 0x28, 0x63, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2c, 0x22,
+ 0x6f, 0x70, 0x74, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x29, 0x29, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x62, 0x3d, 0x6e, 0x28, 0x63, 0x29, 0x2e, 0x76, 0x61, 0x6c, 0x28, 0x29, 0x2c, 0x66, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3b, 0x67, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x62,
+ 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x3d, 0x61, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
+ 0x73, 0x2c, 0x66, 0x3d, 0x6e, 0x2e, 0x6d, 0x61, 0x6b, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28,
+ 0x62, 0x29, 0x2c, 0x67, 0x3d, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x77, 0x68,
+ 0x69, 0x6c, 0x65, 0x28, 0x67, 0x2d, 0x2d, 0x29, 0x69, 0x66, 0x28, 0x64, 0x3d, 0x65, 0x5b, 0x67,
+ 0x5d, 0x2c, 0x6e, 0x2e, 0x69, 0x6e, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x6e, 0x2e, 0x76, 0x61,
+ 0x6c, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x67, 0x65,
+ 0x74, 0x28, 0x64, 0x29, 0x2c, 0x66, 0x29, 0x3e, 0x3d, 0x30, 0x29, 0x74, 0x72, 0x79, 0x7b, 0x64,
+ 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x3d, 0x63, 0x3d, 0x21, 0x30, 0x7d, 0x63,
+ 0x61, 0x74, 0x63, 0x68, 0x28, 0x68, 0x29, 0x7b, 0x64, 0x2e, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c,
+ 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x64, 0x2e, 0x73, 0x65,
+ 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x3d, 0x21, 0x31, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x63, 0x7c, 0x7c, 0x28, 0x61, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x49,
+ 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x2d, 0x31, 0x29, 0x2c, 0x65, 0x7d, 0x7d, 0x7d, 0x7d, 0x29, 0x2c,
+ 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x5b, 0x22, 0x72, 0x61, 0x64, 0x69, 0x6f, 0x22, 0x2c,
+ 0x22, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x62, 0x6f, 0x78, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6e, 0x2e, 0x76, 0x61, 0x6c, 0x48, 0x6f, 0x6f, 0x6b,
+ 0x73, 0x5b, 0x74, 0x68, 0x69, 0x73, 0x5d, 0x3d, 0x7b, 0x73, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x62, 0x29, 0x3f, 0x61,
+ 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x3d, 0x6e, 0x2e, 0x69, 0x6e, 0x41, 0x72, 0x72,
+ 0x61, 0x79, 0x28, 0x6e, 0x28, 0x61, 0x29, 0x2e, 0x76, 0x61, 0x6c, 0x28, 0x29, 0x2c, 0x62, 0x29,
+ 0x3e, 0x2d, 0x31, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x7d, 0x2c, 0x6c, 0x2e, 0x63,
+ 0x68, 0x65, 0x63, 0x6b, 0x4f, 0x6e, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x76, 0x61, 0x6c, 0x48, 0x6f,
+ 0x6f, 0x6b, 0x73, 0x5b, 0x74, 0x68, 0x69, 0x73, 0x5d, 0x2e, 0x67, 0x65, 0x74, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x29, 0x3f,
+ 0x22, 0x6f, 0x6e, 0x22, 0x3a, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x7d, 0x29, 0x7d, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x62, 0x2c, 0x74, 0x62, 0x2c, 0x75, 0x62, 0x3d, 0x6e, 0x2e,
+ 0x65, 0x78, 0x70, 0x72, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x2c,
+ 0x76, 0x62, 0x3d, 0x2f, 0x5e, 0x28, 0x3f, 0x3a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x7c,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x29, 0x24, 0x2f, 0x69, 0x2c, 0x77, 0x62, 0x3d,
+ 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x2c, 0x78, 0x62, 0x3d, 0x6c, 0x2e, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3b, 0x6e, 0x2e, 0x66,
+ 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x61, 0x74, 0x74, 0x72, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x59, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x2e, 0x61, 0x74, 0x74,
+ 0x72, 0x2c, 0x61, 0x2c, 0x62, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x31, 0x29, 0x7d, 0x2c, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x41, 0x74, 0x74, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61,
+ 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6e, 0x2e,
+ 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x61, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64,
+ 0x28, 0x7b, 0x61, 0x74, 0x74, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x2c, 0x66,
+ 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x33,
+ 0x21, 0x3d, 0x3d, 0x66, 0x26, 0x26, 0x38, 0x21, 0x3d, 0x3d, 0x66, 0x26, 0x26, 0x32, 0x21, 0x3d,
+ 0x3d, 0x66, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69,
+ 0x6e, 0x65, 0x64, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x2e, 0x67,
+ 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x3f, 0x6e, 0x2e, 0x70, 0x72,
+ 0x6f, 0x70, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x3a, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x66,
+ 0x26, 0x26, 0x6e, 0x2e, 0x69, 0x73, 0x58, 0x4d, 0x4c, 0x44, 0x6f, 0x63, 0x28, 0x61, 0x29, 0x7c,
+ 0x7c, 0x28, 0x62, 0x3d, 0x62, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73,
+ 0x65, 0x28, 0x29, 0x2c, 0x65, 0x3d, 0x6e, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x48, 0x6f, 0x6f, 0x6b,
+ 0x73, 0x5b, 0x62, 0x5d, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x6d, 0x61,
+ 0x74, 0x63, 0x68, 0x2e, 0x62, 0x6f, 0x6f, 0x6c, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x62, 0x29,
+ 0x3f, 0x74, 0x62, 0x3a, 0x73, 0x62, 0x29, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21,
+ 0x3d, 0x3d, 0x63, 0x3f, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x3d, 0x63, 0x3f, 0x76, 0x6f, 0x69,
+ 0x64, 0x20, 0x6e, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x3a, 0x65, 0x26, 0x26, 0x22, 0x73, 0x65, 0x74, 0x22, 0x69, 0x6e, 0x20, 0x65,
+ 0x26, 0x26, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x28, 0x64, 0x3d, 0x65, 0x2e,
+ 0x73, 0x65, 0x74, 0x28, 0x61, 0x2c, 0x63, 0x2c, 0x62, 0x29, 0x29, 0x3f, 0x64, 0x3a, 0x28, 0x61,
+ 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x62, 0x2c,
+ 0x63, 0x2b, 0x22, 0x22, 0x29, 0x2c, 0x63, 0x29, 0x3a, 0x65, 0x26, 0x26, 0x22, 0x67, 0x65, 0x74,
+ 0x22, 0x69, 0x6e, 0x20, 0x65, 0x26, 0x26, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x3d, 0x28, 0x64,
+ 0x3d, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x29, 0x3f, 0x64, 0x3a, 0x28,
+ 0x64, 0x3d, 0x6e, 0x2e, 0x66, 0x69, 0x6e, 0x64, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x64, 0x3f, 0x76, 0x6f, 0x69, 0x64, 0x20,
+ 0x30, 0x3a, 0x64, 0x29, 0x29, 0x7d, 0x2c, 0x61, 0x74, 0x74, 0x72, 0x48, 0x6f, 0x6f, 0x6b, 0x73,
+ 0x3a, 0x7b, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x7b, 0x73, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x6c, 0x2e,
+ 0x72, 0x61, 0x64, 0x69, 0x6f, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x26, 0x26, 0x22, 0x72, 0x61, 0x64,
+ 0x69, 0x6f, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x28, 0x61, 0x2c, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+ 0x75, 0x74, 0x65, 0x28, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x62, 0x29, 0x2c, 0x63, 0x26,
+ 0x26, 0x28, 0x61, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x63, 0x29, 0x2c, 0x62, 0x7d, 0x7d,
+ 0x7d, 0x7d, 0x2c, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x3d, 0x30, 0x2c, 0x66, 0x3d, 0x62, 0x26, 0x26, 0x62, 0x2e, 0x6d,
+ 0x61, 0x74, 0x63, 0x68, 0x28, 0x47, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x66, 0x26, 0x26, 0x31, 0x3d,
+ 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x77, 0x68, 0x69,
+ 0x6c, 0x65, 0x28, 0x63, 0x3d, 0x66, 0x5b, 0x65, 0x2b, 0x2b, 0x5d, 0x29, 0x64, 0x3d, 0x6e, 0x2e,
+ 0x70, 0x72, 0x6f, 0x70, 0x46, 0x69, 0x78, 0x5b, 0x63, 0x5d, 0x7c, 0x7c, 0x63, 0x2c, 0x6e, 0x2e,
+ 0x65, 0x78, 0x70, 0x72, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x62, 0x6f, 0x6f, 0x6c, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x28, 0x63, 0x29, 0x3f, 0x78, 0x62, 0x26, 0x26, 0x77, 0x62, 0x7c, 0x7c,
+ 0x21, 0x76, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x63, 0x29, 0x3f, 0x61, 0x5b, 0x64, 0x5d,
+ 0x3d, 0x21, 0x31, 0x3a, 0x61, 0x5b, 0x6e, 0x2e, 0x63, 0x61, 0x6d, 0x65, 0x6c, 0x43, 0x61, 0x73,
+ 0x65, 0x28, 0x22, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2d, 0x22, 0x2b, 0x63, 0x29, 0x5d,
+ 0x3d, 0x61, 0x5b, 0x64, 0x5d, 0x3d, 0x21, 0x31, 0x3a, 0x6e, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28,
+ 0x61, 0x2c, 0x63, 0x2c, 0x22, 0x22, 0x29, 0x2c, 0x61, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65,
+ 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x77, 0x62, 0x3f, 0x63, 0x3a, 0x64,
+ 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x74, 0x62, 0x3d, 0x7b, 0x73, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x3f, 0x6e, 0x2e, 0x72, 0x65, 0x6d,
+ 0x6f, 0x76, 0x65, 0x41, 0x74, 0x74, 0x72, 0x28, 0x61, 0x2c, 0x63, 0x29, 0x3a, 0x78, 0x62, 0x26,
+ 0x26, 0x77, 0x62, 0x7c, 0x7c, 0x21, 0x76, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x63, 0x29,
+ 0x3f, 0x61, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28,
+ 0x21, 0x77, 0x62, 0x26, 0x26, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x46, 0x69, 0x78, 0x5b, 0x63,
+ 0x5d, 0x7c, 0x7c, 0x63, 0x2c, 0x63, 0x29, 0x3a, 0x61, 0x5b, 0x6e, 0x2e, 0x63, 0x61, 0x6d, 0x65,
+ 0x6c, 0x43, 0x61, 0x73, 0x65, 0x28, 0x22, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2d, 0x22,
+ 0x2b, 0x63, 0x29, 0x5d, 0x3d, 0x61, 0x5b, 0x63, 0x5d, 0x3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 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d,
+ 0x65, 0x28, 0x61, 0x2c, 0x22, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x22, 0x29, 0x3f, 0x76, 0x6f, 0x69,
+ 0x64, 0x28, 0x61, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65,
+ 0x3d, 0x62, 0x29, 0x3a, 0x73, 0x62, 0x26, 0x26, 0x73, 0x62, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x77, 0x62, 0x7c, 0x7c, 0x28, 0x73, 0x62,
+ 0x3d, 0x7b, 0x73, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x61, 0x2e, 0x67, 0x65,
+ 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x63,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x7c, 0x7c, 0x61, 0x2e, 0x73, 0x65,
+ 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x64,
+ 0x3d, 0x61, 0x2e, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x28, 0x63, 0x29, 0x29, 0x2c, 0x64, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x62, 0x2b, 0x3d,
+ 0x22, 0x22, 0x2c, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x7c, 0x7c,
+ 0x62, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+ 0x74, 0x65, 0x28, 0x63, 0x29, 0x3f, 0x62, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x7d,
+ 0x2c, 0x75, 0x62, 0x2e, 0x69, 0x64, 0x3d, 0x75, 0x62, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75,
+ 0x62, 0x2e, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3f, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3a, 0x28,
+ 0x64, 0x3d, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
+ 0x4e, 0x6f, 0x64, 0x65, 0x28, 0x62, 0x29, 0x29, 0x26, 0x26, 0x22, 0x22, 0x21, 0x3d, 0x3d, 0x64,
+ 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3f, 0x64, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x7d, 0x2c, 0x6e, 0x2e, 0x76, 0x61, 0x6c, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x2e,
+ 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x3d, 0x7b, 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d,
+ 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x4e, 0x6f,
+ 0x64, 0x65, 0x28, 0x62, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x26, 0x26,
+ 0x63, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3f, 0x63, 0x2e, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x3a,
+ 0x73, 0x62, 0x2e, 0x73, 0x65, 0x74, 0x7d, 0x2c, 0x6e, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x48, 0x6f,
+ 0x6f, 0x6b, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x69, 0x74, 0x61,
+ 0x62, 0x6c, 0x65, 0x3d, 0x7b, 0x73, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x73, 0x62, 0x2e, 0x73, 0x65, 0x74, 0x28,
+ 0x61, 0x2c, 0x22, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x21, 0x31, 0x3a, 0x62, 0x2c, 0x63, 0x29,
+ 0x7d, 0x7d, 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x5b, 0x22, 0x77, 0x69, 0x64, 0x74,
+ 0x68, 0x22, 0x2c, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x6e, 0x2e, 0x61, 0x74, 0x74,
+ 0x72, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x5b, 0x62, 0x5d, 0x3d, 0x7b, 0x73, 0x65, 0x74, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x22, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x3f, 0x28, 0x61, 0x2e, 0x73, 0x65, 0x74,
+ 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x62, 0x2c, 0x22, 0x61, 0x75, 0x74,
+ 0x6f, 0x22, 0x29, 0x2c, 0x63, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x7d, 0x7d,
+ 0x29, 0x29, 0x2c, 0x6c, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x61,
+ 0x74, 0x74, 0x72, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3d, 0x7b,
+ 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x63,
+ 0x73, 0x73, 0x54, 0x65, 0x78, 0x74, 0x7c, 0x7c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x2c,
+ 0x73, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65,
+ 0x2e, 0x63, 0x73, 0x73, 0x54, 0x65, 0x78, 0x74, 0x3d, 0x62, 0x2b, 0x22, 0x22, 0x7d, 0x7d, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x79, 0x62, 0x3d, 0x2f, 0x5e, 0x28, 0x3f, 0x3a, 0x69, 0x6e, 0x70,
+ 0x75, 0x74, 0x7c, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x7c, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72,
+ 0x65, 0x61, 0x7c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x7c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x29, 0x24, 0x2f, 0x69, 0x2c, 0x7a, 0x62, 0x3d, 0x2f, 0x5e, 0x28, 0x3f, 0x3a, 0x61, 0x7c, 0x61,
+ 0x72, 0x65, 0x61, 0x29, 0x24, 0x2f, 0x69, 0x3b, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74,
+ 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x59,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x2c, 0x61, 0x2c, 0x62,
+ 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3e, 0x31, 0x29, 0x7d, 0x2c, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x70,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x46, 0x69, 0x78, 0x5b,
+ 0x61, 0x5d, 0x7c, 0x7c, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x72, 0x79, 0x7b, 0x74,
+ 0x68, 0x69, 0x73, 0x5b, 0x61, 0x5d, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x2c, 0x64, 0x65,
+ 0x6c, 0x65, 0x74, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x61, 0x5d, 0x7d, 0x63, 0x61, 0x74,
+ 0x63, 0x68, 0x28, 0x62, 0x29, 0x7b, 0x7d, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65,
+ 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65,
+ 0x3b, 0x69, 0x66, 0x28, 0x33, 0x21, 0x3d, 0x3d, 0x66, 0x26, 0x26, 0x38, 0x21, 0x3d, 0x3d, 0x66,
+ 0x26, 0x26, 0x32, 0x21, 0x3d, 0x3d, 0x66, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31,
+ 0x3d, 0x3d, 0x3d, 0x66, 0x26, 0x26, 0x6e, 0x2e, 0x69, 0x73, 0x58, 0x4d, 0x4c, 0x44, 0x6f, 0x63,
+ 0x28, 0x61, 0x29, 0x7c, 0x7c, 0x28, 0x62, 0x3d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x46, 0x69,
+ 0x78, 0x5b, 0x62, 0x5d, 0x7c, 0x7c, 0x62, 0x2c, 0x65, 0x3d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x70,
+ 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x5b, 0x62, 0x5d, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30,
+ 0x21, 0x3d, 0x3d, 0x63, 0x3f, 0x65, 0x26, 0x26, 0x22, 0x73, 0x65, 0x74, 0x22, 0x69, 0x6e, 0x20,
+ 0x65, 0x26, 0x26, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x28, 0x64, 0x3d, 0x65,
+ 0x2e, 0x73, 0x65, 0x74, 0x28, 0x61, 0x2c, 0x63, 0x2c, 0x62, 0x29, 0x29, 0x3f, 0x64, 0x3a, 0x61,
+ 0x5b, 0x62, 0x5d, 0x3d, 0x63, 0x3a, 0x65, 0x26, 0x26, 0x22, 0x67, 0x65, 0x74, 0x22, 0x69, 0x6e,
+ 0x20, 0x65, 0x26, 0x26, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x3d, 0x28, 0x64, 0x3d, 0x65, 0x2e,
+ 0x67, 0x65, 0x74, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x29, 0x3f, 0x64, 0x3a, 0x61, 0x5b, 0x62, 0x5d,
+ 0x7d, 0x2c, 0x70, 0x72, 0x6f, 0x70, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x7b, 0x74, 0x61, 0x62,
+ 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x7b, 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6e, 0x2e, 0x66,
+ 0x69, 0x6e, 0x64, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x61, 0x2c, 0x22, 0x74, 0x61, 0x62, 0x69,
+ 0x6e, 0x64, 0x65, 0x78, 0x22, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3f,
+ 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28, 0x62, 0x2c, 0x31, 0x30, 0x29, 0x3a, 0x79,
+ 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d,
+ 0x65, 0x29, 0x7c, 0x7c, 0x7a, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x2e, 0x6e, 0x6f,
+ 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x26, 0x26, 0x61, 0x2e, 0x68, 0x72, 0x65, 0x66, 0x3f,
+ 0x30, 0x3a, 0x2d, 0x31, 0x7d, 0x7d, 0x7d, 0x2c, 0x70, 0x72, 0x6f, 0x70, 0x46, 0x69, 0x78, 0x3a,
+ 0x7b, 0x22, 0x66, 0x6f, 0x72, 0x22, 0x3a, 0x22, 0x68, 0x74, 0x6d, 0x6c, 0x46, 0x6f, 0x72, 0x22,
+ 0x2c, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x3a, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e,
+ 0x61, 0x6d, 0x65, 0x22, 0x7d, 0x7d, 0x29, 0x2c, 0x6c, 0x2e, 0x68, 0x72, 0x65, 0x66, 0x4e, 0x6f,
+ 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x7c, 0x7c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x5b, 0x22, 0x68, 0x72, 0x65, 0x66, 0x22, 0x2c, 0x22, 0x73, 0x72, 0x63, 0x22, 0x5d, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x6e, 0x2e,
+ 0x70, 0x72, 0x6f, 0x70, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x5b, 0x62, 0x5d, 0x3d, 0x7b, 0x67, 0x65,
+ 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62,
+ 0x75, 0x74, 0x65, 0x28, 0x62, 0x2c, 0x34, 0x29, 0x7d, 0x7d, 0x7d, 0x29, 0x2c, 0x6c, 0x2e, 0x6f,
+ 0x70, 0x74, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x70,
+ 0x72, 0x6f, 0x70, 0x48, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65,
+ 0x64, 0x3d, 0x7b, 0x67, 0x65, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x26, 0x26,
+ 0x28, 0x62, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78,
+ 0x2c, 0x62, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x26, 0x26, 0x62,
+ 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x65, 0x64, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x7d,
+ 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x5b, 0x22, 0x74, 0x61, 0x62, 0x49,
+ 0x6e, 0x64, 0x65, 0x78, 0x22, 0x2c, 0x22, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x6e, 0x6c, 0x79, 0x22,
+ 0x2c, 0x22, 0x6d, 0x61, 0x78, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x22, 0x2c, 0x22, 0x63, 0x65,
+ 0x6c, 0x6c, 0x53, 0x70, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x22, 0x63, 0x65, 0x6c, 0x6c,
+ 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x22, 0x72, 0x6f, 0x77, 0x53, 0x70, 0x61,
+ 0x6e, 0x22, 0x2c, 0x22, 0x63, 0x6f, 0x6c, 0x53, 0x70, 0x61, 0x6e, 0x22, 0x2c, 0x22, 0x75, 0x73,
+ 0x65, 0x4d, 0x61, 0x70, 0x22, 0x2c, 0x22, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x42, 0x6f, 0x72, 0x64,
+ 0x65, 0x72, 0x22, 0x2c, 0x22, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x64, 0x69, 0x74,
+ 0x61, 0x62, 0x6c, 0x65, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x46, 0x69, 0x78, 0x5b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x5d, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x7d, 0x29, 0x2c, 0x6c, 0x2e, 0x65, 0x6e, 0x63, 0x74, 0x79, 0x70, 0x65,
+ 0x7c, 0x7c, 0x28, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x46, 0x69, 0x78, 0x2e, 0x65, 0x6e, 0x63,
+ 0x74, 0x79, 0x70, 0x65, 0x3d, 0x22, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x22, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x41, 0x62, 0x3d, 0x2f, 0x5b, 0x5c, 0x74, 0x5c, 0x72, 0x5c, 0x6e,
+ 0x5c, 0x66, 0x5d, 0x2f, 0x67, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x42,
+ 0x62, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x61, 0x74,
+ 0x74, 0x72, 0x28, 0x61, 0x2c, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x29, 0x7c, 0x7c, 0x22,
+ 0x22, 0x7d, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x61,
+ 0x64, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c,
+ 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x2c, 0x69, 0x3d, 0x30, 0x3b, 0x69, 0x66, 0x28, 0x6e, 0x2e, 0x69,
+ 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x2e, 0x61, 0x64, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x28, 0x61, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x62, 0x2c, 0x42, 0x62, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x29, 0x29, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x26, 0x26, 0x61, 0x29, 0x7b,
+ 0x62, 0x3d, 0x61, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x47, 0x29, 0x7c, 0x7c, 0x5b, 0x5d,
+ 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x69, 0x2b,
+ 0x2b, 0x5d, 0x29, 0x69, 0x66, 0x28, 0x65, 0x3d, 0x42, 0x62, 0x28, 0x63, 0x29, 0x2c, 0x64, 0x3d,
+ 0x31, 0x3d, 0x3d, 0x3d, 0x63, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26,
+ 0x28, 0x22, 0x20, 0x22, 0x2b, 0x65, 0x2b, 0x22, 0x20, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c,
+ 0x61, 0x63, 0x65, 0x28, 0x41, 0x62, 0x2c, 0x22, 0x20, 0x22, 0x29, 0x29, 0x7b, 0x67, 0x3d, 0x30,
+ 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x3d, 0x62, 0x5b, 0x67, 0x2b, 0x2b, 0x5d, 0x29,
+ 0x64, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28, 0x22, 0x20, 0x22, 0x2b, 0x66, 0x2b,
+ 0x22, 0x20, 0x22, 0x29, 0x3c, 0x30, 0x26, 0x26, 0x28, 0x64, 0x2b, 0x3d, 0x66, 0x2b, 0x22, 0x20,
+ 0x22, 0x29, 0x3b, 0x68, 0x3d, 0x6e, 0x2e, 0x74, 0x72, 0x69, 0x6d, 0x28, 0x64, 0x29, 0x2c, 0x65,
+ 0x21, 0x3d, 0x3d, 0x68, 0x26, 0x26, 0x6e, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x63, 0x2c, 0x22,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x68, 0x29, 0x7d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6c,
+ 0x61, 0x73, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c,
+ 0x68, 0x2c, 0x69, 0x3d, 0x30, 0x3b, 0x69, 0x66, 0x28, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x72, 0x65,
+ 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x28, 0x61, 0x2e, 0x63, 0x61, 0x6c, 0x6c,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x62, 0x2c, 0x42, 0x62, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29,
+ 0x29, 0x29, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73,
+ 0x73, 0x22, 0x2c, 0x22, 0x22, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e,
+ 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x26, 0x26, 0x61, 0x29,
+ 0x7b, 0x62, 0x3d, 0x61, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x47, 0x29, 0x7c, 0x7c, 0x5b,
+ 0x5d, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x69,
+ 0x2b, 0x2b, 0x5d, 0x29, 0x69, 0x66, 0x28, 0x65, 0x3d, 0x42, 0x62, 0x28, 0x63, 0x29, 0x2c, 0x64,
+ 0x3d, 0x31, 0x3d, 0x3d, 0x3d, 0x63, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26,
+ 0x26, 0x28, 0x22, 0x20, 0x22, 0x2b, 0x65, 0x2b, 0x22, 0x20, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70,
+ 0x6c, 0x61, 0x63, 0x65, 0x28, 0x41, 0x62, 0x2c, 0x22, 0x20, 0x22, 0x29, 0x29, 0x7b, 0x67, 0x3d,
+ 0x30, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x66, 0x3d, 0x62, 0x5b, 0x67, 0x2b, 0x2b, 0x5d,
+ 0x29, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x64, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66,
+ 0x28, 0x22, 0x20, 0x22, 0x2b, 0x66, 0x2b, 0x22, 0x20, 0x22, 0x29, 0x3e, 0x2d, 0x31, 0x29, 0x64,
+ 0x3d, 0x64, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x22, 0x20, 0x22, 0x2b, 0x66,
+ 0x2b, 0x22, 0x20, 0x22, 0x2c, 0x22, 0x20, 0x22, 0x29, 0x3b, 0x68, 0x3d, 0x6e, 0x2e, 0x74, 0x72,
+ 0x69, 0x6d, 0x28, 0x64, 0x29, 0x2c, 0x65, 0x21, 0x3d, 0x3d, 0x68, 0x26, 0x26, 0x6e, 0x2e, 0x61,
+ 0x74, 0x74, 0x72, 0x28, 0x63, 0x2c, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x68, 0x29,
+ 0x7d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x74,
+ 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x62,
+ 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20,
+ 0x62, 0x26, 0x26, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x3f,
+ 0x62, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x28,
+ 0x61, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6c,
+ 0x61, 0x73, 0x73, 0x28, 0x61, 0x29, 0x3a, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x7b, 0x6e, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x29, 0x2e, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73,
+ 0x28, 0x61, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x63, 0x2c, 0x42,
+ 0x62, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x62, 0x29, 0x2c, 0x62, 0x29, 0x7d, 0x29, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66,
+ 0x3b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x3d, 0x63,
+ 0x29, 0x7b, 0x64, 0x3d, 0x30, 0x2c, 0x65, 0x3d, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c,
+ 0x66, 0x3d, 0x61, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x47, 0x29, 0x7c, 0x7c, 0x5b, 0x5d,
+ 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x62, 0x3d, 0x66, 0x5b, 0x64, 0x2b, 0x2b, 0x5d, 0x29,
+ 0x65, 0x2e, 0x68, 0x61, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x28, 0x62, 0x29, 0x3f, 0x65, 0x2e,
+ 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x28, 0x62, 0x29, 0x3a, 0x65,
+ 0x2e, 0x61, 0x64, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x28, 0x62, 0x29, 0x7d, 0x65, 0x6c, 0x73,
+ 0x65, 0x28, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x7c, 0x7c, 0x22, 0x62,
+ 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x22, 0x3d, 0x3d, 0x3d, 0x63, 0x29, 0x26, 0x26, 0x28, 0x62,
+ 0x3d, 0x42, 0x62, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x62, 0x26, 0x26, 0x6e, 0x2e, 0x5f,
+ 0x64, 0x61, 0x74, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x5f, 0x5f, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x5f, 0x5f, 0x22, 0x2c, 0x62, 0x29, 0x2c, 0x6e, 0x2e, 0x61,
+ 0x74, 0x74, 0x72, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22,
+ 0x2c, 0x62, 0x7c, 0x7c, 0x61, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x3f, 0x22, 0x22, 0x3a, 0x6e, 0x2e,
+ 0x5f, 0x64, 0x61, 0x74, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x5f, 0x5f, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x5f, 0x5f, 0x22, 0x29, 0x7c, 0x7c, 0x22, 0x22, 0x29,
+ 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x68, 0x61, 0x73, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c,
+ 0x63, 0x2c, 0x64, 0x3d, 0x30, 0x3b, 0x62, 0x3d, 0x22, 0x20, 0x22, 0x2b, 0x61, 0x2b, 0x22, 0x20,
+ 0x22, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x64,
+ 0x2b, 0x2b, 0x5d, 0x29, 0x69, 0x66, 0x28, 0x31, 0x3d, 0x3d, 0x3d, 0x63, 0x2e, 0x6e, 0x6f, 0x64,
+ 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x28, 0x22, 0x20, 0x22, 0x2b, 0x42, 0x62, 0x28, 0x63,
+ 0x29, 0x2b, 0x22, 0x20, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x41,
+ 0x62, 0x2c, 0x22, 0x20, 0x22, 0x29, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28, 0x62,
+ 0x29, 0x3e, 0x2d, 0x31, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x30, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x21, 0x31, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x22, 0x62, 0x6c, 0x75, 0x72, 0x20, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x20, 0x66, 0x6f, 0x63,
+ 0x75, 0x73, 0x69, 0x6e, 0x20, 0x66, 0x6f, 0x63, 0x75, 0x73, 0x6f, 0x75, 0x74, 0x20, 0x6c, 0x6f,
+ 0x61, 0x64, 0x20, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c,
+ 0x20, 0x75, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x20, 0x64, 0x62,
+ 0x6c, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e,
+ 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x75, 0x70, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f,
+ 0x76, 0x65, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x6d, 0x6f, 0x75,
+ 0x73, 0x65, 0x6f, 0x75, 0x74, 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x65, 0x6e, 0x74, 0x65, 0x72,
+ 0x20, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6c, 0x65, 0x61, 0x76, 0x65, 0x20, 0x63, 0x68, 0x61, 0x6e,
+ 0x67, 0x65, 0x20, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x20, 0x73, 0x75, 0x62, 0x6d, 0x69, 0x74,
+ 0x20, 0x6b, 0x65, 0x79, 0x64, 0x6f, 0x77, 0x6e, 0x20, 0x6b, 0x65, 0x79, 0x70, 0x72, 0x65, 0x73,
+ 0x73, 0x20, 0x6b, 0x65, 0x79, 0x75, 0x70, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x63, 0x6f,
+ 0x6e, 0x74, 0x65, 0x78, 0x74, 0x6d, 0x65, 0x6e, 0x75, 0x22, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74,
+ 0x28, 0x22, 0x20, 0x22, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x6e, 0x2e, 0x66, 0x6e, 0x5b, 0x62, 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3e, 0x30, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x2c, 0x61, 0x2c, 0x63, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x72, 0x69,
+ 0x67, 0x67, 0x65, 0x72, 0x28, 0x62, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x66, 0x6e, 0x2e,
+ 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0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 0x26, 0x62, 0x26, 0x26, 0x28, 0x64, 0x3d, 0x30, 0x29, 0x2c, 0x30,
+ 0x3d, 0x3d, 0x3d, 0x64, 0x3f, 0x61, 0x3a, 0x28, 0x63, 0x3d, 0x65, 0x7c, 0x7c, 0x62, 0x2c, 0x64,
+ 0x2b, 0x3d, 0x21, 0x66, 0x2d, 0x21, 0x65, 0x2c, 0x22, 0x22, 0x29, 0x7d, 0x29, 0x29, 0x3f, 0x46,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x22, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x22, 0x2b, 0x65, 0x29, 0x28, 0x29, 0x3a, 0x6e, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22,
+ 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x3a, 0x20, 0x22, 0x2b,
+ 0x62, 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x58, 0x4d, 0x4c, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63,
+ 0x2c, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x62, 0x7c, 0x7c, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e,
+ 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x61, 0x2e, 0x44,
+ 0x4f, 0x4d, 0x50, 0x61, 0x72, 0x73, 0x65, 0x72, 0x3f, 0x28, 0x64, 0x3d, 0x6e, 0x65, 0x77, 0x20,
+ 0x61, 0x2e, 0x44, 0x4f, 0x4d, 0x50, 0x61, 0x72, 0x73, 0x65, 0x72, 0x2c, 0x63, 0x3d, 0x64, 0x2e,
+ 0x70, 0x61, 0x72, 0x73, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28,
+ 0x62, 0x2c, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x78, 0x6d, 0x6c, 0x22, 0x29, 0x29, 0x3a, 0x28,
+ 0x63, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x61, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x58, 0x4f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x28, 0x22, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74,
+ 0x2e, 0x58, 0x4d, 0x4c, 0x44, 0x4f, 0x4d, 0x22, 0x29, 0x2c, 0x63, 0x2e, 0x61, 0x73, 0x79, 0x6e,
+ 0x63, 0x3d, 0x22, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x22, 0x2c, 0x63, 0x2e, 0x6c, 0x6f, 0x61, 0x64,
+ 0x58, 0x4d, 0x4c, 0x28, 0x62, 0x29, 0x29, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x65, 0x29,
+ 0x7b, 0x63, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x63, 0x26, 0x26, 0x63, 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x26, 0x26, 0x21, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 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x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x62, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x21, 0x3d, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x26, 0x26, 0x28, 0x63, 0x3d, 0x62, 0x2c, 0x62, 0x3d,
+ 0x22, 0x2a, 0x22, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x3d, 0x30, 0x2c, 0x66,
+ 0x3d, 0x62, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29,
+ 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x47, 0x29, 0x7c, 0x7c, 0x5b, 0x5d, 0x3b, 0x69, 0x66,
+ 0x28, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29,
+ 0x29, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x64, 0x3d, 0x66, 0x5b, 0x65, 0x2b, 0x2b, 0x5d, 0x29,
+ 0x22, 0x2b, 0x22, 0x3d, 0x3d, 0x3d, 0x64, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x41, 0x74, 0x28, 0x30,
+ 0x29, 0x3f, 0x28, 0x64, 0x3d, 0x64, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x31, 0x29, 0x7c,
+ 0x7c, 0x22, 0x2a, 0x22, 0x2c, 0x28, 0x61, 0x5b, 0x64, 0x5d, 0x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 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6a, 0x7c, 0x7c, 0x66, 0x7c, 0x7c, 0x65, 0x5b,
+ 0x6a, 0x5d, 0x3f, 0x66, 0x3f, 0x21, 0x28, 0x69, 0x3d, 0x6a, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x3a, 0x28, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x2e,
+ 0x75, 0x6e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x6a, 0x29, 0x2c, 0x67, 0x28, 0x6a, 0x29, 0x2c,
+ 0x21, 0x31, 0x29, 0x7d, 0x29, 0x2c, 0x69, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67,
+ 0x28, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x29,
+ 0x7c, 0x7c, 0x21, 0x65, 0x5b, 0x22, 0x2a, 0x22, 0x5d, 0x26, 0x26, 0x67, 0x28, 0x22, 0x2a, 0x22,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x55, 0x62, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x3d, 0x6e, 0x2e, 0x61,
+ 0x6a, 0x61, 0x78, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x74,
+ 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x66, 0x6f, 0x72, 0x28,
+ 0x64, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x29, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d,
+ 0x62, 0x5b, 0x64, 0x5d, 0x26, 0x26, 0x28, 0x28, 0x65, 0x5b, 0x64, 0x5d, 0x3f, 0x61, 0x3a, 0x63,
+ 0x7c, 0x7c, 0x28, 0x63, 0x3d, 0x7b, 0x7d, 0x29, 0x29, 0x5b, 0x64, 0x5d, 0x3d, 0x62, 0x5b, 0x64,
+ 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x26, 0x26, 0x6e, 0x2e, 0x65,
+ 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x21, 0x30, 0x2c, 0x61, 0x2c, 0x63, 0x29, 0x2c, 0x61, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x56, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c,
+ 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68,
+ 0x3d, 0x61, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x69, 0x3d, 0x61, 0x2e,
+ 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28,
+ 0x22, 0x2a, 0x22, 0x3d, 0x3d, 0x3d, 0x69, 0x5b, 0x30, 0x5d, 0x29, 0x69, 0x2e, 0x73, 0x68, 0x69,
+ 0x66, 0x74, 0x28, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x65, 0x26,
+ 0x26, 0x28, 0x65, 0x3d, 0x61, 0x2e, 0x6d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x7c, 0x7c,
+ 0x62, 0x2e, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61,
+ 0x64, 0x65, 0x72, 0x28, 0x22, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70,
+ 0x65, 0x22, 0x29, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x65, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x67, 0x20,
+ 0x69, 0x6e, 0x20, 0x68, 0x29, 0x69, 0x66, 0x28, 0x68, 0x5b, 0x67, 0x5d, 0x26, 0x26, 0x68, 0x5b,
+ 0x67, 0x5d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x65, 0x29, 0x29, 0x7b, 0x69, 0x2e, 0x75, 0x6e,
+ 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x67, 0x29, 0x3b, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x7d, 0x69,
+ 0x66, 0x28, 0x69, 0x5b, 0x30, 0x5d, 0x69, 0x6e, 0x20, 0x63, 0x29, 0x66, 0x3d, 0x69, 0x5b, 0x30,
+ 0x5d, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x67, 0x20, 0x69, 0x6e, 0x20,
+ 0x63, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x69, 0x5b, 0x30, 0x5d, 0x7c, 0x7c, 0x61, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x65, 0x72, 0x73, 0x5b, 0x67, 0x2b, 0x22, 0x20, 0x22, 0x2b,
+ 0x69, 0x5b, 0x30, 0x5d, 0x5d, 0x29, 0x7b, 0x66, 0x3d, 0x67, 0x3b, 0x62, 0x72, 0x65, 0x61, 0x6b,
+ 0x7d, 0x64, 0x7c, 0x7c, 0x28, 0x64, 0x3d, 0x67, 0x29, 0x7d, 0x66, 0x3d, 0x66, 0x7c, 0x7c, 0x64,
+ 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x3f, 0x28, 0x66, 0x21, 0x3d, 0x3d, 0x69,
+ 0x5b, 0x30, 0x5d, 0x26, 0x26, 0x69, 0x2e, 0x75, 0x6e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x66,
+ 0x29, 0x2c, 0x63, 0x5b, 0x66, 0x5d, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x57, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63,
+ 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x2c,
+ 0x69, 0x2c, 0x6a, 0x3d, 0x7b, 0x7d, 0x2c, 0x6b, 0x3d, 0x61, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x54,
+ 0x79, 0x70, 0x65, 0x73, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x29, 0x3b, 0x69, 0x66, 0x28,
+ 0x6b, 0x5b, 0x31, 0x5d, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x67, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x65, 0x72, 0x73, 0x29, 0x6a, 0x5b, 0x67, 0x2e, 0x74,
+ 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x5d, 0x3d, 0x61, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x65, 0x72, 0x73, 0x5b, 0x67, 0x5d, 0x3b, 0x66, 0x3d,
+ 0x6b, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28,
+ 0x66, 0x29, 0x69, 0x66, 0x28, 0x61, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46,
+ 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5b, 0x66, 0x5d, 0x26, 0x26, 0x28, 0x63, 0x5b, 0x61, 0x2e, 0x72,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5b, 0x66, 0x5d,
+ 0x5d, 0x3d, 0x62, 0x29, 0x2c, 0x21, 0x69, 0x26, 0x26, 0x64, 0x26, 0x26, 0x61, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x61, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x62, 0x2c, 0x61, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x29, 0x29, 0x2c, 0x69, 0x3d, 0x66, 0x2c, 0x66, 0x3d, 0x6b,
+ 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x29, 0x69, 0x66, 0x28, 0x22, 0x2a, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x66, 0x29, 0x66, 0x3d, 0x69, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28,
+ 0x22, 0x2a, 0x22, 0x21, 0x3d, 0x3d, 0x69, 0x26, 0x26, 0x69, 0x21, 0x3d, 0x3d, 0x66, 0x29, 0x7b,
+ 0x69, 0x66, 0x28, 0x67, 0x3d, 0x6a, 0x5b, 0x69, 0x2b, 0x22, 0x20, 0x22, 0x2b, 0x66, 0x5d, 0x7c,
+ 0x7c, 0x6a, 0x5b, 0x22, 0x2a, 0x20, 0x22, 0x2b, 0x66, 0x5d, 0x2c, 0x21, 0x67, 0x29, 0x66, 0x6f,
+ 0x72, 0x28, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x6a, 0x29, 0x69, 0x66, 0x28, 0x68, 0x3d, 0x65, 0x2e,
+ 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x22, 0x20, 0x22, 0x29, 0x2c, 0x68, 0x5b, 0x31, 0x5d, 0x3d,
+ 0x3d, 0x3d, 0x66, 0x26, 0x26, 0x28, 0x67, 0x3d, 0x6a, 0x5b, 0x69, 0x2b, 0x22, 0x20, 0x22, 0x2b,
+ 0x68, 0x5b, 0x30, 0x5d, 0x5d, 0x7c, 0x7c, 0x6a, 0x5b, 0x22, 0x2a, 0x20, 0x22, 0x2b, 0x68, 0x5b,
+ 0x30, 0x5d, 0x5d, 0x29, 0x29, 0x7b, 0x67, 0x3d, 0x3d, 0x3d, 0x21, 0x30, 0x3f, 0x67, 0x3d, 0x6a,
+ 0x5b, 0x65, 0x5d, 0x3a, 0x6a, 0x5b, 0x65, 0x5d, 0x21, 0x3d, 0x3d, 0x21, 0x30, 0x26, 0x26, 0x28,
+ 0x66, 0x3d, 0x68, 0x5b, 0x30, 0x5d, 0x2c, 0x6b, 0x2e, 0x75, 0x6e, 0x73, 0x68, 0x69, 0x66, 0x74,
+ 0x28, 0x68, 0x5b, 0x31, 0x5d, 0x29, 0x29, 0x3b, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x7d, 0x69, 0x66,
+ 0x28, 0x67, 0x21, 0x3d, 0x3d, 0x21, 0x30, 0x29, 0x69, 0x66, 0x28, 0x67, 0x26, 0x26, 0x61, 0x5b,
+ 0x22, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x5d, 0x29, 0x62, 0x3d, 0x67, 0x28, 0x62, 0x29,
+ 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x74, 0x72, 0x79, 0x7b, 0x62, 0x3d, 0x67, 0x28, 0x62, 0x29,
+ 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x6c, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x7b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x22, 0x70, 0x61, 0x72, 0x73, 0x65, 0x72, 0x65, 0x72,
+ 0x72, 0x6f, 0x72, 0x22, 0x2c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x67, 0x3f, 0x6c, 0x3a, 0x22,
+ 0x4e, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x72,
+ 0x6f, 0x6d, 0x20, 0x22, 0x2b, 0x69, 0x2b, 0x22, 0x20, 0x74, 0x6f, 0x20, 0x22, 0x2b, 0x66, 0x7d,
+ 0x7d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x22,
+ 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x62, 0x7d,
+ 0x7d, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x61, 0x63, 0x74, 0x69, 0x76,
+ 0x65, 0x3a, 0x30, 0x2c, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64,
+ 0x3a, 0x7b, 0x7d, 0x2c, 0x65, 0x74, 0x61, 0x67, 0x3a, 0x7b, 0x7d, 0x2c, 0x61, 0x6a, 0x61, 0x78,
+ 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x3a, 0x7b, 0x75, 0x72, 0x6c, 0x3a, 0x51, 0x62,
+ 0x2c, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x47, 0x45, 0x54, 0x22, 0x2c, 0x69, 0x73, 0x4c, 0x6f,
+ 0x63, 0x61, 0x6c, 0x3a, 0x4a, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x52, 0x62, 0x5b, 0x31,
+ 0x5d, 0x29, 0x2c, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x3a, 0x21, 0x30, 0x2c, 0x70, 0x72, 0x6f,
+ 0x63, 0x65, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x21, 0x30, 0x2c, 0x61, 0x73, 0x79, 0x6e,
+ 0x63, 0x3a, 0x21, 0x30, 0x2c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65,
+ 0x3a, 0x22, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d,
+ 0x77, 0x77, 0x77, 0x2d, 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x75, 0x72, 0x6c, 0x65, 0x6e, 0x63, 0x6f,
+ 0x64, 0x65, 0x64, 0x3b, 0x20, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x3d, 0x55, 0x54, 0x46,
+ 0x2d, 0x38, 0x22, 0x2c, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x73, 0x3a, 0x7b, 0x22, 0x2a, 0x22,
+ 0x3a, 0x50, 0x62, 0x2c, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70,
+ 0x6c, 0x61, 0x69, 0x6e, 0x22, 0x2c, 0x68, 0x74, 0x6d, 0x6c, 0x3a, 0x22, 0x74, 0x65, 0x78, 0x74,
+ 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x2c, 0x78, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x70, 0x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0x22, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x4a, 0x53, 0x4f, 0x4e,
+ 0x22, 0x7d, 0x2c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x7b, 0x22,
+ 0x2a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x22, 0x3a, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x22,
+ 0x74, 0x65, 0x78, 0x74, 0x20, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x3a, 0x21, 0x30, 0x2c, 0x22, 0x74,
+ 0x65, 0x78, 0x74, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x22, 0x3a, 0x6e, 0x2e, 0x70, 0x61, 0x72, 0x73,
+ 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x2c, 0x22, 0x74, 0x65, 0x78, 0x74, 0x20, 0x78, 0x6d, 0x6c, 0x22,
+ 0x3a, 0x6e, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x58, 0x4d, 0x4c, 0x7d, 0x2c, 0x66, 0x6c, 0x61,
+ 0x74, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x7b, 0x75, 0x72, 0x6c, 0x3a, 0x21, 0x30,
+ 0x2c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x3a, 0x21, 0x30, 0x7d, 0x7d, 0x2c, 0x61, 0x6a,
+ 0x61, 0x78, 0x53, 0x65, 0x74, 0x75, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3f, 0x55,
+ 0x62, 0x28, 0x55, 0x62, 0x28, 0x61, 0x2c, 0x6e, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x65, 0x74,
+ 0x74, 0x69, 0x6e, 0x67, 0x73, 0x29, 0x2c, 0x62, 0x29, 0x3a, 0x55, 0x62, 0x28, 0x6e, 0x2e, 0x61,
+ 0x6a, 0x61, 0x78, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2c, 0x61, 0x29, 0x7d, 0x2c,
+ 0x61, 0x6a, 0x61, 0x78, 0x50, 0x72, 0x65, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x3a, 0x53, 0x62,
+ 0x28, 0x4e, 0x62, 0x29, 0x2c, 0x61, 0x6a, 0x61, 0x78, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f,
+ 0x72, 0x74, 0x3a, 0x53, 0x62, 0x28, 0x4f, 0x62, 0x29, 0x2c, 0x61, 0x6a, 0x61, 0x78, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x22, 0x6f, 0x62,
+ 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x26,
+ 0x26, 0x28, 0x63, 0x3d, 0x62, 0x2c, 0x62, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x29, 0x2c,
+ 0x63, 0x3d, 0x63, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x2c,
+ 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x2c, 0x69, 0x2c, 0x6a, 0x2c, 0x6b, 0x2c, 0x6c, 0x3d, 0x6e, 0x2e,
+ 0x61, 0x6a, 0x61, 0x78, 0x53, 0x65, 0x74, 0x75, 0x70, 0x28, 0x7b, 0x7d, 0x2c, 0x63, 0x29, 0x2c,
+ 0x6d, 0x3d, 0x6c, 0x2e, 0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d, 0x2c, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65,
+ 0x61, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x61, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77,
+ 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x75, 0x7c, 0x7c, 0x28, 0x61, 0x3d, 0x74, 0x5b, 0x63, 0x5d, 0x3d, 0x74, 0x5b, 0x63, 0x5d, 0x7c,
+ 0x7c, 0x61, 0x2c, 0x73, 0x5b, 0x61, 0x5d, 0x3d, 0x62, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d,
+ 0x2c, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70,
+ 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x7c, 0x7c, 0x28, 0x6c, 0x2e, 0x6d, 0x69, 0x6d, 0x65, 0x54,
+ 0x79, 0x70, 0x65, 0x3d, 0x61, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x73, 0x74, 0x61,
+ 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3b, 0x69, 0x66, 0x28, 0x61, 0x29, 0x69,
+ 0x66, 0x28, 0x32, 0x3e, 0x75, 0x29, 0x66, 0x6f, 0x72, 0x28, 0x62, 0x20, 0x69, 0x6e, 0x20, 0x61,
+ 0x29, 0x72, 0x5b, 0x62, 0x5d, 0x3d, 0x5b, 0x72, 0x5b, 0x62, 0x5d, 0x2c, 0x61, 0x5b, 0x62, 0x5d,
+ 0x5d, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x77, 0x2e, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73, 0x28,
+ 0x61, 0x5b, 0x77, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x62, 0x3d, 0x61, 0x7c, 0x7c, 0x76, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6a, 0x26,
+ 0x26, 0x6a, 0x2e, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x28, 0x62, 0x29, 0x2c, 0x79, 0x28, 0x30, 0x2c,
+ 0x62, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x70, 0x2e, 0x70,
+ 0x72, 0x6f, 0x6d, 0x69, 0x73, 0x65, 0x28, 0x77, 0x29, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65,
+ 0x74, 0x65, 0x3d, 0x71, 0x2e, 0x61, 0x64, 0x64, 0x2c, 0x77, 0x2e, 0x73, 0x75, 0x63, 0x63, 0x65,
+ 0x73, 0x73, 0x3d, 0x77, 0x2e, 0x64, 0x6f, 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29, 0x2c, 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x26, 0x26, 0x6c,
+ 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x44, 0x61, 0x74, 0x61, 0x26, 0x26, 0x22, 0x73,
+ 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6c,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x26, 0x26, 0x28, 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x6e,
+ 0x2e, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x28, 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x6c, 0x2e,
+ 0x74, 0x72, 0x61, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x29, 0x29, 0x2c, 0x54, 0x62,
+ 0x28, 0x4e, 0x62, 0x2c, 0x6c, 0x2c, 0x63, 0x2c, 0x77, 0x29, 0x2c, 0x32, 0x3d, 0x3d, 0x3d, 0x75,
+ 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x77, 0x3b, 0x69, 0x3d, 0x6e, 0x2e, 0x65, 0x76,
+ 0x65, 0x6e, 0x74, 0x26, 0x26, 0x6c, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x2c, 0x69, 0x26,
+ 0x26, 0x30, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2b, 0x2b, 0x26,
+ 0x26, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72,
+ 0x28, 0x22, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x74, 0x61, 0x72, 0x74, 0x22, 0x29, 0x2c, 0x6c, 0x2e,
+ 0x74, 0x79, 0x70, 0x65, 0x3d, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x55, 0x70,
+ 0x70, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2c, 0x6c, 0x2e, 0x68, 0x61, 0x73, 0x43,
+ 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x3d, 0x21, 0x4b, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28,
+ 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x29, 0x2c, 0x66, 0x3d, 0x6c, 0x2e, 0x75, 0x72, 0x6c, 0x2c,
+ 0x6c, 0x2e, 0x68, 0x61, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x28, 0x6c,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x26, 0x26, 0x28, 0x66, 0x3d, 0x6c, 0x2e, 0x75, 0x72, 0x6c, 0x2b,
+ 0x3d, 0x28, 0x45, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x66, 0x29, 0x3f, 0x22, 0x26, 0x22,
+ 0x3a, 0x22, 0x3f, 0x22, 0x29, 0x2b, 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x64, 0x65, 0x6c,
+ 0x65, 0x74, 0x65, 0x20, 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x29, 0x2c, 0x6c, 0x2e, 0x63, 0x61,
+ 0x63, 0x68, 0x65, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x26, 0x26, 0x28, 0x6c, 0x2e, 0x75, 0x72, 0x6c,
+ 0x3d, 0x48, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x66, 0x29, 0x3f, 0x66, 0x2e, 0x72, 0x65,
+ 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x48, 0x62, 0x2c, 0x22, 0x24, 0x31, 0x5f, 0x3d, 0x22, 0x2b,
+ 0x44, 0x62, 0x2b, 0x2b, 0x29, 0x3a, 0x66, 0x2b, 0x28, 0x45, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x28, 0x66, 0x29, 0x3f, 0x22, 0x26, 0x22, 0x3a, 0x22, 0x3f, 0x22, 0x29, 0x2b, 0x22, 0x5f, 0x3d,
+ 0x22, 0x2b, 0x44, 0x62, 0x2b, 0x2b, 0x29, 0x29, 0x2c, 0x6c, 0x2e, 0x69, 0x66, 0x4d, 0x6f, 0x64,
+ 0x69, 0x66, 0x69, 0x65, 0x64, 0x26, 0x26, 0x28, 0x6e, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f,
+ 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5b, 0x66, 0x5d, 0x26, 0x26, 0x77, 0x2e, 0x73, 0x65, 0x74,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, 0x22, 0x49,
+ 0x66, 0x2d, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x2d, 0x53, 0x69, 0x6e, 0x63, 0x65,
+ 0x22, 0x2c, 0x6e, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64,
+ 0x5b, 0x66, 0x5d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x74, 0x61, 0x67, 0x5b, 0x66, 0x5d, 0x26, 0x26,
+ 0x77, 0x2e, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64,
+ 0x65, 0x72, 0x28, 0x22, 0x49, 0x66, 0x2d, 0x4e, 0x6f, 0x6e, 0x65, 0x2d, 0x4d, 0x61, 0x74, 0x63,
+ 0x68, 0x22, 0x2c, 0x6e, 0x2e, 0x65, 0x74, 0x61, 0x67, 0x5b, 0x66, 0x5d, 0x29, 0x29, 0x2c, 0x28,
+ 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x26, 0x26, 0x6c, 0x2e, 0x68, 0x61, 0x73, 0x43, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x26, 0x26, 0x6c, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54,
+ 0x79, 0x70, 0x65, 0x21, 0x3d, 0x3d, 0x21, 0x31, 0x7c, 0x7c, 0x63, 0x2e, 0x63, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x29, 0x26, 0x26, 0x77, 0x2e, 0x73, 0x65, 0x74, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, 0x22, 0x43, 0x6f,
+ 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x6c, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x29, 0x2c, 0x77, 0x2e, 0x73, 0x65, 0x74,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, 0x22, 0x41,
+ 0x63, 0x63, 0x65, 0x70, 0x74, 0x22, 0x2c, 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70,
+ 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x26, 0x26, 0x6c, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x73,
+ 0x5b, 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x5d,
+ 0x3f, 0x6c, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74, 0x73, 0x5b, 0x6c, 0x2e, 0x64, 0x61, 0x74,
+ 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x5d, 0x2b, 0x28, 0x22, 0x2a, 0x22, 0x21,
+ 0x3d, 0x3d, 0x6c, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5b, 0x30, 0x5d,
+ 0x3f, 0x22, 0x2c, 0x20, 0x22, 0x2b, 0x50, 0x62, 0x2b, 0x22, 0x3b, 0x20, 0x71, 0x3d, 0x30, 0x2e,
+ 0x30, 0x31, 0x22, 0x3a, 0x22, 0x22, 0x29, 0x3a, 0x6c, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74,
+ 0x73, 0x5b, 0x22, 0x2a, 0x22, 0x5d, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x20, 0x69, 0x6e,
+ 0x20, 0x6c, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x29, 0x77, 0x2e, 0x73, 0x65, 0x74,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, 0x65, 0x2c,
+ 0x6c, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5b, 0x65, 0x5d, 0x29, 0x3b, 0x69, 0x66,
+ 0x28, 0x6c, 0x2e, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x6e, 0x64, 0x26, 0x26, 0x28,
+ 0x6c, 0x2e, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x53, 0x65, 0x6e, 0x64, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x6d, 0x2c, 0x77, 0x2c, 0x6c, 0x29, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x7c, 0x7c, 0x32,
+ 0x3d, 0x3d, 0x3d, 0x75, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x77, 0x2e, 0x61,
+ 0x62, 0x6f, 0x72, 0x74, 0x28, 0x29, 0x3b, 0x76, 0x3d, 0x22, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x22,
+ 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x20, 0x69, 0x6e, 0x7b, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73,
+ 0x73, 0x3a, 0x31, 0x2c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x31, 0x2c, 0x63, 0x6f, 0x6d, 0x70,
+ 0x6c, 0x65, 0x74, 0x65, 0x3a, 0x31, 0x7d, 0x29, 0x77, 0x5b, 0x65, 0x5d, 0x28, 0x6c, 0x5b, 0x65,
+ 0x5d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x6a, 0x3d, 0x54, 0x62, 0x28, 0x4f, 0x62, 0x2c, 0x6c, 0x2c,
+ 0x63, 0x2c, 0x77, 0x29, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x77, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79,
+ 0x53, 0x74, 0x61, 0x74, 0x65, 0x3d, 0x31, 0x2c, 0x69, 0x26, 0x26, 0x6f, 0x2e, 0x74, 0x72, 0x69,
+ 0x67, 0x67, 0x65, 0x72, 0x28, 0x22, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x65, 0x6e, 0x64, 0x22, 0x2c,
+ 0x5b, 0x77, 0x2c, 0x6c, 0x5d, 0x29, 0x2c, 0x32, 0x3d, 0x3d, 0x3d, 0x75, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x77, 0x3b, 0x6c, 0x2e, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x26, 0x26, 0x6c,
+ 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x3e, 0x30, 0x26, 0x26, 0x28, 0x68, 0x3d, 0x61,
+ 0x2e, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x77, 0x2e, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x28, 0x22,
+ 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x29, 0x7d, 0x2c, 0x6c, 0x2e, 0x74, 0x69, 0x6d,
+ 0x65, 0x6f, 0x75, 0x74, 0x29, 0x29, 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x75, 0x3d, 0x31, 0x2c, 0x6a,
+ 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x28, 0x73, 0x2c, 0x79, 0x29, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68,
+ 0x28, 0x78, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x28, 0x32, 0x3e, 0x75, 0x29, 0x29, 0x74, 0x68,
+ 0x72, 0x6f, 0x77, 0x20, 0x78, 0x3b, 0x79, 0x28, 0x2d, 0x31, 0x2c, 0x78, 0x29, 0x7d, 0x7d, 0x65,
+ 0x6c, 0x73, 0x65, 0x20, 0x79, 0x28, 0x2d, 0x31, 0x2c, 0x22, 0x4e, 0x6f, 0x20, 0x54, 0x72, 0x61,
+ 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x29, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x79, 0x28, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x6b, 0x2c, 0x73, 0x2c, 0x74, 0x2c, 0x76, 0x2c, 0x78, 0x2c, 0x79, 0x3d, 0x63, 0x3b, 0x32,
+ 0x21, 0x3d, 0x3d, 0x75, 0x26, 0x26, 0x28, 0x75, 0x3d, 0x32, 0x2c, 0x68, 0x26, 0x26, 0x61, 0x2e,
+ 0x63, 0x6c, 0x65, 0x61, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x68, 0x29, 0x2c,
+ 0x6a, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x2c, 0x67, 0x3d, 0x65, 0x7c, 0x7c, 0x22, 0x22,
+ 0x2c, 0x77, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3d, 0x62, 0x3e,
+ 0x30, 0x3f, 0x34, 0x3a, 0x30, 0x2c, 0x6b, 0x3d, 0x62, 0x3e, 0x3d, 0x32, 0x30, 0x30, 0x26, 0x26,
+ 0x33, 0x30, 0x30, 0x3e, 0x62, 0x7c, 0x7c, 0x33, 0x30, 0x34, 0x3d, 0x3d, 0x3d, 0x62, 0x2c, 0x64,
+ 0x26, 0x26, 0x28, 0x76, 0x3d, 0x56, 0x62, 0x28, 0x6c, 0x2c, 0x77, 0x2c, 0x64, 0x29, 0x29, 0x2c,
+ 0x76, 0x3d, 0x57, 0x62, 0x28, 0x6c, 0x2c, 0x76, 0x2c, 0x77, 0x2c, 0x6b, 0x29, 0x2c, 0x6b, 0x3f,
+ 0x28, 0x6c, 0x2e, 0x69, 0x66, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x26, 0x26, 0x28,
+ 0x78, 0x3d, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48,
+ 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, 0x22, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d, 0x6f, 0x64, 0x69,
+ 0x66, 0x69, 0x65, 0x64, 0x22, 0x29, 0x2c, 0x78, 0x26, 0x26, 0x28, 0x6e, 0x2e, 0x6c, 0x61, 0x73,
+ 0x74, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5b, 0x66, 0x5d, 0x3d, 0x78, 0x29, 0x2c,
+ 0x78, 0x3d, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48,
+ 0x65, 0x61, 0x64, 0x65, 0x72, 0x28, 0x22, 0x65, 0x74, 0x61, 0x67, 0x22, 0x29, 0x2c, 0x78, 0x26,
+ 0x26, 0x28, 0x6e, 0x2e, 0x65, 0x74, 0x61, 0x67, 0x5b, 0x66, 0x5d, 0x3d, 0x78, 0x29, 0x29, 0x2c,
+ 0x32, 0x30, 0x34, 0x3d, 0x3d, 0x3d, 0x62, 0x7c, 0x7c, 0x22, 0x48, 0x45, 0x41, 0x44, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x6c, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x3f, 0x79, 0x3d, 0x22, 0x6e, 0x6f, 0x63, 0x6f,
+ 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x3a, 0x33, 0x30, 0x34, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x79,
+ 0x3d, 0x22, 0x6e, 0x6f, 0x74, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x22, 0x3a, 0x28,
+ 0x79, 0x3d, 0x76, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2c, 0x73, 0x3d, 0x76, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x2c, 0x74, 0x3d, 0x76, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2c, 0x6b, 0x3d, 0x21,
+ 0x74, 0x29, 0x29, 0x3a, 0x28, 0x74, 0x3d, 0x79, 0x2c, 0x28, 0x62, 0x7c, 0x7c, 0x21, 0x79, 0x29,
+ 0x26, 0x26, 0x28, 0x79, 0x3d, 0x22, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2c, 0x30, 0x3e, 0x62,
+ 0x26, 0x26, 0x28, 0x62, 0x3d, 0x30, 0x29, 0x29, 0x29, 0x2c, 0x77, 0x2e, 0x73, 0x74, 0x61, 0x74,
+ 0x75, 0x73, 0x3d, 0x62, 0x2c, 0x77, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x65, 0x78,
+ 0x74, 0x3d, 0x28, 0x63, 0x7c, 0x7c, 0x79, 0x29, 0x2b, 0x22, 0x22, 0x2c, 0x6b, 0x3f, 0x70, 0x2e,
+ 0x72, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x57, 0x69, 0x74, 0x68, 0x28, 0x6d, 0x2c, 0x5b, 0x73,
+ 0x2c, 0x79, 0x2c, 0x77, 0x5d, 0x29, 0x3a, 0x70, 0x2e, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x57,
+ 0x69, 0x74, 0x68, 0x28, 0x6d, 0x2c, 0x5b, 0x77, 0x2c, 0x79, 0x2c, 0x74, 0x5d, 0x29, 0x2c, 0x77,
+ 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x28, 0x72, 0x29, 0x2c, 0x72,
+ 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x2c, 0x69, 0x26, 0x26, 0x6f, 0x2e, 0x74, 0x72, 0x69,
+ 0x67, 0x67, 0x65, 0x72, 0x28, 0x6b, 0x3f, 0x22, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x75, 0x63, 0x63,
+ 0x65, 0x73, 0x73, 0x22, 0x3a, 0x22, 0x61, 0x6a, 0x61, 0x78, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22,
+ 0x2c, 0x5b, 0x77, 0x2c, 0x6c, 0x2c, 0x6b, 0x3f, 0x73, 0x3a, 0x74, 0x5d, 0x29, 0x2c, 0x71, 0x2e,
+ 0x66, 0x69, 0x72, 0x65, 0x57, 0x69, 0x74, 0x68, 0x28, 0x6d, 0x2c, 0x5b, 0x77, 0x2c, 0x79, 0x5d,
+ 0x29, 0x2c, 0x69, 0x26, 0x26, 0x28, 0x6f, 0x2e, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65, 0x72, 0x28,
+ 0x22, 0x61, 0x6a, 0x61, 0x78, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22, 0x2c, 0x5b,
+ 0x77, 0x2c, 0x6c, 0x5d, 0x29, 0x2c, 0x2d, 0x2d, 0x6e, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65,
+ 0x7c, 0x7c, 0x6e, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x72, 0x69, 0x67, 0x67, 0x65,
+ 0x72, 0x28, 0x22, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x74, 0x6f, 0x70, 0x22, 0x29, 0x29, 0x29, 0x7d,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x77, 0x7d, 0x2c, 0x67, 0x65, 0x74, 0x4a, 0x53, 0x4f,
+ 0x4e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x22, 0x6a, 0x73, 0x6f, 0x6e, 0x22, 0x29, 0x7d, 0x2c, 0x67, 0x65,
+ 0x74, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67,
+ 0x65, 0x74, 0x28, 0x61, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x2c, 0x62, 0x2c, 0x22, 0x73,
+ 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63,
+ 0x68, 0x28, 0x5b, 0x22, 0x67, 0x65, 0x74, 0x22, 0x2c, 0x22, 0x70, 0x6f, 0x73, 0x74, 0x22, 0x5d,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x6e,
+ 0x5b, 0x62, 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x63,
+ 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x69,
+ 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x26, 0x26, 0x28, 0x65,
+ 0x3d, 0x65, 0x7c, 0x7c, 0x64, 0x2c, 0x64, 0x3d, 0x63, 0x2c, 0x63, 0x3d, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x29, 0x2c, 0x6e, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x28, 0x6e, 0x2e, 0x65, 0x78, 0x74,
+ 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x75, 0x72, 0x6c, 0x3a, 0x61, 0x2c, 0x74, 0x79, 0x70, 0x65, 0x3a,
+ 0x62, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x65, 0x2c, 0x64, 0x61, 0x74,
+ 0x61, 0x3a, 0x63, 0x2c, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x3a, 0x64, 0x7d, 0x2c, 0x6e,
+ 0x2e, 0x69, 0x73, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x28, 0x61,
+ 0x29, 0x26, 0x26, 0x61, 0x29, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x5f, 0x65, 0x76, 0x61,
+ 0x6c, 0x55, 0x72, 0x6c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x28, 0x7b,
+ 0x75, 0x72, 0x6c, 0x3a, 0x61, 0x2c, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x47, 0x45, 0x54, 0x22,
+ 0x2c, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70,
+ 0x74, 0x22, 0x2c, 0x63, 0x61, 0x63, 0x68, 0x65, 0x3a, 0x21, 0x30, 0x2c, 0x61, 0x73, 0x79, 0x6e,
+ 0x63, 0x3a, 0x21, 0x31, 0x2c, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x3a, 0x21, 0x31, 0x2c, 0x22,
+ 0x74, 0x68, 0x72, 0x6f, 0x77, 0x73, 0x22, 0x3a, 0x21, 0x30, 0x7d, 0x29, 0x7d, 0x2c, 0x6e, 0x2e,
+ 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x77, 0x72, 0x61, 0x70, 0x41,
+ 0x6c, 0x6c, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x69,
+ 0x66, 0x28, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61,
+ 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x6e,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x77, 0x72, 0x61, 0x70, 0x41, 0x6c, 0x6c, 0x28, 0x61,
+ 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x62, 0x29, 0x29, 0x7d, 0x29,
+ 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x62, 0x3d, 0x6e, 0x28, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x6f,
+ 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x65, 0x71,
+ 0x28, 0x30, 0x29, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x21, 0x30, 0x29, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65,
+ 0x26, 0x26, 0x62, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x62, 0x2e, 0x6d, 0x61, 0x70, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x61, 0x2e, 0x66, 0x69,
+ 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x26, 0x26, 0x31, 0x3d, 0x3d, 0x3d, 0x61, 0x2e,
+ 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54,
+ 0x79, 0x70, 0x65, 0x29, 0x61, 0x3d, 0x61, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69,
+ 0x6c, 0x64, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x29, 0x2e, 0x61, 0x70,
+ 0x70, 0x65, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x2c, 0x77, 0x72, 0x61, 0x70, 0x49, 0x6e, 0x6e, 0x65,
+ 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x29, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x6e, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x29, 0x2e, 0x77, 0x72, 0x61, 0x70, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x28, 0x61, 0x2e, 0x63,
+ 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x62, 0x29, 0x29, 0x7d, 0x29, 0x3a, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x2c, 0x63, 0x3d, 0x62, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x28, 0x29,
+ 0x3b, 0x63, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x63, 0x2e, 0x77, 0x72, 0x61, 0x70,
+ 0x41, 0x6c, 0x6c, 0x28, 0x61, 0x29, 0x3a, 0x62, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28,
+ 0x61, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x77, 0x72, 0x61, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6e, 0x2e, 0x69,
+ 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x29, 0x7b, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x2e, 0x77, 0x72, 0x61, 0x70, 0x41, 0x6c, 0x6c, 0x28, 0x62, 0x3f, 0x61, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x63, 0x29, 0x3a, 0x61, 0x29, 0x7d, 0x29, 0x7d,
+ 0x2c, 0x75, 0x6e, 0x77, 0x72, 0x61, 0x70, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61,
+ 0x6d, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x62, 0x6f, 0x64, 0x79, 0x22, 0x29, 0x7c,
+ 0x7c, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65,
+ 0x57, 0x69, 0x74, 0x68, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e,
+ 0x6f, 0x64, 0x65, 0x73, 0x29, 0x7d, 0x29, 0x2e, 0x65, 0x6e, 0x64, 0x28, 0x29, 0x7d, 0x7d, 0x29,
+ 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x58, 0x62, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x26, 0x26,
+ 0x61, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x7c,
+ 0x7c, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x2c, 0x22, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61,
+ 0x79, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x59, 0x62, 0x28,
+ 0x61, 0x29, 0x7b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x61, 0x26, 0x26, 0x31, 0x3d, 0x3d, 0x3d,
+ 0x61, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x22,
+ 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x3d, 0x3d, 0x3d, 0x58, 0x62, 0x28, 0x61, 0x29, 0x7c, 0x7c, 0x22,
+ 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65,
+ 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x30, 0x3b, 0x61, 0x3d, 0x61, 0x2e, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21,
+ 0x31, 0x7d, 0x6e, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73,
+ 0x2e, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x2e, 0x72, 0x65, 0x6c,
+ 0x69, 0x61, 0x62, 0x6c, 0x65, 0x48, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x4f, 0x66, 0x66, 0x73, 0x65,
+ 0x74, 0x73, 0x28, 0x29, 0x3f, 0x61, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x57, 0x69, 0x64,
+ 0x74, 0x68, 0x3c, 0x3d, 0x30, 0x26, 0x26, 0x61, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x48,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x3c, 0x3d, 0x30, 0x26, 0x26, 0x21, 0x61, 0x2e, 0x67, 0x65, 0x74,
+ 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x73, 0x28, 0x29, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x59, 0x62, 0x28, 0x61, 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x65, 0x78,
+ 0x70, 0x72, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x69, 0x62,
+ 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x6e, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x66, 0x69, 0x6c,
+ 0x74, 0x65, 0x72, 0x73, 0x2e, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x28, 0x61, 0x29, 0x7d, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x5a, 0x62, 0x3d, 0x2f, 0x25, 0x32, 0x30, 0x2f, 0x67, 0x2c, 0x24, 0x62,
+ 0x3d, 0x2f, 0x5c, 0x5b, 0x5c, 0x5d, 0x24, 0x2f, 0x2c, 0x5f, 0x62, 0x3d, 0x2f, 0x5c, 0x72, 0x3f,
+ 0x5c, 0x6e, 0x2f, 0x67, 0x2c, 0x61, 0x63, 0x3d, 0x2f, 0x5e, 0x28, 0x3f, 0x3a, 0x73, 0x75, 0x62,
+ 0x6d, 0x69, 0x74, 0x7c, 0x62, 0x75, 0x74, 0x74, 0x6f, 0x6e, 0x7c, 0x69, 0x6d, 0x61, 0x67, 0x65,
+ 0x7c, 0x72, 0x65, 0x73, 0x65, 0x74, 0x7c, 0x66, 0x69, 0x6c, 0x65, 0x29, 0x24, 0x2f, 0x69, 0x2c,
+ 0x62, 0x63, 0x3d, 0x2f, 0x5e, 0x28, 0x3f, 0x3a, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x7c, 0x73, 0x65,
+ 0x6c, 0x65, 0x63, 0x74, 0x7c, 0x74, 0x65, 0x78, 0x74, 0x61, 0x72, 0x65, 0x61, 0x7c, 0x6b, 0x65,
+ 0x79, 0x67, 0x65, 0x6e, 0x29, 0x2f, 0x69, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x63, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28,
+ 0x62, 0x29, 0x29, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x62, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x65, 0x29, 0x7b, 0x63, 0x7c, 0x7c, 0x24, 0x62, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x3f, 0x64, 0x28, 0x61, 0x2c, 0x65, 0x29, 0x3a, 0x63,
+ 0x63, 0x28, 0x61, 0x2b, 0x22, 0x5b, 0x22, 0x2b, 0x28, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x65, 0x26, 0x26, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x21, 0x3d, 0x65, 0x3f, 0x62, 0x3a, 0x22, 0x22, 0x29, 0x2b, 0x22, 0x5d, 0x22, 0x2c, 0x65,
+ 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7d, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28,
+ 0x63, 0x7c, 0x7c, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x21, 0x3d, 0x3d, 0x6e, 0x2e,
+ 0x74, 0x79, 0x70, 0x65, 0x28, 0x62, 0x29, 0x29, 0x64, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x3b, 0x65,
+ 0x6c, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x29, 0x63,
+ 0x63, 0x28, 0x61, 0x2b, 0x22, 0x5b, 0x22, 0x2b, 0x65, 0x2b, 0x22, 0x5d, 0x22, 0x2c, 0x62, 0x5b,
+ 0x65, 0x5d, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7d, 0x6e, 0x2e, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x5b, 0x5d, 0x2c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x62, 0x3d, 0x6e, 0x2e, 0x69, 0x73, 0x46,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x3f, 0x62, 0x28, 0x29, 0x3a, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x62, 0x3f, 0x22, 0x22, 0x3a, 0x62, 0x2c, 0x64, 0x5b, 0x64, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5d, 0x3d, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x55, 0x52,
+ 0x49, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x28, 0x61, 0x29, 0x2b, 0x22, 0x3d,
+ 0x22, 0x2b, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x55, 0x52, 0x49, 0x43, 0x6f, 0x6d, 0x70, 0x6f,
+ 0x6e, 0x65, 0x6e, 0x74, 0x28, 0x62, 0x29, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x6e, 0x2e, 0x61, 0x6a, 0x61,
+ 0x78, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x26, 0x26, 0x6e, 0x2e, 0x61, 0x6a, 0x61,
+ 0x78, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x64, 0x69, 0x74,
+ 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x29, 0x2c, 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79,
+ 0x28, 0x61, 0x29, 0x7c, 0x7c, 0x61, 0x2e, 0x6a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x26, 0x26, 0x21,
+ 0x6e, 0x2e, 0x69, 0x73, 0x50, 0x6c, 0x61, 0x69, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x28,
+ 0x61, 0x29, 0x29, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x61, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x7d, 0x29,
+ 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x28, 0x63, 0x20, 0x69, 0x6e, 0x20, 0x61,
+ 0x29, 0x63, 0x63, 0x28, 0x63, 0x2c, 0x61, 0x5b, 0x63, 0x5d, 0x2c, 0x62, 0x2c, 0x65, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x26,
+ 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x5a, 0x62, 0x2c, 0x22, 0x2b,
+ 0x22, 0x29, 0x7d, 0x2c, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28,
+ 0x7b, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x70,
+ 0x61, 0x72, 0x61, 0x6d, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c,
+ 0x69, 0x7a, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x29, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x72,
+ 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x22, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3f, 0x6e, 0x2e, 0x6d, 0x61, 0x6b, 0x65, 0x41,
+ 0x72, 0x72, 0x61, 0x79, 0x28, 0x61, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x29, 0x2e, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61, 0x6d,
+ 0x65, 0x26, 0x26, 0x21, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x69, 0x73, 0x28, 0x22,
+ 0x3a, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x29, 0x26, 0x26, 0x62, 0x63, 0x2e,
+ 0x74, 0x65, 0x73, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61,
+ 0x6d, 0x65, 0x29, 0x26, 0x26, 0x21, 0x61, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29,
+ 0x26, 0x26, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x7c,
+ 0x7c, 0x21, 0x5a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x29, 0x7d, 0x29, 0x2e, 0x6d,
+ 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x76,
+ 0x61, 0x6c, 0x28, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x3d, 0x3d, 0x63, 0x3f, 0x6e, 0x75, 0x6c, 0x6c, 0x3a, 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72,
+ 0x61, 0x79, 0x28, 0x63, 0x29, 0x3f, 0x6e, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x63, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x62, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x3a, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x5f, 0x62, 0x2c,
+ 0x22, 0x5c, 0x72, 0x5c, 0x6e, 0x22, 0x29, 0x7d, 0x7d, 0x29, 0x3a, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3a, 0x62, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x63, 0x2e,
+ 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x5f, 0x62, 0x2c, 0x22, 0x5c, 0x72, 0x5c, 0x6e,
+ 0x22, 0x29, 0x7d, 0x7d, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x28, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e,
+ 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x78, 0x68,
+ 0x72, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x61, 0x2e, 0x41, 0x63, 0x74,
+ 0x69, 0x76, 0x65, 0x58, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3f, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x69, 0x73, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x3f, 0x68, 0x63, 0x28, 0x29, 0x3a, 0x64,
+ 0x2e, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x3e, 0x38, 0x3f,
+ 0x67, 0x63, 0x28, 0x29, 0x3a, 0x2f, 0x5e, 0x28, 0x67, 0x65, 0x74, 0x7c, 0x70, 0x6f, 0x73, 0x74,
+ 0x7c, 0x68, 0x65, 0x61, 0x64, 0x7c, 0x70, 0x75, 0x74, 0x7c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x7c, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x29, 0x24, 0x2f, 0x69, 0x2e, 0x74, 0x65, 0x73,
+ 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x29, 0x26, 0x26, 0x67, 0x63,
+ 0x28, 0x29, 0x7c, 0x7c, 0x68, 0x63, 0x28, 0x29, 0x7d, 0x3a, 0x67, 0x63, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x63, 0x3d, 0x30, 0x2c, 0x65, 0x63, 0x3d, 0x7b, 0x7d, 0x2c, 0x66, 0x63, 0x3d, 0x6e,
+ 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x78, 0x68,
+ 0x72, 0x28, 0x29, 0x3b, 0x61, 0x2e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e,
+ 0x74, 0x26, 0x26, 0x61, 0x2e, 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74,
+ 0x28, 0x22, 0x6f, 0x6e, 0x75, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x61,
+ 0x20, 0x69, 0x6e, 0x20, 0x65, 0x63, 0x29, 0x65, 0x63, 0x5b, 0x61, 0x5d, 0x28, 0x76, 0x6f, 0x69,
+ 0x64, 0x20, 0x30, 0x2c, 0x21, 0x30, 0x29, 0x7d, 0x29, 0x2c, 0x6c, 0x2e, 0x63, 0x6f, 0x72, 0x73,
+ 0x3d, 0x21, 0x21, 0x66, 0x63, 0x26, 0x26, 0x22, 0x77, 0x69, 0x74, 0x68, 0x43, 0x72, 0x65, 0x64,
+ 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x22, 0x69, 0x6e, 0x20, 0x66, 0x63, 0x2c, 0x66, 0x63,
+ 0x3d, 0x6c, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x3d, 0x21, 0x21, 0x66, 0x63, 0x2c, 0x66, 0x63, 0x26,
+ 0x26, 0x6e, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x21, 0x62, 0x2e, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x7c, 0x7c,
+ 0x6c, 0x2e, 0x63, 0x6f, 0x72, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x73, 0x65, 0x6e, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x2c, 0x67, 0x3d,
+ 0x62, 0x2e, 0x78, 0x68, 0x72, 0x28, 0x29, 0x2c, 0x68, 0x3d, 0x2b, 0x2b, 0x64, 0x63, 0x3b, 0x69,
+ 0x66, 0x28, 0x67, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x28, 0x62, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2c,
+ 0x62, 0x2e, 0x75, 0x72, 0x6c, 0x2c, 0x62, 0x2e, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x2c, 0x62, 0x2e,
+ 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x62, 0x2e, 0x70, 0x61, 0x73, 0x73, 0x77,
+ 0x6f, 0x72, 0x64, 0x29, 0x2c, 0x62, 0x2e, 0x78, 0x68, 0x72, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73,
+ 0x29, 0x66, 0x6f, 0x72, 0x28, 0x66, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x2e, 0x78, 0x68, 0x72, 0x46,
+ 0x69, 0x65, 0x6c, 0x64, 0x73, 0x29, 0x67, 0x5b, 0x66, 0x5d, 0x3d, 0x62, 0x2e, 0x78, 0x68, 0x72,
+ 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x5b, 0x66, 0x5d, 0x3b, 0x62, 0x2e, 0x6d, 0x69, 0x6d, 0x65,
+ 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x67, 0x2e, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65,
+ 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x26, 0x26, 0x67, 0x2e, 0x6f, 0x76, 0x65, 0x72,
+ 0x72, 0x69, 0x64, 0x65, 0x4d, 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x28, 0x62, 0x2e, 0x6d,
+ 0x69, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x29, 0x2c, 0x62, 0x2e, 0x63, 0x72, 0x6f, 0x73, 0x73,
+ 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x7c, 0x7c, 0x64, 0x5b, 0x22, 0x58, 0x2d, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2d, 0x57, 0x69, 0x74, 0x68, 0x22, 0x5d, 0x7c, 0x7c, 0x28,
+ 0x64, 0x5b, 0x22, 0x58, 0x2d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x2d, 0x57,
+ 0x69, 0x74, 0x68, 0x22, 0x5d, 0x3d, 0x22, 0x58, 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x66, 0x20, 0x69, 0x6e,
+ 0x20, 0x64, 0x29, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x21, 0x3d, 0x3d, 0x64, 0x5b, 0x66, 0x5d,
+ 0x26, 0x26, 0x67, 0x2e, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x65,
+ 0x61, 0x64, 0x65, 0x72, 0x28, 0x66, 0x2c, 0x64, 0x5b, 0x66, 0x5d, 0x2b, 0x22, 0x22, 0x29, 0x3b,
+ 0x67, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x28, 0x62, 0x2e, 0x68, 0x61, 0x73, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x6e, 0x74, 0x26, 0x26, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x7c, 0x7c, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x29, 0x2c, 0x63, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c,
+ 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x2c, 0x69, 0x2c, 0x6a, 0x3b, 0x69, 0x66, 0x28,
+ 0x63, 0x26, 0x26, 0x28, 0x64, 0x7c, 0x7c, 0x34, 0x3d, 0x3d, 0x3d, 0x67, 0x2e, 0x72, 0x65, 0x61,
+ 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x29, 0x29, 0x69, 0x66, 0x28, 0x64, 0x65, 0x6c, 0x65,
+ 0x74, 0x65, 0x20, 0x65, 0x63, 0x5b, 0x68, 0x5d, 0x2c, 0x63, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20,
+ 0x30, 0x2c, 0x67, 0x2e, 0x6f, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x73, 0x74, 0x61, 0x74, 0x65,
+ 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x3d, 0x6e, 0x2e, 0x6e, 0x6f, 0x6f, 0x70, 0x2c, 0x64, 0x29,
+ 0x34, 0x21, 0x3d, 0x3d, 0x67, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65,
+ 0x26, 0x26, 0x67, 0x2e, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x28, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65,
+ 0x7b, 0x6a, 0x3d, 0x7b, 0x7d, 0x2c, 0x66, 0x3d, 0x67, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
+ 0x2c, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x67, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x65, 0x78, 0x74,
+ 0x26, 0x26, 0x28, 0x6a, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x3d, 0x67, 0x2e, 0x72, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x65, 0x78, 0x74, 0x29, 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x69, 0x3d,
+ 0x67, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x54, 0x65, 0x78, 0x74, 0x7d, 0x63, 0x61, 0x74,
+ 0x63, 0x68, 0x28, 0x6b, 0x29, 0x7b, 0x69, 0x3d, 0x22, 0x22, 0x7d, 0x66, 0x7c, 0x7c, 0x21, 0x62,
+ 0x2e, 0x69, 0x73, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x7c, 0x7c, 0x62, 0x2e, 0x63, 0x72, 0x6f, 0x73,
+ 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3f, 0x31, 0x32, 0x32, 0x33, 0x3d, 0x3d, 0x3d, 0x66,
+ 0x26, 0x26, 0x28, 0x66, 0x3d, 0x32, 0x30, 0x34, 0x29, 0x3a, 0x66, 0x3d, 0x6a, 0x2e, 0x74, 0x65,
+ 0x78, 0x74, 0x3f, 0x32, 0x30, 0x30, 0x3a, 0x34, 0x30, 0x34, 0x7d, 0x6a, 0x26, 0x26, 0x65, 0x28,
+ 0x66, 0x2c, 0x69, 0x2c, 0x6a, 0x2c, 0x67, 0x2e, 0x67, 0x65, 0x74, 0x41, 0x6c, 0x6c, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x28, 0x29, 0x29,
+ 0x7d, 0x2c, 0x62, 0x2e, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x3f, 0x34, 0x3d, 0x3d, 0x3d, 0x67, 0x2e,
+ 0x72, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3f, 0x61, 0x2e, 0x73, 0x65, 0x74,
+ 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x63, 0x29, 0x3a, 0x67, 0x2e, 0x6f, 0x6e, 0x72,
+ 0x65, 0x61, 0x64, 0x79, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x3d,
+ 0x65, 0x63, 0x5b, 0x68, 0x5d, 0x3d, 0x63, 0x3a, 0x63, 0x28, 0x29, 0x7d, 0x2c, 0x61, 0x62, 0x6f,
+ 0x72, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x63, 0x26,
+ 0x26, 0x63, 0x28, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x2c, 0x21, 0x30, 0x29, 0x7d, 0x7d, 0x7d,
+ 0x7d, 0x29, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x63, 0x28, 0x29,
+ 0x7b, 0x74, 0x72, 0x79, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20,
+ 0x61, 0x2e, 0x58, 0x4d, 0x4c, 0x48, 0x74, 0x74, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x62, 0x29, 0x7b, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x63, 0x28, 0x29, 0x7b, 0x74, 0x72, 0x79, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x61, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76,
+ 0x65, 0x58, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x28, 0x22, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73,
+ 0x6f, 0x66, 0x74, 0x2e, 0x58, 0x4d, 0x4c, 0x48, 0x54, 0x54, 0x50, 0x22, 0x29, 0x7d, 0x63, 0x61,
+ 0x74, 0x63, 0x68, 0x28, 0x62, 0x29, 0x7b, 0x7d, 0x7d, 0x6e, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x50,
+ 0x72, 0x65, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x61, 0x2e, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x44, 0x6f, 0x6d, 0x61,
+ 0x69, 0x6e, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x2e,
+ 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3d, 0x21, 0x31, 0x29, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x61,
+ 0x6a, 0x61, 0x78, 0x53, 0x65, 0x74, 0x75, 0x70, 0x28, 0x7b, 0x61, 0x63, 0x63, 0x65, 0x70, 0x74,
+ 0x73, 0x3a, 0x7b, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3a, 0x22, 0x74, 0x65, 0x78, 0x74, 0x2f,
+ 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2c, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x6a, 0x61, 0x76, 0x61, 0x73, 0x63, 0x72, 0x69,
+ 0x70, 0x74, 0x2c, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
+ 0x65, 0x63, 0x6d, 0x61, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x2c, 0x20, 0x61, 0x70, 0x70, 0x6c,
+ 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x65, 0x63, 0x6d, 0x61, 0x73, 0x63,
+ 0x72, 0x69, 0x70, 0x74, 0x22, 0x7d, 0x2c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x3a,
+ 0x7b, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x3a, 0x2f, 0x5c, 0x62, 0x28, 0x3f, 0x3a, 0x6a, 0x61,
+ 0x76, 0x61, 0x7c, 0x65, 0x63, 0x6d, 0x61, 0x29, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x5c, 0x62,
+ 0x2f, 0x7d, 0x2c, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x7b, 0x22,
+ 0x74, 0x65, 0x78, 0x74, 0x20, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x6e, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x45, 0x76, 0x61, 0x6c, 0x28, 0x61, 0x29, 0x2c,
+ 0x61, 0x7d, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x50, 0x72, 0x65, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x6f, 0x69, 0x64, 0x20,
+ 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x63, 0x61, 0x63, 0x68, 0x65, 0x26, 0x26, 0x28, 0x61, 0x2e,
+ 0x63, 0x61, 0x63, 0x68, 0x65, 0x3d, 0x21, 0x31, 0x29, 0x2c, 0x61, 0x2e, 0x63, 0x72, 0x6f, 0x73,
+ 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x22, 0x47, 0x45, 0x54, 0x22, 0x2c, 0x61, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x3d,
+ 0x21, 0x31, 0x29, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x54, 0x72, 0x61, 0x6e,
+ 0x73, 0x70, 0x6f, 0x72, 0x74, 0x28, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x2e,
+ 0x63, 0x72, 0x6f, 0x73, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x62, 0x2c, 0x63, 0x3d, 0x64, 0x2e, 0x68, 0x65, 0x61, 0x64, 0x7c, 0x7c, 0x6e, 0x28, 0x22,
+ 0x68, 0x65, 0x61, 0x64, 0x22, 0x29, 0x5b, 0x30, 0x5d, 0x7c, 0x7c, 0x64, 0x2e, 0x64, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x7b, 0x73, 0x65, 0x6e, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x65, 0x2c, 0x66, 0x29, 0x7b, 0x62, 0x3d, 0x64, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
+ 0x22, 0x29, 0x2c, 0x62, 0x2e, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x3d, 0x21, 0x30, 0x2c, 0x61, 0x2e,
+ 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x43, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x26, 0x26, 0x28,
+ 0x62, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x3d, 0x61, 0x2e, 0x73, 0x63, 0x72, 0x69,
+ 0x70, 0x74, 0x43, 0x68, 0x61, 0x72, 0x73, 0x65, 0x74, 0x29, 0x2c, 0x62, 0x2e, 0x73, 0x72, 0x63,
+ 0x3d, 0x61, 0x2e, 0x75, 0x72, 0x6c, 0x2c, 0x62, 0x2e, 0x6f, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x3d,
+ 0x62, 0x2e, 0x6f, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, 0x68,
+ 0x61, 0x6e, 0x67, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c,
+ 0x63, 0x29, 0x7b, 0x28, 0x63, 0x7c, 0x7c, 0x21, 0x62, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x53,
+ 0x74, 0x61, 0x74, 0x65, 0x7c, 0x7c, 0x2f, 0x6c, 0x6f, 0x61, 0x64, 0x65, 0x64, 0x7c, 0x63, 0x6f,
+ 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x62, 0x2e, 0x72,
+ 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, 0x61, 0x74, 0x65, 0x29, 0x29, 0x26, 0x26, 0x28, 0x62, 0x2e,
+ 0x6f, 0x6e, 0x6c, 0x6f, 0x61, 0x64, 0x3d, 0x62, 0x2e, 0x6f, 0x6e, 0x72, 0x65, 0x61, 0x64, 0x79,
+ 0x73, 0x74, 0x61, 0x74, 0x65, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x3d, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x2c, 0x62, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x26, 0x26, 0x62,
+ 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x72, 0x65, 0x6d, 0x6f,
+ 0x76, 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x62, 0x29, 0x2c, 0x62, 0x3d, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x2c, 0x63, 0x7c, 0x7c, 0x66, 0x28, 0x32, 0x30, 0x30, 0x2c, 0x22, 0x73, 0x75, 0x63, 0x63,
+ 0x65, 0x73, 0x73, 0x22, 0x29, 0x29, 0x7d, 0x2c, 0x63, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74,
+ 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28, 0x62, 0x2c, 0x63, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74,
+ 0x43, 0x68, 0x69, 0x6c, 0x64, 0x29, 0x7d, 0x2c, 0x61, 0x62, 0x6f, 0x72, 0x74, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x62, 0x26, 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66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x22, 0x6a, 0x73, 0x6f, 0x6e, 0x20, 0x6a, 0x73, 0x6f,
+ 0x6e, 0x70, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x63,
+ 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x3d,
+ 0x62, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x21, 0x3d, 0x3d, 0x21, 0x31, 0x26, 0x26, 0x28, 0x6a,
+ 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x62, 0x2e, 0x75, 0x72, 0x6c, 0x29, 0x3f, 0x22, 0x75,
+ 0x72, 0x6c, 0x22, 0x3a, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79,
+ 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x26, 0x26, 0x30, 0x3d, 0x3d,
+ 0x3d, 0x28, 0x62, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x7c,
+ 0x7c, 0x22, 0x22, 0x29, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x28, 0x22, 0x61, 0x70,
+ 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x78, 0x2d, 0x77, 0x77, 0x77, 0x2d,
+ 0x66, 0x6f, 0x72, 0x6d, 0x2d, 0x75, 0x72, 0x6c, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x22,
+ 0x29, 0x26, 0x26, 0x6a, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0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e, 0x75, 0x72, 0x6c, 0x2b, 0x3d, 0x28, 0x45, 0x62, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28,
+ 0x62, 0x2e, 0x75, 0x72, 0x6c, 0x29, 0x3f, 0x22, 0x26, 0x22, 0x3a, 0x22, 0x3f, 0x22, 0x29, 0x2b,
+ 0x62, 0x2e, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x2b, 0x22, 0x3d, 0x22, 0x2b, 0x65, 0x29, 0x2c, 0x62,
+ 0x2e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x65, 0x72, 0x73, 0x5b, 0x22, 0x73, 0x63, 0x72,
+ 0x69, 0x70, 0x74, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x22, 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x7c, 0x7c,
+ 0x6e, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x65, 0x2b, 0x22, 0x20, 0x77, 0x61, 0x73, 0x20,
+ 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0x29, 0x2c, 0x67, 0x5b, 0x30,
+ 0x5d, 0x7d, 0x2c, 0x62, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x73, 0x5b, 0x30,
+ 0x5d, 0x3d, 0x22, 0x6a, 0x73, 0x6f, 0x6e, 0x22, 0x2c, 0x66, 0x3d, 0x61, 0x5b, 0x65, 0x5d, 0x2c,
+ 0x61, 0x5b, 0x65, 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x67, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x7d, 0x2c, 0x64, 0x2e, 0x61,
+ 0x6c, 0x77, 0x61, 0x79, 0x73, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x66, 0x3f, 0x6e, 0x28, 0x61, 0x29,
+ 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x28, 0x65, 0x29, 0x3a, 0x61,
+ 0x5b, 0x65, 0x5d, 0x3d, 0x66, 0x2c, 0x62, 0x5b, 0x65, 0x5d, 0x26, 0x26, 0x28, 0x62, 0x2e, 0x6a,
+ 0x73, 0x6f, 0x6e, 0x70, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x3d, 0x63, 0x2e, 0x6a,
+ 0x73, 0x6f, 0x6e, 0x70, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x2c, 0x69, 0x63, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x65, 0x29, 0x29, 0x2c, 0x67, 0x26, 0x26, 0x6e, 0x2e, 0x69, 0x73,
+ 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x66, 0x29, 0x26, 0x26, 0x66, 0x28, 0x67,
+ 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x67, 0x3d, 0x66, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d,
+ 0x29, 0x2c, 0x22, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x29, 0x3a, 0x76, 0x6f, 0x69, 0x64,
+ 0x20, 0x30, 0x7d, 0x29, 0x2c, 0x6c, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x4d,
+ 0x4c, 0x44, 0x6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0x6f, 0x64, 0x65, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7d, 0x28, 0x29, 0x2c, 0x6e, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65,
+ 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c,
+ 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x7c, 0x7c, 0x22, 0x73, 0x74, 0x72,
+ 0x69, 0x6e, 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3b, 0x22, 0x62, 0x6f, 0x6f, 0x6c,
+ 0x65, 0x61, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x26, 0x26,
+ 0x28, 0x63, 0x3d, 0x62, 0x2c, 0x62, 0x3d, 0x21, 0x31, 0x29, 0x2c, 0x62, 0x3d, 0x62, 0x7c, 0x7c,
+ 0x28, 0x6c, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x4d, 0x4c, 0x44, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x3f, 0x64, 0x2e, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x48, 0x54, 0x4d,
+ 0x4c, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x22, 0x29, 0x3a, 0x64, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x78, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x61, 0x29,
+ 0x2c, 0x66, 0x3d, 0x21, 0x63, 0x26, 0x26, 0x5b, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x65, 0x3f, 0x5b, 0x62, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x28, 0x65, 0x5b, 0x31, 0x5d, 0x29, 0x5d, 0x3a, 0x28, 0x65, 0x3d, 0x6a, 0x61,
+ 0x28, 0x5b, 0x61, 0x5d, 0x2c, 0x62, 0x2c, 0x66, 0x29, 0x2c, 0x66, 0x26, 0x26, 0x66, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x6e, 0x28, 0x66, 0x29, 0x2e, 0x72, 0x65, 0x6d, 0x6f,
+ 0x76, 0x65, 0x28, 0x29, 0x2c, 0x6e, 0x2e, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x28, 0x5b, 0x5d, 0x2c,
+ 0x65, 0x2e, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x29, 0x29, 0x7d, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x6b, 0x63, 0x3d, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x6c, 0x6f, 0x61, 0x64,
+ 0x3b, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x6c, 0x6f, 0x61, 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x22, 0x73,
+ 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61,
+ 0x26, 0x26, 0x6b, 0x63, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6b, 0x63, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x68, 0x3d, 0x61, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f,
+ 0x66, 0x28, 0x22, 0x20, 0x22, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x68, 0x3e,
+ 0x2d, 0x31, 0x26, 0x26, 0x28, 0x64, 0x3d, 0x6e, 0x2e, 0x74, 0x72, 0x69, 0x6d, 0x28, 0x61, 0x2e,
+ 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x68, 0x2c, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x29, 0x29, 0x2c, 0x61, 0x3d, 0x61, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x2c, 0x68,
+ 0x29, 0x29, 0x2c, 0x6e, 0x2e, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x62, 0x29, 0x3f, 0x28, 0x63, 0x3d, 0x62, 0x2c, 0x62, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30,
+ 0x29, 0x3a, 0x62, 0x26, 0x26, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x22, 0x50, 0x4f, 0x53,
+ 0x54, 0x22, 0x29, 0x2c, 0x67, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x30, 0x26, 0x26,
+ 0x6e, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x28, 0x7b, 0x75, 0x72, 0x6c, 0x3a, 0x61, 0x2c, 0x74, 0x79,
+ 0x70, 0x65, 0x3a, 0x65, 0x7c, 0x7c, 0x22, 0x47, 0x45, 0x54, 0x22, 0x2c, 0x64, 0x61, 0x74, 0x61,
+ 0x54, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x2c, 0x64, 0x61, 0x74, 0x61,
+ 0x3a, 0x62, 0x7d, 0x29, 0x2e, 0x64, 0x6f, 0x6e, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x66, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x2c, 0x67, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x28, 0x64, 0x3f, 0x6e, 0x28, 0x22, 0x3c, 0x64,
+ 0x69, 0x76, 0x3e, 0x22, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x6e, 0x2e, 0x70,
+ 0x61, 0x72, 0x73, 0x65, 0x48, 0x54, 0x4d, 0x4c, 0x28, 0x61, 0x29, 0x29, 0x2e, 0x66, 0x69, 0x6e,
+ 0x64, 0x28, 0x64, 0x29, 0x3a, 0x61, 0x29, 0x7d, 0x29, 0x2e, 0x61, 0x6c, 0x77, 0x61, 0x79, 0x73,
+ 0x28, 0x63, 0x26, 0x26, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x67, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x63, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x67, 0x2c, 0x66, 0x7c,
+ 0x7c, 0x5b, 0x61, 0x2e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x54, 0x65, 0x78, 0x74,
+ 0x2c, 0x62, 0x2c, 0x61, 0x5d, 0x29, 0x7d, 0x29, 0x7d, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d,
+ 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x5b, 0x22, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x74,
+ 0x61, 0x72, 0x74, 0x22, 0x2c, 0x22, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x74, 0x6f, 0x70, 0x22, 0x2c,
+ 0x22, 0x61, 0x6a, 0x61, 0x78, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x22, 0x2c, 0x22,
+ 0x61, 0x6a, 0x61, 0x78, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x22, 0x2c, 0x22, 0x61, 0x6a, 0x61, 0x78,
+ 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x65,
+ 0x6e, 0x64, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7b, 0x6e, 0x2e, 0x66, 0x6e, 0x5b, 0x62, 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x61, 0x29, 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e,
+ 0x65, 0x78, 0x70, 0x72, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x2e, 0x61, 0x6e, 0x69,
+ 0x6d, 0x61, 0x74, 0x65, 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x67, 0x72, 0x65, 0x70, 0x28,
+ 0x6e, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x73, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x3d, 0x3d,
+ 0x62, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x7d, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7d,
+ 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x63, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x69, 0x73, 0x57, 0x69, 0x6e, 0x64, 0x6f,
+ 0x77, 0x28, 0x61, 0x29, 0x3f, 0x61, 0x3a, 0x39, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x6e, 0x6f, 0x64,
+ 0x65, 0x54, 0x79, 0x70, 0x65, 0x3f, 0x61, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x56,
+ 0x69, 0x65, 0x77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x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x3f, 0x74, 0x68, 0x69, 0x73,
+ 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x6e, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x2e,
+ 0x73, 0x65, 0x74, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61,
+ 0x2c, 0x62, 0x29, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x3d,
+ 0x7b, 0x74, 0x6f, 0x70, 0x3a, 0x30, 0x2c, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x30, 0x7d, 0x2c, 0x65,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2c, 0x66, 0x3d, 0x65, 0x26, 0x26, 0x65, 0x2e,
+ 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x3b, 0x69, 0x66,
+ 0x28, 0x66, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3d, 0x66, 0x2e, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x6e, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x28, 0x62, 0x2c, 0x65, 0x29, 0x3f, 0x28, 0x22,
+ 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65,
+ 0x6f, 0x66, 0x20, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67,
+ 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x26, 0x26, 0x28, 0x64, 0x3d, 0x65,
+ 0x2e, 0x67, 0x65, 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6c, 0x69, 0x65,
+ 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x28, 0x29, 0x29, 0x2c, 0x63, 0x3d, 0x6c, 0x63, 0x28, 0x66,
+ 0x29, 0x2c, 0x7b, 0x74, 0x6f, 0x70, 0x3a, 0x64, 0x2e, 0x74, 0x6f, 0x70, 0x2b, 0x28, 0x63, 0x2e,
+ 0x70, 0x61, 0x67, 0x65, 0x59, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x7c, 0x7c, 0x62, 0x2e, 0x73,
+ 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x54, 0x6f, 0x70, 0x29, 0x2d, 0x28, 0x62, 0x2e, 0x63, 0x6c, 0x69,
+ 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x70, 0x7c, 0x7c, 0x30, 0x29, 0x2c, 0x6c, 0x65, 0x66, 0x74, 0x3a,
+ 0x64, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x2b, 0x28, 0x63, 0x2e, 0x70, 0x61, 0x67, 0x65, 0x58, 0x4f,
+ 0x66, 0x66, 0x73, 0x65, 0x74, 0x7c, 0x7c, 0x62, 0x2e, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x4c,
+ 0x65, 0x66, 0x74, 0x29, 0x2d, 0x28, 0x62, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x4c, 0x65,
+ 0x66, 0x74, 0x7c, 0x7c, 0x30, 0x29, 0x7d, 0x29, 0x3a, 0x64, 0x7d, 0x2c, 0x70, 0x6f, 0x73, 0x69,
+ 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x3d, 0x7b, 0x74, 0x6f, 0x70, 0x3a, 0x30, 0x2c, 0x6c, 0x65, 0x66,
+ 0x74, 0x3a, 0x30, 0x7d, 0x2c, 0x64, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x66, 0x69, 0x78, 0x65, 0x64, 0x22, 0x3d, 0x3d, 0x3d, 0x6e,
+ 0x2e, 0x63, 0x73, 0x73, 0x28, 0x64, 0x2c, 0x22, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e,
+ 0x22, 0x29, 0x3f, 0x62, 0x3d, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69,
+ 0x6e, 0x67, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x28, 0x29, 0x3a, 0x28,
+ 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x50, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2c, 0x62, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x66, 0x66,
+ 0x73, 0x65, 0x74, 0x28, 0x29, 0x2c, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65,
+ 0x28, 0x61, 0x5b, 0x30, 0x5d, 0x2c, 0x22, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x29, 0x7c, 0x7c, 0x28,
+ 0x63, 0x3d, 0x61, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x29, 0x2c, 0x63, 0x2e,
+ 0x74, 0x6f, 0x70, 0x2b, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x61, 0x5b, 0x30, 0x5d, 0x2c,
+ 0x22, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x6f, 0x70, 0x57, 0x69, 0x64, 0x74, 0x68, 0x22,
+ 0x2c, 0x21, 0x30, 0x29, 0x2d, 0x61, 0x2e, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x54, 0x6f, 0x70,
+ 0x28, 0x29, 0x2c, 0x63, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x2b, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73,
+ 0x28, 0x61, 0x5b, 0x30, 0x5d, 0x2c, 0x22, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4c, 0x65, 0x66,
+ 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x21, 0x30, 0x29, 0x2d, 0x61, 0x2e, 0x73, 0x63,
+ 0x72, 0x6f, 0x6c, 0x6c, 0x4c, 0x65, 0x66, 0x74, 0x28, 0x29, 0x29, 0x2c, 0x7b, 0x74, 0x6f, 0x70,
+ 0x3a, 0x62, 0x2e, 0x74, 0x6f, 0x70, 0x2d, 0x63, 0x2e, 0x74, 0x6f, 0x70, 0x2d, 0x6e, 0x2e, 0x63,
+ 0x73, 0x73, 0x28, 0x64, 0x2c, 0x22, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x54, 0x6f, 0x70, 0x22,
+ 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x62, 0x2e, 0x6c, 0x65, 0x66, 0x74,
+ 0x2d, 0x63, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28, 0x64, 0x2c,
+ 0x22, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x4c, 0x65, 0x66, 0x74, 0x22, 0x2c, 0x21, 0x30, 0x29,
+ 0x7d, 0x7d, 0x7d, 0x2c, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3b, 0x77,
+ 0x68, 0x69, 0x6c, 0x65, 0x28, 0x61, 0x26, 0x26, 0x21, 0x6e, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e,
+ 0x61, 0x6d, 0x65, 0x28, 0x61, 0x2c, 0x22, 0x68, 0x74, 0x6d, 0x6c, 0x22, 0x29, 0x26, 0x26, 0x22,
+ 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x22, 0x3d, 0x3d, 0x3d, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x28,
+ 0x61, 0x2c, 0x22, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x29, 0x61, 0x3d,
+ 0x61, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7c, 0x7c, 0x51, 0x61, 0x7d, 0x29, 0x7d, 0x7d, 0x29,
+ 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x7b, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x4c,
+ 0x65, 0x66, 0x74, 0x3a, 0x22, 0x70, 0x61, 0x67, 0x65, 0x58, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74,
+ 0x22, 0x2c, 0x73, 0x63, 0x72, 0x6f, 0x6c, 0x6c, 0x54, 0x6f, 0x70, 0x3a, 0x22, 0x70, 0x61, 0x67,
+ 0x65, 0x59, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x7d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x2f,
+ 0x59, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x62, 0x29, 0x3b, 0x6e, 0x2e, 0x66, 0x6e, 0x5b,
+ 0x61, 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x59, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x66,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5b, 0x22, 0x74, 0x6f, 0x70, 0x22, 0x2c, 0x22,
+ 0x6c, 0x65, 0x66, 0x74, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x0a, 0x6e, 0x2e, 0x63, 0x73, 0x73, 0x48, 0x6f, 0x6f, 0x6b, 0x73,
+ 0x5b, 0x62, 0x5d, 0x3d, 0x55, 0x61, 0x28, 0x6c, 0x2e, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x50, 0x6f,
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x3f, 0x28, 0x63,
+ 0x3d, 0x53, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x2c, 0x4f, 0x61, 0x2e, 0x74, 0x65, 0x73, 0x74,
+ 0x28, 0x63, 0x29, 0x3f, 0x6e, 0x28, 0x61, 0x29, 0x2e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x5b, 0x62, 0x5d, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x3a, 0x63, 0x29, 0x3a, 0x76,
+ 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x29, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x7b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x22, 0x2c, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x7d,
+ 0x2c, 0x66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x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6f, 0x66, 0x66, 0x28, 0x61, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x62, 0x29, 0x7d, 0x2c, 0x64,
+ 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x61, 0x2c, 0x63, 0x2c, 0x64,
+ 0x29, 0x7d, 0x2c, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x65, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x3d, 0x3d, 0x3d, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f,
+ 0x66, 0x66, 0x28, 0x61, 0x2c, 0x22, 0x2a, 0x2a, 0x22, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6f, 0x66, 0x66, 0x28, 0x62, 0x2c, 0x61, 0x7c, 0x7c, 0x22, 0x2a, 0x2a, 0x22, 0x2c, 0x63, 0x29,
+ 0x7d, 0x7d, 0x29, 0x2c, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x73, 0x69, 0x7a, 0x65, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7d, 0x2c, 0x6e, 0x2e, 0x66,
+ 0x6e, 0x2e, 0x61, 0x6e, 0x64, 0x53, 0x65, 0x6c, 0x66, 0x3d, 0x6e, 0x2e, 0x66, 0x6e, 0x2e, 0x61,
+ 0x64, 0x64, 0x42, 0x61, 0x63, 0x6b, 0x2c, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x26, 0x26, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x2e, 0x61, 0x6d, 0x64, 0x26, 0x26, 0x64, 0x65,
+ 0x66, 0x69, 0x6e, 0x65, 0x28, 0x22, 0x6a, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x2c, 0x5b, 0x5d,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x63, 0x3d, 0x61, 0x2e,
+ 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2c, 0x6e, 0x63, 0x3d, 0x61, 0x2e, 0x24, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x2e, 0x6e, 0x6f, 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63,
+ 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x24, 0x3d, 0x3d, 0x3d, 0x6e, 0x26, 0x26, 0x28, 0x61,
+ 0x2e, 0x24, 0x3d, 0x6e, 0x63, 0x29, 0x2c, 0x62, 0x26, 0x26, 0x61, 0x2e, 0x6a, 0x51, 0x75, 0x65,
+ 0x72, 0x79, 0x3d, 0x3d, 0x3d, 0x6e, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x6a, 0x51, 0x75, 0x65, 0x72,
+ 0x79, 0x3d, 0x6d, 0x63, 0x29, 0x2c, 0x6e, 0x7d, 0x2c, 0x62, 0x7c, 0x7c, 0x28, 0x61, 0x2e, 0x6a,
+ 0x51, 0x75, 0x65, 0x72, 0x79, 0x3d, 0x61, 0x2e, 0x24, 0x3d, 0x6e, 0x29, 0x2c, 0x6e, 0x7d, 0x29,
+ 0x3b, 0x0a,
+
+};
+static const unsigned char gjs_moment_min_jsData[] = {
+ 0x2f, 0x2f, 0x21, 0x20, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6a, 0x73, 0x0a, 0x2f, 0x2f,
+ 0x21, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3a, 0x20, 0x32, 0x2e, 0x31, 0x31,
+ 0x2e, 0x31, 0x0a, 0x2f, 0x2f, 0x21, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x73, 0x20, 0x3a,
+ 0x20, 0x54, 0x69, 0x6d, 0x20, 0x57, 0x6f, 0x6f, 0x64, 0x2c, 0x20, 0x49, 0x73, 0x6b, 0x72, 0x65,
+ 0x6e, 0x20, 0x43, 0x68, 0x65, 0x72, 0x6e, 0x65, 0x76, 0x2c, 0x20, 0x4d, 0x6f, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x6a, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x6f, 0x72,
+ 0x73, 0x0a, 0x2f, 0x2f, 0x21, 0x20, 0x6c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x20, 0x3a, 0x20,
+ 0x4d, 0x49, 0x54, 0x0a, 0x2f, 0x2f, 0x21, 0x20, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x6a, 0x73,
+ 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x21, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x74, 0x79,
+ 0x70, 0x65, 0x6f, 0x66, 0x20, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x26, 0x26, 0x22, 0x75,
+ 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e,
+ 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x3d, 0x62, 0x28, 0x29, 0x3a, 0x22, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x64,
+ 0x65, 0x66, 0x69, 0x6e, 0x65, 0x26, 0x26, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x2e, 0x61, 0x6d,
+ 0x64, 0x3f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x28, 0x62, 0x29, 0x3a, 0x61, 0x2e, 0x6d, 0x6f,
+ 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x62, 0x28, 0x29, 0x7d, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x22, 0x75, 0x73, 0x65, 0x20, 0x73,
+ 0x74, 0x72, 0x69, 0x63, 0x74, 0x22, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x61, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x55, 0x63, 0x2e, 0x61, 0x70,
+ 0x70, 0x6c, 0x79, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x28, 0x61,
+ 0x29, 0x7b, 0x55, 0x63, 0x3d, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x5b, 0x6f, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x20, 0x41, 0x72, 0x72, 0x61, 0x79, 0x5d, 0x22, 0x3d, 0x3d, 0x3d, 0x4f, 0x62,
+ 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74,
+ 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x6f,
+ 0x66, 0x20, 0x44, 0x61, 0x74, 0x65, 0x7c, 0x7c, 0x22, 0x5b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x20, 0x44, 0x61, 0x74, 0x65, 0x5d, 0x22, 0x3d, 0x3d, 0x3d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72,
+ 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x63, 0x2c, 0x64, 0x3d, 0x5b, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x63, 0x3d, 0x30, 0x3b, 0x63,
+ 0x3c, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x2b, 0x2b, 0x63, 0x29, 0x64, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x62, 0x28, 0x61, 0x5b, 0x63, 0x5d, 0x2c, 0x63, 0x29, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x66, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65,
+ 0x2e, 0x68, 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x2e,
+ 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x67, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61,
+ 0x72, 0x20, 0x63, 0x20, 0x69, 0x6e, 0x20, 0x62, 0x29, 0x66, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x26,
+ 0x26, 0x28, 0x61, 0x5b, 0x63, 0x5d, 0x3d, 0x62, 0x5b, 0x63, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x66, 0x28, 0x62, 0x2c, 0x22, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e,
+ 0x67, 0x22, 0x29, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x3d, 0x62, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x29, 0x2c, 0x66, 0x28, 0x62,
+ 0x2c, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x22, 0x29, 0x26, 0x26, 0x28, 0x61, 0x2e,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x3d, 0x62, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f,
+ 0x66, 0x29, 0x2c, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x28,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x44, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x21, 0x30, 0x29, 0x2e, 0x75,
+ 0x74, 0x63, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x28,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x3a, 0x21,
+ 0x31, 0x2c, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x3a, 0x5b,
+ 0x5d, 0x2c, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x5b, 0x5d,
+ 0x2c, 0x6f, 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x3a, 0x2d, 0x32, 0x2c, 0x63, 0x68, 0x61,
+ 0x72, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x4f, 0x76, 0x65, 0x72, 0x3a, 0x30, 0x2c, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x21, 0x31, 0x2c, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x69, 0x6e, 0x76, 0x61,
+ 0x6c, 0x69, 0x64, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3a, 0x21, 0x31, 0x2c, 0x75, 0x73, 0x65,
+ 0x72, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x3a, 0x21, 0x31, 0x2c,
+ 0x69, 0x73, 0x6f, 0x3a, 0x21, 0x31, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x6a, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x3d, 0x3d, 0x61, 0x2e, 0x5f, 0x70, 0x66, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x5f, 0x70, 0x66,
+ 0x3d, 0x69, 0x28, 0x29, 0x29, 0x2c, 0x61, 0x2e, 0x5f, 0x70, 0x66, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x28, 0x61, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x3d, 0x3d, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6a, 0x28, 0x61, 0x29, 0x3b, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x56,
+ 0x61, 0x6c, 0x69, 0x64, 0x3d, 0x21, 0x28, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x28, 0x61, 0x2e, 0x5f,
+ 0x64, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x29, 0x7c, 0x7c, 0x21, 0x28,
+ 0x62, 0x2e, 0x6f, 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x3c, 0x30, 0x29, 0x7c, 0x7c, 0x62,
+ 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x7c, 0x7c, 0x62, 0x2e, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x7c, 0x7c, 0x62, 0x2e, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69,
+ 0x64, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x7c, 0x7c, 0x62, 0x2e, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x49, 0x6e, 0x70, 0x75, 0x74, 0x7c, 0x7c, 0x62, 0x2e, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64,
+ 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x7c, 0x7c, 0x62, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e,
+ 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x29, 0x2c, 0x61, 0x2e, 0x5f, 0x73, 0x74,
+ 0x72, 0x69, 0x63, 0x74, 0x26, 0x26, 0x28, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69,
+ 0x64, 0x3d, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x26, 0x26, 0x30, 0x3d,
+ 0x3d, 0x3d, 0x62, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x4f, 0x76, 0x65,
+ 0x72, 0x26, 0x26, 0x30, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x54,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x76, 0x6f,
+ 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x62, 0x69, 0x67, 0x48, 0x6f, 0x75, 0x72,
+ 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x28, 0x61,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x68, 0x28, 0x4e, 0x61, 0x4e, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x3f, 0x67, 0x28,
+ 0x6a, 0x28, 0x62, 0x29, 0x2c, 0x61, 0x29, 0x3a, 0x6a, 0x28, 0x62, 0x29, 0x2e, 0x75, 0x73, 0x65,
+ 0x72, 0x49, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x64, 0x3d, 0x21, 0x30, 0x2c,
+ 0x62, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d,
+ 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x6d,
+ 0x28, 0x62, 0x2e, 0x5f, 0x69, 0x73, 0x41, 0x4d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x62, 0x6a,
+ 0x65, 0x63, 0x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x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x28, 0x62, 0x29, 0x7b, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x62, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44,
+ 0x61, 0x74, 0x65, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x62, 0x2e, 0x5f, 0x64, 0x3f, 0x62,
+ 0x2e, 0x5f, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x3a, 0x4e, 0x61,
+ 0x4e, 0x29, 0x2c, 0x58, 0x63, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x26, 0x26, 0x28, 0x58, 0x63, 0x3d,
+ 0x21, 0x30, 0x2c, 0x61, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65,
+ 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x58, 0x63, 0x3d, 0x21, 0x31, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x6f, 0x66,
+ 0x20, 0x6f, 0x7c, 0x7c, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x26, 0x26, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x21, 0x3d, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x41, 0x4d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x4f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x71,
+ 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x30, 0x3e, 0x61, 0x3f, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x28, 0x61, 0x29, 0x3a, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x72, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x2b, 0x61,
+ 0x2c, 0x63, 0x3d, 0x30, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x30, 0x21, 0x3d, 0x3d,
+ 0x62, 0x26, 0x26, 0x69, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x74, 0x65, 0x28, 0x62, 0x29, 0x26, 0x26,
+ 0x28, 0x63, 0x3d, 0x71, 0x28, 0x62, 0x29, 0x29, 0x2c, 0x63, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x2c, 0x65, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x61, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29,
+ 0x2c, 0x66, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x61, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x2c, 0x67,
+ 0x3d, 0x30, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x3d, 0x30, 0x3b, 0x65, 0x3e, 0x64, 0x3b, 0x64,
+ 0x2b, 0x2b, 0x29, 0x28, 0x63, 0x26, 0x26, 0x61, 0x5b, 0x64, 0x5d, 0x21, 0x3d, 0x3d, 0x62, 0x5b,
+ 0x64, 0x5d, 0x7c, 0x7c, 0x21, 0x63, 0x26, 0x26, 0x72, 0x28, 0x61, 0x5b, 0x64, 0x5d, 0x29, 0x21,
+ 0x3d, 0x3d, 0x72, 0x28, 0x62, 0x5b, 0x64, 0x5d, 0x29, 0x29, 0x26, 0x26, 0x67, 0x2b, 0x2b, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x2b, 0x66, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x28, 0x29, 0x7b, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x75, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3f,
+ 0x61, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2e,
+ 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x22, 0x5f, 0x22, 0x2c, 0x22, 0x2d, 0x22, 0x29,
+ 0x3a, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x76, 0x28, 0x61, 0x29,
+ 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65,
+ 0x2c, 0x66, 0x3d, 0x30, 0x3b, 0x66, 0x3c, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b,
+ 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x65, 0x3d, 0x75, 0x28, 0x61, 0x5b, 0x66, 0x5d, 0x29, 0x2e,
+ 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x22, 0x2d, 0x22, 0x29, 0x2c, 0x62, 0x3d, 0x65, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x63, 0x3d, 0x75, 0x28, 0x61, 0x5b, 0x66, 0x2b, 0x31, 0x5d,
+ 0x29, 0x2c, 0x63, 0x3d, 0x63, 0x3f, 0x63, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x22, 0x2d,
+ 0x22, 0x29, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x3b, 0x62, 0x3e, 0x30, 0x3b, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x64, 0x3d, 0x77, 0x28, 0x65, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x2c, 0x62,
+ 0x29, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2d, 0x22, 0x29, 0x29, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x63, 0x26, 0x26, 0x63, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x3d, 0x62, 0x26, 0x26, 0x73, 0x28, 0x65, 0x2c, 0x63, 0x2c, 0x21,
+ 0x30, 0x29, 0x3e, 0x3d, 0x62, 0x2d, 0x31, 0x29, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x62, 0x2d,
+ 0x2d, 0x7d, 0x66, 0x2b, 0x2b, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x28, 0x61, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x59,
+ 0x63, 0x5b, 0x61, 0x5d, 0x26, 0x26, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,
+ 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
+ 0x26, 0x26, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x26, 0x26, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
+ 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x29, 0x74, 0x72, 0x79, 0x7b, 0x62, 0x3d, 0x56,
+ 0x63, 0x2e, 0x5f, 0x61, 0x62, 0x62, 0x72, 0x2c, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28,
+ 0x22, 0x2e, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x2f, 0x22, 0x2b, 0x61, 0x29, 0x2c, 0x78,
+ 0x28, 0x62, 0x29, 0x7d, 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x63, 0x29, 0x7b, 0x7d, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x59, 0x63, 0x5b, 0x61, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x78, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x26, 0x26, 0x28, 0x63, 0x3d, 0x6d, 0x28,
+ 0x62, 0x29, 0x3f, 0x7a, 0x28, 0x61, 0x29, 0x3a, 0x79, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x2c, 0x63,
+ 0x26, 0x26, 0x28, 0x56, 0x63, 0x3d, 0x63, 0x29, 0x29, 0x2c, 0x56, 0x63, 0x2e, 0x5f, 0x61, 0x62,
+ 0x62, 0x72, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x79, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d,
+ 0x3d, 0x62, 0x3f, 0x28, 0x62, 0x2e, 0x61, 0x62, 0x62, 0x72, 0x3d, 0x61, 0x2c, 0x59, 0x63, 0x5b,
+ 0x61, 0x5d, 0x3d, 0x59, 0x63, 0x5b, 0x61, 0x5d, 0x7c, 0x7c, 0x6e, 0x65, 0x77, 0x20, 0x74, 0x2c,
+ 0x59, 0x63, 0x5b, 0x61, 0x5d, 0x2e, 0x73, 0x65, 0x74, 0x28, 0x62, 0x29, 0x2c, 0x78, 0x28, 0x61,
+ 0x29, 0x2c, 0x59, 0x63, 0x5b, 0x61, 0x5d, 0x29, 0x3a, 0x28, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x20, 0x59, 0x63, 0x5b, 0x61, 0x5d, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7a, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62,
+ 0x3b, 0x69, 0x66, 0x28, 0x61, 0x26, 0x26, 0x61, 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65,
+ 0x26, 0x26, 0x61, 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x5f, 0x61, 0x62, 0x62,
+ 0x72, 0x26, 0x26, 0x28, 0x61, 0x3d, 0x61, 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x2e,
+ 0x5f, 0x61, 0x62, 0x62, 0x72, 0x29, 0x2c, 0x21, 0x61, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x56, 0x63, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x63, 0x28, 0x61, 0x29, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x62, 0x3d, 0x77, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62,
+ 0x3b, 0x61, 0x3d, 0x5b, 0x61, 0x5d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x28,
+ 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x61, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77,
+ 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x3b, 0x5a, 0x63, 0x5b, 0x63, 0x5d, 0x3d, 0x5a,
+ 0x63, 0x5b, 0x63, 0x2b, 0x22, 0x73, 0x22, 0x5d, 0x3d, 0x5a, 0x63, 0x5b, 0x62, 0x5d, 0x3d, 0x61,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x42, 0x28, 0x61, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x3f, 0x5a, 0x63, 0x5b, 0x61, 0x5d, 0x7c, 0x7c, 0x5a,
+ 0x63, 0x5b, 0x61, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28,
+ 0x29, 0x5d, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x43, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c,
+ 0x64, 0x3d, 0x7b, 0x7d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x63, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29,
+ 0x66, 0x28, 0x61, 0x2c, 0x63, 0x29, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x42, 0x28, 0x63, 0x29, 0x2c,
+ 0x62, 0x26, 0x26, 0x28, 0x64, 0x5b, 0x62, 0x5d, 0x3d, 0x61, 0x5b, 0x63, 0x5d, 0x29, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x44, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x20,
+ 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x6f, 0x66, 0x20, 0x46, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x7c, 0x7c, 0x22, 0x5b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x46, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x22, 0x3d, 0x3d, 0x3d, 0x4f, 0x62, 0x6a, 0x65, 0x63,
+ 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x64, 0x3f, 0x28,
+ 0x47, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x62, 0x2c, 0x64, 0x29, 0x2c, 0x61, 0x2e, 0x75, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x63, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3a, 0x46, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x62, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x46, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x69, 0x73, 0x56,
+ 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x61, 0x2e, 0x5f, 0x64, 0x5b, 0x22, 0x67, 0x65, 0x74,
+ 0x22, 0x2b, 0x28, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3f, 0x22, 0x55, 0x54, 0x43,
+ 0x22, 0x3a, 0x22, 0x22, 0x29, 0x2b, 0x62, 0x5d, 0x28, 0x29, 0x3a, 0x4e, 0x61, 0x4e, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x47, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29,
+ 0x7b, 0x61, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x26, 0x26, 0x61, 0x2e,
+ 0x5f, 0x64, 0x5b, 0x22, 0x73, 0x65, 0x74, 0x22, 0x2b, 0x28, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x55,
+ 0x54, 0x43, 0x3f, 0x22, 0x55, 0x54, 0x43, 0x22, 0x3a, 0x22, 0x22, 0x29, 0x2b, 0x62, 0x5d, 0x28,
+ 0x63, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x48, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x6f, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x29, 0x66,
+ 0x6f, 0x72, 0x28, 0x63, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x65, 0x74, 0x28, 0x63, 0x2c, 0x61, 0x5b, 0x63, 0x5d, 0x29, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20,
+ 0x69, 0x66, 0x28, 0x61, 0x3d, 0x42, 0x28, 0x61, 0x29, 0x2c, 0x44, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x5b, 0x61, 0x5d, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x5b, 0x61, 0x5d, 0x28, 0x62, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x49, 0x28, 0x61, 0x2c,
+ 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x22, 0x22, 0x2b, 0x4d, 0x61,
+ 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x61, 0x29, 0x2c, 0x65, 0x3d, 0x62, 0x2d, 0x64, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x66, 0x3d, 0x61, 0x3e, 0x3d, 0x30, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x28, 0x66, 0x3f, 0x63, 0x3f, 0x22, 0x2b, 0x22, 0x3a, 0x22, 0x22, 0x3a,
+ 0x22, 0x2d, 0x22, 0x29, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x31, 0x30,
+ 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x30, 0x2c, 0x65, 0x29, 0x29, 0x2e,
+ 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74,
+ 0x72, 0x28, 0x31, 0x29, 0x2b, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x4a, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65,
+ 0x3d, 0x64, 0x3b, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70,
+ 0x65, 0x6f, 0x66, 0x20, 0x64, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x5b, 0x64, 0x5d, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x61, 0x26, 0x26, 0x28, 0x62, 0x64, 0x5b, 0x61,
+ 0x5d, 0x3d, 0x65, 0x29, 0x2c, 0x62, 0x26, 0x26, 0x28, 0x62, 0x64, 0x5b, 0x62, 0x5b, 0x30, 0x5d,
+ 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x49, 0x28, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x62, 0x5b,
+ 0x31, 0x5d, 0x2c, 0x62, 0x5b, 0x32, 0x5d, 0x29, 0x7d, 0x29, 0x2c, 0x63, 0x26, 0x26, 0x28, 0x62,
+ 0x64, 0x5b, 0x63, 0x5d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61,
+ 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x2e, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c,
+ 0x28, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2c, 0x61, 0x29, 0x7d, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4b, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x2f, 0x5c, 0x5b, 0x5b, 0x5c,
+ 0x73, 0x5c, 0x53, 0x5d, 0x2f, 0x29, 0x3f, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65,
+ 0x28, 0x2f, 0x5e, 0x5c, 0x5b, 0x7c, 0x5c, 0x5d, 0x24, 0x2f, 0x67, 0x2c, 0x22, 0x22, 0x29, 0x3a,
+ 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x2f, 0x5c, 0x5c, 0x2f, 0x67, 0x2c,
+ 0x22, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4c, 0x28, 0x61,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x3d, 0x61, 0x2e, 0x6d, 0x61,
+ 0x74, 0x63, 0x68, 0x28, 0x24, 0x63, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x62, 0x3d, 0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, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x28,
+ 0x62, 0x3d, 0x4e, 0x28, 0x62, 0x2c, 0x61, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61,
+ 0x74, 0x61, 0x28, 0x29, 0x29, 0x2c, 0x61, 0x64, 0x5b, 0x62, 0x5d, 0x3d, 0x61, 0x64, 0x5b, 0x62,
+ 0x5d, 0x7c, 0x7c, 0x4c, 0x28, 0x62, 0x29, 0x2c, 0x61, 0x64, 0x5b, 0x62, 0x5d, 0x28, 0x61, 0x29,
+ 0x29, 0x3a, 0x61, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29,
+ 0x2e, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x62, 0x2e, 0x6c, 0x6f, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x65, 0x46, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x28, 0x61, 0x29, 0x7c, 0x7c, 0x61, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x64,
+ 0x3d, 0x35, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x5f, 0x63, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x49, 0x6e,
+ 0x64, 0x65, 0x78, 0x3d, 0x30, 0x3b, 0x64, 0x3e, 0x3d, 0x30, 0x26, 0x26, 0x5f, 0x63, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x3b, 0x29, 0x61, 0x3d, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c,
+ 0x61, 0x63, 0x65, 0x28, 0x5f, 0x63, 0x2c, 0x63, 0x29, 0x2c, 0x5f, 0x63, 0x2e, 0x6c, 0x61, 0x73,
+ 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x30, 0x2c, 0x64, 0x2d, 0x3d, 0x31, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x4f, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x74, 0x64, 0x5b, 0x61, 0x5d, 0x3d, 0x44,
+ 0x28, 0x62, 0x29, 0x3f, 0x62, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x2c, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x26, 0x26, 0x63, 0x3f,
+ 0x63, 0x3a, 0x62, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x50, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x28, 0x74, 0x64,
+ 0x2c, 0x61, 0x29, 0x3f, 0x74, 0x64, 0x5b, 0x61, 0x5d, 0x28, 0x62, 0x2e, 0x5f, 0x73, 0x74, 0x72,
+ 0x69, 0x63, 0x74, 0x2c, 0x62, 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x29, 0x3a, 0x6e,
+ 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78,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29, 0x7c,
+ 0x5b, 0x5c, 0x5d, 0x7b, 0x7d, 0x5d, 0x2f, 0x67, 0x2c, 0x22, 0x5c, 0x5c, 0x24, 0x26, 0x22, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x62, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x22,
+ 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20,
+ 0x61, 0x26, 0x26, 0x28, 0x61, 0x3d, 0x5b, 0x61, 0x5d, 0x29, 0x2c, 0x22, 0x6e, 0x75, 0x6d, 0x62,
+ 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x26, 0x26, 0x28,
+ 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x63, 0x29, 0x7b,
+ 0x63, 0x5b, 0x62, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x29, 0x7d, 0x29, 0x2c, 0x63, 0x3d, 0x30, 0x3b,
+ 0x63, 0x3c, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x63, 0x2b, 0x2b, 0x29, 0x75,
+ 0x64, 0x5b, 0x61, 0x5b, 0x63, 0x5d, 0x5d, 0x3d, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x54, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x53, 0x28, 0x61, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b,
+ 0x64, 0x2e, 0x5f, 0x77, 0x3d, 0x64, 0x2e, 0x5f, 0x77, 0x7c, 0x7c, 0x7b, 0x7d, 0x2c, 0x62, 0x28,
+ 0x61, 0x2c, 0x64, 0x2e, 0x5f, 0x77, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7d, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x55, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x62, 0x26, 0x26, 0x66, 0x28, 0x75, 0x64, 0x2c, 0x61, 0x29,
+ 0x26, 0x26, 0x75, 0x64, 0x5b, 0x61, 0x5d, 0x28, 0x62, 0x2c, 0x63, 0x2e, 0x5f, 0x61, 0x2c, 0x63,
+ 0x2c, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x56, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x44,
+ 0x61, 0x74, 0x65, 0x28, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x55, 0x54, 0x43, 0x28, 0x61, 0x2c, 0x62,
+ 0x2b, 0x31, 0x2c, 0x30, 0x29, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61, 0x74,
+ 0x65, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x57, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x28, 0x74, 0x68, 0x69,
+ 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7b,
+ 0x69, 0x66, 0x28, 0x65, 0x3d, 0x68, 0x28, 0x5b, 0x32, 0x65, 0x33, 0x2c, 0x64, 0x5d, 0x29, 0x2c,
+ 0x63, 0x26, 0x26, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x4d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x26, 0x26, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x50,
+ 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45,
+ 0x78, 0x70, 0x28, 0x22, 0x5e, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x73, 0x28, 0x65, 0x2c, 0x22, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65,
+ 0x28, 0x22, 0x2e, 0x22, 0x2c, 0x22, 0x22, 0x29, 0x2b, 0x22, 0x24, 0x22, 0x2c, 0x22, 0x69, 0x22,
+ 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x6e,
+ 0x74, 0x68, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x3d, 0x6e, 0x65, 0x77, 0x20,
+ 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x22, 0x5e, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x28, 0x65, 0x2c, 0x22, 0x22,
+ 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x22, 0x2e, 0x22, 0x2c, 0x22, 0x22,
+ 0x29, 0x2b, 0x22, 0x24, 0x22, 0x2c, 0x22, 0x69, 0x22, 0x29, 0x29, 0x2c, 0x63, 0x7c, 0x7c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65,
+ 0x5b, 0x64, 0x5d, 0x7c, 0x7c, 0x28, 0x66, 0x3d, 0x22, 0x5e, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x28, 0x65, 0x2c, 0x22, 0x22, 0x29, 0x2b, 0x22, 0x7c,
+ 0x5e, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68,
+ 0x6f, 0x72, 0x74, 0x28, 0x65, 0x2c, 0x22, 0x22, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x3d, 0x6e,
+ 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x66, 0x2e, 0x72, 0x65, 0x70, 0x6c,
+ 0x61, 0x63, 0x65, 0x28, 0x22, 0x2e, 0x22, 0x2c, 0x22, 0x22, 0x29, 0x2c, 0x22, 0x69, 0x22, 0x29,
+ 0x29, 0x2c, 0x63, 0x26, 0x26, 0x22, 0x4d, 0x4d, 0x4d, 0x4d, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x26,
+ 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x4d, 0x6f, 0x6e, 0x74, 0x68,
+ 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61,
+ 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x63, 0x26,
+ 0x26, 0x22, 0x4d, 0x4d, 0x4d, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x50, 0x61, 0x72,
+ 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x63, 0x26, 0x26, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b,
+ 0x64, 0x5d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x64, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5a, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x61, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x22, 0x73,
+ 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62,
+ 0x26, 0x26, 0x28, 0x62, 0x3d, 0x61, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74,
+ 0x61, 0x28, 0x29, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x28,
+ 0x62, 0x29, 0x2c, 0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70,
+ 0x65, 0x6f, 0x66, 0x20, 0x62, 0x29, 0x3f, 0x61, 0x3a, 0x28, 0x63, 0x3d, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x61, 0x2e, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x2c, 0x56, 0x28,
+ 0x61, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x62, 0x29, 0x29, 0x2c, 0x61, 0x2e, 0x5f,
+ 0x64, 0x5b, 0x22, 0x73, 0x65, 0x74, 0x22, 0x2b, 0x28, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54,
+ 0x43, 0x3f, 0x22, 0x55, 0x54, 0x43, 0x22, 0x3a, 0x22, 0x22, 0x29, 0x2b, 0x22, 0x4d, 0x6f, 0x6e,
+ 0x74, 0x68, 0x22, 0x5d, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x2c, 0x61, 0x29, 0x3a, 0x61, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x24, 0x28, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x62, 0x3f, 0x28, 0x5a, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x62, 0x29, 0x2c, 0x61, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f,
+ 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x29, 0x3a, 0x46, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x4d, 0x6f, 0x6e,
+ 0x74, 0x68, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5f, 0x28,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x56, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x28, 0x29, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x61,
+ 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x45, 0x78, 0x61, 0x63,
+ 0x74, 0x3f, 0x28, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x5f, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x73, 0x52, 0x65, 0x67, 0x65, 0x78, 0x22, 0x29, 0x7c, 0x7c, 0x63, 0x61, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x61, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x72, 0x69,
+ 0x63, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x29, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72,
+ 0x74, 0x53, 0x74, 0x72, 0x69, 0x63, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x26, 0x26, 0x61, 0x3f,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72,
+ 0x74, 0x53, 0x74, 0x72, 0x69, 0x63, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3a, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x52, 0x65,
+ 0x67, 0x65, 0x78, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x61, 0x28,
+ 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x45, 0x78, 0x61, 0x63, 0x74,
+ 0x3f, 0x28, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x22, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68,
+ 0x73, 0x52, 0x65, 0x67, 0x65, 0x78, 0x22, 0x29, 0x7c, 0x7c, 0x63, 0x61, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x61, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x74, 0x72, 0x69, 0x63, 0x74, 0x52, 0x65, 0x67, 0x65,
+ 0x78, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x52, 0x65,
+ 0x67, 0x65, 0x78, 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68,
+ 0x73, 0x53, 0x74, 0x72, 0x69, 0x63, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x26, 0x26, 0x61, 0x3f,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x74, 0x72, 0x69,
+ 0x63, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x73, 0x52, 0x65, 0x67, 0x65, 0x78, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x63, 0x61, 0x28, 0x29, 0x7b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x7d, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x3d, 0x5b, 0x5d, 0x2c, 0x65, 0x3d,
+ 0x5b, 0x5d, 0x2c, 0x66, 0x3d, 0x5b, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x62, 0x3d, 0x30, 0x3b,
+ 0x31, 0x32, 0x3e, 0x62, 0x3b, 0x62, 0x2b, 0x2b, 0x29, 0x63, 0x3d, 0x68, 0x28, 0x5b, 0x32, 0x65,
+ 0x33, 0x2c, 0x62, 0x5d, 0x29, 0x2c, 0x64, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x28, 0x63, 0x2c,
+ 0x22, 0x22, 0x29, 0x29, 0x2c, 0x65, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x28, 0x63, 0x2c, 0x22, 0x22, 0x29, 0x29, 0x2c, 0x66,
+ 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68,
+ 0x73, 0x28, 0x63, 0x2c, 0x22, 0x22, 0x29, 0x29, 0x2c, 0x66, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74,
+ 0x28, 0x63, 0x2c, 0x22, 0x22, 0x29, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x2e, 0x73, 0x6f,
+ 0x72, 0x74, 0x28, 0x61, 0x29, 0x2c, 0x65, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x28, 0x61, 0x29, 0x2c,
+ 0x66, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x28, 0x61, 0x29, 0x2c, 0x62, 0x3d, 0x30, 0x3b, 0x31, 0x32,
+ 0x3e, 0x62, 0x3b, 0x62, 0x2b, 0x2b, 0x29, 0x64, 0x5b, 0x62, 0x5d, 0x3d, 0x52, 0x28, 0x64, 0x5b,
+ 0x62, 0x5d, 0x29, 0x2c, 0x65, 0x5b, 0x62, 0x5d, 0x3d, 0x52, 0x28, 0x65, 0x5b, 0x62, 0x5d, 0x29,
+ 0x2c, 0x66, 0x5b, 0x62, 0x5d, 0x3d, 0x52, 0x28, 0x66, 0x5b, 0x62, 0x5d, 0x29, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3d,
+ 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x22, 0x5e, 0x28, 0x22, 0x2b,
+ 0x66, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x7c, 0x22, 0x29, 0x2b, 0x22, 0x29, 0x22, 0x2c,
+ 0x22, 0x69, 0x22, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68,
+ 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x52, 0x65, 0x67, 0x65, 0x78, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x74, 0x72, 0x69, 0x63, 0x74,
+ 0x52, 0x65, 0x67, 0x65, 0x78, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70,
+ 0x28, 0x22, 0x5e, 0x28, 0x22, 0x2b, 0x65, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x7c, 0x22,
+ 0x29, 0x2b, 0x22, 0x29, 0x24, 0x22, 0x2c, 0x22, 0x69, 0x22, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x53, 0x74, 0x72,
+ 0x69, 0x63, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67,
+ 0x45, 0x78, 0x70, 0x28, 0x22, 0x5e, 0x28, 0x22, 0x2b, 0x64, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28,
+ 0x22, 0x7c, 0x22, 0x29, 0x2b, 0x22, 0x29, 0x24, 0x22, 0x2c, 0x22, 0x69, 0x22, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x62, 0x2c, 0x63, 0x3d, 0x61, 0x2e, 0x5f, 0x61, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x63, 0x26, 0x26, 0x2d, 0x32, 0x3d, 0x3d, 0x3d, 0x6a, 0x28, 0x61, 0x29, 0x2e, 0x6f,
+ 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x26, 0x26, 0x28,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0x3e, 0x39,
+ 0x39, 0x39, 0x3f, 0x42, 0x64, 0x3a, 0x2d, 0x31, 0x2c, 0x6a, 0x28, 0x61, 0x29, 0x2e, 0x5f, 0x6f,
+ 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72,
+ 0x26, 0x26, 0x28, 0x76, 0x64, 0x3e, 0x62, 0x7c, 0x7c, 0x62, 0x3e, 0x78, 0x64, 0x29, 0x26, 0x26,
+ 0x28, 0x62, 0x3d, 0x78, 0x64, 0x29, 0x2c, 0x6a, 0x28, 0x61, 0x29, 0x2e, 0x5f, 0x6f, 0x76, 0x65,
+ 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x57, 0x65, 0x65, 0x6b, 0x73, 0x26, 0x26, 0x2d, 0x31, 0x3d, 0x3d,
+ 0x3d, 0x62, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x43, 0x64, 0x29, 0x2c, 0x6a, 0x28, 0x61, 0x29, 0x2e,
+ 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79,
+ 0x26, 0x26, 0x2d, 0x31, 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x44, 0x64, 0x29,
+ 0x2c, 0x6a, 0x28, 0x61, 0x29, 0x2e, 0x6f, 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x3d, 0x62,
+ 0x29, 0x2c, 0x61, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x61, 0x28,
+ 0x62, 0x29, 0x7b, 0x61, 0x2e, 0x73, 0x75, 0x70, 0x70, 0x72, 0x65, 0x73, 0x73, 0x44, 0x65, 0x70,
+ 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x73,
+ 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x26, 0x26, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x64, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f,
+ 0x6c, 0x65, 0x26, 0x26, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x2e, 0x77, 0x61, 0x72, 0x6e,
+ 0x26, 0x26, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x2e, 0x77, 0x61, 0x72, 0x6e, 0x28, 0x22,
+ 0x44, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x61, 0x72, 0x6e,
+ 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x22, 0x2b, 0x62, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63,
+ 0x3d, 0x21, 0x30, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63,
+ 0x26, 0x26, 0x28, 0x65, 0x61, 0x28, 0x61, 0x2b, 0x22, 0x5c, 0x6e, 0x41, 0x72, 0x67, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x20, 0x22, 0x2b, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x61,
+ 0x6c, 0x6c, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2e, 0x6a, 0x6f,
+ 0x69, 0x6e, 0x28, 0x22, 0x2c, 0x20, 0x22, 0x29, 0x2b, 0x22, 0x5c, 0x6e, 0x22, 0x2b, 0x28, 0x6e,
+ 0x65, 0x77, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x29, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x29,
+ 0x2c, 0x63, 0x3d, 0x21, 0x31, 0x29, 0x2c, 0x62, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d, 0x2c,
+ 0x62, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x61, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x4a, 0x64, 0x5b, 0x61, 0x5d, 0x7c, 0x7c, 0x28, 0x65, 0x61, 0x28, 0x62,
+ 0x29, 0x2c, 0x4a, 0x64, 0x5b, 0x61, 0x5d, 0x3d, 0x21, 0x30, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62,
+ 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x3d, 0x61, 0x2e, 0x5f,
+ 0x69, 0x2c, 0x69, 0x3d, 0x4b, 0x64, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28,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, 0x68, 0x3b, 0x63, 0x3e, 0x62, 0x3b, 0x62, 0x2b, 0x2b, 0x29, 0x69, 0x66, 0x28,
+ 0x4f, 0x64, 0x5b, 0x62, 0x5d, 0x5b, 0x31, 0x5d, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x69, 0x5b,
+ 0x33, 0x5d, 0x29, 0x29, 0x7b, 0x66, 0x3d, 0x28, 0x69, 0x5b, 0x32, 0x5d, 0x7c, 0x7c, 0x22, 0x20,
+ 0x22, 0x29, 0x2b, 0x4f, 0x64, 0x5b, 0x62, 0x5d, 0x5b, 0x30, 0x5d, 0x3b, 0x62, 0x72, 0x65, 0x61,
+ 0x6b, 0x7d, 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x66, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x76, 0x6f, 0x69, 0x64, 0x28, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x3d, 0x21, 0x31, 0x29, 0x7d, 0x69, 0x66, 0x28, 0x21, 0x64, 0x26, 0x26, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x66, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x6f,
+ 0x69, 0x64, 0x28, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x3d, 0x21, 0x31,
+ 0x29, 0x3b, 0x69, 0x66, 0x28, 0x69, 0x5b, 0x34, 0x5d, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x4d,
+ 0x64, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x69, 0x5b, 0x34, 0x5d, 0x29, 0x29, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x76, 0x6f, 0x69, 0x64, 0x28, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x3d, 0x21, 0x31, 0x29, 0x3b, 0x67, 0x3d, 0x22, 0x5a, 0x22, 0x7d, 0x61, 0x2e,
+ 0x5f, 0x66, 0x3d, 0x65, 0x2b, 0x28, 0x66, 0x7c, 0x7c, 0x22, 0x22, 0x29, 0x2b, 0x28, 0x67, 0x7c,
+ 0x7c, 0x22, 0x22, 0x29, 0x2c, 0x77, 0x61, 0x28, 0x61, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20,
+ 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x3d, 0x21, 0x31, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x61, 0x28, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x63, 0x3d, 0x50, 0x64, 0x2e, 0x65, 0x78, 0x65, 0x63, 0x28, 0x62, 0x2e, 0x5f, 0x69, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x3d, 0x63,
+ 0x3f, 0x76, 0x6f, 0x69, 0x64, 0x28, 0x62, 0x2e, 0x5f, 0x64, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44,
+ 0x61, 0x74, 0x65, 0x28, 0x2b, 0x63, 0x5b, 0x31, 0x5d, 0x29, 0x29, 0x3a, 0x28, 0x68, 0x61, 0x28,
+ 0x62, 0x29, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x28, 0x62, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x3d, 0x3d, 0x3d, 0x21, 0x31, 0x26, 0x26, 0x28, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x20, 0x62, 0x2e, 0x5f, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x2c, 0x61, 0x2e, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x46, 0x61, 0x6c,
+ 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x62, 0x29, 0x29, 0x29, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c,
+ 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x68, 0x3d, 0x6e, 0x65, 0x77,
+ 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c,
+ 0x66, 0x2c, 0x67, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x30, 0x30, 0x3e,
+ 0x61, 0x26, 0x26, 0x61, 0x3e, 0x3d, 0x30, 0x26, 0x26, 0x69, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x74,
+ 0x65, 0x28, 0x68, 0x2e, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28,
+ 0x29, 0x29, 0x26, 0x26, 0x68, 0x2e, 0x73, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61,
+ 0x72, 0x28, 0x61, 0x29, 0x2c, 0x68, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x6b, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6e, 0x65, 0x77, 0x20,
+ 0x44, 0x61, 0x74, 0x65, 0x28, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x55, 0x54, 0x43, 0x2e, 0x61, 0x70,
+ 0x70, 0x6c, 0x79, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x73, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x30, 0x30, 0x3e,
+ 0x61, 0x26, 0x26, 0x61, 0x3e, 0x3d, 0x30, 0x26, 0x26, 0x69, 0x73, 0x46, 0x69, 0x6e, 0x69, 0x74,
+ 0x65, 0x28, 0x62, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65,
+ 0x61, 0x72, 0x28, 0x29, 0x29, 0x26, 0x26, 0x62, 0x2e, 0x73, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46,
+ 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x61, 0x29, 0x2c, 0x62, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6d, 0x61, 0x28, 0x61, 0x29, 0x3f, 0x33, 0x36, 0x36, 0x3a, 0x33, 0x36, 0x35,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x61, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x25, 0x34, 0x3d, 0x3d, 0x3d, 0x30, 0x26, 0x26,
+ 0x61, 0x25, 0x31, 0x30, 0x30, 0x21, 0x3d, 0x3d, 0x30, 0x7c, 0x7c, 0x61, 0x25, 0x34, 0x30, 0x30,
+ 0x3d, 0x3d, 0x3d, 0x30, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x61,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6d, 0x61, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x6f, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x3d, 0x37, 0x2b, 0x62, 0x2d, 0x63, 0x2c, 0x65, 0x3d, 0x28, 0x37, 0x2b, 0x6b, 0x61,
+ 0x28, 0x61, 0x2c, 0x30, 0x2c, 0x64, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61,
+ 0x79, 0x28, 0x29, 0x2d, 0x62, 0x29, 0x25, 0x37, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2d,
+ 0x65, 0x2b, 0x64, 0x2d, 0x31, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70,
+ 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x66, 0x2c, 0x67, 0x2c, 0x68, 0x3d, 0x28, 0x37, 0x2b, 0x63, 0x2d, 0x64, 0x29, 0x25, 0x37,
+ 0x2c, 0x69, 0x3d, 0x6f, 0x61, 0x28, 0x61, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x2c, 0x6a, 0x3d, 0x31,
+ 0x2b, 0x37, 0x2a, 0x28, 0x62, 0x2d, 0x31, 0x29, 0x2b, 0x68, 0x2b, 0x69, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x30, 0x3e, 0x3d, 0x6a, 0x3f, 0x28, 0x66, 0x3d, 0x61, 0x2d, 0x31, 0x2c,
+ 0x67, 0x3d, 0x6c, 0x61, 0x28, 0x66, 0x29, 0x2b, 0x6a, 0x29, 0x3a, 0x6a, 0x3e, 0x6c, 0x61, 0x28,
+ 0x61, 0x29, 0x3f, 0x28, 0x66, 0x3d, 0x61, 0x2b, 0x31, 0x2c, 0x67, 0x3d, 0x6a, 0x2d, 0x6c, 0x61,
+ 0x28, 0x61, 0x29, 0x29, 0x3a, 0x28, 0x66, 0x3d, 0x61, 0x2c, 0x67, 0x3d, 0x6a, 0x29, 0x2c, 0x7b,
+ 0x79, 0x65, 0x61, 0x72, 0x3a, 0x66, 0x2c, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72,
+ 0x3a, 0x67, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x71, 0x61, 0x28,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x2c, 0x66,
+ 0x3d, 0x6f, 0x61, 0x28, 0x61, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x62, 0x2c, 0x63,
+ 0x29, 0x2c, 0x67, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x28,
+ 0x61, 0x2e, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2d, 0x66, 0x2d,
+ 0x31, 0x29, 0x2f, 0x37, 0x29, 0x2b, 0x31, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31,
+ 0x3e, 0x67, 0x3f, 0x28, 0x65, 0x3d, 0x61, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2d, 0x31,
+ 0x2c, 0x64, 0x3d, 0x67, 0x2b, 0x72, 0x61, 0x28, 0x65, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x29, 0x3a,
+ 0x67, 0x3e, 0x72, 0x61, 0x28, 0x61, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x62, 0x2c,
+ 0x63, 0x29, 0x3f, 0x28, 0x64, 0x3d, 0x67, 0x2d, 0x72, 0x61, 0x28, 0x61, 0x2e, 0x79, 0x65, 0x61,
+ 0x72, 0x28, 0x29, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x2c, 0x65, 0x3d, 0x61, 0x2e, 0x79, 0x65, 0x61,
+ 0x72, 0x28, 0x29, 0x2b, 0x31, 0x29, 0x3a, 0x28, 0x65, 0x3d, 0x61, 0x2e, 0x79, 0x65, 0x61, 0x72,
+ 0x28, 0x29, 0x2c, 0x64, 0x3d, 0x67, 0x29, 0x2c, 0x7b, 0x77, 0x65, 0x65, 0x6b, 0x3a, 0x64, 0x2c,
+ 0x79, 0x65, 0x61, 0x72, 0x3a, 0x65, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x72, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64,
+ 0x3d, 0x6f, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x2c, 0x65, 0x3d, 0x6f, 0x61, 0x28,
+ 0x61, 0x2b, 0x31, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x28,
+ 0x6c, 0x61, 0x28, 0x61, 0x29, 0x2d, 0x64, 0x2b, 0x65, 0x29, 0x2f, 0x37, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x3f, 0x61,
+ 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x62, 0x3f, 0x62, 0x3a, 0x63, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x61, 0x28, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x63, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x61, 0x2e, 0x6e, 0x6f, 0x77,
+ 0x28, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x2e, 0x5f, 0x75, 0x73,
+ 0x65, 0x55, 0x54, 0x43, 0x3f, 0x5b, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75,
+ 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54,
+ 0x43, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x2c, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54,
+ 0x43, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x5d, 0x3a, 0x5b, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x46,
+ 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x4d,
+ 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x2c, 0x63, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65,
+ 0x28, 0x29, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x61, 0x28,
+ 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66,
+ 0x3d, 0x5b, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x2e, 0x5f, 0x64, 0x29, 0x7b, 0x66, 0x6f,
+ 0x72, 0x28, 0x64, 0x3d, 0x74, 0x61, 0x28, 0x61, 0x29, 0x2c, 0x61, 0x2e, 0x5f, 0x77, 0x26, 0x26,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x2e, 0x5f, 0x61, 0x5b, 0x78, 0x64, 0x5d, 0x26, 0x26,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x2e, 0x5f, 0x61, 0x5b, 0x77, 0x64, 0x5d, 0x26, 0x26,
+ 0x76, 0x61, 0x28, 0x61, 0x29, 0x2c, 0x61, 0x2e, 0x5f, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65,
+ 0x61, 0x72, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x73, 0x61, 0x28, 0x61, 0x2e, 0x5f, 0x61, 0x5b, 0x76,
+ 0x64, 0x5d, 0x2c, 0x64, 0x5b, 0x76, 0x64, 0x5d, 0x29, 0x2c, 0x61, 0x2e, 0x5f, 0x64, 0x61, 0x79,
+ 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x3e, 0x6c, 0x61, 0x28, 0x65, 0x29, 0x26, 0x26, 0x28, 0x6a,
+ 0x28, 0x61, 0x29, 0x2e, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x44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0x36, 0x29, 0x26, 0x26, 0x28, 0x69, 0x3d, 0x21, 0x30, 0x29,
+ 0x29, 0x3a, 0x65, 0x3d, 0x66, 0x29, 0x2c, 0x31, 0x3e, 0x64, 0x7c, 0x7c, 0x64, 0x3e, 0x72, 0x61,
+ 0x28, 0x63, 0x2c, 0x66, 0x2c, 0x67, 0x29, 0x3f, 0x6a, 0x28, 0x61, 0x29, 0x2e, 0x5f, 0x6f, 0x76,
+ 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x57, 0x65, 0x65, 0x6b, 0x73, 0x3d, 0x21, 0x30, 0x3a, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x69, 0x3f, 0x6a, 0x28, 0x61, 0x29, 0x2e, 0x5f, 0x6f, 0x76, 0x65,
+ 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x3d, 0x21, 0x30, 0x3a,
+ 0x28, 0x68, 0x3d, 0x70, 0x61, 0x28, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x29,
+ 0x2c, 0x61, 0x2e, 0x5f, 0x61, 0x5b, 0x76, 0x64, 0x5d, 0x3d, 0x68, 0x2e, 0x79, 0x65, 0x61, 0x72,
+ 0x2c, 0x61, 0x2e, 0x5f, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x3d, 0x68, 0x2e,
+ 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x61, 0x28, 0x62, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x62, 0x2e, 0x5f,
+ 0x66, 0x3d, 0x3d, 0x3d, 0x61, 0x2e, 0x49, 0x53, 0x4f, 0x5f, 0x38, 0x36, 0x30, 0x31, 0x29, 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74, 0x72, 0x28, 0x30, 0x2c, 0x68, 0x2e, 0x69, 0x6e, 0x64, 0x65,
+ 0x78, 0x4f, 0x66, 0x28, 0x64, 0x29, 0x29, 0x2c, 0x67, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3e, 0x30, 0x26, 0x26, 0x6a, 0x28, 0x62, 0x29, 0x2e, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x49,
+ 0x6e, 0x70, 0x75, 0x74, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x67, 0x29, 0x2c, 0x68, 0x3d, 0x68,
+ 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x68, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66,
+ 0x28, 0x64, 0x29, 0x2b, 0x64, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x2c, 0x6b, 0x2b,
+ 0x3d, 0x64, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x2c, 0x62, 0x64, 0x5b, 0x66, 0x5d,
+ 0x3f, 0x28, 0x64, 0x3f, 0x6a, 0x28, 0x62, 0x29, 0x2e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x3d, 0x21,
+ 0x31, 0x3a, 0x6a, 0x28, 0x62, 0x29, 0x2e, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x54, 0x6f, 0x6b,
+ 0x65, 0x6e, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x66, 0x29, 0x2c, 0x55, 0x28, 0x66, 0x2c,
+ 0x64, 0x2c, 0x62, 0x29, 0x29, 0x3a, 0x62, 0x2e, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x26,
+ 0x26, 0x21, 0x64, 0x26, 0x26, 0x6a, 0x28, 0x62, 0x29, 0x2e, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64,
+ 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x66, 0x29, 0x3b, 0x6a,
+ 0x28, 0x62, 0x29, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x73, 0x4c, 0x65, 0x66, 0x74, 0x4f, 0x76, 0x65,
+ 0x72, 0x3d, 0x69, 0x2d, 0x6b, 0x2c, 0x68, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x30,
+ 0x26, 0x26, 0x6a, 0x28, 0x62, 0x29, 0x2e, 0x75, 0x6e, 0x75, 0x73, 0x65, 0x64, 0x49, 0x6e, 0x70,
+ 0x75, 0x74, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x68, 0x29, 0x2c, 0x6a, 0x28, 0x62, 0x29, 0x2e,
+ 0x62, 0x69, 0x67, 0x48, 0x6f, 0x75, 0x72, 0x3d, 0x3d, 0x3d, 0x21, 0x30, 0x26, 0x26, 0x62, 0x2e,
+ 0x5f, 0x61, 0x5b, 0x79, 0x64, 0x5d, 0x3c, 0x3d, 0x31, 0x32, 0x26, 0x26, 0x62, 0x2e, 0x5f, 0x61,
+ 0x5b, 0x79, 0x64, 0x5d, 0x3e, 0x30, 0x26, 0x26, 0x28, 0x6a, 0x28, 0x62, 0x29, 0x2e, 0x62, 0x69,
+ 0x67, 0x48, 0x6f, 0x75, 0x72, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x29, 0x2c, 0x62, 0x2e,
+ 0x5f, 0x61, 0x5b, 0x79, 0x64, 0x5d, 0x3d, 0x78, 0x61, 0x28, 0x62, 0x2e, 0x5f, 0x6c, 0x6f, 0x63,
+ 0x61, 0x6c, 0x65, 0x2c, 0x62, 0x2e, 0x5f, 0x61, 0x5b, 0x79, 0x64, 0x5d, 0x2c, 0x62, 0x2e, 0x5f,
+ 0x6d, 0x65, 0x72, 0x69, 0x64, 0x69, 0x65, 0x6d, 0x29, 0x2c, 0x75, 0x61, 0x28, 0x62, 0x29, 0x2c,
+ 0x64, 0x61, 0x28, 0x62, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x78,
+ 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x63, 0x3f, 0x62, 0x3a,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x2e, 0x6d, 0x65, 0x72, 0x69, 0x64, 0x69, 0x65, 0x6d,
+ 0x48, 0x6f, 0x75, 0x72, 0x3f, 0x61, 0x2e, 0x6d, 0x65, 0x72, 0x69, 0x64, 0x69, 0x65, 0x6d, 0x48,
+ 0x6f, 0x75, 0x72, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61,
+ 0x2e, 0x69, 0x73, 0x50, 0x4d, 0x3f, 0x28, 0x64, 0x3d, 0x61, 0x2e, 0x69, 0x73, 0x50, 0x4d, 0x28,
+ 0x63, 0x29, 0x2c, 0x64, 0x26, 0x26, 0x31, 0x32, 0x3e, 0x62, 0x26, 0x26, 0x28, 0x62, 0x2b, 0x3d,
+ 0x31, 0x32, 0x29, 0x2c, 0x64, 0x7c, 0x7c, 0x31, 0x32, 0x21, 0x3d, 0x3d, 0x62, 0x7c, 0x7c, 0x28,
+ 0x62, 0x3d, 0x30, 0x29, 0x2c, 0x62, 0x29, 0x3a, 0x62, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x79, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63,
+ 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x3b, 0x69, 0x66, 0x28, 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x2e,
+ 0x5f, 0x66, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6a, 0x28, 0x61, 0x29, 0x2e, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x46, 0x6f, 0x72,
+ 0x6d, 0x61, 0x74, 0x3d, 0x21, 0x30, 0x2c, 0x76, 0x6f, 0x69, 0x64, 0x28, 0x61, 0x2e, 0x5f, 0x64,
+ 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x4e, 0x61, 0x4e, 0x29, 0x29, 0x3b,
+ 0x66, 0x6f, 0x72, 0x28, 0x65, 0x3d, 0x30, 0x3b, 0x65, 0x3c, 0x61, 0x2e, 0x5f, 0x66, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x65, 0x2b, 0x2b, 0x29, 0x66, 0x3d, 0x30, 0x2c, 0x62, 0x3d,
+ 0x6e, 0x28, 0x7b, 0x7d, 0x2c, 0x61, 0x29, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x2e,
+ 0x5f, 0x75, 0x73, 0x65, 0x55, 0x54, 0x43, 0x26, 0x26, 0x28, 0x62, 0x2e, 0x5f, 0x75, 0x73, 0x65,
+ 0x55, 0x54, 0x43, 0x3d, 0x61, 0x2e, 0x5f, 0x75, 0x73, 0x65, 0x55, 0x54, 0x43, 0x29, 0x2c, 0x62,
+ 0x2e, 0x5f, 0x66, 0x3d, 0x61, 0x2e, 0x5f, 0x66, 0x5b, 0x65, 0x5d, 0x2c, 0x77, 0x61, 0x28, 0x62,
+ 0x29, 0x2c, 0x6b, 0x28, 0x62, 0x29, 0x26, 0x26, 0x28, 0x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 0x72, 0x2c, 0x62, 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x2c, 0x62, 0x2e, 0x73, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x2c, 0x62, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f,
+ 0x6e, 0x64, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x26, 0x26, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49,
+ 0x6e, 0x74, 0x28, 0x61, 0x2c, 0x31, 0x30, 0x29, 0x7d, 0x29, 0x2c, 0x75, 0x61, 0x28, 0x61, 0x29,
+ 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x61, 0x28, 0x61, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x6f, 0x28, 0x64, 0x61, 0x28,
+ 0x42, 0x61, 0x28, 0x61, 0x29, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62,
+ 0x2e, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x44, 0x61, 0x79, 0x26, 0x26, 0x28, 0x62, 0x2e, 0x61, 0x64,
+ 0x64, 0x28, 0x31, 0x2c, 0x22, 0x64, 0x22, 0x29, 0x2c, 0x62, 0x2e, 0x5f, 0x6e, 0x65, 0x78, 0x74,
+ 0x44, 0x61, 0x79, 0x3d, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x29, 0x2c, 0x62, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x42, 0x61, 0x28, 0x61, 0x29, 0x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3a, 0x65, 0x3f, 0x77, 0x61, 0x28, 0x61, 0x29, 0x3a, 0x64, 0x28, 0x62, 0x29,
+ 0x3f, 0x61, 0x2e, 0x5f, 0x64, 0x3d, 0x62, 0x3a, 0x43, 0x61, 0x28, 0x61, 0x29, 0x2c, 0x6b, 0x28,
+ 0x61, 0x29, 0x7c, 0x7c, 0x28, 0x61, 0x2e, 0x5f, 0x64, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x2c,
+ 0x61, 0x29, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x61, 0x28,
+ 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x3d, 0x62, 0x2e, 0x5f, 0x69, 0x3b, 0x76, 0x6f,
+ 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x66, 0x3f, 0x62, 0x2e, 0x5f, 0x64, 0x3d, 0x6e, 0x65,
+ 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x61, 0x2e, 0x6e, 0x6f, 0x77, 0x28, 0x29, 0x29, 0x3a,
+ 0x64, 0x28, 0x66, 0x29, 0x3f, 0x62, 0x2e, 0x5f, 0x64, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61,
+ 0x74, 0x65, 0x28, 0x2b, 0x66, 0x29, 0x3a, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d,
+ 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x66, 0x3f, 0x69, 0x61, 0x28, 0x62, 0x29, 0x3a,
+ 0x63, 0x28, 0x66, 0x29, 0x3f, 0x28, 0x62, 0x2e, 0x5f, 0x61, 0x3d, 0x65, 0x28, 0x66, 0x2e, 0x73,
+ 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x29, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65,
+ 0x49, 0x6e, 0x74, 0x28, 0x61, 0x2c, 0x31, 0x30, 0x29, 0x7d, 0x29, 0x2c, 0x75, 0x61, 0x28, 0x62,
+ 0x29, 0x29, 0x3a, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70,
+ 0x65, 0x6f, 0x66, 0x20, 0x66, 0x3f, 0x7a, 0x61, 0x28, 0x62, 0x29, 0x3a, 0x22, 0x6e, 0x75, 0x6d,
+ 0x62, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x66, 0x3f, 0x62,
+ 0x2e, 0x5f, 0x64, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x66, 0x29, 0x3a,
+ 0x61, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x70, 0x75,
+ 0x74, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x62, 0x29, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x44, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64,
+ 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x3d, 0x7b, 0x7d, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x22, 0x62, 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x22, 0x3d, 0x3d, 0x74, 0x79,
+ 0x70, 0x65, 0x6f, 0x66, 0x20, 0x63, 0x26, 0x26, 0x28, 0x64, 0x3d, 0x63, 0x2c, 0x63, 0x3d, 0x76,
+ 0x6f, 0x69, 0x64, 0x20, 0x30, 0x29, 0x2c, 0x66, 0x2e, 0x5f, 0x69, 0x73, 0x41, 0x4d, 0x6f, 0x6d,
+ 0x65, 0x6e, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x21, 0x30, 0x2c, 0x66, 0x2e, 0x5f,
+ 0x75, 0x73, 0x65, 0x55, 0x54, 0x43, 0x3d, 0x66, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3d,
+ 0x65, 0x2c, 0x66, 0x2e, 0x5f, 0x6c, 0x3d, 0x63, 0x2c, 0x66, 0x2e, 0x5f, 0x69, 0x3d, 0x61, 0x2c,
+ 0x66, 0x2e, 0x5f, 0x66, 0x3d, 0x62, 0x2c, 0x66, 0x2e, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74,
+ 0x3d, 0x64, 0x2c, 0x41, 0x61, 0x28, 0x66, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x45, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x44, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c,
+ 0x21, 0x31, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x46, 0x61, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x3b, 0x69, 0x66, 0x28,
+ 0x31, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26, 0x63, 0x28,
+ 0x62, 0x5b, 0x30, 0x5d, 0x29, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x62, 0x5b, 0x30, 0x5d, 0x29, 0x2c,
+ 0x21, 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x45, 0x61, 0x28, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x64, 0x3d, 0x62, 0x5b, 0x30, 0x5d,
+ 0x2c, 0x65, 0x3d, 0x31, 0x3b, 0x65, 0x3c, 0x62, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b,
+ 0x2b, 0x2b, 0x65, 0x29, 0x28, 0x21, 0x62, 0x5b, 0x65, 0x5d, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x28, 0x29, 0x7c, 0x7c, 0x62, 0x5b, 0x65, 0x5d, 0x5b, 0x61, 0x5d, 0x28, 0x64, 0x29,
+ 0x29, 0x26, 0x26, 0x28, 0x64, 0x3d, 0x62, 0x5b, 0x65, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x47, 0x61,
+ 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x5b, 0x5d, 0x2e, 0x73, 0x6c, 0x69, 0x63,
+ 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x2c, 0x30, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x46, 0x61, 0x28, 0x22, 0x69,
+ 0x73, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x22, 0x2c, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x48, 0x61, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d,
+ 0x5b, 0x5d, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x30, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x46, 0x61, 0x28, 0x22, 0x69, 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x22, 0x2c, 0x61,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x49, 0x61, 0x28, 0x61, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x43, 0x28, 0x61, 0x29, 0x2c, 0x63, 0x3d, 0x62, 0x2e,
+ 0x79, 0x65, 0x61, 0x72, 0x7c, 0x7c, 0x30, 0x2c, 0x64, 0x3d, 0x62, 0x2e, 0x71, 0x75, 0x61, 0x72,
+ 0x74, 0x65, 0x72, 0x7c, 0x7c, 0x30, 0x2c, 0x65, 0x3d, 0x62, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68,
+ 0x7c, 0x7c, 0x30, 0x2c, 0x66, 0x3d, 0x62, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x7c, 0x7c, 0x30, 0x2c,
+ 0x67, 0x3d, 0x62, 0x2e, 0x64, 0x61, 0x79, 0x7c, 0x7c, 0x30, 0x2c, 0x68, 0x3d, 0x62, 0x2e, 0x68,
+ 0x6f, 0x75, 0x72, 0x7c, 0x7c, 0x30, 0x2c, 0x69, 0x3d, 0x62, 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74,
+ 0x65, 0x7c, 0x7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, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x20,
+ 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x6f, 0x66, 0x20, 0x49, 0x61, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4b, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x4a,
+ 0x28, 0x61, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x74, 0x63,
+ 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x2c, 0x63, 0x3d, 0x22, 0x2b, 0x22, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x30, 0x3e, 0x61, 0x26, 0x26, 0x28, 0x61, 0x3d, 0x2d, 0x61,
+ 0x2c, 0x63, 0x3d, 0x22, 0x2d, 0x22, 0x29, 0x2c, 0x63, 0x2b, 0x49, 0x28, 0x7e, 0x7e, 0x28, 0x61,
+ 0x2f, 0x36, 0x30, 0x29, 0x2c, 0x32, 0x29, 0x2b, 0x62, 0x2b, 0x49, 0x28, 0x7e, 0x7e, 0x61, 0x25,
+ 0x36, 0x30, 0x2c, 0x32, 0x29, 0x7d, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x4c, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x28,
+ 0x62, 0x7c, 0x7c, 0x22, 0x22, 0x29, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x61, 0x29, 0x7c,
+ 0x7c, 0x5b, 0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0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28,
+ 0x2b, 0x65, 0x2e, 0x5f, 0x64, 0x2b, 0x66, 0x29, 0x2c, 0x61, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x65, 0x2c, 0x21, 0x31, 0x29, 0x2c, 0x65, 0x29,
+ 0x3a, 0x45, 0x61, 0x28, 0x62, 0x29, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x28, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x35, 0x2a, 0x2d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f,
+ 0x75, 0x6e, 0x64, 0x28, 0x61, 0x2e, 0x5f, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65,
+ 0x7a, 0x6f, 0x6e, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x2f, 0x31, 0x35, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x61, 0x28, 0x62, 0x2c, 0x63,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x2c, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x7c, 0x7c, 0x30, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x62, 0x3f, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x62, 0x3f, 0x62, 0x3d, 0x4c, 0x61,
+ 0x28, 0x71, 0x64, 0x2c, 0x62, 0x29, 0x3a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28,
+ 0x62, 0x29, 0x3c, 0x31, 0x36, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x36, 0x30, 0x2a, 0x62, 0x29, 0x2c,
+ 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x26, 0x26, 0x63, 0x26,
+ 0x26, 0x28, 0x64, 0x3d, 0x4e, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x62, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3d, 0x21, 0x30, 0x2c, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x21, 0x3d, 0x64, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x64, 0x2c,
+ 0x22, 0x6d, 0x22, 0x29, 0x2c, 0x65, 0x21, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x28, 0x21, 0x63, 0x7c,
+ 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x50,
+ 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x3f, 0x63, 0x62, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x5a, 0x61, 0x28, 0x62, 0x2d, 0x65, 0x2c, 0x22, 0x6d, 0x22, 0x29, 0x2c, 0x31, 0x2c, 0x21, 0x31,
+ 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e,
+ 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x7c, 0x7c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73,
+ 0x73, 0x3d, 0x21, 0x30, 0x2c, 0x61, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x66, 0x66,
+ 0x73, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x50, 0x72, 0x6f, 0x67, 0x72,
+ 0x65, 0x73, 0x73, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29,
+ 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3f, 0x65, 0x3a, 0x4e,
+ 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x62, 0x3f,
+ 0x74, 0x68, 0x69, 0x73, 0x3a, 0x4e, 0x61, 0x4e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x50, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x3f, 0x28, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e,
+ 0x67, 0x22, 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x26, 0x26, 0x28, 0x61,
+ 0x3d, 0x2d, 0x61, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66,
+ 0x73, 0x65, 0x74, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3a, 0x2d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x51, 0x61, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x4f,
+ 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x30, 0x2c, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x26, 0x26, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x30, 0x2c,
+ 0x61, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3d, 0x21,
+ 0x31, 0x2c, 0x61, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x75, 0x62, 0x74, 0x72, 0x61,
+ 0x63, 0x74, 0x28, 0x4e, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x22, 0x6d, 0x22, 0x29,
+ 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x53, 0x61, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x74, 0x7a, 0x6d, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66,
+ 0x66, 0x73, 0x65, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x74, 0x7a, 0x6d, 0x29, 0x3a,
+ 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75,
+ 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x4c, 0x61, 0x28, 0x70, 0x64, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x61, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64,
+ 0x28, 0x29, 0x3f, 0x28, 0x61, 0x3d, 0x61, 0x3f, 0x45, 0x61, 0x28, 0x61, 0x29, 0x2e, 0x75, 0x74,
+ 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x3a, 0x30, 0x2c, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x2d, 0x61, 0x29,
+ 0x25, 0x36, 0x30, 0x3d, 0x3d, 0x3d, 0x30, 0x29, 0x3a, 0x21, 0x31, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x55, 0x61, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28,
+ 0x29, 0x3e, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x6d,
+ 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x30, 0x29, 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65,
+ 0x74, 0x28, 0x29, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66,
+ 0x73, 0x65, 0x74, 0x28, 0x29, 0x3e, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65,
+ 0x28, 0x29, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x35, 0x29, 0x2e, 0x75, 0x74, 0x63, 0x4f,
+ 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x56, 0x61, 0x28, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x6d, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x69, 0x73, 0x44, 0x53, 0x54, 0x53, 0x68, 0x69, 0x66, 0x74, 0x65, 0x64, 0x29, 0x29,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x44,
+ 0x53, 0x54, 0x53, 0x68, 0x69, 0x66, 0x74, 0x65, 0x64, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d,
+ 0x7b, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x6e, 0x28, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c,
+ 0x61, 0x3d, 0x42, 0x61, 0x28, 0x61, 0x29, 0x2c, 0x61, 0x2e, 0x5f, 0x61, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x62, 0x3d, 0x61, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3f, 0x68, 0x28, 0x61,
+ 0x2e, 0x5f, 0x61, 0x29, 0x3a, 0x45, 0x61, 0x28, 0x61, 0x2e, 0x5f, 0x61, 0x29, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x44, 0x53, 0x54, 0x53, 0x68, 0x69, 0x66, 0x74, 0x65, 0x64,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x26,
+ 0x26, 0x73, 0x28, 0x61, 0x2e, 0x5f, 0x61, 0x2c, 0x62, 0x2e, 0x74, 0x6f, 0x41, 0x72, 0x72, 0x61,
+ 0x79, 0x28, 0x29, 0x29, 0x3e, 0x30, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x69, 0x73, 0x44, 0x53, 0x54, 0x53, 0x68, 0x69, 0x66, 0x74, 0x65, 0x64, 0x3d, 0x21,
+ 0x31, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69,
+ 0x73, 0x44, 0x53, 0x54, 0x53, 0x68, 0x69, 0x66, 0x74, 0x65, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x57, 0x61, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f,
+ 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3a, 0x21, 0x31, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x58, 0x61, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69,
+ 0x64, 0x28, 0x29, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3a,
+ 0x21, 0x31, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x59, 0x61, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,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0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x73, 0x29, 0x2c, 0x64, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x49, 0x61, 0x28, 0x67,
+ 0x29, 0x2c, 0x4a, 0x61, 0x28, 0x61, 0x29, 0x26, 0x26, 0x66, 0x28, 0x61, 0x2c, 0x22, 0x5f, 0x6c,
+ 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x22, 0x29, 0x26, 0x26, 0x28, 0x64, 0x2e, 0x5f, 0x6c, 0x6f, 0x63,
+ 0x61, 0x6c, 0x65, 0x3d, 0x61, 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x29, 0x2c, 0x64,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x24, 0x61, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x61, 0x26, 0x26, 0x70, 0x61, 0x72, 0x73, 0x65,
+ 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x61, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28,
+ 0x22, 0x2c, 0x22, 0x2c, 0x22, 0x2e, 0x22, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x28, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x28, 0x63, 0x29, 0x3f, 0x30, 0x3a, 0x63, 0x29, 0x2a, 0x62,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5f, 0x61, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x7b, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x30, 0x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 0x62,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x26, 0x26, 0x62, 0x2e, 0x69, 0x73,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x28, 0x62, 0x3d, 0x4d, 0x61, 0x28, 0x62, 0x2c,
+ 0x61, 0x29, 0x2c, 0x61, 0x2e, 0x69, 0x73, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28, 0x62, 0x29,
+ 0x3f, 0x63, 0x3d, 0x5f, 0x61, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x3a, 0x28, 0x63, 0x3d, 0x5f, 0x61,
+ 0x28, 0x62, 0x2c, 0x61, 0x29, 0x2c, 0x63, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63,
+ 0x6f, 0x6e, 0x64, 0x73, 0x3d, 0x2d, 0x63, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63,
+ 0x6f, 0x6e, 0x64, 0x73, 0x2c, 0x63, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x3d, 0x2d, 0x63,
+ 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x29, 0x2c, 0x63, 0x29, 0x3a, 0x7b, 0x6d, 0x69, 0x6c,
+ 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x30, 0x2c, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x73, 0x3a, 0x30, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62,
+ 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x65, 0x2c, 0x66, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d,
+ 0x3d, 0x3d, 0x64, 0x7c, 0x7c, 0x69, 0x73, 0x4e, 0x61, 0x4e, 0x28, 0x2b, 0x64, 0x29, 0x7c, 0x7c,
+ 0x28, 0x67, 0x61, 0x28, 0x62, 0x2c, 0x22, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2e,
+ 0x22, 0x2b, 0x62, 0x2b, 0x22, 0x28, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x20, 0x6e, 0x75,
+ 0x6d, 0x62, 0x65, 0x72, 0x29, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61,
+ 0x74, 0x65, 0x64, 0x2e, 0x20, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x75, 0x73, 0x65, 0x20,
+ 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2e, 0x22, 0x2b, 0x62, 0x2b, 0x22, 0x28, 0x6e,
+ 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2c, 0x20, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x29, 0x2e, 0x22,
+ 0x29, 0x2c, 0x66, 0x3d, 0x63, 0x2c, 0x63, 0x3d, 0x64, 0x2c, 0x64, 0x3d, 0x66, 0x29, 0x2c, 0x63,
+ 0x3d, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x63, 0x3f, 0x2b, 0x63, 0x3a, 0x63, 0x2c, 0x65, 0x3d, 0x5a, 0x61, 0x28, 0x63, 0x2c,
+ 0x64, 0x29, 0x2c, 0x63, 0x62, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x65, 0x2c, 0x61, 0x29, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63,
+ 0x62, 0x28, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66,
+ 0x3d, 0x63, 0x2e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,
+ 0x2c, 0x67, 0x3d, 0x63, 0x2e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x2c, 0x68, 0x3d, 0x63, 0x2e, 0x5f,
+ 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x3b, 0x62, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64,
+ 0x28, 0x29, 0x26, 0x26, 0x28, 0x65, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x65, 0x3f, 0x21,
+ 0x30, 0x3a, 0x65, 0x2c, 0x66, 0x26, 0x26, 0x62, 0x2e, 0x5f, 0x64, 0x2e, 0x73, 0x65, 0x74, 0x54,
+ 0x69, 0x6d, 0x65, 0x28, 0x2b, 0x62, 0x2e, 0x5f, 0x64, 0x2b, 0x66, 0x2a, 0x64, 0x29, 0x2c, 0x67,
+ 0x26, 0x26, 0x47, 0x28, 0x62, 0x2c, 0x22, 0x44, 0x61, 0x74, 0x65, 0x22, 0x2c, 0x46, 0x28, 0x62,
+ 0x2c, 0x22, 0x44, 0x61, 0x74, 0x65, 0x22, 0x29, 0x2b, 0x67, 0x2a, 0x64, 0x29, 0x2c, 0x68, 0x26,
+ 0x26, 0x5a, 0x28, 0x62, 0x2c, 0x46, 0x28, 0x62, 0x2c, 0x22, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x22,
+ 0x29, 0x2b, 0x68, 0x2a, 0x64, 0x29, 0x2c, 0x65, 0x26, 0x26, 0x61, 0x2e, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x62, 0x2c, 0x67, 0x7c, 0x7c, 0x68, 0x29,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x62, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x61, 0x7c, 0x7c, 0x45, 0x61, 0x28, 0x29,
+ 0x2c, 0x64, 0x3d, 0x4d, 0x61, 0x28, 0x63, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x73, 0x74,
+ 0x61, 0x72, 0x74, 0x4f, 0x66, 0x28, 0x22, 0x64, 0x61, 0x79, 0x22, 0x29, 0x2c, 0x65, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x64, 0x69, 0x66, 0x66, 0x28, 0x64, 0x2c, 0x22, 0x64, 0x61, 0x79, 0x73,
+ 0x22, 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x66, 0x3d, 0x2d, 0x36, 0x3e, 0x65, 0x3f, 0x22, 0x73, 0x61,
+ 0x6d, 0x65, 0x45, 0x6c, 0x73, 0x65, 0x22, 0x3a, 0x2d, 0x31, 0x3e, 0x65, 0x3f, 0x22, 0x6c, 0x61,
+ 0x73, 0x74, 0x57, 0x65, 0x65, 0x6b, 0x22, 0x3a, 0x30, 0x3e, 0x65, 0x3f, 0x22, 0x6c, 0x61, 0x73,
+ 0x74, 0x44, 0x61, 0x79, 0x22, 0x3a, 0x31, 0x3e, 0x65, 0x3f, 0x22, 0x73, 0x61, 0x6d, 0x65, 0x44,
+ 0x61, 0x79, 0x22, 0x3a, 0x32, 0x3e, 0x65, 0x3f, 0x22, 0x6e, 0x65, 0x78, 0x74, 0x44, 0x61, 0x79,
+ 0x22, 0x3a, 0x37, 0x3e, 0x65, 0x3f, 0x22, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x65, 0x65, 0x6b, 0x22,
+ 0x3a, 0x22, 0x73, 0x61, 0x6d, 0x65, 0x45, 0x6c, 0x73, 0x65, 0x22, 0x2c, 0x67, 0x3d, 0x62, 0x26,
+ 0x26, 0x28, 0x44, 0x28, 0x62, 0x5b, 0x66, 0x5d, 0x29, 0x3f, 0x62, 0x5b, 0x66, 0x5d, 0x28, 0x29,
+ 0x3a, 0x62, 0x5b, 0x66, 0x5d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, 0x67, 0x7c, 0x7c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x2e, 0x63,
+ 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x28, 0x66, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x45,
+ 0x61, 0x28, 0x63, 0x29, 0x29, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x65, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20,
+ 0x6f, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x66, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x70,
+ 0x28, 0x61, 0x29, 0x3f, 0x61, 0x3a, 0x45, 0x61, 0x28, 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28,
+ 0x29, 0x26, 0x26, 0x63, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x28,
+ 0x62, 0x3d, 0x42, 0x28, 0x6d, 0x28, 0x62, 0x29, 0x3f, 0x22, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x3a, 0x62, 0x29, 0x2c, 0x22, 0x6d, 0x69, 0x6c, 0x6c, 0x69,
+ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x2b, 0x74, 0x68, 0x69,
+ 0x73, 0x3e, 0x2b, 0x63, 0x3a, 0x2b, 0x63, 0x3c, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c,
+ 0x6f, 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f, 0x66, 0x28, 0x62, 0x29,
+ 0x29, 0x3a, 0x21, 0x31, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x62,
+ 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x70, 0x28, 0x61, 0x29,
+ 0x3f, 0x61, 0x3a, 0x45, 0x61, 0x28, 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x26, 0x26,
+ 0x63, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x28, 0x62, 0x3d, 0x42,
+ 0x28, 0x6d, 0x28, 0x62, 0x29, 0x3f, 0x22, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f,
+ 0x6e, 0x64, 0x22, 0x3a, 0x62, 0x29, 0x2c, 0x22, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63,
+ 0x6f, 0x6e, 0x64, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x2b, 0x63, 0x3e, 0x2b, 0x74, 0x68, 0x69,
+ 0x73, 0x3a, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29, 0x2e,
+ 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x28, 0x62, 0x29, 0x3c, 0x2b, 0x63, 0x29, 0x3a, 0x21, 0x31, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x68, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c,
+ 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69,
+ 0x73, 0x41, 0x66, 0x74, 0x65, 0x72, 0x28, 0x61, 0x2c, 0x63, 0x29, 0x26, 0x26, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x69, 0x73, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x2c, 0x64, 0x3d, 0x70, 0x28, 0x61, 0x29, 0x3f, 0x61, 0x3a,
+ 0x45, 0x61, 0x28, 0x61, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x26, 0x26, 0x64, 0x2e, 0x69,
+ 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x28, 0x62, 0x3d, 0x42, 0x28, 0x62, 0x7c,
+ 0x7c, 0x22, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x29, 0x2c,
+ 0x22, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x3d, 0x3d, 0x3d,
+ 0x62, 0x3f, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x3d, 0x3d, 0x3d, 0x2b, 0x64, 0x3a, 0x28, 0x63, 0x3d,
+ 0x2b, 0x64, 0x2c, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29,
+ 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f, 0x66, 0x28, 0x62, 0x29, 0x3c, 0x3d, 0x63, 0x26, 0x26,
+ 0x63, 0x3c, 0x3d, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29,
+ 0x2e, 0x65, 0x6e, 0x64, 0x4f, 0x66, 0x28, 0x62, 0x29, 0x29, 0x29, 0x3a, 0x21, 0x31, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x53, 0x61,
+ 0x6d, 0x65, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73,
+ 0x41, 0x66, 0x74, 0x65, 0x72, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x53, 0x61, 0x6d, 0x65, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x42, 0x65, 0x66, 0x6f,
+ 0x72, 0x65, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x6c, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64,
+ 0x2c, 0x65, 0x2c, 0x66, 0x2c, 0x67, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x28, 0x64, 0x3d,
+ 0x4d, 0x61, 0x28, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x64, 0x2e, 0x69, 0x73, 0x56,
+ 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x28, 0x65, 0x3d, 0x36, 0x65, 0x34, 0x2a, 0x28, 0x64,
+ 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x2d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x75, 0x74, 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x29, 0x29, 0x2c, 0x62,
+ 0x3d, 0x42, 0x28, 0x62, 0x29, 0x2c, 0x22, 0x79, 0x65, 0x61, 0x72, 0x22, 0x3d, 0x3d, 0x3d, 0x62,
+ 0x7c, 0x7c, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x7c, 0x7c, 0x22,
+ 0x71, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x28, 0x67, 0x3d,
+ 0x6d, 0x62, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x64, 0x29, 0x2c, 0x22, 0x71, 0x75, 0x61, 0x72,
+ 0x74, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x67, 0x2f, 0x3d, 0x33, 0x3a, 0x22, 0x79,
+ 0x65, 0x61, 0x72, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x28, 0x67, 0x2f, 0x3d, 0x31, 0x32,
+ 0x29, 0x29, 0x3a, 0x28, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2d, 0x64, 0x2c, 0x67, 0x3d, 0x22,
+ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x66, 0x2f, 0x31, 0x65,
+ 0x33, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x66,
+ 0x2f, 0x36, 0x65, 0x34, 0x3a, 0x22, 0x68, 0x6f, 0x75, 0x72, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f,
+ 0x66, 0x2f, 0x33, 0x36, 0x65, 0x35, 0x3a, 0x22, 0x64, 0x61, 0x79, 0x22, 0x3d, 0x3d, 0x3d, 0x62,
+ 0x3f, 0x28, 0x66, 0x2d, 0x65, 0x29, 0x2f, 0x38, 0x36, 0x34, 0x65, 0x35, 0x3a, 0x22, 0x77, 0x65,
+ 0x65, 0x6b, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x28, 0x66, 0x2d, 0x65, 0x29, 0x2f, 0x36, 0x30,
+ 0x34, 0x38, 0x65, 0x35, 0x3a, 0x66, 0x29, 0x2c, 0x63, 0x3f, 0x67, 0x3a, 0x71, 0x28, 0x67, 0x29,
+ 0x29, 0x3a, 0x4e, 0x61, 0x4e, 0x29, 0x3a, 0x4e, 0x61, 0x4e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x3d, 0x31, 0x32, 0x2a, 0x28, 0x62, 0x2e, 0x79, 0x65, 0x61, 0x72,
+ 0x28, 0x29, 0x2d, 0x61, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x29, 0x2b, 0x28, 0x62, 0x2e,
+ 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x2d, 0x61, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28,
+ 0x29, 0x29, 0x2c, 0x66, 0x3d, 0x61, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x61,
+ 0x64, 0x64, 0x28, 0x65, 0x2c, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x22, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x30, 0x3e, 0x62, 0x2d, 0x66, 0x3f, 0x28, 0x63, 0x3d, 0x61,
+ 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x65, 0x2d, 0x31,
+ 0x2c, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x22, 0x29, 0x2c, 0x64, 0x3d, 0x28, 0x62, 0x2d,
+ 0x66, 0x29, 0x2f, 0x28, 0x66, 0x2d, 0x63, 0x29, 0x29, 0x3a, 0x28, 0x63, 0x3d, 0x61, 0x2e, 0x63,
+ 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x65, 0x2b, 0x31, 0x2c, 0x22,
+ 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x22, 0x29, 0x2c, 0x64, 0x3d, 0x28, 0x62, 0x2d, 0x66, 0x29,
+ 0x2f, 0x28, 0x63, 0x2d, 0x66, 0x29, 0x29, 0x2c, 0x2d, 0x28, 0x65, 0x2b, 0x64, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29,
+ 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x22, 0x65, 0x6e, 0x22, 0x29, 0x2e, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x28, 0x22, 0x64, 0x64, 0x64, 0x20, 0x4d, 0x4d, 0x4d, 0x20, 0x44, 0x44,
+ 0x20, 0x59, 0x59, 0x59, 0x59, 0x20, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x20, 0x5b,
+ 0x47, 0x4d, 0x54, 0x5d, 0x5a, 0x5a, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x6f, 0x62, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x75, 0x74, 0x63, 0x28, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x30, 0x3c, 0x61, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28,
+ 0x29, 0x26, 0x26, 0x61, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x3c, 0x3d, 0x39, 0x39, 0x39,
+ 0x39, 0x3f, 0x44, 0x28, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79,
+ 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x49, 0x53, 0x4f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x29, 0x3f,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x6f, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x2e, 0x74, 0x6f,
+ 0x49, 0x53, 0x4f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x3a, 0x4d, 0x28, 0x61, 0x2c,
+ 0x22, 0x59, 0x59, 0x59, 0x59, 0x2d, 0x4d, 0x4d, 0x2d, 0x44, 0x44, 0x5b, 0x54, 0x5d, 0x48, 0x48,
+ 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x2e, 0x53, 0x53, 0x53, 0x5b, 0x5a, 0x5d, 0x22, 0x29, 0x3a,
+ 0x4d, 0x28, 0x61, 0x2c, 0x22, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x2d, 0x4d, 0x4d, 0x2d, 0x44,
+ 0x44, 0x5b, 0x54, 0x5d, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x2e, 0x53, 0x53, 0x53,
+ 0x5b, 0x5a, 0x5d, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70,
+ 0x62, 0x28, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x3d, 0x4d, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x62, 0x7c, 0x7c, 0x61, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x46, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x2e, 0x70,
+ 0x6f, 0x73, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, 0x63, 0x29, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x71, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69,
+ 0x64, 0x28, 0x29, 0x26, 0x26, 0x28, 0x70, 0x28, 0x61, 0x29, 0x26, 0x26, 0x61, 0x2e, 0x69, 0x73,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x7c, 0x7c, 0x45, 0x61, 0x28, 0x61, 0x29, 0x2e, 0x69,
+ 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x29, 0x3f, 0x5a, 0x61, 0x28, 0x7b, 0x74, 0x6f,
+ 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x66, 0x72, 0x6f, 0x6d, 0x3a, 0x61, 0x7d, 0x29, 0x2e, 0x6c,
+ 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
+ 0x65, 0x28, 0x29, 0x29, 0x2e, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x69, 0x7a, 0x65, 0x28, 0x21, 0x62,
+ 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74,
+ 0x61, 0x28, 0x29, 0x2e, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x44, 0x61, 0x74, 0x65, 0x28,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x62, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x72, 0x6f,
+ 0x6d, 0x28, 0x45, 0x61, 0x28, 0x29, 0x2c, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x73, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29,
+ 0x26, 0x26, 0x28, 0x70, 0x28, 0x61, 0x29, 0x26, 0x26, 0x61, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x28, 0x29, 0x7c, 0x7c, 0x45, 0x61, 0x28, 0x61, 0x29, 0x2e, 0x69, 0x73, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x28, 0x29, 0x29, 0x3f, 0x5a, 0x61, 0x28, 0x7b, 0x66, 0x72, 0x6f, 0x6d, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2c, 0x74, 0x6f, 0x3a, 0x61, 0x7d, 0x29, 0x2e, 0x6c, 0x6f, 0x63, 0x61,
+ 0x6c, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x29,
+ 0x29, 0x2e, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x69, 0x7a, 0x65, 0x28, 0x21, 0x62, 0x29, 0x3a, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29,
+ 0x2e, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x62, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x6f, 0x28, 0x45, 0x61, 0x28,
+ 0x29, 0x2c, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x62,
+ 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x3f, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x5f, 0x61, 0x62, 0x62, 0x72, 0x3a, 0x28,
+ 0x62, 0x3d, 0x7a, 0x28, 0x61, 0x29, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x62, 0x26, 0x26,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x62, 0x29,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x76, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x77, 0x62, 0x28, 0x61, 0x29, 0x7b, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x28, 0x61,
+ 0x3d, 0x42, 0x28, 0x61, 0x29, 0x29, 0x7b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x79, 0x65, 0x61, 0x72,
+ 0x22, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x30, 0x29, 0x3b,
+ 0x63, 0x61, 0x73, 0x65, 0x22, 0x71, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x22, 0x3a, 0x63, 0x61,
+ 0x73, 0x65, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x22, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64,
+ 0x61, 0x74, 0x65, 0x28, 0x31, 0x29, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x77, 0x65, 0x65, 0x6b,
+ 0x22, 0x3a, 0x63, 0x61, 0x73, 0x65, 0x22, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x22, 0x3a,
+ 0x63, 0x61, 0x73, 0x65, 0x22, 0x64, 0x61, 0x79, 0x22, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68,
+ 0x6f, 0x75, 0x72, 0x73, 0x28, 0x30, 0x29, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x68, 0x6f, 0x75,
+ 0x72, 0x22, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x28,
+ 0x30, 0x29, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x22, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x30, 0x29, 0x3b,
+ 0x63, 0x61, 0x73, 0x65, 0x22, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x3a, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x30,
+ 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x22, 0x3d, 0x3d,
+ 0x3d, 0x61, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79,
+ 0x28, 0x30, 0x29, 0x2c, 0x22, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x22, 0x3d, 0x3d, 0x3d,
+ 0x61, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x64,
+ 0x61, 0x79, 0x28, 0x31, 0x29, 0x2c, 0x22, 0x71, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x61, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28,
+ 0x33, 0x2a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x2f, 0x33, 0x29, 0x29, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x78, 0x62, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x42, 0x28, 0x61, 0x29, 0x2c,
+ 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x7c, 0x7c, 0x22, 0x6d, 0x69, 0x6c,
+ 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x3f, 0x74, 0x68,
+ 0x69, 0x73, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f, 0x66, 0x28,
+ 0x61, 0x29, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x31, 0x2c, 0x22, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65,
+ 0x6b, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x3f, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x22, 0x3a, 0x61, 0x29,
+ 0x2e, 0x73, 0x75, 0x62, 0x74, 0x72, 0x61, 0x63, 0x74, 0x28, 0x31, 0x2c, 0x22, 0x6d, 0x73, 0x22,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x79, 0x62, 0x28, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x2d, 0x36,
+ 0x65, 0x34, 0x2a, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74,
+ 0x7c, 0x7c, 0x30, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7a, 0x62,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66,
+ 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2f, 0x31, 0x65, 0x33, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65,
+ 0x74, 0x3f, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x2b, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x42, 0x62, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x74, 0x68,
+ 0x69, 0x73, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x61, 0x2e, 0x79, 0x65, 0x61, 0x72,
+ 0x28, 0x29, 0x2c, 0x61, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x2c, 0x61, 0x2e, 0x64,
+ 0x61, 0x74, 0x65, 0x28, 0x29, 0x2c, 0x61, 0x2e, 0x68, 0x6f, 0x75, 0x72, 0x28, 0x29, 0x2c, 0x61,
+ 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x28, 0x29, 0x2c, 0x61, 0x2e, 0x73, 0x65, 0x63, 0x6f,
+ 0x6e, 0x64, 0x28, 0x29, 0x2c, 0x61, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f,
+ 0x6e, 0x64, 0x28, 0x29, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43,
+ 0x62, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x79, 0x65, 0x61, 0x72, 0x73, 0x3a, 0x61, 0x2e, 0x79, 0x65,
+ 0x61, 0x72, 0x28, 0x29, 0x2c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x3a, 0x61, 0x2e, 0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x28, 0x29, 0x2c, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x61, 0x2e, 0x64, 0x61, 0x74,
+ 0x65, 0x28, 0x29, 0x2c, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x3a, 0x61, 0x2e, 0x68, 0x6f, 0x75, 0x72,
+ 0x73, 0x28, 0x29, 0x2c, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x3a, 0x61, 0x2e, 0x6d, 0x69,
+ 0x6e, 0x75, 0x74, 0x65, 0x73, 0x28, 0x29, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a,
+ 0x61, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x2c, 0x6d, 0x69, 0x6c, 0x6c,
+ 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x61, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69,
+ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x44, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x74, 0x6f, 0x49, 0x53, 0x4f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28,
+ 0x29, 0x3a, 0x22, 0x6e, 0x75, 0x6c, 0x6c, 0x22, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x45, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6b, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x46,
+ 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x28, 0x7b, 0x7d, 0x2c,
+ 0x6a, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x47, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6a, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x29, 0x2e, 0x6f, 0x76, 0x65, 0x72, 0x66, 0x6c, 0x6f, 0x77, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x48, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x7b, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x69, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x66,
+ 0x2c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f,
+ 0x63, 0x61, 0x6c, 0x65, 0x2c, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x2c, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x3a, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x49, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x4a, 0x28, 0x30,
+ 0x2c, 0x5b, 0x61, 0x2c, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x5d, 0x2c, 0x30, 0x2c,
+ 0x62, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4a, 0x62, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4e, 0x62, 0x2e, 0x63, 0x61, 0x6c, 0x6c,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x65, 0x65,
+ 0x6b, 0x28, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79,
+ 0x28, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61,
+ 0x74, 0x61, 0x28, 0x29, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x2e, 0x64, 0x6f, 0x77, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29,
+ 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x2e, 0x64, 0x6f, 0x79, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4b, 0x62, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x4e, 0x62, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x28, 0x29, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x28,
+ 0x29, 0x2c, 0x31, 0x2c, 0x34, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x4c, 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x61, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x31, 0x2c, 0x34, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4d, 0x62, 0x28, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44,
+ 0x61, 0x74, 0x61, 0x28, 0x29, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x72, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28,
+ 0x29, 0x2c, 0x61, 0x2e, 0x64, 0x6f, 0x77, 0x2c, 0x61, 0x2e, 0x64, 0x6f, 0x79, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63,
+ 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x3f, 0x71, 0x61, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x3a, 0x28, 0x66, 0x3d,
+ 0x72, 0x61, 0x28, 0x61, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x2c, 0x62, 0x3e, 0x66, 0x26, 0x26, 0x28,
+ 0x62, 0x3d, 0x66, 0x29, 0x2c, 0x4f, 0x62, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2c, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c,
+ 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x3d, 0x70, 0x61, 0x28, 0x61, 0x2c,
+ 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x2c, 0x67, 0x3d, 0x6b, 0x61, 0x28, 0x66, 0x2e,
+ 0x79, 0x65, 0x61, 0x72, 0x2c, 0x30, 0x2c, 0x66, 0x2e, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65,
+ 0x61, 0x72, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x79, 0x65, 0x61, 0x72, 0x28, 0x67, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c,
+ 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x28, 0x67, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x28, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x65, 0x28, 0x67,
+ 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x29, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x50, 0x62, 0x28,
+ 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d,
+ 0x61, 0x3f, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x28, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x2b, 0x31, 0x29, 0x2f, 0x33, 0x29, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x33, 0x2a, 0x28, 0x61, 0x2d,
+ 0x31, 0x29, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x25,
+ 0x33, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x51, 0x62, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x71, 0x61, 0x28, 0x61, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x2e, 0x64, 0x6f, 0x77, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x2e, 0x64, 0x6f, 0x79, 0x29, 0x2e, 0x77, 0x65, 0x65,
+ 0x6b, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x62, 0x28, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65,
+ 0x6b, 0x2e, 0x64, 0x6f, 0x77, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53,
+ 0x62, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x2e, 0x64, 0x6f, 0x79, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x54, 0x62, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29,
+ 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x3f, 0x62, 0x3a, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x37, 0x2a, 0x28, 0x61, 0x2d, 0x62, 0x29, 0x2c, 0x22, 0x64,
+ 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x55, 0x62, 0x28, 0x61,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x71, 0x61, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c,
+ 0x31, 0x2c, 0x34, 0x29, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x3f, 0x62, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x61, 0x64, 0x64, 0x28, 0x37, 0x2a, 0x28, 0x61, 0x2d, 0x62, 0x29, 0x2c, 0x22, 0x64, 0x22, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x56, 0x62, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22,
+ 0x21, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x3f, 0x61, 0x3a, 0x69, 0x73, 0x4e,
+ 0x61, 0x4e, 0x28, 0x61, 0x29, 0x3f, 0x28, 0x61, 0x3d, 0x62, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64,
+ 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x28, 0x61, 0x29, 0x2c, 0x22, 0x6e, 0x75, 0x6d,
+ 0x62, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x3f, 0x61,
+ 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3a, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28,
+ 0x61, 0x2c, 0x31, 0x30, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x57,
+ 0x62, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x29, 0x3f,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x5b, 0x61,
+ 0x2e, 0x64, 0x61, 0x79, 0x28, 0x29, 0x5d, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65,
+ 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x5b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65,
+ 0x6b, 0x64, 0x61, 0x79, 0x73, 0x2e, 0x69, 0x73, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x28, 0x62, 0x29, 0x3f, 0x22, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x3a,
+ 0x22, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x6c, 0x6f, 0x6e, 0x65, 0x22, 0x5d, 0x5b, 0x61, 0x2e,
+ 0x64, 0x61, 0x79, 0x28, 0x29, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
+ 0x58, 0x62, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74,
+ 0x5b, 0x61, 0x2e, 0x64, 0x61, 0x79, 0x28, 0x29, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x59, 0x62, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x4d, 0x69,
+ 0x6e, 0x5b, 0x61, 0x2e, 0x64, 0x61, 0x79, 0x28, 0x29, 0x5d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x5a, 0x62, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x7c,
+ 0x7c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73,
+ 0x50, 0x61, 0x72, 0x73, 0x65, 0x3d, 0x5b, 0x5d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d,
+ 0x69, 0x6e, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x3d,
+ 0x5b, 0x5d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x57, 0x65,
+ 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x3d, 0x5b, 0x5d, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79,
+ 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x3d, 0x5b, 0x5d, 0x29, 0x2c, 0x64, 0x3d, 0x30, 0x3b, 0x37,
+ 0x3e, 0x64, 0x3b, 0x64, 0x2b, 0x2b, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x65, 0x3d, 0x45, 0x61, 0x28,
+ 0x5b, 0x32, 0x65, 0x33, 0x2c, 0x31, 0x5d, 0x29, 0x2e, 0x64, 0x61, 0x79, 0x28, 0x64, 0x29, 0x2c,
+ 0x63, 0x26, 0x26, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x57, 0x65,
+ 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x26, 0x26,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x57, 0x65, 0x65, 0x6b, 0x64,
+ 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x3d, 0x6e, 0x65, 0x77, 0x20,
+ 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x22, 0x5e, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x28, 0x65, 0x2c, 0x22, 0x22, 0x29, 0x2e, 0x72,
+ 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x22, 0x2e, 0x22, 0x2c, 0x22, 0x2e, 0x3f, 0x22, 0x29,
+ 0x2b, 0x22, 0x24, 0x22, 0x2c, 0x22, 0x69, 0x22, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x73, 0x68, 0x6f, 0x72, 0x74, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72,
+ 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70,
+ 0x28, 0x22, 0x5e, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61,
+ 0x79, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x28, 0x65, 0x2c, 0x22, 0x22, 0x29, 0x2e, 0x72, 0x65,
+ 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x22, 0x2e, 0x22, 0x2c, 0x22, 0x2e, 0x3f, 0x22, 0x29, 0x2b,
+ 0x22, 0x24, 0x22, 0x2c, 0x22, 0x69, 0x22, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d,
+ 0x69, 0x6e, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b,
+ 0x64, 0x5d, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x22, 0x5e,
+ 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x4d,
+ 0x69, 0x6e, 0x28, 0x65, 0x2c, 0x22, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65,
+ 0x28, 0x22, 0x2e, 0x22, 0x2c, 0x22, 0x2e, 0x3f, 0x22, 0x29, 0x2b, 0x22, 0x24, 0x22, 0x2c, 0x22,
+ 0x69, 0x22, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64,
+ 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x7c, 0x7c, 0x28, 0x66, 0x3d,
+ 0x22, 0x5e, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79,
+ 0x73, 0x28, 0x65, 0x2c, 0x22, 0x22, 0x29, 0x2b, 0x22, 0x7c, 0x5e, 0x22, 0x2b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x28,
+ 0x65, 0x2c, 0x22, 0x22, 0x29, 0x2b, 0x22, 0x7c, 0x5e, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x4d, 0x69, 0x6e, 0x28, 0x65, 0x2c, 0x22, 0x22,
+ 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73,
+ 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x65, 0x67,
+ 0x45, 0x78, 0x70, 0x28, 0x66, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x22, 0x2e,
+ 0x22, 0x2c, 0x22, 0x22, 0x29, 0x2c, 0x22, 0x69, 0x22, 0x29, 0x29, 0x2c, 0x63, 0x26, 0x26, 0x22,
+ 0x64, 0x64, 0x64, 0x64, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x66, 0x75, 0x6c, 0x6c, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72,
+ 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x63, 0x26, 0x26, 0x22, 0x64, 0x64,
+ 0x64, 0x22, 0x3d, 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x68,
+ 0x6f, 0x72, 0x74, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65,
+ 0x5b, 0x64, 0x5d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x63, 0x26, 0x26, 0x22, 0x64, 0x64, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x62, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x69, 0x6e, 0x57, 0x65,
+ 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x2e, 0x74,
+ 0x65, 0x73, 0x74, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3b,
+ 0x69, 0x66, 0x28, 0x21, 0x63, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x77, 0x65, 0x65,
+ 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x5b, 0x64, 0x5d, 0x2e, 0x74, 0x65,
+ 0x73, 0x74, 0x28, 0x61, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x7d, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x24, 0x62, 0x28, 0x61, 0x29, 0x7b, 0x69,
+ 0x66, 0x28, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28,
+ 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61,
+ 0x3f, 0x74, 0x68, 0x69, 0x73, 0x3a, 0x4e, 0x61, 0x4e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3f, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61, 0x79, 0x28, 0x29, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x79, 0x28, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x3f,
+ 0x28, 0x61, 0x3d, 0x56, 0x62, 0x28, 0x61, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63,
+ 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x61, 0x64, 0x64, 0x28, 0x61, 0x2d, 0x62, 0x2c, 0x22, 0x64, 0x22, 0x29, 0x29, 0x3a, 0x62, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5f, 0x62, 0x28, 0x61, 0x29, 0x7b, 0x69,
+ 0x66, 0x28, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28,
+ 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61,
+ 0x3f, 0x74, 0x68, 0x69, 0x73, 0x3a, 0x4e, 0x61, 0x4e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x61, 0x79, 0x28, 0x29, 0x2b, 0x37, 0x2d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x2e,
+ 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x2e, 0x64, 0x6f, 0x77, 0x29, 0x25, 0x37, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x3f, 0x62, 0x3a, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x61, 0x2d, 0x62, 0x2c, 0x22, 0x64, 0x22, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x28, 0x29, 0x3f, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x3f, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x64, 0x61, 0x79, 0x28, 0x29, 0x7c, 0x7c, 0x37, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x64, 0x61, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x61, 0x79, 0x28, 0x29, 0x25, 0x37,
+ 0x3f, 0x61, 0x3a, 0x61, 0x2d, 0x37, 0x29, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x21, 0x3d, 0x61, 0x3f,
+ 0x74, 0x68, 0x69, 0x73, 0x3a, 0x4e, 0x61, 0x4e, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x62, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x4d, 0x61,
+ 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63,
+ 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f, 0x66, 0x28, 0x22,
+ 0x64, 0x61, 0x79, 0x22, 0x29, 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65,
+ 0x28, 0x29, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x4f, 0x66, 0x28, 0x22, 0x79, 0x65, 0x61, 0x72,
+ 0x22, 0x29, 0x29, 0x2f, 0x38, 0x36, 0x34, 0x65, 0x35, 0x29, 0x2b, 0x31, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x3d, 0x3d, 0x61, 0x3f, 0x62, 0x3a, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x61, 0x2d, 0x62, 0x2c, 0x22, 0x64, 0x22, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x63, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x28,
+ 0x29, 0x25, 0x31, 0x32, 0x7c, 0x7c, 0x31, 0x32, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x64, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x4a, 0x28, 0x61, 0x2c, 0x30, 0x2c,
+ 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44,
+ 0x61, 0x74, 0x61, 0x28, 0x29, 0x2e, 0x6d, 0x65, 0x72, 0x69, 0x64, 0x69, 0x65, 0x6d, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x28, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x28, 0x29, 0x2c, 0x62, 0x29, 0x7d, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x2e, 0x5f, 0x6d, 0x65, 0x72, 0x69, 0x64,
+ 0x69, 0x65, 0x6d, 0x50, 0x61, 0x72, 0x73, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x66, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x70,
+ 0x22, 0x3d, 0x3d, 0x3d, 0x28, 0x61, 0x2b, 0x22, 0x22, 0x29, 0x2e, 0x74, 0x6f, 0x4c, 0x6f, 0x77,
+ 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x2e, 0x63, 0x68, 0x61, 0x72, 0x41, 0x74, 0x28,
+ 0x30, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x63, 0x28, 0x61,
+ 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3e, 0x31,
+ 0x31, 0x3f, 0x63, 0x3f, 0x22, 0x70, 0x6d, 0x22, 0x3a, 0x22, 0x50, 0x4d, 0x22, 0x3a, 0x63, 0x3f,
+ 0x22, 0x61, 0x6d, 0x22, 0x3a, 0x22, 0x41, 0x4d, 0x22, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x68, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x62, 0x5b, 0x42, 0x64, 0x5d,
+ 0x3d, 0x72, 0x28, 0x31, 0x65, 0x33, 0x2a, 0x28, 0x22, 0x30, 0x2e, 0x22, 0x2b, 0x61, 0x29, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x63, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54,
+ 0x43, 0x3f, 0x22, 0x55, 0x54, 0x43, 0x22, 0x3a, 0x22, 0x22, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x6a, 0x63, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3f, 0x22, 0x43, 0x6f, 0x6f,
+ 0x72, 0x64, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x64, 0x20, 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73,
+ 0x61, 0x6c, 0x20, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x3a, 0x22, 0x22, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x45, 0x61, 0x28, 0x31, 0x65, 0x33, 0x2a, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x63, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x45, 0x61, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x5a,
+ 0x6f, 0x6e, 0x65, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d,
+ 0x63, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x63, 0x61, 0x6c, 0x65, 0x6e, 0x64, 0x61, 0x72, 0x5b, 0x61, 0x5d,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x44, 0x28, 0x64, 0x29, 0x3f, 0x64, 0x2e, 0x63,
+ 0x61, 0x6c, 0x6c, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x3a, 0x64, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x6e, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x65, 0x46, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x5b, 0x61, 0x5d, 0x2c, 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x6c, 0x6f, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5b, 0x61,
+ 0x2e, 0x74, 0x6f, 0x55, 0x70, 0x70, 0x65, 0x72, 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x5d, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x7c, 0x7c, 0x21, 0x63, 0x3f, 0x62, 0x3a, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x65, 0x46, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x5b, 0x61, 0x5d, 0x3d, 0x63, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63,
+ 0x65, 0x28, 0x2f, 0x4d, 0x4d, 0x4d, 0x4d, 0x7c, 0x4d, 0x4d, 0x7c, 0x44, 0x44, 0x7c, 0x64, 0x64,
+ 0x64, 0x64, 0x2f, 0x67, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28,
+ 0x31, 0x29, 0x7d, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f, 0x6e, 0x67, 0x44,
+ 0x61, 0x74, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x5b, 0x61, 0x5d, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x63, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64,
+ 0x44, 0x61, 0x74, 0x65, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x70, 0x63,
+ 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65,
+ 0x28, 0x22, 0x25, 0x64, 0x22, 0x2c, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x71, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x72, 0x63, 0x28, 0x61, 0x2c, 0x62,
+ 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x5b, 0x63,
+ 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x44, 0x28, 0x65, 0x29, 0x3f, 0x65, 0x28,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x3a, 0x65, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61,
+ 0x63, 0x65, 0x28, 0x2f, 0x25, 0x64, 0x2f, 0x69, 0x2c, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x54, 0x69, 0x6d, 0x65, 0x5b, 0x61, 0x3e, 0x30, 0x3f, 0x22, 0x66, 0x75, 0x74, 0x75, 0x72,
+ 0x65, 0x22, 0x3a, 0x22, 0x70, 0x61, 0x73, 0x74, 0x22, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x44, 0x28, 0x63, 0x29, 0x3f, 0x63, 0x28, 0x62, 0x29, 0x3a, 0x63, 0x2e, 0x72, 0x65,
+ 0x70, 0x6c, 0x61, 0x63, 0x65, 0x28, 0x2f, 0x25, 0x73, 0x2f, 0x69, 0x2c, 0x62, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x74, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x62, 0x2c, 0x63, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x63, 0x20, 0x69, 0x6e, 0x20, 0x61,
+ 0x29, 0x62, 0x3d, 0x61, 0x5b, 0x63, 0x5d, 0x2c, 0x44, 0x28, 0x62, 0x29, 0x3f, 0x74, 0x68, 0x69,
+ 0x73, 0x5b, 0x63, 0x5d, 0x3d, 0x62, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x22, 0x5f, 0x22, 0x2b,
+ 0x63, 0x5d, 0x3d, 0x62, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6f, 0x72, 0x64, 0x69, 0x6e,
+ 0x61, 0x6c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x4c, 0x65, 0x6e, 0x69, 0x65, 0x6e, 0x74, 0x3d, 0x6e,
+ 0x65, 0x77, 0x20, 0x52, 0x65, 0x67, 0x45, 0x78, 0x70, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x2e, 0x73, 0x6f, 0x75,
+ 0x72, 0x63, 0x65, 0x2b, 0x22, 0x7c, 0x22, 0x2b, 0x2f, 0x5c, 0x64, 0x7b, 0x31, 0x2c, 0x32, 0x7d,
+ 0x2f, 0x2e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x75, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x65, 0x3d, 0x7a, 0x28, 0x29, 0x2c, 0x66, 0x3d, 0x68, 0x28, 0x29, 0x2e, 0x73,
+ 0x65, 0x74, 0x28, 0x64, 0x2c, 0x62, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65,
+ 0x5b, 0x63, 0x5d, 0x28, 0x66, 0x2c, 0x61, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x76, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b,
+ 0x69, 0x66, 0x28, 0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3d, 0x3d, 0x74, 0x79, 0x70,
+ 0x65, 0x6f, 0x66, 0x20, 0x61, 0x26, 0x26, 0x28, 0x62, 0x3d, 0x61, 0x2c, 0x61, 0x3d, 0x76, 0x6f,
+ 0x69, 0x64, 0x20, 0x30, 0x29, 0x2c, 0x61, 0x3d, 0x61, 0x7c, 0x7c, 0x22, 0x22, 0x2c, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x21, 0x3d, 0x62, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x63, 0x28,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x65, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x2c, 0x67,
+ 0x3d, 0x5b, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x66, 0x3d, 0x30, 0x3b, 0x64, 0x3e, 0x66, 0x3b,
+ 0x66, 0x2b, 0x2b, 0x29, 0x67, 0x5b, 0x66, 0x5d, 0x3d, 0x75, 0x63, 0x28, 0x61, 0x2c, 0x66, 0x2c,
+ 0x63, 0x2c, 0x65, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x22, 0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x73, 0x22, 0x2c, 0x31, 0x32, 0x2c, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x22,
+ 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x78, 0x63, 0x28, 0x61, 0x2c,
+ 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x63, 0x28, 0x61, 0x2c, 0x62,
+ 0x2c, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x22, 0x2c, 0x31,
+ 0x32, 0x2c, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x79, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x76, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x64,
+ 0x61, 0x79, 0x73, 0x22, 0x2c, 0x37, 0x2c, 0x22, 0x64, 0x61, 0x79, 0x22, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x7a, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x22, 0x77, 0x65,
+ 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x22, 0x2c, 0x37, 0x2c, 0x22,
+ 0x64, 0x61, 0x79, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41,
+ 0x63, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x63,
+ 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x4d, 0x69,
+ 0x6e, 0x22, 0x2c, 0x37, 0x2c, 0x22, 0x64, 0x61, 0x79, 0x22, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x42, 0x63, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63,
+ 0x6f, 0x6e, 0x64, 0x73, 0x3d, 0x73, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x69,
+ 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x3d, 0x73, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x64, 0x61, 0x79, 0x73, 0x29, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x73, 0x3d, 0x73, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x73, 0x29, 0x2c, 0x61, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e,
+ 0x64, 0x73, 0x3d, 0x73, 0x65, 0x28, 0x61, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63,
+ 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x2c, 0x61, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3d,
+ 0x73, 0x65, 0x28, 0x61, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x2c, 0x61, 0x2e,
+ 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x3d, 0x73, 0x65, 0x28, 0x61, 0x2e, 0x6d, 0x69, 0x6e,
+ 0x75, 0x74, 0x65, 0x73, 0x29, 0x2c, 0x61, 0x2e, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x3d, 0x73, 0x65,
+ 0x28, 0x61, 0x2e, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x29, 0x2c, 0x61, 0x2e, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x73, 0x3d, 0x73, 0x65, 0x28, 0x61, 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0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x43, 0x63, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x2c, 0x62, 0x2c,
+ 0x31, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x63, 0x28, 0x61,
+ 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x43, 0x63, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2c, 0x61, 0x2c, 0x62, 0x2c, 0x2d, 0x31, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x20, 0x46, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x30, 0x3e, 0x61, 0x3f, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28,
+ 0x61, 0x29, 0x3a, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x28, 0x61, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x47, 0x63, 0x28, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x2c, 0x66, 0x3d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,
+ 0x2c, 0x67, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x2c, 0x68, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x2c, 0x69, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x66, 0x3e, 0x3d, 0x30, 0x26, 0x26, 0x67, 0x3e, 0x3d, 0x30, 0x26, 0x26, 0x68, 0x3e, 0x3d,
+ 0x30, 0x7c, 0x7c, 0x30, 0x3e, 0x3d, 0x66, 0x26, 0x26, 0x30, 0x3e, 0x3d, 0x67, 0x26, 0x26, 0x30,
+ 0x3e, 0x3d, 0x68, 0x7c, 0x7c, 0x28, 0x66, 0x2b, 0x3d, 0x38, 0x36, 0x34, 0x65, 0x35, 0x2a, 0x46,
+ 0x63, 0x28, 0x49, 0x63, 0x28, 0x68, 0x29, 0x2b, 0x67, 0x29, 0x2c, 0x67, 0x3d, 0x30, 0x2c, 0x68,
+ 0x3d, 0x30, 0x29, 0x2c, 0x69, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e,
+ 0x64, 0x73, 0x3d, 0x66, 0x25, 0x31, 0x65, 0x33, 0x2c, 0x61, 0x3d, 0x71, 0x28, 0x66, 0x2f, 0x31,
+ 0x65, 0x33, 0x29, 0x2c, 0x69, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3d, 0x61, 0x25,
+ 0x36, 0x30, 0x2c, 0x62, 0x3d, 0x71, 0x28, 0x61, 0x2f, 0x36, 0x30, 0x29, 0x2c, 0x69, 0x2e, 0x6d,
+ 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x3d, 0x62, 0x25, 0x36, 0x30, 0x2c, 0x63, 0x3d, 0x71, 0x28,
+ 0x62, 0x2f, 0x36, 0x30, 0x29, 0x2c, 0x69, 0x2e, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x3d, 0x63, 0x25,
+ 0x32, 0x34, 0x2c, 0x67, 0x2b, 0x3d, 0x71, 0x28, 0x63, 0x2f, 0x32, 0x34, 0x29, 0x2c, 0x65, 0x3d,
+ 0x71, 0x28, 0x48, 0x63, 0x28, 0x67, 0x29, 0x29, 0x2c, 0x68, 0x2b, 0x3d, 0x65, 0x2c, 0x67, 0x2d,
+ 0x3d, 0x46, 0x63, 0x28, 0x49, 0x63, 0x28, 0x65, 0x29, 0x29, 0x2c, 0x64, 0x3d, 0x71, 0x28, 0x68,
+ 0x2f, 0x31, 0x32, 0x29, 0x2c, 0x68, 0x25, 0x3d, 0x31, 0x32, 0x2c, 0x69, 0x2e, 0x64, 0x61, 0x79,
+ 0x73, 0x3d, 0x67, 0x2c, 0x69, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x3d, 0x68, 0x2c, 0x69,
+ 0x2e, 0x79, 0x65, 0x61, 0x72, 0x73, 0x3d, 0x64, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x48, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x34, 0x38, 0x30, 0x30, 0x2a, 0x61, 0x2f, 0x31, 0x34, 0x36, 0x30, 0x39,
+ 0x37, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x49, 0x63, 0x28, 0x61, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x34, 0x36, 0x30, 0x39, 0x37, 0x2a, 0x61,
+ 0x2f, 0x34, 0x38, 0x30, 0x30, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4a,
+ 0x63, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,
+ 0x73, 0x3b, 0x69, 0x66, 0x28, 0x61, 0x3d, 0x42, 0x28, 0x61, 0x29, 0x2c, 0x22, 0x6d, 0x6f, 0x6e,
+ 0x74, 0x68, 0x22, 0x3d, 0x3d, 0x3d, 0x61, 0x7c, 0x7c, 0x22, 0x79, 0x65, 0x61, 0x72, 0x22, 0x3d,
+ 0x3d, 0x3d, 0x61, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x2b, 0x64, 0x2f, 0x38, 0x36, 0x34, 0x65, 0x35, 0x2c,
+ 0x63, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x2b, 0x48,
+ 0x63, 0x28, 0x62, 0x29, 0x2c, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x22, 0x3d, 0x3d, 0x3d, 0x61,
+ 0x3f, 0x63, 0x3a, 0x63, 0x2f, 0x31, 0x32, 0x3b, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x28, 0x62,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x2b, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x49, 0x63, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x29, 0x29, 0x2c, 0x61, 0x29, 0x7b, 0x63, 0x61, 0x73, 0x65,
+ 0x22, 0x77, 0x65, 0x65, 0x6b, 0x22, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x2f,
+ 0x37, 0x2b, 0x64, 0x2f, 0x36, 0x30, 0x34, 0x38, 0x65, 0x35, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22,
+ 0x64, 0x61, 0x79, 0x22, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x2b, 0x64, 0x2f,
+ 0x38, 0x36, 0x34, 0x65, 0x35, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x68, 0x6f, 0x75, 0x72, 0x22,
+ 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x32, 0x34, 0x2a, 0x62, 0x2b, 0x64, 0x2f, 0x33,
+ 0x36, 0x65, 0x35, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x22,
+ 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x34, 0x34, 0x30, 0x2a, 0x62, 0x2b, 0x64,
+ 0x2f, 0x36, 0x65, 0x34, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,
+ 0x22, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2a, 0x62,
+ 0x2b, 0x64, 0x2f, 0x31, 0x65, 0x33, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x6d, 0x69, 0x6c, 0x6c,
+ 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x38, 0x36, 0x34, 0x65, 0x35,
+ 0x2a, 0x62, 0x29, 0x2b, 0x64, 0x3b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x74, 0x68,
+ 0x72, 0x6f, 0x77, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x55,
+ 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x74, 0x20, 0x22, 0x2b, 0x61, 0x29,
+ 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4b, 0x63, 0x28, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x69, 0x6c,
+ 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2b, 0x38, 0x36, 0x34, 0x65, 0x35, 0x2a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x25, 0x31, 0x32, 0x2a, 0x32, 0x35, 0x39, 0x32, 0x65,
+ 0x36, 0x2b, 0x33, 0x31, 0x35, 0x33, 0x36, 0x65, 0x36, 0x2a, 0x72, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x2f, 0x31, 0x32, 0x29, 0x7d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4c, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x73, 0x28, 0x61, 0x29, 0x7d,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4d, 0x63, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3d, 0x42, 0x28, 0x61, 0x29, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x5b, 0x61, 0x2b, 0x22, 0x73, 0x22, 0x5d, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4e, 0x63, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x61,
+ 0x5d, 0x7d, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x4f, 0x63, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x71, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64,
+ 0x61, 0x79, 0x73, 0x28, 0x29, 0x2f, 0x37, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x50, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x65, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76,
+ 0x65, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x62, 0x7c, 0x7c, 0x31, 0x2c, 0x21, 0x21, 0x63, 0x2c, 0x61,
+ 0x2c, 0x64, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x51, 0x63, 0x28,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x5a, 0x61, 0x28,
+ 0x61, 0x29, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x29, 0x2c, 0x65, 0x3d, 0x49, 0x65, 0x28, 0x64, 0x2e,
+ 0x61, 0x73, 0x28, 0x22, 0x73, 0x22, 0x29, 0x29, 0x2c, 0x66, 0x3d, 0x49, 0x65, 0x28, 0x64, 0x2e,
+ 0x61, 0x73, 0x28, 0x22, 0x6d, 0x22, 0x29, 0x29, 0x2c, 0x67, 0x3d, 0x49, 0x65, 0x28, 0x64, 0x2e,
+ 0x61, 0x73, 0x28, 0x22, 0x68, 0x22, 0x29, 0x29, 0x2c, 0x68, 0x3d, 0x49, 0x65, 0x28, 0x64, 0x2e,
+ 0x61, 0x73, 0x28, 0x22, 0x64, 0x22, 0x29, 0x29, 0x2c, 0x69, 0x3d, 0x49, 0x65, 0x28, 0x64, 0x2e,
+ 0x61, 0x73, 0x28, 0x22, 0x4d, 0x22, 0x29, 0x29, 0x2c, 0x6a, 0x3d, 0x49, 0x65, 0x28, 0x64, 0x2e,
+ 0x61, 0x73, 0x28, 0x22, 0x79, 0x22, 0x29, 0x29, 0x2c, 0x6b, 0x3d, 0x65, 0x3c, 0x4a, 0x65, 0x2e,
+ 0x73, 0x26, 0x26, 0x5b, 0x22, 0x73, 0x22, 0x2c, 0x65, 0x5d, 0x7c, 0x7c, 0x31, 0x3e, 0x3d, 0x66,
+ 0x26, 0x26, 0x5b, 0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, 0x75, 0x6c, 0x6c, 0x2c, 0x6b, 0x29, 0x7d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x63, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x4a,
+ 0x65, 0x5b, 0x61, 0x5d, 0x3f, 0x21, 0x31, 0x3a, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d,
+ 0x3d, 0x62, 0x3f, 0x4a, 0x65, 0x5b, 0x61, 0x5d, 0x3a, 0x28, 0x4a, 0x65, 0x5b, 0x61, 0x5d, 0x3d,
+ 0x62, 0x2c, 0x21, 0x30, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53,
+ 0x63, 0x28, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x2c, 0x63, 0x3d, 0x51,
+ 0x63, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x21, 0x61, 0x2c, 0x62, 0x29, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x61, 0x26, 0x26, 0x28, 0x63, 0x3d, 0x62, 0x2e, 0x70, 0x61, 0x73, 0x74,
+ 0x46, 0x75, 0x74, 0x75, 0x72, 0x65, 0x28, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x63, 0x29, 0x29,
+ 0x2c, 0x62, 0x2e, 0x70, 0x6f, 0x73, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, 0x63, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x63, 0x28, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x3d, 0x4b, 0x65, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,
+ 0x29, 0x2f, 0x31, 0x65, 0x33, 0x2c, 0x65, 0x3d, 0x4b, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x64, 0x61, 0x79, 0x73, 0x29, 0x2c, 0x66, 0x3d, 0x4b, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x29, 0x3b, 0x61, 0x3d, 0x71, 0x28, 0x64, 0x2f,
+ 0x36, 0x30, 0x29, 0x2c, 0x62, 0x3d, 0x71, 0x28, 0x61, 0x2f, 0x36, 0x30, 0x29, 0x2c, 0x64, 0x25,
+ 0x3d, 0x36, 0x30, 0x2c, 0x61, 0x25, 0x3d, 0x36, 0x30, 0x2c, 0x63, 0x3d, 0x71, 0x28, 0x66, 0x2f,
+ 0x31, 0x32, 0x29, 0x2c, 0x66, 0x25, 0x3d, 0x31, 0x32, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x3d,
+ 0x63, 0x2c, 0x68, 0x3d, 0x66, 0x2c, 0x69, 0x3d, 0x65, 0x2c, 0x6a, 0x3d, 0x62, 0x2c, 0x6b, 0x3d,
+ 0x61, 0x2c, 0x6c, 0x3d, 0x64, 0x2c, 0x6d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x73, 0x53,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x3b, 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x29, 0x2b, 0x31, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x4d,
+ 0x4d, 0x4d, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x2e, 0x6d, 0x6f, 0x6e,
+ 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29,
+ 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x4d, 0x4d, 0x4d, 0x4d, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61,
+ 0x74, 0x61, 0x28, 0x29, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2c, 0x61, 0x29, 0x7d, 0x29, 0x2c, 0x41, 0x28, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x22, 0x2c,
+ 0x22, 0x4d, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x4d, 0x22, 0x2c, 0x68, 0x64, 0x29, 0x2c, 0x4f,
+ 0x28, 0x22, 0x4d, 0x4d, 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c, 0x4f, 0x28,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5e, 0x5c, 0x2f, 0x3f,
+ 0x44, 0x61, 0x74, 0x65, 0x5c, 0x28, 0x28, 0x5c, 0x2d, 0x3f, 0x5c, 0x64, 0x2b, 0x29, 0x2f, 0x69,
+ 0x3b, 0x61, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x49, 0x6e, 0x70,
+ 0x75, 0x74, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x3d, 0x66, 0x61, 0x28, 0x22, 0x6d,
+ 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x66, 0x61, 0x6c, 0x6c, 0x73, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x20, 0x74, 0x6f,
+ 0x20, 0x6a, 0x73, 0x20, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69,
+ 0x73, 0x20, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x75, 0x72, 0x61, 0x67, 0x65, 0x64, 0x20, 0x61, 0x6e,
+ 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65,
+ 0x64, 0x20, 0x69, 0x6e, 0x20, 0x75, 0x70, 0x63, 0x6f, 0x6d, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x61,
+ 0x6a, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x20, 0x50, 0x6c, 0x65,
+ 0x61, 0x73, 0x65, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x68, 0x74, 0x74,
+ 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
+ 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x69, 0x73,
+ 0x73, 0x75, 0x65, 0x73, 0x2f, 0x31, 0x34, 0x30, 0x37, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x6d, 0x6f,
+ 0x72, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x2e, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x61, 0x2e, 0x5f, 0x64, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44,
+ 0x61, 0x74, 0x65, 0x28, 0x61, 0x2e, 0x5f, 0x69, 0x2b, 0x28, 0x61, 0x2e, 0x5f, 0x75, 0x73, 0x65,
+ 0x55, 0x54, 0x43, 0x3f, 0x22, 0x20, 0x55, 0x54, 0x43, 0x22, 0x3a, 0x22, 0x22, 0x29, 0x29, 0x7d,
+ 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x59, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x39, 0x39, 0x39, 0x39, 0x3e, 0x3d, 0x61, 0x3f, 0x22, 0x22, 0x2b, 0x61, 0x3a, 0x22, 0x2b, 0x22,
+ 0x2b, 0x61, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x30, 0x2c, 0x5b, 0x22, 0x59, 0x59, 0x22, 0x2c, 0x32,
+ 0x5d, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x28,
+ 0x29, 0x25, 0x31, 0x30, 0x30, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x30, 0x2c, 0x5b, 0x22, 0x59, 0x59,
+ 0x59, 0x59, 0x22, 0x2c, 0x34, 0x5d, 0x2c, 0x30, 0x2c, 0x22, 0x79, 0x65, 0x61, 0x72, 0x22, 0x29,
+ 0x2c, 0x4a, 0x28, 0x30, 0x2c, 0x5b, 0x22, 0x59, 0x59, 0x59, 0x59, 0x59, 0x22, 0x2c, 0x35, 0x5d,
+ 0x2c, 0x30, 0x2c, 0x22, 0x79, 0x65, 0x61, 0x72, 0x22, 0x29, 0x2c, 0x4a, 0x28, 0x30, 0x2c, 0x5b,
+ 0x22, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x22, 0x2c, 0x36, 0x2c, 0x21, 0x30, 0x5d, 0x2c, 0x30,
+ 0x2c, 0x22, 0x79, 0x65, 0x61, 0x72, 0x22, 0x29, 0x2c, 0x41, 0x28, 0x22, 0x79, 0x65, 0x61, 0x72,
+ 0x22, 0x2c, 0x22, 0x79, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x59, 0x22, 0x2c, 0x6f, 0x64, 0x29,
+ 0x2c, 0x4f, 0x28, 0x22, 0x59, 0x59, 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c, 0x4f,
+ 0x28, 0x22, 0x59, 0x59, 0x59, 0x59, 0x22, 0x2c, 0x6c, 0x64, 0x2c, 0x66, 0x64, 0x29, 0x2c, 0x4f,
+ 0x28, 0x22, 0x59, 0x59, 0x59, 0x59, 0x59, 0x22, 0x2c, 0x6d, 0x64, 0x2c, 0x67, 0x64, 0x29, 0x2c,
+ 0x4f, 0x28, 0x22, 0x59, 0x59, 0x59, 0x59, 0x59, 0x59, 0x22, 0x2c, 0x6d, 0x64, 0x2c, 0x67, 0x64,
+ 0x29, 0x2c, 0x53, 0x28, 0x5b, 0x22, 0x59, 0x59, 0x59, 0x59, 0x59, 0x22, 0x2c, 0x22, 0x59, 0x59,
+ 0x59, 0x59, 0x59, 0x59, 0x22, 0x5d, 0x2c, 0x76, 0x64, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x59, 0x59,
+ 0x59, 0x59, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x63,
+ 0x29, 0x7b, 0x63, 0x5b, 0x76, 0x64, 0x5d, 0x3d, 0x32, 0x3d, 0x3d, 0x3d, 0x62, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3f, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x54, 0x77, 0x6f, 0x44,
+ 0x69, 0x67, 0x69, 0x74, 0x59, 0x65, 0x61, 0x72, 0x28, 0x62, 0x29, 0x3a, 0x72, 0x28, 0x62, 0x29,
+ 0x7d, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x59, 0x59, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x63, 0x5b, 0x76, 0x64, 0x5d, 0x3d, 0x61, 0x2e,
+ 0x70, 0x61, 0x72, 0x73, 0x65, 0x54, 0x77, 0x6f, 0x44, 0x69, 0x67, 0x69, 0x74, 0x59, 0x65, 0x61,
+ 0x72, 0x28, 0x62, 0x29, 0x7d, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x59, 0x22, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x62, 0x5b, 0x76, 0x64, 0x5d,
+ 0x3d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28, 0x61, 0x2c, 0x31, 0x30, 0x29, 0x7d,
+ 0x29, 0x2c, 0x61, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x54, 0x77, 0x6f, 0x44, 0x69, 0x67, 0x69,
+ 0x74, 0x59, 0x65, 0x61, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x28, 0x61, 0x29, 0x2b, 0x28, 0x72,
+ 0x28, 0x61, 0x29, 0x3e, 0x36, 0x38, 0x3f, 0x31, 0x39, 0x30, 0x30, 0x3a, 0x32, 0x65, 0x33, 0x29,
+ 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x51, 0x64, 0x3d, 0x45, 0x28, 0x22, 0x46, 0x75, 0x6c, 0x6c,
+ 0x59, 0x65, 0x61, 0x72, 0x22, 0x2c, 0x21, 0x31, 0x29, 0x3b, 0x61, 0x2e, 0x49, 0x53, 0x4f, 0x5f,
+ 0x38, 0x36, 0x30, 0x31, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x52, 0x64, 0x3d, 0x66, 0x61, 0x28, 0x22, 0x6d, 0x6f, 0x6d,
+ 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2e, 0x6d, 0x69, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70,
+ 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6d, 0x6f, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x69, 0x6e, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e,
+ 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
+ 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x6d, 0x6f, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x2f, 0x31, 0x35, 0x34, 0x38, 0x22, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d,
+ 0x45, 0x61, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x61, 0x72,
+ 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x26, 0x26,
+ 0x61, 0x2e, 0x69, 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x74, 0x68, 0x69, 0x73,
+ 0x3e, 0x61, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x3a, 0x61, 0x3a, 0x6c, 0x28, 0x29, 0x7d, 0x29, 0x2c,
+ 0x53, 0x64, 0x3d, 0x66, 0x61, 0x28, 0x22, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2e,
+ 0x6d, 0x61, 0x78, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65,
+ 0x64, 0x2c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6d, 0x61,
+ 0x78, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e, 0x20, 0x68, 0x74, 0x74, 0x70, 0x73,
+ 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x6f,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x69, 0x73, 0x73, 0x75,
+ 0x65, 0x73, 0x2f, 0x31, 0x35, 0x34, 0x38, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x45, 0x61, 0x2e, 0x61, 0x70, 0x70,
+ 0x6c, 0x79, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69,
+ 0x73, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x28, 0x29, 0x26, 0x26, 0x61, 0x2e, 0x69, 0x73, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x28, 0x29, 0x3f, 0x61, 0x3e, 0x74, 0x68, 0x69, 0x73, 0x3f, 0x74, 0x68, 0x69,
+ 0x73, 0x3a, 0x61, 0x3a, 0x6c, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x54, 0x64, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,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 0x28, 0x5b, 0x30, 0x2d, 0x39, 0x2c, 0x2e, 0x5d, 0x2a, 0x29, 0x53, 0x29, 0x3f, 0x29, 0x3f, 0x7c,
+ 0x28, 0x5b, 0x30, 0x2d, 0x39, 0x2c, 0x2e, 0x5d, 0x2a, 0x29, 0x57, 0x29, 0x24, 0x2f, 0x3b, 0x0a,
+ 0x5a, 0x61, 0x2e, 0x66, 0x6e, 0x3d, 0x49, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79,
+ 0x70, 0x65, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x58, 0x64, 0x3d, 0x62, 0x62, 0x28, 0x31, 0x2c, 0x22,
+ 0x61, 0x64, 0x64, 0x22, 0x29, 0x2c, 0x59, 0x64, 0x3d, 0x62, 0x62, 0x28, 0x2d, 0x31, 0x2c, 0x22,
+ 0x73, 0x75, 0x62, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x29, 0x3b, 0x61, 0x2e, 0x64, 0x65, 0x66,
+ 0x61, 0x75, 0x6c, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3d, 0x22, 0x59, 0x59, 0x59, 0x59,
+ 0x2d, 0x4d, 0x4d, 0x2d, 0x44, 0x44, 0x54, 0x48, 0x48, 0x3a, 0x6d, 0x6d, 0x3a, 0x73, 0x73, 0x5a,
+ 0x22, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x5a, 0x64, 0x3d, 0x66, 0x61, 0x28, 0x22, 0x6d, 0x6f, 0x6d,
+ 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2e, 0x6c, 0x61, 0x6e, 0x67, 0x28, 0x29, 0x20, 0x69, 0x73, 0x20,
+ 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x49, 0x6e, 0x73, 0x74,
+ 0x65, 0x61, 0x64, 0x2c, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x28,
+ 0x29, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x20, 0x74,
+ 0x6f, 0x20, 0x67, 0x65, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61,
+ 0x67, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2e, 0x20, 0x55, 0x73, 0x65, 0x20, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2e, 0x6c,
+ 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x29, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, 0x61, 0x6e, 0x67,
+ 0x65, 0x20, 0x6c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x22, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x76, 0x6f, 0x69, 0x64, 0x20, 0x30, 0x3d, 0x3d, 0x3d, 0x61, 0x3f, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x3a, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x61, 0x29, 0x7d, 0x29, 0x3b, 0x4a,
+ 0x28, 0x30, 0x2c, 0x5b, 0x22, 0x67, 0x67, 0x22, 0x2c, 0x32, 0x5d, 0x2c, 0x30, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x25,
+ 0x31, 0x30, 0x30, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x30, 0x2c, 0x5b, 0x22, 0x47, 0x47, 0x22, 0x2c,
+ 0x32, 0x5d, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x73, 0x6f, 0x57,
+ 0x65, 0x65, 0x6b, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x25, 0x31, 0x30, 0x30, 0x7d, 0x29, 0x2c,
+ 0x49, 0x62, 0x28, 0x22, 0x67, 0x67, 0x67, 0x67, 0x22, 0x2c, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x59,
+ 0x65, 0x61, 0x72, 0x22, 0x29, 0x2c, 0x49, 0x62, 0x28, 0x22, 0x67, 0x67, 0x67, 0x67, 0x67, 0x22,
+ 0x2c, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x59, 0x65, 0x61, 0x72, 0x22, 0x29, 0x2c, 0x49, 0x62, 0x28,
+ 0x22, 0x47, 0x47, 0x47, 0x47, 0x22, 0x2c, 0x22, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x59,
+ 0x65, 0x61, 0x72, 0x22, 0x29, 0x2c, 0x49, 0x62, 0x28, 0x22, 0x47, 0x47, 0x47, 0x47, 0x47, 0x22,
+ 0x2c, 0x22, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x59, 0x65, 0x61, 0x72, 0x22, 0x29, 0x2c,
+ 0x41, 0x28, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x59, 0x65, 0x61, 0x72, 0x22, 0x2c, 0x22, 0x67, 0x67,
+ 0x22, 0x29, 0x2c, 0x41, 0x28, 0x22, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x59, 0x65, 0x61,
+ 0x72, 0x22, 0x2c, 0x22, 0x47, 0x47, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x47, 0x22, 0x2c, 0x6f,
+ 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x67, 0x22, 0x2c, 0x6f, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22,
+ 0x47, 0x47, 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x67, 0x67,
+ 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x47, 0x47, 0x47, 0x47,
+ 0x22, 0x2c, 0x6c, 0x64, 0x2c, 0x66, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x67, 0x67, 0x67, 0x67,
+ 0x22, 0x2c, 0x6c, 0x64, 0x2c, 0x66, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x47, 0x47, 0x47, 0x47,
+ 0x47, 0x22, 0x2c, 0x6d, 0x64, 0x2c, 0x67, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x67, 0x67, 0x67,
+ 0x67, 0x67, 0x22, 0x2c, 0x6d, 0x64, 0x2c, 0x67, 0x64, 0x29, 0x2c, 0x54, 0x28, 0x5b, 0x22, 0x67,
+ 0x67, 0x67, 0x67, 0x22, 0x2c, 0x22, 0x67, 0x67, 0x67, 0x67, 0x67, 0x22, 0x2c, 0x22, 0x47, 0x47,
+ 0x47, 0x47, 0x22, 0x2c, 0x22, 0x47, 0x47, 0x47, 0x47, 0x47, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x62,
+ 0x5b, 0x64, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, 0x30, 0x2c, 0x32, 0x29, 0x5d, 0x3d,
+ 0x72, 0x28, 0x61, 0x29, 0x7d, 0x29, 0x2c, 0x54, 0x28, 0x5b, 0x22, 0x67, 0x67, 0x22, 0x2c, 0x22,
+ 0x47, 0x47, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x2c,
+ 0x63, 0x2c, 0x64, 0x2c, 0x65, 0x29, 0x7b, 0x63, 0x5b, 0x65, 0x5d, 0x3d, 0x61, 0x2e, 0x70, 0x61,
+ 0x72, 0x73, 0x65, 0x54, 0x77, 0x6f, 0x44, 0x69, 0x67, 0x69, 0x74, 0x59, 0x65, 0x61, 0x72, 0x28,
+ 0x62, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x51, 0x22, 0x2c, 0x30, 0x2c, 0x22, 0x51, 0x6f,
+ 0x22, 0x2c, 0x22, 0x71, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x22, 0x29, 0x2c, 0x41, 0x28, 0x22,
+ 0x71, 0x75, 0x61, 0x72, 0x74, 0x65, 0x72, 0x22, 0x2c, 0x22, 0x51, 0x22, 0x29, 0x2c, 0x4f, 0x28,
+ 0x22, 0x51, 0x22, 0x2c, 0x63, 0x64, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x51, 0x22, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x62, 0x5b, 0x77, 0x64,
+ 0x5d, 0x3d, 0x33, 0x2a, 0x28, 0x72, 0x28, 0x61, 0x29, 0x2d, 0x31, 0x29, 0x7d, 0x29, 0x2c, 0x4a,
+ 0x28, 0x22, 0x77, 0x22, 0x2c, 0x5b, 0x22, 0x77, 0x77, 0x22, 0x2c, 0x32, 0x5d, 0x2c, 0x22, 0x77,
+ 0x6f, 0x22, 0x2c, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x22, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x57, 0x22,
+ 0x2c, 0x5b, 0x22, 0x57, 0x57, 0x22, 0x2c, 0x32, 0x5d, 0x2c, 0x22, 0x57, 0x6f, 0x22, 0x2c, 0x22,
+ 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x22, 0x29, 0x2c, 0x41, 0x28, 0x22, 0x77, 0x65, 0x65,
+ 0x6b, 0x22, 0x2c, 0x22, 0x77, 0x22, 0x29, 0x2c, 0x41, 0x28, 0x22, 0x69, 0x73, 0x6f, 0x57, 0x65,
+ 0x65, 0x6b, 0x22, 0x2c, 0x22, 0x57, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x77, 0x22, 0x2c, 0x68,
+ 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x77, 0x77, 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29,
+ 0x2c, 0x4f, 0x28, 0x22, 0x57, 0x22, 0x2c, 0x68, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x57, 0x57,
+ 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c, 0x54, 0x28, 0x5b, 0x22, 0x77, 0x22, 0x2c,
+ 0x22, 0x77, 0x77, 0x22, 0x2c, 0x22, 0x57, 0x22, 0x2c, 0x22, 0x57, 0x57, 0x22, 0x5d, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29,
+ 0x7b, 0x62, 0x5b, 0x64, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, 0x30, 0x2c, 0x31, 0x29,
+ 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x29, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x24, 0x64, 0x3d,
+ 0x7b, 0x64, 0x6f, 0x77, 0x3a, 0x30, 0x2c, 0x64, 0x6f, 0x79, 0x3a, 0x36, 0x7d, 0x3b, 0x4a, 0x28,
+ 0x22, 0x44, 0x22, 0x2c, 0x5b, 0x22, 0x44, 0x44, 0x22, 0x2c, 0x32, 0x5d, 0x2c, 0x22, 0x44, 0x6f,
+ 0x22, 0x2c, 0x22, 0x64, 0x61, 0x74, 0x65, 0x22, 0x29, 0x2c, 0x41, 0x28, 0x22, 0x64, 0x61, 0x74,
+ 0x65, 0x22, 0x2c, 0x22, 0x44, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x44, 0x22, 0x2c, 0x68, 0x64,
+ 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x44, 0x44, 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c,
+ 0x4f, 0x28, 0x22, 0x44, 0x6f, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x3f, 0x62, 0x2e,
+ 0x5f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x3a, 0x62, 0x2e,
+ 0x5f, 0x6f, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x4c, 0x65, 0x6e,
+ 0x69, 0x65, 0x6e, 0x74, 0x7d, 0x29, 0x2c, 0x53, 0x28, 0x5b, 0x22, 0x44, 0x22, 0x2c, 0x22, 0x44,
+ 0x44, 0x22, 0x5d, 0x2c, 0x78, 0x64, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x44, 0x6f, 0x22, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x7b, 0x62, 0x5b, 0x78,
+ 0x64, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x68, 0x64, 0x29,
+ 0x5b, 0x30, 0x5d, 0x2c, 0x31, 0x30, 0x29, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x5f, 0x64,
+ 0x3d, 0x45, 0x28, 0x22, 0x44, 0x61, 0x74, 0x65, 0x22, 0x2c, 0x21, 0x30, 0x29, 0x3b, 0x4a, 0x28,
+ 0x22, 0x64, 0x22, 0x2c, 0x30, 0x2c, 0x22, 0x64, 0x6f, 0x22, 0x2c, 0x22, 0x64, 0x61, 0x79, 0x22,
+ 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x64, 0x64, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28,
+ 0x29, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x4d, 0x69, 0x6e, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2c, 0x61, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x64, 0x64, 0x64, 0x22, 0x2c,
+ 0x30, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61,
+ 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79,
+ 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29, 0x7d, 0x29,
+ 0x2c, 0x4a, 0x28, 0x22, 0x64, 0x64, 0x64, 0x64, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61,
+ 0x28, 0x29, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2c, 0x61, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x65, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c,
+ 0x22, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x22, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x45, 0x22,
+ 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x22, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79,
+ 0x22, 0x29, 0x2c, 0x41, 0x28, 0x22, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x64, 0x22, 0x29, 0x2c,
+ 0x41, 0x28, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x65, 0x22, 0x29,
+ 0x2c, 0x41, 0x28, 0x22, 0x69, 0x73, 0x6f, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x22, 0x2c,
+ 0x22, 0x45, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x64, 0x22, 0x2c, 0x68, 0x64, 0x29, 0x2c, 0x4f,
+ 0x28, 0x22, 0x65, 0x22, 0x2c, 0x68, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x45, 0x22, 0x2c, 0x68,
+ 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x64, 0x64, 0x22, 0x2c, 0x73, 0x64, 0x29, 0x2c, 0x4f, 0x28,
+ 0x22, 0x64, 0x64, 0x64, 0x22, 0x2c, 0x73, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x64, 0x64, 0x64,
+ 0x64, 0x22, 0x2c, 0x73, 0x64, 0x29, 0x2c, 0x54, 0x28, 0x5b, 0x22, 0x64, 0x64, 0x22, 0x2c, 0x22,
+ 0x64, 0x64, 0x64, 0x22, 0x2c, 0x22, 0x64, 0x64, 0x64, 0x64, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x2c, 0x64, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x65, 0x3d, 0x63, 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x77,
+ 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x28, 0x61, 0x2c, 0x64,
+ 0x2c, 0x63, 0x2e, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x29, 0x3b, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x21, 0x3d, 0x65, 0x3f, 0x62, 0x2e, 0x64, 0x3d, 0x65, 0x3a, 0x6a, 0x28, 0x63, 0x29, 0x2e, 0x69,
+ 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x57, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x3d, 0x61, 0x7d,
+ 0x29, 0x2c, 0x54, 0x28, 0x5b, 0x22, 0x64, 0x22, 0x2c, 0x22, 0x65, 0x22, 0x2c, 0x22, 0x45, 0x22,
+ 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63,
+ 0x2c, 0x64, 0x29, 0x7b, 0x62, 0x5b, 0x64, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x29, 0x7d, 0x29, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x61, 0x65, 0x3d, 0x22, 0x53, 0x75, 0x6e, 0x64, 0x61, 0x79, 0x5f, 0x4d,
+ 0x6f, 0x6e, 0x64, 0x61, 0x79, 0x5f, 0x54, 0x75, 0x65, 0x73, 0x64, 0x61, 0x79, 0x5f, 0x57, 0x65,
+ 0x64, 0x6e, 0x65, 0x73, 0x64, 0x61, 0x79, 0x5f, 0x54, 0x68, 0x75, 0x72, 0x73, 0x64, 0x61, 0x79,
+ 0x5f, 0x46, 0x72, 0x69, 0x64, 0x61, 0x79, 0x5f, 0x53, 0x61, 0x74, 0x75, 0x72, 0x64, 0x61, 0x79,
+ 0x22, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x22, 0x5f, 0x22, 0x29, 0x2c, 0x62, 0x65, 0x3d,
+ 0x22, 0x53, 0x75, 0x6e, 0x5f, 0x4d, 0x6f, 0x6e, 0x5f, 0x54, 0x75, 0x65, 0x5f, 0x57, 0x65, 0x64,
+ 0x5f, 0x54, 0x68, 0x75, 0x5f, 0x46, 0x72, 0x69, 0x5f, 0x53, 0x61, 0x74, 0x22, 0x2e, 0x73, 0x70,
+ 0x6c, 0x69, 0x74, 0x28, 0x22, 0x5f, 0x22, 0x29, 0x2c, 0x63, 0x65, 0x3d, 0x22, 0x53, 0x75, 0x5f,
+ 0x4d, 0x6f, 0x5f, 0x54, 0x75, 0x5f, 0x57, 0x65, 0x5f, 0x54, 0x68, 0x5f, 0x46, 0x72, 0x5f, 0x53,
+ 0x61, 0x22, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x22, 0x5f, 0x22, 0x29, 0x3b, 0x4a, 0x28,
+ 0x22, 0x44, 0x44, 0x44, 0x22, 0x2c, 0x5b, 0x22, 0x44, 0x44, 0x44, 0x44, 0x22, 0x2c, 0x33, 0x5d,
+ 0x2c, 0x22, 0x44, 0x44, 0x44, 0x6f, 0x22, 0x2c, 0x22, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65,
+ 0x61, 0x72, 0x22, 0x29, 0x2c, 0x41, 0x28, 0x22, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61,
+ 0x72, 0x22, 0x2c, 0x22, 0x44, 0x44, 0x44, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x44, 0x44, 0x44,
+ 0x22, 0x2c, 0x6b, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x44, 0x44, 0x44, 0x44, 0x22, 0x2c, 0x65,
+ 0x64, 0x29, 0x2c, 0x53, 0x28, 0x5b, 0x22, 0x44, 0x44, 0x44, 0x22, 0x2c, 0x22, 0x44, 0x44, 0x44,
+ 0x44, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x2c, 0x63, 0x29, 0x7b, 0x63, 0x2e, 0x5f, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72,
+ 0x3d, 0x72, 0x28, 0x61, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x48, 0x22, 0x2c, 0x5b, 0x22,
+ 0x48, 0x48, 0x22, 0x2c, 0x32, 0x5d, 0x2c, 0x30, 0x2c, 0x22, 0x68, 0x6f, 0x75, 0x72, 0x22, 0x29,
+ 0x2c, 0x4a, 0x28, 0x22, 0x68, 0x22, 0x2c, 0x5b, 0x22, 0x68, 0x68, 0x22, 0x2c, 0x32, 0x5d, 0x2c,
+ 0x30, 0x2c, 0x63, 0x63, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x68, 0x6d, 0x6d, 0x22, 0x2c, 0x30, 0x2c,
+ 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x22, 0x22, 0x2b, 0x63, 0x63, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x29, 0x2b, 0x49, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x75,
+ 0x74, 0x65, 0x73, 0x28, 0x29, 0x2c, 0x32, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x68, 0x6d,
+ 0x6d, 0x73, 0x73, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x22, 0x2b, 0x63, 0x63, 0x2e,
+ 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2b, 0x49, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x28, 0x29, 0x2c, 0x32, 0x29, 0x2b,
+ 0x49, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29,
+ 0x2c, 0x32, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x48, 0x6d, 0x6d, 0x22, 0x2c, 0x30, 0x2c,
+ 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x22, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x6f, 0x75, 0x72, 0x73,
+ 0x28, 0x29, 0x2b, 0x49, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65,
+ 0x73, 0x28, 0x29, 0x2c, 0x32, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x22, 0x48, 0x6d, 0x6d, 0x73,
+ 0x73, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x68, 0x6f, 0x75, 0x72, 0x73, 0x28, 0x29, 0x2b, 0x49, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d,
+ 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x28, 0x29, 0x2c, 0x32, 0x29, 0x2b, 0x49, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x2c, 0x32, 0x29, 0x7d,
+ 0x29, 0x2c, 0x64, 0x63, 0x28, 0x22, 0x61, 0x22, 0x2c, 0x21, 0x30, 0x29, 0x2c, 0x64, 0x63, 0x28,
+ 0x22, 0x41, 0x22, 0x2c, 0x21, 0x31, 0x29, 0x2c, 0x41, 0x28, 0x22, 0x68, 0x6f, 0x75, 0x72, 0x22,
+ 0x2c, 0x22, 0x68, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x61, 0x22, 0x2c, 0x65, 0x63, 0x29, 0x2c,
+ 0x4f, 0x28, 0x22, 0x41, 0x22, 0x2c, 0x65, 0x63, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x48, 0x22, 0x2c,
+ 0x68, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x68, 0x22, 0x2c, 0x68, 0x64, 0x29, 0x2c, 0x4f, 0x28,
+ 0x22, 0x48, 0x48, 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x68,
+ 0x68, 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x68, 0x6d, 0x6d,
+ 0x22, 0x2c, 0x69, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x68, 0x6d, 0x6d, 0x73, 0x73, 0x22, 0x2c,
+ 0x6a, 0x64, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x48, 0x6d, 0x6d, 0x22, 0x2c, 0x69, 0x64, 0x29, 0x2c,
+ 0x4f, 0x28, 0x22, 0x48, 0x6d, 0x6d, 0x73, 0x73, 0x22, 0x2c, 0x6a, 0x64, 0x29, 0x2c, 0x53, 0x28,
+ 0x5b, 0x22, 0x48, 0x22, 0x2c, 0x22, 0x48, 0x48, 0x22, 0x5d, 0x2c, 0x79, 0x64, 0x29, 0x2c, 0x53,
+ 0x28, 0x5b, 0x22, 0x61, 0x22, 0x2c, 0x22, 0x41, 0x22, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x63, 0x2e, 0x5f, 0x69, 0x73,
+ 0x50, 0x6d, 0x3d, 0x63, 0x2e, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x69, 0x73, 0x50,
+ 0x4d, 0x28, 0x61, 0x29, 0x2c, 0x63, 0x2e, 0x5f, 0x6d, 0x65, 0x72, 0x69, 0x64, 0x69, 0x65, 0x6d,
+ 0x3d, 0x61, 0x7d, 0x29, 0x2c, 0x53, 0x28, 0x5b, 0x22, 0x68, 0x22, 0x2c, 0x22, 0x68, 0x68, 0x22,
+ 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63,
+ 0x29, 0x7b, 0x62, 0x5b, 0x79, 0x64, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x29, 0x2c, 0x6a, 0x28, 0x63,
+ 0x29, 0x2e, 0x62, 0x69, 0x67, 0x48, 0x6f, 0x75, 0x72, 0x3d, 0x21, 0x30, 0x7d, 0x29, 0x2c, 0x53,
+ 0x28, 0x22, 0x68, 0x6d, 0x6d, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x61, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x32, 0x3b, 0x62, 0x5b, 0x79, 0x64, 0x5d, 0x3d, 0x72, 0x28,
+ 0x61, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, 0x30, 0x2c, 0x64, 0x29, 0x29, 0x2c, 0x62,
+ 0x5b, 0x7a, 0x64, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28,
+ 0x64, 0x29, 0x29, 0x2c, 0x6a, 0x28, 0x63, 0x29, 0x2e, 0x62, 0x69, 0x67, 0x48, 0x6f, 0x75, 0x72,
+ 0x3d, 0x21, 0x30, 0x7d, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x68, 0x6d, 0x6d, 0x73, 0x73, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x34,
+ 0x2c, 0x65, 0x3d, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x32, 0x3b, 0x62, 0x5b,
+ 0x79, 0x64, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, 0x30,
+ 0x2c, 0x64, 0x29, 0x29, 0x2c, 0x62, 0x5b, 0x7a, 0x64, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x2e, 0x73,
+ 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, 0x64, 0x2c, 0x32, 0x29, 0x29, 0x2c, 0x62, 0x5b, 0x41, 0x64,
+ 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, 0x65, 0x29, 0x29,
+ 0x2c, 0x6a, 0x28, 0x63, 0x29, 0x2e, 0x62, 0x69, 0x67, 0x48, 0x6f, 0x75, 0x72, 0x3d, 0x21, 0x30,
+ 0x7d, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x48, 0x6d, 0x6d, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64,
+ 0x3d, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x32, 0x3b, 0x62, 0x5b, 0x79, 0x64,
+ 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, 0x30, 0x2c, 0x64,
+ 0x29, 0x29, 0x2c, 0x62, 0x5b, 0x7a, 0x64, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x2e, 0x73, 0x75, 0x62,
+ 0x73, 0x74, 0x72, 0x28, 0x64, 0x29, 0x29, 0x7d, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x48, 0x6d, 0x6d,
+ 0x73, 0x73, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x2c, 0x63, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x3d, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x2d, 0x34, 0x2c, 0x65, 0x3d, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d,
+ 0x32, 0x3b, 0x62, 0x5b, 0x79, 0x64, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x2e, 0x73, 0x75, 0x62, 0x73,
+ 0x74, 0x72, 0x28, 0x30, 0x2c, 0x64, 0x29, 0x29, 0x2c, 0x62, 0x5b, 0x7a, 0x64, 0x5d, 0x3d, 0x72,
+ 0x28, 0x61, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x28, 0x64, 0x2c, 0x32, 0x29, 0x29, 0x2c,
+ 0x62, 0x5b, 0x41, 0x64, 0x5d, 0x3d, 0x72, 0x28, 0x61, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72,
+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22, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x2c,
+ 0x22, 0x73, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x73, 0x22, 0x2c, 0x68, 0x64, 0x29, 0x2c, 0x4f,
+ 0x28, 0x22, 0x73, 0x73, 0x22, 0x2c, 0x68, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c, 0x53, 0x28, 0x5b,
+ 0x22, 0x73, 0x22, 0x2c, 0x22, 0x73, 0x73, 0x22, 0x5d, 0x2c, 0x41, 0x64, 0x29, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x67, 0x65, 0x3d, 0x45, 0x28, 0x22, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22,
+ 0x2c, 0x21, 0x31, 0x29, 0x3b, 0x4a, 0x28, 0x22, 0x53, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x7e, 0x7e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63,
+ 0x6f, 0x6e, 0x64, 0x28, 0x29, 0x2f, 0x31, 0x30, 0x30, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x30,
+ 0x2c, 0x5b, 0x22, 0x53, 0x53, 0x22, 0x2c, 0x32, 0x5d, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7e, 0x7e, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,
+ 0x28, 0x29, 0x2f, 0x31, 0x30, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x30, 0x2c, 0x5b, 0x22, 0x53,
+ 0x53, 0x53, 0x22, 0x2c, 0x33, 0x5d, 0x2c, 0x30, 0x2c, 0x22, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x29, 0x2c, 0x4a, 0x28, 0x30, 0x2c, 0x5b, 0x22, 0x53, 0x53,
+ 0x53, 0x53, 0x22, 0x2c, 0x34, 0x5d, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x30, 0x2a, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x28, 0x29,
+ 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x30, 0x2c, 0x5b, 0x22, 0x53, 0x53, 0x53, 0x53, 0x53, 0x22, 0x2c,
+ 0x35, 0x5d, 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x30, 0x30, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x28, 0x29, 0x7d, 0x29, 0x2c,
+ 0x4a, 0x28, 0x30, 0x2c, 0x5b, 0x22, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x22, 0x2c, 0x36, 0x5d,
+ 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x65, 0x33, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x69,
+ 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28,
+ 0x30, 0x2c, 0x5b, 0x22, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x22, 0x2c, 0x37, 0x5d, 0x2c,
+ 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x31, 0x65, 0x34, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x69, 0x6c,
+ 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x30,
+ 0x2c, 0x5b, 0x22, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x22, 0x2c, 0x38, 0x5d, 0x2c,
+ 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x31, 0x65, 0x35, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x69, 0x6c,
+ 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x4a, 0x28, 0x30,
+ 0x2c, 0x5b, 0x22, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x22, 0x2c, 0x39, 0x5d,
+ 0x2c, 0x30, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x65, 0x36, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x69,
+ 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x28, 0x29, 0x7d, 0x29, 0x2c, 0x41, 0x28,
+ 0x22, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x2c, 0x22, 0x6d,
+ 0x73, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x53, 0x22, 0x2c, 0x6b, 0x64, 0x2c, 0x63, 0x64, 0x29,
+ 0x2c, 0x4f, 0x28, 0x22, 0x53, 0x53, 0x22, 0x2c, 0x6b, 0x64, 0x2c, 0x64, 0x64, 0x29, 0x2c, 0x4f,
+ 0x28, 0x22, 0x53, 0x53, 0x53, 0x22, 0x2c, 0x6b, 0x64, 0x2c, 0x65, 0x64, 0x29, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x68, 0x65, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x68, 0x65, 0x3d, 0x22, 0x53, 0x53, 0x53,
+ 0x53, 0x22, 0x3b, 0x68, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x3d, 0x39, 0x3b,
+ 0x68, 0x65, 0x2b, 0x3d, 0x22, 0x53, 0x22, 0x29, 0x4f, 0x28, 0x68, 0x65, 0x2c, 0x6e, 0x64, 0x29,
+ 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x68, 0x65, 0x3d, 0x22, 0x53, 0x22, 0x3b, 0x68, 0x65, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x3d, 0x39, 0x3b, 0x68, 0x65, 0x2b, 0x3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65, 0x64, 0x3d, 0x56, 0x61, 0x2c, 0x6a, 0x65, 0x2e, 0x69, 0x73,
+ 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x3d, 0x57, 0x61, 0x2c, 0x6a, 0x65, 0x2e, 0x69, 0x73, 0x55, 0x74,
+ 0x63, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x58, 0x61, 0x2c, 0x6a, 0x65, 0x2e, 0x69, 0x73,
+ 0x55, 0x74, 0x63, 0x3d, 0x59, 0x61, 0x2c, 0x6a, 0x65, 0x2e, 0x69, 0x73, 0x55, 0x54, 0x43, 0x3d,
+ 0x59, 0x61, 0x2c, 0x6a, 0x65, 0x2e, 0x7a, 0x6f, 0x6e, 0x65, 0x41, 0x62, 0x62, 0x72, 0x3d, 0x69,
+ 0x63, 0x2c, 0x6a, 0x65, 0x2e, 0x7a, 0x6f, 0x6e, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x6a, 0x63,
+ 0x2c, 0x6a, 0x65, 0x2e, 0x64, 0x61, 0x74, 0x65, 0x73, 0x3d, 0x66, 0x61, 0x28, 0x22, 0x64, 0x61,
+ 0x74, 0x65, 0x73, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x20, 0x69, 0x73, 0x20,
+ 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x55, 0x73, 0x65, 0x20,
+ 0x64, 0x61, 0x74, 0x65, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e, 0x22, 0x2c, 0x5f,
+ 0x64, 0x29, 0x2c, 0x6a, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x3d, 0x66, 0x61, 0x28,
+ 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72,
+ 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20,
+ 0x55, 0x73, 0x65, 0x20, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61,
+ 0x64, 0x22, 0x2c, 0x24, 0x29, 0x2c, 0x6a, 0x65, 0x2e, 0x79, 0x65, 0x61, 0x72, 0x73, 0x3d, 0x66,
+ 0x61, 0x28, 0x22, 0x79, 0x65, 0x61, 0x72, 0x73, 0x20, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f,
+ 0x72, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e,
+ 0x20, 0x55, 0x73, 0x65, 0x20, 0x79, 0x65, 0x61, 0x72, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61,
+ 0x64, 0x22, 0x2c, 0x51, 0x64, 0x29, 0x2c, 0x6a, 0x65, 0x2e, 0x7a, 0x6f, 0x6e, 0x65, 0x3d, 0x66,
+ 0x61, 0x28, 0x22, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2e, 0x7a, 0x6f, 0x6e, 0x65,
+ 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2c, 0x20,
+ 0x75, 0x73, 0x65, 0x20, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x2e, 0x75, 0x74, 0x63,
+ 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e, 0x20,
+ 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
+ 0x6f, 0x6d, 0x2f, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73, 0x2f, 0x31, 0x37, 0x37, 0x39, 0x22, 0x2c, 0x50, 0x61,
+ 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6b, 0x65, 0x3d, 0x6a, 0x65, 0x2c, 0x6c, 0x65, 0x3d, 0x7b,
+ 0x73, 0x61, 0x6d, 0x65, 0x44, 0x61, 0x79, 0x3a, 0x22, 0x5b, 0x54, 0x6f, 0x64, 0x61, 0x79, 0x20,
+ 0x61, 0x74, 0x5d, 0x20, 0x4c, 0x54, 0x22, 0x2c, 0x6e, 0x65, 0x78, 0x74, 0x44, 0x61, 0x79, 0x3a,
+ 0x22, 0x5b, 0x54, 0x6f, 0x6d, 0x6f, 0x72, 0x72, 0x6f, 0x77, 0x20, 0x61, 0x74, 0x5d, 0x20, 0x4c,
+ 0x54, 0x22, 0x2c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x65, 0x65, 0x6b, 0x3a, 0x22, 0x64, 0x64, 0x64,
+ 0x64, 0x20, 0x5b, 0x61, 0x74, 0x5d, 0x20, 0x4c, 0x54, 0x22, 0x2c, 0x6c, 0x61, 0x73, 0x74, 0x44,
+ 0x61, 0x79, 0x3a, 0x22, 0x5b, 0x59, 0x65, 0x73, 0x74, 0x65, 0x72, 0x64, 0x61, 0x79, 0x20, 0x61,
+ 0x74, 0x5d, 0x20, 0x4c, 0x54, 0x22, 0x2c, 0x6c, 0x61, 0x73, 0x74, 0x57, 0x65, 0x65, 0x6b, 0x3a,
+ 0x22, 0x5b, 0x4c, 0x61, 0x73, 0x74, 0x5d, 0x20, 0x64, 0x64, 0x64, 0x64, 0x20, 0x5b, 0x61, 0x74,
+ 0x5d, 0x20, 0x4c, 0x54, 0x22, 0x2c, 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7b, 0x66, 0x75, 0x74, 0x75,
+ 0x72, 0x65, 0x3a, 0x22, 0x69, 0x6e, 0x20, 0x25, 0x73, 0x22, 0x2c, 0x70, 0x61, 0x73, 0x74, 0x3a,
+ 0x22, 0x25, 0x73, 0x20, 0x61, 0x67, 0x6f, 0x22, 0x2c, 0x73, 0x3a, 0x22, 0x61, 0x20, 0x66, 0x65,
+ 0x77, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x2c, 0x6d, 0x3a, 0x22, 0x61, 0x20,
+ 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x22, 0x2c, 0x6d, 0x6d, 0x3a, 0x22, 0x25, 0x64, 0x20, 0x6d,
+ 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x22, 0x2c, 0x68, 0x3a, 0x22, 0x61, 0x6e, 0x20, 0x68, 0x6f,
+ 0x75, 0x72, 0x22, 0x2c, 0x68, 0x68, 0x3a, 0x22, 0x25, 0x64, 0x20, 0x68, 0x6f, 0x75, 0x72, 0x73,
+ 0x22, 0x2c, 0x64, 0x3a, 0x22, 0x61, 0x20, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x64, 0x64, 0x3a, 0x22,
+ 0x25, 0x64, 0x20, 0x64, 0x61, 0x79, 0x73, 0x22, 0x2c, 0x4d, 0x3a, 0x22, 0x61, 0x20, 0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x22, 0x2c, 0x4d, 0x4d, 0x3a, 0x22, 0x25, 0x64, 0x20, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x73, 0x22, 0x2c, 0x79, 0x3a, 0x22, 0x61, 0x20, 0x79, 0x65, 0x61, 0x72, 0x22, 0x2c, 0x79,
+ 0x79, 0x3a, 0x22, 0x25, 0x64, 0x20, 0x79, 0x65, 0x61, 0x72, 0x73, 0x22, 0x7d, 0x2c, 0x72, 0x65,
+ 0x3d, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0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x2e, 0x70,
+ 0x6f, 0x73, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3d, 0x71, 0x63, 0x2c, 0x72, 0x65, 0x2e,
+ 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x3d, 0x71, 0x65,
+ 0x2c, 0x72, 0x65, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65,
+ 0x3d, 0x72, 0x63, 0x2c, 0x72, 0x65, 0x2e, 0x70, 0x61, 0x73, 0x74, 0x46, 0x75, 0x74, 0x75, 0x72,
+ 0x65, 0x3d, 0x73, 0x63, 0x2c, 0x72, 0x65, 0x2e, 0x73, 0x65, 0x74, 0x3d, 0x74, 0x63, 0x2c, 0x72,
+ 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x3d, 0x57, 0x2c, 0x72, 0x65, 0x2e, 0x5f, 0x6d,
+ 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x3d, 0x46, 0x64, 0x2c, 0x72, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3d, 0x58, 0x2c, 0x72, 0x65, 0x2e, 0x5f, 0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3d, 0x47, 0x64, 0x2c, 0x72, 0x65, 0x2e,
+ 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65, 0x3d, 0x59, 0x2c, 0x72, 0x65,
+ 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3d, 0x49, 0x64,
+ 0x2c, 0x72, 0x65, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3d,
+ 0x62, 0x61, 0x2c, 0x72, 0x65, 0x2e, 0x5f, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f,
+ 0x72, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3d, 0x48, 0x64, 0x2c, 0x72, 0x65, 0x2e, 0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x67, 0x65, 0x78, 0x3d, 0x61,
+ 0x61, 0x2c, 0x72, 0x65, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x3d, 0x51, 0x62, 0x2c, 0x72, 0x65, 0x2e,
+ 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x3d, 0x24, 0x64, 0x2c, 0x72, 0x65, 0x2e, 0x66, 0x69, 0x72, 0x73,
+ 0x74, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x59, 0x65, 0x61, 0x72, 0x3d, 0x53, 0x62, 0x2c, 0x72, 0x65,
+ 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x3d,
+ 0x52, 0x62, 0x2c, 0x72, 0x65, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x3d, 0x57,
+ 0x62, 0x2c, 0x72, 0x65, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x3d, 0x61,
+ 0x65, 0x2c, 0x72, 0x65, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x4d, 0x69, 0x6e,
+ 0x3d, 0x59, 0x62, 0x2c, 0x72, 0x65, 0x2e, 0x5f, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73,
+ 0x4d, 0x69, 0x6e, 0x3d, 0x63, 0x65, 0x2c, 0x72, 0x65, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61,
+ 0x79, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3d, 0x58, 0x62, 0x2c, 0x72, 0x65, 0x2e, 0x5f, 0x77,
+ 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3d, 0x62, 0x65, 0x2c,
+ 0x72, 0x65, 0x2e, 0x77, 0x65, 0x65, 0x6b, 0x64, 0x61, 0x79, 0x73, 0x50, 0x61, 0x72, 0x73, 0x65,
+ 0x3d, 0x5a, 0x62, 0x2c, 0x72, 0x65, 0x2e, 0x69, 0x73, 0x50, 0x4d, 0x3d, 0x66, 0x63, 0x2c, 0x72,
+ 0x65, 0x2e, 0x5f, 0x6d, 0x65, 0x72, 0x69, 0x64, 0x69, 0x65, 0x6d, 0x50, 0x61, 0x72, 0x73, 0x65,
+ 0x3d, 0x64, 0x65, 0x2c, 0x72, 0x65, 0x2e, 0x6d, 0x65, 0x72, 0x69, 0x64, 0x69, 0x65, 0x6d, 0x3d,
+ 0x67, 0x63, 0x2c, 0x78, 0x28, 0x22, 0x65, 0x6e, 0x22, 0x2c, 0x7b, 0x6f, 0x72, 0x64, 0x69, 0x6e,
+ 0x61, 0x6c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x3a, 0x2f, 0x5c, 0x64, 0x7b, 0x31, 0x2c, 0x32, 0x7d,
+ 0x28, 0x74, 0x68, 0x7c, 0x73, 0x74, 0x7c, 0x6e, 0x64, 0x7c, 0x72, 0x64, 0x29, 0x2f, 0x2c, 0x6f,
+ 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x3d, 0x61, 0x25, 0x31, 0x30, 0x2c, 0x63, 0x3d,
+ 0x31, 0x3d, 0x3d, 0x3d, 0x72, 0x28, 0x61, 0x25, 0x31, 0x30, 0x30, 0x2f, 0x31, 0x30, 0x29, 0x3f,
+ 0x22, 0x74, 0x68, 0x22, 0x3a, 0x31, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x22, 0x73, 0x74, 0x22, 0x3a,
+ 0x32, 0x3d, 0x3d, 0x3d, 0x62, 0x3f, 0x22, 0x6e, 0x64, 0x22, 0x3a, 0x33, 0x3d, 0x3d, 0x3d, 0x62,
+ 0x3f, 0x22, 0x72, 0x64, 0x22, 0x3a, 0x22, 0x74, 0x68, 0x22, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x61, 0x2b, 0x63, 0x7d, 0x7d, 0x29, 0x2c, 0x61, 0x2e, 0x6c, 0x61, 0x6e, 0x67, 0x3d,
+ 0x66, 0x61, 0x28, 0x22, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6c, 0x61, 0x6e, 0x67, 0x20,
+ 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x55,
+ 0x73, 0x65, 0x20, 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65,
+ 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e, 0x22, 0x2c, 0x78, 0x29, 0x2c, 0x61, 0x2e,
+ 0x6c, 0x61, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x66, 0x61, 0x28, 0x22, 0x6d, 0x6f, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x6c, 0x61, 0x6e, 0x67, 0x44, 0x61, 0x74, 0x61, 0x20, 0x69, 0x73, 0x20,
+ 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x55, 0x73, 0x65, 0x20,
+ 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x44, 0x61, 0x74,
+ 0x61, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e, 0x22, 0x2c, 0x7a, 0x29, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x73, 0x65, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x2c, 0x74,
+ 0x65, 0x3d, 0x4c, 0x63, 0x28, 0x22, 0x6d, 0x73, 0x22, 0x29, 0x2c, 0x75, 0x65, 0x3d, 0x4c, 0x63,
+ 0x28, 0x22, 0x73, 0x22, 0x29, 0x2c, 0x76, 0x65, 0x3d, 0x4c, 0x63, 0x28, 0x22, 0x6d, 0x22, 0x29,
+ 0x2c, 0x77, 0x65, 0x3d, 0x4c, 0x63, 0x28, 0x22, 0x68, 0x22, 0x29, 0x2c, 0x78, 0x65, 0x3d, 0x4c,
+ 0x63, 0x28, 0x22, 0x64, 0x22, 0x29, 0x2c, 0x79, 0x65, 0x3d, 0x4c, 0x63, 0x28, 0x22, 0x77, 0x22,
+ 0x29, 0x2c, 0x7a, 0x65, 0x3d, 0x4c, 0x63, 0x28, 0x22, 0x4d, 0x22, 0x29, 0x2c, 0x41, 0x65, 0x3d,
+ 0x4c, 0x63, 0x28, 0x22, 0x79, 0x22, 0x29, 0x2c, 0x42, 0x65, 0x3d, 0x4e, 0x63, 0x28, 0x22, 0x6d,
+ 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x29, 0x2c, 0x43, 0x65,
+ 0x3d, 0x4e, 0x63, 0x28, 0x22, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x29, 0x2c, 0x44,
+ 0x65, 0x3d, 0x4e, 0x63, 0x28, 0x22, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x22, 0x29, 0x2c,
+ 0x45, 0x65, 0x3d, 0x4e, 0x63, 0x28, 0x22, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x22, 0x29, 0x2c, 0x46,
+ 0x65, 0x3d, 0x4e, 0x63, 0x28, 0x22, 0x64, 0x61, 0x79, 0x73, 0x22, 0x29, 0x2c, 0x47, 0x65, 0x3d,
+ 0x4e, 0x63, 0x28, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x22, 0x29, 0x2c, 0x48, 0x65, 0x3d,
+ 0x4e, 0x63, 0x28, 0x22, 0x79, 0x65, 0x61, 0x72, 0x73, 0x22, 0x29, 0x2c, 0x49, 0x65, 0x3d, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2c, 0x4a, 0x65, 0x3d, 0x7b, 0x73, 0x3a,
+ 0x34, 0x35, 0x2c, 0x6d, 0x3a, 0x34, 0x35, 0x2c, 0x68, 0x3a, 0x32, 0x32, 0x2c, 0x64, 0x3a, 0x32,
+ 0x36, 0x2c, 0x4d, 0x3a, 0x31, 0x31, 0x7d, 0x2c, 0x4b, 0x65, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x61, 0x62, 0x73, 0x2c, 0x4c, 0x65, 0x3d, 0x49, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74,
+ 0x79, 0x70, 0x65, 0x3b, 0x4c, 0x65, 0x2e, 0x61, 0x62, 0x73, 0x3d, 0x42, 0x63, 0x2c, 0x4c, 0x65,
+ 0x2e, 0x61, 0x64, 0x64, 0x3d, 0x44, 0x63, 0x2c, 0x4c, 0x65, 0x2e, 0x73, 0x75, 0x62, 0x74, 0x72,
+ 0x61, 0x63, 0x74, 0x3d, 0x45, 0x63, 0x2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 0x3d, 0x76, 0x62, 0x2c, 0x4c, 0x65, 0x2e, 0x74, 0x6f, 0x49, 0x73, 0x6f, 0x53,
+ 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3d, 0x66, 0x61, 0x28, 0x22, 0x74, 0x6f, 0x49, 0x73, 0x6f, 0x53,
+ 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x70, 0x72, 0x65,
+ 0x63, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x20, 0x50, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x20, 0x75, 0x73,
+ 0x65, 0x20, 0x74, 0x6f, 0x49, 0x53, 0x4f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x20,
+ 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x28, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x20,
+ 0x74, 0x68, 0x65, 0x20, 0x63, 0x61, 0x70, 0x69, 0x74, 0x61, 0x6c, 0x73, 0x29, 0x22, 0x2c, 0x54,
+ 0x63, 0x29, 0x2c, 0x4c, 0x65, 0x2e, 0x6c, 0x61, 0x6e, 0x67, 0x3d, 0x5a, 0x64, 0x2c, 0x4a, 0x28,
+ 0x22, 0x58, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x22, 0x75, 0x6e, 0x69, 0x78, 0x22, 0x29, 0x2c,
+ 0x4a, 0x28, 0x22, 0x78, 0x22, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x4f, 0x66, 0x22, 0x29, 0x2c, 0x4f, 0x28, 0x22, 0x78, 0x22, 0x2c, 0x6f, 0x64, 0x29, 0x2c, 0x4f,
+ 0x28, 0x22, 0x58, 0x22, 0x2c, 0x72, 0x64, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x58, 0x22, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x63,
+ 0x2e, 0x5f, 0x64, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x31, 0x65, 0x33,
+ 0x2a, 0x70, 0x61, 0x72, 0x73, 0x65, 0x46, 0x6c, 0x6f, 0x61, 0x74, 0x28, 0x61, 0x2c, 0x31, 0x30,
+ 0x29, 0x29, 0x7d, 0x29, 0x2c, 0x53, 0x28, 0x22, 0x78, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x2c, 0x63, 0x29, 0x7b, 0x63, 0x2e, 0x5f, 0x64, 0x3d,
+ 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x72, 0x28, 0x61, 0x29, 0x29, 0x7d, 0x29,
+ 0x2c, 0x61, 0x2e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x32, 0x2e, 0x31, 0x31,
+ 0x2e, 0x31, 0x22, 0x2c, 0x62, 0x28, 0x45, 0x61, 0x29, 0x2c, 0x61, 0x2e, 0x66, 0x6e, 0x3d, 0x6b,
+ 0x65, 0x2c, 0x61, 0x2e, 0x6d, 0x69, 0x6e, 0x3d, 0x47, 0x61, 0x2c, 0x61, 0x2e, 0x6d, 0x61, 0x78,
+ 0x3d, 0x48, 0x61, 0x2c, 0x61, 0x2e, 0x6e, 0x6f, 0x77, 0x3d, 0x54, 0x64, 0x2c, 0x61, 0x2e, 0x75,
+ 0x74, 0x63, 0x3d, 0x68, 0x2c, 0x61, 0x2e, 0x75, 0x6e, 0x69, 0x78, 0x3d, 0x6b, 0x63, 0x2c, 0x61,
+ 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 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0x61, 0x79,
+ 0x73, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x3d, 0x7a, 0x63, 0x2c, 0x61, 0x2e, 0x6e, 0x6f, 0x72, 0x6d,
+ 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x73, 0x3d, 0x42, 0x2c, 0x61, 0x2e, 0x72,
+ 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x68, 0x72, 0x65, 0x73,
+ 0x68, 0x6f, 0x6c, 0x64, 0x3d, 0x52, 0x63, 0x2c, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74,
+ 0x79, 0x70, 0x65, 0x3d, 0x6b, 0x65, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x4d, 0x65, 0x3d, 0x61, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x65, 0x7d, 0x29, 0x3b,
+
+};
+static const unsigned char gjs_rickshaw_min_jsData[] = {
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x72, 0x6f, 0x6f, 0x74, 0x2c, 0x66,
+ 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f,
+ 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x3d, 0x3d, 0x3d, 0x22, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x26, 0x26, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x2e, 0x61, 0x6d,
+ 0x64, 0x29, 0x7b, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x28, 0x5b, 0x22, 0x64, 0x33, 0x22, 0x5d,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x33, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x6f, 0x6f, 0x74, 0x2e, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x3d, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x28, 0x64, 0x33, 0x29, 0x7d, 0x29,
+ 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20,
+ 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x3d, 0x3d, 0x3d, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63,
+ 0x74, 0x22, 0x29, 0x7b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72,
+ 0x74, 0x73, 0x3d, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x28, 0x72, 0x65, 0x71, 0x75, 0x69,
+ 0x72, 0x65, 0x28, 0x22, 0x64, 0x33, 0x22, 0x29, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x72,
+ 0x6f, 0x6f, 0x74, 0x2e, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x3d, 0x66, 0x61, 0x63,
+ 0x74, 0x6f, 0x72, 0x79, 0x28, 0x64, 0x33, 0x29, 0x7d, 0x7d, 0x29, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x33, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x3d, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
+ 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e,
+ 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x6f, 0x62, 0x6a, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x70, 0x61, 0x72, 0x74, 0x73, 0x3d, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
+ 0x65, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x22, 0x2e, 0x22, 0x29, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x31, 0x2c, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3d, 0x70, 0x61, 0x72, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3b, 0x69, 0x3c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x2b, 0x2b, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x74, 0x3d, 0x70,
+ 0x61, 0x72, 0x74, 0x73, 0x5b, 0x69, 0x5d, 0x3b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5b, 0x63,
+ 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x74, 0x5d, 0x3d, 0x70, 0x61, 0x72, 0x65,
+ 0x6e, 0x74, 0x5b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x74, 0x5d, 0x7c,
+ 0x7c, 0x7b, 0x7d, 0x3b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x5b, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x50, 0x61, 0x72, 0x74, 0x5d, 0x7d, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x7d, 0x2c, 0x6b, 0x65,
+ 0x79, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6f, 0x62, 0x6a, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6b, 0x65, 0x79, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x66, 0x6f, 0x72,
+ 0x28, 0x76, 0x61, 0x72, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x29,
+ 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6b, 0x65, 0x79, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6b, 0x65, 0x79, 0x73, 0x7d, 0x2c, 0x65, 0x78, 0x74, 0x65,
+ 0x6e, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x65, 0x73, 0x74,
+ 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x29, 0x7b,
+ 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79,
+ 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x29, 0x7b, 0x64, 0x65, 0x73, 0x74,
+ 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5b, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79,
+ 0x5d, 0x3d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5b, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74,
+ 0x79, 0x5d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2c, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6f, 0x62, 0x6a, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x4a, 0x53, 0x4f, 0x4e, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x28, 0x4a, 0x53, 0x4f,
+ 0x4e, 0x2e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x69, 0x66, 0x79, 0x28, 0x6f, 0x62, 0x6a, 0x29,
+ 0x29, 0x7d, 0x7d, 0x3b, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x67, 0x6c,
+ 0x6f, 0x62, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x5f, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3d, 0x4f, 0x62, 0x6a, 0x65, 0x63,
+ 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x3d, 0x22,
+ 0x4e, 0x75, 0x6c, 0x6c, 0x22, 0x2c, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x5f,
+ 0x54, 0x59, 0x50, 0x45, 0x3d, 0x22, 0x55, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22,
+ 0x2c, 0x42, 0x4f, 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x3d, 0x22, 0x42,
+ 0x6f, 0x6f, 0x6c, 0x65, 0x61, 0x6e, 0x22, 0x2c, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x5f, 0x54,
+ 0x59, 0x50, 0x45, 0x3d, 0x22, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x2c, 0x53, 0x54, 0x52,
+ 0x49, 0x4e, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x3d, 0x22, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x22, 0x2c, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x3d, 0x22, 0x4f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x2c, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f,
+ 0x43, 0x4c, 0x41, 0x53, 0x53, 0x3d, 0x22, 0x5b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x46,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x22, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6f, 0x62,
+ 0x6a, 0x65, 0x63, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x74, 0x6f,
+ 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6f, 0x62, 0x6a, 0x65,
+ 0x63, 0x74, 0x29, 0x3d, 0x3d, 0x3d, 0x46, 0x55, 0x4e, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43,
+ 0x4c, 0x41, 0x53, 0x53, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x78,
+ 0x74, 0x65, 0x6e, 0x64, 0x28, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72,
+ 0x20, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x73, 0x6f, 0x75,
+ 0x72, 0x63, 0x65, 0x29, 0x69, 0x66, 0x28, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x68, 0x61,
+ 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x70, 0x72, 0x6f,
+ 0x70, 0x65, 0x72, 0x74, 0x79, 0x29, 0x29, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x5b, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5d, 0x3d, 0x73, 0x6f, 0x75,
+ 0x72, 0x63, 0x65, 0x5b, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5d, 0x3b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x65, 0x79, 0x73, 0x28, 0x6f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x54, 0x79, 0x70, 0x65, 0x28, 0x6f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x29, 0x21, 0x3d, 0x3d, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f,
+ 0x54, 0x59, 0x50, 0x45, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x6e, 0x65, 0x77, 0x20,
+ 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x72, 0x65,
+ 0x73, 0x75, 0x6c, 0x74, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72,
+ 0x20, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x20, 0x69, 0x6e, 0x20, 0x6f, 0x62, 0x6a,
+ 0x65, 0x63, 0x74, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x68,
+ 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x70, 0x72,
+ 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x29, 0x29, 0x7b, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73,
+ 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x29, 0x7d,
+ 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x54, 0x79, 0x70, 0x65, 0x28, 0x6f, 0x29,
+ 0x7b, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x28, 0x6f, 0x29, 0x7b, 0x63, 0x61, 0x73, 0x65, 0x20,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4e, 0x55, 0x4c, 0x4c,
+ 0x5f, 0x54, 0x59, 0x50, 0x45, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x20, 0x76, 0x6f, 0x69, 0x64, 0x20,
+ 0x30, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e,
+ 0x45, 0x44, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x3b, 0x73, 0x77, 0x69, 0x74, 0x63, 0x68,
+ 0x28, 0x74, 0x79, 0x70, 0x65, 0x29, 0x7b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x62, 0x6f, 0x6f, 0x6c,
+ 0x65, 0x61, 0x6e, 0x22, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x42, 0x4f, 0x4f, 0x4c,
+ 0x45, 0x41, 0x4e, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x6e, 0x75,
+ 0x6d, 0x62, 0x65, 0x72, 0x22, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4e, 0x55, 0x4d,
+ 0x42, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x3b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x22, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x53, 0x54, 0x52,
+ 0x49, 0x4e, 0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x7d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x55, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,
+ 0x28, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x3d, 0x3d,
+ 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x7d, 0x76, 0x61, 0x72, 0x20,
+ 0x73, 0x6c, 0x69, 0x63, 0x65, 0x3d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x3b, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x75, 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0x6e, 0x67, 0x74,
+ 0x68, 0x3d, 0x3d, 0x31, 0x26, 0x26, 0x21, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x3f,
+ 0x5b, 0x5d, 0x3a, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x20, 0x77, 0x72, 0x61, 0x70, 0x28, 0x66, 0x6e, 0x2c, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65,
+ 0x72, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x5f, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3d,
+ 0x66, 0x6e, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x75, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x28, 0x5b, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x5f, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x5d, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74,
+ 0x73, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65,
+ 0x72, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x29, 0x7d,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x28, 0x61, 0x72, 0x72, 0x61, 0x79, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3d, 0x61, 0x72, 0x72,
+ 0x61, 0x79, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x77, 0x68, 0x69,
+ 0x6c, 0x65, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x2d, 0x29, 0x61, 0x72, 0x72, 0x61,
+ 0x79, 0x5b, 0x61, 0x72, 0x72, 0x61, 0x79, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2b, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x5d, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x5b, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x28, 0x61,
+ 0x72, 0x72, 0x61, 0x79, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x72, 0x61, 0x79,
+ 0x3d, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x72, 0x72, 0x61,
+ 0x79, 0x2c, 0x30, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x28, 0x61, 0x72, 0x72, 0x61, 0x79, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x66, 0x6e, 0x2c,
+ 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x32, 0x26, 0x26,
+ 0x69, 0x73, 0x55, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x5b, 0x30, 0x5d, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x5f, 0x5f, 0x6d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x3d, 0x66, 0x6e, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x73, 0x6c, 0x69, 0x63, 0x65,
+ 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2c,
+ 0x32, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x3d, 0x6d, 0x65, 0x72, 0x67, 0x65,
+ 0x28, 0x61, 0x72, 0x67, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64,
+ 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2c, 0x61,
+ 0x29, 0x7d, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x46, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x49, 0x53, 0x5f, 0x44, 0x4f,
+ 0x4e, 0x54, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x42, 0x55, 0x47, 0x47, 0x59, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20,
+ 0x70, 0x20, 0x69, 0x6e, 0x7b, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x31, 0x7d,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x70, 0x3d, 0x3d, 0x3d, 0x22, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69,
+ 0x6e, 0x67, 0x22, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65,
+ 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x28, 0x29, 0x3b,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x75, 0x62, 0x63, 0x6c, 0x61, 0x73,
+ 0x73, 0x28, 0x29, 0x7b, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65,
+ 0x73, 0x3d, 0x5b, 0x5d, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79,
+ 0x28, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x69,
+ 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72,
+ 0x74, 0x69, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x29, 0x29, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d,
+ 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74,
+ 0x28, 0x29, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6b, 0x6c, 0x61, 0x73,
+ 0x73, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c,
+ 0x69, 0x7a, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61,
+ 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x7d, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64,
+ 0x28, 0x6b, 0x6c, 0x61, 0x73, 0x73, 0x2c, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x4d, 0x65, 0x74,
+ 0x68, 0x6f, 0x64, 0x73, 0x29, 0x3b, 0x6b, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x73, 0x75, 0x70, 0x65,
+ 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3b, 0x6b, 0x6c,
+ 0x61, 0x73, 0x73, 0x2e, 0x73, 0x75, 0x62, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x3d, 0x5b,
+ 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x29, 0x7b, 0x73, 0x75, 0x62,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x3d,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65,
+ 0x3b, 0x6b, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65,
+ 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x73, 0x75, 0x62, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x3b, 0x74, 0x72,
+ 0x79, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x75, 0x62, 0x63, 0x6c, 0x61, 0x73,
+ 0x73, 0x65, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6b, 0x6c, 0x61, 0x73, 0x73, 0x29, 0x7d,
+ 0x63, 0x61, 0x74, 0x63, 0x68, 0x28, 0x65, 0x29, 0x7b, 0x7d, 0x7d, 0x66, 0x6f, 0x72, 0x28, 0x76,
+ 0x61, 0x72, 0x20, 0x69, 0x3d, 0x30, 0x2c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3d, 0x70, 0x72,
+ 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b,
+ 0x69, 0x3c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x2b, 0x2b, 0x29, 0x6b, 0x6c, 0x61,
+ 0x73, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x28, 0x70, 0x72,
+ 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x5b, 0x69, 0x5d, 0x29, 0x3b, 0x69, 0x66, 0x28,
+ 0x21, 0x6b, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65,
+ 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x29, 0x6b, 0x6c, 0x61, 0x73,
+ 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x69, 0x6e, 0x69, 0x74,
+ 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3d, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x46, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x6b, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x74, 0x79, 0x70, 0x65, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72,
+ 0x3d, 0x6b, 0x6c, 0x61, 0x73, 0x73, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6b, 0x6c,
+ 0x61, 0x73, 0x73, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x64, 0x64,
+ 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x28, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x26, 0x26, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x75, 0x70, 0x65, 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69,
+ 0x65, 0x73, 0x3d, 0x6b, 0x65, 0x79, 0x73, 0x28, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x29, 0x3b,
+ 0x69, 0x66, 0x28, 0x49, 0x53, 0x5f, 0x44, 0x4f, 0x4e, 0x54, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x42,
+ 0x55, 0x47, 0x47, 0x59, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e,
+ 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x21, 0x3d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72,
+ 0x69, 0x6e, 0x67, 0x29, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x70,
+ 0x75, 0x73, 0x68, 0x28, 0x22, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x3b,
+ 0x69, 0x66, 0x28, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f,
+ 0x66, 0x21, 0x3d, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74,
+ 0x79, 0x70, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x29, 0x70, 0x72, 0x6f, 0x70,
+ 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x22, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x4f, 0x66, 0x22, 0x29, 0x7d, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69,
+ 0x3d, 0x30, 0x2c, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3d, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72,
+ 0x74, 0x69, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x3c, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x2b, 0x2b, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x70, 0x72,
+ 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x3d, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65,
+ 0x73, 0x5b, 0x69, 0x5d, 0x2c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x73, 0x6f, 0x75, 0x72, 0x63,
+ 0x65, 0x5b, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x61,
+ 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x26, 0x26, 0x69, 0x73, 0x46, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x26, 0x26, 0x61, 0x72, 0x67, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x28, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29,
+ 0x5b, 0x30, 0x5d, 0x3d, 0x3d, 0x22, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x22, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x3d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3b,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x77, 0x72, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6d, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x61, 0x6e, 0x63, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x5b, 0x6d, 0x5d, 0x2e, 0x61, 0x70, 0x70, 0x6c,
+ 0x79, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x73,
+ 0x29, 0x7d, 0x7d, 0x28, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x29, 0x2c, 0x6d, 0x65,
+ 0x74, 0x68, 0x6f, 0x64, 0x29, 0x3b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x76, 0x61, 0x6c, 0x75,
+ 0x65, 0x4f, 0x66, 0x3d, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x66, 0x2c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x29, 0x3b,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3d, 0x62,
+ 0x69, 0x6e, 0x64, 0x28, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72,
+ 0x69, 0x6e, 0x67, 0x2c, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x29, 0x7d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x5b, 0x70, 0x72, 0x6f, 0x70, 0x65,
+ 0x72, 0x74, 0x79, 0x5d, 0x3d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x3a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x2c, 0x4d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x73, 0x3a, 0x7b, 0x61, 0x64, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x3a,
+ 0x61, 0x64, 0x64, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x7d, 0x7d, 0x7d, 0x28, 0x29, 0x3b,
+ 0x69, 0x66, 0x28, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
+ 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x29, 0x7b, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c,
+ 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x2e,
+ 0x43, 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x7d, 0x65, 0x6c, 0x73, 0x65,
+ 0x7b, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x2e, 0x43,
+ 0x6c, 0x61, 0x73, 0x73, 0x3d, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x7d, 0x7d, 0x29, 0x28, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x2e, 0x43, 0x6c, 0x61, 0x73,
+ 0x73, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73,
+ 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x21,
+ 0x3d, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x26, 0x26, 0x21,
+ 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x69, 0x6e, 0x20, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x61, 0x22, 0x29, 0x29, 0x29, 0x7b, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x76, 0x69, 0x65, 0x77, 0x29, 0x7b, 0x22, 0x75, 0x73,
+ 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x22, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x3d, 0x22, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x2c, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x6f,
+ 0x70, 0x3d, 0x22, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x22, 0x2c, 0x65, 0x6c,
+ 0x65, 0x6d, 0x43, 0x74, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x3d, 0x28, 0x76, 0x69, 0x65, 0x77,
+ 0x2e, 0x48, 0x54, 0x4d, 0x4c, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x76, 0x69,
+ 0x65, 0x77, 0x2e, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x5b, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x5d, 0x2c, 0x6f, 0x62, 0x6a, 0x43, 0x74, 0x72, 0x3d, 0x4f, 0x62,
+ 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x73, 0x74, 0x72, 0x54, 0x72, 0x69, 0x6d, 0x3d, 0x53, 0x74, 0x72,
+ 0x69, 0x6e, 0x67, 0x5b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x5d, 0x2e, 0x74,
+ 0x72, 0x69, 0x6d, 0x7c, 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x70, 0x6c,
+ 0x61, 0x63, 0x65, 0x28, 0x2f, 0x5e, 0x5c, 0x73, 0x2b, 0x7c, 0x5c, 0x73, 0x2b, 0x24, 0x2f, 0x67,
+ 0x2c, 0x22, 0x22, 0x29, 0x7d, 0x2c, 0x61, 0x72, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66,
+ 0x3d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x5b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x6f, 0x70,
+ 0x5d, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x4f, 0x66, 0x7c, 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d,
+ 0x30, 0x2c, 0x6c, 0x65, 0x6e, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x3b, 0x69, 0x3c, 0x6c, 0x65, 0x6e, 0x3b, 0x69, 0x2b, 0x2b,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x69, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x26, 0x26,
+ 0x74, 0x68, 0x69, 0x73, 0x5b, 0x69, 0x5d, 0x3d, 0x3d, 0x3d, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x7d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x2d, 0x31, 0x7d, 0x2c, 0x44, 0x4f, 0x4d, 0x45, 0x78, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x64, 0x65, 0x3d, 0x44, 0x4f, 0x4d, 0x45, 0x78, 0x63,
+ 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x5d, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x3d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
+ 0x65, 0x7d, 0x2c, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x6e, 0x64,
+ 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2c, 0x74, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3d, 0x3d, 0x3d, 0x22, 0x22,
+ 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x4f, 0x4d, 0x45,
+ 0x78, 0x28, 0x22, 0x53, 0x59, 0x4e, 0x54, 0x41, 0x58, 0x5f, 0x45, 0x52, 0x52, 0x22, 0x2c, 0x22,
+ 0x41, 0x6e, 0x20, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x6c,
+ 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x77, 0x61, 0x73,
+ 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x22, 0x29, 0x7d, 0x69, 0x66, 0x28,
+ 0x2f, 0x5c, 0x73, 0x2f, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x28, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x29,
+ 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x4f, 0x4d, 0x45,
+ 0x78, 0x28, 0x22, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x43, 0x48, 0x41, 0x52, 0x41,
+ 0x43, 0x54, 0x45, 0x52, 0x5f, 0x45, 0x52, 0x52, 0x22, 0x2c, 0x22, 0x53, 0x74, 0x72, 0x69, 0x6e,
+ 0x67, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x69, 0x6e,
+ 0x76, 0x61, 0x6c, 0x69, 0x64, 0x20, 0x63, 0x68, 0x61, 0x72, 0x61, 0x63, 0x74, 0x65, 0x72, 0x22,
+ 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x49, 0x6e, 0x64, 0x65,
+ 0x78, 0x4f, 0x66, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69,
+ 0x73, 0x74, 0x2c, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x29, 0x7d, 0x2c, 0x43, 0x6c, 0x61, 0x73, 0x73,
+ 0x4c, 0x69, 0x73, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x6c,
+ 0x65, 0x6d, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x72, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x43,
+ 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x3d, 0x73, 0x74, 0x72, 0x54, 0x72, 0x69, 0x6d, 0x2e, 0x63,
+ 0x61, 0x6c, 0x6c, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61,
+ 0x6d, 0x65, 0x29, 0x2c, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x3d, 0x74, 0x72, 0x69, 0x6d,
+ 0x6d, 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x3f, 0x74, 0x72, 0x69, 0x6d, 0x6d,
+ 0x65, 0x64, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28,
+ 0x2f, 0x5c, 0x73, 0x2b, 0x2f, 0x29, 0x3a, 0x5b, 0x5d, 0x2c, 0x69, 0x3d, 0x30, 0x2c, 0x6c, 0x65,
+ 0x6e, 0x3d, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x3b, 0x69, 0x3c, 0x6c, 0x65, 0x6e, 0x3b, 0x69, 0x2b, 0x2b, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63, 0x6c, 0x61, 0x73, 0x73,
+ 0x65, 0x73, 0x5b, 0x69, 0x5d, 0x29, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x75, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x65, 0x6c, 0x65, 0x6d, 0x2e, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x6f, 0x53, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x7d, 0x7d, 0x2c, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69,
+ 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x3d, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73,
+ 0x74, 0x5b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x5d, 0x3d, 0x5b, 0x5d, 0x2c,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x3b, 0x44, 0x4f, 0x4d, 0x45, 0x78, 0x5b, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x5d, 0x3d, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x5b, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x50, 0x72, 0x6f, 0x70, 0x5d, 0x3b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69,
+ 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x69, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x74, 0x68, 0x69, 0x73, 0x5b, 0x69, 0x5d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x65, 0x6e,
+ 0x29, 0x3d, 0x3d, 0x3d, 0x2d, 0x31, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x28, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x29,
+ 0x7d, 0x7d, 0x3b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74,
+ 0x6f, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x29, 0x7b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2b, 0x3d,
+ 0x22, 0x22, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x63, 0x68, 0x65,
+ 0x63, 0x6b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x64,
+ 0x65, 0x78, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x29, 0x3b, 0x69,
+ 0x66, 0x28, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x21, 0x3d, 0x3d, 0x2d, 0x31, 0x29, 0x7b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2c,
+ 0x31, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43,
+ 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x29, 0x7d, 0x7d, 0x3b, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x74, 0x6f, 0x67, 0x67,
+ 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x29, 0x7b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2b, 0x3d, 0x22, 0x22, 0x3b, 0x69, 0x66, 0x28,
+ 0x63, 0x68, 0x65, 0x63, 0x6b, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x6e, 0x64, 0x47, 0x65, 0x74,
+ 0x49, 0x6e, 0x64, 0x65, 0x78, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2c, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x29, 0x3d, 0x3d, 0x3d, 0x2d, 0x31, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x64, 0x64,
+ 0x28, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x29, 0x7d,
+ 0x7d, 0x3b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f,
+ 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x20, 0x22, 0x29, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x6f,
+ 0x62, 0x6a, 0x43, 0x74, 0x72, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x70,
+ 0x65, 0x72, 0x74, 0x79, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c,
+ 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x44, 0x65, 0x73, 0x63, 0x3d, 0x7b, 0x67, 0x65, 0x74,
+ 0x3a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72,
+ 0x2c, 0x65, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x74, 0x72, 0x75, 0x65,
+ 0x2c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x74, 0x72,
+ 0x75, 0x65, 0x7d, 0x3b, 0x74, 0x72, 0x79, 0x7b, 0x6f, 0x62, 0x6a, 0x43, 0x74, 0x72, 0x2e, 0x64,
+ 0x65, 0x66, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x65, 0x6c,
+ 0x65, 0x6d, 0x43, 0x74, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2c, 0x63, 0x6c, 0x61, 0x73, 0x73,
+ 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x2c, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69,
+ 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x44, 0x65, 0x73, 0x63, 0x29, 0x7d, 0x63, 0x61, 0x74, 0x63,
+ 0x68, 0x28, 0x65, 0x78, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x65, 0x78, 0x2e, 0x6e, 0x75, 0x6d, 0x62,
+ 0x65, 0x72, 0x3d, 0x3d, 0x3d, 0x2d, 0x32, 0x31, 0x34, 0x36, 0x38, 0x32, 0x33, 0x32, 0x35, 0x32,
+ 0x29, 0x7b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x44,
+ 0x65, 0x73, 0x63, 0x2e, 0x65, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x62, 0x6c, 0x65, 0x3d, 0x66,
+ 0x61, 0x6c, 0x73, 0x65, 0x3b, 0x6f, 0x62, 0x6a, 0x43, 0x74, 0x72, 0x2e, 0x64, 0x65, 0x66, 0x69,
+ 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x43,
+ 0x74, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2c, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73,
+ 0x74, 0x50, 0x72, 0x6f, 0x70, 0x2c, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x50,
+ 0x72, 0x6f, 0x70, 0x44, 0x65, 0x73, 0x63, 0x29, 0x7d, 0x7d, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20,
+ 0x69, 0x66, 0x28, 0x6f, 0x62, 0x6a, 0x43, 0x74, 0x72, 0x5b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x50,
+ 0x72, 0x6f, 0x70, 0x5d, 0x2e, 0x5f, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74,
+ 0x74, 0x65, 0x72, 0x5f, 0x5f, 0x29, 0x7b, 0x65, 0x6c, 0x65, 0x6d, 0x43, 0x74, 0x72, 0x50, 0x72,
+ 0x6f, 0x74, 0x6f, 0x2e, 0x5f, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x47, 0x65, 0x74, 0x74,
+ 0x65, 0x72, 0x5f, 0x5f, 0x28, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72,
+ 0x6f, 0x70, 0x2c, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x47, 0x65, 0x74, 0x74,
+ 0x65, 0x72, 0x29, 0x7d, 0x7d, 0x29, 0x28, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x29, 0x7d, 0x7d,
+ 0x3b, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x52, 0x49, 0x43, 0x4b, 0x53,
+ 0x48, 0x41, 0x57, 0x5f, 0x4e, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x54, 0x21, 0x3d, 0x3d,
+ 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x26, 0x26, 0x21, 0x52, 0x49,
+ 0x43, 0x4b, 0x53, 0x48, 0x41, 0x57, 0x5f, 0x4e, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x54,
+ 0x7c, 0x7c, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x52, 0x49, 0x43, 0x4b, 0x53, 0x48, 0x41,
+ 0x57, 0x5f, 0x4e, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x41, 0x54, 0x3d, 0x3d, 0x3d, 0x22, 0x75,
+ 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x29, 0x7b, 0x6e, 0x65, 0x77, 0x20, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x2e, 0x43,
+ 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x7d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x22, 0x29, 0x3b, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69,
+ 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67,
+ 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x20, 0x6e,
+ 0x65, 0x65, 0x64, 0x73, 0x20, 0x61, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
+ 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x3b,
+ 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x6e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x21, 0x3d, 0x3d, 0x31, 0x29, 0x74, 0x68, 0x72,
+ 0x6f, 0x77, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70,
+ 0x68, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x77, 0x61, 0x73, 0x20, 0x64, 0x65,
+ 0x66, 0x69, 0x6e, 0x65, 0x64, 0x20, 0x62, 0x75, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x6e,
+ 0x20, 0x48, 0x54, 0x4d, 0x4c, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73,
+ 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3d, 0x7b, 0x7d, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62,
+ 0x61, 0x63, 0x6b, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x3d,
+ 0x5b, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73,
+ 0x3d, 0x7b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a,
+ 0x22, 0x63, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x61, 0x6c, 0x22, 0x2c, 0x6f, 0x66, 0x66, 0x73, 0x65,
+ 0x74, 0x3a, 0x22, 0x7a, 0x65, 0x72, 0x6f, 0x22, 0x2c, 0x6d, 0x69, 0x6e, 0x3a, 0x75, 0x6e, 0x64,
+ 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x2c, 0x6d, 0x61, 0x78, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x66,
+ 0x69, 0x6e, 0x65, 0x64, 0x2c, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3a, 0x66, 0x61,
+ 0x6c, 0x73, 0x65, 0x2c, 0x78, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x66,
+ 0x69, 0x6e, 0x65, 0x64, 0x2c, 0x79, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3a, 0x75, 0x6e, 0x64, 0x65,
+ 0x66, 0x69, 0x6e, 0x65, 0x64, 0x2c, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3a, 0x74, 0x72, 0x75, 0x65,
+ 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x65, 0x72, 0x73, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66,
+ 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x7d, 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x53,
+ 0x69, 0x7a, 0x65, 0x28, 0x7b, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x61, 0x72, 0x67, 0x73, 0x2e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x61, 0x72, 0x67,
+ 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73,
+ 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x22, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73,
+ 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28,
+ 0x22, 0x73, 0x76, 0x67, 0x3a, 0x73, 0x76, 0x67, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28,
+ 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x29, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x67,
+ 0x65, 0x28, 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x6c, 0x6f, 0x61, 0x64, 0x52,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x20, 0x69, 0x6e, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x21, 0x6e, 0x61, 0x6d, 0x65, 0x7c, 0x7c, 0x21, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e,
+ 0x68, 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x6e,
+ 0x61, 0x6d, 0x65, 0x29, 0x29, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x72, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5b, 0x6e, 0x61, 0x6d, 0x65,
+ 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x72, 0x7c, 0x7c, 0x21, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x74, 0x79, 0x70, 0x65, 0x7c, 0x7c, 0x21, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74,
+ 0x79, 0x70, 0x65, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x29, 0x63, 0x6f, 0x6e, 0x74, 0x69,
+ 0x6e, 0x75, 0x65, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
+ 0x72, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x28, 0x6e, 0x65, 0x77, 0x20, 0x72, 0x28,
+ 0x7b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3a, 0x73, 0x65, 0x6c, 0x66, 0x7d, 0x29, 0x29, 0x7d, 0x7d,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e,
+ 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x26,
+ 0x26, 0x21, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
+ 0x63, 0x65, 0x6f, 0x66, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x53, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x29, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x4f, 0x62, 0x6a, 0x65, 0x63,
+ 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x74, 0x6f, 0x53, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x29, 0x3b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20,
+ 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3a,
+ 0x20, 0x22, 0x2b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
+ 0x72, 0x65, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75,
+ 0x6e, 0x74, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63,
+ 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x21, 0x28, 0x73, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x6f, 0x66, 0x20,
+ 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x29, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x73,
+ 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x6e, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20,
+ 0x22, 0x2b, 0x73, 0x7d, 0x69, 0x66, 0x28, 0x21, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x29, 0x7b,
+ 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x68, 0x61, 0x73,
+ 0x20, 0x6e, 0x6f, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x20, 0x22, 0x2b, 0x4a, 0x53, 0x4f, 0x4e,
+ 0x2e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x69, 0x66, 0x79, 0x28, 0x73, 0x29, 0x7d, 0x69, 0x66,
+ 0x28, 0x21, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28,
+ 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x29, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f,
+ 0x74, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3a, 0x20, 0x22, 0x2b, 0x4a, 0x53,
+ 0x4f, 0x4e, 0x2e, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x69, 0x66, 0x79, 0x28, 0x73, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x29, 0x7d, 0x69, 0x66, 0x28, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e, 0x30, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x78, 0x3d, 0x73,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x79,
+ 0x3d, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x30, 0x5d, 0x2e, 0x79, 0x3b, 0x69, 0x66, 0x28,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x78, 0x21, 0x3d, 0x22, 0x6e, 0x75, 0x6d, 0x62, 0x65,
+ 0x72, 0x22, 0x7c, 0x7c, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x79, 0x21, 0x3d, 0x22, 0x6e,
+ 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x26, 0x26, 0x79, 0x21, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x78, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x79, 0x20,
+ 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x70, 0x6f,
+ 0x69, 0x6e, 0x74, 0x73, 0x20, 0x73, 0x68, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x20, 0x6e,
+ 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, 0x6f,
+ 0x66, 0x20, 0x22, 0x2b, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x78, 0x2b, 0x22, 0x20, 0x61,
+ 0x6e, 0x64, 0x20, 0x22, 0x2b, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x79, 0x7d, 0x7d, 0x69,
+ 0x66, 0x28, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3e,
+ 0x3d, 0x33, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x32, 0x5d,
+ 0x2e, 0x78, 0x3c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x7c, 0x7c,
+ 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x3c, 0x73, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x7c, 0x7c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b,
+ 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x5d,
+ 0x2e, 0x78, 0x3c, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x29, 0x7b,
+ 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x64, 0x61, 0x74,
+ 0x61, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x73, 0x6f,
+ 0x72, 0x74, 0x65, 0x64, 0x20, 0x6f, 0x6e, 0x20, 0x78, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,
+ 0x20, 0x66, 0x6f, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3a, 0x20, 0x22, 0x2b, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x7d, 0x7d, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x44, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x69, 0x6e, 0x3d, 0x64, 0x33, 0x2e,
+ 0x6d, 0x69, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x64, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x7d, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x61,
+ 0x78, 0x3d, 0x64, 0x33, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6d, 0x61,
+ 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x5b, 0x64, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d,
+ 0x31, 0x5d, 0x2e, 0x78, 0x7d, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5b, 0x6d,
+ 0x69, 0x6e, 0x2c, 0x6d, 0x61, 0x78, 0x5d, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x69,
+ 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69,
+ 0x6e, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e,
+ 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x78, 0x3d,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x78, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x7c, 0x7c, 0x64, 0x33,
+ 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x28, 0x29, 0x29,
+ 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x28, 0x29, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x64,
+ 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x78, 0x29, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x5b,
+ 0x30, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x5d, 0x29, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x79, 0x3d, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x79, 0x53, 0x63, 0x61,
+ 0x6c, 0x65, 0x7c, 0x7c, 0x64, 0x33, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6c, 0x69, 0x6e,
+ 0x65, 0x61, 0x72, 0x28, 0x29, 0x29, 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x28, 0x29, 0x2e, 0x64, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x79, 0x29, 0x2e, 0x72,
+ 0x61, 0x6e, 0x67, 0x65, 0x28, 0x5b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x2c, 0x30, 0x5d, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x78, 0x2e, 0x6d, 0x61, 0x67,
+ 0x6e, 0x69, 0x74, 0x75, 0x64, 0x65, 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e,
+ 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28,
+ 0x5b, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x78, 0x5b, 0x30, 0x5d, 0x2d, 0x64, 0x6f, 0x6d,
+ 0x61, 0x69, 0x6e, 0x2e, 0x78, 0x5b, 0x30, 0x5d, 0x2c, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e,
+ 0x78, 0x5b, 0x31, 0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, 0x61, 0x63, 0x6b, 0x65, 0x64,
+ 0x44, 0x61, 0x74, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x44,
+ 0x61, 0x74, 0x61, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x63, 0x6f,
+ 0x76, 0x65, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28,
+ 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c,
+ 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b,
+ 0x29, 0x7b, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x29, 0x7d, 0x29, 0x7d, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x28, 0x29, 0x2e,
+ 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x7d, 0x29, 0x2e,
+ 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x64,
+ 0x29, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x70,
+ 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x29, 0x7b, 0x70,
+ 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x7d, 0x29, 0x7d,
+ 0x64, 0x61, 0x74, 0x61, 0x3d, 0x70, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x3f, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x64, 0x61, 0x74,
+ 0x61, 0x29, 0x3a, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x28, 0x29, 0x2e, 0x66, 0x6f, 0x72,
+ 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x64, 0x61, 0x74, 0x61,
+ 0x5b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x44, 0x61, 0x74, 0x61, 0x29, 0x7b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74,
+ 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x64, 0x2e, 0x79, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x64, 0x2e, 0x79, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x7d,
+ 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61,
+ 0x2e, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45,
+ 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x6e, 0x74,
+ 0x72, 0x79, 0x29, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x2e, 0x66,
+ 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x5b, 0x64, 0x61, 0x74,
+ 0x61, 0x5d, 0x29, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65,
+ 0x64, 0x44, 0x61, 0x74, 0x61, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53,
+ 0x74, 0x61, 0x63, 0x6b, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6c,
+ 0x61, 0x79, 0x6f, 0x75, 0x74, 0x3d, 0x64, 0x33, 0x2e, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2e,
+ 0x73, 0x74, 0x61, 0x63, 0x6b, 0x28, 0x29, 0x3b, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x6f,
+ 0x66, 0x66, 0x73, 0x65, 0x74, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6f, 0x66, 0x66, 0x73, 0x65,
+ 0x74, 0x29, 0x3b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x6c,
+ 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x7d, 0x73, 0x74, 0x61, 0x63,
+ 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44,
+ 0x61, 0x74, 0x61, 0x7c, 0x7c, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x75, 0x6e, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x29, 0x7b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x2e,
+ 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x29, 0x7b, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x64, 0x2e, 0x79, 0x30,
+ 0x3d, 0x64, 0x2e, 0x79, 0x30, 0x3d, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x64, 0x3f, 0x30, 0x3a, 0x64, 0x2e, 0x79, 0x30, 0x7d, 0x29, 0x7d, 0x29, 0x7d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x68, 0x6f, 0x6f, 0x6b,
+ 0x73, 0x2e, 0x61, 0x66, 0x74, 0x65, 0x72, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x29, 0x7b,
+ 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x65, 0x6e, 0x74, 0x72,
+ 0x79, 0x2e, 0x66, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x5b,
+ 0x64, 0x61, 0x74, 0x61, 0x5d, 0x29, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x30,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72,
+ 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3d, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x5b, 0x69, 0x2b, 0x2b, 0x5d, 0x7d, 0x29, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61,
+ 0x3d, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x7d,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x53,
+ 0x74, 0x61, 0x63, 0x6b, 0x61, 0x62, 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x70,
+ 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e,
+ 0x74, 0x3d, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x7c, 0x7c, 0x73,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x66, 0x28,
+ 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x26, 0x26, 0x73, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x21, 0x3d, 0x70, 0x6f, 0x69, 0x6e,
+ 0x74, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x73,
+ 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x63, 0x61,
+ 0x6e, 0x6e, 0x6f, 0x74, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72,
+ 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x70,
+ 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x3a, 0x20, 0x22, 0x2b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x43,
+ 0x6f, 0x75, 0x6e, 0x74, 0x2b, 0x22, 0x20, 0x76, 0x73, 0x20, 0x22, 0x2b, 0x73, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2b, 0x22, 0x3b, 0x20, 0x73, 0x65, 0x65,
+ 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x66, 0x69, 0x6c, 0x6c, 0x28, 0x29, 0x22, 0x7d, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29,
+ 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61,
+ 0x2e, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x3d, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x5b, 0x5d, 0x2c,
+ 0x61, 0x66, 0x74, 0x65, 0x72, 0x3a, 0x5b, 0x5d, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x73, 0x6c, 0x69, 0x63, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77,
+ 0x2e, 0x78, 0x4d, 0x69, 0x6e, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x6e, 0x64,
+ 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x61, 0x78, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x73, 0x49,
+ 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x69, 0x6e, 0x26,
+ 0x26, 0x64, 0x2e, 0x78, 0x3c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77,
+ 0x2e, 0x78, 0x4d, 0x69, 0x6e, 0x29, 0x69, 0x73, 0x49, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x3d,
+ 0x66, 0x61, 0x6c, 0x73, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69,
+ 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x61, 0x78, 0x26, 0x26, 0x64, 0x2e, 0x78, 0x3e, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x61, 0x78, 0x29,
+ 0x69, 0x73, 0x49, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x3d, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x73, 0x49, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65,
+ 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61,
+ 0x63, 0x6b, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63,
+ 0x6b, 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x75, 0x72, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x61,
+ 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7d, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x5b, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x5d, 0x3d, 0x72, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x65, 0x72, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x75, 0x72, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72,
+ 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b,
+ 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x7c, 0x7c, 0x61,
+ 0x72, 0x67, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x73, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x29, 0x2e, 0x66, 0x6f, 0x72, 0x45,
+ 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6b, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5b, 0x6b, 0x5d, 0x3d, 0x6b,
+ 0x20, 0x69, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x73, 0x3f, 0x61, 0x72, 0x67, 0x73, 0x5b, 0x6b, 0x5d,
+ 0x3a, 0x6b, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x5b,
+ 0x6b, 0x5d, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73,
+ 0x5b, 0x6b, 0x5d, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x29, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6b, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6b,
+ 0x5d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5b, 0x6b, 0x5d,
+ 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x73, 0x74, 0x61, 0x63,
+ 0x6b, 0x22, 0x69, 0x6e, 0x20, 0x61, 0x72, 0x67, 0x73, 0x29, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x75,
+ 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3d, 0x21, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3d,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x7c, 0x7c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x26, 0x26, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x7c, 0x7c, 0x22, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x65, 0x74, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x28, 0x72, 0x65, 0x6e, 0x64, 0x65,
+ 0x72, 0x65, 0x72, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b,
+ 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7b, 0x63, 0x61, 0x6c,
+ 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x29, 0x7d, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x72, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x72, 0x3d, 0x3d, 0x22, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x72, 0x28, 0x7b, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x3a, 0x73, 0x65, 0x6c, 0x66, 0x7d, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65,
+ 0x72, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x29,
+ 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x5b, 0x72, 0x5d, 0x29, 0x7b, 0x74, 0x68,
+ 0x72, 0x6f, 0x77, 0x22, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x6e, 0x27, 0x74, 0x20, 0x66, 0x69, 0x6e,
+ 0x64, 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x20, 0x22, 0x2b, 0x72, 0x7d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x5b, 0x72, 0x5d, 0x7d,
+ 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x3d,
+ 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72,
+ 0x65, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x7c,
+ 0x7c, 0x7b, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x77, 0x69,
+ 0x6e, 0x64, 0x6f, 0x77, 0x21, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3d, 0x77, 0x69, 0x6e, 0x64,
+ 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x53, 0x74,
+ 0x79, 0x6c, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74,
+ 0x28, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
+ 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x29,
+ 0x2c, 0x31, 0x30, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28,
+ 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74,
+ 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x29,
+ 0x2c, 0x31, 0x30, 0x29, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x7c, 0x7c, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x7c, 0x7c, 0x34, 0x30, 0x30, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x68,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x7c, 0x7c, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x7c, 0x7c, 0x32, 0x35, 0x30, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76,
+ 0x69, 0x73, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x2e, 0x61, 0x74, 0x74,
+ 0x72, 0x28, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67,
+ 0x68, 0x74, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x29,
+ 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a,
+ 0x65, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x43,
+ 0x6f, 0x6c, 0x6f, 0x72, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x46, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x3d, 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x31,
+ 0x34, 0x3d, 0x5b, 0x22, 0x23, 0x65, 0x63, 0x62, 0x37, 0x39, 0x36, 0x22, 0x2c, 0x22, 0x23, 0x64,
+ 0x63, 0x38, 0x66, 0x37, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x62, 0x32, 0x61, 0x34, 0x37, 0x30, 0x22,
+ 0x2c, 0x22, 0x23, 0x39, 0x32, 0x38, 0x37, 0x35, 0x61, 0x22, 0x2c, 0x22, 0x23, 0x37, 0x31, 0x36,
+ 0x63, 0x34, 0x39, 0x22, 0x2c, 0x22, 0x23, 0x64, 0x32, 0x65, 0x64, 0x38, 0x32, 0x22, 0x2c, 0x22,
+ 0x23, 0x62, 0x62, 0x65, 0x34, 0x36, 0x38, 0x22, 0x2c, 0x22, 0x23, 0x61, 0x31, 0x64, 0x30, 0x35,
+ 0x64, 0x22, 0x2c, 0x22, 0x23, 0x65, 0x37, 0x63, 0x62, 0x65, 0x36, 0x22, 0x2c, 0x22, 0x23, 0x64,
+ 0x38, 0x61, 0x61, 0x64, 0x36, 0x22, 0x2c, 0x22, 0x23, 0x61, 0x38, 0x38, 0x38, 0x63, 0x32, 0x22,
+ 0x2c, 0x22, 0x23, 0x39, 0x64, 0x63, 0x32, 0x64, 0x33, 0x22, 0x2c, 0x22, 0x23, 0x36, 0x34, 0x39,
+ 0x65, 0x62, 0x39, 0x22, 0x2c, 0x22, 0x23, 0x33, 0x38, 0x37, 0x61, 0x61, 0x33, 0x22, 0x5d, 0x2e,
+ 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x2e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x32,
+ 0x30, 0x30, 0x30, 0x3d, 0x5b, 0x22, 0x23, 0x35, 0x37, 0x33, 0x30, 0x36, 0x66, 0x22, 0x2c, 0x22,
+ 0x23, 0x35, 0x31, 0x34, 0x63, 0x37, 0x36, 0x22, 0x2c, 0x22, 0x23, 0x36, 0x34, 0x36, 0x35, 0x38,
+ 0x33, 0x22, 0x2c, 0x22, 0x23, 0x37, 0x33, 0x38, 0x33, 0x39, 0x34, 0x22, 0x2c, 0x22, 0x23, 0x36,
+ 0x62, 0x39, 0x63, 0x37, 0x64, 0x22, 0x2c, 0x22, 0x23, 0x38, 0x34, 0x62, 0x36, 0x36, 0x35, 0x22,
+ 0x2c, 0x22, 0x23, 0x61, 0x37, 0x63, 0x61, 0x35, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x62, 0x66, 0x65,
+ 0x37, 0x34, 0x36, 0x22, 0x2c, 0x22, 0x23, 0x65, 0x32, 0x66, 0x35, 0x32, 0x38, 0x22, 0x2c, 0x22,
+ 0x23, 0x66, 0x66, 0x66, 0x37, 0x32, 0x36, 0x22, 0x2c, 0x22, 0x23, 0x65, 0x63, 0x64, 0x64, 0x30,
+ 0x30, 0x22, 0x2c, 0x22, 0x23, 0x64, 0x34, 0x62, 0x31, 0x31, 0x64, 0x22, 0x2c, 0x22, 0x23, 0x64,
+ 0x65, 0x38, 0x38, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x64, 0x65, 0x34, 0x38, 0x30, 0x30, 0x22,
+ 0x2c, 0x22, 0x23, 0x63, 0x39, 0x31, 0x35, 0x31, 0x35, 0x22, 0x2c, 0x22, 0x23, 0x39, 0x61, 0x30,
+ 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x37, 0x62, 0x30, 0x34, 0x32, 0x39, 0x22, 0x2c, 0x22,
+ 0x23, 0x35, 0x38, 0x30, 0x38, 0x33, 0x39, 0x22, 0x2c, 0x22, 0x23, 0x33, 0x31, 0x30, 0x38, 0x32,
+ 0x62, 0x22, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73,
+ 0x2e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x72, 0x75, 0x6d, 0x32, 0x30, 0x30, 0x31, 0x3d, 0x5b, 0x22,
+ 0x23, 0x32, 0x66, 0x32, 0x34, 0x33, 0x66, 0x22, 0x2c, 0x22, 0x23, 0x33, 0x63, 0x32, 0x63, 0x35,
+ 0x35, 0x22, 0x2c, 0x22, 0x23, 0x34, 0x61, 0x33, 0x37, 0x36, 0x38, 0x22, 0x2c, 0x22, 0x23, 0x35,
+ 0x36, 0x35, 0x32, 0x37, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x36, 0x62, 0x36, 0x62, 0x37, 0x63, 0x22,
+ 0x2c, 0x22, 0x23, 0x37, 0x32, 0x39, 0x35, 0x37, 0x66, 0x22, 0x2c, 0x22, 0x23, 0x38, 0x36, 0x61,
+ 0x64, 0x36, 0x65, 0x22, 0x2c, 0x22, 0x23, 0x61, 0x31, 0x62, 0x63, 0x35, 0x65, 0x22, 0x2c, 0x22,
+ 0x23, 0x62, 0x38, 0x64, 0x39, 0x35, 0x34, 0x22, 0x2c, 0x22, 0x23, 0x64, 0x33, 0x65, 0x30, 0x34,
+ 0x65, 0x22, 0x2c, 0x22, 0x23, 0x63, 0x63, 0x61, 0x64, 0x32, 0x61, 0x22, 0x2c, 0x22, 0x23, 0x63,
+ 0x63, 0x38, 0x34, 0x31, 0x32, 0x22, 0x2c, 0x22, 0x23, 0x63, 0x31, 0x35, 0x32, 0x31, 0x64, 0x22,
+ 0x2c, 0x22, 0x23, 0x61, 0x64, 0x33, 0x38, 0x32, 0x31, 0x22, 0x2c, 0x22, 0x23, 0x38, 0x61, 0x31,
+ 0x30, 0x31, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x36, 0x38, 0x31, 0x37, 0x31, 0x37, 0x22, 0x2c, 0x22,
+ 0x23, 0x35, 0x33, 0x31, 0x65, 0x31, 0x65, 0x22, 0x2c, 0x22, 0x23, 0x33, 0x64, 0x31, 0x38, 0x31,
+ 0x38, 0x22, 0x2c, 0x22, 0x23, 0x33, 0x32, 0x30, 0x61, 0x31, 0x62, 0x22, 0x5d, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73,
+ 0x69, 0x63, 0x39, 0x3d, 0x5b, 0x22, 0x23, 0x34, 0x32, 0x33, 0x64, 0x34, 0x66, 0x22, 0x2c, 0x22,
+ 0x23, 0x34, 0x61, 0x36, 0x38, 0x36, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x38, 0x34, 0x38, 0x66, 0x33,
+ 0x39, 0x22, 0x2c, 0x22, 0x23, 0x61, 0x32, 0x62, 0x37, 0x33, 0x63, 0x22, 0x2c, 0x22, 0x23, 0x64,
+ 0x64, 0x63, 0x62, 0x35, 0x33, 0x22, 0x2c, 0x22, 0x23, 0x63, 0x35, 0x61, 0x33, 0x32, 0x66, 0x22,
+ 0x2c, 0x22, 0x23, 0x37, 0x64, 0x35, 0x38, 0x33, 0x36, 0x22, 0x2c, 0x22, 0x23, 0x39, 0x36, 0x33,
+ 0x62, 0x32, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x37, 0x63, 0x32, 0x36, 0x32, 0x36, 0x22, 0x2c, 0x22,
+ 0x23, 0x34, 0x39, 0x31, 0x64, 0x33, 0x37, 0x22, 0x2c, 0x22, 0x23, 0x32, 0x66, 0x32, 0x35, 0x34,
+ 0x61, 0x22, 0x5d, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x28, 0x29, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x2e, 0x68, 0x74, 0x74, 0x70, 0x53,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x3d, 0x7b, 0x35, 0x30, 0x33, 0x3a, 0x22, 0x23, 0x65, 0x61, 0x35,
+ 0x30, 0x32, 0x39, 0x22, 0x2c, 0x35, 0x30, 0x32, 0x3a, 0x22, 0x23, 0x64, 0x32, 0x33, 0x66, 0x31,
+ 0x34, 0x22, 0x2c, 0x35, 0x30, 0x30, 0x3a, 0x22, 0x23, 0x62, 0x66, 0x33, 0x36, 0x31, 0x33, 0x22,
+ 0x2c, 0x34, 0x31, 0x30, 0x3a, 0x22, 0x23, 0x65, 0x66, 0x61, 0x63, 0x65, 0x61, 0x22, 0x2c, 0x34,
+ 0x30, 0x39, 0x3a, 0x22, 0x23, 0x65, 0x32, 0x39, 0x31, 0x64, 0x63, 0x22, 0x2c, 0x34, 0x30, 0x33,
+ 0x3a, 0x22, 0x23, 0x66, 0x34, 0x35, 0x37, 0x65, 0x38, 0x22, 0x2c, 0x34, 0x30, 0x38, 0x3a, 0x22,
+ 0x23, 0x65, 0x31, 0x32, 0x31, 0x64, 0x32, 0x22, 0x2c, 0x34, 0x30, 0x31, 0x3a, 0x22, 0x23, 0x62,
+ 0x39, 0x32, 0x64, 0x61, 0x65, 0x22, 0x2c, 0x34, 0x30, 0x35, 0x3a, 0x22, 0x23, 0x66, 0x34, 0x37,
+ 0x63, 0x65, 0x62, 0x22, 0x2c, 0x34, 0x30, 0x34, 0x3a, 0x22, 0x23, 0x61, 0x38, 0x32, 0x61, 0x39,
+ 0x66, 0x22, 0x2c, 0x34, 0x30, 0x30, 0x3a, 0x22, 0x23, 0x62, 0x32, 0x36, 0x33, 0x63, 0x36, 0x22,
+ 0x2c, 0x33, 0x30, 0x31, 0x3a, 0x22, 0x23, 0x36, 0x66, 0x61, 0x30, 0x32, 0x34, 0x22, 0x2c, 0x33,
+ 0x30, 0x32, 0x3a, 0x22, 0x23, 0x38, 0x37, 0x63, 0x33, 0x32, 0x62, 0x22, 0x2c, 0x33, 0x30, 0x37,
+ 0x3a, 0x22, 0x23, 0x61, 0x30, 0x64, 0x38, 0x34, 0x63, 0x22, 0x2c, 0x33, 0x30, 0x34, 0x3a, 0x22,
+ 0x23, 0x32, 0x38, 0x62, 0x35, 0x35, 0x63, 0x22, 0x2c, 0x32, 0x30, 0x30, 0x3a, 0x22, 0x23, 0x31,
+ 0x61, 0x34, 0x66, 0x37, 0x34, 0x22, 0x2c, 0x32, 0x30, 0x36, 0x3a, 0x22, 0x23, 0x32, 0x37, 0x38,
+ 0x33, 0x39, 0x66, 0x22, 0x2c, 0x32, 0x30, 0x31, 0x3a, 0x22, 0x23, 0x35, 0x32, 0x61, 0x64, 0x63,
+ 0x39, 0x22, 0x2c, 0x32, 0x30, 0x32, 0x3a, 0x22, 0x23, 0x37, 0x63, 0x39, 0x37, 0x39, 0x66, 0x22,
+ 0x2c, 0x32, 0x30, 0x33, 0x3a, 0x22, 0x23, 0x61, 0x35, 0x62, 0x38, 0x62, 0x64, 0x22, 0x2c, 0x32,
+ 0x30, 0x34, 0x3a, 0x22, 0x23, 0x63, 0x31, 0x63, 0x64, 0x64, 0x31, 0x22, 0x7d, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
+ 0x77, 0x68, 0x65, 0x65, 0x6c, 0x3d, 0x5b, 0x22, 0x23, 0x62, 0x35, 0x62, 0x36, 0x61, 0x39, 0x22,
+ 0x2c, 0x22, 0x23, 0x38, 0x35, 0x38, 0x37, 0x37, 0x32, 0x22, 0x2c, 0x22, 0x23, 0x37, 0x38, 0x35,
+ 0x66, 0x34, 0x33, 0x22, 0x2c, 0x22, 0x23, 0x39, 0x36, 0x35, 0x35, 0x37, 0x65, 0x22, 0x2c, 0x22,
+ 0x23, 0x34, 0x36, 0x38, 0x32, 0x62, 0x34, 0x22, 0x2c, 0x22, 0x23, 0x36, 0x35, 0x62, 0x39, 0x61,
+ 0x63, 0x22, 0x2c, 0x22, 0x23, 0x37, 0x33, 0x63, 0x30, 0x33, 0x61, 0x22, 0x2c, 0x22, 0x23, 0x63,
+ 0x62, 0x35, 0x31, 0x33, 0x61, 0x22, 0x5d, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x28,
+ 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x2e, 0x63,
+ 0x6f, 0x6f, 0x6c, 0x3d, 0x5b, 0x22, 0x23, 0x35, 0x65, 0x39, 0x64, 0x32, 0x66, 0x22, 0x2c, 0x22,
+ 0x23, 0x37, 0x33, 0x63, 0x30, 0x33, 0x61, 0x22, 0x2c, 0x22, 0x23, 0x34, 0x36, 0x38, 0x32, 0x62,
+ 0x34, 0x22, 0x2c, 0x22, 0x23, 0x37, 0x62, 0x63, 0x33, 0x62, 0x38, 0x22, 0x2c, 0x22, 0x23, 0x61,
+ 0x39, 0x38, 0x38, 0x34, 0x65, 0x22, 0x2c, 0x22, 0x23, 0x63, 0x31, 0x62, 0x32, 0x36, 0x36, 0x22,
+ 0x2c, 0x22, 0x23, 0x61, 0x34, 0x37, 0x34, 0x39, 0x33, 0x22, 0x2c, 0x22, 0x23, 0x63, 0x30, 0x39,
+ 0x66, 0x62, 0x35, 0x22, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d,
+ 0x65, 0x73, 0x2e, 0x6d, 0x75, 0x6e, 0x69, 0x6e, 0x3d, 0x5b, 0x22, 0x23, 0x30, 0x30, 0x63, 0x63,
+ 0x30, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x30, 0x30, 0x36, 0x36, 0x62, 0x33, 0x22, 0x2c, 0x22, 0x23,
+ 0x66, 0x66, 0x38, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x66, 0x66, 0x63, 0x63, 0x30, 0x30,
+ 0x22, 0x2c, 0x22, 0x23, 0x33, 0x33, 0x30, 0x30, 0x39, 0x39, 0x22, 0x2c, 0x22, 0x23, 0x39, 0x39,
+ 0x30, 0x30, 0x39, 0x39, 0x22, 0x2c, 0x22, 0x23, 0x63, 0x63, 0x66, 0x66, 0x30, 0x30, 0x22, 0x2c,
+ 0x22, 0x23, 0x66, 0x66, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x38, 0x30, 0x38, 0x30,
+ 0x38, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x30, 0x30, 0x38, 0x66, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x23,
+ 0x30, 0x30, 0x34, 0x38, 0x37, 0x64, 0x22, 0x2c, 0x22, 0x23, 0x62, 0x33, 0x35, 0x61, 0x30, 0x30,
+ 0x22, 0x2c, 0x22, 0x23, 0x62, 0x33, 0x38, 0x66, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x36, 0x62,
+ 0x30, 0x30, 0x36, 0x62, 0x22, 0x2c, 0x22, 0x23, 0x38, 0x66, 0x62, 0x33, 0x30, 0x30, 0x22, 0x2c,
+ 0x22, 0x23, 0x62, 0x33, 0x30, 0x30, 0x30, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x62, 0x65, 0x62, 0x65,
+ 0x62, 0x65, 0x22, 0x2c, 0x22, 0x23, 0x38, 0x30, 0x66, 0x66, 0x38, 0x30, 0x22, 0x2c, 0x22, 0x23,
+ 0x38, 0x30, 0x63, 0x39, 0x66, 0x66, 0x22, 0x2c, 0x22, 0x23, 0x66, 0x66, 0x63, 0x30, 0x38, 0x30,
+ 0x22, 0x2c, 0x22, 0x23, 0x66, 0x66, 0x65, 0x36, 0x38, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x61, 0x61,
+ 0x38, 0x30, 0x66, 0x66, 0x22, 0x2c, 0x22, 0x23, 0x65, 0x65, 0x30, 0x30, 0x63, 0x63, 0x22, 0x2c,
+ 0x22, 0x23, 0x66, 0x66, 0x38, 0x30, 0x38, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x36, 0x36, 0x36, 0x36,
+ 0x30, 0x30, 0x22, 0x2c, 0x22, 0x23, 0x66, 0x66, 0x62, 0x66, 0x66, 0x66, 0x22, 0x2c, 0x22, 0x23,
+ 0x30, 0x30, 0x66, 0x66, 0x63, 0x63, 0x22, 0x2c, 0x22, 0x23, 0x63, 0x63, 0x36, 0x36, 0x39, 0x39,
+ 0x22, 0x2c, 0x22, 0x23, 0x39, 0x39, 0x39, 0x39, 0x30, 0x30, 0x22, 0x5d, 0x7d, 0x3b, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
+ 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75,
+ 0x72, 0x65, 0x73, 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x22, 0x29,
+ 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75, 0x72,
+ 0x65, 0x73, 0x2e, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72,
+ 0x76, 0x61, 0x6c, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x64, 0x64, 0x44, 0x61, 0x74, 0x61,
+ 0x3b, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3d, 0x74, 0x69,
+ 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x7c, 0x7c, 0x31, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x56, 0x61, 0x6c, 0x75,
+ 0x65, 0x3d, 0x32, 0x30, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61,
+ 0x73, 0x65, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x28, 0x6e,
+ 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65,
+ 0x28, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x64, 0x64,
+ 0x44, 0x61, 0x74, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61,
+ 0x74, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x56, 0x61,
+ 0x6c, 0x75, 0x65, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x28,
+ 0x29, 0x2a, 0x31, 0x30, 0x30, 0x2b, 0x31, 0x35, 0x2b, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x61, 0x6e,
+ 0x64, 0x6f, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6e, 0x64,
+ 0x65, 0x78, 0x3d, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x30, 0x5d, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74,
+ 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x3d, 0x31, 0x3b,
+ 0x64, 0x61, 0x74, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x56, 0x61, 0x72, 0x69, 0x61, 0x6e, 0x63, 0x65,
+ 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x28, 0x29, 0x2a, 0x32,
+ 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x76, 0x3d, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x56, 0x61,
+ 0x6c, 0x75, 0x65, 0x2f, 0x32, 0x35, 0x2b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2b, 0x2b,
+ 0x20, 0x2b, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x69, 0x6e, 0x64, 0x65,
+ 0x78, 0x2a, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2a, 0x31, 0x31, 0x2f, 0x39, 0x36, 0x30,
+ 0x29, 0x2b, 0x32, 0x29, 0x2a, 0x31, 0x35, 0x2b, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f,
+ 0x73, 0x28, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f, 0x37, 0x29, 0x2b, 0x32, 0x29, 0x2a, 0x37, 0x2b,
+ 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x6f, 0x73, 0x28, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2f,
+ 0x31, 0x37, 0x29, 0x2b, 0x32, 0x29, 0x2a, 0x31, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x78, 0x3a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2a, 0x74, 0x69,
+ 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x2b, 0x74, 0x69, 0x6d, 0x65, 0x42,
+ 0x61, 0x73, 0x65, 0x2c, 0x79, 0x3a, 0x76, 0x2b, 0x72, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x56, 0x61,
+ 0x72, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x7d, 0x29, 0x7d, 0x29, 0x3b, 0x6c, 0x61, 0x73, 0x74, 0x52,
+ 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x72, 0x61, 0x6e, 0x64, 0x6f,
+ 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x2e, 0x38, 0x35, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x2e,
+ 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x7d, 0x29, 0x3b, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61,
+ 0x73, 0x65, 0x2b, 0x3d, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,
+ 0x7d, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x46, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x29, 0x3b,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65,
+ 0x73, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x3d, 0x5b, 0x22, 0x4a, 0x61,
+ 0x6e, 0x22, 0x2c, 0x22, 0x46, 0x65, 0x62, 0x22, 0x2c, 0x22, 0x4d, 0x61, 0x72, 0x22, 0x2c, 0x22,
+ 0x41, 0x70, 0x72, 0x22, 0x2c, 0x22, 0x4d, 0x61, 0x79, 0x22, 0x2c, 0x22, 0x4a, 0x75, 0x6e, 0x22,
+ 0x2c, 0x22, 0x4a, 0x75, 0x6c, 0x22, 0x2c, 0x22, 0x41, 0x75, 0x67, 0x22, 0x2c, 0x22, 0x53, 0x65,
+ 0x70, 0x22, 0x2c, 0x22, 0x4f, 0x63, 0x74, 0x22, 0x2c, 0x22, 0x4e, 0x6f, 0x76, 0x22, 0x2c, 0x22,
+ 0x44, 0x65, 0x63, 0x22, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x6e, 0x69, 0x74, 0x73,
+ 0x3d, 0x5b, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x64, 0x65, 0x63, 0x61, 0x64, 0x65, 0x22,
+ 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2a, 0x33,
+ 0x36, 0x35, 0x2e, 0x32, 0x35, 0x2a, 0x31, 0x30, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74,
+ 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28, 0x64,
+ 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28,
+ 0x29, 0x2f, 0x31, 0x30, 0x2c, 0x31, 0x30, 0x29, 0x2a, 0x31, 0x30, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x79, 0x65, 0x61, 0x72, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e,
+ 0x64, 0x73, 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2a, 0x33, 0x36, 0x35, 0x2e, 0x32, 0x35, 0x2c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67,
+ 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x7d,
+ 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x22, 0x2c,
+ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2a, 0x33, 0x30,
+ 0x2e, 0x35, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x5b, 0x64, 0x2e, 0x67, 0x65,
+ 0x74, 0x55, 0x54, 0x43, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x5d, 0x7d, 0x7d, 0x2c, 0x7b,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f,
+ 0x6e, 0x64, 0x73, 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2a, 0x37, 0x2c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28, 0x64, 0x29, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,
+ 0x73, 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65,
+ 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x44, 0x61, 0x74,
+ 0x65, 0x28, 0x29, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x36, 0x20, 0x68,
+ 0x6f, 0x75, 0x72, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x33, 0x36, 0x30,
+ 0x30, 0x2a, 0x36, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65,
+ 0x28, 0x64, 0x29, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x68, 0x6f, 0x75,
+ 0x72, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x33, 0x36, 0x30, 0x30, 0x2c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x65, 0x6c,
+ 0x66, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x64, 0x29, 0x7d,
+ 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x31, 0x35, 0x20, 0x6d, 0x69, 0x6e, 0x75,
+ 0x74, 0x65, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x36, 0x30, 0x2a, 0x31,
+ 0x35, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73,
+ 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x64,
+ 0x29, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x75, 0x74,
+ 0x65, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x36, 0x30, 0x2c, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74,
+ 0x55, 0x54, 0x43, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x28, 0x29, 0x7d, 0x7d, 0x2c, 0x7b,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x31, 0x35, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22,
+ 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x31, 0x35, 0x2c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54,
+ 0x43, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x2b, 0x22, 0x73, 0x22, 0x7d, 0x7d,
+ 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x2c,
+ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x31, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x53,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x2b, 0x22, 0x73, 0x22, 0x7d, 0x7d, 0x2c, 0x7b,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x64, 0x65, 0x63, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,
+ 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x31, 0x2f, 0x31, 0x30, 0x2c, 0x66,
+ 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65,
+ 0x74, 0x55, 0x54, 0x43, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,
+ 0x28, 0x29, 0x2b, 0x22, 0x6d, 0x73, 0x22, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a,
+ 0x22, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x2c, 0x73, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x31, 0x2f, 0x31, 0x30, 0x30, 0x2c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54,
+ 0x43, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x2b,
+ 0x22, 0x6d, 0x73, 0x22, 0x7d, 0x7d, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x6e, 0x69,
+ 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x75, 0x6e, 0x69, 0x74, 0x4e,
+ 0x61, 0x6d, 0x65, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x75, 0x6e, 0x69, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x3d, 0x75, 0x6e,
+ 0x69, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x29, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28,
+ 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x44, 0x61,
+ 0x74, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x33, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x28, 0x22, 0x25, 0x62, 0x20, 0x25, 0x65, 0x22, 0x29, 0x28, 0x64, 0x29,
+ 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x6d,
+ 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x74, 0x6f, 0x55, 0x54, 0x43, 0x53, 0x74, 0x72, 0x69,
+ 0x6e, 0x67, 0x28, 0x29, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x2f, 0x28, 0x5c, 0x64, 0x2b,
+ 0x3a, 0x5c, 0x64, 0x2b, 0x29, 0x3a, 0x2f, 0x29, 0x5b, 0x31, 0x5d, 0x7d, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x74, 0x69, 0x6d, 0x65, 0x2c, 0x75, 0x6e, 0x69, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64,
+ 0x61, 0x74, 0x65, 0x2c, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x2c, 0x79, 0x65, 0x61, 0x72, 0x3b, 0x69,
+ 0x66, 0x28, 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x3d, 0x22, 0x6d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x22, 0x29, 0x7b, 0x64, 0x61, 0x74, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44,
+ 0x61, 0x74, 0x65, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x31, 0x65, 0x33, 0x29, 0x3b, 0x66, 0x6c,
+ 0x6f, 0x6f, 0x72, 0x3d, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x55, 0x54, 0x43, 0x28, 0x64, 0x61, 0x74,
+ 0x65, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72,
+ 0x28, 0x29, 0x2c, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x6f,
+ 0x6e, 0x74, 0x68, 0x28, 0x29, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x3b, 0x69, 0x66, 0x28, 0x66, 0x6c,
+ 0x6f, 0x6f, 0x72, 0x3d, 0x3d, 0x74, 0x69, 0x6d, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x74, 0x69, 0x6d, 0x65, 0x3b, 0x79, 0x65, 0x61, 0x72, 0x3d, 0x64, 0x61, 0x74, 0x65, 0x2e,
+ 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x3d, 0x64, 0x61, 0x74, 0x65, 0x2e,
+ 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x3b, 0x69, 0x66,
+ 0x28, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x3d, 0x3d, 0x31, 0x31, 0x29, 0x7b, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x3d, 0x30, 0x3b, 0x79, 0x65, 0x61, 0x72, 0x3d, 0x79, 0x65, 0x61, 0x72, 0x2b, 0x31, 0x7d,
+ 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x2b, 0x3d, 0x31, 0x7d, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x55, 0x54, 0x43, 0x28, 0x79, 0x65,
+ 0x61, 0x72, 0x2c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x7d, 0x69, 0x66,
+ 0x28, 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x3d, 0x22, 0x79, 0x65, 0x61,
+ 0x72, 0x22, 0x29, 0x7b, 0x64, 0x61, 0x74, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74,
+ 0x65, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x31, 0x65, 0x33, 0x29, 0x3b, 0x66, 0x6c, 0x6f, 0x6f,
+ 0x72, 0x3d, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x55, 0x54, 0x43, 0x28, 0x64, 0x61, 0x74, 0x65, 0x2e,
+ 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29,
+ 0x2c, 0x30, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x3b, 0x69, 0x66, 0x28, 0x66, 0x6c, 0x6f, 0x6f, 0x72,
+ 0x3d, 0x3d, 0x74, 0x69, 0x6d, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x69,
+ 0x6d, 0x65, 0x3b, 0x79, 0x65, 0x61, 0x72, 0x3d, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x67, 0x65, 0x74,
+ 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2b, 0x31, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x44, 0x61, 0x74, 0x65, 0x2e, 0x55, 0x54, 0x43, 0x28,
+ 0x79, 0x65, 0x61, 0x72, 0x2c, 0x30, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x7d, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65, 0x69, 0x6c, 0x28, 0x74, 0x69, 0x6d,
+ 0x65, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x2a,
+ 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x7d, 0x7d, 0x3b, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
+ 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74,
+ 0x75, 0x72, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x22,
+ 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75,
+ 0x72, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65,
+ 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x6f, 0x6e,
+ 0x74, 0x68, 0x73, 0x3d, 0x5b, 0x22, 0x4a, 0x61, 0x6e, 0x22, 0x2c, 0x22, 0x46, 0x65, 0x62, 0x22,
+ 0x2c, 0x22, 0x4d, 0x61, 0x72, 0x22, 0x2c, 0x22, 0x41, 0x70, 0x72, 0x22, 0x2c, 0x22, 0x4d, 0x61,
+ 0x79, 0x22, 0x2c, 0x22, 0x4a, 0x75, 0x6e, 0x22, 0x2c, 0x22, 0x4a, 0x75, 0x6c, 0x22, 0x2c, 0x22,
+ 0x41, 0x75, 0x67, 0x22, 0x2c, 0x22, 0x53, 0x65, 0x70, 0x22, 0x2c, 0x22, 0x4f, 0x63, 0x74, 0x22,
+ 0x2c, 0x22, 0x4e, 0x6f, 0x76, 0x22, 0x2c, 0x22, 0x44, 0x65, 0x63, 0x22, 0x5d, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x3d, 0x5b, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a,
+ 0x22, 0x64, 0x65, 0x63, 0x61, 0x64, 0x65, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,
+ 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2a, 0x33, 0x36, 0x35, 0x2e, 0x32, 0x35, 0x2a, 0x31, 0x30,
+ 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x70, 0x61,
+ 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c,
+ 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2f, 0x31, 0x30, 0x2c, 0x31, 0x30, 0x29, 0x2a, 0x31, 0x30,
+ 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x79, 0x65, 0x61, 0x72, 0x22, 0x2c,
+ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2a, 0x33, 0x36,
+ 0x35, 0x2e, 0x32, 0x35, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28,
+ 0x29, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x6d, 0x6f, 0x6e, 0x74, 0x68,
+ 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2a,
+ 0x33, 0x30, 0x2e, 0x35, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x73, 0x5b, 0x64, 0x2e,
+ 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x5d, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x77, 0x65, 0x65, 0x6b, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e,
+ 0x64, 0x73, 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2a, 0x37, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61,
+ 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x6f, 0x72,
+ 0x6d, 0x61, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28, 0x64, 0x29, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3a, 0x22, 0x64, 0x61, 0x79, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,
+ 0x3a, 0x38, 0x36, 0x34, 0x30, 0x30, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d,
+ 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x36, 0x20, 0x68, 0x6f, 0x75, 0x72, 0x22,
+ 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x33, 0x36, 0x30, 0x30, 0x2a, 0x36, 0x2c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x65, 0x6c,
+ 0x66, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x64, 0x29, 0x7d,
+ 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x68, 0x6f, 0x75, 0x72, 0x22, 0x2c, 0x73,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x33, 0x36, 0x30, 0x30, 0x2c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x64, 0x29, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e,
+ 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x31, 0x35, 0x20, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x22, 0x2c,
+ 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x36, 0x30, 0x2a, 0x31, 0x35, 0x2c, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x64, 0x29, 0x7d, 0x7d, 0x2c,
+ 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x6d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x22, 0x2c, 0x73,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x36, 0x30, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74,
+ 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x75,
+ 0x74, 0x65, 0x73, 0x28, 0x29, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x31,
+ 0x35, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,
+ 0x73, 0x3a, 0x31, 0x35, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29,
+ 0x2b, 0x22, 0x73, 0x22, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x73, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x31, 0x2c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67,
+ 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x2b, 0x22, 0x73, 0x22, 0x7d,
+ 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x64, 0x65, 0x63, 0x69, 0x73, 0x65, 0x63,
+ 0x6f, 0x6e, 0x64, 0x22, 0x2c, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x31, 0x2f, 0x31,
+ 0x30, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64,
+ 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,
+ 0x28, 0x29, 0x2b, 0x22, 0x6d, 0x73, 0x22, 0x7d, 0x7d, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a,
+ 0x22, 0x63, 0x65, 0x6e, 0x74, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x2c, 0x73, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3a, 0x31, 0x2f, 0x31, 0x30, 0x30, 0x2c, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x74, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x69,
+ 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x29, 0x2b, 0x22, 0x6d, 0x73,
+ 0x22, 0x7d, 0x7d, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x6e, 0x69, 0x74, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x75, 0x6e, 0x69, 0x74, 0x4e, 0x61, 0x6d, 0x65,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x6e,
+ 0x69, 0x74, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x75, 0x6e, 0x69, 0x74, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x75, 0x6e, 0x69, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x3d, 0x75, 0x6e, 0x69, 0x74, 0x2e,
+ 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x29, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x7d, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x44, 0x61, 0x74, 0x65, 0x3d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x64, 0x33, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61,
+ 0x74, 0x28, 0x22, 0x25, 0x62, 0x20, 0x25, 0x65, 0x22, 0x29, 0x28, 0x64, 0x29, 0x7d, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x64, 0x2e, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x2e, 0x6d,
+ 0x61, 0x74, 0x63, 0x68, 0x28, 0x2f, 0x28, 0x5c, 0x64, 0x2b, 0x3a, 0x5c, 0x64, 0x2b, 0x29, 0x3a,
+ 0x2f, 0x29, 0x5b, 0x31, 0x5d, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x65, 0x69, 0x6c,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x2c, 0x75,
+ 0x6e, 0x69, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x65, 0x2c, 0x66, 0x6c,
+ 0x6f, 0x6f, 0x72, 0x2c, 0x79, 0x65, 0x61, 0x72, 0x3b, 0x69, 0x66, 0x28, 0x75, 0x6e, 0x69, 0x74,
+ 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x3d, 0x22, 0x64, 0x61, 0x79, 0x22, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x6e, 0x65, 0x61, 0x72, 0x46, 0x75, 0x74, 0x75, 0x72, 0x65, 0x3d, 0x6e, 0x65, 0x77,
+ 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x2b, 0x75, 0x6e, 0x69, 0x74,
+ 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2d, 0x31, 0x29, 0x2a, 0x31, 0x65, 0x33, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x3d, 0x6e, 0x65, 0x77,
+ 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x30, 0x29, 0x3b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64,
+ 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73,
+ 0x28, 0x30, 0x29, 0x3b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x2e, 0x73, 0x65, 0x74, 0x53,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x28, 0x30, 0x29, 0x3b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65,
+ 0x64, 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x75, 0x74, 0x65, 0x73, 0x28, 0x30, 0x29, 0x3b,
+ 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x2e, 0x73, 0x65, 0x74, 0x48, 0x6f, 0x75, 0x72, 0x73,
+ 0x28, 0x30, 0x29, 0x3b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x2e, 0x73, 0x65, 0x74, 0x44,
+ 0x61, 0x74, 0x65, 0x28, 0x6e, 0x65, 0x61, 0x72, 0x46, 0x75, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x67,
+ 0x65, 0x74, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x29, 0x3b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65,
+ 0x64, 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x6e, 0x65, 0x61, 0x72, 0x46,
+ 0x75, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29,
+ 0x29, 0x3b, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x2e, 0x73, 0x65, 0x74, 0x46, 0x75, 0x6c,
+ 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x6e, 0x65, 0x61, 0x72, 0x46, 0x75, 0x74, 0x75, 0x72, 0x65,
+ 0x2e, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x65, 0x64, 0x2e, 0x67,
+ 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x7d, 0x69, 0x66, 0x28,
+ 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x3d, 0x22, 0x6d, 0x6f, 0x6e, 0x74,
+ 0x68, 0x22, 0x29, 0x7b, 0x64, 0x61, 0x74, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74,
+ 0x65, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x31, 0x65, 0x33, 0x29, 0x3b, 0x66, 0x6c, 0x6f, 0x6f,
+ 0x72, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x64, 0x61, 0x74, 0x65, 0x2e,
+ 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x64, 0x61,
+ 0x74, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x29, 0x2e, 0x67,
+ 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x3b, 0x69, 0x66, 0x28,
+ 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x3d, 0x3d, 0x74, 0x69, 0x6d, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x3b, 0x79, 0x65, 0x61, 0x72, 0x3d, 0x64, 0x61, 0x74,
+ 0x65, 0x2e, 0x67, 0x65, 0x74, 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x3d, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x67,
+ 0x65, 0x74, 0x4d, 0x6f, 0x6e, 0x74, 0x68, 0x28, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x6d, 0x6f, 0x6e,
+ 0x74, 0x68, 0x3d, 0x3d, 0x31, 0x31, 0x29, 0x7b, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x3d, 0x30, 0x3b,
+ 0x79, 0x65, 0x61, 0x72, 0x3d, 0x79, 0x65, 0x61, 0x72, 0x2b, 0x31, 0x7d, 0x65, 0x6c, 0x73, 0x65,
+ 0x7b, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x2b, 0x3d, 0x31, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x79, 0x65, 0x61, 0x72, 0x2c, 0x6d,
+ 0x6f, 0x6e, 0x74, 0x68, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x2f,
+ 0x31, 0x65, 0x33, 0x7d, 0x69, 0x66, 0x28, 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x3d, 0x22, 0x79, 0x65, 0x61, 0x72, 0x22, 0x29, 0x7b, 0x64, 0x61, 0x74, 0x65, 0x3d, 0x6e,
+ 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x31, 0x65, 0x33,
+ 0x29, 0x3b, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65,
+ 0x28, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x55, 0x54, 0x43, 0x46, 0x75, 0x6c, 0x6c,
+ 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2c, 0x30, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d,
+ 0x65, 0x28, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x3b, 0x69, 0x66, 0x28, 0x66, 0x6c, 0x6f, 0x6f, 0x72,
+ 0x3d, 0x3d, 0x74, 0x69, 0x6d, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x69,
+ 0x6d, 0x65, 0x3b, 0x79, 0x65, 0x61, 0x72, 0x3d, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x67, 0x65, 0x74,
+ 0x46, 0x75, 0x6c, 0x6c, 0x59, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2b, 0x31, 0x3b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x79, 0x65, 0x61,
+ 0x72, 0x2c, 0x30, 0x29, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x2f, 0x31,
+ 0x65, 0x33, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63,
+ 0x65, 0x69, 0x6c, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x73, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x2a, 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x73, 0x65, 0x63, 0x6f,
+ 0x6e, 0x64, 0x73, 0x7d, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e,
+ 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x4e, 0x75, 0x6d, 0x62,
+ 0x65, 0x72, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69,
+ 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x4b, 0x4d, 0x42, 0x54, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x79, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x62, 0x73, 0x5f, 0x79, 0x3d, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x79, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x61, 0x62,
+ 0x73, 0x5f, 0x79, 0x3e, 0x3d, 0x31, 0x65, 0x31, 0x32, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x79, 0x2f, 0x31, 0x65, 0x31, 0x32, 0x2b, 0x22, 0x54, 0x22, 0x7d, 0x65, 0x6c, 0x73,
+ 0x65, 0x20, 0x69, 0x66, 0x28, 0x61, 0x62, 0x73, 0x5f, 0x79, 0x3e, 0x3d, 0x31, 0x65, 0x39, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x2f, 0x31, 0x65, 0x39, 0x2b, 0x22, 0x42,
+ 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x61, 0x62, 0x73, 0x5f, 0x79, 0x3e,
+ 0x3d, 0x31, 0x65, 0x36, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x2f, 0x31,
+ 0x65, 0x36, 0x2b, 0x22, 0x4d, 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x61,
+ 0x62, 0x73, 0x5f, 0x79, 0x3e, 0x3d, 0x31, 0x65, 0x33, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x79, 0x2f, 0x31, 0x65, 0x33, 0x2b, 0x22, 0x4b, 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65,
+ 0x20, 0x69, 0x66, 0x28, 0x61, 0x62, 0x73, 0x5f, 0x79, 0x3c, 0x31, 0x26, 0x26, 0x79, 0x3e, 0x30,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78,
+ 0x65, 0x64, 0x28, 0x32, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x61, 0x62,
+ 0x73, 0x5f, 0x79, 0x3d, 0x3d, 0x3d, 0x30, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22,
+ 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x7d,
+ 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75,
+ 0x72, 0x65, 0x73, 0x2e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61,
+ 0x74, 0x42, 0x61, 0x73, 0x65, 0x31, 0x30, 0x32, 0x34, 0x4b, 0x4d, 0x47, 0x54, 0x50, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x79, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61,
+ 0x62, 0x73, 0x5f, 0x79, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x79, 0x29,
+ 0x3b, 0x69, 0x66, 0x28, 0x61, 0x62, 0x73, 0x5f, 0x79, 0x3e, 0x3d, 0x30, 0x78, 0x34, 0x30, 0x30,
+ 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x79, 0x2f, 0x30, 0x78, 0x34, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30,
+ 0x30, 0x30, 0x30, 0x30, 0x2b, 0x22, 0x50, 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66,
+ 0x28, 0x61, 0x62, 0x73, 0x5f, 0x79, 0x3e, 0x3d, 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36,
+ 0x32, 0x37, 0x37, 0x37, 0x36, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x2f,
+ 0x31, 0x30, 0x39, 0x39, 0x35, 0x31, 0x31, 0x36, 0x32, 0x37, 0x37, 0x37, 0x36, 0x2b, 0x22, 0x54,
+ 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x61, 0x62, 0x73, 0x5f, 0x79, 0x3e,
+ 0x3d, 0x31, 0x30, 0x37, 0x33, 0x37, 0x34, 0x31, 0x38, 0x32, 0x34, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x79, 0x2f, 0x31, 0x30, 0x37, 0x33, 0x37, 0x34, 0x31, 0x38, 0x32, 0x34,
+ 0x2b, 0x22, 0x47, 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x61, 0x62, 0x73,
+ 0x5f, 0x79, 0x3e, 0x3d, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x79, 0x2f, 0x31, 0x30, 0x34, 0x38, 0x35, 0x37, 0x36, 0x2b, 0x22, 0x4d,
+ 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x61, 0x62, 0x73, 0x5f, 0x79, 0x3e,
+ 0x3d, 0x31, 0x30, 0x32, 0x34, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x2f,
+ 0x31, 0x30, 0x32, 0x34, 0x2b, 0x22, 0x4b, 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66,
+ 0x28, 0x61, 0x62, 0x73, 0x5f, 0x79, 0x3c, 0x31, 0x26, 0x26, 0x79, 0x3e, 0x30, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78, 0x65, 0x64, 0x28,
+ 0x32, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x61, 0x62, 0x73, 0x5f, 0x79,
+ 0x3d, 0x3d, 0x3d, 0x30, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x22, 0x7d, 0x65,
+ 0x6c, 0x73, 0x65, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x7d, 0x7d, 0x3b, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
+ 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x2e, 0x50, 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x50, 0x61, 0x6c, 0x65, 0x74,
+ 0x74, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x6e, 0x65, 0x77, 0x20,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65,
+ 0x73, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d,
+ 0x65, 0x73, 0x3d, 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d,
+ 0x65, 0x3d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x5b,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5d, 0x7c, 0x7c, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x7c, 0x7c, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
+ 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x77, 0x68,
+ 0x65, 0x65, 0x6c, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67,
+ 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x30, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x30, 0x3b, 0x69, 0x66,
+ 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74,
+ 0x65, 0x64, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d,
+ 0x31, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x2c, 0x6a, 0x2c, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65,
+ 0x3d, 0x5b, 0x5d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x69, 0x3d, 0x30, 0x3b, 0x69, 0x3c, 0x73, 0x63,
+ 0x68, 0x65, 0x6d, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x3b, 0x69, 0x2b, 0x2b, 0x29, 0x7b, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5b, 0x69, 0x5d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x3d, 0x64, 0x33, 0x2e, 0x69, 0x6e, 0x74, 0x65,
+ 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x73, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5b, 0x69, 0x5d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5b, 0x69, 0x2b, 0x31, 0x5d, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28,
+ 0x6a, 0x3d, 0x31, 0x3b, 0x6a, 0x3c, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72,
+ 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53, 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74,
+ 0x3b, 0x6a, 0x2b, 0x2b, 0x29, 0x7b, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x28, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x28, 0x31, 0x2f, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x53,
+ 0x74, 0x6f, 0x70, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x6a, 0x29, 0x29, 0x7d, 0x7d, 0x73, 0x63,
+ 0x68, 0x65, 0x6d, 0x65, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d,
+ 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x5d, 0x29, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x3d, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x7d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2e, 0x6c, 0x65, 0x6e,
+ 0x67, 0x74, 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6b, 0x65, 0x79, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5b,
+ 0x6b, 0x65, 0x79, 0x5d, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d,
+ 0x65, 0x5b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x49, 0x6e,
+ 0x64, 0x65, 0x78, 0x2b, 0x2b, 0x5d, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x29, 0x7c,
+ 0x7c, 0x22, 0x23, 0x38, 0x30, 0x38, 0x30, 0x38, 0x30, 0x22, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x21, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x69, 0x66, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e,
+ 0x64, 0x65, 0x78, 0x3d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65,
+ 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x32, 0x2d, 0x31, 0x29, 0x7b, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
+ 0x3d, 0x64, 0x33, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x48,
+ 0x73, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64,
+ 0x65, 0x78, 0x5d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5b,
+ 0x30, 0x5d, 0x29, 0x28, 0x2e, 0x35, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x30, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x2a, 0x3d,
+ 0x32, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x64, 0x33, 0x2e,
+ 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x48, 0x73, 0x6c, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x5d, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x5b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2b,
+ 0x31, 0x5d, 0x29, 0x28, 0x2e, 0x35, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2b, 0x2b, 0x7d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x65, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63,
+ 0x6f, 0x6c, 0x6f, 0x72, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x6f, 0x6c,
+ 0x6f, 0x72, 0x7d, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x6a, 0x61, 0x78, 0x22, 0x29, 0x3b, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x6a,
+ 0x61, 0x78, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73,
+ 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x7b, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61,
+ 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72,
+ 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x55, 0x52, 0x4c,
+ 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x55, 0x52, 0x4c, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6f,
+ 0x6e, 0x44, 0x61, 0x74, 0x61, 0x7c, 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x7d, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x2e, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x7c, 0x7c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6f, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6f, 0x6e, 0x45,
+ 0x72, 0x72, 0x6f, 0x72, 0x7c, 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x28, 0x29,
+ 0x7d, 0x2c, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x61, 0x6a, 0x61, 0x78,
+ 0x28, 0x7b, 0x75, 0x72, 0x6c, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x55,
+ 0x52, 0x4c, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x22, 0x6a, 0x73, 0x6f,
+ 0x6e, 0x22, 0x2c, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x29, 0x2c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x72,
+ 0x72, 0x6f, 0x72, 0x2e, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x29,
+ 0x7d, 0x2c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x67, 0x28, 0x22,
+ 0x65, 0x72, 0x72, 0x6f, 0x72, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x64, 0x61,
+ 0x74, 0x61, 0x55, 0x52, 0x4c, 0x3a, 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x55, 0x52, 0x4c, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x45, 0x72,
+ 0x72, 0x6f, 0x72, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c, 0x73, 0x75, 0x63, 0x63, 0x65,
+ 0x73, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61,
+ 0x2c, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x29, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x7b, 0x64,
+ 0x61, 0x74, 0x61, 0x3a, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x7d, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x7c, 0x7c, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x61, 0x72, 0x67, 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x7d, 0x2c, 0x5f, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61,
+ 0x74, 0x61, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3b,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x3d, 0x73, 0x2e, 0x6b, 0x65, 0x79, 0x7c, 0x7c,
+ 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x4b, 0x65, 0x79, 0x29, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x20, 0x61, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x6f, 0x72,
+ 0x20, 0x61, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3b, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x66, 0x6f,
+ 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x3d, 0x64, 0x2e,
+ 0x6b, 0x65, 0x79, 0x7c, 0x7c, 0x64, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x21,
+ 0x64, 0x61, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x29, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x64, 0x61,
+ 0x74, 0x61, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x20, 0x61, 0x20, 0x6b, 0x65, 0x79, 0x20, 0x6f,
+ 0x72, 0x20, 0x61, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x4b, 0x65, 0x79, 0x3d, 0x3d, 0x64, 0x61, 0x74, 0x61, 0x4b, 0x65, 0x79, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x3d,
+ 0x5b, 0x22, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x22, 0x2c, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2c,
+ 0x22, 0x64, 0x61, 0x74, 0x61, 0x22, 0x5d, 0x3b, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69,
+ 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x70, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x64, 0x5b, 0x70, 0x5d, 0x29, 0x73,
+ 0x5b, 0x70, 0x5d, 0x3d, 0x64, 0x5b, 0x70, 0x5d, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x7d, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x7d, 0x7d, 0x29,
+ 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
+ 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x22, 0x29, 0x3b, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x6e,
+ 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x73, 0x3d, 0x7b, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x3a, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x3d, 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x72, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x61, 0x64, 0x64, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x69,
+ 0x6d, 0x65, 0x2c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2c, 0x65, 0x6e, 0x64, 0x5f, 0x74,
+ 0x69, 0x6d, 0x65, 0x29, 0x7b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x74,
+ 0x69, 0x6d, 0x65, 0x5d, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x74,
+ 0x69, 0x6d, 0x65, 0x5d, 0x7c, 0x7c, 0x7b, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x3a, 0x5b, 0x5d, 0x7d,
+ 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x74, 0x69, 0x6d, 0x65, 0x5d,
+ 0x2e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x63, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x3a, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2c, 0x65, 0x6e, 0x64,
+ 0x3a, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x7d, 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6b, 0x65, 0x79,
+ 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x29, 0x2e, 0x66, 0x6f, 0x72,
+ 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x69,
+ 0x6d, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x74, 0x69, 0x6d,
+ 0x65, 0x5d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x73, 0x65, 0x6c, 0x66,
+ 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x29, 0x3b, 0x69,
+ 0x66, 0x28, 0x6c, 0x65, 0x66, 0x74, 0x3c, 0x30, 0x7c, 0x7c, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x73,
+ 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x2e, 0x72, 0x61, 0x6e, 0x67,
+ 0x65, 0x28, 0x29, 0x5b, 0x31, 0x5d, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x7b, 0x61,
+ 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x6f, 0x66,
+ 0x66, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x22, 0x29, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x74, 0x79,
+ 0x6c, 0x65, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65,
+ 0x22, 0x7d, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x62, 0x6f, 0x78,
+ 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x6f, 0x78, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x62, 0x6f, 0x78, 0x2e,
+ 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x62, 0x6f, 0x78,
+ 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x6f, 0x66, 0x66,
+ 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x22, 0x29, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x7d, 0x69, 0x66, 0x28, 0x21, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28,
+ 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x61, 0x6e,
+ 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e,
+ 0x65, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61,
+ 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28,
+ 0x22, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x65, 0x29, 0x7b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73,
+ 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x28, 0x22, 0x61, 0x63,
+ 0x74, 0x69, 0x76, 0x65, 0x22, 0x29, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74,
+ 0x2e, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x28, 0x22, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22,
+ 0x29, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x62, 0x6f, 0x78,
+ 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x62, 0x6f, 0x78, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x62, 0x6f, 0x78, 0x2e,
+ 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x62, 0x6f, 0x78,
+ 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x28, 0x22,
+ 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x66, 0x61, 0x6c, 0x73,
+ 0x65, 0x29, 0x7d, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 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 0x4c, 0x69, 0x73, 0x74,
+ 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x29, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e,
+ 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x62, 0x6f, 0x78, 0x2e, 0x65,
+ 0x6e, 0x64, 0x29, 0x7b, 0x62, 0x6f, 0x78, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76,
+ 0x22, 0x29, 0x3b, 0x62, 0x6f, 0x78, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64,
+ 0x64, 0x28, 0x22, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61,
+ 0x6e, 0x67, 0x65, 0x22, 0x29, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43,
+ 0x68, 0x69, 0x6c, 0x64, 0x28, 0x62, 0x6f, 0x78, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x7d, 0x7d, 0x69, 0x66, 0x28, 0x62, 0x6f, 0x78, 0x2e, 0x65,
+ 0x6e, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x3d, 0x6c, 0x65, 0x66,
+ 0x74, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6e, 0x64, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69,
+ 0x6e, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x62,
+ 0x6f, 0x78, 0x2e, 0x65, 0x6e, 0x64, 0x29, 0x2c, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x78, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x29, 0x5b, 0x31, 0x5d, 0x29,
+ 0x3b, 0x69, 0x66, 0x28, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61,
+ 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x3e, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6e, 0x64, 0x29, 0x7b, 0x61, 0x6e, 0x6e,
+ 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6e, 0x64, 0x3d,
+ 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d,
+ 0x61, 0x78, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28,
+ 0x62, 0x6f, 0x78, 0x2e, 0x65, 0x6e, 0x64, 0x29, 0x2c, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x78, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x29, 0x5b, 0x30, 0x5d,
+ 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x52, 0x61, 0x6e, 0x67, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x61, 0x6e, 0x6e, 0x6f, 0x74,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6e, 0x64, 0x2d, 0x61, 0x6e,
+ 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74, 0x61,
+ 0x72, 0x74, 0x3b, 0x62, 0x6f, 0x78, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x61,
+ 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x74,
+ 0x61, 0x72, 0x74, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x3b, 0x62, 0x6f, 0x78, 0x2e, 0x72, 0x61, 0x6e,
+ 0x67, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x52, 0x61, 0x6e, 0x67, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x3b,
+ 0x62, 0x6f, 0x78, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x28, 0x22, 0x6f, 0x66, 0x66, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x22, 0x29, 0x7d, 0x61,
+ 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28,
+ 0x22, 0x6f, 0x66, 0x66, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x22, 0x29, 0x3b, 0x61, 0x6e, 0x6e,
+ 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x74, 0x79,
+ 0x6c, 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x2b, 0x22, 0x70, 0x78,
+ 0x22, 0x7d, 0x29, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x73, 0x65, 0x6c, 0x66, 0x2e,
+ 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x29, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41,
+ 0x78, 0x69, 0x73, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x54,
+ 0x69, 0x6d, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67,
+ 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73,
+ 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63,
+ 0x6b, 0x73, 0x54, 0x72, 0x65, 0x61, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73,
+ 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x54, 0x72, 0x65, 0x61, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x7c,
+ 0x7c, 0x22, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x69,
+ 0x78, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73,
+ 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x69,
+ 0x6d, 0x65, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x46, 0x69, 0x78, 0x74,
+ 0x75, 0x72, 0x65, 0x7c, 0x7c, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72, 0x69, 0x61, 0x74, 0x65,
+ 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x6e, 0x69, 0x74, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x3d, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x75, 0x6e, 0x69, 0x74,
+ 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
+ 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x6f,
+ 0x6e, 0x64, 0x73, 0x3d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x31, 0x5d, 0x2d, 0x64, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x30, 0x5d, 0x3b, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x2e, 0x66, 0x6f,
+ 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x75,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28,
+ 0x72, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2f, 0x75, 0x2e, 0x73,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x3e, 0x3d, 0x32, 0x29, 0x7b, 0x75, 0x6e, 0x69, 0x74,
+ 0x3d, 0x75, 0x6e, 0x69, 0x74, 0x7c, 0x7c, 0x75, 0x7d, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x75, 0x6e, 0x69, 0x74, 0x7c, 0x7c, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x75, 0x6e,
+ 0x69, 0x74, 0x73, 0x5b, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x75, 0x6e, 0x69, 0x74, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x5d, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74,
+ 0x69, 0x63, 0x6b, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x2e, 0x64, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x75, 0x6e, 0x69, 0x74, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x69, 0x78, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e,
+ 0x69, 0x74, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x70, 0x72,
+ 0x69, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x55, 0x6e, 0x69, 0x74, 0x28, 0x29, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x63, 0x65,
+ 0x69, 0x6c, 0x28, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x31, 0x5d, 0x2d, 0x64, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x30, 0x5d, 0x29, 0x2f, 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x73, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x75, 0x6e, 0x6e, 0x69,
+ 0x6e, 0x67, 0x54, 0x69, 0x63, 0x6b, 0x3d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x30, 0x5d,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x3d, 0x5b, 0x5d, 0x3b,
+ 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x30, 0x3b, 0x69, 0x3c, 0x63, 0x6f,
+ 0x75, 0x6e, 0x74, 0x3b, 0x69, 0x2b, 0x2b, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x69, 0x63,
+ 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x63, 0x65, 0x69, 0x6c,
+ 0x28, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x63, 0x6b, 0x2c, 0x75, 0x6e, 0x69,
+ 0x74, 0x29, 0x3b, 0x72, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67, 0x54, 0x69, 0x63, 0x6b, 0x3d, 0x74,
+ 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2b, 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x73, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2f, 0x32, 0x3b, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x74, 0x69, 0x63, 0x6b,
+ 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2c, 0x75, 0x6e, 0x69, 0x74, 0x3a, 0x75, 0x6e, 0x69, 0x74, 0x7d,
+ 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73,
+ 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x65, 0x2e, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x43, 0x68,
+ 0x69, 0x6c, 0x64, 0x28, 0x65, 0x29, 0x7d, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6f, 0x66,
+ 0x66, 0x73, 0x65, 0x74, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x4f,
+ 0x66, 0x66, 0x73, 0x65, 0x74, 0x73, 0x28, 0x29, 0x3b, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x73,
+ 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6f, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x78, 0x28, 0x6f, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x3e, 0x73, 0x65,
+ 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65,
+ 0x28, 0x29, 0x5b, 0x31, 0x5d, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28,
+ 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x6f, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x2b,
+ 0x22, 0x70, 0x78, 0x22, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x78, 0x5f, 0x74, 0x69,
+ 0x63, 0x6b, 0x22, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e,
+ 0x74, 0x69, 0x63, 0x6b, 0x73, 0x54, 0x72, 0x65, 0x61, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x3b, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x2e, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x74, 0x69, 0x74,
+ 0x6c, 0x65, 0x22, 0x29, 0x3b, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72,
+ 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x6f, 0x2e, 0x75, 0x6e, 0x69, 0x74, 0x2e, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x74, 0x65, 0x72, 0x28, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x6f,
+ 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x31, 0x65, 0x33, 0x29, 0x29, 0x3b, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64,
+ 0x28, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x29, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e,
+ 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x3b,
+ 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x70, 0x75,
+ 0x73, 0x68, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x7d, 0x29, 0x7d, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x73, 0x65,
+ 0x6c, 0x66, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x29, 0x7d, 0x29, 0x7d, 0x3b, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
+ 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x58, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x58,
+ 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x62, 0x65, 0x72, 0x74, 0x68, 0x52, 0x61, 0x74, 0x65, 0x3d, 0x2e, 0x31, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7c, 0x7c, 0x22, 0x74, 0x6f, 0x70, 0x22, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x50, 0x65, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x3d,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x50, 0x65, 0x72, 0x54, 0x69,
+ 0x63, 0x6b, 0x7c, 0x7c, 0x37, 0x35, 0x3b, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74,
+ 0x69, 0x63, 0x6b, 0x73, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63,
+ 0x54, 0x69, 0x63, 0x6b, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73,
+ 0x3b, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x73, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x73, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69, 0x7a,
+ 0x65, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69, 0x7a, 0x65, 0x7c,
+ 0x7c, 0x34, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x54, 0x72, 0x65,
+ 0x61, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b,
+ 0x73, 0x54, 0x72, 0x65, 0x61, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x22, 0x70, 0x6c, 0x61,
+ 0x69, 0x6e, 0x22, 0x3b, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x53, 0x69, 0x7a,
+ 0x65, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x61,
+ 0x72, 0x67, 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x3d, 0x64, 0x33,
+ 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76,
+ 0x67, 0x3a, 0x73, 0x76, 0x67, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72,
+ 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x5f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x78, 0x5f, 0x61, 0x78, 0x69, 0x73, 0x5f,
+ 0x64, 0x33, 0x22, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x5b, 0x30, 0x5d,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x74,
+ 0x79, 0x6c, 0x65, 0x2e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x72, 0x65,
+ 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74,
+ 0x53, 0x69, 0x7a, 0x65, 0x28, 0x7b, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x61, 0x72, 0x67, 0x73,
+ 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x76, 0x69, 0x73, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x28, 0x29, 0x7d, 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65,
+ 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x72, 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x7c, 0x7c,
+ 0x7b, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x64, 0x69, 0x73, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x76, 0x69, 0x73, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x29, 0x2e,
+ 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2a, 0x28, 0x31, 0x2b, 0x62, 0x65, 0x72, 0x74, 0x68,
+ 0x52, 0x61, 0x74, 0x65, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x65, 0x72, 0x74, 0x68,
+ 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2a, 0x62, 0x65, 0x72, 0x74, 0x68, 0x52, 0x61, 0x74, 0x65,
+ 0x2f, 0x32, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x2d, 0x31, 0x2a, 0x62,
+ 0x65, 0x72, 0x74, 0x68, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65,
+ 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x21, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e,
+ 0x65, 0x64, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x21, 0x3d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65,
+ 0x74, 0x53, 0x69, 0x7a, 0x65, 0x28, 0x7b, 0x61, 0x75, 0x74, 0x6f, 0x3a, 0x74, 0x72, 0x75, 0x65,
+ 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x78, 0x69, 0x73, 0x3d, 0x64, 0x33, 0x2e, 0x73,
+ 0x76, 0x67, 0x2e, 0x61, 0x78, 0x69, 0x73, 0x28, 0x29, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x29, 0x2e, 0x6f, 0x72,
+ 0x69, 0x65, 0x6e, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x3b, 0x61, 0x78, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b,
+ 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b,
+ 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x7c, 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x78, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x78, 0x7d, 0x29, 0x3b, 0x69,
+ 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65,
+ 0x73, 0x29, 0x61, 0x78, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65,
+ 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65,
+ 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x3d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x54, 0x69, 0x63, 0x6b, 0x73, 0x7c, 0x7c,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2f, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x50, 0x65, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x29, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x62, 0x65, 0x72, 0x74, 0x68, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66,
+ 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2a,
+ 0x62, 0x65, 0x72, 0x74, 0x68, 0x52, 0x61, 0x74, 0x65, 0x2f, 0x32, 0x29, 0x7c, 0x7c, 0x30, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x3b, 0x69, 0x66,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x3d, 0x3d, 0x22, 0x74, 0x6f, 0x70, 0x22, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x79, 0x4f,
+ 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x68, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x3b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x3d, 0x22,
+ 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x22, 0x2b, 0x62, 0x65, 0x72, 0x74,
+ 0x68, 0x2b, 0x22, 0x2c, 0x22, 0x2b, 0x79, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x2b, 0x22, 0x29,
+ 0x22, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
+ 0x3d, 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x22, 0x2b, 0x62, 0x65,
+ 0x72, 0x74, 0x68, 0x2b, 0x22, 0x2c, 0x20, 0x30, 0x29, 0x22, 0x7d, 0x69, 0x66, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x76, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22,
+ 0x2a, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x7d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x76, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76,
+ 0x67, 0x3a, 0x67, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73,
+ 0x73, 0x22, 0x2c, 0x5b, 0x22, 0x78, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x5f, 0x64, 0x33, 0x22,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x54, 0x72, 0x65, 0x61, 0x74,
+ 0x6d, 0x65, 0x6e, 0x74, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x20, 0x22, 0x29, 0x29,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
+ 0x22, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x29, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x61, 0x78, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x29, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x75, 0x62,
+ 0x64, 0x69, 0x76, 0x69, 0x64, 0x65, 0x28, 0x30, 0x29, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69,
+ 0x7a, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69, 0x7a, 0x65,
+ 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x69, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x3d,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x3d, 0x3d, 0x22, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x22, 0x3f, 0x31, 0x3a, 0x2d, 0x31,
+ 0x29, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x68, 0x65, 0x69,
+ 0x67, 0x68, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x76,
+ 0x69, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76, 0x67, 0x3a, 0x67,
+ 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c,
+ 0x22, 0x78, 0x5f, 0x67, 0x72, 0x69, 0x64, 0x5f, 0x64, 0x33, 0x22, 0x29, 0x2e, 0x63, 0x61, 0x6c,
+ 0x6c, 0x28, 0x61, 0x78, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x29, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x75, 0x62,
+ 0x64, 0x69, 0x76, 0x69, 0x64, 0x65, 0x28, 0x30, 0x29, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69,
+ 0x7a, 0x65, 0x28, 0x67, 0x72, 0x69, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x29, 0x29, 0x2e, 0x73, 0x65,
+ 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x74, 0x65, 0x78, 0x74, 0x22, 0x29, 0x2e,
+ 0x65, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e,
+ 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x64, 0x61,
+ 0x74, 0x61, 0x2d, 0x78, 0x2d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x29, 0x7d, 0x29, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x48, 0x65, 0x69, 0x67,
+ 0x68, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x68, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x69, 0x73, 0x63,
+ 0x6f, 0x76, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b,
+ 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77,
+ 0x21, 0x3d, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77,
+ 0x2e, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x53, 0x74, 0x79, 0x6c,
+ 0x65, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x3d, 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28, 0x73, 0x74, 0x79, 0x6c, 0x65,
+ 0x2e, 0x67, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75,
+ 0x65, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x29, 0x2c, 0x31, 0x30, 0x29, 0x3b,
+ 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d,
+ 0x70, 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x67,
+ 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x28,
+ 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x29, 0x2c, 0x31, 0x30, 0x29, 0x7d, 0x7d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x7c, 0x7c, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x57, 0x69, 0x64,
+ 0x74, 0x68, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x29, 0x2a, 0x28, 0x31, 0x2b, 0x62, 0x65, 0x72, 0x74, 0x68, 0x52, 0x61,
+ 0x74, 0x65, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7c, 0x7c, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7c, 0x7c, 0x34, 0x30, 0x7d, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28,
+ 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x59,
+ 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x59, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x7b,
+ 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x7c, 0x7c, 0x22, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x50, 0x65, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x3d, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x50, 0x65, 0x72, 0x54, 0x69, 0x63, 0x6b,
+ 0x7c, 0x7c, 0x37, 0x35, 0x3b, 0x69, 0x66, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63,
+ 0x6b, 0x73, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x54, 0x69,
+ 0x63, 0x6b, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x3b, 0x69,
+ 0x66, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65,
+ 0x73, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65,
+ 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c, 0x75, 0x65,
+ 0x73, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69, 0x7a, 0x65, 0x3d,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69, 0x7a, 0x65, 0x7c, 0x7c, 0x34,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x54, 0x72, 0x65, 0x61, 0x74,
+ 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x54,
+ 0x72, 0x65, 0x61, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x7c, 0x7c, 0x22, 0x70, 0x6c, 0x61, 0x69, 0x6e,
+ 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61,
+ 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61,
+ 0x74, 0x7c, 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x79, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x79, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x65,
+ 0x72, 0x74, 0x68, 0x52, 0x61, 0x74, 0x65, 0x3d, 0x2e, 0x31, 0x3b, 0x69, 0x66, 0x28, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x3d, 0x64,
+ 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73,
+ 0x76, 0x67, 0x3a, 0x73, 0x76, 0x67, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x79, 0x5f, 0x61, 0x78, 0x69, 0x73, 0x22, 0x29, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x76, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x5b, 0x30, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x70, 0x6f,
+ 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x22, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65,
+ 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x28, 0x7b,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x2c, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x68, 0x65, 0x69,
+ 0x67, 0x68, 0x74, 0x7d, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x76, 0x69, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x76,
+ 0x69, 0x73, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6f, 0x6e, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x29, 0x7d, 0x29, 0x7d,
+ 0x2c, 0x73, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x69, 0x66,
+ 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x21, 0x3d,
+ 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x3d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67,
+ 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x70,
+ 0x61, 0x72, 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x67, 0x65,
+ 0x74, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x22,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x29, 0x2c, 0x31, 0x30, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x21,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x61, 0x75, 0x74, 0x6f, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x70, 0x61, 0x72,
+ 0x73, 0x65, 0x49, 0x6e, 0x74, 0x28, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x50,
+ 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x22, 0x68, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x22, 0x29, 0x2c, 0x31, 0x30, 0x29, 0x7d, 0x7d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74,
+ 0x68, 0x7c, 0x7c, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, 0x7c,
+ 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x64, 0x74,
+ 0x68, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x65, 0x72, 0x74, 0x68, 0x52, 0x61, 0x74, 0x65,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7c, 0x7c, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x76, 0x69, 0x73, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x29, 0x2e, 0x61, 0x74, 0x74,
+ 0x72, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2a, 0x28, 0x31, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62,
+ 0x65, 0x72, 0x74, 0x68, 0x52, 0x61, 0x74, 0x65, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62,
+ 0x65, 0x72, 0x74, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x65, 0x72, 0x74, 0x68, 0x52, 0x61, 0x74, 0x65, 0x3b,
+ 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x3d, 0x3d, 0x22, 0x6c, 0x65, 0x66, 0x74, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e,
+ 0x74, 0x6f, 0x70, 0x3d, 0x2d, 0x31, 0x2a, 0x62, 0x65, 0x72, 0x74, 0x68, 0x2b, 0x22, 0x70, 0x78,
+ 0x22, 0x7d, 0x7d, 0x2c, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x21, 0x3d, 0x3d, 0x75, 0x6e,
+ 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x21, 0x3d, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x29,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x28, 0x7b, 0x61, 0x75,
+ 0x74, 0x6f, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74,
+ 0x69, 0x63, 0x6b, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63,
+ 0x54, 0x69, 0x63, 0x6b, 0x73, 0x7c, 0x7c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f,
+ 0x72, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x68, 0x65, 0x69,
+ 0x67, 0x68, 0x74, 0x2f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x50,
+ 0x65, 0x72, 0x54, 0x69, 0x63, 0x6b, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x78, 0x69, 0x73,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x72, 0x61, 0x77, 0x41, 0x78, 0x69, 0x73, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79, 0x29, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x64, 0x72, 0x61, 0x77, 0x47, 0x72, 0x69, 0x64, 0x28, 0x61, 0x78, 0x69,
+ 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x48,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x2c, 0x5f, 0x64, 0x72, 0x61, 0x77, 0x41, 0x78,
+ 0x69, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x63, 0x61, 0x6c,
+ 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x78, 0x69, 0x73, 0x3d, 0x64, 0x33, 0x2e, 0x73,
+ 0x76, 0x67, 0x2e, 0x61, 0x78, 0x69, 0x73, 0x28, 0x29, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x28,
+ 0x73, 0x63, 0x61, 0x6c, 0x65, 0x29, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x3b,
+ 0x61, 0x78, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x29,
+ 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x73, 0x29, 0x61, 0x78, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x56, 0x61, 0x6c,
+ 0x75, 0x65, 0x73, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69,
+ 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x3d, 0x22, 0x6c, 0x65, 0x66, 0x74, 0x22,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x65, 0x72, 0x74, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x65, 0x72,
+ 0x74, 0x68, 0x52, 0x61, 0x74, 0x65, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73,
+ 0x66, 0x6f, 0x72, 0x6d, 0x3d, 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x28,
+ 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2b, 0x22, 0x2c, 0x20,
+ 0x22, 0x2b, 0x62, 0x65, 0x72, 0x74, 0x68, 0x2b, 0x22, 0x29, 0x22, 0x7d, 0x69, 0x66, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x76, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28,
+ 0x22, 0x2a, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x7d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73,
+ 0x76, 0x67, 0x3a, 0x67, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x22, 0x2c, 0x5b, 0x22, 0x79, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x22, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x54, 0x72, 0x65, 0x61, 0x74, 0x6d, 0x65,
+ 0x6e, 0x74, 0x5d, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x20, 0x22, 0x29, 0x29, 0x2e, 0x61,
+ 0x74, 0x74, 0x72, 0x28, 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x2c,
+ 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x29, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28,
+ 0x61, 0x78, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x74, 0x69, 0x63, 0x6b, 0x73, 0x29, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x64, 0x69,
+ 0x76, 0x69, 0x64, 0x65, 0x28, 0x30, 0x29, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69, 0x7a, 0x65,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69, 0x7a, 0x65, 0x29, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x61, 0x78, 0x69, 0x73, 0x7d, 0x2c, 0x5f, 0x64,
+ 0x72, 0x61, 0x77, 0x47, 0x72, 0x69, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x78, 0x69, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x69, 0x64, 0x53,
+ 0x69, 0x7a, 0x65, 0x3d, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x3d, 0x22, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x3f, 0x31,
+ 0x3a, 0x2d, 0x31, 0x29, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x76, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76, 0x67,
+ 0x3a, 0x67, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73,
+ 0x22, 0x2c, 0x22, 0x79, 0x5f, 0x67, 0x72, 0x69, 0x64, 0x22, 0x29, 0x2e, 0x63, 0x61, 0x6c, 0x6c,
+ 0x28, 0x61, 0x78, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x73, 0x29, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x75, 0x62, 0x64,
+ 0x69, 0x76, 0x69, 0x64, 0x65, 0x28, 0x30, 0x29, 0x2e, 0x74, 0x69, 0x63, 0x6b, 0x53, 0x69, 0x7a,
+ 0x65, 0x28, 0x67, 0x72, 0x69, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x29, 0x29, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x74, 0x65, 0x78, 0x74, 0x22, 0x29, 0x2e, 0x65,
+ 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x73,
+ 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x64, 0x61, 0x74,
+ 0x61, 0x2d, 0x79, 0x2d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x74, 0x65, 0x78, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x29, 0x0a, 0x7d, 0x29, 0x7d,
+ 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x59, 0x2e, 0x53, 0x63, 0x61,
+ 0x6c, 0x65, 0x64, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x59, 0x2e, 0x53, 0x63, 0x61, 0x6c,
+ 0x65, 0x64, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73,
+ 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x59, 0x2c, 0x7b,
+ 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x72, 0x67, 0x73, 0x2e,
+ 0x73, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x3d, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e,
+ 0x65, 0x64, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x45,
+ 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x64, 0x20, 0x72, 0x65, 0x71,
+ 0x75, 0x69, 0x72, 0x65, 0x73, 0x20, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x22, 0x29, 0x7d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x63,
+ 0x61, 0x6c, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x67, 0x72, 0x69, 0x64, 0x3d, 0x3d, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66,
+ 0x69, 0x6e, 0x65, 0x64, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x69, 0x64,
+ 0x3d, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x67, 0x72, 0x69, 0x64, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x69, 0x64, 0x7d, 0x24,
+ 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x2c, 0x5f, 0x64, 0x72,
+ 0x61, 0x77, 0x41, 0x78, 0x69, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x2c, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x63,
+ 0x61, 0x6c, 0x65, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65,
+ 0x72, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x2e, 0x79, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x3d, 0x5b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d,
+ 0x69, 0x6e, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2c, 0x64, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x29, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x2e, 0x61,
+ 0x70, 0x70, 0x6c, 0x79, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2c, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
+ 0x29, 0x5d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x70,
+ 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72,
+ 0x28, 0x29, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x5b, 0x30, 0x2c, 0x31, 0x5d, 0x29,
+ 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x61, 0x64, 0x6a, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x3d, 0x5b,
+ 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x70, 0x28, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72,
+ 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x65, 0x78, 0x74, 0x65, 0x6e,
+ 0x74, 0x4d, 0x61, 0x70, 0x28, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x44, 0x6f, 0x6d, 0x61, 0x69,
+ 0x6e, 0x5b, 0x31, 0x5d, 0x29, 0x5d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x64, 0x6a, 0x75, 0x73,
+ 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6c,
+ 0x69, 0x6e, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x65,
+ 0x78, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x61, 0x64,
+ 0x6a, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x64,
+ 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x70, 0x79, 0x28, 0x29, 0x2e, 0x64, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x6d, 0x61, 0x70, 0x28,
+ 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x29, 0x2e, 0x72, 0x61, 0x6e,
+ 0x67, 0x65, 0x28, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x29,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28,
+ 0x61, 0x64, 0x6a, 0x75, 0x73, 0x74, 0x65, 0x64, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x29, 0x7d, 0x2c,
+ 0x5f, 0x64, 0x72, 0x61, 0x77, 0x47, 0x72, 0x69, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x2c, 0x61, 0x78, 0x69, 0x73, 0x29, 0x7b,
+ 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x69, 0x64, 0x29, 0x7b, 0x24, 0x73,
+ 0x75, 0x70, 0x65, 0x72, 0x28, 0x61, 0x78, 0x69, 0x73, 0x29, 0x7d, 0x7d, 0x7d, 0x29, 0x3b, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
+ 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x48, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x22, 0x29, 0x3b, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x42, 0x65, 0x68,
+ 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x48, 0x69, 0x67,
+ 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6c, 0x65, 0x67,
+ 0x65, 0x6e, 0x64, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x66, 0x65, 0x3d,
+ 0x7b, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4c, 0x69, 0x6e,
+ 0x65, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x69, 0x73, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x64, 0x69,
+ 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x7c, 0x7c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x43, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x33, 0x2e, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x67, 0x62, 0x28, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x64, 0x33, 0x2e, 0x72, 0x67, 0x62, 0x28, 0x22,
+ 0x23, 0x64, 0x38, 0x64, 0x38, 0x64, 0x38, 0x22, 0x29, 0x29, 0x28, 0x2e, 0x38, 0x29, 0x2e, 0x74,
+ 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x61, 0x64, 0x64, 0x48, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x45, 0x76, 0x65, 0x6e,
+ 0x74, 0x73, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6c, 0x29, 0x7b, 0x6c,
+ 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e,
+ 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65,
+ 0x6f, 0x76, 0x65, 0x72, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4c, 0x69, 0x6e, 0x65, 0x29,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x61, 0x63, 0x74, 0x69,
+ 0x76, 0x65, 0x4c, 0x69, 0x6e, 0x65, 0x3d, 0x6c, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x65,
+ 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61,
+ 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6c, 0x69, 0x6e, 0x65,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x6c, 0x3d, 0x3d, 0x3d, 0x6c, 0x69, 0x6e, 0x65, 0x29, 0x7b, 0x69,
+ 0x66, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x26, 0x26, 0x28,
+ 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x65, 0x72, 0x3f, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x63,
+ 0x6b, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x29, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x69, 0x6e, 0x64, 0x65, 0x78,
+ 0x4f, 0x66, 0x28, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x3b,
+ 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x64,
+ 0x65, 0x78, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x70, 0x6c, 0x69,
+ 0x63, 0x65, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2c, 0x31,
+ 0x29, 0x5b, 0x30, 0x5d, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x29, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7d, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
+ 0x53, 0x61, 0x66, 0x65, 0x5b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x5d, 0x3d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x66, 0x65,
+ 0x5b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d,
+ 0x65, 0x5d, 0x7c, 0x7c, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64,
+ 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x29, 0x7d, 0x29, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x2c,
+ 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x3b, 0x6c, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65,
+ 0x72, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x2c, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x63, 0x74,
+ 0x69, 0x76, 0x65, 0x4c, 0x69, 0x6e, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x65,
+ 0x6c, 0x73, 0x65, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4c, 0x69, 0x6e, 0x65, 0x3d, 0x6e,
+ 0x75, 0x6c, 0x6c, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e,
+ 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6c, 0x69, 0x6e, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x6c, 0x3d, 0x3d, 0x3d, 0x6c, 0x69, 0x6e, 0x65, 0x26, 0x26, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x68,
+ 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x28, 0x22, 0x6f,
+ 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x29, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x6f, 0x70,
+ 0x28, 0x29, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x6c, 0x69, 0x6e, 0x65,
+ 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2c, 0x30,
+ 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x3b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20,
+ 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x49, 0x6e, 0x64,
+ 0x65, 0x78, 0x7d, 0x69, 0x66, 0x28, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x66, 0x65, 0x5b,
+ 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x5d, 0x29, 0x7b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x63,
+ 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x61, 0x66, 0x65, 0x5b, 0x6c,
+ 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x5d,
+ 0x7d, 0x7d, 0x29, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x2c, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x7d,
+ 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x6e,
+ 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x6c, 0x29, 0x7b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x61, 0x64, 0x64, 0x48,
+ 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x28, 0x6c,
+ 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e,
+ 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f,
+ 0x72, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x29,
+ 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x4f, 0x72, 0x64, 0x65, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x72, 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65,
+ 0x6e, 0x64, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x3b, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f,
+ 0x77, 0x2e, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x3d, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66,
+ 0x69, 0x6e, 0x65, 0x64, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x63, 0x6f, 0x75,
+ 0x6c, 0x64, 0x6e, 0x27, 0x74, 0x20, 0x66, 0x69, 0x6e, 0x64, 0x20, 0x6a, 0x51, 0x75, 0x65, 0x72,
+ 0x79, 0x20, 0x61, 0x74, 0x20, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x6a, 0x51, 0x75, 0x65,
+ 0x72, 0x79, 0x22, 0x7d, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x77, 0x69,
+ 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x75, 0x69, 0x3d, 0x3d,
+ 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x72,
+ 0x6f, 0x77, 0x22, 0x63, 0x6f, 0x75, 0x6c, 0x64, 0x6e, 0x27, 0x74, 0x20, 0x66, 0x69, 0x6e, 0x64,
+ 0x20, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x20, 0x55, 0x49, 0x20, 0x61, 0x74, 0x20, 0x77, 0x69,
+ 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x75, 0x69, 0x22, 0x7d,
+ 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x65,
+ 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x61,
+ 0x62, 0x6c, 0x65, 0x28, 0x7b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x6d, 0x65, 0x6e, 0x74,
+ 0x3a, 0x22, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x22, 0x2c, 0x74, 0x6f, 0x6c, 0x65, 0x72, 0x61,
+ 0x6e, 0x63, 0x65, 0x3a, 0x22, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x2c, 0x75, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76,
+ 0x65, 0x6e, 0x74, 0x2c, 0x75, 0x69, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x28, 0x73, 0x65, 0x6c,
+ 0x66, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x2e, 0x66,
+ 0x69, 0x6e, 0x64, 0x28, 0x22, 0x6c, 0x69, 0x22, 0x29, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2c, 0x69, 0x74,
+ 0x65, 0x6d, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x29, 0x7d, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d,
+ 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x3b, 0x69, 0x3e, 0x3d, 0x30, 0x3b,
+ 0x69, 0x2d, 0x2d, 0x29, 0x7b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5b, 0x69, 0x5d, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x7d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x7d, 0x29, 0x3b,
+ 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x65, 0x67, 0x65,
+ 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
+ 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7d, 0x29, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x68, 0x3d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x43, 0x6f, 0x6d,
+ 0x70, 0x75, 0x74, 0x65, 0x64, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e,
+ 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e,
+ 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x65, 0x67, 0x65,
+ 0x6e, 0x64, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65,
+ 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x68, 0x7d, 0x29, 0x7d, 0x3b, 0x52, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28,
+ 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72,
+ 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x54, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x3d,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61,
+ 0x64, 0x64, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x6c, 0x69, 0x6e, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x6e, 0x63, 0x68,
+ 0x6f, 0x72, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x61, 0x22, 0x29, 0x3b, 0x61,
+ 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d,
+ 0x22, 0x26, 0x23, 0x31, 0x30, 0x30, 0x30, 0x34, 0x3b, 0x22, 0x3b, 0x61, 0x6e, 0x63, 0x68, 0x6f,
+ 0x72, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28,
+ 0x22, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x3b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x65,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x42, 0x65, 0x66,
+ 0x6f, 0x72, 0x65, 0x28, 0x61, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x2c, 0x6c, 0x69, 0x6e, 0x65, 0x2e,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69,
+ 0x6c, 0x64, 0x29, 0x3b, 0x61, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x2e, 0x6f, 0x6e, 0x63, 0x6c, 0x69,
+ 0x63, 0x6b, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x69,
+ 0x66, 0x28, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69,
+ 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x7b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x2e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x29, 0x3b, 0x6c, 0x69, 0x6e,
+ 0x65, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c,
+ 0x69, 0x73, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x22, 0x64, 0x69, 0x73, 0x61,
+ 0x62, 0x6c, 0x65, 0x64, 0x22, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x69, 0x66, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x73, 0x2e, 0x64, 0x69, 0x73,
+ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x7d, 0x29, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x3d,
+ 0x31, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x29, 0x3b, 0x6c,
+ 0x69, 0x6e, 0x65, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73,
+ 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x64, 0x69, 0x73, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x22, 0x29, 0x7d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x2e, 0x62, 0x69, 0x6e, 0x64, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x3d,
+ 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x74,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x42, 0x79, 0x54, 0x61, 0x67, 0x4e, 0x61, 0x6d,
+ 0x65, 0x28, 0x22, 0x73, 0x70, 0x61, 0x6e, 0x22, 0x29, 0x5b, 0x30, 0x5d, 0x3b, 0x6c, 0x61, 0x62,
+ 0x65, 0x6c, 0x2e, 0x6f, 0x6e, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x69, 0x73, 0x61, 0x62,
+ 0x6c, 0x65, 0x41, 0x6c, 0x6c, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x3d,
+ 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61,
+ 0x62, 0x6c, 0x65, 0x64, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
+ 0x41, 0x6c, 0x6c, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x29, 0x7b, 0x66,
+ 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x30, 0x3b, 0x69, 0x3c, 0x73, 0x65, 0x6c,
+ 0x66, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x2b, 0x2b, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6c,
+ 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x6e,
+ 0x65, 0x73, 0x5b, 0x69, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x3d, 0x3d, 0x3d, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29,
+ 0x7b, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x7b, 0x7d, 0x65, 0x6c,
+ 0x73, 0x65, 0x7b, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41, 0x6c, 0x6c, 0x4f, 0x74, 0x68,
+ 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x62, 0x72, 0x65,
+ 0x61, 0x6b, 0x7d, 0x7d, 0x7d, 0x69, 0x66, 0x28, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x41,
+ 0x6c, 0x6c, 0x4f, 0x74, 0x68, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x73, 0x29, 0x7b, 0x6c, 0x69,
+ 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65,
+ 0x28, 0x29, 0x3b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65,
+ 0x28, 0x22, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x29, 0x3b, 0x73, 0x65, 0x6c,
+ 0x66, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x2e, 0x66,
+ 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6c, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x3d, 0x3d, 0x3d, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x7d, 0x65,
+ 0x6c, 0x73, 0x65, 0x7b, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73,
+ 0x61, 0x62, 0x6c, 0x65, 0x28, 0x29, 0x3b, 0x6c, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22,
+ 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22, 0x29, 0x7d, 0x7d, 0x29, 0x7d, 0x65, 0x6c,
+ 0x73, 0x65, 0x7b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c,
+ 0x69, 0x6e, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6c, 0x29, 0x7b, 0x6c, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x29, 0x3b, 0x6c, 0x2e, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x72,
+ 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x22, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x22,
+ 0x29, 0x7d, 0x29, 0x7d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x24, 0x3d,
+ 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x24, 0x21, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x26,
+ 0x26, 0x24, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c,
+ 0x69, 0x73, 0x74, 0x29, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x29, 0x7b, 0x24,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x73,
+ 0x74, 0x29, 0x2e, 0x73, 0x6f, 0x72, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x7b, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x65, 0x6e,
+ 0x74, 0x2c, 0x75, 0x69, 0x29, 0x7b, 0x75, 0x69, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x62, 0x69,
+ 0x6e, 0x64, 0x28, 0x22, 0x6e, 0x6f, 0x2e, 0x6f, 0x6e, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x29, 0x7b,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66,
+ 0x61, 0x75, 0x6c, 0x74, 0x28, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x73, 0x74, 0x6f, 0x70, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2c, 0x75, 0x69,
+ 0x29, 0x7b, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x75, 0x69, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x2e,
+ 0x75, 0x6e, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x22, 0x6e, 0x6f, 0x2e, 0x6f, 0x6e, 0x63, 0x6c, 0x69,
+ 0x63, 0x6b, 0x22, 0x29, 0x7d, 0x2c, 0x32, 0x35, 0x30, 0x29, 0x7d, 0x7d, 0x29, 0x7d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x2e,
+ 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6c, 0x29, 0x7b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x61, 0x64, 0x64, 0x41, 0x6e, 0x63, 0x68,
+ 0x6f, 0x72, 0x28, 0x6c, 0x29, 0x7d, 0x29, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x61, 0x64,
+ 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x73, 0x2e, 0x64, 0x69, 0x73,
+ 0x61, 0x62, 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x69, 0x66, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3c, 0x3d, 0x31, 0x29, 0x7b,
+ 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x22, 0x7d, 0x73, 0x2e, 0x64, 0x69,
+ 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x3b, 0x73, 0x2e, 0x65,
+ 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x3d, 0x66, 0x61, 0x6c, 0x73,
+ 0x65, 0x7d, 0x7d, 0x29, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x61, 0x64, 0x64, 0x42,
+ 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x75, 0x72, 0x3d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x61, 0x64, 0x64, 0x42, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x28, 0x29, 0x7d, 0x7d, 0x3b,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61,
+ 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x48, 0x6f, 0x76, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x29,
+ 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x48, 0x6f, 0x76, 0x65, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x3d, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x28, 0x7b, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x78, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x2e, 0x78, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x7c, 0x7c, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x78, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x78, 0x2a, 0x31, 0x65, 0x33, 0x29,
+ 0x2e, 0x74, 0x6f, 0x55, 0x54, 0x43, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x7d, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3d,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x7c,
+ 0x7c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x79, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x79, 0x3d, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3f, 0x79, 0x3a, 0x79,
+ 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78, 0x65, 0x64, 0x28, 0x32, 0x29, 0x7d, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69,
+ 0x76, 0x22, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73,
+ 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x22, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x3d, 0x74, 0x72, 0x75, 0x65,
+ 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61,
+ 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x76, 0x65,
+ 0x6e, 0x74, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x61, 0x64,
+ 0x64, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x73, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6f, 0x6e, 0x53, 0x68, 0x6f, 0x77, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6f, 0x6e,
+ 0x53, 0x68, 0x6f, 0x77, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x48, 0x69, 0x64, 0x65,
+ 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x6f, 0x6e, 0x48, 0x69, 0x64, 0x65, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6f, 0x6e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e,
+ 0x6f, 0x6e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x66, 0x6f, 0x72,
+ 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72,
+ 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x7d, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65,
+ 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2c, 0x78, 0x2c, 0x79, 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x58,
+ 0x2c, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x59, 0x2c, 0x64, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d,
+ 0x65, 0x2b, 0x22, 0x3a, 0x26, 0x6e, 0x62, 0x73, 0x70, 0x3b, 0x22, 0x2b, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x74, 0x65, 0x64, 0x59, 0x7d, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x65, 0x3d, 0x65, 0x7c, 0x7c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3b, 0x69,
+ 0x66, 0x28, 0x21, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6c, 0x61, 0x73, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3d, 0x65, 0x3b, 0x69, 0x66, 0x28,
+ 0x21, 0x65, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61,
+ 0x6d, 0x65, 0x2e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x2f, 0x5e, 0x28, 0x70, 0x61, 0x74, 0x68,
+ 0x7c, 0x73, 0x76, 0x67, 0x7c, 0x72, 0x65, 0x63, 0x74, 0x7c, 0x63, 0x69, 0x72, 0x63, 0x6c, 0x65,
+ 0x29, 0x24, 0x2f, 0x29, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x58, 0x3d, 0x65, 0x2e, 0x6f, 0x66,
+ 0x66, 0x73, 0x65, 0x74, 0x58, 0x7c, 0x7c, 0x65, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x58, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x59, 0x3d, 0x65, 0x2e, 0x6f, 0x66, 0x66,
+ 0x73, 0x65, 0x74, 0x59, 0x7c, 0x7c, 0x65, 0x2e, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x59, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x6a, 0x3d, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74,
+ 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74,
+ 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x28, 0x29,
+ 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61,
+ 0x74, 0x61, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x74,
+ 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x5b, 0x6a, 0x2b, 0x2b, 0x5d, 0x3b, 0x69,
+ 0x66, 0x28, 0x21, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
+ 0x58, 0x3d, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74,
+ 0x28, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x58, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d,
+ 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x64, 0x33,
+ 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2e,
+ 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x5b, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x30, 0x5d, 0x2e,
+ 0x78, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x2d, 0x31, 0x29,
+ 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x5d, 0x29, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x5b, 0x30,
+ 0x2c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x5d, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65,
+ 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64,
+ 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x53, 0x63, 0x61, 0x6c,
+ 0x65, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x58, 0x29, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x61,
+ 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d,
+ 0x3d, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x29, 0x61,
+ 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2d,
+ 0x2d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69,
+ 0x6d, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x7c, 0x7c, 0x30, 0x2c, 0x64, 0x61, 0x74,
+ 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x29, 0x3b, 0x66, 0x6f, 0x72, 0x28,
+ 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x78, 0x69, 0x6d, 0x61, 0x74,
+ 0x65, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3b, 0x69, 0x3c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x3b, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x64, 0x61, 0x74,
+ 0x61, 0x5b, 0x69, 0x5d, 0x7c, 0x7c, 0x21, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x69, 0x2b, 0x31, 0x5d,
+ 0x29, 0x62, 0x72, 0x65, 0x61, 0x6b, 0x3b, 0x69, 0x66, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x69,
+ 0x5d, 0x2e, 0x78, 0x3c, 0x3d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x58, 0x26, 0x26, 0x64, 0x61,
+ 0x74, 0x61, 0x5b, 0x69, 0x2b, 0x31, 0x5d, 0x2e, 0x78, 0x3e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
+ 0x58, 0x29, 0x7b, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x4d, 0x61, 0x74,
+ 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x58, 0x2d, 0x64, 0x61,
+ 0x74, 0x61, 0x5b, 0x69, 0x5d, 0x2e, 0x78, 0x29, 0x3c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62,
+ 0x73, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x58, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x69,
+ 0x2b, 0x31, 0x5d, 0x2e, 0x78, 0x29, 0x3f, 0x69, 0x3a, 0x69, 0x2b, 0x31, 0x3b, 0x62, 0x72, 0x65,
+ 0x61, 0x6b, 0x7d, 0x69, 0x66, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x69, 0x2b, 0x31, 0x5d, 0x2e,
+ 0x78, 0x3c, 0x3d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x58, 0x29, 0x7b, 0x69, 0x2b, 0x2b, 0x7d,
+ 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x69, 0x2d, 0x2d, 0x7d, 0x7d, 0x69, 0x66, 0x28, 0x64, 0x61, 0x74,
+ 0x61, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3c, 0x30, 0x29, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x64,
+ 0x65, 0x78, 0x3d, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x64,
+ 0x61, 0x74, 0x61, 0x5b, 0x64, 0x61, 0x74, 0x61, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x5d, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x3d, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x73, 0x71, 0x72, 0x74, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x78, 0x29, 0x2d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x58, 0x29,
+ 0x2c, 0x32, 0x29, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x6f, 0x77, 0x28, 0x4d, 0x61, 0x74,
+ 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79, 0x28, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x2e, 0x79, 0x2b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x79, 0x30, 0x29, 0x2d,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x59, 0x29, 0x2c, 0x32, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x78, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x78, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x7c, 0x7c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x78, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3d, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x2e, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x7c, 0x7c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x79, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x3d, 0x7b, 0x66, 0x6f, 0x72, 0x6d, 0x61,
+ 0x74, 0x74, 0x65, 0x64, 0x58, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x78, 0x46, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x74, 0x65, 0x72, 0x28, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x78, 0x29, 0x2c, 0x66,
+ 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x59, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x79,
+ 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x72, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x3f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x63,
+ 0x61, 0x6c, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x28, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x2e, 0x79, 0x29, 0x3a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x79, 0x29, 0x2c, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x3a, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x3a, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2c, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x3a,
+ 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2c, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x6a,
+ 0x2c, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d,
+ 0x65, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x6e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x50, 0x6f,
+ 0x69, 0x6e, 0x74, 0x7c, 0x7c, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x3c, 0x6e, 0x65,
+ 0x61, 0x72, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x64, 0x69, 0x73, 0x74, 0x61,
+ 0x6e, 0x63, 0x65, 0x29, 0x7b, 0x6e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x69, 0x6e,
+ 0x74, 0x3d, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x7d, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x2e, 0x70,
+ 0x75, 0x73, 0x68, 0x28, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x29, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73,
+ 0x29, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x6e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x69,
+ 0x6e, 0x74, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x6e, 0x65, 0x61, 0x72, 0x65, 0x73,
+ 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x3d, 0x74, 0x72,
+ 0x75, 0x65, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x58, 0x3d, 0x6e,
+ 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x61, 0x6c, 0x75,
+ 0x65, 0x2e, 0x78, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65,
+ 0x64, 0x58, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x6e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x50,
+ 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x58, 0x56,
+ 0x61, 0x6c, 0x75, 0x65, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x22, 0x22, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x64,
+ 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x58, 0x29, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x7b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x3a, 0x70,
+ 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x2c, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x3a, 0x70, 0x6f, 0x69,
+ 0x6e, 0x74, 0x73, 0x2c, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x58, 0x3a, 0x65, 0x76, 0x65, 0x6e, 0x74,
+ 0x58, 0x2c, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x59, 0x3a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x59, 0x2c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x58, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x58, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2c,
+ 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x58, 0x3a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x58, 0x7d,
+ 0x29, 0x7d, 0x2c, 0x68, 0x69, 0x64, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x3d,
+ 0x66, 0x61, 0x6c, 0x73, 0x65, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64,
+ 0x28, 0x22, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x29, 0x3b, 0x69, 0x66, 0x28,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x48, 0x69,
+ 0x64, 0x65, 0x3d, 0x3d, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x48, 0x69, 0x64, 0x65, 0x28, 0x29, 0x7d, 0x7d, 0x2c,
+ 0x73, 0x68, 0x6f, 0x77, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x3d, 0x74, 0x72, 0x75,
+ 0x65, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28,
+ 0x22, 0x69, 0x6e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x53, 0x68, 0x6f,
+ 0x77, 0x3d, 0x3d, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x7b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x53, 0x68, 0x6f, 0x77, 0x28, 0x29, 0x7d, 0x7d, 0x2c, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x72, 0x67, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x70, 0x6f,
+ 0x69, 0x6e, 0x74, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x3d, 0x70, 0x6f, 0x69, 0x6e, 0x74,
+ 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x70, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x70, 0x2e, 0x61, 0x63,
+ 0x74, 0x69, 0x76, 0x65, 0x7d, 0x29, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x3b, 0x69,
+ 0x66, 0x28, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x79, 0x3d,
+ 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x58, 0x56, 0x61, 0x6c, 0x75,
+ 0x65, 0x3d, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65,
+ 0x64, 0x58, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x6d,
+ 0x61, 0x74, 0x74, 0x65, 0x64, 0x59, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x70, 0x6f, 0x69, 0x6e,
+ 0x74, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x59, 0x56, 0x61, 0x6c, 0x75,
+ 0x65, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x69,
+ 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x22, 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x6c,
+ 0x65, 0x66, 0x74, 0x3d, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x70, 0x6f, 0x69, 0x6e,
+ 0x74, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x78, 0x29, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x78, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x3b, 0x78, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x2e,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x78, 0x5f, 0x6c, 0x61, 0x62,
+ 0x65, 0x6c, 0x22, 0x3b, 0x78, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72,
+ 0x48, 0x54, 0x4d, 0x4c, 0x3d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x58, 0x56,
+ 0x61, 0x6c, 0x75, 0x65, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x78, 0x4c,
+ 0x61, 0x62, 0x65, 0x6c, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x3d, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x3b, 0x69, 0x74, 0x65,
+ 0x6d, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x69, 0x74, 0x65,
+ 0x6d, 0x22, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x70, 0x6f,
+ 0x69, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61,
+ 0x63, 0x74, 0x75, 0x61, 0x6c, 0x59, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x63,
+ 0x61, 0x6c, 0x65, 0x3f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65,
+ 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x28, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x2e, 0x79, 0x29, 0x3a, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x2e, 0x79, 0x3b, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48,
+ 0x54, 0x4d, 0x4c, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74,
+ 0x65, 0x72, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x78, 0x2c, 0x61, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x59, 0x2c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x58, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2c,
+ 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x74, 0x65, 0x64, 0x59, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x2c,
+ 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x29, 0x3b, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x2e, 0x74, 0x6f, 0x70, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x79, 0x28, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x79,
+ 0x30, 0x2b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x79, 0x29,
+ 0x2b, 0x22, 0x70, 0x78, 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x69,
+ 0x74, 0x65, 0x6d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x74, 0x3d, 0x64, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x3b, 0x64, 0x6f, 0x74, 0x2e, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x64, 0x6f, 0x74, 0x22, 0x3b, 0x64,
+ 0x6f, 0x74, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x74, 0x6f, 0x70, 0x3d, 0x69, 0x74, 0x65,
+ 0x6d, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x74, 0x6f, 0x70, 0x3b, 0x64, 0x6f, 0x74, 0x2e,
+ 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x65,
+ 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x64, 0x6f, 0x74, 0x29, 0x3b, 0x69, 0x66, 0x28,
+ 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x2e, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x29, 0x7b, 0x69, 0x74,
+ 0x65, 0x6d, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64,
+ 0x28, 0x22, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x22, 0x29, 0x3b, 0x64, 0x6f, 0x74, 0x2e, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x61, 0x63,
+ 0x74, 0x69, 0x76, 0x65, 0x22, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e,
+ 0x61, 0x62, 0x6c, 0x65, 0x73, 0x3d, 0x5b, 0x78, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x2c, 0x69, 0x74,
+ 0x65, 0x6d, 0x5d, 0x3b, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x66,
+ 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x65, 0x6c, 0x29, 0x7b, 0x65, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74,
+ 0x2e, 0x61, 0x64, 0x64, 0x28, 0x22, 0x6c, 0x65, 0x66, 0x74, 0x22, 0x29, 0x7d, 0x29, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x68, 0x6f, 0x77, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6c,
+ 0x65, 0x66, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x5f, 0x63, 0x61, 0x6c, 0x63, 0x4c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x45, 0x72,
+ 0x72, 0x6f, 0x72, 0x28, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x29, 0x3b,
+ 0x69, 0x66, 0x28, 0x6c, 0x65, 0x66, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x45, 0x72, 0x72, 0x6f,
+ 0x72, 0x3e, 0x30, 0x29, 0x7b, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x2e,
+ 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x65, 0x6c, 0x29, 0x7b, 0x65, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73,
+ 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x22, 0x6c, 0x65, 0x66, 0x74, 0x22, 0x29,
+ 0x3b, 0x65, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64,
+ 0x64, 0x28, 0x22, 0x72, 0x69, 0x67, 0x68, 0x74, 0x22, 0x29, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x45, 0x72, 0x72, 0x6f, 0x72,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x63, 0x61, 0x6c, 0x63, 0x4c, 0x61, 0x79, 0x6f, 0x75,
+ 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x61, 0x62, 0x6c, 0x65,
+ 0x73, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x72, 0x69, 0x67, 0x68, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e,
+ 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3e, 0x6c, 0x65, 0x66, 0x74, 0x41, 0x6c, 0x69, 0x67, 0x6e, 0x45,
+ 0x72, 0x72, 0x6f, 0x72, 0x29, 0x7b, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x73,
+ 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x65, 0x6c, 0x29, 0x7b, 0x65, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69,
+ 0x73, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x22, 0x72, 0x69, 0x67, 0x68, 0x74,
+ 0x22, 0x29, 0x3b, 0x65, 0x6c, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4c, 0x69, 0x73, 0x74, 0x2e,
+ 0x61, 0x64, 0x64, 0x28, 0x22, 0x6c, 0x65, 0x66, 0x74, 0x22, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x69,
+ 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e,
+ 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3d, 0x3d, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6f, 0x6e, 0x52, 0x65, 0x6e, 0x64, 0x65,
+ 0x72, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x7d, 0x2c, 0x5f, 0x63, 0x61, 0x6c, 0x63, 0x4c,
+ 0x61, 0x79, 0x6f, 0x75, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x61, 0x72, 0x65,
+ 0x6e, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69,
+ 0x6e, 0x67, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x28, 0x29, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3d, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61,
+ 0x6c, 0x69, 0x67, 0x6e, 0x52, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x61,
+ 0x62, 0x6c, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x6c, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x65,
+ 0x63, 0x74, 0x3d, 0x65, 0x6c, 0x2e, 0x67, 0x65, 0x74, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e,
+ 0x67, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x28, 0x29, 0x3b, 0x69, 0x66,
+ 0x28, 0x21, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x7d, 0x69, 0x66, 0x28, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x72, 0x69, 0x67,
+ 0x68, 0x74, 0x3e, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x2e, 0x72, 0x69,
+ 0x67, 0x68, 0x74, 0x29, 0x7b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2b, 0x3d, 0x72, 0x65, 0x63, 0x74,
+ 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63,
+ 0x74, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x7d, 0x69, 0x66, 0x28, 0x72, 0x65, 0x63, 0x74, 0x2e,
+ 0x6c, 0x65, 0x66, 0x74, 0x3c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x2e,
+ 0x6c, 0x65, 0x66, 0x74, 0x29, 0x7b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2b, 0x3d, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x74, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x2d, 0x72, 0x65, 0x63,
+ 0x74, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x7d, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x7d, 0x2c, 0x5f, 0x61, 0x64, 0x64, 0x4c, 0x69, 0x73, 0x74,
+ 0x65, 0x6e, 0x65, 0x72, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74,
+ 0x65, 0x6e, 0x65, 0x72, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x22,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x76, 0x69, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x65, 0x29, 0x7d, 0x2e, 0x62,
+ 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6f, 0x6e, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x2e, 0x62,
+ 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x64,
+ 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x28, 0x22,
+ 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6f, 0x75, 0x74, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x65, 0x2e, 0x72, 0x65, 0x6c, 0x61, 0x74,
+ 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x26, 0x26, 0x21, 0x28, 0x65, 0x2e, 0x72, 0x65,
+ 0x6c, 0x61, 0x74, 0x65, 0x64, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x70,
+ 0x61, 0x72, 0x65, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x6f, 0x73, 0x69, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x65,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x26, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x44, 0x4f, 0x43,
+ 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43,
+ 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x53, 0x29, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68,
+ 0x69, 0x64, 0x65, 0x28, 0x29, 0x7d, 0x7d, 0x2e, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x29, 0x2c, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x29, 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28,
+ 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x4a, 0x53, 0x4f, 0x4e, 0x50, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x4a, 0x53, 0x4f, 0x4e, 0x50, 0x3d, 0x52, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x28, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x41, 0x6a, 0x61, 0x78, 0x2c, 0x7b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x6a, 0x51, 0x75, 0x65, 0x72,
+ 0x79, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x28, 0x7b, 0x75, 0x72, 0x6c, 0x3a, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x55, 0x52, 0x4c, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70,
+ 0x65, 0x3a, 0x22, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x22, 0x2c, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73,
+ 0x73, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x62,
+ 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x2c, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x62, 0x69, 0x6e, 0x64, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x4c, 0x65,
+ 0x67, 0x65, 0x6e, 0x64, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x4c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x3d, 0x52, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x28, 0x7b, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x72,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x22, 0x2c,
+ 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x61,
+ 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e,
+ 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x3d, 0x61, 0x72, 0x67, 0x73,
+ 0x2e, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x61, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x3b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73,
+ 0x4c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x64, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x69,
+ 0x73, 0x74, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x75, 0x6c, 0x22, 0x29, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x70, 0x70,
+ 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x69,
+ 0x73, 0x74, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28,
+ 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6f, 0x6e, 0x55,
+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x7d, 0x29, 0x7d, 0x2c, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74,
+ 0x2e, 0x66, 0x69, 0x72, 0x73, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x29, 0x7d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73,
+ 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6e, 0x61, 0x74, 0x75,
+ 0x72, 0x61, 0x6c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x29, 0x7b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x28,
+ 0x29, 0x7d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x73, 0x65, 0x6c,
+ 0x66, 0x2e, 0x61, 0x64, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x28, 0x73, 0x29, 0x7d, 0x29, 0x7d, 0x2c,
+ 0x61, 0x64, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x69, 0x6e,
+ 0x65, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x6c, 0x69, 0x22, 0x29, 0x3b, 0x6c,
+ 0x69, 0x6e, 0x65, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6c,
+ 0x69, 0x6e, 0x65, 0x22, 0x3b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64,
+ 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x7b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x2b, 0x3d, 0x22, 0x20, 0x64, 0x69, 0x73, 0x61, 0x62,
+ 0x6c, 0x65, 0x64, 0x22, 0x7d, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x7b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x28, 0x6c, 0x69, 0x6e, 0x65, 0x29, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65,
+ 0x64, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61,
+ 0x6d, 0x65, 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x73, 0x77, 0x61,
+ 0x74, 0x63, 0x68, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22,
+ 0x29, 0x3b, 0x73, 0x77, 0x61, 0x74, 0x63, 0x68, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x22, 0x73, 0x77, 0x61, 0x74, 0x63, 0x68, 0x22, 0x3b, 0x73, 0x77, 0x61, 0x74,
+ 0x63, 0x68, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f,
+ 0x75, 0x6e, 0x64, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e,
+ 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x73, 0x77, 0x61, 0x74, 0x63, 0x68, 0x29, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x3d, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28,
+ 0x22, 0x73, 0x70, 0x61, 0x6e, 0x22, 0x29, 0x3b, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x3d, 0x22, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x22, 0x3b,
+ 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x2e, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x48, 0x54, 0x4d, 0x4c, 0x3d,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3b, 0x6c, 0x69, 0x6e, 0x65,
+ 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x6c, 0x61, 0x62,
+ 0x65, 0x6c, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x61, 0x70,
+ 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x6c, 0x69, 0x6e, 0x65, 0x29, 0x3b,
+ 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x3b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6e, 0x6f, 0x4c,
+ 0x65, 0x67, 0x65, 0x6e, 0x64, 0x29, 0x7b, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x2e, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3d, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22,
+ 0x7d, 0x76, 0x61, 0x72, 0x20, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x3d, 0x7b, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x3a, 0x6c, 0x69, 0x6e, 0x65, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3a,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x7d, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x73, 0x68, 0x65, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73,
+ 0x68, 0x65, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x2e, 0x61, 0x64, 0x64, 0x41, 0x6e, 0x63, 0x68, 0x6f,
+ 0x72, 0x28, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x68,
+ 0x65, 0x6c, 0x76, 0x69, 0x6e, 0x67, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x65, 0x68,
+ 0x61, 0x76, 0x69, 0x6f, 0x75, 0x72, 0x28, 0x29, 0x7d, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x29, 0x7b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x68, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x65, 0x72, 0x2e, 0x61,
+ 0x64, 0x64, 0x48, 0x69, 0x67, 0x68, 0x6c, 0x69, 0x67, 0x68, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74,
+ 0x73, 0x28, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x29, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x69,
+ 0x6e, 0x65, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x7d, 0x7d, 0x29, 0x3b, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63,
+ 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x22, 0x29, 0x3b,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52,
+ 0x61, 0x6e, 0x67, 0x65, 0x53, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
+ 0x28, 0x7b, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x43, 0x61, 0x6c, 0x6c,
+ 0x62, 0x61, 0x63, 0x6b, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x75,
+ 0x69, 0x6c, 0x64, 0x28, 0x29, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6f, 0x6e, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x2e, 0x62,
+ 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x7d, 0x2c, 0x62, 0x75, 0x69, 0x6c,
+ 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x24,
+ 0x3d, 0x6a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61,
+ 0x69, 0x6e, 0x3d, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x44, 0x6f, 0x6d,
+ 0x61, 0x69, 0x6e, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x3b, 0x24, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x24, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x64,
+ 0x65, 0x72, 0x28, 0x7b, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x6d,
+ 0x69, 0x6e, 0x3a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x30, 0x5d, 0x2c, 0x6d, 0x61, 0x78,
+ 0x3a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x31, 0x5d, 0x2c, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x73, 0x3a, 0x5b, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x30, 0x5d, 0x2c, 0x64, 0x6f, 0x6d,
+ 0x61, 0x69, 0x6e, 0x5b, 0x31, 0x5d, 0x5d, 0x2c, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2c, 0x75, 0x69, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x75, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5b, 0x31, 0x5d,
+ 0x3c, 0x3d, 0x75, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64,
+ 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x69, 0x6e, 0x3d, 0x75, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x73, 0x5b, 0x30, 0x5d, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f,
+ 0x77, 0x2e, 0x78, 0x4d, 0x61, 0x78, 0x3d, 0x75, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,
+ 0x5b, 0x31, 0x5d, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29,
+ 0x3b, 0x69, 0x66, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x30, 0x5d, 0x3d, 0x3d, 0x75,
+ 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x29, 0x7b, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x69, 0x6e, 0x3d, 0x75,
+ 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x7d, 0x69, 0x66, 0x28, 0x64, 0x6f, 0x6d, 0x61,
+ 0x69, 0x6e, 0x5b, 0x31, 0x5d, 0x3d, 0x3d, 0x75, 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73,
+ 0x5b, 0x31, 0x5d, 0x29, 0x7b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f,
+ 0x77, 0x2e, 0x78, 0x4d, 0x61, 0x78, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,
+ 0x7d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62,
+ 0x61, 0x63, 0x6b, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7b,
+ 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2c, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x69, 0x6e,
+ 0x2c, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d,
+ 0x61, 0x78, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x7d, 0x29, 0x3b, 0x24, 0x28, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x5b, 0x30, 0x5d, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x3d, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x2b, 0x22, 0x70, 0x78, 0x22, 0x7d, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x24, 0x3d, 0x6a, 0x51, 0x75,
+ 0x65, 0x72, 0x79, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x3d, 0x24,
+ 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72,
+ 0x28, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x73, 0x22, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28,
+ 0x29, 0x3b, 0x24, 0x28, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x73, 0x6c, 0x69,
+ 0x64, 0x65, 0x72, 0x28, 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x22, 0x6d, 0x69,
+ 0x6e, 0x22, 0x2c, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x30, 0x5d, 0x29, 0x3b, 0x24, 0x28,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x28,
+ 0x22, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x22, 0x6d, 0x61, 0x78, 0x22, 0x2c, 0x64,
+ 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x31, 0x5d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x69, 0x6e, 0x3d, 0x3d,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x7b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x3d,
+ 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x30, 0x5d, 0x7d, 0x69, 0x66, 0x28, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x61, 0x78, 0x3d, 0x3d,
+ 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x7b, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5b, 0x31, 0x5d, 0x3d,
+ 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x5b, 0x31, 0x5d, 0x7d, 0x24, 0x28, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x28, 0x22, 0x6f, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x22, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0x2c, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x73, 0x29, 0x7d, 0x2c, 0x6f, 0x6e, 0x53, 0x6c, 0x69, 0x64, 0x65, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b,
+ 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x43, 0x61, 0x6c, 0x6c,
+ 0x62, 0x61, 0x63, 0x6b, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62,
+ 0x61, 0x63, 0x6b, 0x29, 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65,
+ 0x53, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x29,
+ 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x52, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x76,
+ 0x69, 0x65, 0x77, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61,
+ 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x7b, 0x69, 0x6e, 0x69, 0x74, 0x69,
+ 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61,
+ 0x72, 0x67, 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65,
+ 0x53, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x6e,
+ 0x65, 0x65, 0x64, 0x73, 0x20, 0x61, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65,
+ 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x3b,
+ 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x26, 0x26,
+ 0x21, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x29, 0x74, 0x68, 0x72,
+ 0x6f, 0x77, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x53, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x50, 0x72,
+ 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x20, 0x61, 0x20, 0x72, 0x65,
+ 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x20, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x20,
+ 0x6f, 0x66, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65,
+ 0x6d, 0x65, 0x6e, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3d, 0x22, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x22, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x3f, 0x5b, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5d, 0x3a,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3d, 0x7b, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x3a, 0x37, 0x35, 0x2c, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x34, 0x30, 0x30, 0x2c, 0x67,
+ 0x72, 0x69, 0x70, 0x70, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x75, 0x6e, 0x64, 0x65,
+ 0x66, 0x69, 0x6e, 0x65, 0x64, 0x2c, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x54, 0x6f, 0x70, 0x54, 0x68,
+ 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x3a, 0x33, 0x2c, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x3a, 0x31,
+ 0x30, 0x2c, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x22, 0x23, 0x64,
+ 0x34, 0x64, 0x34, 0x64, 0x34, 0x22, 0x2c, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x4f, 0x70, 0x61, 0x63,
+ 0x69, 0x74, 0x79, 0x3a, 0x31, 0x2c, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x46, 0x72, 0x61,
+ 0x6d, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x30, 0x2c, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x52, 0x61, 0x74, 0x69, 0x6f, 0x3a, 0x2e, 0x32, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e,
+ 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x7c, 0x7c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61,
+ 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x67, 0x72, 0x69, 0x70, 0x70, 0x65, 0x72, 0x43, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x3d, 0x64, 0x33, 0x2e, 0x72, 0x67, 0x62, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65,
+ 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x29, 0x2e, 0x64, 0x61, 0x72, 0x6b, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x74, 0x6f, 0x53, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x75, 0x72, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x3d, 0x5b,
+ 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x43, 0x61, 0x6c, 0x6c,
+ 0x62, 0x61, 0x63, 0x6b, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72,
+ 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69,
+ 0x64, 0x74, 0x68, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x72, 0x75,
+ 0x65, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x46, 0x72, 0x6f,
+ 0x6d, 0x47, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x69, 0x66, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x72, 0x61,
+ 0x70, 0x68, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x46,
+ 0x72, 0x6f, 0x6d, 0x47, 0x72, 0x61, 0x70, 0x68, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x75, 0x72, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x28, 0x61,
+ 0x72, 0x67, 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72,
+ 0x28, 0x29, 0x7d, 0x2e, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x7d,
+ 0x61, 0x72, 0x67, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x7c, 0x7c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x3b, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f,
+ 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e,
+ 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x75, 0x72, 0x65, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x29, 0x7d, 0x2c, 0x6f, 0x6e, 0x53, 0x6c, 0x69,
+ 0x64, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x61, 0x6c, 0x6c,
+ 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65,
+ 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63,
+ 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7d, 0x2c, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x75, 0x72, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63,
+ 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73,
+ 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7d,
+ 0x2c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x75, 0x72, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x73, 0x2e, 0x66, 0x6f,
+ 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63,
+ 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7b, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63,
+ 0x6b, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66,
+ 0x61, 0x75, 0x6c, 0x74, 0x73, 0x29, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6b, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5b, 0x6b, 0x5d, 0x3d, 0x6b, 0x20, 0x69, 0x6e, 0x20, 0x61,
+ 0x72, 0x67, 0x73, 0x3f, 0x61, 0x72, 0x67, 0x73, 0x5b, 0x6b, 0x5d, 0x3a, 0x6b, 0x20, 0x69, 0x6e,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3f, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5b, 0x6b, 0x5d, 0x3a, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x5b, 0x6b, 0x5d, 0x7d, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x69, 0x6e,
+ 0x20, 0x61, 0x72, 0x67, 0x73, 0x7c, 0x7c, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x69,
+ 0x6e, 0x20, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x72, 0x61, 0x70, 0x68, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x77, 0x69, 0x64, 0x74,
+ 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x5b, 0x30, 0x5d,
+ 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x7d, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x72, 0x61, 0x70, 0x68, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67,
+ 0x68, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x5b, 0x30,
+ 0x5d, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x68, 0x65,
+ 0x69, 0x67, 0x68, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70,
+ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x7d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2e, 0x66, 0x6f,
+ 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x70,
+ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x68, 0x65, 0x69, 0x67,
+ 0x68, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x48,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x2f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x54, 0x6f, 0x70, 0x54, 0x68, 0x69,
+ 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a, 0x32, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63,
+ 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a, 0x32, 0x3b, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x2e,
+ 0x73, 0x65, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x28, 0x7b, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x2c, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x68, 0x65, 0x69, 0x67,
+ 0x68, 0x74, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76, 0x67,
+ 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x76, 0x67, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d,
+ 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68,
+ 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a, 0x32, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x76,
+ 0x67, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61,
+ 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a, 0x32, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22,
+ 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x73, 0x76, 0x67, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2b,
+ 0x22, 0x70, 0x78, 0x22, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c, 0x73, 0x76,
+ 0x67, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x29, 0x7d, 0x7d, 0x2c,
+ 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x7d, 0x2c, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65,
+ 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76, 0x67,
+ 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41,
+ 0x6c, 0x6c, 0x28, 0x22, 0x73, 0x76, 0x67, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72,
+ 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x5b, 0x6e, 0x75,
+ 0x6c, 0x6c, 0x5d, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65,
+ 0x77, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x54, 0x6f, 0x70, 0x54,
+ 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a, 0x32, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65,
+ 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a,
+ 0x32, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72,
+ 0x61, 0x6d, 0x65, 0x3d, 0x5b, 0x30, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x65, 0x76,
+ 0x69, 0x65, 0x77, 0x57, 0x69, 0x64, 0x74, 0x68, 0x5d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x75,
+ 0x69, 0x6c, 0x64, 0x47, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x7b,
+ 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x41, 0x72, 0x67, 0x73, 0x3d, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x7b, 0x7d,
+ 0x2c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x29, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e,
+ 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2f, 0x73, 0x65,
+ 0x6c, 0x66, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3d, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x65, 0x78, 0x74, 0x65,
+ 0x6e, 0x64, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x41, 0x72, 0x67, 0x73, 0x2c, 0x7b, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e,
+ 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e,
+ 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x28, 0x22, 0x64,
+ 0x69, 0x76, 0x22, 0x29, 0x29, 0x2c, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x68, 0x65, 0x69,
+ 0x67, 0x68, 0x74, 0x2c, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x70,
+ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x3a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2c, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3a, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72,
+ 0x65, 0x72, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x6e,
+ 0x65, 0x77, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70,
+ 0x68, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x41, 0x72, 0x67, 0x73, 0x29, 0x3b, 0x73, 0x65, 0x6c,
+ 0x66, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x29, 0x3b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2e, 0x6f, 0x6e,
+ 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x29,
+ 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x29, 0x7d, 0x29,
+ 0x3b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2e, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x75, 0x72, 0x65, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67,
+ 0x73, 0x29, 0x7b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x68,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2d, 0x73, 0x65, 0x6c, 0x66,
+ 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e,
+ 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a, 0x32, 0x3b, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x28, 0x61,
+ 0x72, 0x67, 0x73, 0x29, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65,
+ 0x72, 0x28, 0x29, 0x7d, 0x29, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x72, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x28, 0x29, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x43,
+ 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29,
+ 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x64, 0x69, 0x76, 0x2e,
+ 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73,
+ 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x6f,
+ 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64,
+ 0x3d, 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x22, 0x2b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2b, 0x22,
+ 0x70, 0x78, 0x2c, 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x54, 0x6f, 0x70, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e,
+ 0x65, 0x73, 0x73, 0x2b, 0x22, 0x70, 0x78, 0x29, 0x22, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x43,
+ 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29,
+ 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x64, 0x69, 0x76, 0x22, 0x29, 0x2e, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x22, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72,
+ 0x65, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x22,
+ 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x2d, 0x77,
+ 0x65, 0x62, 0x6b, 0x69, 0x74, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x22,
+ 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e,
+ 0x64, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x2d, 0x6d, 0x6f, 0x7a, 0x2d, 0x74,
+ 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c,
+ 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c,
+ 0x65, 0x28, 0x22, 0x2d, 0x6d, 0x73, 0x2d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
+ 0x22, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x43, 0x6f, 0x6d, 0x6d, 0x61,
+ 0x6e, 0x64, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x74, 0x72, 0x61, 0x6e, 0x73,
+ 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x6c, 0x61, 0x74, 0x65, 0x43,
+ 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x29, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x62, 0x75, 0x69,
+ 0x6c, 0x64, 0x47, 0x72, 0x61, 0x70, 0x68, 0x29, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x43, 0x6f,
+ 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x65, 0x78, 0x69, 0x74, 0x28, 0x29, 0x2e, 0x72,
+ 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x61, 0x73, 0x74,
+ 0x65, 0x72, 0x47, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x73, 0x5b, 0x30, 0x5d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69,
+ 0x6e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e,
+ 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x28, 0x29, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28,
+ 0x5b, 0x30, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x57,
+ 0x69, 0x64, 0x74, 0x68, 0x5d, 0x29, 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x6d, 0x61, 0x73,
+ 0x74, 0x65, 0x72, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x44, 0x6f, 0x6d,
+ 0x61, 0x69, 0x6e, 0x28, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72, 0x65,
+ 0x6e, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x3d, 0x5b, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72,
+ 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x69,
+ 0x6e, 0x2c, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69,
+ 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x61, 0x78, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x3d,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5b, 0x30, 0x5d,
+ 0x3d, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x3f, 0x30, 0x3a, 0x4d,
+ 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e,
+ 0x53, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x28, 0x63, 0x75, 0x72,
+ 0x72, 0x65, 0x6e, 0x74, 0x57, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5b, 0x30, 0x5d, 0x29, 0x29, 0x3b,
+ 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46,
+ 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x3c, 0x30, 0x29, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63,
+ 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x3d, 0x30,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61,
+ 0x6d, 0x65, 0x5b, 0x31, 0x5d, 0x3d, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x57, 0x69, 0x6e,
+ 0x64, 0x6f, 0x77, 0x5b, 0x31, 0x5d, 0x3d, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e,
+ 0x65, 0x64, 0x3f, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x57,
+ 0x69, 0x64, 0x74, 0x68, 0x3a, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x63, 0x61, 0x6c, 0x65,
+ 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x28, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x57,
+ 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x5b, 0x31, 0x5d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x31,
+ 0x5d, 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72,
+ 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x3c, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x57,
+ 0x69, 0x64, 0x74, 0x68, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65,
+ 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x31, 0x5d, 0x3d, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d,
+ 0x7c, 0x7c, 0x30, 0x29, 0x2b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x57, 0x69, 0x64,
+ 0x74, 0x68, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x65, 0x6e, 0x74, 0x65,
+ 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76, 0x67, 0x22,
+ 0x29, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x22, 0x72, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72,
+ 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x2e,
+ 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2b, 0x22, 0x70, 0x78, 0x22, 0x29, 0x2e, 0x73, 0x74,
+ 0x79, 0x6c, 0x65, 0x28, 0x22, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2c, 0x22,
+ 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65,
+ 0x28, 0x22, 0x74, 0x6f, 0x70, 0x22, 0x2c, 0x30, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f,
+ 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x44, 0x69, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x28, 0x29, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d,
+ 0x65, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72,
+ 0x47, 0x72, 0x69, 0x70, 0x70, 0x65, 0x72, 0x73, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x28, 0x29,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x4d, 0x69, 0x64,
+ 0x64, 0x6c, 0x65, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x72, 0x65, 0x67, 0x69,
+ 0x73, 0x74, 0x65, 0x72, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x28,
+ 0x29, 0x7d, 0x2c, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x44, 0x69, 0x6d, 0x6d, 0x69, 0x6e,
+ 0x67, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72,
+ 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76,
+ 0x67, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x70, 0x61, 0x74,
+ 0x68, 0x2e, 0x64, 0x69, 0x6d, 0x6d, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61,
+ 0x28, 0x5b, 0x6e, 0x75, 0x6c, 0x6c, 0x5d, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28,
+ 0x22, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x66, 0x69,
+ 0x6c, 0x6c, 0x22, 0x2c, 0x22, 0x77, 0x68, 0x69, 0x74, 0x65, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74,
+ 0x72, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x2d, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x22,
+ 0x2c, 0x22, 0x30, 0x2e, 0x37, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x66, 0x69,
+ 0x6c, 0x6c, 0x2d, 0x72, 0x75, 0x6c, 0x65, 0x22, 0x2c, 0x22, 0x65, 0x76, 0x65, 0x6e, 0x6f, 0x64,
+ 0x64, 0x22, 0x29, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x22, 0x64, 0x69, 0x6d,
+ 0x6d, 0x69, 0x6e, 0x67, 0x22, 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x70, 0x61, 0x74, 0x68, 0x3d, 0x22, 0x22, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20,
+ 0x4d, 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e,
+ 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b,
+ 0x6e, 0x65, 0x73, 0x73, 0x2b, 0x22, 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x54, 0x6f, 0x70, 0x54, 0x68, 0x69,
+ 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x68,
+ 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x57,
+ 0x69, 0x64, 0x74, 0x68, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x76, 0x20, 0x22,
+ 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x48, 0x65, 0x69,
+ 0x67, 0x68, 0x74, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x68, 0x20, 0x22, 0x2b,
+ 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x57, 0x69, 0x64,
+ 0x74, 0x68, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x7a, 0x20, 0x22, 0x3b, 0x70,
+ 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x4d, 0x20, 0x22, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e,
+ 0x6d, 0x61, 0x78, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74,
+ 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65,
+ 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x29, 0x2b, 0x22, 0x20, 0x22, 0x2b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65,
+ 0x54, 0x6f, 0x70, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x3b, 0x70, 0x61, 0x74,
+ 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x48, 0x20, 0x22, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69,
+ 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72,
+ 0x61, 0x6d, 0x65, 0x5b, 0x31, 0x5d, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68,
+ 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a, 0x32, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70,
+ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e,
+ 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x29, 0x3b, 0x70, 0x61,
+ 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x76, 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70,
+ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x70, 0x61, 0x74,
+ 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x48, 0x20, 0x22, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61,
+ 0x78, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72,
+ 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68,
+ 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x29, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22,
+ 0x20, 0x7a, 0x22, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x74, 0x74, 0x72,
+ 0x28, 0x22, 0x64, 0x22, 0x2c, 0x70, 0x61, 0x74, 0x68, 0x29, 0x7d, 0x2c, 0x5f, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41,
+ 0x6c, 0x6c, 0x28, 0x22, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x22, 0x29,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x5b, 0x6e, 0x75, 0x6c, 0x6c, 0x5d, 0x29, 0x3b, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70,
+ 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74,
+ 0x72, 0x28, 0x22, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x22, 0x2c, 0x22, 0x77, 0x68, 0x69, 0x74,
+ 0x65, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65,
+ 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x22, 0x31, 0x70, 0x78, 0x22, 0x29, 0x2e, 0x61,
+ 0x74, 0x74, 0x72, 0x28, 0x22, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x2d, 0x6c, 0x69, 0x6e, 0x65,
+ 0x6a, 0x6f, 0x69, 0x6e, 0x22, 0x2c, 0x22, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x29, 0x2e, 0x61,
+ 0x74, 0x74, 0x72, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x43, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x2d, 0x6f, 0x70,
+ 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x4f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x29,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x2d, 0x72, 0x75, 0x6c, 0x65,
+ 0x22, 0x2c, 0x22, 0x65, 0x76, 0x65, 0x6e, 0x6f, 0x64, 0x64, 0x22, 0x29, 0x2e, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x65, 0x64, 0x28, 0x22, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x22, 0x2c, 0x74, 0x72, 0x75,
+ 0x65, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x22, 0x22, 0x3b, 0x70,
+ 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x4d, 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x2b,
+ 0x22, 0x20, 0x30, 0x22, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x48, 0x20, 0x22,
+ 0x2b, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72,
+ 0x61, 0x6d, 0x65, 0x5b, 0x31, 0x5d, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68,
+ 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a, 0x32, 0x29, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b,
+ 0x3d, 0x22, 0x20, 0x56, 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d,
+ 0x22, 0x20, 0x48, 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65,
+ 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b,
+ 0x3d, 0x22, 0x20, 0x7a, 0x22, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x4d, 0x20,
+ 0x22, 0x2b, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46,
+ 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54,
+ 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x29, 0x2b, 0x22, 0x20, 0x22, 0x2b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x54,
+ 0x6f, 0x70, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x3b, 0x70, 0x61, 0x74, 0x68,
+ 0x2b, 0x3d, 0x22, 0x20, 0x48, 0x20, 0x22, 0x2b, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75,
+ 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x31, 0x5d, 0x2b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x29, 0x3b,
+ 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x76, 0x20, 0x22, 0x2b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x70,
+ 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x48, 0x20, 0x22, 0x2b, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d,
+ 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61,
+ 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73,
+ 0x73, 0x29, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x7a, 0x22, 0x3b, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x64, 0x22, 0x2c, 0x70,
+ 0x61, 0x74, 0x68, 0x29, 0x7d, 0x2c, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x72, 0x69,
+ 0x70, 0x70, 0x65, 0x72, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x69, 0x70, 0x70, 0x65, 0x72, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28,
+ 0x22, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x67, 0x72, 0x69, 0x70, 0x70, 0x65, 0x72, 0x22, 0x29, 0x2e,
+ 0x64, 0x61, 0x74, 0x61, 0x28, 0x5b, 0x6e, 0x75, 0x6c, 0x6c, 0x5d, 0x29, 0x3b, 0x67, 0x72, 0x69,
+ 0x70, 0x70, 0x65, 0x72, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70,
+ 0x65, 0x6e, 0x64, 0x28, 0x22, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72,
+ 0x28, 0x22, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x67, 0x72, 0x69, 0x70, 0x70, 0x65, 0x72, 0x43, 0x6f, 0x6c,
+ 0x6f, 0x72, 0x29, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x22, 0x67, 0x72, 0x69,
+ 0x70, 0x70, 0x65, 0x72, 0x22, 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x70, 0x61, 0x74, 0x68, 0x3d, 0x22, 0x22, 0x3b, 0x5b, 0x2e, 0x34, 0x2c, 0x2e, 0x36, 0x5d, 0x2e,
+ 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x73, 0x70, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x29, 0x7b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d,
+ 0x22, 0x20, 0x4d, 0x20, 0x22, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64,
+ 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61,
+ 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69,
+ 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x2a, 0x73, 0x70, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x29, 0x2b,
+ 0x22, 0x20, 0x22, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x2a, 0x2e, 0x33, 0x29, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x56, 0x20,
+ 0x22, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2a,
+ 0x2e, 0x37, 0x29, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x4d, 0x20, 0x22, 0x2b,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x31, 0x5d, 0x2b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d,
+ 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73,
+ 0x2a, 0x28, 0x31, 0x2b, 0x73, 0x70, 0x61, 0x63, 0x69, 0x6e, 0x67, 0x29, 0x29, 0x2b, 0x22, 0x20,
+ 0x22, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2a,
+ 0x2e, 0x33, 0x29, 0x3b, 0x70, 0x61, 0x74, 0x68, 0x2b, 0x3d, 0x22, 0x20, 0x56, 0x20, 0x22, 0x2b,
+ 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2a, 0x2e, 0x37,
+ 0x29, 0x7d, 0x2e, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x3b, 0x67,
+ 0x72, 0x69, 0x70, 0x70, 0x65, 0x72, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x64, 0x22, 0x2c,
+ 0x70, 0x61, 0x74, 0x68, 0x29, 0x7d, 0x2c, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x48, 0x61,
+ 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41,
+ 0x6c, 0x6c, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x68, 0x61,
+ 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x5b, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x5d, 0x29, 0x3b, 0x6c, 0x65, 0x66, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x2e, 0x65,
+ 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x72,
+ 0x65, 0x63, 0x74, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x77, 0x69, 0x64, 0x74,
+ 0x68, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66,
+ 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e,
+ 0x65, 0x73, 0x73, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x63, 0x75, 0x72, 0x73,
+ 0x6f, 0x72, 0x22, 0x2c, 0x22, 0x65, 0x77, 0x2d, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x29,
+ 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x2d, 0x6f, 0x70, 0x61,
+ 0x63, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x22, 0x30, 0x22, 0x29, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73,
+ 0x65, 0x64, 0x28, 0x22, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22,
+ 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x3b, 0x6c, 0x65, 0x66, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c,
+ 0x65, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x78, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x29,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x69, 0x67, 0x68, 0x74, 0x48, 0x61, 0x6e, 0x64,
+ 0x6c, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x72, 0x69, 0x67, 0x68,
+ 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28,
+ 0x5b, 0x6e, 0x75, 0x6c, 0x6c, 0x5d, 0x29, 0x3b, 0x72, 0x69, 0x67, 0x68, 0x74, 0x48, 0x61, 0x6e,
+ 0x64, 0x6c, 0x65, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65,
+ 0x6e, 0x64, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28,
+ 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e,
+ 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54,
+ 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28,
+ 0x22, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x2c, 0x22, 0x65, 0x77, 0x2d, 0x72, 0x65, 0x73,
+ 0x69, 0x7a, 0x65, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x66, 0x69, 0x6c,
+ 0x6c, 0x2d, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x22, 0x30, 0x22, 0x29, 0x2e,
+ 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x22, 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x68,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x3b, 0x72, 0x69, 0x67,
+ 0x68, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x78,
+ 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72,
+ 0x61, 0x6d, 0x65, 0x5b, 0x31, 0x5d, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68,
+ 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66,
+ 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x29, 0x7d, 0x2c, 0x5f, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x48,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x73,
+ 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x6d,
+ 0x69, 0x64, 0x64, 0x6c, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x29, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x28, 0x5b, 0x6e, 0x75, 0x6c, 0x6c, 0x5d, 0x29, 0x3b, 0x6d, 0x69, 0x64, 0x64,
+ 0x6c, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29,
+ 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x22, 0x29, 0x2e,
+ 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x22, 0x2c, 0x22,
+ 0x6d, 0x6f, 0x76, 0x65, 0x22, 0x29, 0x2e, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x28, 0x22, 0x66, 0x69,
+ 0x6c, 0x6c, 0x2d, 0x6f, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x22, 0x2c, 0x22, 0x30, 0x22, 0x29,
+ 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x22, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65,
+ 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x3b, 0x6d,
+ 0x69, 0x64, 0x64, 0x6c, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x2e, 0x61, 0x74, 0x74, 0x72,
+ 0x28, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61,
+ 0x78, 0x28, 0x30, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74,
+ 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x31, 0x5d, 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75,
+ 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x29, 0x29, 0x2e,
+ 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x78, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75,
+ 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x5b, 0x30, 0x5d, 0x2b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x48,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x54, 0x68, 0x69, 0x63, 0x6b, 0x6e, 0x65, 0x73, 0x73, 0x29, 0x2e,
+ 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x29, 0x7d, 0x2c, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x4d, 0x6f, 0x75, 0x73,
+ 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x64,
+ 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c,
+ 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x72, 0x61, 0x67, 0x3d,
+ 0x7b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3a, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x73, 0x74, 0x6f, 0x70, 0x3a, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x2c, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x72, 0x69, 0x67,
+ 0x68, 0x74, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x72, 0x69, 0x67, 0x69, 0x64, 0x3a, 0x66,
+ 0x61, 0x6c, 0x73, 0x65, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x3b, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x4d,
+ 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x64, 0x61, 0x74, 0x75, 0x6d, 0x2c, 0x69,
+ 0x6e, 0x64, 0x65, 0x78, 0x29, 0x7b, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x3d,
+ 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x5f, 0x67, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58,
+ 0x46, 0x72, 0x6f, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x28, 0x64, 0x33, 0x2e, 0x65, 0x76, 0x65,
+ 0x6e, 0x74, 0x2c, 0x64, 0x72, 0x61, 0x67, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x69, 0x73,
+ 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x72, 0x61, 0x76, 0x65, 0x6c, 0x65, 0x64, 0x3d, 0x64, 0x72,
+ 0x61, 0x67, 0x2e, 0x73, 0x74, 0x6f, 0x70, 0x2d, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65,
+ 0x72, 0x44, 0x72, 0x61, 0x67, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65,
+ 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x44, 0x72, 0x61, 0x67, 0x2e, 0x73, 0x6c, 0x69, 0x63, 0x65,
+ 0x28, 0x30, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x46,
+ 0x72, 0x61, 0x6d, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x46, 0x72, 0x61,
+ 0x6d, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3b, 0x69, 0x66, 0x28, 0x64, 0x72, 0x61, 0x67, 0x2e,
+ 0x72, 0x69, 0x67, 0x69, 0x64, 0x29, 0x7b, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x46, 0x72,
+ 0x61, 0x6d, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x72,
+ 0x61, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d,
+ 0x2d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72,
+ 0x65, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30, 0x5d, 0x7d, 0x69, 0x66, 0x28, 0x64, 0x72, 0x61, 0x67,
+ 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x29, 0x7b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65,
+ 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30, 0x5d, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x61,
+ 0x78, 0x28, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67,
+ 0x5b, 0x30, 0x5d, 0x2b, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x72, 0x61, 0x76,
+ 0x65, 0x6c, 0x65, 0x64, 0x2c, 0x30, 0x29, 0x7d, 0x69, 0x66, 0x28, 0x64, 0x72, 0x61, 0x67, 0x2e,
+ 0x72, 0x69, 0x67, 0x68, 0x74, 0x29, 0x7b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65,
+ 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69,
+ 0x6e, 0x28, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67,
+ 0x5b, 0x31, 0x5d, 0x2b, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x72, 0x61, 0x76,
+ 0x65, 0x6c, 0x65, 0x64, 0x2c, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65,
+ 0x77, 0x57, 0x69, 0x64, 0x74, 0x68, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x63, 0x75, 0x72, 0x72,
+ 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x66, 0x72,
+ 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x2d,
+ 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30,
+ 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d,
+ 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3c, 0x3d, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x46,
+ 0x72, 0x61, 0x6d, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x64, 0x72,
+ 0x61, 0x67, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x29, 0x7b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66,
+ 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30, 0x5d, 0x3d, 0x66, 0x72, 0x61, 0x6d, 0x65,
+ 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x2d, 0x6d, 0x69, 0x6e,
+ 0x69, 0x6d, 0x75, 0x6d, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x7d, 0x69,
+ 0x66, 0x28, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x29, 0x7b, 0x66, 0x72,
+ 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x3d,
+ 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30,
+ 0x5d, 0x2b, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x57, 0x69,
+ 0x64, 0x74, 0x68, 0x7d, 0x69, 0x66, 0x28, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65,
+ 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30, 0x5d, 0x3c, 0x3d, 0x30, 0x29, 0x7b, 0x66, 0x72, 0x61,
+ 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x2d, 0x3d,
+ 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30,
+ 0x5d, 0x3b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67,
+ 0x5b, 0x30, 0x5d, 0x3d, 0x30, 0x7d, 0x69, 0x66, 0x28, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66,
+ 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x3e, 0x3d, 0x73, 0x65, 0x6c, 0x66,
+ 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x57, 0x69, 0x64, 0x74, 0x68, 0x29, 0x7b, 0x66,
+ 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30, 0x5d,
+ 0x2d, 0x3d, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67,
+ 0x5b, 0x31, 0x5d, 0x2d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77,
+ 0x57, 0x69, 0x64, 0x74, 0x68, 0x3b, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72,
+ 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x70, 0x72, 0x65,
+ 0x76, 0x69, 0x65, 0x77, 0x57, 0x69, 0x64, 0x74, 0x68, 0x7d, 0x7d, 0x73, 0x65, 0x6c, 0x66, 0x2e,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x64,
+ 0x33, 0x2e, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x28, 0x29,
+ 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x64, 0x33, 0x2e,
+ 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65,
+ 0x72, 0x29, 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x5b, 0x30, 0x2c, 0x73, 0x65, 0x6c,
+ 0x66, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x57, 0x69, 0x64, 0x74, 0x68, 0x5d, 0x29,
+ 0x2e, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x64, 0x61, 0x74,
+ 0x61, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x77,
+ 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x3d, 0x5b,
+ 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x66, 0x72, 0x61, 0x6d,
+ 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30, 0x5d, 0x29, 0x2c, 0x64,
+ 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x66, 0x72, 0x61, 0x6d, 0x65,
+ 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x29, 0x5d, 0x3b, 0x73,
+ 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63,
+ 0x6b, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x29, 0x7b, 0x63, 0x61,
+ 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2c, 0x77, 0x69, 0x6e,
+ 0x64, 0x6f, 0x77, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30, 0x5d, 0x2c,
+ 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b,
+ 0x31, 0x5d, 0x29, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66,
+ 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30, 0x5d, 0x3d, 0x3d, 0x3d, 0x30, 0x29, 0x7b,
+ 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b,
+ 0x30, 0x5d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x7d, 0x69, 0x66, 0x28,
+ 0x66, 0x72, 0x61, 0x6d, 0x65, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31,
+ 0x5d, 0x3d, 0x3d, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77,
+ 0x57, 0x69, 0x64, 0x74, 0x68, 0x29, 0x7b, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x41, 0x66, 0x74,
+ 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69,
+ 0x6e, 0x65, 0x64, 0x7d, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77,
+ 0x2e, 0x78, 0x4d, 0x69, 0x6e, 0x3d, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x41, 0x66, 0x74, 0x65,
+ 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x30, 0x5d, 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x77,
+ 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x78, 0x4d, 0x61, 0x78, 0x3d, 0x77, 0x69, 0x6e, 0x64, 0x6f,
+ 0x77, 0x41, 0x66, 0x74, 0x65, 0x72, 0x44, 0x72, 0x61, 0x67, 0x5b, 0x31, 0x5d, 0x3b, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x29, 0x7d, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x64,
+ 0x6f, 0x77, 0x6e, 0x28, 0x29, 0x7b, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65,
+ 0x74, 0x3d, 0x64, 0x33, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x61, 0x72, 0x67, 0x65,
+ 0x74, 0x3b, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x73, 0x74, 0x61, 0x72, 0x74, 0x3d, 0x73, 0x65, 0x6c,
+ 0x66, 0x2e, 0x5f, 0x67, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x46, 0x72, 0x6f,
+ 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x28, 0x64, 0x33, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2c,
+ 0x64, 0x72, 0x61, 0x67, 0x29, 0x3b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x72, 0x61, 0x6d, 0x65,
+ 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x44, 0x72, 0x61, 0x67, 0x3d, 0x73, 0x65, 0x6c, 0x66, 0x2e,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x6c, 0x69,
+ 0x63, 0x65, 0x28, 0x29, 0x3b, 0x64, 0x33, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3f, 0x64, 0x33, 0x2e,
+ 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x66,
+ 0x61, 0x75, 0x6c, 0x74, 0x28, 0x29, 0x3a, 0x64, 0x33, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3d, 0x66, 0x61, 0x6c, 0x73,
+ 0x65, 0x3b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x64, 0x6f, 0x63, 0x75,
+ 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d,
+ 0x6f, 0x76, 0x65, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x72, 0x61, 0x6e,
+ 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65,
+ 0x77, 0x22, 0x2c, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x29, 0x3b,
+ 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x75, 0x70, 0x2e,
+ 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73,
+ 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x2c, 0x6f,
+ 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x75, 0x70, 0x29, 0x3b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x28, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x6f, 0x6e,
+ 0x28, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x72, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65,
+ 0x72, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x2c, 0x6f, 0x6e, 0x4d, 0x6f, 0x75,
+ 0x73, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x29, 0x3b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63,
+ 0x74, 0x28, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22,
+ 0x74, 0x6f, 0x75, 0x63, 0x68, 0x65, 0x6e, 0x64, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70,
+ 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x2c, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x75,
+ 0x70, 0x29, 0x3b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x64, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68,
+ 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65,
+ 0x76, 0x69, 0x65, 0x77, 0x22, 0x2c, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x75, 0x70, 0x29,
+ 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73,
+ 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x4c, 0x65, 0x66, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x28,
+ 0x64, 0x61, 0x74, 0x75, 0x6d, 0x2c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x7b, 0x64, 0x72, 0x61,
+ 0x67, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x6f, 0x6e, 0x4d, 0x6f,
+ 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x69,
+ 0x67, 0x68, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x28, 0x64, 0x61, 0x74, 0x75, 0x6d, 0x2c,
+ 0x69, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x7b, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x72, 0x69, 0x67, 0x68,
+ 0x74, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f,
+ 0x77, 0x6e, 0x28, 0x29, 0x7d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e,
+ 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x48,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x28, 0x64, 0x61, 0x74, 0x75, 0x6d, 0x2c, 0x69, 0x6e, 0x64, 0x65,
+ 0x78, 0x29, 0x7b, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x74, 0x72, 0x75,
+ 0x65, 0x3b, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x74, 0x72, 0x75,
+ 0x65, 0x3b, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x72, 0x69, 0x67, 0x69, 0x64, 0x3d, 0x74, 0x72, 0x75,
+ 0x65, 0x3b, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x28, 0x29, 0x7d,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65,
+ 0x75, 0x70, 0x28, 0x64, 0x61, 0x74, 0x75, 0x6d, 0x2c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x7b,
+ 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65,
+ 0x6e, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x6d, 0x6f, 0x76,
+ 0x65, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65,
+ 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22,
+ 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74,
+ 0x28, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6d,
+ 0x6f, 0x75, 0x73, 0x65, 0x75, 0x70, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f,
+ 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65,
+ 0x76, 0x69, 0x65, 0x77, 0x22, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x64, 0x33, 0x2e, 0x73,
+ 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e,
+ 0x6f, 0x6e, 0x28, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x72, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69,
+ 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x2c, 0x6e, 0x75, 0x6c,
+ 0x6c, 0x29, 0x3b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x64, 0x6f, 0x63,
+ 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68,
+ 0x65, 0x6e, 0x64, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x72, 0x61, 0x6e,
+ 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65,
+ 0x77, 0x22, 0x2c, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x3b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x28, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x6f, 0x6e, 0x28,
+ 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x2e, 0x72, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x73, 0x6c, 0x69, 0x64,
+ 0x65, 0x72, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x22, 0x2c, 0x6e, 0x75, 0x6c, 0x6c,
+ 0x29, 0x3b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x72,
+ 0x61, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x44, 0x72, 0x61, 0x67, 0x3b, 0x64, 0x72,
+ 0x61, 0x67, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3d, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x3b, 0x64, 0x72,
+ 0x61, 0x67, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3d, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x3b, 0x64,
+ 0x72, 0x61, 0x67, 0x2e, 0x72, 0x69, 0x67, 0x69, 0x64, 0x3d, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x7d,
+ 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22,
+ 0x72, 0x65, 0x63, 0x74, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65,
+ 0x22, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e,
+ 0x22, 0x2c, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x4c, 0x65, 0x66,
+ 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x72, 0x69,
+ 0x67, 0x68, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x29, 0x2e, 0x6f, 0x6e, 0x28,
+ 0x22, 0x6d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x22, 0x2c, 0x6f, 0x6e, 0x4d, 0x6f,
+ 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48, 0x61, 0x6e, 0x64,
+ 0x6c, 0x65, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x6d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x5f,
+ 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x6d, 0x6f, 0x75,
+ 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x22, 0x2c, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x64,
+ 0x6f, 0x77, 0x6e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x29,
+ 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28,
+ 0x22, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c,
+ 0x65, 0x22, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x22, 0x2c, 0x6f, 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x4c,
+ 0x65, 0x66, 0x74, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x2e,
+ 0x72, 0x69, 0x67, 0x68, 0x74, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x29, 0x2e, 0x6f,
+ 0x6e, 0x28, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x2c, 0x6f,
+ 0x6e, 0x4d, 0x6f, 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x52, 0x69, 0x67, 0x68, 0x74, 0x48,
+ 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x29, 0x3b, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x73,
+ 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x72, 0x65, 0x63, 0x74, 0x2e, 0x6d, 0x69, 0x64, 0x64,
+ 0x6c, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x29, 0x2e, 0x6f, 0x6e, 0x28, 0x22,
+ 0x74, 0x6f, 0x75, 0x63, 0x68, 0x73, 0x74, 0x61, 0x72, 0x74, 0x22, 0x2c, 0x6f, 0x6e, 0x4d, 0x6f,
+ 0x75, 0x73, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x4d, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x48, 0x61, 0x6e,
+ 0x64, 0x6c, 0x65, 0x29, 0x7d, 0x2c, 0x5f, 0x67, 0x65, 0x74, 0x43, 0x6c, 0x69, 0x65, 0x6e, 0x74,
+ 0x58, 0x46, 0x72, 0x6f, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2c, 0x64, 0x72, 0x61, 0x67, 0x29, 0x7b,
+ 0x73, 0x77, 0x69, 0x74, 0x63, 0x68, 0x28, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x74, 0x79, 0x70,
+ 0x65, 0x29, 0x7b, 0x63, 0x61, 0x73, 0x65, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x73, 0x74, 0x61,
+ 0x72, 0x74, 0x22, 0x3a, 0x63, 0x61, 0x73, 0x65, 0x22, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x6d, 0x6f,
+ 0x76, 0x65, 0x22, 0x3a, 0x76, 0x61, 0x72, 0x20, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x4c, 0x69, 0x73,
+ 0x74, 0x3d, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x54,
+ 0x6f, 0x75, 0x63, 0x68, 0x65, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x6f, 0x75, 0x63, 0x68,
+ 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x74, 0x6f,
+ 0x75, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x30, 0x3b, 0x74, 0x6f, 0x75, 0x63, 0x68,
+ 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3c, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65,
+ 0x78, 0x2b, 0x2b, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x4c, 0x69, 0x73,
+ 0x74, 0x5b, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x5d, 0x2e, 0x74, 0x61,
+ 0x72, 0x67, 0x65, 0x74, 0x3d, 0x3d, 0x3d, 0x64, 0x72, 0x61, 0x67, 0x2e, 0x74, 0x61, 0x72, 0x67,
+ 0x65, 0x74, 0x29, 0x7b, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x3d, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x4c,
+ 0x69, 0x73, 0x74, 0x5b, 0x74, 0x6f, 0x75, 0x63, 0x68, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x5d, 0x3b,
+ 0x62, 0x72, 0x65, 0x61, 0x6b, 0x7d, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x6f,
+ 0x75, 0x63, 0x68, 0x21, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3f, 0x74, 0x6f, 0x75, 0x63, 0x68,
+ 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e,
+ 0x65, 0x64, 0x3b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x58, 0x7d,
+ 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d,
+ 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x22,
+ 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28,
+ 0x7b, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f,
+ 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x2c, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x7d, 0x2c, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72,
+ 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x7d, 0x2c, 0x64,
+ 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f,
+ 0x6e, 0x3a, 0x2e, 0x38, 0x2c, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68,
+ 0x3a, 0x32, 0x2c, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x2c,
+ 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x7b, 0x74, 0x6f, 0x70, 0x3a, 0x2e, 0x30, 0x31,
+ 0x2c, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x30, 0x2c, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a,
+ 0x2e, 0x30, 0x31, 0x2c, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x30, 0x7d, 0x2c, 0x73, 0x74, 0x72, 0x6f,
+ 0x6b, 0x65, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x66, 0x69, 0x6c, 0x6c, 0x3a, 0x66, 0x61,
+ 0x6c, 0x73, 0x65, 0x7d, 0x7d, 0x2c, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x64, 0x61, 0x74, 0x61,
+ 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x78, 0x4d, 0x69, 0x6e, 0x3d, 0x2b, 0x49, 0x6e, 0x66, 0x69, 0x6e,
+ 0x69, 0x74, 0x79, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x78, 0x4d, 0x61, 0x78, 0x3d, 0x2d, 0x49, 0x6e,
+ 0x66, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x79, 0x4d, 0x69, 0x6e, 0x3d,
+ 0x2b, 0x49, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x79, 0x4d,
+ 0x61, 0x78, 0x3d, 0x2d, 0x49, 0x6e, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x79, 0x3b, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x29, 0x7b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x64, 0x2e, 0x79, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x79, 0x3d, 0x64, 0x2e, 0x79, 0x2b, 0x64, 0x2e, 0x79, 0x30, 0x3b,
+ 0x69, 0x66, 0x28, 0x79, 0x3c, 0x79, 0x4d, 0x69, 0x6e, 0x29, 0x79, 0x4d, 0x69, 0x6e, 0x3d, 0x79,
+ 0x3b, 0x69, 0x66, 0x28, 0x79, 0x3e, 0x79, 0x4d, 0x61, 0x78, 0x29, 0x79, 0x4d, 0x61, 0x78, 0x3d,
+ 0x79, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6c,
+ 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x69, 0x66, 0x28,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x3c, 0x78, 0x4d, 0x69, 0x6e,
+ 0x29, 0x78, 0x4d, 0x69, 0x6e, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2e,
+ 0x78, 0x3b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5b, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x5d, 0x2e, 0x78, 0x3e, 0x78,
+ 0x4d, 0x61, 0x78, 0x29, 0x78, 0x4d, 0x61, 0x78, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x5b,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x5d,
+ 0x2e, 0x78, 0x7d, 0x29, 0x3b, 0x78, 0x4d, 0x69, 0x6e, 0x2d, 0x3d, 0x28, 0x78, 0x4d, 0x61, 0x78,
+ 0x2d, 0x78, 0x4d, 0x69, 0x6e, 0x29, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x64, 0x64,
+ 0x69, 0x6e, 0x67, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x78, 0x4d, 0x61, 0x78, 0x2b, 0x3d, 0x28,
+ 0x78, 0x4d, 0x61, 0x78, 0x2d, 0x78, 0x4d, 0x69, 0x6e, 0x29, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3b, 0x79, 0x4d,
+ 0x69, 0x6e, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6d, 0x69,
+ 0x6e, 0x3d, 0x3d, 0x3d, 0x22, 0x61, 0x75, 0x74, 0x6f, 0x22, 0x3f, 0x79, 0x4d, 0x69, 0x6e, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x7c, 0x7c,
+ 0x30, 0x3b, 0x79, 0x4d, 0x61, 0x78, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x3d, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x64, 0x3f, 0x79, 0x4d, 0x61, 0x78, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x6d, 0x61, 0x78, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x6d, 0x69, 0x6e, 0x3d, 0x3d, 0x3d, 0x22, 0x61, 0x75, 0x74, 0x6f, 0x22,
+ 0x7c, 0x7c, 0x79, 0x4d, 0x69, 0x6e, 0x3c, 0x30, 0x29, 0x7b, 0x79, 0x4d, 0x69, 0x6e, 0x2d, 0x3d,
+ 0x28, 0x79, 0x4d, 0x61, 0x78, 0x2d, 0x79, 0x4d, 0x69, 0x6e, 0x29, 0x2a, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x7d,
+ 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x6d, 0x61,
+ 0x78, 0x3d, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x29, 0x7b, 0x79,
+ 0x4d, 0x61, 0x78, 0x2b, 0x3d, 0x28, 0x79, 0x4d, 0x61, 0x78, 0x2d, 0x79, 0x4d, 0x69, 0x6e, 0x29,
+ 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2e, 0x74, 0x6f,
+ 0x70, 0x7d, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x78, 0x3a, 0x5b, 0x78, 0x4d, 0x69, 0x6e,
+ 0x2c, 0x78, 0x4d, 0x61, 0x78, 0x5d, 0x2c, 0x79, 0x3a, 0x5b, 0x79, 0x4d, 0x69, 0x6e, 0x2c, 0x79,
+ 0x4d, 0x61, 0x78, 0x5d, 0x7d, 0x7d, 0x2c, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x67,
+ 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x7c, 0x7c, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x76, 0x69, 0x73, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x2e, 0x76, 0x69, 0x73, 0x7c, 0x7c, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x76, 0x69, 0x73,
+ 0x3b, 0x76, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22,
+ 0x2a, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x69, 0x6c,
+ 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65,
+ 0x64, 0x7d, 0x29, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x2e, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x70, 0x61, 0x74, 0x68, 0x4e, 0x6f, 0x64,
+ 0x65, 0x73, 0x3d, 0x76, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c,
+ 0x28, 0x22, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x64, 0x61,
+ 0x74, 0x61, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29,
+ 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76, 0x67, 0x3a, 0x70, 0x61, 0x74,
+ 0x68, 0x22, 0x29, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x22, 0x70, 0x61, 0x74,
+ 0x68, 0x22, 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x64,
+ 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x61, 0x74,
+ 0x68, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x28, 0x29, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x3d, 0x76, 0x69, 0x73, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x70, 0x61, 0x74, 0x68, 0x2e,
+ 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x64, 0x61,
+ 0x74, 0x61, 0x29, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65,
+ 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76, 0x67, 0x3a, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x63,
+ 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x22, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x22, 0x2c,
+ 0x74, 0x72, 0x75, 0x65, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x64, 0x22, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x72, 0x6f, 0x6b, 0x65,
+ 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x28, 0x29, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x69,
+ 0x3d, 0x30, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63,
+ 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73,
+ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x70, 0x61, 0x74, 0x68, 0x4e, 0x6f, 0x64,
+ 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x5b, 0x69, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x29, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73,
+ 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3d, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x4e, 0x6f, 0x64, 0x65,
+ 0x73, 0x5b, 0x30, 0x5d, 0x5b, 0x69, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x74,
+ 0x79, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x29, 0x3b, 0x69, 0x2b, 0x2b, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c, 0x5f, 0x73,
+ 0x74, 0x79, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20,
+ 0x66, 0x69, 0x6c, 0x6c, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x6c, 0x3f, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x22, 0x6e, 0x6f, 0x6e,
+ 0x65, 0x22, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3d, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3f, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x22, 0x6e, 0x6f, 0x6e, 0x65, 0x22, 0x3b, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x22, 0x2c, 0x66, 0x69,
+ 0x6c, 0x6c, 0x29, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x2e,
+ 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x73, 0x74,
+ 0x72, 0x6f, 0x6b, 0x65, 0x22, 0x2c, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x29, 0x3b, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x2d, 0x77,
+ 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b,
+ 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x7b, 0x64, 0x33, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x61,
+ 0x74, 0x68, 0x29, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x2c, 0x74, 0x72, 0x75,
+ 0x65, 0x29, 0x7d, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72,
+ 0x6f, 0x6b, 0x65, 0x29, 0x7b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x29, 0x2e, 0x63, 0x6c,
+ 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61,
+ 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29, 0x7d, 0x7d, 0x2c, 0x63,
+ 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6b,
+ 0x65, 0x79, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
+ 0x73, 0x28, 0x29, 0x29, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6b, 0x65, 0x79, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x61,
+ 0x72, 0x67, 0x73, 0x2e, 0x68, 0x61, 0x73, 0x4f, 0x77, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72,
+ 0x74, 0x79, 0x28, 0x6b, 0x65, 0x79, 0x29, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6b, 0x65,
+ 0x79, 0x5d, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x6b, 0x65, 0x79, 0x5d, 0x7c, 0x7c, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5b, 0x6b, 0x65, 0x79, 0x5d, 0x7c, 0x7c, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x28, 0x29, 0x5b, 0x6b,
+ 0x65, 0x79, 0x5d, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7d, 0x69, 0x66, 0x28, 0x74, 0x79,
+ 0x70, 0x65, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
+ 0x74, 0x73, 0x28, 0x29, 0x5b, 0x6b, 0x65, 0x79, 0x5d, 0x3d, 0x3d, 0x22, 0x6f, 0x62, 0x6a, 0x65,
+ 0x63, 0x74, 0x22, 0x29, 0x7b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6b, 0x65,
+ 0x79, 0x73, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73,
+ 0x28, 0x29, 0x5b, 0x6b, 0x65, 0x79, 0x5d, 0x29, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6b, 0x29, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x5b, 0x6b, 0x65, 0x79, 0x5d, 0x5b, 0x6b, 0x5d, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x5b, 0x6b,
+ 0x65, 0x79, 0x5d, 0x5b, 0x6b, 0x5d, 0x21, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e,
+ 0x65, 0x64, 0x3f, 0x61, 0x72, 0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, 0x65, 0x64, 0x3f,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5b, 0x6b, 0x65, 0x79, 0x5d, 0x3a,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x28, 0x29, 0x5b,
+ 0x6b, 0x65, 0x79, 0x5d, 0x7d, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c, 0x73, 0x65,
+ 0x74, 0x53, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x57, 0x69, 0x64, 0x74,
+ 0x68, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x57, 0x69, 0x64, 0x74,
+ 0x68, 0x21, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x29, 0x7b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d,
+ 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x7d, 0x7d, 0x2c, 0x73, 0x65,
+ 0x74, 0x54, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x65,
+ 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x21, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x64, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x3d,
+ 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x7d, 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x22, 0x29, 0x3b, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65,
+ 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x3d, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x28, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a,
+ 0x22, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x2c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x29,
+ 0x2c, 0x7b, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x66,
+ 0x69, 0x6c, 0x6c, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65,
+ 0x3a, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50,
+ 0x61, 0x74, 0x68, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x66,
+ 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x6c, 0x69,
+ 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x78, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x78, 0x28, 0x64, 0x2e, 0x78, 0x29, 0x7d, 0x29, 0x2e, 0x79, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x79, 0x28, 0x64, 0x2e, 0x79, 0x29, 0x7d, 0x29, 0x2e, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x29, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x29, 0x3b, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79,
+ 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x26, 0x26, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72,
+ 0x79, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x79,
+ 0x21, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x22, 0x29, 0x3b,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x3d, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65,
+ 0x61, 0x74, 0x65, 0x28, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61,
+ 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2c, 0x7b, 0x6e, 0x61, 0x6d,
+ 0x65, 0x3a, 0x22, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x22, 0x2c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c,
+ 0x74, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70,
+ 0x65, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65,
+ 0x72, 0x28, 0x29, 0x2c, 0x7b, 0x66, 0x69, 0x6c, 0x6c, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x73,
+ 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x75, 0x6e, 0x73, 0x74,
+ 0x61, 0x63, 0x6b, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x7d, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x76,
+ 0x67, 0x2e, 0x61, 0x72, 0x65, 0x61, 0x28, 0x29, 0x2e, 0x78, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x64, 0x2e, 0x78, 0x29, 0x7d, 0x29, 0x2e, 0x79, 0x30, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79, 0x28, 0x64, 0x2e, 0x79, 0x30, 0x29,
+ 0x7d, 0x29, 0x2e, 0x79, 0x31, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79,
+ 0x28, 0x64, 0x2e, 0x79, 0x2b, 0x64, 0x2e, 0x79, 0x30, 0x29, 0x7d, 0x29, 0x2e, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f,
+ 0x6e, 0x29, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x29, 0x3b, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79,
+ 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x26, 0x26, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72,
+ 0x79, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x79,
+ 0x21, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x72, 0x22, 0x29, 0x3b, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x42, 0x61, 0x72, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x62,
+ 0x61, 0x72, 0x22, 0x2c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65,
+ 0x72, 0x28, 0x29, 0x2c, 0x7b, 0x67, 0x61, 0x70, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x2e, 0x30, 0x35,
+ 0x2c, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x7d, 0x29,
+ 0x3b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73,
+ 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x7d, 0x2c, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61,
+ 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73,
+ 0x75, 0x70, 0x65, 0x72, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x67, 0x73, 0x3d,
+ 0x61, 0x72, 0x67, 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x61,
+ 0x70, 0x53, 0x69, 0x7a, 0x65, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x61, 0x70, 0x53, 0x69,
+ 0x7a, 0x65, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x61, 0x70, 0x53, 0x69, 0x7a, 0x65,
+ 0x3b, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x2c, 0x64,
+ 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24,
+ 0x73, 0x75, 0x70, 0x65, 0x72, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69,
+ 0x6e, 0x3d, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x66,
+ 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e,
+ 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x73, 0x6c,
+ 0x69, 0x63, 0x65, 0x28, 0x2d, 0x31, 0x29, 0x2e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x29, 0x29,
+ 0x3b, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x78, 0x5b, 0x31, 0x5d, 0x2b, 0x3d, 0x4e, 0x75,
+ 0x6d, 0x62, 0x65, 0x72, 0x28, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74,
+ 0x65, 0x72, 0x76, 0x61, 0x6c, 0x2e, 0x6d, 0x61, 0x67, 0x6e, 0x69, 0x74, 0x75, 0x64, 0x65, 0x29,
+ 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x7d, 0x2c,
+ 0x62, 0x61, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x72,
+ 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3d, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74,
+ 0x65, 0x72, 0x76, 0x61, 0x6c, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62, 0x61, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x2e, 0x6d, 0x61,
+ 0x67, 0x6e, 0x69, 0x74, 0x75, 0x64, 0x65, 0x28, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74,
+ 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x2e, 0x6d, 0x61, 0x67, 0x6e, 0x69, 0x74, 0x75,
+ 0x64, 0x65, 0x29, 0x2a, 0x28, 0x31, 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x61, 0x70, 0x53,
+ 0x69, 0x7a, 0x65, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x62, 0x61, 0x72, 0x57,
+ 0x69, 0x64, 0x74, 0x68, 0x7d, 0x2c, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x67, 0x73,
+ 0x3d, 0x61, 0x72, 0x67, 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x7c, 0x7c, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x76, 0x69, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73,
+ 0x2e, 0x76, 0x69, 0x73, 0x7c, 0x7c, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x76, 0x69, 0x73, 0x3b,
+ 0x76, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2a,
+ 0x22, 0x29, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x62, 0x61, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x61,
+ 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x61, 0x63,
+ 0x74, 0x69, 0x76, 0x65, 0x28, 0x29, 0x5b, 0x30, 0x5d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x62,
+ 0x61, 0x72, 0x58, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x3d, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e,
+ 0x74, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x21, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x7d, 0x29, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x42, 0x61, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75,
+ 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3f, 0x62, 0x61, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x2f,
+ 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e,
+ 0x74, 0x3a, 0x62, 0x61, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74,
+ 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x3d,
+ 0x5b, 0x31, 0x2c, 0x30, 0x2c, 0x30, 0x2c, 0x64, 0x2e, 0x79, 0x3c, 0x30, 0x3f, 0x2d, 0x31, 0x3a,
+ 0x31, 0x2c, 0x30, 0x2c, 0x64, 0x2e, 0x79, 0x3c, 0x30, 0x3f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x79, 0x2e, 0x6d, 0x61, 0x67, 0x6e, 0x69, 0x74, 0x75, 0x64, 0x65, 0x28, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x61, 0x62, 0x73, 0x28, 0x64, 0x2e, 0x79, 0x29, 0x29, 0x2a, 0x32, 0x3a, 0x30, 0x5d, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x28, 0x22, 0x2b,
+ 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x2e, 0x6a, 0x6f, 0x69, 0x6e, 0x28, 0x22, 0x2c, 0x22, 0x29,
+ 0x2b, 0x22, 0x29, 0x22, 0x7d, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72,
+ 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x62, 0x61, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x62, 0x61, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x3d, 0x76, 0x69, 0x73,
+ 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x70, 0x61, 0x74, 0x68,
+ 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73,
+ 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64,
+ 0x2e, 0x79, 0x21, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x29, 0x29, 0x2e, 0x65, 0x6e, 0x74,
+ 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76, 0x67,
+ 0x3a, 0x72, 0x65, 0x63, 0x74, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x78, 0x22,
+ 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x64, 0x2e, 0x78, 0x29,
+ 0x2b, 0x62, 0x61, 0x72, 0x58, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x7d, 0x29, 0x2e, 0x61, 0x74,
+ 0x74, 0x72, 0x28, 0x22, 0x79, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x79, 0x28, 0x64, 0x2e, 0x79, 0x30, 0x2b, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28,
+ 0x64, 0x2e, 0x79, 0x29, 0x29, 0x2a, 0x28, 0x64, 0x2e, 0x79, 0x3c, 0x30, 0x3f, 0x2d, 0x31, 0x3a,
+ 0x31, 0x29, 0x7d, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x22, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x42, 0x61, 0x72, 0x57, 0x69, 0x64, 0x74, 0x68,
+ 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79, 0x2e, 0x6d, 0x61, 0x67, 0x6e, 0x69,
+ 0x74, 0x75, 0x64, 0x65, 0x28, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x61, 0x62, 0x73, 0x28, 0x64, 0x2e,
+ 0x79, 0x29, 0x29, 0x7d, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x74, 0x72, 0x61, 0x6e,
+ 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x22, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
+ 0x29, 0x3b, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70,
+ 0x65, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6e,
+ 0x6f, 0x64, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x6e, 0x29, 0x7b, 0x6e, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+ 0x74, 0x65, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x22, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x29, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x29, 0x62, 0x61, 0x72, 0x58, 0x4f, 0x66,
+ 0x66, 0x73, 0x65, 0x74, 0x2b, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x42, 0x61, 0x72, 0x57,
+ 0x69, 0x64, 0x74, 0x68, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c, 0x5f, 0x66, 0x72,
+ 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3a, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73,
+ 0x3d, 0x7b, 0x7d, 0x3b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x30, 0x3b,
+ 0x69, 0x3c, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x2d, 0x31, 0x3b,
+ 0x69, 0x2b, 0x2b, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61,
+ 0x6c, 0x3d, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x69, 0x2b, 0x31, 0x5d, 0x2e, 0x78, 0x2d, 0x64, 0x61,
+ 0x74, 0x61, 0x5b, 0x69, 0x5d, 0x2e, 0x78, 0x3b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c,
+ 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5b, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5d,
+ 0x3d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5b,
+ 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x5d, 0x7c, 0x7c, 0x30, 0x3b, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x76, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5b, 0x69, 0x6e, 0x74, 0x65,
+ 0x72, 0x76, 0x61, 0x6c, 0x5d, 0x2b, 0x2b, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x66, 0x72, 0x65, 0x71,
+ 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3d, 0x7b, 0x63, 0x6f,
+ 0x75, 0x6e, 0x74, 0x3a, 0x30, 0x2c, 0x6d, 0x61, 0x67, 0x6e, 0x69, 0x74, 0x75, 0x64, 0x65, 0x3a,
+ 0x31, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6b, 0x65, 0x79, 0x73,
+ 0x28, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x29,
+ 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x69, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74,
+ 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3c, 0x69,
+ 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5b, 0x69, 0x5d,
+ 0x29, 0x7b, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76,
+ 0x61, 0x6c, 0x3d, 0x7b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76,
+ 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5b, 0x69, 0x5d, 0x2c, 0x6d, 0x61, 0x67, 0x6e,
+ 0x69, 0x74, 0x75, 0x64, 0x65, 0x3a, 0x69, 0x7d, 0x7d, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x66, 0x72, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72,
+ 0x76, 0x61, 0x6c, 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72,
+ 0x65, 0x72, 0x2e, 0x41, 0x72, 0x65, 0x61, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65,
+ 0x72, 0x2e, 0x41, 0x72, 0x65, 0x61, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x52, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x65, 0x72, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x61, 0x72, 0x65, 0x61,
+ 0x22, 0x2c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x65, 0x78, 0x74, 0x65,
+ 0x6e, 0x64, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x29, 0x2c, 0x7b, 0x75, 0x6e, 0x73,
+ 0x74, 0x61, 0x63, 0x6b, 0x3a, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x66, 0x69, 0x6c, 0x6c, 0x3a,
+ 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3a, 0x66, 0x61, 0x6c,
+ 0x73, 0x65, 0x7d, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68,
+ 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x61, 0x63, 0x74,
+ 0x6f, 0x72, 0x79, 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x61, 0x72, 0x65, 0x61, 0x28,
+ 0x29, 0x2e, 0x78, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x64,
+ 0x2e, 0x78, 0x29, 0x7d, 0x29, 0x2e, 0x79, 0x30, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x79, 0x28, 0x64, 0x2e, 0x79, 0x30, 0x29, 0x7d, 0x29, 0x2e, 0x79, 0x31, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79, 0x28, 0x64, 0x2e, 0x79, 0x2b, 0x64, 0x2e,
+ 0x79, 0x30, 0x29, 0x7d, 0x29, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74,
+ 0x65, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c,
+ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x29, 0x3b, 0x0a, 0x66, 0x61,
+ 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x26, 0x26, 0x66,
+ 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x64, 0x2e, 0x79, 0x21, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x29, 0x3b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x7d, 0x2c, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x53, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6f,
+ 0x72, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61,
+ 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x3d, 0x64,
+ 0x33, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x78, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x64, 0x2e, 0x78, 0x29, 0x7d, 0x29,
+ 0x2e, 0x79, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79, 0x28, 0x64, 0x2e,
+ 0x79, 0x2b, 0x64, 0x2e, 0x79, 0x30, 0x29, 0x7d, 0x29, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70,
+ 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x69, 0x6e, 0x74, 0x65,
+ 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69,
+ 0x6f, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x29,
+ 0x3b, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,
+ 0x26, 0x26, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65,
+ 0x64, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65,
+ 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x79, 0x21, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d,
+ 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79,
+ 0x7d, 0x2c, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67,
+ 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x7c, 0x7c, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3b,
+ 0x76, 0x61, 0x72, 0x20, 0x76, 0x69, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x76, 0x69, 0x73,
+ 0x7c, 0x7c, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x76, 0x69, 0x73, 0x3b, 0x76, 0x69, 0x73, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2a, 0x22, 0x29, 0x2e, 0x72,
+ 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6d, 0x65, 0x74, 0x68,
+ 0x6f, 0x64, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3f,
+ 0x22, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x22, 0x3a, 0x22, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74,
+ 0x22, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x73, 0x2e, 0x64, 0x69,
+ 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x7d, 0x29, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x6f,
+ 0x64, 0x65, 0x73, 0x3d, 0x76, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c,
+ 0x6c, 0x28, 0x22, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x64,
+ 0x61, 0x74, 0x61, 0x29, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x5b, 0x6d, 0x65, 0x74,
+ 0x68, 0x6f, 0x64, 0x5d, 0x28, 0x22, 0x73, 0x76, 0x67, 0x3a, 0x67, 0x22, 0x2c, 0x22, 0x67, 0x22,
+ 0x29, 0x3b, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22,
+ 0x73, 0x76, 0x67, 0x3a, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28,
+ 0x22, 0x64, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50,
+ 0x61, 0x74, 0x68, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x28, 0x29, 0x29, 0x2e, 0x61, 0x74,
+ 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x61, 0x72, 0x65, 0x61,
+ 0x22, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b,
+ 0x65, 0x29, 0x7b, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28,
+ 0x22, 0x73, 0x76, 0x67, 0x3a, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72,
+ 0x28, 0x22, 0x64, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x53, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x28, 0x29, 0x29,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x22, 0x6c,
+ 0x69, 0x6e, 0x65, 0x22, 0x29, 0x7d, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x30, 0x3b, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x69, 0x66,
+ 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64,
+ 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70,
+ 0x61, 0x74, 0x68, 0x3d, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x5b, 0x69, 0x2b, 0x2b,
+ 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x53, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7d, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x29, 0x7d, 0x2c, 0x5f, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x61, 0x74,
+ 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c, 0x65,
+ 0x63, 0x74, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x29, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x2e, 0x61, 0x72, 0x65, 0x61, 0x22, 0x29, 0x2e,
+ 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x22, 0x2c, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x29, 0x7b, 0x64, 0x33, 0x2e, 0x73, 0x65, 0x6c,
+ 0x65, 0x63, 0x74, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x29,
+ 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x22, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x22, 0x29,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x22, 0x2c, 0x22, 0x6e, 0x6f,
+ 0x6e, 0x65, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x73, 0x74, 0x72, 0x6f, 0x6b,
+ 0x65, 0x22, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65,
+ 0x7c, 0x7c, 0x64, 0x33, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65,
+ 0x52, 0x67, 0x62, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
+ 0x2c, 0x22, 0x62, 0x6c, 0x61, 0x63, 0x6b, 0x22, 0x29, 0x28, 0x2e, 0x31, 0x32, 0x35, 0x29, 0x29,
+ 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x2d, 0x77, 0x69,
+ 0x64, 0x74, 0x68, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65,
+ 0x57, 0x69, 0x64, 0x74, 0x68, 0x29, 0x7d, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x7b, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69,
+ 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x22, 0x2c, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x7d, 0x7d,
+ 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53,
+ 0x63, 0x61, 0x74, 0x74, 0x65, 0x72, 0x50, 0x6c, 0x6f, 0x74, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x63, 0x61, 0x74, 0x74, 0x65, 0x72, 0x50, 0x6c, 0x6f, 0x74,
+ 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e,
+ 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2c, 0x7b,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x73, 0x63, 0x61, 0x74, 0x74, 0x65, 0x72, 0x70, 0x6c, 0x6f,
+ 0x74, 0x22, 0x2c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x65, 0x78, 0x74,
+ 0x65, 0x6e, 0x64, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x29, 0x2c, 0x7b, 0x75, 0x6e,
+ 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x66, 0x69, 0x6c, 0x6c, 0x3a,
+ 0x74, 0x72, 0x75, 0x65, 0x2c, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3a, 0x66, 0x61, 0x6c, 0x73,
+ 0x65, 0x2c, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x7b, 0x74, 0x6f, 0x70, 0x3a, 0x2e,
+ 0x30, 0x31, 0x2c, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x2e, 0x30, 0x31, 0x2c, 0x62, 0x6f, 0x74,
+ 0x74, 0x6f, 0x6d, 0x3a, 0x2e, 0x30, 0x31, 0x2c, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x2e, 0x30, 0x31,
+ 0x7d, 0x2c, 0x64, 0x6f, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x34, 0x7d, 0x29, 0x7d, 0x2c, 0x69,
+ 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x2c, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b,
+ 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x2c, 0x72, 0x65,
+ 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72,
+ 0x67, 0x73, 0x29, 0x7b, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x7c, 0x7c, 0x7b,
+ 0x7d, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x7c, 0x7c, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x76, 0x69, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x7c, 0x7c, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x2e, 0x76, 0x69, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x74, 0x53,
+ 0x69, 0x7a, 0x65, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x6f, 0x74, 0x53, 0x69, 0x7a, 0x65,
+ 0x3b, 0x76, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22,
+ 0x2a, 0x22, 0x29, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x3b, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73,
+ 0x3d, 0x76, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22,
+ 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x79, 0x21, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x29, 0x29,
+ 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28,
+ 0x22, 0x73, 0x76, 0x67, 0x3a, 0x63, 0x69, 0x72, 0x63, 0x6c, 0x65, 0x22, 0x29, 0x2e, 0x61, 0x74,
+ 0x74, 0x72, 0x28, 0x22, 0x63, 0x78, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x78, 0x28, 0x64, 0x2e, 0x78, 0x29, 0x7d, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22,
+ 0x63, 0x79, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79, 0x28, 0x64,
+ 0x2e, 0x79, 0x29, 0x7d, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x72, 0x22, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x22, 0x72, 0x22, 0x69, 0x6e, 0x20, 0x64, 0x3f, 0x64, 0x2e, 0x72, 0x3a, 0x64, 0x6f, 0x74,
+ 0x53, 0x69, 0x7a, 0x65, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x29, 0x7b, 0x6e, 0x6f, 0x64, 0x65,
+ 0x73, 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x65, 0x64, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x4e, 0x61, 0x6d, 0x65, 0x2c, 0x74, 0x72, 0x75, 0x65, 0x29,
+ 0x7d, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65,
+ 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6e, 0x6f,
+ 0x64, 0x65, 0x73, 0x5b, 0x30, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x6e, 0x29, 0x7b, 0x6e, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74,
+ 0x65, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x22, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d,
+ 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x4d,
+ 0x75, 0x6c, 0x74, 0x69, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x4d,
+ 0x75, 0x6c, 0x74, 0x69, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c,
+ 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72,
+ 0x65, 0x72, 0x2c, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x22,
+ 0x2c, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x2c, 0x61, 0x72, 0x67, 0x73,
+ 0x29, 0x7b, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x2c,
+ 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64,
+ 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x29, 0x2c, 0x7b, 0x75, 0x6e, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x66, 0x69, 0x6c, 0x6c, 0x3a, 0x66, 0x61, 0x6c,
+ 0x73, 0x65, 0x2c, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x7d, 0x29,
+ 0x7d, 0x2c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x2c, 0x61, 0x72, 0x67, 0x73,
+ 0x29, 0x7b, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3d, 0x61, 0x72, 0x67, 0x73,
+ 0x3b, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7d, 0x2c, 0x64,
+ 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24,
+ 0x73, 0x75, 0x70, 0x65, 0x72, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x3d, 0x5b, 0x5d, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x67, 0x72,
+ 0x6f, 0x75, 0x70, 0x73, 0x28, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x28, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x29, 0x3b, 0x67, 0x72, 0x6f, 0x75, 0x70,
+ 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61,
+ 0x74, 0x61, 0x3d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61,
+ 0x62, 0x6c, 0x65, 0x64, 0x7d, 0x29, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x2e,
+ 0x73, 0x74, 0x61, 0x63, 0x6b, 0x7d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x21, 0x64, 0x61, 0x74, 0x61,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x3b, 0x69,
+ 0x66, 0x28, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72,
+ 0x26, 0x26, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72,
+ 0x2e, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x29, 0x7b, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d,
+ 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x64,
+ 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65,
+ 0x7b, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3d, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x64,
+ 0x61, 0x74, 0x61, 0x29, 0x7d, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x2e, 0x70, 0x75, 0x73,
+ 0x68, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x29, 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x78, 0x4d, 0x69, 0x6e, 0x3d, 0x64, 0x33, 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x64, 0x6f, 0x6d, 0x61,
+ 0x69, 0x6e, 0x73, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x78, 0x5b, 0x30,
+ 0x5d, 0x7d, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x78, 0x4d, 0x61, 0x78, 0x3d, 0x64, 0x33,
+ 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x2e, 0x6d, 0x61, 0x70,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x78, 0x5b, 0x31, 0x5d, 0x7d, 0x29, 0x29, 0x3b, 0x76, 0x61,
+ 0x72, 0x20, 0x79, 0x4d, 0x69, 0x6e, 0x3d, 0x64, 0x33, 0x2e, 0x6d, 0x69, 0x6e, 0x28, 0x64, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x79,
+ 0x5b, 0x30, 0x5d, 0x7d, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x79, 0x4d, 0x61, 0x78, 0x3d,
+ 0x64, 0x33, 0x2e, 0x6d, 0x61, 0x78, 0x28, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x2e, 0x6d,
+ 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x79, 0x5b, 0x31, 0x5d, 0x7d, 0x29, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x7b, 0x78, 0x3a, 0x5b, 0x78, 0x4d, 0x69, 0x6e, 0x2c, 0x78,
+ 0x4d, 0x61, 0x78, 0x5d, 0x2c, 0x79, 0x3a, 0x5b, 0x79, 0x4d, 0x69, 0x6e, 0x2c, 0x79, 0x4d, 0x61,
+ 0x78, 0x5d, 0x7d, 0x7d, 0x2c, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72,
+ 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3d, 0x7b, 0x7d,
+ 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f,
+ 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x3b, 0x69, 0x66, 0x28, 0x21, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,
+ 0x73, 0x5b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65,
+ 0x72, 0x5d, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x73, 0x3d, 0x22, 0x68, 0x74, 0x74, 0x70,
+ 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x77, 0x33, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x32, 0x30,
+ 0x30, 0x30, 0x2f, 0x73, 0x76, 0x67, 0x22, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x76, 0x69, 0x73, 0x3d,
+ 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45,
+ 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x4e, 0x53, 0x28, 0x6e, 0x73, 0x2c, 0x22, 0x67, 0x22, 0x29,
+ 0x3b, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x76, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x5b, 0x30, 0x5d,
+ 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x28, 0x76, 0x69, 0x73,
+ 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3d, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x5f, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x73, 0x5b,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5d,
+ 0x3b, 0x76, 0x61, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3d, 0x7b, 0x7d, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3d, 0x5b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x28, 0x29, 0x2c, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x28, 0x29,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x5d, 0x3b, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74,
+ 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x65,
+ 0x78, 0x74, 0x65, 0x6e, 0x64, 0x28, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2c, 0x64, 0x29, 0x7d,
+ 0x29, 0x3b, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69,
+ 0x67, 0x75, 0x72, 0x65, 0x28, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x29, 0x3b, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5d, 0x3d, 0x7b, 0x72, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x65, 0x72, 0x3a, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2c, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x3a, 0x5b, 0x5d, 0x2c, 0x76, 0x69, 0x73, 0x3a, 0x64, 0x33, 0x2e, 0x73,
+ 0x65, 0x6c, 0x65, 0x63, 0x74, 0x28, 0x76, 0x69, 0x73, 0x29, 0x7d, 0x7d, 0x72, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e,
+ 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x5d, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7d, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3d,
+ 0x5b, 0x5d, 0x3b, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x28, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x29, 0x2e, 0x66, 0x6f, 0x72,
+ 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6b, 0x65,
+ 0x79, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x3d, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5b, 0x6b, 0x65, 0x79, 0x5d, 0x3b, 0x67,
+ 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x67, 0x72, 0x6f, 0x75, 0x70,
+ 0x29, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x6f, 0x75, 0x70,
+ 0x73, 0x7d, 0x2c, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x29, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70,
+ 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x3d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x21, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64,
+ 0x7d, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x7d, 0x29, 0x3b, 0x69, 0x66,
+ 0x28, 0x21, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72,
+ 0x2e, 0x75, 0x6e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x61,
+ 0x79, 0x6f, 0x75, 0x74, 0x3d, 0x64, 0x33, 0x2e, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x2e, 0x73,
+ 0x74, 0x61, 0x63, 0x6b, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x74, 0x61, 0x63, 0x6b,
+ 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x6c, 0x61, 0x79, 0x6f, 0x75, 0x74, 0x28, 0x64, 0x61, 0x74,
+ 0x61, 0x29, 0x29, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61,
+ 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x2c, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x7b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x63, 0x6c, 0x6f, 0x6e, 0x65, 0x28, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x44, 0x61,
+ 0x74, 0x61, 0x5b, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5d, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x2c, 0x74,
+ 0x68, 0x69, 0x73, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x6f, 0x75,
+ 0x70, 0x73, 0x7d, 0x2c, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x21, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x72, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x65, 0x72, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x6e, 0x65, 0x77, 0x20,
+ 0x45, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x45, 0x61, 0x63, 0x68, 0x20, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x73, 0x20, 0x61, 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65,
+ 0x72, 0x65, 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x27, 0x6d,
+ 0x75, 0x6c, 0x74, 0x69, 0x27, 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x22, 0x29,
+ 0x7d, 0x7d, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x76,
+ 0x69, 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2a, 0x22,
+ 0x29, 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x67,
+ 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x67, 0x72, 0x6f, 0x75,
+ 0x70, 0x73, 0x28, 0x29, 0x3b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x3d, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x28, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x29, 0x3b,
+ 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x29, 0x7b, 0x76,
+ 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x21, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73,
+ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x7d, 0x29, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x61,
+ 0x63, 0x74, 0x69, 0x76, 0x65, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x7d, 0x3b,
+ 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x72,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x7b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2c, 0x76, 0x69, 0x73, 0x3a, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x76,
+ 0x69, 0x73, 0x7d, 0x29, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45,
+ 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b,
+ 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3d, 0x73, 0x2e, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b,
+ 0x7c, 0x7c, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x7c, 0x7c, 0x73, 0x2e, 0x64, 0x61, 0x74,
+ 0x61, 0x7d, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63,
+ 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64,
+ 0x65, 0x72, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x50, 0x6c, 0x6f, 0x74, 0x22, 0x29, 0x3b,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52,
+ 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x6e, 0x65, 0x50, 0x6c, 0x6f, 0x74,
+ 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e,
+ 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e,
+ 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x52, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x2c, 0x7b,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x6c, 0x69, 0x6e, 0x65, 0x70, 0x6c, 0x6f, 0x74, 0x22, 0x2c,
+ 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64,
+ 0x28, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72, 0x28, 0x29, 0x2c, 0x7b, 0x75, 0x6e, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x66, 0x69, 0x6c, 0x6c, 0x3a, 0x66, 0x61, 0x6c,
+ 0x73, 0x65, 0x2c, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x70,
+ 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x7b, 0x74, 0x6f, 0x70, 0x3a, 0x2e, 0x30, 0x31, 0x2c,
+ 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x2e, 0x30, 0x31, 0x2c, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d,
+ 0x3a, 0x2e, 0x30, 0x31, 0x2c, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x2e, 0x30, 0x31, 0x7d, 0x2c, 0x64,
+ 0x6f, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x33, 0x2c, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x57,
+ 0x69, 0x64, 0x74, 0x68, 0x3a, 0x32, 0x7d, 0x29, 0x7d, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x50, 0x61, 0x74, 0x68, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x3d, 0x64, 0x33, 0x2e, 0x73, 0x76, 0x67, 0x2e, 0x6c,
+ 0x69, 0x6e, 0x65, 0x28, 0x29, 0x2e, 0x78, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x78, 0x28, 0x64, 0x2e, 0x78, 0x29, 0x7d, 0x29, 0x2e, 0x79, 0x28, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79, 0x28, 0x64, 0x2e, 0x79, 0x29, 0x7d, 0x29, 0x2e, 0x69, 0x6e,
+ 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x69,
+ 0x6f, 0x6e, 0x29, 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x29, 0x3b, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72,
+ 0x79, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x26, 0x26, 0x66, 0x61, 0x63, 0x74, 0x6f,
+ 0x72, 0x79, 0x2e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e,
+ 0x79, 0x21, 0x3d, 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x7d, 0x2c, 0x72, 0x65, 0x6e, 0x64, 0x65,
+ 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29,
+ 0x7b, 0x61, 0x72, 0x67, 0x73, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x76,
+ 0x61, 0x72, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72,
+ 0x61, 0x70, 0x68, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x61,
+ 0x72, 0x67, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x7c, 0x7c, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x76, 0x69, 0x73,
+ 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x76, 0x69, 0x73, 0x7c, 0x7c, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x76, 0x69, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x6f, 0x74, 0x53, 0x69, 0x7a, 0x65,
+ 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x6f, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3b, 0x76, 0x69,
+ 0x73, 0x2e, 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x2a, 0x22, 0x29,
+ 0x2e, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x28, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61,
+ 0x74, 0x61, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29, 0x7b, 0x72, 0x65, 0x74,
+ 0x75, 0x72, 0x6e, 0x21, 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x7d, 0x29,
+ 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x29,
+ 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x7d,
+ 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x3d, 0x76, 0x69, 0x73, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x70, 0x61, 0x74, 0x68, 0x22,
+ 0x29, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x2e, 0x65, 0x6e, 0x74,
+ 0x65, 0x72, 0x28, 0x29, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76, 0x67,
+ 0x3a, 0x70, 0x61, 0x74, 0x68, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x64, 0x22,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x50, 0x61, 0x74, 0x68,
+ 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x28, 0x29, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x69,
+ 0x3d, 0x30, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63,
+ 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x64, 0x69, 0x73,
+ 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x73, 0x65, 0x72,
+ 0x69, 0x65, 0x73, 0x2e, 0x70, 0x61, 0x74, 0x68, 0x3d, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x5b, 0x30,
+ 0x5d, 0x5b, 0x69, 0x2b, 0x2b, 0x5d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x5f, 0x73, 0x74, 0x79,
+ 0x6c, 0x65, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29,
+ 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3b, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66,
+ 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x3d, 0x76, 0x69, 0x73, 0x2e,
+ 0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x41, 0x6c, 0x6c, 0x28, 0x22, 0x78, 0x22, 0x29, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b,
+ 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x79, 0x21, 0x3d,
+ 0x3d, 0x6e, 0x75, 0x6c, 0x6c, 0x7d, 0x29, 0x29, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x29,
+ 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x22, 0x73, 0x76, 0x67, 0x3a, 0x63, 0x69, 0x72,
+ 0x63, 0x6c, 0x65, 0x22, 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x78, 0x22, 0x2c,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x78, 0x28, 0x64, 0x2e, 0x78, 0x29, 0x7d,
+ 0x29, 0x2e, 0x61, 0x74, 0x74, 0x72, 0x28, 0x22, 0x63, 0x79, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x2e, 0x79, 0x28, 0x64, 0x2e, 0x79, 0x29, 0x7d, 0x29, 0x2e, 0x61, 0x74,
+ 0x74, 0x72, 0x28, 0x22, 0x72, 0x22, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x22, 0x72, 0x22, 0x69, 0x6e, 0x20, 0x64,
+ 0x3f, 0x64, 0x2e, 0x72, 0x3a, 0x64, 0x6f, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x7d, 0x29, 0x3b, 0x41,
+ 0x72, 0x72, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x66,
+ 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x2e, 0x63, 0x61, 0x6c, 0x6c, 0x28, 0x6e, 0x6f, 0x64, 0x65,
+ 0x73, 0x5b, 0x30, 0x5d, 0x2c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x21, 0x6e, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x6e, 0x2e,
+ 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x64, 0x61,
+ 0x74, 0x61, 0x2d, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x22, 0x2c, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x29, 0x3b, 0x6e, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74,
+ 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x66, 0x69, 0x6c, 0x6c, 0x22, 0x2c, 0x22, 0x77,
+ 0x68, 0x69, 0x74, 0x65, 0x22, 0x29, 0x3b, 0x6e, 0x2e, 0x73, 0x65, 0x74, 0x41, 0x74, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x22, 0x2c, 0x73,
+ 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x29, 0x3b, 0x6e, 0x2e, 0x73,
+ 0x65, 0x74, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x22, 0x73, 0x74, 0x72,
+ 0x6f, 0x6b, 0x65, 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x22, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x73, 0x74, 0x72, 0x6f, 0x6b, 0x65, 0x57, 0x69, 0x64, 0x74, 0x68, 0x29, 0x7d, 0x2e, 0x62, 0x69,
+ 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29,
+ 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d,
+ 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x53, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x22,
+ 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x53, 0x6d, 0x6f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28,
+ 0x7b, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x72, 0x67, 0x73, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x67, 0x72, 0x61, 0x70, 0x68, 0x3d, 0x61, 0x72, 0x67, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x61, 0x72,
+ 0x67, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x61, 0x6c, 0x65,
+ 0x3d, 0x31, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x28, 0x29, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x74, 0x61, 0x63, 0x6b,
+ 0x44, 0x61, 0x74, 0x61, 0x2e, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x22, 0x73, 0x6d, 0x6f, 0x6f,
+ 0x74, 0x68, 0x65, 0x72, 0x22, 0x2c, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x6f, 0x73, 0x69, 0x74,
+ 0x69, 0x6f, 0x6e, 0x3a, 0x35, 0x30, 0x2c, 0x66, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x72,
+ 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d, 0x65, 0x72, 0x2e, 0x62, 0x69, 0x6e, 0x64, 0x28, 0x74,
+ 0x68, 0x69, 0x73, 0x29, 0x7d, 0x29, 0x7d, 0x2c, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x6c,
+ 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x24, 0x3d, 0x6a, 0x51, 0x75,
+ 0x65, 0x72, 0x79, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x29, 0x7b, 0x24, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x29, 0x7b, 0x24, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74,
+ 0x29, 0x2e, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x72, 0x28, 0x7b, 0x6d, 0x69, 0x6e, 0x3a, 0x31, 0x2c,
+ 0x6d, 0x61, 0x78, 0x3a, 0x31, 0x30, 0x30, 0x2c, 0x73, 0x6c, 0x69, 0x64, 0x65, 0x3a, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x2c, 0x75, 0x69, 0x29,
+ 0x7b, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x65, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x75,
+ 0x69, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x29, 0x7d, 0x7d, 0x29, 0x7d, 0x29, 0x7d, 0x7d, 0x2c,
+ 0x73, 0x65, 0x74, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x73, 0x63, 0x61, 0x6c,
+ 0x65, 0x3c, 0x31, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x22, 0x73, 0x63, 0x61, 0x6c, 0x65,
+ 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x3a, 0x20, 0x22,
+ 0x2b, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x67, 0x72,
+ 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x73, 0x63, 0x61,
+ 0x6c, 0x65, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x75, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x7d, 0x2c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72,
+ 0x6d, 0x65, 0x72, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74,
+ 0x61, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x67, 0x72, 0x65,
+ 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x3d, 0x3d, 0x31, 0x29, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x61,
+ 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x5b, 0x5d,
+ 0x3b, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74,
+ 0x61, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65,
+ 0x64, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x3d, 0x5b, 0x5d, 0x3b, 0x77,
+ 0x68, 0x69, 0x6c, 0x65, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x61, 0x76, 0x67, 0x58,
+ 0x3d, 0x30, 0x2c, 0x61, 0x76, 0x67, 0x59, 0x3d, 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x6c,
+ 0x69, 0x63, 0x65, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x73,
+ 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x30, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x67, 0x67,
+ 0x72, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x29, 0x3b, 0x73,
+ 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x61, 0x76, 0x67, 0x58, 0x2b, 0x3d, 0x64,
+ 0x2e, 0x78, 0x2f, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b,
+ 0x61, 0x76, 0x67, 0x59, 0x2b, 0x3d, 0x64, 0x2e, 0x79, 0x2f, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7d, 0x29, 0x3b, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61,
+ 0x74, 0x65, 0x64, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x75,
+ 0x73, 0x68, 0x28, 0x7b, 0x78, 0x3a, 0x61, 0x76, 0x67, 0x58, 0x2c, 0x79, 0x3a, 0x61, 0x76, 0x67,
+ 0x59, 0x7d, 0x29, 0x7d, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61,
+ 0x74, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74,
+ 0x65, 0x64, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x44, 0x61, 0x74, 0x61, 0x29, 0x7d, 0x2e, 0x62,
+ 0x69, 0x6e, 0x64, 0x28, 0x74, 0x68, 0x69, 0x73, 0x29, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61,
+ 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e, 0x61, 0x6d,
+ 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x69, 0x6f, 0x22,
+ 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68,
+ 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x69, 0x6f, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28,
+ 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41,
+ 0x6a, 0x61, 0x78, 0x2c, 0x7b, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x73, 0x6f, 0x63, 0x6b,
+ 0x65, 0x74, 0x3d, 0x69, 0x6f, 0x2e, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x28, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x55, 0x52, 0x4c, 0x29, 0x3b, 0x76, 0x61, 0x72, 0x20,
+ 0x73, 0x65, 0x6c, 0x66, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x3b, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74,
+ 0x2e, 0x6f, 0x6e, 0x28, 0x22, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x22, 0x2c, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x7b, 0x73, 0x65,
+ 0x6c, 0x66, 0x2e, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29,
+ 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e,
+ 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3d, 0x52, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x65, 0x28, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2c, 0x7b, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c,
+ 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74,
+ 0x61, 0x2c, 0x70, 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x2c, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
+ 0x73, 0x29, 0x7b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3d, 0x6f, 0x70, 0x74, 0x69, 0x6f,
+ 0x6e, 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x6c, 0x65,
+ 0x74, 0x74, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x50, 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x28, 0x70,
+ 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d,
+ 0x65, 0x42, 0x61, 0x73, 0x65, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73, 0x65, 0x3d, 0x3d, 0x3d,
+ 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x3f, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x28, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65,
+ 0x29, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x29,
+ 0x3a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73,
+ 0x65, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76,
+ 0x61, 0x6c, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
+ 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3d, 0x3d,
+ 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x3f, 0x31, 0x65, 0x33, 0x3a,
+ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65,
+ 0x72, 0x76, 0x61, 0x6c, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d,
+ 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x28, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e,
+ 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x64, 0x61, 0x74, 0x61, 0x26,
+ 0x26, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x3d, 0x22, 0x6f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x26, 0x26, 0x41, 0x72, 0x72, 0x61, 0x79, 0x2e, 0x69, 0x73,
+ 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x29, 0x7b, 0x64, 0x61, 0x74,
+ 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x61, 0x64,
+ 0x64, 0x49, 0x74, 0x65, 0x6d, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7d, 0x2c, 0x74, 0x68, 0x69,
+ 0x73, 0x29, 0x7d, 0x7d, 0x2c, 0x61, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x74,
+ 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x3d, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x29, 0x7b, 0x74,
+ 0x68, 0x72, 0x6f, 0x77, 0x22, 0x61, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x28, 0x29, 0x20, 0x6e,
+ 0x65, 0x65, 0x64, 0x73, 0x20, 0x61, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x7d, 0x69, 0x74, 0x65,
+ 0x6d, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x63, 0x6f, 0x6c,
+ 0x6f, 0x72, 0x7c, 0x7c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65,
+ 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x29, 0x3b, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x69, 0x74, 0x65, 0x6d,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x7c, 0x7c, 0x5b, 0x5d, 0x3b, 0x69, 0x66, 0x28, 0x69, 0x74, 0x65,
+ 0x6d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3d, 0x3d, 0x3d,
+ 0x30, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x26, 0x26,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x28, 0x29, 0x3e,
+ 0x30, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e,
+ 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x70, 0x6c, 0x6f, 0x74, 0x29, 0x7b, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x64, 0x61, 0x74, 0x61,
+ 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x78, 0x3a, 0x70, 0x6c, 0x6f, 0x74, 0x2e, 0x78, 0x2c,
+ 0x79, 0x3a, 0x30, 0x7d, 0x29, 0x7d, 0x29, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x69, 0x66, 0x28,
+ 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3d, 0x3d, 0x3d, 0x30, 0x29, 0x7b, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e,
+ 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x78, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d,
+ 0x65, 0x42, 0x61, 0x73, 0x65, 0x2d, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65,
+ 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x7c, 0x7c, 0x30, 0x29, 0x2c, 0x79, 0x3a, 0x30,
+ 0x7d, 0x29, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x69, 0x74, 0x65,
+ 0x6d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e,
+ 0x64, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x61,
+ 0x64, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x74, 0x65, 0x6d,
+ 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x29, 0x29, 0x7d, 0x7d, 0x2c, 0x61, 0x64, 0x64, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x78, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x67, 0x65, 0x74,
+ 0x49, 0x6e, 0x64, 0x65, 0x78, 0x28, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x2e, 0x66, 0x6f, 0x72, 0x45,
+ 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x61, 0x6d,
+ 0x65, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x21, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x74, 0x65, 0x6d,
+ 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x29, 0x7b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x28, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3a, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x29, 0x7d, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7b, 0x69, 0x74, 0x65, 0x6d,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x78, 0x3a, 0x78, 0x7c,
+ 0x7c, 0x28, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d,
+ 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x7c, 0x7c, 0x31, 0x29, 0x2b, 0x74, 0x68,
+ 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73, 0x65, 0x2c, 0x79, 0x3a, 0x64, 0x61,
+ 0x74, 0x61, 0x5b, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x5d, 0x7c, 0x7c, 0x30,
+ 0x7d, 0x29, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x2c, 0x67, 0x65, 0x74, 0x49, 0x6e,
+ 0x64, 0x65, 0x78, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x26, 0x26, 0x74,
+ 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x26, 0x26, 0x74, 0x68, 0x69,
+ 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3f, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x30, 0x7d, 0x2c, 0x69, 0x74, 0x65, 0x6d, 0x42, 0x79, 0x4e, 0x61,
+ 0x6d, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x6e, 0x61, 0x6d, 0x65,
+ 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d, 0x30, 0x3b, 0x69, 0x3c,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3b, 0x69, 0x2b, 0x2b, 0x29,
+ 0x7b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x69, 0x5d, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3d, 0x3d, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68,
+ 0x69, 0x73, 0x5b, 0x69, 0x5d, 0x7d, 0x7d, 0x2c, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x49,
+ 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x69, 0x76, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e,
+ 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3d, 0x69, 0x76, 0x2f, 0x31, 0x65, 0x33, 0x7d, 0x2c, 0x73,
+ 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65,
+ 0x42, 0x61, 0x73, 0x65, 0x3d, 0x74, 0x7d, 0x2c, 0x64, 0x75, 0x6d, 0x70, 0x3a, 0x66, 0x75, 0x6e,
+ 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61,
+ 0x3d, 0x7b, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73, 0x65, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73, 0x65, 0x2c, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74,
+ 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x49,
+ 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x2c, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x3a, 0x5b, 0x5d,
+ 0x7d, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7b, 0x76, 0x61,
+ 0x72, 0x20, 0x6e, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x3d, 0x7b, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
+ 0x3a, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x6e, 0x61, 0x6d, 0x65,
+ 0x3a, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x3a,
+ 0x5b, 0x5d, 0x7d, 0x3b, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x66, 0x6f,
+ 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x70,
+ 0x6c, 0x6f, 0x74, 0x29, 0x7b, 0x6e, 0x65, 0x77, 0x49, 0x74, 0x65, 0x6d, 0x2e, 0x64, 0x61, 0x74,
+ 0x61, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x7b, 0x78, 0x3a, 0x70, 0x6c, 0x6f, 0x74, 0x2e, 0x78,
+ 0x2c, 0x79, 0x3a, 0x70, 0x6c, 0x6f, 0x74, 0x2e, 0x79, 0x7d, 0x29, 0x7d, 0x29, 0x3b, 0x64, 0x61,
+ 0x74, 0x61, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x6e, 0x65,
+ 0x77, 0x49, 0x74, 0x65, 0x6d, 0x29, 0x7d, 0x29, 0x3b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x64, 0x61, 0x74, 0x61, 0x7d, 0x2c, 0x6c, 0x6f, 0x61, 0x64, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x7b, 0x69, 0x66, 0x28, 0x64, 0x61, 0x74,
+ 0x61, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61,
+ 0x6c, 0x3d, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72,
+ 0x76, 0x61, 0x6c, 0x7d, 0x69, 0x66, 0x28, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x74, 0x69, 0x6d, 0x65,
+ 0x42, 0x61, 0x73, 0x65, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x42,
+ 0x61, 0x73, 0x65, 0x3d, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73,
+ 0x65, 0x7d, 0x69, 0x66, 0x28, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x29,
+ 0x7b, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45,
+ 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x69, 0x74, 0x65,
+ 0x6d, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x28, 0x69, 0x74, 0x65,
+ 0x6d, 0x29, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e,
+ 0x64, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x2e, 0x61,
+ 0x64, 0x64, 0x4c, 0x69, 0x6e, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x69, 0x74, 0x65, 0x6d,
+ 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x6e, 0x61, 0x6d, 0x65,
+ 0x29, 0x29, 0x7d, 0x7d, 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x7d, 0x7d, 0x29, 0x3b, 0x52,
+ 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x7a,
+ 0x65, 0x72, 0x6f, 0x46, 0x69, 0x6c, 0x6c, 0x3d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x29, 0x7b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x6c, 0x28, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2c, 0x30, 0x29, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x66, 0x69, 0x6c, 0x6c, 0x3d, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x66, 0x69,
+ 0x6c, 0x6c, 0x29, 0x7b, 0x76, 0x61, 0x72, 0x20, 0x78, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x69, 0x3d,
+ 0x30, 0x3b, 0x76, 0x61, 0x72, 0x20, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x73, 0x65, 0x72, 0x69, 0x65,
+ 0x73, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x73,
+ 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x7d,
+ 0x29, 0x3b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x69, 0x3c, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d,
+ 0x61, 0x78, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x64, 0x61,
+ 0x74, 0x61, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x2e, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x7d, 0x29, 0x29, 0x29, 0x7b, 0x78, 0x3d, 0x4d, 0x61, 0x74, 0x68, 0x2e, 0x6d, 0x69,
+ 0x6e, 0x2e, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x28, 0x6e, 0x75, 0x6c, 0x6c, 0x2c, 0x64, 0x61, 0x74,
+ 0x61, 0x2e, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x5b, 0x69, 0x5d,
+ 0x7d, 0x29, 0x2e, 0x6d, 0x61, 0x70, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x64, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x5b, 0x69, 0x5d, 0x2e, 0x78,
+ 0x7d, 0x29, 0x29, 0x3b, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68,
+ 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x29, 0x7b, 0x69, 0x66, 0x28,
+ 0x21, 0x64, 0x5b, 0x69, 0x5d, 0x7c, 0x7c, 0x64, 0x5b, 0x69, 0x5d, 0x2e, 0x78, 0x21, 0x3d, 0x78,
+ 0x29, 0x7b, 0x64, 0x2e, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x28, 0x69, 0x2c, 0x30, 0x2c, 0x7b,
+ 0x78, 0x3a, 0x78, 0x2c, 0x79, 0x3a, 0x66, 0x69, 0x6c, 0x6c, 0x7d, 0x29, 0x7d, 0x7d, 0x29, 0x3b,
+ 0x69, 0x2b, 0x2b, 0x7d, 0x7d, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x6e,
+ 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x22, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x3b, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3d, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x28, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2c, 0x7b, 0x69,
+ 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x70, 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x2c,
+ 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x29, 0x7b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73,
+ 0x3d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x7c, 0x7c, 0x7b, 0x7d, 0x3b, 0x69, 0x66, 0x28,
+ 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74,
+ 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3d, 0x3d, 0x3d, 0x22, 0x75,
+ 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77,
+ 0x20, 0x6e, 0x65, 0x77, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x46, 0x69, 0x78, 0x65,
+ 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x73, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e,
+ 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x22, 0x29, 0x7d, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65,
+ 0x6f, 0x66, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x6d, 0x61, 0x78, 0x44, 0x61,
+ 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x3d, 0x3d, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65,
+ 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x29, 0x7b, 0x74, 0x68, 0x72, 0x6f, 0x77, 0x20, 0x6e, 0x65,
+ 0x77, 0x20, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44, 0x75,
+ 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x20, 0x72, 0x65,
+ 0x71, 0x75, 0x69, 0x72, 0x65, 0x73, 0x20, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f,
+ 0x69, 0x6e, 0x74, 0x73, 0x22, 0x29, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x70, 0x61, 0x6c, 0x65,
+ 0x74, 0x74, 0x65, 0x3d, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77,
+ 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x50, 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x28, 0x70,
+ 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d,
+ 0x65, 0x42, 0x61, 0x73, 0x65, 0x3d, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x6f, 0x70, 0x74,
+ 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73, 0x65, 0x3d, 0x3d, 0x3d,
+ 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x22, 0x3f, 0x4d, 0x61, 0x74, 0x68,
+ 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x28, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65,
+ 0x29, 0x2e, 0x67, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x2f, 0x31, 0x65, 0x33, 0x29,
+ 0x3a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73,
+ 0x65, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x49, 0x6e,
+ 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x28, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x74,
+ 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x29, 0x3b, 0x69, 0x66, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d,
+ 0x2e, 0x64, 0x61, 0x74, 0x61, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x64,
+ 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3d, 0x74, 0x68, 0x69,
+ 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68,
+ 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64,
+ 0x65, 0x78, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x5b, 0x30, 0x5d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x7d, 0x65, 0x6c, 0x73, 0x65, 0x7b, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3d, 0x30, 0x3b, 0x74,
+ 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78,
+ 0x3d, 0x30, 0x7d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x61, 0x50,
+ 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x3d, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x6d, 0x61,
+ 0x78, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x3b, 0x69, 0x66, 0x28, 0x64,
+ 0x61, 0x74, 0x61, 0x26, 0x26, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66, 0x20, 0x64, 0x61, 0x74, 0x61,
+ 0x3d, 0x3d, 0x22, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x26, 0x26, 0x41, 0x72, 0x72, 0x61,
+ 0x79, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x29,
+ 0x7b, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x66, 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75,
+ 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x61, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x28, 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7d,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72,
+ 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x2b, 0x3d, 0x31, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2b, 0x3d, 0x31, 0x7d,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61, 0x73, 0x65, 0x2d, 0x3d, 0x28,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e,
+ 0x74, 0x73, 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53,
+ 0x69, 0x7a, 0x65, 0x29, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e,
+ 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x79, 0x70, 0x65, 0x6f, 0x66,
+ 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69,
+ 0x6e, 0x74, 0x73, 0x21, 0x3d, 0x3d, 0x22, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64,
+ 0x22, 0x26, 0x26, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53,
+ 0x69, 0x7a, 0x65, 0x3c, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x61,
+ 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x29, 0x7b, 0x66, 0x6f, 0x72, 0x28, 0x76, 0x61, 0x72, 0x20,
+ 0x69, 0x3d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f,
+ 0x69, 0x6e, 0x74, 0x73, 0x2d, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
+ 0x74, 0x53, 0x69, 0x7a, 0x65, 0x2d, 0x31, 0x3b, 0x69, 0x3e, 0x31, 0x3b, 0x69, 0x2d, 0x2d, 0x29,
+ 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a,
+ 0x65, 0x2b, 0x3d, 0x31, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
+ 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2b, 0x3d, 0x31, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66,
+ 0x6f, 0x72, 0x45, 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x69, 0x74, 0x65, 0x6d, 0x29, 0x7b, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e,
+ 0x75, 0x6e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x28, 0x7b, 0x78, 0x3a, 0x28, 0x28, 0x69, 0x2d, 0x31,
+ 0x29, 0x2a, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e, 0x74, 0x65, 0x72,
+ 0x76, 0x61, 0x6c, 0x7c, 0x7c, 0x31, 0x29, 0x2b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x74, 0x69, 0x6d,
+ 0x65, 0x42, 0x61, 0x73, 0x65, 0x2c, 0x79, 0x3a, 0x30, 0x2c, 0x69, 0x3a, 0x69, 0x7d, 0x29, 0x7d,
+ 0x2c, 0x74, 0x68, 0x69, 0x73, 0x29, 0x7d, 0x7d, 0x7d, 0x2c, 0x61, 0x64, 0x64, 0x44, 0x61, 0x74,
+ 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x24, 0x73, 0x75, 0x70, 0x65,
+ 0x72, 0x2c, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x78, 0x29, 0x7b, 0x24, 0x73, 0x75, 0x70, 0x65, 0x72,
+ 0x28, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x78, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x63, 0x75,
+ 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x2b, 0x3d, 0x31, 0x3b, 0x74, 0x68, 0x69,
+ 0x73, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x2b, 0x3d,
+ 0x31, 0x3b, 0x69, 0x66, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74,
+ 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x21, 0x3d, 0x3d, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69,
+ 0x6e, 0x65, 0x64, 0x29, 0x7b, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x28, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x3e, 0x74, 0x68, 0x69, 0x73,
+ 0x2e, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74, 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x29, 0x7b,
+ 0x74, 0x68, 0x69, 0x73, 0x2e, 0x64, 0x72, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x28, 0x29, 0x7d,
+ 0x7d, 0x7d, 0x2c, 0x64, 0x72, 0x6f, 0x70, 0x44, 0x61, 0x74, 0x61, 0x3a, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x7b, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x66, 0x6f, 0x72, 0x45,
+ 0x61, 0x63, 0x68, 0x28, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x69, 0x74, 0x65,
+ 0x6d, 0x29, 0x7b, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x73, 0x70, 0x6c,
+ 0x69, 0x63, 0x65, 0x28, 0x30, 0x2c, 0x31, 0x29, 0x7d, 0x29, 0x3b, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x2d, 0x3d, 0x31, 0x7d, 0x2c,
+ 0x67, 0x65, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x29, 0x7b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e,
+ 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x7d, 0x7d, 0x29, 0x3b,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x7d,
+ 0x29, 0x3b,
+
+};
+static const unsigned char glegend_cssData[] = {
+ 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64,
+ 0x20, 0x7b, 0x0a, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a,
+ 0x20, 0x41, 0x72, 0x69, 0x61, 0x6c, 0x3b, 0x0a, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x73, 0x69,
+ 0x7a, 0x65, 0x3a, 0x20, 0x31, 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x63, 0x6f, 0x6c, 0x6f, 0x72,
+ 0x3a, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72,
+ 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x23, 0x34, 0x30, 0x34, 0x30, 0x34, 0x30, 0x3b, 0x0a, 0x09,
+ 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x2d,
+ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x09, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a,
+ 0x20, 0x31, 0x32, 0x70, 0x78, 0x20, 0x35, 0x70, 0x78, 0x3b, 0x20, 0x0a, 0x09, 0x62, 0x6f, 0x72,
+ 0x64, 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x32, 0x70, 0x78, 0x3b,
+ 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x72, 0x65, 0x6c, 0x61,
+ 0x74, 0x69, 0x76, 0x65, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61,
+ 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x3a, 0x68, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x7b,
+ 0x0a, 0x09, 0x7a, 0x2d, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x20, 0x31, 0x30, 0x3b, 0x0a, 0x7d,
+ 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e,
+ 0x64, 0x20, 0x2e, 0x73, 0x77, 0x61, 0x74, 0x63, 0x68, 0x20, 0x7b, 0x0a, 0x09, 0x77, 0x69, 0x64,
+ 0x74, 0x68, 0x3a, 0x20, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x68, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x3a, 0x20, 0x31, 0x30, 0x70, 0x78, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72,
+ 0x3a, 0x20, 0x31, 0x70, 0x78, 0x20, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x20, 0x72, 0x67, 0x62, 0x61,
+ 0x28, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x29, 0x3b, 0x0a,
+ 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65,
+ 0x6e, 0x64, 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x7b, 0x0a, 0x09, 0x63, 0x6c, 0x65, 0x61,
+ 0x72, 0x3a, 0x20, 0x62, 0x6f, 0x74, 0x68, 0x3b, 0x0a, 0x09, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x68,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x34, 0x30, 0x25, 0x3b, 0x0a, 0x09, 0x70, 0x61,
+ 0x64, 0x64, 0x69, 0x6e, 0x67, 0x2d, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x31, 0x35, 0x70,
+ 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x6c,
+ 0x65, 0x67, 0x65, 0x6e, 0x64, 0x20, 0x2e, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x2e, 0x73, 0x77, 0x61,
+ 0x74, 0x63, 0x68, 0x20, 0x7b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20,
+ 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x2d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x09, 0x6d,
+ 0x61, 0x72, 0x67, 0x69, 0x6e, 0x2d, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x33, 0x70, 0x78,
+ 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73,
+ 0x3a, 0x20, 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x20, 0x2e, 0x6c, 0x61, 0x62, 0x65, 0x6c,
+ 0x20, 0x7b, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x09,
+ 0x77, 0x68, 0x69, 0x74, 0x65, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x20, 0x6e, 0x6f, 0x77,
+ 0x72, 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x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x20, 0x7b, 0x0a, 0x09, 0x6f, 0x70, 0x61, 0x63, 0x69,
+ 0x74, 0x79, 0x3a, 0x20, 0x30, 0x2e, 0x34, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b,
+ 0x73, 0x68, 0x61, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x20, 0x75, 0x6c, 0x20, 0x7b,
+ 0x0a, 0x09, 0x6c, 0x69, 0x73, 0x74, 0x2d, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x2d, 0x74, 0x79, 0x70,
+ 0x65, 0x3a, 0x20, 0x6e, 0x6f, 0x6e, 0x65, 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e,
+ 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x09, 0x70, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x3a, 0x20, 0x30,
+ 0x3b, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x67, 0x69, 0x6e, 0x3a, 0x20, 0x32, 0x70, 0x78, 0x3b, 0x0a,
+ 0x09, 0x63, 0x75, 0x72, 0x73, 0x6f, 0x72, 0x3a, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72,
+ 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x6c, 0x65,
+ 0x67, 0x65, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x20, 0x7b, 0x0a, 0x09, 0x70, 0x61, 0x64, 0x64, 0x69,
+ 0x6e, 0x67, 0x3a, 0x20, 0x30, 0x20, 0x30, 0x20, 0x30, 0x20, 0x32, 0x70, 0x78, 0x3b, 0x0a, 0x09,
+ 0x6d, 0x69, 0x6e, 0x2d, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x38, 0x30, 0x70, 0x78, 0x3b,
+ 0x0a, 0x09, 0x77, 0x68, 0x69, 0x74, 0x65, 0x2d, 0x73, 0x70, 0x61, 0x63, 0x65, 0x3a, 0x20, 0x6e,
+ 0x6f, 0x77, 0x72, 0x61, 0x70, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x5f, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x3a, 0x68, 0x6f, 0x76,
+ 0x65, 0x72, 0x20, 0x7b, 0x0a, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64,
+ 0x3a, 0x20, 0x72, 0x67, 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c,
+ 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x38, 0x29, 0x3b, 0x0a, 0x09, 0x62, 0x6f,
+ 0x72, 0x64, 0x65, 0x72, 0x2d, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x33, 0x70, 0x78,
+ 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x72, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x5f, 0x6c, 0x65,
+ 0x67, 0x65, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x3a, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x20, 0x7b,
+ 0x0a, 0x09, 0x62, 0x61, 0x63, 0x6b, 0x67, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x3a, 0x20, 0x72, 0x67,
+ 0x62, 0x61, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35,
+ 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x29, 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2d,
+ 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x3a, 0x20, 0x33, 0x70, 0x78, 0x3b, 0x0a, 0x7d, 0x0a,
+
+};
+static const unsigned char glines_cssData[] = {
+ 0x64, 0x69, 0x76, 0x2c, 0x20, 0x73, 0x70, 0x61, 0x6e, 0x2c, 0x20, 0x70, 0x2c, 0x20, 0x74, 0x64,
+ 0x20, 0x7b, 0x0a, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x2d, 0x66, 0x61, 0x6d, 0x69, 0x6c, 0x79, 0x3a,
+ 0x20, 0x41, 0x72, 0x69, 0x61, 0x6c, 0x2c, 0x20, 0x73, 0x61, 0x6e, 0x73, 0x2d, 0x73, 0x65, 0x72,
+ 0x69, 0x66, 0x3b, 0x0a, 0x7d, 0x0a, 0x23, 0x63, 0x68, 0x61, 0x72, 0x74, 0x20, 0x7b, 0x0a, 0x09,
+ 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x2d,
+ 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x7d, 0x0a, 0x23, 0x6c, 0x65, 0x67, 0x65, 0x6e, 0x64,
+ 0x20, 0x7b, 0x0a, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x3a, 0x20, 0x69, 0x6e, 0x6c,
+ 0x69, 0x6e, 0x65, 0x2d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x3b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69,
+ 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x3b, 0x0a,
+ 0x09, 0x6c, 0x65, 0x66, 0x74, 0x3a, 0x20, 0x38, 0x70, 0x78, 0x3b, 0x0a, 0x7d, 0x0a, 0x23, 0x6c,
+ 0x65, 0x67, 0x65, 0x6e, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20,
+ 0x7b, 0x0a, 0x09, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x61, 0x62, 0x73,
+ 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x3b, 0x0a, 0x09, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x30,
+ 0x3b, 0x0a, 0x09, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x3a, 0x20, 0x32, 0x36, 0x70, 0x78, 0x3b,
+ 0x0a, 0x09, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x2e, 0x63,
+ 0x68, 0x61, 0x72, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x7b,
+ 0x0a, 0x09, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x3a, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x3b, 0x0a, 0x09,
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69,
+ 0x76, 0x65, 0x3b, 0x0a, 0x7d, 0x0a,
+
+};
+static const unsigned char glocal_jsData[] = {
+ 0x22, 0x75, 0x73, 0x65, 0x20, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x22, 0x3b, 0x0a, 0x0a, 0x76,
+ 0x61, 0x72, 0x20, 0x67, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x7b, 0x7d, 0x0a, 0x0a, 0x24, 0x28, 0x64,
+ 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x29, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x79, 0x28, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x24, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x53, 0x65, 0x74, 0x75, 0x70, 0x28, 0x7b, 0x20, 0x63, 0x61,
+ 0x63, 0x68, 0x65, 0x3a, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x71, 0x70, 0x73, 0x67,
+ 0x72, 0x61, 0x70, 0x68, 0x20, 0x3d, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x28, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x6f,
+ 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e,
+ 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x22, 0x71, 0x70, 0x73, 0x63, 0x68, 0x61, 0x72, 0x74, 0x22,
+ 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x3a, 0x20, 0x34, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x32, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x65, 0x72, 0x3a, 0x20, 0x27, 0x6c,
+ 0x69, 0x6e, 0x65, 0x27, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x3a, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68,
+ 0x61, 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73, 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44,
+ 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x5b, 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a,
+ 0x20, 0x27, 0x73, 0x65, 0x72, 0x76, 0x66, 0x61, 0x69, 0x6c, 0x70, 0x73, 0x27, 0x20, 0x7d, 0x2c,
+ 0x20, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x27, 0x71, 0x70, 0x73, 0x27, 0x7d, 0x5d, 0x2c,
+ 0x20, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x2c, 0x20, 0x7b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e,
+ 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74,
+ 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61,
+ 0x73, 0x65, 0x3a, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x2e, 0x67,
+ 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x20, 0x2f, 0x20, 0x31, 0x30, 0x30, 0x30, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x7d, 0x20, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x79, 0x5f, 0x74,
+ 0x69, 0x63, 0x6b, 0x73, 0x20, 0x3d, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x59,
+ 0x28, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x3a, 0x20, 0x71, 0x70, 0x73, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2c, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3a, 0x20, 0x27, 0x6c, 0x65, 0x66, 0x74, 0x27, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x74, 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3a, 0x20, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e,
+ 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x4b, 0x4d, 0x42,
+ 0x54, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x74,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x27, 0x71, 0x70, 0x73,
+ 0x79, 0x5f, 0x61, 0x78, 0x69, 0x73, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x29,
+ 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x71, 0x70, 0x73, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76,
+ 0x61, 0x72, 0x20, 0x63, 0x70, 0x75, 0x67, 0x72, 0x61, 0x70, 0x68, 0x20, 0x3d, 0x20, 0x6e, 0x65,
+ 0x77, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68,
+ 0x28, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x65, 0x6d,
+ 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65,
+ 0x74, 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x22, 0x63, 0x70,
+ 0x75, 0x63, 0x68, 0x61, 0x72, 0x74, 0x22, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3a, 0x20, 0x34, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x32, 0x30,
+ 0x30, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65,
+ 0x72, 0x65, 0x72, 0x3a, 0x20, 0x27, 0x6c, 0x69, 0x6e, 0x65, 0x27, 0x2c, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x65, 0x72, 0x69, 0x65, 0x73, 0x3a, 0x20, 0x6e, 0x65, 0x77,
+ 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x53, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x2e, 0x46, 0x69, 0x78, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x5b,
+ 0x7b, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x27, 0x6f, 0x6e, 0x65, 0x27, 0x20, 0x7d, 0x2c,
+ 0x20, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x20, 0x27, 0x74, 0x77, 0x6f, 0x27, 0x7d, 0x5d, 0x2c,
+ 0x20, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x2c, 0x20, 0x7b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x49, 0x6e,
+ 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x44, 0x61, 0x74,
+ 0x61, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x2c, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x61,
+ 0x73, 0x65, 0x3a, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x44, 0x61, 0x74, 0x65, 0x28, 0x29, 0x2e, 0x67,
+ 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x28, 0x29, 0x20, 0x2f, 0x20, 0x31, 0x30, 0x30, 0x30, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x7d, 0x20, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x79, 0x5f, 0x74,
+ 0x69, 0x63, 0x6b, 0x73, 0x20, 0x3d, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x52, 0x69, 0x63, 0x6b, 0x73,
+ 0x68, 0x61, 0x77, 0x2e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x41, 0x78, 0x69, 0x73, 0x2e, 0x59,
+ 0x28, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x3a, 0x20, 0x63, 0x70, 0x75, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2c, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3a, 0x20, 0x27, 0x6c, 0x65, 0x66, 0x74, 0x27, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x74, 0x69, 0x63, 0x6b, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x3a, 0x20, 0x52, 0x69,
+ 0x63, 0x6b, 0x73, 0x68, 0x61, 0x77, 0x2e, 0x46, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e,
+ 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x4b, 0x4d, 0x42,
+ 0x54, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65, 0x6c, 0x65, 0x6d, 0x65,
+ 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x67, 0x65, 0x74,
+ 0x45, 0x6c, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x49, 0x64, 0x28, 0x27, 0x63, 0x70, 0x75,
+ 0x79, 0x5f, 0x61, 0x78, 0x69, 0x73, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x20, 0x29,
+ 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x63, 0x70, 0x75, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e,
+ 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61,
+ 0x72, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x3d,
+ 0x30, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x66, 0x66, 0x65,
+ 0x72, 0x73, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x3d,
+ 0x24, 0x28, 0x22, 0x23, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x31, 0x22, 0x29, 0x2e, 0x69, 0x73,
+ 0x28, 0x27, 0x3a, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x71, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,
+ 0x3d, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x74, 0x3f, 0x63, 0x6f, 0x6d, 0x6d, 0x61,
+ 0x6e, 0x64, 0x3d, 0x67, 0x65, 0x74, 0x2d, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2d, 0x72, 0x69, 0x6e,
+ 0x67, 0x26, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x27, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x66, 0x69, 0x6c, 0x74,
+ 0x65, 0x72, 0x65, 0x64, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x71, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3d, 0x71, 0x73, 0x74, 0x72, 0x69, 0x6e,
+ 0x67, 0x2b, 0x22, 0x26, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x66, 0x69, 0x6c, 0x74, 0x65,
+ 0x72, 0x65, 0x64, 0x3d, 0x31, 0x22, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x24, 0x2e, 0x67, 0x65, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x28, 0x71, 0x73, 0x74, 0x72, 0x69,
+ 0x6e, 0x67, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64,
+ 0x61, 0x74, 0x61, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x6f, 0x6e,
+ 0x73, 0x6f, 0x6c, 0x65, 0x2e, 0x6c, 0x6f, 0x67, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x3b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x22,
+ 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4e,
+ 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x44, 0x6f,
+ 0x6d, 0x61, 0x69, 0x6e, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x54, 0x79, 0x70,
+ 0x65, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x75, 0x6d, 0x3d, 0x30, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x3d, 0x30,
+ 0x2c, 0x20, 0x72, 0x65, 0x73, 0x74, 0x3d, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x24, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x65, 0x6e, 0x74,
+ 0x72, 0x69, 0x65, 0x73, 0x22, 0x5d, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x28, 0x61, 0x2c, 0x62, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2b, 0x3d, 0x62, 0x5b, 0x30, 0x5d, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6d, 0x2b,
+ 0x2b, 0x20, 0x3e, 0x20, 0x31, 0x30, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x74, 0x2b, 0x3d, 0x62, 0x5b,
+ 0x30, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x69, 0x66, 0x28, 0x62, 0x5b, 0x31, 0x5d, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x3e,
+ 0x20, 0x32, 0x35, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x62, 0x5b, 0x31, 0x5d, 0x3d, 0x62, 0x5b, 0x31, 0x5d, 0x2e, 0x73, 0x75, 0x62,
+ 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x30, 0x2c, 0x32, 0x35, 0x29, 0x3b, 0x0a, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x62, 0x6f,
+ 0x75, 0x77, 0x2b, 0x28, 0x22, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62,
+ 0x5b, 0x30, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b,
+ 0x62, 0x5b, 0x31, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22,
+ 0x2b, 0x62, 0x5b, 0x32, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72,
+ 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x3d, 0x22, 0x3c, 0x74, 0x72, 0x3e,
+ 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x72, 0x65, 0x73, 0x74, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64,
+ 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x52, 0x65, 0x73, 0x74, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f,
+ 0x74, 0x72, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77,
+ 0x3d, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x22,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x71, 0x75, 0x65, 0x72,
+ 0x79, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x28, 0x62, 0x6f, 0x75,
+ 0x77, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x3d, 0x24, 0x28, 0x22,
+ 0x23, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x32, 0x22, 0x29, 0x2e, 0x69, 0x73, 0x28, 0x27, 0x3a,
+ 0x63, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x64, 0x27, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x71, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3d, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x73,
+ 0x74, 0x61, 0x74, 0x3f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x3d, 0x67, 0x65, 0x74, 0x2d,
+ 0x71, 0x75, 0x65, 0x72, 0x79, 0x2d, 0x72, 0x69, 0x6e, 0x67, 0x26, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x73, 0x65, 0x72, 0x76, 0x66, 0x61, 0x69, 0x6c, 0x2d, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73,
+ 0x27, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x66, 0x69,
+ 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x71, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3d, 0x71, 0x73, 0x74, 0x72,
+ 0x69, 0x6e, 0x67, 0x2b, 0x22, 0x26, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x66, 0x69, 0x6c,
+ 0x74, 0x65, 0x72, 0x65, 0x64, 0x3d, 0x31, 0x22, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x24, 0x2e, 0x67, 0x65, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x28, 0x71, 0x73, 0x74,
+ 0x72, 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
+ 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x76, 0x61, 0x72, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x22, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65,
+ 0x3e, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3c,
+ 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x53, 0x65, 0x72, 0x76, 0x66, 0x61, 0x69, 0x6c,
+ 0x20, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e,
+ 0x54, 0x79, 0x70, 0x65, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x75, 0x6d, 0x3d, 0x30,
+ 0x2c, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x3d, 0x30, 0x2c, 0x20, 0x72, 0x65, 0x73, 0x74, 0x3d,
+ 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28,
+ 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x5d, 0x2c,
+ 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x20, 0x7b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c,
+ 0x2b, 0x3d, 0x62, 0x5b, 0x30, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6d, 0x2b, 0x2b, 0x20, 0x3e, 0x20, 0x31, 0x30, 0x29,
+ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x72, 0x65, 0x73, 0x74, 0x2b, 0x3d, 0x62, 0x5b, 0x30, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x62, 0x5b, 0x31, 0x5d,
+ 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x20, 0x3e, 0x20, 0x32, 0x35, 0x29, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x5b, 0x31, 0x5d,
+ 0x3d, 0x62, 0x5b, 0x31, 0x5d, 0x2e, 0x73, 0x75, 0x62, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x28,
+ 0x30, 0x2c, 0x32, 0x35, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x28, 0x22, 0x3c, 0x74, 0x72,
+ 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x30, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74,
+ 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x31, 0x5d, 0x2b, 0x22, 0x3c, 0x2f,
+ 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x32, 0x5d, 0x2b, 0x22, 0x3c,
+ 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75,
+ 0x77, 0x2b, 0x3d, 0x22, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x72, 0x65,
+ 0x73, 0x74, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x52, 0x65, 0x73,
+ 0x74, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x22, 0x3c,
+ 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x24, 0x28, 0x22, 0x23, 0x73, 0x65, 0x72, 0x76, 0x66, 0x61, 0x69, 0x6c, 0x71, 0x75, 0x65, 0x72,
+ 0x79, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x28, 0x62, 0x6f, 0x75,
+ 0x77, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x67, 0x65, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x28, 0x27, 0x6a,
+ 0x73, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x74, 0x3f, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x3d,
+ 0x67, 0x65, 0x74, 0x2d, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2d, 0x72, 0x69, 0x6e, 0x67, 0x26,
+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x73, 0x27, 0x2c, 0x20, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29,
+ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x6f, 0x75,
+ 0x77, 0x3d, 0x22, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74,
+ 0x68, 0x3e, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68,
+ 0x3e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72,
+ 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x75,
+ 0x6d, 0x3d, 0x30, 0x2c, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x3d, 0x30, 0x2c, 0x20, 0x72, 0x65,
+ 0x73, 0x74, 0x3d, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x65, 0x61,
+ 0x63, 0x68, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73,
+ 0x22, 0x5d, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62,
+ 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x6f,
+ 0x74, 0x61, 0x6c, 0x2b, 0x3d, 0x62, 0x5b, 0x30, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x6e, 0x75, 0x6d, 0x2b, 0x2b, 0x20, 0x3e, 0x20,
+ 0x31, 0x30, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x74, 0x20, 0x2b, 0x3d, 0x62, 0x5b, 0x30, 0x5d, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75,
+ 0x77, 0x3d, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x28, 0x22, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64,
+ 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x30, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74,
+ 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x31, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c,
+ 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x3d, 0x22, 0x3c,
+ 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x72, 0x65, 0x73, 0x74, 0x2b, 0x22, 0x3c,
+ 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x52, 0x65, 0x73, 0x74, 0x3c, 0x2f, 0x74, 0x64,
+ 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62,
+ 0x6f, 0x75, 0x77, 0x3d, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c,
+ 0x65, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x72,
+ 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x2e, 0x68, 0x74, 0x6d, 0x6c,
+ 0x28, 0x62, 0x6f, 0x75, 0x77, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x67, 0x65, 0x74, 0x4a, 0x53, 0x4f,
+ 0x4e, 0x28, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x74, 0x3f, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x61, 0x6e, 0x64, 0x3d, 0x67, 0x65, 0x74, 0x2d, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x2d, 0x72,
+ 0x69, 0x6e, 0x67, 0x26, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x73, 0x65, 0x72, 0x76, 0x66, 0x61, 0x69,
+ 0x6c, 0x2d, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x73, 0x27, 0x2c, 0x20, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x66,
+ 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x20, 0x7b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x22,
+ 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4e,
+ 0x75, 0x6d, 0x62, 0x65, 0x72, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x53, 0x65,
+ 0x72, 0x76, 0x66, 0x61, 0x69, 0x6c, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3c, 0x2f, 0x74,
+ 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x76, 0x61, 0x72, 0x20, 0x6e, 0x75, 0x6d, 0x3d, 0x30, 0x2c, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c,
+ 0x3d, 0x30, 0x2c, 0x20, 0x72, 0x65, 0x73, 0x74, 0x3d, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x24, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x65,
+ 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x22, 0x5d, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x2b, 0x3d, 0x62, 0x5b, 0x30, 0x5d, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x6e, 0x75,
+ 0x6d, 0x2b, 0x2b, 0x20, 0x3e, 0x20, 0x31, 0x30, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x73, 0x74, 0x20, 0x2b,
+ 0x3d, 0x20, 0x62, 0x5b, 0x30, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x28, 0x22,
+ 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x30, 0x5d, 0x2b, 0x22,
+ 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x31, 0x5d, 0x2b,
+ 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62,
+ 0x6f, 0x75, 0x77, 0x2b, 0x3d, 0x22, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b,
+ 0x72, 0x65, 0x73, 0x74, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x52,
+ 0x65, 0x73, 0x74, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x3b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x62, 0x6f, 0x75, 0x77, 0x2b,
+ 0x22, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x73, 0x65, 0x72, 0x76, 0x66, 0x61, 0x69, 0x6c, 0x72, 0x65,
+ 0x6d, 0x6f, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x22, 0x29, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x28,
+ 0x62, 0x6f, 0x75, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x28, 0x7b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x75, 0x72, 0x6c,
+ 0x3a, 0x20, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x74, 0x3f, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x61, 0x6e, 0x64, 0x3d, 0x73, 0x74, 0x61, 0x74, 0x73, 0x27, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x27, 0x47,
+ 0x45, 0x54, 0x27, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x27, 0x6a, 0x73, 0x6f, 0x6e,
+ 0x27, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6a,
+ 0x73, 0x6f, 0x6e, 0x70, 0x3a, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
+ 0x3a, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x2c,
+ 0x20, 0x78, 0x2c, 0x20, 0x79, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x64, 0x61,
+ 0x74, 0x61, 0x5b, 0x22, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x5d, 0x29, 0x3b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x24, 0x28, 0x22, 0x23, 0x61, 0x63, 0x6c, 0x2d, 0x64, 0x72, 0x6f, 0x70, 0x73, 0x22, 0x29, 0x2e,
+ 0x74, 0x65, 0x78, 0x74, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x61, 0x63, 0x6c, 0x2d, 0x64,
+ 0x72, 0x6f, 0x70, 0x73, 0x22, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x64, 0x79, 0x6e,
+ 0x2d, 0x64, 0x72, 0x6f, 0x70, 0x73, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x64, 0x61,
+ 0x74, 0x61, 0x5b, 0x22, 0x64, 0x79, 0x6e, 0x2d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22,
+ 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x72, 0x75, 0x6c, 0x65, 0x2d, 0x64, 0x72, 0x6f,
+ 0x70, 0x73, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22,
+ 0x72, 0x75, 0x6c, 0x65, 0x2d, 0x64, 0x72, 0x6f, 0x70, 0x22, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28,
+ 0x22, 0x23, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28,
+ 0x6d, 0x6f, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x75, 0x70, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x5d, 0x2a, 0x31,
+ 0x30, 0x30, 0x30, 0x2e, 0x30, 0x29, 0x2e, 0x68, 0x75, 0x6d, 0x61, 0x6e, 0x69, 0x7a, 0x65, 0x28,
+ 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x22,
+ 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x6c, 0x61,
+ 0x74, 0x65, 0x6e, 0x63, 0x79, 0x2d, 0x61, 0x76, 0x67, 0x31, 0x30, 0x30, 0x30, 0x30, 0x22, 0x5d,
+ 0x2f, 0x31, 0x30, 0x30, 0x30, 0x2e, 0x30, 0x29, 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78, 0x65, 0x64,
+ 0x28, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x21, 0x67, 0x64, 0x61, 0x74, 0x61, 0x5b,
+ 0x22, 0x63, 0x70, 0x75, 0x2d, 0x73, 0x79, 0x73, 0x2d, 0x6d, 0x73, 0x65, 0x63, 0x22, 0x5d, 0x29,
+ 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x64, 0x61, 0x74, 0x61, 0x3d, 0x64, 0x61, 0x74, 0x61,
+ 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x63, 0x70, 0x75, 0x3d, 0x28, 0x28, 0x31, 0x2e, 0x30,
+ 0x2a, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x63, 0x70, 0x75, 0x2d, 0x73, 0x79, 0x73, 0x2d, 0x6d,
+ 0x73, 0x65, 0x63, 0x22, 0x5d, 0x2b, 0x31, 0x2e, 0x30, 0x2a, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22,
+ 0x63, 0x70, 0x75, 0x2d, 0x75, 0x73, 0x65, 0x72, 0x2d, 0x6d, 0x73, 0x65, 0x63, 0x22, 0x5d, 0x20,
+ 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x2a, 0x67, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x63, 0x70, 0x75,
+ 0x2d, 0x73, 0x79, 0x73, 0x2d, 0x6d, 0x73, 0x65, 0x63, 0x22, 0x5d, 0x2d, 0x31, 0x2e, 0x30, 0x2a,
+ 0x67, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x63, 0x70, 0x75, 0x2d, 0x75, 0x73, 0x65, 0x72, 0x2d,
+ 0x6d, 0x73, 0x65, 0x63, 0x22, 0x5d, 0x29, 0x2f, 0x31, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x24, 0x28, 0x22, 0x23, 0x63, 0x70, 0x75, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x63,
+ 0x70, 0x75, 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78, 0x65, 0x64, 0x28, 0x32, 0x29, 0x29, 0x3b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x76, 0x61, 0x72, 0x20, 0x71, 0x70, 0x73, 0x3d, 0x31, 0x2e, 0x30, 0x2a, 0x64, 0x61, 0x74, 0x61,
+ 0x5b, 0x22, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x5d, 0x2d, 0x31, 0x2e, 0x30, 0x2a,
+ 0x67, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x5d,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x71, 0x70, 0x73, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74,
+ 0x28, 0x71, 0x70, 0x73, 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78, 0x65, 0x64, 0x28, 0x32, 0x29, 0x29,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x70, 0x6f, 0x6c,
+ 0x69, 0x63, 0x79, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b,
+ 0x22, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2d, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x5d,
+ 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x73, 0x65, 0x72, 0x76, 0x66, 0x61, 0x69, 0x6c,
+ 0x70, 0x73, 0x3d, 0x31, 0x2e, 0x30, 0x2a, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x73, 0x65, 0x72,
+ 0x76, 0x66, 0x61, 0x69, 0x6c, 0x2d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22,
+ 0x5d, 0x2d, 0x31, 0x2e, 0x30, 0x2a, 0x67, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x73, 0x65, 0x72,
+ 0x76, 0x66, 0x61, 0x69, 0x6c, 0x2d, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x22,
+ 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x74, 0x6f, 0x74, 0x70, 0x63, 0x61, 0x63, 0x68,
+ 0x65, 0x3d, 0x31, 0x2e, 0x30, 0x2a, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x63, 0x61, 0x63, 0x68,
+ 0x65, 0x2d, 0x68, 0x69, 0x74, 0x73, 0x22, 0x5d, 0x2d, 0x31, 0x2e, 0x30, 0x2a, 0x67, 0x64, 0x61,
+ 0x74, 0x61, 0x5b, 0x22, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x68, 0x69, 0x74, 0x73, 0x22, 0x5d,
+ 0x2b, 0x31, 0x2e, 0x30, 0x2a, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x63, 0x61, 0x63, 0x68, 0x65,
+ 0x2d, 0x6d, 0x69, 0x73, 0x73, 0x65, 0x73, 0x22, 0x5d, 0x2d, 0x31, 0x2e, 0x30, 0x2a, 0x67, 0x64,
+ 0x61, 0x74, 0x61, 0x5b, 0x22, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x6d, 0x69, 0x73, 0x73, 0x65,
+ 0x73, 0x22, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x68, 0x69, 0x74, 0x72, 0x61, 0x74, 0x65,
+ 0x3d, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x74, 0x6f, 0x74, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65,
+ 0x20, 0x3e, 0x20, 0x30, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x68, 0x69, 0x74, 0x72,
+ 0x61, 0x74, 0x65, 0x3d, 0x31, 0x30, 0x30, 0x2e, 0x30, 0x2a, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b,
+ 0x22, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x68, 0x69, 0x74, 0x73, 0x22, 0x5d, 0x2d, 0x31, 0x2e,
+ 0x30, 0x2a, 0x67, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x63, 0x61, 0x63, 0x68, 0x65, 0x2d, 0x68,
+ 0x69, 0x74, 0x73, 0x22, 0x5d, 0x29, 0x2f, 0x74, 0x6f, 0x74, 0x70, 0x63, 0x61, 0x63, 0x68, 0x65,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x70, 0x68, 0x69, 0x74, 0x72, 0x61,
+ 0x74, 0x65, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x68, 0x69, 0x74, 0x72, 0x61, 0x74,
+ 0x65, 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78, 0x65, 0x64, 0x28, 0x32, 0x29, 0x29, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x70, 0x68,
+ 0x69, 0x74, 0x72, 0x61, 0x74, 0x65, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x30, 0x29,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x71, 0x70, 0x73, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65, 0x72, 0x69,
+ 0x65, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x44, 0x61, 0x74, 0x61, 0x28, 0x7b, 0x20, 0x71, 0x70, 0x73,
+ 0x3a, 0x20, 0x71, 0x70, 0x73, 0x2c, 0x20, 0x73, 0x65, 0x72, 0x76, 0x66, 0x61, 0x69, 0x6c, 0x70,
+ 0x73, 0x3a, 0x20, 0x73, 0x65, 0x72, 0x76, 0x66, 0x61, 0x69, 0x6c, 0x70, 0x73, 0x7d, 0x29, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x71, 0x70, 0x73, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72,
+ 0x28, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x70, 0x75, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2e, 0x73, 0x65,
+ 0x72, 0x69, 0x65, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x44, 0x61, 0x74, 0x61, 0x28, 0x7b, 0x20, 0x6f,
+ 0x6e, 0x65, 0x3a, 0x20, 0x63, 0x70, 0x75, 0x2c, 0x20, 0x74, 0x77, 0x6f, 0x3a, 0x20, 0x68, 0x69,
+ 0x74, 0x72, 0x61, 0x74, 0x65, 0x7d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x63, 0x70, 0x75, 0x67, 0x72, 0x61, 0x70,
+ 0x68, 0x2e, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x28, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x67, 0x64, 0x61,
+ 0x74, 0x61, 0x3d, 0x64, 0x61, 0x74, 0x61, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x20, 0x20, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x20, 0x7b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x28, 0x7b, 0x20, 0x75,
+ 0x72, 0x6c, 0x3a, 0x20, 0x27, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76,
+ 0x65, 0x72, 0x73, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x27, 0x2c, 0x20,
+ 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x27, 0x47, 0x45, 0x54, 0x27, 0x2c, 0x20, 0x64, 0x61, 0x74,
+ 0x61, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x27, 0x2c, 0x20, 0x6a,
+ 0x73, 0x6f, 0x6e, 0x70, 0x3a, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x75,
+ 0x63, 0x63, 0x65, 0x73, 0x73, 0x3a, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x64, 0x61, 0x74, 0x61, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22,
+ 0x23, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28,
+ 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x64, 0x61, 0x65, 0x6d, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70,
+ 0x65, 0x22, 0x5d, 0x2b, 0x22, 0x20, 0x22, 0x2b, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x76, 0x65,
+ 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24,
+ 0x28, 0x22, 0x23, 0x61, 0x63, 0x6c, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x28, 0x64, 0x61,
+ 0x74, 0x61, 0x5b, 0x22, 0x61, 0x63, 0x6c, 0x22, 0x5d, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x24, 0x28, 0x22, 0x23, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x22, 0x29, 0x2e, 0x74, 0x65, 0x78,
+ 0x74, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x22, 0x5d, 0x29,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d,
+ 0x27, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31,
+ 0x30, 0x30, 0x25, 0x22, 0x3e, 0x3c, 0x74, 0x72, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x72,
+ 0x69, 0x67, 0x68, 0x74, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x23, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c,
+ 0x74, 0x68, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x6c, 0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0x3e, 0x27, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x22, 0x5d,
+ 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x20,
+ 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20,
+ 0x3d, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x2b, 0x20, 0x28, 0x22, 0x3c, 0x74, 0x72, 0x20, 0x61,
+ 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22,
+ 0x2b, 0x62, 0x5b, 0x22, 0x69, 0x64, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c,
+ 0x74, 0x64, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x22, 0x2b,
+ 0x62, 0x5b, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e,
+ 0x3c, 0x74, 0x64, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x22,
+ 0x2b, 0x62, 0x5b, 0x22, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x5d, 0x2b, 0x22, 0x3c,
+ 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x73, 0x74, 0x61,
+ 0x74, 0x65, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x6c, 0x61, 0x74, 0x65,
+ 0x6e, 0x63, 0x79, 0x20, 0x3d, 0x20, 0x28, 0x62, 0x5b, 0x22, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63,
+ 0x79, 0x22, 0x5d, 0x20, 0x3d, 0x3d, 0x3d, 0x20, 0x6e, 0x75, 0x6c, 0x6c, 0x29, 0x20, 0x3f, 0x20,
+ 0x30, 0x2e, 0x30, 0x20, 0x3a, 0x20, 0x62, 0x5b, 0x22, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79,
+ 0x22, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75,
+ 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x2b, 0x20, 0x28, 0x22, 0x3c, 0x74, 0x64,
+ 0x3e, 0x22, 0x2b, 0x6c, 0x61, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x2e, 0x74, 0x6f, 0x46, 0x69, 0x78,
+ 0x65, 0x64, 0x28, 0x32, 0x29, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e,
+ 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x5d, 0x2b, 0x22,
+ 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x72, 0x65,
+ 0x75, 0x73, 0x65, 0x64, 0x73, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74,
+ 0x64, 0x3e, 0x22, 0x2b, 0x28, 0x62, 0x5b, 0x22, 0x71, 0x70, 0x73, 0x22, 0x5d, 0x29, 0x2e, 0x74,
+ 0x6f, 0x46, 0x69, 0x78, 0x65, 0x64, 0x28, 0x32, 0x29, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e,
+ 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x6f, 0x75, 0x74, 0x73, 0x74, 0x61, 0x6e,
+ 0x64, 0x69, 0x6e, 0x67, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x22, 0x29, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d,
+ 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x2b, 0x20, 0x28, 0x22, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b,
+ 0x62, 0x5b, 0x22, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74,
+ 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x6f, 0x72, 0x64, 0x65, 0x72,
+ 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x20, 0x61, 0x6c, 0x69,
+ 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x70, 0x6f, 0x6f,
+ 0x6c, 0x73, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e,
+ 0x22, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x20, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x2b,
+ 0x20, 0x22, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x64, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d,
+ 0x73, 0x22, 0x29, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x28, 0x62, 0x6f, 0x75, 0x77, 0x29, 0x3b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d,
+ 0x27, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31,
+ 0x30, 0x30, 0x25, 0x22, 0x3e, 0x3c, 0x74, 0x72, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x6c,
+ 0x65, 0x66, 0x74, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x23, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74,
+ 0x68, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x52, 0x75, 0x6c,
+ 0x65, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73,
+ 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x27, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x69, 0x66, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x72, 0x75, 0x6c, 0x65, 0x73,
+ 0x22, 0x5d, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x64, 0x61, 0x74,
+ 0x61, 0x5b, 0x22, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x5d, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20,
+ 0x62, 0x6f, 0x75, 0x77, 0x20, 0x2b, 0x20, 0x28, 0x22, 0x3c, 0x74, 0x72, 0x20, 0x61, 0x6c, 0x69,
+ 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b,
+ 0x22, 0x69, 0x64, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x20,
+ 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22,
+ 0x72, 0x75, 0x6c, 0x65, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64,
+ 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x2b, 0x22,
+ 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f, 0x75,
+ 0x77, 0x20, 0x2b, 0x20, 0x28, 0x22, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x6d,
+ 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c,
+ 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x7d, 0x29, 0x3b, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x2b, 0x20, 0x27, 0x3c,
+ 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x22, 0x63, 0x65,
+ 0x6e, 0x74, 0x65, 0x72, 0x22, 0x20, 0x63, 0x6f, 0x6c, 0x73, 0x70, 0x61, 0x6e, 0x3d, 0x22, 0x34,
+ 0x22, 0x3e, 0x3c, 0x66, 0x6f, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x22, 0x23,
+ 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x22, 0x3e, 0x4e, 0x6f, 0x20, 0x72, 0x75, 0x6c, 0x65, 0x73,
+ 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x3c, 0x2f, 0x66, 0x6f, 0x6e, 0x74, 0x3e, 0x3c,
+ 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x27, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x2b, 0x20, 0x22,
+ 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x24, 0x28, 0x22, 0x23, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x29, 0x2e, 0x68, 0x74, 0x6d, 0x6c,
+ 0x28, 0x62, 0x6f, 0x75, 0x77, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f,
+ 0x75, 0x77, 0x3d, 0x27, 0x3c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68,
+ 0x3d, 0x22, 0x31, 0x30, 0x30, 0x25, 0x22, 0x3e, 0x3c, 0x74, 0x72, 0x20, 0x61, 0x6c, 0x69, 0x67,
+ 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x23, 0x3c, 0x2f, 0x74, 0x68,
+ 0x3e, 0x3c, 0x74, 0x68, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x20, 0x52, 0x75, 0x6c, 0x65, 0x3c, 0x2f, 0x74,
+ 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3c, 0x2f, 0x74, 0x68,
+ 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x3c, 0x2f, 0x74, 0x68,
+ 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x27, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66,
+ 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2d,
+ 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x5d, 0x2e, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x29, 0x20,
+ 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x65, 0x61, 0x63,
+ 0x68, 0x28, 0x64, 0x61, 0x74, 0x61, 0x5b, 0x22, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x2d, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x5d, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
+ 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f,
+ 0x75, 0x77, 0x20, 0x2b, 0x20, 0x28, 0x22, 0x3c, 0x74, 0x72, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e,
+ 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x69,
+ 0x64, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x20, 0x61, 0x6c,
+ 0x69, 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x72, 0x75,
+ 0x6c, 0x65, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22,
+ 0x2b, 0x62, 0x5b, 0x22, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f,
+ 0x74, 0x64, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20,
+ 0x2b, 0x20, 0x28, 0x22, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x5b, 0x22, 0x6d, 0x61, 0x74,
+ 0x63, 0x68, 0x65, 0x73, 0x22, 0x5d, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74,
+ 0x72, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d,
+ 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x65,
+ 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75,
+ 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x2b, 0x20, 0x27, 0x3c, 0x74, 0x72, 0x3e,
+ 0x3c, 0x74, 0x64, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x22, 0x63, 0x65, 0x6e, 0x74, 0x65,
+ 0x72, 0x22, 0x20, 0x63, 0x6f, 0x6c, 0x73, 0x70, 0x61, 0x6e, 0x3d, 0x22, 0x34, 0x22, 0x3e, 0x3c,
+ 0x66, 0x6f, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3d, 0x22, 0x23, 0x61, 0x61, 0x61,
+ 0x61, 0x61, 0x61, 0x22, 0x3e, 0x4e, 0x6f, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
+ 0x20, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x3c, 0x2f,
+ 0x66, 0x6f, 0x6e, 0x74, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x27,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f,
+ 0x75, 0x77, 0x20, 0x2b, 0x20, 0x22, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x22, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x2d, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x22, 0x29, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x28,
+ 0x62, 0x6f, 0x75, 0x77, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x0a, 0x0a, 0x2f,
+ 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x28, 0x28, 0x69, 0x6e, 0x74,
+ 0x65, 0x72, 0x76, 0x61, 0x6c, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2b, 0x2b, 0x29, 0x25, 0x35, 0x29,
+ 0x0a, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f,
+ 0x2f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e,
+ 0x67, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x28, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x28, 0x7b, 0x20, 0x75, 0x72,
+ 0x6c, 0x3a, 0x20, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x74, 0x3f, 0x63, 0x6f, 0x6d,
+ 0x6d, 0x61, 0x6e, 0x64, 0x3d, 0x64, 0x79, 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x6c, 0x69, 0x73,
+ 0x74, 0x27, 0x2c, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x27, 0x47, 0x45, 0x54, 0x27, 0x2c,
+ 0x20, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x27, 0x6a, 0x73, 0x6f, 0x6e,
+ 0x27, 0x2c, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x3a, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x3a, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x27, 0x3c, 0x74, 0x61, 0x62, 0x6c,
+ 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x30, 0x25, 0x22, 0x3e, 0x3c,
+ 0x74, 0x72, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x3c, 0x74,
+ 0x68, 0x3e, 0x44, 0x79, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x6e, 0x65,
+ 0x74, 0x6d, 0x61, 0x73, 0x6b, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x53, 0x65,
+ 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x42, 0x6c,
+ 0x6f, 0x63, 0x6b, 0x73, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x20, 0x61, 0x6c, 0x69,
+ 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x52, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x3c, 0x2f,
+ 0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x27, 0x3b, 0x0a, 0x09, 0x09, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x67, 0x6f, 0x74, 0x73, 0x6f, 0x6d, 0x65, 0x3d, 0x66, 0x61,
+ 0x6c, 0x73, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x65, 0x61, 0x63, 0x68,
+ 0x28, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28,
+ 0x61, 0x2c, 0x62, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x28, 0x22, 0x3c, 0x74, 0x72, 0x3e,
+ 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x61, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74,
+ 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x2e, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2b, 0x22, 0x3c,
+ 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x2e, 0x62, 0x6c, 0x6f, 0x63,
+ 0x6b, 0x73, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62,
+ 0x2e, 0x72, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f,
+ 0x74, 0x72, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x20, 0x67, 0x6f, 0x74, 0x73, 0x6f,
+ 0x6d, 0x65, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x29,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69,
+ 0x66, 0x28, 0x21, 0x67, 0x6f, 0x74, 0x73, 0x6f, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f, 0x75, 0x77,
+ 0x20, 0x2b, 0x20, 0x27, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x20, 0x61, 0x6c, 0x69, 0x67,
+ 0x6e, 0x3d, 0x22, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x20, 0x63, 0x6f, 0x6c, 0x73, 0x70,
+ 0x61, 0x6e, 0x3d, 0x22, 0x34, 0x22, 0x3e, 0x3c, 0x66, 0x6f, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6c,
+ 0x6f, 0x72, 0x3d, 0x22, 0x23, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x22, 0x3e, 0x4e, 0x6f, 0x20,
+ 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x63, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x20, 0x61,
+ 0x63, 0x74, 0x69, 0x76, 0x65, 0x3c, 0x2f, 0x66, 0x6f, 0x6e, 0x74, 0x3e, 0x3c, 0x2f, 0x74, 0x64,
+ 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x27, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62,
+ 0x6f, 0x75, 0x77, 0x3d, 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c,
+ 0x65, 0x3e, 0x22, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x64, 0x79,
+ 0x6e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x22, 0x29, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x28, 0x62, 0x6f,
+ 0x75, 0x77, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x7d, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x2e, 0x61, 0x6a, 0x61, 0x78, 0x28, 0x7b, 0x20, 0x75, 0x72,
+ 0x6c, 0x3a, 0x20, 0x27, 0x6a, 0x73, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x74, 0x3f, 0x63, 0x6f, 0x6d,
+ 0x6d, 0x61, 0x6e, 0x64, 0x3d, 0x65, 0x62, 0x70, 0x66, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x6c, 0x69,
+ 0x73, 0x74, 0x27, 0x2c, 0x20, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x27, 0x47, 0x45, 0x54, 0x27,
+ 0x2c, 0x20, 0x64, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x27, 0x6a, 0x73, 0x6f,
+ 0x6e, 0x27, 0x2c, 0x20, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x3a, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65,
+ 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x3a, 0x20, 0x66, 0x75, 0x6e, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x64, 0x61, 0x74, 0x61, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x27, 0x3c, 0x74, 0x61, 0x62,
+ 0x6c, 0x65, 0x20, 0x77, 0x69, 0x64, 0x74, 0x68, 0x3d, 0x22, 0x31, 0x30, 0x30, 0x25, 0x22, 0x3e,
+ 0x3c, 0x74, 0x72, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x3d, 0x6c, 0x65, 0x66, 0x74, 0x3e, 0x3c,
+ 0x74, 0x68, 0x3e, 0x4b, 0x65, 0x72, 0x6e, 0x65, 0x6c, 0x2d, 0x62, 0x61, 0x73, 0x65, 0x64, 0x20,
+ 0x64, 0x79, 0x6e, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x20, 0x6e, 0x65, 0x74, 0x6d,
+ 0x61, 0x73, 0x6b, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68, 0x3e, 0x53, 0x65, 0x63, 0x6f,
+ 0x6e, 0x64, 0x73, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x74, 0x68,
+ 0x3e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x3c, 0x2f, 0x74, 0x68, 0x3e, 0x3c, 0x2f, 0x74, 0x72,
+ 0x3e, 0x27, 0x3b, 0x0a, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x67,
+ 0x6f, 0x74, 0x73, 0x6f, 0x6d, 0x65, 0x3d, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x24, 0x2e, 0x65, 0x61, 0x63, 0x68, 0x28, 0x64, 0x61, 0x74, 0x61, 0x2c, 0x20,
+ 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x61, 0x2c, 0x62, 0x29, 0x20, 0x7b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d, 0x62, 0x6f,
+ 0x75, 0x77, 0x2b, 0x28, 0x22, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x61,
+ 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64, 0x3e, 0x22, 0x2b, 0x62, 0x2e, 0x73,
+ 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x74, 0x64,
+ 0x3e, 0x22, 0x2b, 0x62, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x2b, 0x22, 0x3c, 0x2f, 0x74,
+ 0x64, 0x3e, 0x3c, 0x2f, 0x74, 0x72, 0x3e, 0x22, 0x29, 0x3b, 0x0a, 0x09, 0x09, 0x09, 0x20, 0x67,
+ 0x6f, 0x74, 0x73, 0x6f, 0x6d, 0x65, 0x3d, 0x74, 0x72, 0x75, 0x65, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x7d, 0x29, 0x3b, 0x0a, 0x0a, 0x09, 0x09, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66,
+ 0x28, 0x21, 0x67, 0x6f, 0x74, 0x73, 0x6f, 0x6d, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20, 0x3d, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x20,
+ 0x2b, 0x20, 0x27, 0x3c, 0x74, 0x72, 0x3e, 0x3c, 0x74, 0x64, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e,
+ 0x3d, 0x22, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x22, 0x20, 0x63, 0x6f, 0x6c, 0x73, 0x70, 0x61,
+ 0x6e, 0x3d, 0x22, 0x34, 0x22, 0x3e, 0x3c, 0x66, 0x6f, 0x6e, 0x74, 0x20, 0x63, 0x6f, 0x6c, 0x6f,
+ 0x72, 0x3d, 0x22, 0x23, 0x61, 0x61, 0x61, 0x61, 0x61, 0x61, 0x22, 0x3e, 0x4e, 0x6f, 0x20, 0x65,
+ 0x42, 0x50, 0x46, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x73, 0x20, 0x61, 0x63, 0x74, 0x69, 0x76,
+ 0x65, 0x3c, 0x2f, 0x66, 0x6f, 0x6e, 0x74, 0x3e, 0x3c, 0x2f, 0x74, 0x64, 0x3e, 0x3c, 0x2f, 0x74,
+ 0x72, 0x3e, 0x27, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x62, 0x6f, 0x75, 0x77, 0x3d,
+ 0x62, 0x6f, 0x75, 0x77, 0x2b, 0x22, 0x3c, 0x2f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x3e, 0x22, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x65, 0x62, 0x70, 0x66, 0x62, 0x6c,
+ 0x6f, 0x63, 0x6b, 0x22, 0x29, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x28, 0x62, 0x6f, 0x75, 0x77, 0x29,
+ 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x7d, 0x7d, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x66, 0x69,
+ 0x6c, 0x74, 0x65, 0x72, 0x31, 0x22, 0x29, 0x2e, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x28, 0x75, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x52, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x29,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x24, 0x28, 0x22, 0x23, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72,
+ 0x32, 0x22, 0x29, 0x2e, 0x63, 0x6c, 0x69, 0x63, 0x6b, 0x28, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x52, 0x69, 0x6e, 0x67, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x73, 0x29, 0x3b, 0x0a, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x28, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x28, 0x75, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x2c, 0x20, 0x31, 0x30, 0x30, 0x30, 0x29, 0x3b, 0x0a, 0x7d, 0x29, 0x3b, 0x0a,
+
+};
+static const unsigned char gpowerdns_logo_220px_pngData[] = {
+ 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
+ 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, 0x1d, 0x08, 0x06, 0x00, 0x00, 0x00, 0xc1, 0xee, 0x02,
+ 0x90, 0x00, 0x00, 0x00, 0x04, 0x73, 0x42, 0x49, 0x54, 0x08, 0x08, 0x08, 0x08, 0x7c, 0x08, 0x64,
+ 0x88, 0x00, 0x00, 0x00, 0x09, 0x70, 0x48, 0x59, 0x73, 0x00, 0x00, 0x03, 0xdf, 0x00, 0x00, 0x03,
+ 0xdf, 0x01, 0x3c, 0x03, 0xc5, 0x4a, 0x00, 0x00, 0x00, 0x19, 0x74, 0x45, 0x58, 0x74, 0x53, 0x6f,
+ 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x00, 0x77, 0x77, 0x77, 0x2e, 0x69, 0x6e, 0x6b, 0x73, 0x63,
+ 0x61, 0x70, 0x65, 0x2e, 0x6f, 0x72, 0x67, 0x9b, 0xee, 0x3c, 0x1a, 0x00, 0x00, 0x17, 0x41, 0x49,
+ 0x44, 0x41, 0x54, 0x78, 0x9c, 0xcd, 0x5d, 0x7b, 0x74, 0x13, 0xd7, 0x99, 0xbf, 0x33, 0x92, 0x46,
+ 0x33, 0xd6, 0x5b, 0xb2, 0x65, 0xc9, 0x96, 0xe5, 0x77, 0x4c, 0x0c, 0x18, 0xfc, 0xa4, 0xe6, 0x91,
+ 0x18, 0x12, 0x16, 0x43, 0x80, 0x24, 0x94, 0x24, 0x9b, 0x26, 0x0b, 0x65, 0x13, 0x7a, 0xd2, 0x64,
+ 0x53, 0xf6, 0xa4, 0x24, 0x85, 0xc3, 0xf6, 0x6c, 0x4f, 0xb2, 0x4b, 0x36, 0x6d, 0x16, 0x4a, 0x77,
+ 0xc9, 0xd2, 0xa4, 0x84, 0x2c, 0x6d, 0xb2, 0x01, 0x7a, 0x08, 0x01, 0x1a, 0x07, 0xb3, 0x38, 0x26,
+ 0x50, 0x30, 0x18, 0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.css", string((const char*)gdetail_cssData, sizeof(gdetail_cssData))},
+{"graph.css", string((const char*)ggraph_cssData, sizeof(ggraph_cssData))},
+{"index.html", string((const char*)gindex_htmlData, sizeof(gindex_htmlData))},
+{"js/d3.min.js", string((const char*)gjs_d3_min_jsData, sizeof(gjs_d3_min_jsData))},
+{"js/jquery.min.js", string((const char*)gjs_jquery_min_jsData, sizeof(gjs_jquery_min_jsData))},
+{"js/moment.min.js", string((const char*)gjs_moment_min_jsData, sizeof(gjs_moment_min_jsData))},
+{"js/rickshaw.min.js", string((const char*)gjs_rickshaw_min_jsData, sizeof(gjs_rickshaw_min_jsData))},
+{"legend.css", string((const char*)glegend_cssData, sizeof(glegend_cssData))},
+{"lines.css", string((const char*)glines_cssData, sizeof(glines_cssData))},
+{"local.js", string((const char*)glocal_jsData, sizeof(glocal_jsData))},
+{"powerdns-logo-220px.png", string((const char*)gpowerdns_logo_220px_pngData, sizeof(gpowerdns_logo_220px_pngData))},
+};
diff --git a/incfiles b/incfiles
new file mode 100755
index 0000000..9f96afe
--- /dev/null
+++ b/incfiles
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+export LC_ALL=C.UTF-8
+export LANG=C.UTF-8
+
+if [ -n "$1" ]
+then
+ DIR=$1/
+fi
+
+for a in $(find ${DIR}html -type f | grep -v \~ | sort)
+do
+ c=$(echo $a | sed s:${DIR}html/:: | tr "/.-" "___")
+ echo "static const unsigned char g${c}Data[] = {"
+ od -v -t x1 "$a" | sed 's/^[0-7]*//' | sed 's/\([0-9a-f][0-9a-f]\)/0x\1,/g'
+ echo "};"
+done
+
+echo "static const map<string,string> s_urlmap={"
+for a in $(find ${DIR}html -type f | grep -v \~ | sort)
+do
+ b=$(echo $a | sed s:${DIR}html/::g)
+ c=$(echo $b | tr "/.-" "___")
+ echo "{\"$b\", string((const char*)g${c}Data, sizeof(g${c}Data))},"
+done
+echo "};"
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..8175c64
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,518 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2018-03-11.20; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# 'make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab=' '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+ --help display this help and exit.
+ --version display version info and exit.
+
+ -c (ignored)
+ -C install only if different (preserve the last data modification time)
+ -d create directories instead of installing files.
+ -g GROUP $chgrpprog installed files to GROUP.
+ -m MODE $chmodprog installed files to MODE.
+ -o USER $chownprog installed files to USER.
+ -s $stripprog installed files.
+ -t DIRECTORY install into DIRECTORY.
+ -T report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+ RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+ case $1 in
+ -c) ;;
+
+ -C) copy_on_change=true;;
+
+ -d) dir_arg=true;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) mode=$2
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
+
+ -o) chowncmd="$chownprog $2"
+ shift;;
+
+ -s) stripcmd=$stripprog;;
+
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) is_target_a_directory=never;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ --) shift
+ break;;
+
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
+
+ *) break;;
+ esac
+ shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dst_arg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dst_arg"
+ shift # fnord
+ fi
+ shift # arg
+ dst_arg=$arg
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ done
+fi
+
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call 'install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
+if test -z "$dir_arg"; then
+ do_exit='(exit $ret); exit $ret'
+ trap "ret=129; $do_exit" 1
+ trap "ret=130; $do_exit" 2
+ trap "ret=141; $do_exit" 13
+ trap "ret=143; $do_exit" 15
+
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
+fi
+
+for src
+do
+ # Protect names problematic for 'test' and other utilities.
+ case $src in
+ -* | [=\(\)!]) src=./$src;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
+ else
+
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dst_arg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+ dst=$dst_arg
+
+ # If destination is a directory, append the input filename.
+ if test -d "$dst"; then
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
+ dstdir_status=0
+ else
+ dstdir=`dirname "$dst"`
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
+
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ # Note that $RANDOM variable is not portable (e.g. dash); Use it
+ # here however when possible just to lower collision chance.
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p' feature.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
+ else
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
+ esac
+
+ oIFS=$IFS
+ IFS=/
+ set -f
+ set fnord $dstdir
+ shift
+ set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
+ fi
+ fi
+
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+ { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+ { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+ # If -C, don't bother to copy if it wouldn't change the file.
+ if $copy_on_change &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
+ set X $old && old=:$2:$4:$5:$6 &&
+ set X $new && new=:$2:$4:$5:$6 &&
+ set +f &&
+ test "$old" = "$new" &&
+ $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+ then
+ rm -f "$dsttmp"
+ else
+ # Rename the file to the real destination.
+ $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+ {
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd -f "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
+ }
+ fi || exit 1
+
+ trap '' 0
+ fi
+done
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/ipcipher.cc b/ipcipher.cc
new file mode 100644
index 0000000..57a2aa3
--- /dev/null
+++ b/ipcipher.cc
@@ -0,0 +1,99 @@
+#include "ipcipher.hh"
+#include "ext/ipcrypt/ipcrypt.h"
+#include <openssl/aes.h>
+#include <openssl/evp.h>
+
+/*
+int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
+ const unsigned char *salt, int saltlen, int iter,
+ int keylen, unsigned char *out);
+*/
+std::string makeIPCipherKey(const std::string& password)
+{
+ static const char salt[]="ipcipheripcipher";
+ unsigned char out[16];
+
+ PKCS5_PBKDF2_HMAC_SHA1(password.c_str(), password.size(), (const unsigned char*)salt, sizeof(salt)-1, 50000, sizeof(out), out);
+
+ return std::string((const char*)out, (const char*)out + sizeof(out));
+}
+
+static ComboAddress encryptCA4(const ComboAddress& ca, const std::string &key)
+{
+ if(key.size() != 16)
+ throw std::runtime_error("Need 128 bits of key for ipcrypt");
+
+ ComboAddress ret=ca;
+
+ // always returns 0, has no failure mode
+ ipcrypt_encrypt( (unsigned char*)&ret.sin4.sin_addr.s_addr,
+ (const unsigned char*) &ca.sin4.sin_addr.s_addr,
+ (const unsigned char*)key.c_str());
+ return ret;
+}
+
+static ComboAddress decryptCA4(const ComboAddress& ca, const std::string &key)
+{
+ if(key.size() != 16)
+ throw std::runtime_error("Need 128 bits of key for ipcrypt");
+
+ ComboAddress ret=ca;
+
+ // always returns 0, has no failure mode
+ ipcrypt_decrypt( (unsigned char*)&ret.sin4.sin_addr.s_addr,
+ (const unsigned char*) &ca.sin4.sin_addr.s_addr,
+ (const unsigned char*)key.c_str());
+ return ret;
+}
+
+
+static ComboAddress encryptCA6(const ComboAddress& ca, const std::string &key)
+{
+ if(key.size() != 16)
+ throw std::runtime_error("Need 128 bits of key for ipcrypt");
+
+ ComboAddress ret=ca;
+
+ AES_KEY wctx;
+ AES_set_encrypt_key((const unsigned char*)key.c_str(), 128, &wctx);
+ AES_encrypt((const unsigned char*)&ca.sin6.sin6_addr.s6_addr,
+ (unsigned char*)&ret.sin6.sin6_addr.s6_addr, &wctx);
+
+ return ret;
+}
+
+static ComboAddress decryptCA6(const ComboAddress& ca, const std::string &key)
+{
+ if(key.size() != 16)
+ throw std::runtime_error("Need 128 bits of key for ipcrypt");
+
+ ComboAddress ret=ca;
+ AES_KEY wctx;
+ AES_set_decrypt_key((const unsigned char*)key.c_str(), 128, &wctx);
+ AES_decrypt((const unsigned char*)&ca.sin6.sin6_addr.s6_addr,
+ (unsigned char*)&ret.sin6.sin6_addr.s6_addr, &wctx);
+
+ return ret;
+}
+
+
+ComboAddress encryptCA(const ComboAddress& ca, const std::string& key)
+{
+ if(ca.sin4.sin_family == AF_INET)
+ return encryptCA4(ca, key);
+ else if(ca.sin4.sin_family == AF_INET6)
+ return encryptCA6(ca, key);
+ else
+ throw std::runtime_error("ipcrypt can't encrypt non-IP addresses");
+}
+
+ComboAddress decryptCA(const ComboAddress& ca, const std::string& key)
+{
+ if(ca.sin4.sin_family == AF_INET)
+ return decryptCA4(ca, key);
+ else if(ca.sin4.sin_family == AF_INET6)
+ return decryptCA6(ca, key);
+ else
+ throw std::runtime_error("ipcrypt can't decrypt non-IP addresses");
+
+}
diff --git a/ipcipher.hh b/ipcipher.hh
new file mode 100644
index 0000000..cbb932d
--- /dev/null
+++ b/ipcipher.hh
@@ -0,0 +1,9 @@
+#pragma once
+#include "iputils.hh"
+#include <string>
+
+// see https://powerdns.org/ipcipher
+
+ComboAddress encryptCA(const ComboAddress& ca, const std::string& key);
+ComboAddress decryptCA(const ComboAddress& ca, const std::string& key);
+std::string makeIPCipherKey(const std::string& password);
diff --git a/iputils.cc b/iputils.cc
new file mode 100644
index 0000000..1c04228
--- /dev/null
+++ b/iputils.cc
@@ -0,0 +1,545 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "iputils.hh"
+#include <sys/socket.h>
+
+/** these functions provide a very lightweight wrapper to the Berkeley sockets API. Errors -> exceptions! */
+
+static void RuntimeError(const boost::format& fmt)
+{
+ throw runtime_error(fmt.str());
+}
+
+static void NetworkErr(const boost::format& fmt)
+{
+ throw NetworkError(fmt.str());
+}
+
+int SSocket(int family, int type, int flags)
+{
+ int ret = socket(family, type, flags);
+ if(ret < 0)
+ RuntimeError(boost::format("creating socket of type %d: %s") % family % stringerror());
+ return ret;
+}
+
+int SConnect(int sockfd, const ComboAddress& remote)
+{
+ int ret = connect(sockfd, reinterpret_cast<const struct sockaddr*>(&remote), remote.getSocklen());
+ if(ret < 0) {
+ int savederrno = errno;
+ RuntimeError(boost::format("connecting socket to %s: %s") % remote.toStringWithPort() % strerror(savederrno));
+ }
+ return ret;
+}
+
+int SConnectWithTimeout(int sockfd, const ComboAddress& remote, const struct timeval& timeout)
+{
+ int ret = connect(sockfd, reinterpret_cast<const struct sockaddr*>(&remote), remote.getSocklen());
+ if(ret < 0) {
+ int savederrno = errno;
+ if (savederrno == EINPROGRESS) {
+ if (timeout <= timeval{0,0}) {
+ return savederrno;
+ }
+
+ /* we wait until the connection has been established */
+ bool error = false;
+ bool disconnected = false;
+ int res = waitForRWData(sockfd, false, timeout.tv_sec, timeout.tv_usec, &error, &disconnected);
+ if (res == 1) {
+ if (error) {
+ savederrno = 0;
+ socklen_t errlen = sizeof(savederrno);
+ if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, (void *)&savederrno, &errlen) == 0) {
+ NetworkErr(boost::format("connecting to %s failed: %s") % remote.toStringWithPort() % string(strerror(savederrno)));
+ }
+ else {
+ NetworkErr(boost::format("connecting to %s failed") % remote.toStringWithPort());
+ }
+ }
+ if (disconnected) {
+ NetworkErr(boost::format("%s closed the connection") % remote.toStringWithPort());
+ }
+ return 0;
+ }
+ else if (res == 0) {
+ NetworkErr(boost::format("timeout while connecting to %s") % remote.toStringWithPort());
+ } else if (res < 0) {
+ savederrno = errno;
+ NetworkErr(boost::format("waiting to connect to %s: %s") % remote.toStringWithPort() % string(strerror(savederrno)));
+ }
+ }
+ else {
+ NetworkErr(boost::format("connecting to %s: %s") % remote.toStringWithPort() % string(strerror(savederrno)));
+ }
+ }
+
+ return 0;
+}
+
+int SBind(int sockfd, const ComboAddress& local)
+{
+ int ret = bind(sockfd, (struct sockaddr*)&local, local.getSocklen());
+ if(ret < 0) {
+ int savederrno = errno;
+ RuntimeError(boost::format("binding socket to %s: %s") % local.toStringWithPort() % strerror(savederrno));
+ }
+ return ret;
+}
+
+int SAccept(int sockfd, ComboAddress& remote)
+{
+ socklen_t remlen = remote.getSocklen();
+
+ int ret = accept(sockfd, (struct sockaddr*)&remote, &remlen);
+ if(ret < 0)
+ RuntimeError(boost::format("accepting new connection on socket: %s") % stringerror());
+ return ret;
+}
+
+int SListen(int sockfd, int limit)
+{
+ int ret = listen(sockfd, limit);
+ if(ret < 0)
+ RuntimeError(boost::format("setting socket to listen: %s") % stringerror());
+ return ret;
+}
+
+int SSetsockopt(int sockfd, int level, int opname, int value)
+{
+ int ret = setsockopt(sockfd, level, opname, &value, sizeof(value));
+ if(ret < 0)
+ RuntimeError(boost::format("setsockopt for level %d and opname %d to %d failed: %s") % level % opname % value % stringerror());
+ return ret;
+}
+
+void setSocketIgnorePMTU(int sockfd, int family)
+{
+ if (family == AF_INET) {
+#if defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT)
+#ifdef IP_PMTUDISC_OMIT
+ /* Linux 3.15+ has IP_PMTUDISC_OMIT, which discards PMTU information to prevent
+ poisoning, but still allows fragmentation if the packet size exceeds the
+ outgoing interface MTU, which is good.
+ */
+ try {
+ SSetsockopt(sockfd, IPPROTO_IP, IP_MTU_DISCOVER, IP_PMTUDISC_OMIT);
+ return;
+ }
+ catch(const std::exception& e) {
+ /* failed, let's try IP_PMTUDISC_DONT instead */
+ }
+#endif /* IP_PMTUDISC_OMIT */
+
+ /* IP_PMTUDISC_DONT disables Path MTU discovery */
+ SSetsockopt(sockfd, IPPROTO_IP, IP_MTU_DISCOVER, IP_PMTUDISC_DONT);
+#endif /* defined(IP_MTU_DISCOVER) && defined(IP_PMTUDISC_DONT) */
+ }
+ else {
+ #if defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DONT)
+#ifdef IPV6_PMTUDISC_OMIT
+ /* Linux 3.15+ has IPV6_PMTUDISC_OMIT, which discards PMTU information to prevent
+ poisoning, but still allows fragmentation if the packet size exceeds the
+ outgoing interface MTU, which is good.
+ */
+ try {
+ SSetsockopt(sockfd, IPPROTO_IPV6, IPV6_MTU_DISCOVER, IPV6_PMTUDISC_OMIT);
+ return;
+ }
+ catch(const std::exception& e) {
+ /* failed, let's try IP_PMTUDISC_DONT instead */
+ }
+#endif /* IPV6_PMTUDISC_OMIT */
+
+ /* IPV6_PMTUDISC_DONT disables Path MTU discovery */
+ SSetsockopt(sockfd, IPPROTO_IPV6, IPV6_MTU_DISCOVER, IPV6_PMTUDISC_DONT);
+#endif /* defined(IPV6_MTU_DISCOVER) && defined(IPV6_PMTUDISC_DONT) */
+ }
+}
+
+
+bool setReusePort(int sockfd)
+{
+#if defined(SO_REUSEPORT_LB)
+ try {
+ SSetsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT_LB, 1);
+ return true;
+ }
+ catch (const std::exception& e) {
+ return false;
+ }
+#elif defined(SO_REUSEPORT)
+ try {
+ SSetsockopt(sockfd, SOL_SOCKET, SO_REUSEPORT, 1);
+ return true;
+ }
+ catch (const std::exception& e) {
+ return false;
+ }
+#endif
+ return false;
+}
+
+bool HarvestTimestamp(struct msghdr* msgh, struct timeval* tv)
+{
+#ifdef SO_TIMESTAMP
+ struct cmsghdr *cmsg;
+ for (cmsg = CMSG_FIRSTHDR(msgh); cmsg != nullptr; cmsg = CMSG_NXTHDR(msgh,cmsg)) {
+ if ((cmsg->cmsg_level == SOL_SOCKET) && (cmsg->cmsg_type == SO_TIMESTAMP || cmsg->cmsg_type == SCM_TIMESTAMP) &&
+ CMSG_LEN(sizeof(*tv)) == cmsg->cmsg_len) {
+ memcpy(tv, CMSG_DATA(cmsg), sizeof(*tv));
+ return true;
+ }
+ }
+#endif
+ return false;
+}
+bool HarvestDestinationAddress(const struct msghdr* msgh, ComboAddress* destination)
+{
+ destination->reset();
+#ifdef __NetBSD__
+ struct cmsghdr* cmsg;
+#else
+ const struct cmsghdr* cmsg;
+#endif
+ for (cmsg = CMSG_FIRSTHDR(msgh); cmsg != nullptr; cmsg = CMSG_NXTHDR(const_cast<struct msghdr*>(msgh), const_cast<struct cmsghdr*>(cmsg))) {
+#if defined(IP_PKTINFO)
+ if ((cmsg->cmsg_level == IPPROTO_IP) && (cmsg->cmsg_type == IP_PKTINFO)) {
+ struct in_pktinfo *i = (struct in_pktinfo *) CMSG_DATA(cmsg);
+ destination->sin4.sin_addr = i->ipi_addr;
+ destination->sin4.sin_family = AF_INET;
+ return true;
+ }
+#elif defined(IP_RECVDSTADDR)
+ if ((cmsg->cmsg_level == IPPROTO_IP) && (cmsg->cmsg_type == IP_RECVDSTADDR)) {
+ struct in_addr *i = (struct in_addr *) CMSG_DATA(cmsg);
+ destination->sin4.sin_addr = *i;
+ destination->sin4.sin_family = AF_INET;
+ return true;
+ }
+#endif
+
+ if ((cmsg->cmsg_level == IPPROTO_IPV6) && (cmsg->cmsg_type == IPV6_PKTINFO)) {
+ struct in6_pktinfo *i = (struct in6_pktinfo *) CMSG_DATA(cmsg);
+ destination->sin6.sin6_addr = i->ipi6_addr;
+ destination->sin4.sin_family = AF_INET6;
+ return true;
+ }
+ }
+ return false;
+}
+
+bool IsAnyAddress(const ComboAddress& addr)
+{
+ if(addr.sin4.sin_family == AF_INET)
+ return addr.sin4.sin_addr.s_addr == 0;
+ else if(addr.sin4.sin_family == AF_INET6)
+ return !memcmp(&addr.sin6.sin6_addr, &in6addr_any, sizeof(addr.sin6.sin6_addr));
+
+ return false;
+}
+int sendOnNBSocket(int fd, const struct msghdr *msgh)
+{
+ int sendErr = 0;
+#ifdef __OpenBSD__
+ // OpenBSD can and does return EAGAIN on non-blocking datagram sockets
+ for (int i = 0; i < 10; i++) { // Arbitrary upper bound
+ if (sendmsg(fd, msgh, 0) != -1) {
+ sendErr = 0;
+ break;
+ }
+ sendErr = errno;
+ if (sendErr != EAGAIN) {
+ break;
+ }
+ }
+#else
+ if (sendmsg(fd, msgh, 0) == -1) {
+ sendErr = errno;
+ }
+#endif
+ return sendErr;
+}
+
+ssize_t sendfromto(int sock, const void* data, size_t len, int flags, const ComboAddress& from, const ComboAddress& to)
+{
+ struct msghdr msgh;
+ struct iovec iov;
+ cmsgbuf_aligned cbuf;
+
+ /* Set up iov and msgh structures. */
+ memset(&msgh, 0, sizeof(struct msghdr));
+ iov.iov_base = const_cast<void*>(data);
+ iov.iov_len = len;
+ msgh.msg_iov = &iov;
+ msgh.msg_iovlen = 1;
+ msgh.msg_name = (struct sockaddr*)&to;
+ msgh.msg_namelen = to.getSocklen();
+
+ if(from.sin4.sin_family) {
+ addCMsgSrcAddr(&msgh, &cbuf, &from, 0);
+ }
+ else {
+ msgh.msg_control=nullptr;
+ }
+ return sendmsg(sock, &msgh, flags);
+}
+
+// be careful: when using this for receive purposes, make sure addr->sin4.sin_family is set appropriately so getSocklen works!
+// be careful: when using this function for *send* purposes, be sure to set cbufsize to 0!
+// be careful: if you don't call addCMsgSrcAddr after fillMSGHdr, make sure to set msg_control to NULL
+void fillMSGHdr(struct msghdr* msgh, struct iovec* iov, cmsgbuf_aligned* cbuf, size_t cbufsize, char* data, size_t datalen, ComboAddress* addr)
+{
+ iov->iov_base = data;
+ iov->iov_len = datalen;
+
+ memset(msgh, 0, sizeof(struct msghdr));
+
+ msgh->msg_control = cbuf;
+ msgh->msg_controllen = cbufsize;
+ msgh->msg_name = addr;
+ msgh->msg_namelen = addr->getSocklen();
+ msgh->msg_iov = iov;
+ msgh->msg_iovlen = 1;
+ msgh->msg_flags = 0;
+}
+
+// warning: various parts of PowerDNS assume 'truncate' will never throw
+void ComboAddress::truncate(unsigned int bits) noexcept
+{
+ uint8_t* start;
+ int len=4;
+ if(sin4.sin_family==AF_INET) {
+ if(bits >= 32)
+ return;
+ start = (uint8_t*)&sin4.sin_addr.s_addr;
+ len=4;
+ }
+ else {
+ if(bits >= 128)
+ return;
+ start = (uint8_t*)&sin6.sin6_addr.s6_addr;
+ len=16;
+ }
+
+ auto tozero= len*8 - bits; // if set to 22, this will clear 1 byte, as it should
+
+ memset(start + len - tozero/8, 0, tozero/8); // blot out the whole bytes on the right
+
+ auto bitsleft=tozero % 8; // 2 bits left to clear
+
+ // a b c d, to truncate to 22 bits, we just zeroed 'd' and need to zero 2 bits from c
+ // so and by '11111100', which is ~((1<<2)-1) = ~3
+ uint8_t* place = start + len - 1 - tozero/8;
+ *place &= (~((1<<bitsleft)-1));
+}
+
+size_t sendMsgWithOptions(int fd, const char* buffer, size_t len, const ComboAddress* dest, const ComboAddress* local, unsigned int localItf, int flags)
+{
+ struct msghdr msgh;
+ struct iovec iov;
+ cmsgbuf_aligned cbuf;
+
+ /* Set up iov and msgh structures. */
+ memset(&msgh, 0, sizeof(struct msghdr));
+ msgh.msg_control = nullptr;
+ msgh.msg_controllen = 0;
+ if (dest) {
+ msgh.msg_name = reinterpret_cast<void*>(const_cast<ComboAddress*>(dest));
+ msgh.msg_namelen = dest->getSocklen();
+ }
+ else {
+ msgh.msg_name = nullptr;
+ msgh.msg_namelen = 0;
+ }
+
+ msgh.msg_flags = 0;
+
+ if (localItf != 0 && local) {
+ addCMsgSrcAddr(&msgh, &cbuf, local, localItf);
+ }
+
+ iov.iov_base = reinterpret_cast<void*>(const_cast<char*>(buffer));
+ iov.iov_len = len;
+ msgh.msg_iov = &iov;
+ msgh.msg_iovlen = 1;
+ msgh.msg_flags = 0;
+
+ size_t sent = 0;
+ bool firstTry = true;
+
+ do {
+
+#ifdef MSG_FASTOPEN
+ if (flags & MSG_FASTOPEN && firstTry == false) {
+ flags &= ~MSG_FASTOPEN;
+ }
+#endif /* MSG_FASTOPEN */
+
+ ssize_t res = sendmsg(fd, &msgh, flags);
+
+ if (res > 0) {
+ size_t written = static_cast<size_t>(res);
+ sent += written;
+
+ if (sent == len) {
+ return sent;
+ }
+
+ /* partial write */
+ firstTry = false;
+ iov.iov_len -= written;
+ iov.iov_base = reinterpret_cast<void*>(reinterpret_cast<char*>(iov.iov_base) + written);
+ }
+ else if (res == 0) {
+ return res;
+ }
+ else if (res == -1) {
+ int err = errno;
+ if (err == EINTR) {
+ continue;
+ }
+ else if (err == EAGAIN || err == EWOULDBLOCK || err == EINPROGRESS || err == ENOTCONN) {
+ /* EINPROGRESS might happen with non blocking socket,
+ especially with TCP Fast Open */
+ return sent;
+ }
+ else {
+ unixDie("failed in sendMsgWithTimeout");
+ }
+ }
+ }
+ while (true);
+
+ return 0;
+}
+
+template class NetmaskTree<bool, Netmask>;
+
+/* requires a non-blocking socket.
+ On Linux, we could use MSG_DONTWAIT on a blocking socket
+ but this is not portable.
+*/
+bool isTCPSocketUsable(int sock)
+{
+ int err = 0;
+ char buf = '\0';
+ size_t buf_size = sizeof(buf);
+
+ do {
+ ssize_t got = recv(sock, &buf, buf_size, MSG_PEEK);
+
+ if (got > 0) {
+ /* socket is usable, some data is even waiting to be read */
+ return true;
+ }
+ else if (got == 0) {
+ /* other end has closed the socket */
+ return false;
+ }
+ else {
+ err = errno;
+
+ if (err == EAGAIN || err == EWOULDBLOCK) {
+ /* socket is usable, no data waiting */
+ return true;
+ }
+ else {
+ if (err != EINTR) {
+ /* something is wrong, could be ECONNRESET,
+ ENOTCONN, EPIPE, but anyway this socket is
+ not usable. */
+ return false;
+ }
+ }
+ }
+ } while (err == EINTR);
+
+ return false;
+}
+/* mission in life: parse four cases
+ 1) [2002::1]:53
+ 2) 1.2.3.4
+ 3) 1.2.3.4:5300
+ 4) 2001::1 no port allowed
+*/
+
+ComboAddress parseIPAndPort(const std::string& input, uint16_t port)
+{
+ if (input[0] == '[') { // case 1
+ auto both = splitField(input.substr(1), ']');
+ return ComboAddress(both.first, both.second.empty() ? port : static_cast<uint16_t>(pdns_stou(both.second.substr(1))));
+ }
+
+ string::size_type count = 0;
+ for (char c : input) {
+ if (c == ':') {
+ count++;
+ }
+ if (count > 1) {
+ break;
+ }
+ }
+ switch (count) {
+ case 0: // case 2
+ return ComboAddress(input, port);
+ case 1: { // case 3
+ string::size_type cpos = input.rfind(':');
+ pair<std::string,std::string> both;
+ both.first = input.substr(0, cpos);
+ both.second = input.substr(cpos + 1);
+
+ uint16_t newport = static_cast<uint16_t>(pdns_stou(both.second));
+ return ComboAddress(both.first, newport);
+ }
+ default: // case 4
+ return ComboAddress(input, port);
+ }
+}
+
+void setSocketBuffer(int fd, int optname, uint32_t size)
+{
+ uint32_t psize = 0;
+ socklen_t len = sizeof(psize);
+
+ if (!getsockopt(fd, SOL_SOCKET, optname, &psize, &len) && psize > size) {
+ throw std::runtime_error("Not decreasing socket buffer size from " + std::to_string(psize) + " to " + std::to_string(size));
+ }
+
+ if (setsockopt(fd, SOL_SOCKET, optname, &size, sizeof(size)) < 0) {
+ throw std::runtime_error("Unable to raise socket buffer size to " + std::to_string(size) + ": " + stringerror());
+ }
+}
+
+void setSocketReceiveBuffer(int fd, uint32_t size)
+{
+ setSocketBuffer(fd, SO_RCVBUF, size);
+}
+
+void setSocketSendBuffer(int fd, uint32_t size)
+{
+ setSocketBuffer(fd, SO_SNDBUF, size);
+}
diff --git a/iputils.hh b/iputils.hh
new file mode 100644
index 0000000..cca7714
--- /dev/null
+++ b/iputils.hh
@@ -0,0 +1,1657 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <string>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <iostream>
+#include <stdio.h>
+#include <functional>
+#include <bitset>
+#include "pdnsexception.hh"
+#include "misc.hh"
+#include <netdb.h>
+#include <sstream>
+#include <boost/tuple/tuple.hpp>
+#include <boost/tuple/tuple_comparison.hpp>
+
+#include "namespaces.hh"
+
+#ifdef __APPLE__
+#include <libkern/OSByteOrder.h>
+
+#define htobe16(x) OSSwapHostToBigInt16(x)
+#define htole16(x) OSSwapHostToLittleInt16(x)
+#define be16toh(x) OSSwapBigToHostInt16(x)
+#define le16toh(x) OSSwapLittleToHostInt16(x)
+
+#define htobe32(x) OSSwapHostToBigInt32(x)
+#define htole32(x) OSSwapHostToLittleInt32(x)
+#define be32toh(x) OSSwapBigToHostInt32(x)
+#define le32toh(x) OSSwapLittleToHostInt32(x)
+
+#define htobe64(x) OSSwapHostToBigInt64(x)
+#define htole64(x) OSSwapHostToLittleInt64(x)
+#define be64toh(x) OSSwapBigToHostInt64(x)
+#define le64toh(x) OSSwapLittleToHostInt64(x)
+#endif
+
+#ifdef __sun
+
+#define htobe16(x) BE_16(x)
+#define htole16(x) LE_16(x)
+#define be16toh(x) BE_IN16(&(x))
+#define le16toh(x) LE_IN16(&(x))
+
+#define htobe32(x) BE_32(x)
+#define htole32(x) LE_32(x)
+#define be32toh(x) BE_IN32(&(x))
+#define le32toh(x) LE_IN32(&(x))
+
+#define htobe64(x) BE_64(x)
+#define htole64(x) LE_64(x)
+#define be64toh(x) BE_IN64(&(x))
+#define le64toh(x) LE_IN64(&(x))
+
+#endif
+
+#ifdef __FreeBSD__
+#include <sys/endian.h>
+#endif
+
+#if defined(__NetBSD__) && defined(IP_PKTINFO) && !defined(IP_SENDSRCADDR)
+// The IP_PKTINFO option in NetBSD was incompatible with Linux until a
+// change that also introduced IP_SENDSRCADDR for FreeBSD compatibility.
+#undef IP_PKTINFO
+#endif
+
+union ComboAddress {
+ struct sockaddr_in sin4;
+ struct sockaddr_in6 sin6;
+
+ bool operator==(const ComboAddress& rhs) const
+ {
+ if(boost::tie(sin4.sin_family, sin4.sin_port) != boost::tie(rhs.sin4.sin_family, rhs.sin4.sin_port))
+ return false;
+ if(sin4.sin_family == AF_INET)
+ return sin4.sin_addr.s_addr == rhs.sin4.sin_addr.s_addr;
+ else
+ return memcmp(&sin6.sin6_addr.s6_addr, &rhs.sin6.sin6_addr.s6_addr, sizeof(sin6.sin6_addr.s6_addr))==0;
+ }
+
+ bool operator!=(const ComboAddress& rhs) const
+ {
+ return(!operator==(rhs));
+ }
+
+ bool operator<(const ComboAddress& rhs) const
+ {
+ if(sin4.sin_family == 0) {
+ return false;
+ }
+ if(boost::tie(sin4.sin_family, sin4.sin_port) < boost::tie(rhs.sin4.sin_family, rhs.sin4.sin_port))
+ return true;
+ if(boost::tie(sin4.sin_family, sin4.sin_port) > boost::tie(rhs.sin4.sin_family, rhs.sin4.sin_port))
+ return false;
+
+ if(sin4.sin_family == AF_INET)
+ return sin4.sin_addr.s_addr < rhs.sin4.sin_addr.s_addr;
+ else
+ return memcmp(&sin6.sin6_addr.s6_addr, &rhs.sin6.sin6_addr.s6_addr, sizeof(sin6.sin6_addr.s6_addr)) < 0;
+ }
+
+ bool operator>(const ComboAddress& rhs) const
+ {
+ return rhs.operator<(*this);
+ }
+
+ struct addressOnlyHash
+ {
+ uint32_t operator()(const ComboAddress& ca) const
+ {
+ const unsigned char* start = nullptr;
+ uint32_t len = 0;
+ if (ca.sin4.sin_family == AF_INET) {
+ start = reinterpret_cast<const unsigned char*>(&ca.sin4.sin_addr.s_addr);
+ len = 4;
+ }
+ else {
+ start = reinterpret_cast<const unsigned char*>(&ca.sin6.sin6_addr.s6_addr);
+ len = 16;
+ }
+ return burtle(start, len, 0);
+ }
+ };
+
+ struct addressOnlyLessThan
+ {
+ bool operator()(const ComboAddress& a, const ComboAddress& b) const
+ {
+ if(a.sin4.sin_family < b.sin4.sin_family)
+ return true;
+ if(a.sin4.sin_family > b.sin4.sin_family)
+ return false;
+ if(a.sin4.sin_family == AF_INET)
+ return a.sin4.sin_addr.s_addr < b.sin4.sin_addr.s_addr;
+ else
+ return memcmp(&a.sin6.sin6_addr.s6_addr, &b.sin6.sin6_addr.s6_addr, sizeof(a.sin6.sin6_addr.s6_addr)) < 0;
+ }
+ };
+
+ struct addressOnlyEqual
+ {
+ bool operator()(const ComboAddress& a, const ComboAddress& b) const
+ {
+ if(a.sin4.sin_family != b.sin4.sin_family)
+ return false;
+ if(a.sin4.sin_family == AF_INET)
+ return a.sin4.sin_addr.s_addr == b.sin4.sin_addr.s_addr;
+ else
+ return !memcmp(&a.sin6.sin6_addr.s6_addr, &b.sin6.sin6_addr.s6_addr, sizeof(a.sin6.sin6_addr.s6_addr));
+ }
+ };
+
+
+ socklen_t getSocklen() const
+ {
+ if(sin4.sin_family == AF_INET)
+ return sizeof(sin4);
+ else
+ return sizeof(sin6);
+ }
+
+ ComboAddress()
+ {
+ sin4.sin_family=AF_INET;
+ sin4.sin_addr.s_addr=0;
+ sin4.sin_port=0;
+ sin6.sin6_scope_id = 0;
+ sin6.sin6_flowinfo = 0;
+ }
+
+ ComboAddress(const struct sockaddr *sa, socklen_t salen) {
+ setSockaddr(sa, salen);
+ };
+
+ ComboAddress(const struct sockaddr_in6 *sa) {
+ setSockaddr((const struct sockaddr*)sa, sizeof(struct sockaddr_in6));
+ };
+
+ ComboAddress(const struct sockaddr_in *sa) {
+ setSockaddr((const struct sockaddr*)sa, sizeof(struct sockaddr_in));
+ };
+
+ void setSockaddr(const struct sockaddr *sa, socklen_t salen) {
+ if (salen > sizeof(struct sockaddr_in6)) throw PDNSException("ComboAddress can't handle other than sockaddr_in or sockaddr_in6");
+ memcpy(this, sa, salen);
+ }
+
+ // 'port' sets a default value in case 'str' does not set a port
+ explicit ComboAddress(const string& str, uint16_t port=0)
+ {
+ memset(&sin6, 0, sizeof(sin6));
+ sin4.sin_family = AF_INET;
+ sin4.sin_port = 0;
+ if(makeIPv4sockaddr(str, &sin4)) {
+ sin6.sin6_family = AF_INET6;
+ if(makeIPv6sockaddr(str, &sin6) < 0)
+ throw PDNSException("Unable to convert presentation address '"+ str +"'");
+
+ }
+ if(!sin4.sin_port) // 'str' overrides port!
+ sin4.sin_port=htons(port);
+ }
+
+ bool isIPv6() const
+ {
+ return sin4.sin_family == AF_INET6;
+ }
+ bool isIPv4() const
+ {
+ return sin4.sin_family == AF_INET;
+ }
+
+ bool isMappedIPv4() const
+ {
+ if(sin4.sin_family!=AF_INET6)
+ return false;
+
+ int n=0;
+ const unsigned char* ptr = reinterpret_cast<const unsigned char*>(&sin6.sin6_addr.s6_addr);
+ for(n=0; n < 10; ++n)
+ if(ptr[n])
+ return false;
+
+ for(; n < 12; ++n)
+ if(ptr[n]!=0xff)
+ return false;
+
+ return true;
+ }
+
+ ComboAddress mapToIPv4() const
+ {
+ if(!isMappedIPv4())
+ throw PDNSException("ComboAddress can't map non-mapped IPv6 address back to IPv4");
+ ComboAddress ret;
+ ret.sin4.sin_family=AF_INET;
+ ret.sin4.sin_port=sin4.sin_port;
+
+ const unsigned char* ptr = reinterpret_cast<const unsigned char*>(&sin6.sin6_addr.s6_addr);
+ ptr+=(sizeof(sin6.sin6_addr.s6_addr) - sizeof(ret.sin4.sin_addr.s_addr));
+ memcpy(&ret.sin4.sin_addr.s_addr, ptr, sizeof(ret.sin4.sin_addr.s_addr));
+ return ret;
+ }
+
+ string toString() const
+ {
+ char host[1024];
+ int retval = 0;
+ if(sin4.sin_family && !(retval = getnameinfo(reinterpret_cast<const struct sockaddr*>(this), getSocklen(), host, sizeof(host),0, 0, NI_NUMERICHOST)))
+ return string(host);
+ else
+ return "invalid "+string(gai_strerror(retval));
+ }
+
+ //! Ignores any interface specifiers possibly available in the sockaddr data.
+ string toStringNoInterface() const
+ {
+ char host[1024];
+ if(sin4.sin_family == AF_INET && (nullptr != inet_ntop(sin4.sin_family, &sin4.sin_addr, host, sizeof(host))))
+ return string(host);
+ else if(sin4.sin_family == AF_INET6 && (nullptr != inet_ntop(sin4.sin_family, &sin6.sin6_addr, host, sizeof(host))))
+ return string(host);
+ else
+ return "invalid "+stringerror();
+ }
+
+ string toStringWithPort() const
+ {
+ if(sin4.sin_family==AF_INET)
+ return toString() + ":" + std::to_string(ntohs(sin4.sin_port));
+ else
+ return "["+toString() + "]:" + std::to_string(ntohs(sin4.sin_port));
+ }
+
+ string toStringWithPortExcept(int port) const
+ {
+ if(ntohs(sin4.sin_port) == port)
+ return toString();
+ if(sin4.sin_family==AF_INET)
+ return toString() + ":" + std::to_string(ntohs(sin4.sin_port));
+ else
+ return "["+toString() + "]:" + std::to_string(ntohs(sin4.sin_port));
+ }
+
+ string toLogString() const
+ {
+ return toStringWithPortExcept(53);
+ }
+
+ string toByteString() const
+ {
+ if (isIPv4()) {
+ return string(reinterpret_cast<const char*>(&sin4.sin_addr.s_addr), sizeof(sin4.sin_addr.s_addr));
+ }
+ return string(reinterpret_cast<const char*>(&sin6.sin6_addr.s6_addr), sizeof(sin6.sin6_addr.s6_addr));
+ }
+
+ void truncate(unsigned int bits) noexcept;
+
+ uint16_t getPort() const
+ {
+ return ntohs(sin4.sin_port);
+ }
+
+ void setPort(uint16_t port)
+ {
+ sin4.sin_port = htons(port);
+ }
+
+ void reset()
+ {
+ memset(&sin4, 0, sizeof(sin4));
+ memset(&sin6, 0, sizeof(sin6));
+ }
+
+ //! Get the total number of address bits (either 32 or 128 depending on IP version)
+ uint8_t getBits() const
+ {
+ if (isIPv4())
+ return 32;
+ if (isIPv6())
+ return 128;
+ return 0;
+ }
+ /** Get the value of the bit at the provided bit index. When the index >= 0,
+ the index is relative to the LSB starting at index zero. When the index < 0,
+ the index is relative to the MSB starting at index -1 and counting down.
+ */
+ bool getBit(int index) const
+ {
+ if(isIPv4()) {
+ if (index >= 32)
+ return false;
+ if (index < 0) {
+ if (index < -32)
+ return false;
+ index = 32 + index;
+ }
+
+ uint32_t ls_addr = ntohl(sin4.sin_addr.s_addr);
+
+ return ((ls_addr & (1U<<index)) != 0x00000000);
+ }
+ if(isIPv6()) {
+ if (index >= 128)
+ return false;
+ if (index < 0) {
+ if (index < -128)
+ return false;
+ index = 128 + index;
+ }
+
+ const uint8_t* ls_addr = reinterpret_cast<const uint8_t*>(sin6.sin6_addr.s6_addr);
+ uint8_t byte_idx = index / 8;
+ uint8_t bit_idx = index % 8;
+
+ return ((ls_addr[15-byte_idx] & (1U << bit_idx)) != 0x00);
+ }
+ return false;
+ }
+
+ /*! Returns a comma-separated string of IP addresses
+ *
+ * \param c An stl container with ComboAddresses
+ * \param withPort Also print the port (default true)
+ * \param portExcept Print the port, except when this is the port (default 53)
+ */
+ template < template < class ... > class Container, class ... Args >
+ static string caContainerToString(const Container<ComboAddress, Args...>& c, const bool withPort = true, const uint16_t portExcept = 53) {
+ vector<string> strs;
+ for (const auto& ca : c) {
+ if (withPort) {
+ strs.push_back(ca.toStringWithPortExcept(portExcept));
+ continue;
+ }
+ strs.push_back(ca.toString());
+ }
+ return boost::join(strs, ",");
+ };
+};
+
+/** This exception is thrown by the Netmask class and by extension by the NetmaskGroup class */
+class NetmaskException: public PDNSException
+{
+public:
+ NetmaskException(const string &a) : PDNSException(a) {}
+};
+
+inline ComboAddress makeComboAddress(const string& str)
+{
+ ComboAddress address;
+ address.sin4.sin_family=AF_INET;
+ if(inet_pton(AF_INET, str.c_str(), &address.sin4.sin_addr) <= 0) {
+ address.sin4.sin_family=AF_INET6;
+ if(makeIPv6sockaddr(str, &address.sin6) < 0)
+ throw NetmaskException("Unable to convert '"+str+"' to a netmask");
+ }
+ return address;
+}
+
+inline ComboAddress makeComboAddressFromRaw(uint8_t version, const char* raw, size_t len)
+{
+ ComboAddress address;
+
+ if (version == 4) {
+ address.sin4.sin_family = AF_INET;
+ if (len != sizeof(address.sin4.sin_addr)) throw NetmaskException("invalid raw address length");
+ memcpy(&address.sin4.sin_addr, raw, sizeof(address.sin4.sin_addr));
+ }
+ else if (version == 6) {
+ address.sin6.sin6_family = AF_INET6;
+ if (len != sizeof(address.sin6.sin6_addr)) throw NetmaskException("invalid raw address length");
+ memcpy(&address.sin6.sin6_addr, raw, sizeof(address.sin6.sin6_addr));
+ }
+ else throw NetmaskException("invalid address family");
+
+ return address;
+}
+
+inline ComboAddress makeComboAddressFromRaw(uint8_t version, const string &str)
+{
+ return makeComboAddressFromRaw(version, str.c_str(), str.size());
+}
+
+/** This class represents a netmask and can be queried to see if a certain
+ IP address is matched by this mask */
+class Netmask
+{
+public:
+ Netmask()
+ {
+ d_network.sin4.sin_family = 0; // disable this doing anything useful
+ d_network.sin4.sin_port = 0; // this guarantees d_network compares identical
+ d_mask = 0;
+ d_bits = 0;
+ }
+
+ Netmask(const ComboAddress& network, uint8_t bits=0xff): d_network(network)
+ {
+ d_network.sin4.sin_port = 0;
+ setBits(network.isIPv4() ? std::min(bits, static_cast<uint8_t>(32)) : std::min(bits, static_cast<uint8_t>(128)));
+ }
+
+ void setBits(uint8_t value)
+ {
+ d_bits = value;
+
+ if (d_bits < 32) {
+ d_mask = ~(0xFFFFFFFF >> d_bits);
+ }
+ else {
+ // note that d_mask is unused for IPv6
+ d_mask = 0xFFFFFFFF;
+ }
+
+ if (isIPv4()) {
+ d_network.sin4.sin_addr.s_addr = htonl(ntohl(d_network.sin4.sin_addr.s_addr) & d_mask);
+ }
+ else if (isIPv6()) {
+ uint8_t bytes = d_bits/8;
+ uint8_t *us = (uint8_t*) &d_network.sin6.sin6_addr.s6_addr;
+ uint8_t bits = d_bits % 8;
+ uint8_t mask = (uint8_t) ~(0xFF>>bits);
+
+ if (bytes < sizeof(d_network.sin6.sin6_addr.s6_addr)) {
+ us[bytes] &= mask;
+ }
+
+ for(size_t idx = bytes + 1; idx < sizeof(d_network.sin6.sin6_addr.s6_addr); ++idx) {
+ us[idx] = 0;
+ }
+ }
+ }
+
+ //! Constructor supplies the mask, which cannot be changed
+ Netmask(const string &mask)
+ {
+ pair<string,string> split = splitField(mask,'/');
+ d_network = makeComboAddress(split.first);
+
+ if (!split.second.empty()) {
+ setBits(static_cast<uint8_t>(pdns_stou(split.second)));
+ }
+ else if (d_network.sin4.sin_family == AF_INET) {
+ setBits(32);
+ }
+ else {
+ setBits(128);
+ }
+ }
+
+ bool match(const ComboAddress& ip) const
+ {
+ return match(&ip);
+ }
+
+ //! If this IP address in socket address matches
+ bool match(const ComboAddress *ip) const
+ {
+ if(d_network.sin4.sin_family != ip->sin4.sin_family) {
+ return false;
+ }
+ if(d_network.sin4.sin_family == AF_INET) {
+ return match4(htonl((unsigned int)ip->sin4.sin_addr.s_addr));
+ }
+ if(d_network.sin6.sin6_family == AF_INET6) {
+ uint8_t bytes=d_bits/8, n;
+ const uint8_t *us=(const uint8_t*) &d_network.sin6.sin6_addr.s6_addr;
+ const uint8_t *them=(const uint8_t*) &ip->sin6.sin6_addr.s6_addr;
+
+ for(n=0; n < bytes; ++n) {
+ if(us[n]!=them[n]) {
+ return false;
+ }
+ }
+ // still here, now match remaining bits
+ uint8_t bits= d_bits % 8;
+ uint8_t mask= (uint8_t) ~(0xFF>>bits);
+
+ return((us[n]) == (them[n] & mask));
+ }
+ return false;
+ }
+
+ //! If this ASCII IP address matches
+ bool match(const string &ip) const
+ {
+ ComboAddress address=makeComboAddress(ip);
+ return match(&address);
+ }
+
+ //! If this IP address in native format matches
+ bool match4(uint32_t ip) const
+ {
+ return (ip & d_mask) == (ntohl(d_network.sin4.sin_addr.s_addr));
+ }
+
+ string toString() const
+ {
+ return d_network.toStringNoInterface()+"/"+std::to_string((unsigned int)d_bits);
+ }
+
+ string toStringNoMask() const
+ {
+ return d_network.toStringNoInterface();
+ }
+
+ const ComboAddress& getNetwork() const
+ {
+ return d_network;
+ }
+
+ const ComboAddress& getMaskedNetwork() const
+ {
+ return getNetwork();
+ }
+
+ uint8_t getBits() const
+ {
+ return d_bits;
+ }
+
+ bool isIPv6() const
+ {
+ return d_network.sin6.sin6_family == AF_INET6;
+ }
+
+ bool isIPv4() const
+ {
+ return d_network.sin4.sin_family == AF_INET;
+ }
+
+ bool operator<(const Netmask& rhs) const
+ {
+ if (empty() && !rhs.empty())
+ return false;
+
+ if (!empty() && rhs.empty())
+ return true;
+
+ if (d_bits > rhs.d_bits)
+ return true;
+ if (d_bits < rhs.d_bits)
+ return false;
+
+ return d_network < rhs.d_network;
+ }
+
+ bool operator>(const Netmask& rhs) const
+ {
+ return rhs.operator<(*this);
+ }
+
+ bool operator==(const Netmask& rhs) const
+ {
+ return tie(d_network, d_bits) == tie(rhs.d_network, rhs.d_bits);
+ }
+
+ bool empty() const
+ {
+ return d_network.sin4.sin_family==0;
+ }
+
+ //! Get normalized version of the netmask. This means that all address bits below the network bits are zero.
+ Netmask getNormalized() const {
+ return Netmask(getMaskedNetwork(), d_bits);
+ }
+ //! Get Netmask for super network of this one (i.e. with fewer network bits)
+ Netmask getSuper(uint8_t bits) const {
+ return Netmask(d_network, std::min(d_bits, bits));
+ }
+
+ //! Get the total number of address bits for this netmask (either 32 or 128 depending on IP version)
+ uint8_t getFullBits() const
+ {
+ return d_network.getBits();
+ }
+
+ /** Get the value of the bit at the provided bit index. When the index >= 0,
+ the index is relative to the LSB starting at index zero. When the index < 0,
+ the index is relative to the MSB starting at index -1 and counting down.
+ When the index points outside the network bits, it always yields zero.
+ */
+ bool getBit(int bit) const
+ {
+ if (bit < -d_bits)
+ return false;
+ if (bit >= 0) {
+ if(isIPv4()) {
+ if (bit >= 32 || bit < (32 - d_bits))
+ return false;
+ }
+ if(isIPv6()) {
+ if (bit >= 128 || bit < (128 - d_bits))
+ return false;
+ }
+ }
+ return d_network.getBit(bit);
+ }
+
+private:
+ ComboAddress d_network;
+ uint32_t d_mask;
+ uint8_t d_bits;
+};
+
+/** Binary tree map implementation with <Netmask,T> pair.
+ *
+ * This is an binary tree implementation for storing attributes for IPv4 and IPv6 prefixes.
+ * The most simple use case is simple NetmaskTree<bool> used by NetmaskGroup, which only
+ * wants to know if given IP address is matched in the prefixes stored.
+ *
+ * This element is useful for anything that needs to *STORE* prefixes, and *MATCH* IP addresses
+ * to a *LIST* of *PREFIXES*. Not the other way round.
+ *
+ * You can store IPv4 and IPv6 addresses to same tree, separate payload storage is kept per AFI.
+ * Network prefixes (Netmasks) are always recorded in normalized fashion, meaning that only
+ * the network bits are set. This is what is returned in the insert() and lookup() return
+ * values.
+ *
+ * Use swap if you need to move the tree to another NetmaskTree instance, it is WAY faster
+ * than using copy ctor or assignment operator, since it moves the nodes and tree root to
+ * new home instead of actually recreating the tree.
+ *
+ * Please see NetmaskGroup for example of simple use case. Other usecases can be found
+ * from GeoIPBackend and Sortlist, and from dnsdist.
+ */
+template <typename T, class K = Netmask>
+class NetmaskTree {
+public:
+ class Iterator;
+
+ typedef K key_type;
+ typedef T value_type;
+ typedef std::pair<const key_type,value_type> node_type;
+ typedef size_t size_type;
+ typedef class Iterator iterator;
+
+private:
+ /** Single node in tree, internal use only.
+ */
+ class TreeNode : boost::noncopyable {
+ public:
+ explicit TreeNode() noexcept :
+ parent(nullptr), node(), assigned(false), d_bits(0) {
+ }
+ explicit TreeNode(const key_type& key) :
+ parent(nullptr), node({key.getNormalized(), value_type()}),
+ assigned(false), d_bits(key.getFullBits()) {
+ }
+
+ //<! Makes a left leaf node with specified key.
+ TreeNode* make_left(const key_type& key) {
+ d_bits = node.first.getBits();
+ left = make_unique<TreeNode>(key);
+ left->parent = this;
+ return left.get();
+ }
+
+ //<! Makes a right leaf node with specified key.
+ TreeNode* make_right(const key_type& key) {
+ d_bits = node.first.getBits();
+ right = make_unique<TreeNode>(key);
+ right->parent = this;
+ return right.get();
+ }
+
+ //<! Splits branch at indicated bit position by inserting key
+ TreeNode* split(const key_type& key, int bits) {
+ if (parent == nullptr) {
+ // not to be called on the root node
+ throw std::logic_error(
+ "NetmaskTree::TreeNode::split(): must not be called on root node");
+ }
+
+ // determine reference from parent
+ unique_ptr<TreeNode>& parent_ref =
+ (parent->left.get() == this ? parent->left : parent->right);
+ if (parent_ref.get() != this) {
+ throw std::logic_error(
+ "NetmaskTree::TreeNode::split(): parent node reference is invalid");
+ }
+
+ // create new tree node for the new key
+ TreeNode* new_node = new TreeNode(key);
+ new_node->d_bits = bits;
+
+ // attach the new node under our former parent
+ unique_ptr<TreeNode> new_child(new_node);
+ std::swap(parent_ref, new_child); // hereafter new_child points to "this"
+ new_node->parent = parent;
+
+ // attach "this" node below the new node
+ // (left or right depending on bit)
+ new_child->parent = new_node;
+ if (new_child->node.first.getBit(-1-bits)) {
+ std::swap(new_node->right, new_child);
+ } else {
+ std::swap(new_node->left, new_child);
+ }
+
+ return new_node;
+ }
+
+ //<! Forks branch for new key at indicated bit position
+ TreeNode* fork(const key_type& key, int bits) {
+ if (parent == nullptr) {
+ // not to be called on the root node
+ throw std::logic_error(
+ "NetmaskTree::TreeNode::fork(): must not be called on root node");
+ }
+
+ // determine reference from parent
+ unique_ptr<TreeNode>& parent_ref =
+ (parent->left.get() == this ? parent->left : parent->right);
+ if (parent_ref.get() != this) {
+ throw std::logic_error(
+ "NetmaskTree::TreeNode::fork(): parent node reference is invalid");
+ }
+
+ // create new tree node for the branch point
+ TreeNode* branch_node = new TreeNode(node.first.getSuper(bits));
+ branch_node->d_bits = bits;
+
+ // the current node will now be a child of the new branch node
+ // (hereafter new_child1 points to "this")
+ unique_ptr<TreeNode> new_child1 = std::move(parent_ref);
+ // attach the branch node under our former parent
+ parent_ref = std::unique_ptr<TreeNode>(branch_node);
+ branch_node->parent = parent;
+
+ // create second new leaf node for the new key
+ unique_ptr<TreeNode> new_child2 = make_unique<TreeNode>(key);
+ TreeNode* new_node = new_child2.get();
+
+ // attach the new child nodes below the branch node
+ // (left or right depending on bit)
+ new_child1->parent = branch_node;
+ new_child2->parent = branch_node;
+ if (new_child1->node.first.getBit(-1-bits)) {
+ branch_node->right = std::move(new_child1);
+ branch_node->left = std::move(new_child2);
+ } else {
+ branch_node->right = std::move(new_child2);
+ branch_node->left = std::move(new_child1);
+ }
+ // now we have attached the new unique pointers to the tree:
+ // - branch_node is below its parent
+ // - new_child1 (ourselves) is below branch_node
+ // - new_child2, the new leaf node, is below branch_node as well
+
+ return new_node;
+ }
+
+ //<! Traverse left branch depth-first
+ TreeNode *traverse_l()
+ {
+ TreeNode *tnode = this;
+
+ while (tnode->left)
+ tnode = tnode->left.get();
+ return tnode;
+ }
+
+ //<! Traverse tree depth-first and in-order (L-N-R)
+ TreeNode *traverse_lnr()
+ {
+ TreeNode *tnode = this;
+
+ // precondition: descended left as deep as possible
+ if (tnode->right) {
+ // descend right
+ tnode = tnode->right.get();
+ // descend left as deep as possible and return next node
+ return tnode->traverse_l();
+ }
+
+ // ascend to parent
+ while (tnode->parent != nullptr) {
+ TreeNode *prev_child = tnode;
+ tnode = tnode->parent;
+
+ // return this node, but only when we come from the left child branch
+ if (tnode->left && tnode->left.get() == prev_child)
+ return tnode;
+ }
+ return nullptr;
+ }
+
+ //<! Traverse only assigned nodes
+ TreeNode *traverse_lnr_assigned()
+ {
+ TreeNode *tnode = traverse_lnr();
+
+ while (tnode != nullptr && !tnode->assigned)
+ tnode = tnode->traverse_lnr();
+ return tnode;
+ }
+
+ unique_ptr<TreeNode> left;
+ unique_ptr<TreeNode> right;
+ TreeNode* parent;
+
+ node_type node;
+ bool assigned; //<! Whether this node is assigned-to by the application
+
+ int d_bits; //<! How many bits have been used so far
+ };
+
+ void cleanup_tree(TreeNode* node)
+ {
+ // only cleanup this node if it has no children and node not assigned
+ if (!(node->left || node->right || node->assigned)) {
+ // get parent node ptr
+ TreeNode* pparent = node->parent;
+ // delete this node
+ if (pparent) {
+ if (pparent->left.get() == node)
+ pparent->left.reset();
+ else
+ pparent->right.reset();
+ // now recurse up to the parent
+ cleanup_tree(pparent);
+ }
+ }
+ }
+
+ void copyTree(const NetmaskTree& rhs)
+ {
+ TreeNode *node;
+
+ node = rhs.d_root.get();
+ if (node != nullptr)
+ node = node->traverse_l();
+ while (node != nullptr) {
+ if (node->assigned)
+ insert(node->node.first).second = node->node.second;
+ node = node->traverse_lnr();
+ }
+ }
+
+public:
+ class Iterator {
+ public:
+ typedef node_type value_type;
+ typedef node_type& reference;
+ typedef node_type* pointer;
+ typedef std::forward_iterator_tag iterator_category;
+ typedef size_type difference_type;
+
+ private:
+ friend class NetmaskTree;
+
+ const NetmaskTree* d_tree;
+ TreeNode* d_node;
+
+ Iterator(const NetmaskTree* tree, TreeNode* node): d_tree(tree), d_node(node) {
+ }
+
+ public:
+ Iterator(): d_tree(nullptr), d_node(nullptr) {}
+
+ Iterator& operator++() // prefix
+ {
+ if (d_node == nullptr) {
+ throw std::logic_error(
+ "NetmaskTree::Iterator::operator++: iterator is invalid");
+ }
+ d_node = d_node->traverse_lnr_assigned();
+ return *this;
+ }
+ Iterator operator++(int) // postfix
+ {
+ Iterator tmp(*this);
+ operator++();
+ return tmp;
+ }
+
+ reference operator*()
+ {
+ if (d_node == nullptr) {
+ throw std::logic_error(
+ "NetmaskTree::Iterator::operator*: iterator is invalid");
+ }
+ return d_node->node;
+ }
+
+ pointer operator->()
+ {
+ if (d_node == nullptr) {
+ throw std::logic_error(
+ "NetmaskTree::Iterator::operator->: iterator is invalid");
+ }
+ return &d_node->node;
+ }
+
+ bool operator==(const Iterator& rhs)
+ {
+ return (d_tree == rhs.d_tree && d_node == rhs.d_node);
+ }
+ bool operator!=(const Iterator& rhs)
+ {
+ return !(*this == rhs);
+ }
+ };
+
+public:
+ NetmaskTree() noexcept: d_root(new TreeNode()), d_left(nullptr), d_size(0) {
+ }
+
+ NetmaskTree(const NetmaskTree& rhs): d_root(new TreeNode()), d_left(nullptr), d_size(0) {
+ copyTree(rhs);
+ }
+
+ NetmaskTree& operator=(const NetmaskTree& rhs) {
+ clear();
+ copyTree(rhs);
+ return *this;
+ }
+
+ const iterator begin() const {
+ return Iterator(this, d_left);
+ }
+ const iterator end() const {
+ return Iterator(this, nullptr);
+ }
+ iterator begin() {
+ return Iterator(this, d_left);
+ }
+ iterator end() {
+ return Iterator(this, nullptr);
+ }
+
+ node_type& insert(const string &mask) {
+ return insert(key_type(mask));
+ }
+
+ //<! Creates new value-pair in tree and returns it.
+ node_type& insert(const key_type& key) {
+ TreeNode* node;
+ bool is_left = true;
+
+ // we turn left on IPv4 and right on IPv6
+ if (key.isIPv4()) {
+ node = d_root->left.get();
+ if (node == nullptr) {
+ node = new TreeNode(key);
+ node->assigned = true;
+ node->parent = d_root.get();
+
+ d_root->left = unique_ptr<TreeNode>(node);
+ d_size++;
+ d_left = node;
+ return node->node;
+ }
+ } else if (key.isIPv6()) {
+ node = d_root->right.get();
+ if (node == nullptr) {
+ node = new TreeNode(key);
+ node->assigned = true;
+ node->parent = d_root.get();
+
+ d_root->right = unique_ptr<TreeNode>(node);
+ d_size++;
+ if (!d_root->left)
+ d_left = node;
+ return node->node;
+ }
+ if (d_root->left)
+ is_left = false;
+ } else
+ throw NetmaskException("invalid address family");
+
+ // we turn left on 0 and right on 1
+ int bits = 0;
+ for(; bits < key.getBits(); bits++) {
+ bool vall = key.getBit(-1-bits);
+
+ if (bits >= node->d_bits) {
+ // the end of the current node is reached; continue with the next
+ if (vall) {
+ if (node->left || node->assigned)
+ is_left = false;
+ if (!node->right) {
+ // the right branch doesn't exist yet; attach our key here
+ node = node->make_right(key);
+ break;
+ }
+ node = node->right.get();
+ } else {
+ if (!node->left) {
+ // the left branch doesn't exist yet; attach our key here
+ node = node->make_left(key);
+ break;
+ }
+ node = node->left.get();
+ }
+ continue;
+ }
+ if (bits >= node->node.first.getBits()) {
+ // the matching branch ends here, yet the key netmask has more bits; add a
+ // child node below the existing branch leaf.
+ if (vall) {
+ if (node->assigned)
+ is_left = false;
+ node = node->make_right(key);
+ } else {
+ node = node->make_left(key);
+ }
+ break;
+ }
+ bool valr = node->node.first.getBit(-1-bits);
+ if (vall != valr) {
+ if (vall)
+ is_left = false;
+ // the branch matches just upto this point, yet continues in a different
+ // direction; fork the branch.
+ node = node->fork(key, bits);
+ break;
+ }
+ }
+
+ if (node->node.first.getBits() > key.getBits()) {
+ // key is a super-network of the matching node; split the branch and
+ // insert a node for the key above the matching node.
+ node = node->split(key, key.getBits());
+ }
+
+ if (node->left)
+ is_left = false;
+
+ node_type& value = node->node;
+
+ if (!node->assigned) {
+ // only increment size if not assigned before
+ d_size++;
+ // update the pointer to the left-most tree node
+ if (is_left)
+ d_left = node;
+ node->assigned = true;
+ } else {
+ // tree node exists for this value
+ if (is_left && d_left != node) {
+ throw std::logic_error(
+ "NetmaskTree::insert(): lost track of left-most node in tree");
+ }
+ }
+
+ return value;
+ }
+
+ //<! Creates or updates value
+ void insert_or_assign(const key_type& mask, const value_type& value) {
+ insert(mask).second = value;
+ }
+
+ void insert_or_assign(const string& mask, const value_type& value) {
+ insert(key_type(mask)).second = value;
+ }
+
+ //<! check if given key is present in TreeMap
+ bool has_key(const key_type& key) const {
+ const node_type *ptr = lookup(key);
+ return ptr && ptr->first == key;
+ }
+
+ //<! Returns "best match" for key_type, which might not be value
+ const node_type* lookup(const key_type& value) const {
+ uint8_t max_bits = value.getBits();
+ return lookupImpl(value, max_bits);
+ }
+
+ //<! Perform best match lookup for value, using at most max_bits
+ const node_type* lookup(const ComboAddress& value, int max_bits = 128) const {
+ uint8_t addr_bits = value.getBits();
+ if (max_bits < 0 || max_bits > addr_bits) {
+ max_bits = addr_bits;
+ }
+
+ return lookupImpl(key_type(value, max_bits), max_bits);
+ }
+
+ //<! Removes key from TreeMap.
+ void erase(const key_type& key) {
+ TreeNode *node = nullptr;
+
+ if (key.isIPv4())
+ node = d_root->left.get();
+ else if (key.isIPv6())
+ node = d_root->right.get();
+ else
+ throw NetmaskException("invalid address family");
+ // no tree, no value
+ if (node == nullptr) return;
+
+ int bits = 0;
+ for(; node && bits < key.getBits(); bits++) {
+ bool vall = key.getBit(-1-bits);
+ if (bits >= node->d_bits) {
+ // the end of the current node is reached; continue with the next
+ if (vall) {
+ node = node->right.get();
+ } else {
+ node = node->left.get();
+ }
+ continue;
+ }
+ if (bits >= node->node.first.getBits()) {
+ // the matching branch ends here
+ if (key.getBits() != node->node.first.getBits())
+ node = nullptr;
+ break;
+ }
+ bool valr = node->node.first.getBit(-1-bits);
+ if (vall != valr) {
+ // the branch matches just upto this point, yet continues in a different
+ // direction
+ node = nullptr;
+ break;
+ }
+ }
+ if (node) {
+ if (d_size == 0) {
+ throw std::logic_error(
+ "NetmaskTree::erase(): size of tree is zero before erase");
+ }
+ d_size--;
+ node->assigned = false;
+ node->node.second = value_type();
+
+ if (node == d_left)
+ d_left = d_left->traverse_lnr_assigned();
+
+ cleanup_tree(node);
+ }
+ }
+
+ void erase(const string& key) {
+ erase(key_type(key));
+ }
+
+ //<! checks whether the container is empty.
+ bool empty() const {
+ return (d_size == 0);
+ }
+
+ //<! returns the number of elements
+ size_type size() const {
+ return d_size;
+ }
+
+ //<! See if given ComboAddress matches any prefix
+ bool match(const ComboAddress& value) const {
+ return (lookup(value) != nullptr);
+ }
+
+ bool match(const std::string& value) const {
+ return match(ComboAddress(value));
+ }
+
+ //<! Clean out the tree
+ void clear() {
+ d_root.reset(new TreeNode());
+ d_left = nullptr;
+ d_size = 0;
+ }
+
+ //<! swaps the contents with another NetmaskTree
+ void swap(NetmaskTree& rhs) {
+ std::swap(d_root, rhs.d_root);
+ std::swap(d_left, rhs.d_left);
+ std::swap(d_size, rhs.d_size);
+ }
+
+private:
+
+ const node_type* lookupImpl(const key_type& value, uint8_t max_bits) const {
+ TreeNode *node = nullptr;
+
+ if (value.isIPv4())
+ node = d_root->left.get();
+ else if (value.isIPv6())
+ node = d_root->right.get();
+ else
+ throw NetmaskException("invalid address family");
+ if (node == nullptr) return nullptr;
+
+ node_type *ret = nullptr;
+
+ int bits = 0;
+ for(; bits < max_bits; bits++) {
+ bool vall = value.getBit(-1-bits);
+ if (bits >= node->d_bits) {
+ // the end of the current node is reached; continue with the next
+ // (we keep track of last assigned node)
+ if (node->assigned && bits == node->node.first.getBits())
+ ret = &node->node;
+ if (vall) {
+ if (!node->right)
+ break;
+ node = node->right.get();
+ } else {
+ if (!node->left)
+ break;
+ node = node->left.get();
+ }
+ continue;
+ }
+ if (bits >= node->node.first.getBits()) {
+ // the matching branch ends here
+ break;
+ }
+ bool valr = node->node.first.getBit(-1-bits);
+ if (vall != valr) {
+ // the branch matches just upto this point, yet continues in a different
+ // direction
+ break;
+ }
+ }
+ // needed if we did not find one in loop
+ if (node->assigned && bits == node->node.first.getBits())
+ ret = &node->node;
+
+ // this can be nullptr.
+ return ret;
+ }
+
+ unique_ptr<TreeNode> d_root; //<! Root of our tree
+ TreeNode *d_left;
+ size_type d_size;
+};
+
+/** This class represents a group of supplemental Netmask classes. An IP address matches
+ if it is matched by one or more of the Netmask objects within.
+*/
+class NetmaskGroup
+{
+public:
+ NetmaskGroup() noexcept {
+ }
+
+ //! If this IP address is matched by any of the classes within
+
+ bool match(const ComboAddress *ip) const
+ {
+ const auto &ret = tree.lookup(*ip);
+ if(ret) return ret->second;
+ return false;
+ }
+
+ bool match(const ComboAddress& ip) const
+ {
+ return match(&ip);
+ }
+
+ bool lookup(const ComboAddress* ip, Netmask* nmp) const
+ {
+ const auto &ret = tree.lookup(*ip);
+ if (ret) {
+ if (nmp != nullptr)
+ *nmp = ret->first;
+
+ return ret->second;
+ }
+ return false;
+ }
+
+ bool lookup(const ComboAddress& ip, Netmask* nmp) const
+ {
+ return lookup(&ip, nmp);
+ }
+
+ //! Add this string to the list of possible matches
+ void addMask(const string &ip, bool positive=true)
+ {
+ if(!ip.empty() && ip[0] == '!') {
+ addMask(Netmask(ip.substr(1)), false);
+ } else {
+ addMask(Netmask(ip), positive);
+ }
+ }
+
+ //! Add this Netmask to the list of possible matches
+ void addMask(const Netmask& nm, bool positive=true)
+ {
+ tree.insert(nm).second=positive;
+ }
+
+ void addMasks(const NetmaskGroup& group, boost::optional<bool> positive)
+ {
+ for (const auto& entry : group.tree) {
+ addMask(entry.first, positive ? *positive : entry.second);
+ }
+ }
+
+ //! Delete this Netmask from the list of possible matches
+ void deleteMask(const Netmask& nm)
+ {
+ tree.erase(nm);
+ }
+
+ void deleteMask(const std::string& ip)
+ {
+ if (!ip.empty())
+ deleteMask(Netmask(ip));
+ }
+
+ void clear()
+ {
+ tree.clear();
+ }
+
+ bool empty() const
+ {
+ return tree.empty();
+ }
+
+ size_t size() const
+ {
+ return tree.size();
+ }
+
+ string toString() const
+ {
+ ostringstream str;
+ for(auto iter = tree.begin(); iter != tree.end(); ++iter) {
+ if(iter != tree.begin())
+ str <<", ";
+ if(!(iter->second))
+ str<<"!";
+ str<<iter->first.toString();
+ }
+ return str.str();
+ }
+
+ void toStringVector(vector<string>* vec) const
+ {
+ for(auto iter = tree.begin(); iter != tree.end(); ++iter) {
+ vec->push_back((iter->second ? "" : "!") + iter->first.toString());
+ }
+ }
+
+ void toMasks(const string &ips)
+ {
+ vector<string> parts;
+ stringtok(parts, ips, ", \t");
+
+ for (vector<string>::const_iterator iter = parts.begin(); iter != parts.end(); ++iter)
+ addMask(*iter);
+ }
+
+private:
+ NetmaskTree<bool> tree;
+};
+
+struct SComboAddress
+{
+ SComboAddress(const ComboAddress& orig) : ca(orig) {}
+ ComboAddress ca;
+ bool operator<(const SComboAddress& rhs) const
+ {
+ return ComboAddress::addressOnlyLessThan()(ca, rhs.ca);
+ }
+ operator const ComboAddress&()
+ {
+ return ca;
+ }
+};
+
+class NetworkError : public runtime_error
+{
+public:
+ NetworkError(const string& why="Network Error") : runtime_error(why.c_str())
+ {}
+ NetworkError(const char *why="Network Error") : runtime_error(why)
+ {}
+};
+
+class AddressAndPortRange
+{
+public:
+ AddressAndPortRange(): d_addrMask(0), d_portMask(0)
+ {
+ d_addr.sin4.sin_family = 0; // disable this doing anything useful
+ d_addr.sin4.sin_port = 0; // this guarantees d_network compares identical
+ }
+
+ AddressAndPortRange(ComboAddress ca, uint8_t addrMask, uint8_t portMask = 0): d_addr(std::move(ca)), d_addrMask(addrMask), d_portMask(portMask)
+ {
+ if (!d_addr.isIPv4()) {
+ d_portMask = 0;
+ }
+
+ uint16_t port = d_addr.getPort();
+ if (d_portMask < 16) {
+ uint16_t mask = ~(0xFFFF >> d_portMask);
+ port = port & mask;
+ }
+
+ if (d_addrMask < d_addr.getBits()) {
+ if (d_portMask > 0) {
+ throw std::runtime_error("Trying to create a AddressAndPortRange with a reduced address mask (" + std::to_string(d_addrMask) + ") and a port range (" + std::to_string(d_portMask) + ")");
+ }
+ d_addr = Netmask(d_addr, d_addrMask).getMaskedNetwork();
+ }
+ d_addr.setPort(port);
+ }
+
+ uint8_t getFullBits() const
+ {
+ return d_addr.getBits() + 16;
+ }
+
+ uint8_t getBits() const
+ {
+ if (d_addrMask < d_addr.getBits()) {
+ return d_addrMask;
+ }
+
+ return d_addr.getBits() + d_portMask;
+ }
+
+ /** Get the value of the bit at the provided bit index. When the index >= 0,
+ the index is relative to the LSB starting at index zero. When the index < 0,
+ the index is relative to the MSB starting at index -1 and counting down.
+ */
+ bool getBit(int index) const
+ {
+ if (index >= getFullBits()) {
+ return false;
+ }
+ if (index < 0) {
+ index = getFullBits() + index;
+ }
+
+ if (index < 16) {
+ /* we are into the port bits */
+ uint16_t port = d_addr.getPort();
+ return ((port & (1U<<index)) != 0x0000);
+ }
+
+ index -= 16;
+
+ return d_addr.getBit(index);
+ }
+
+ bool isIPv4() const
+ {
+ return d_addr.isIPv4();
+ }
+
+ bool isIPv6() const
+ {
+ return d_addr.isIPv6();
+ }
+
+ AddressAndPortRange getNormalized() const
+ {
+ return AddressAndPortRange(d_addr, d_addrMask, d_portMask);
+ }
+
+ AddressAndPortRange getSuper(uint8_t bits) const
+ {
+ if (bits <= d_addrMask) {
+ return AddressAndPortRange(d_addr, bits, 0);
+ }
+ if (bits <= d_addrMask + d_portMask) {
+ return AddressAndPortRange(d_addr, d_addrMask, d_portMask - (bits - d_addrMask));
+ }
+
+ return AddressAndPortRange(d_addr, d_addrMask, d_portMask);
+ }
+
+ const ComboAddress& getNetwork() const
+ {
+ return d_addr;
+ }
+
+ string toString() const
+ {
+ if (d_addrMask < d_addr.getBits() || d_portMask == 0) {
+ return d_addr.toStringNoInterface() + "/" + std::to_string(d_addrMask);
+ }
+ return d_addr.toStringNoInterface() + ":" + std::to_string(d_addr.getPort()) + "/" + std::to_string(d_portMask);
+ }
+
+ bool empty() const
+ {
+ return d_addr.sin4.sin_family == 0;
+ }
+
+ bool operator==(const AddressAndPortRange& rhs) const
+ {
+ return tie(d_addr, d_addrMask, d_portMask) == tie(rhs.d_addr, rhs.d_addrMask, rhs.d_portMask);
+ }
+
+ bool operator<(const AddressAndPortRange& rhs) const
+ {
+ if (empty() && !rhs.empty()) {
+ return false;
+ }
+
+ if (!empty() && rhs.empty()) {
+ return true;
+ }
+
+ if (d_addrMask > rhs.d_addrMask) {
+ return true;
+ }
+
+ if (d_addrMask < rhs.d_addrMask) {
+ return false;
+ }
+
+ if (d_addr < rhs.d_addr) {
+ return true;
+ }
+
+ if (d_addr > rhs.d_addr) {
+ return false;
+ }
+
+ if (d_portMask > rhs.d_portMask) {
+ return true;
+ }
+
+ if (d_portMask < rhs.d_portMask) {
+ return false;
+ }
+
+ return d_addr.getPort() < rhs.d_addr.getPort();
+ }
+
+ bool operator>(const AddressAndPortRange& rhs) const
+ {
+ return rhs.operator<(*this);
+ }
+
+ struct hash
+ {
+ uint32_t operator()(const AddressAndPortRange& apr) const
+ {
+ ComboAddress::addressOnlyHash hashOp;
+ uint16_t port = apr.d_addr.getPort();
+ /* it's fine to hash the whole address and port because the non-relevant parts have
+ been masked to 0 */
+ return burtle(reinterpret_cast<const unsigned char*>(&port), sizeof(port), hashOp(apr.d_addr));
+ }
+ };
+
+private:
+ ComboAddress d_addr;
+ uint8_t d_addrMask;
+ /* only used for v4 addresses */
+ uint8_t d_portMask;
+};
+
+int SSocket(int family, int type, int flags);
+int SConnect(int sockfd, const ComboAddress& remote);
+/* tries to connect to remote for a maximum of timeout seconds.
+ sockfd should be set to non-blocking beforehand.
+ returns 0 on success (the socket is writable), throw a
+ runtime_error otherwise */
+int SConnectWithTimeout(int sockfd, const ComboAddress& remote, const struct timeval& timeout);
+int SBind(int sockfd, const ComboAddress& local);
+int SAccept(int sockfd, ComboAddress& remote);
+int SListen(int sockfd, int limit);
+int SSetsockopt(int sockfd, int level, int opname, int value);
+void setSocketIgnorePMTU(int sockfd, int family);
+bool setReusePort(int sockfd);
+
+#if defined(IP_PKTINFO)
+ #define GEN_IP_PKTINFO IP_PKTINFO
+#elif defined(IP_RECVDSTADDR)
+ #define GEN_IP_PKTINFO IP_RECVDSTADDR
+#endif
+
+bool IsAnyAddress(const ComboAddress& addr);
+bool HarvestDestinationAddress(const struct msghdr* msgh, ComboAddress* destination);
+bool HarvestTimestamp(struct msghdr* msgh, struct timeval* tv);
+void fillMSGHdr(struct msghdr* msgh, struct iovec* iov, cmsgbuf_aligned* cbuf, size_t cbufsize, char* data, size_t datalen, ComboAddress* addr);
+int sendOnNBSocket(int fd, const struct msghdr *msgh);
+ssize_t sendfromto(int sock, const void* data, size_t len, int flags, const ComboAddress& from, const ComboAddress& to);
+size_t sendMsgWithOptions(int fd, const char* buffer, size_t len, const ComboAddress* dest, const ComboAddress* local, unsigned int localItf, int flags);
+
+/* requires a non-blocking, connected TCP socket */
+bool isTCPSocketUsable(int sock);
+
+extern template class NetmaskTree<bool>;
+ComboAddress parseIPAndPort(const std::string& input, uint16_t port);
+
+/* These functions throw if the value was already set to a higher value,
+ or on error */
+void setSocketBuffer(int fd, int optname, uint32_t size);
+void setSocketReceiveBuffer(int fd, uint32_t size);
+void setSocketSendBuffer(int fd, uint32_t size);
diff --git a/kqueuemplexer.cc b/kqueuemplexer.cc
new file mode 100644
index 0000000..a81487c
--- /dev/null
+++ b/kqueuemplexer.cc
@@ -0,0 +1,242 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "mplexer.hh"
+#include "sstuff.hh"
+#include <iostream>
+#include <unistd.h>
+#include "misc.hh"
+#include <sys/types.h>
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#include <sys/event.h>
+#endif
+#include <sys/time.h>
+
+#include "namespaces.hh"
+
+class KqueueFDMultiplexer : public FDMultiplexer
+{
+public:
+ KqueueFDMultiplexer();
+ ~KqueueFDMultiplexer()
+ {
+ if (d_kqueuefd >= 0) {
+ close(d_kqueuefd);
+ }
+ }
+
+ int run(struct timeval* tv, int timeout = 500) override;
+ void getAvailableFDs(std::vector<int>& fds, int timeout) override;
+
+ void addFD(int fd, FDMultiplexer::EventKind kind) override;
+ void removeFD(int fd, FDMultiplexer::EventKind kind) override;
+
+ string getName() const override
+ {
+ return "kqueue";
+ }
+
+private:
+ int d_kqueuefd;
+ boost::shared_array<struct kevent> d_kevents;
+ static unsigned int s_maxevents; // not a hard maximum
+};
+
+unsigned int KqueueFDMultiplexer::s_maxevents = 1024;
+
+static FDMultiplexer* make()
+{
+ return new KqueueFDMultiplexer();
+}
+
+static struct KqueueRegisterOurselves
+{
+ KqueueRegisterOurselves()
+ {
+ FDMultiplexer::getMultiplexerMap().emplace(0, &make); // priority 0!
+ }
+} kQueueDoIt;
+
+KqueueFDMultiplexer::KqueueFDMultiplexer() :
+ d_kevents(new struct kevent[s_maxevents])
+{
+ d_kqueuefd = kqueue();
+ if (d_kqueuefd < 0) {
+ throw FDMultiplexerException("Setting up kqueue: " + stringerror());
+ }
+}
+
+static uint32_t convertEventKind(FDMultiplexer::EventKind kind)
+{
+ switch (kind) {
+ case FDMultiplexer::EventKind::Read:
+ return EVFILT_READ;
+ case FDMultiplexer::EventKind::Write:
+ return EVFILT_WRITE;
+ case FDMultiplexer::EventKind::Both:
+ throw std::runtime_error("Read and write events cannot be combined in one go with kqueue");
+ }
+
+ throw std::runtime_error("Unhandled event kind in the kqueue multiplexer");
+}
+
+void KqueueFDMultiplexer::addFD(int fd, FDMultiplexer::EventKind kind)
+{
+ struct kevent kqevents[2];
+ int nevents = 0;
+
+ if (kind == FDMultiplexer::EventKind::Both || kind == FDMultiplexer::EventKind::Read) {
+ EV_SET(&kqevents[nevents], fd, convertEventKind(FDMultiplexer::EventKind::Read), EV_ADD, 0, 0, 0);
+ nevents++;
+ }
+
+ if (kind == FDMultiplexer::EventKind::Both || kind == FDMultiplexer::EventKind::Write) {
+ EV_SET(&kqevents[nevents], fd, convertEventKind(FDMultiplexer::EventKind::Write), EV_ADD, 0, 0, 0);
+ nevents++;
+ }
+
+ if (kevent(d_kqueuefd, kqevents, nevents, 0, 0, 0) < 0) {
+ throw FDMultiplexerException("Adding fd to kqueue set: " + stringerror());
+ }
+}
+
+void KqueueFDMultiplexer::removeFD(int fd, FDMultiplexer::EventKind kind)
+{
+ struct kevent kqevents[2];
+ int nevents = 0;
+
+ if (kind == FDMultiplexer::EventKind::Both || kind == FDMultiplexer::EventKind::Read) {
+ EV_SET(&kqevents[nevents], fd, convertEventKind(FDMultiplexer::EventKind::Read), EV_DELETE, 0, 0, 0);
+ nevents++;
+ }
+
+ if (kind == FDMultiplexer::EventKind::Both || kind == FDMultiplexer::EventKind::Write) {
+ EV_SET(&kqevents[nevents], fd, convertEventKind(FDMultiplexer::EventKind::Write), EV_DELETE, 0, 0, 0);
+ nevents++;
+ }
+
+ if (kevent(d_kqueuefd, kqevents, nevents, 0, 0, 0) < 0) {
+ // ponder putting Callback back on the map..
+ throw FDMultiplexerException("Removing fd from kqueue set: " + stringerror());
+ }
+}
+
+void KqueueFDMultiplexer::getAvailableFDs(std::vector<int>& fds, int timeout)
+{
+ struct timespec ts;
+ ts.tv_sec = timeout / 1000;
+ ts.tv_nsec = (timeout % 1000) * 1000000;
+
+ int ret = kevent(d_kqueuefd, 0, 0, d_kevents.get(), s_maxevents, &ts);
+
+ if (ret < 0 && errno != EINTR) {
+ throw FDMultiplexerException("kqueue returned error: " + stringerror());
+ }
+
+ // we de-duplicate here, since if a descriptor is readable AND writable
+ // we will get two events
+ std::unordered_set<int> fdSet;
+ fdSet.reserve(ret);
+ for (int n = 0; n < ret; ++n) {
+ fdSet.insert(d_kevents[n].ident);
+ }
+
+ for (const auto fd : fdSet) {
+ fds.push_back(fd);
+ }
+}
+
+int KqueueFDMultiplexer::run(struct timeval* now, int timeout)
+{
+ if (d_inrun) {
+ throw FDMultiplexerException("FDMultiplexer::run() is not reentrant!\n");
+ }
+
+ struct timespec ts;
+ ts.tv_sec = timeout / 1000;
+ ts.tv_nsec = (timeout % 1000) * 1000000;
+
+ int ret = kevent(d_kqueuefd, 0, 0, d_kevents.get(), s_maxevents, &ts);
+ gettimeofday(now, nullptr); // MANDATORY!
+
+ if (ret < 0 && errno != EINTR) {
+ throw FDMultiplexerException("kqueue returned error: " + stringerror());
+ }
+
+ if (ret < 0) {
+ // nothing - thanks AB!
+ return 0;
+ }
+
+ d_inrun = true;
+
+ for (int n = 0; n < ret; ++n) {
+ if (d_kevents[n].filter == EVFILT_READ) {
+ const auto& iter = d_readCallbacks.find(d_kevents[n].ident);
+ if (iter != d_readCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ }
+ }
+
+ if (d_kevents[n].filter == EVFILT_WRITE) {
+ const auto& iter = d_writeCallbacks.find(d_kevents[n].ident);
+ if (iter != d_writeCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ }
+ }
+ }
+
+ d_inrun = false;
+ return ret;
+}
+
+#if 0
+void acceptData(int fd, boost::any& parameter)
+{
+ cout<<"Have data on fd "<<fd<<endl;
+ Socket* sock=boost::any_cast<Socket*>(parameter);
+ string packet;
+ IPEndpoint rem;
+ sock->recvFrom(packet, rem);
+ cout<<"Received "<<packet.size()<<" bytes!\n";
+}
+
+int main()
+{
+ Socket s(AF_INET, SOCK_DGRAM);
+
+ IPEndpoint loc("0.0.0.0", 2000);
+ s.bind(loc);
+
+ KqueueFDMultiplexer sfm;
+
+ sfm.addReadFD(s.getHandle(), &acceptData, &s);
+
+ for(int n=0; n < 100 ; ++n) {
+ sfm.run();
+ }
+ sfm.removeReadFD(s.getHandle());
+ sfm.removeReadFD(s.getHandle());
+}
+#endif
diff --git a/libssl.cc b/libssl.cc
new file mode 100644
index 0000000..2c0e8be
--- /dev/null
+++ b/libssl.cc
@@ -0,0 +1,855 @@
+
+#include "config.h"
+#include "libssl.hh"
+
+#ifdef HAVE_LIBSSL
+
+#include <atomic>
+#include <fstream>
+#include <cstring>
+#include <mutex>
+#include <pthread.h>
+
+#include <openssl/conf.h>
+#include <openssl/err.h>
+#include <openssl/ocsp.h>
+#include <openssl/rand.h>
+#include <openssl/ssl.h>
+#include <fcntl.h>
+
+#ifdef HAVE_LIBSODIUM
+#include <sodium.h>
+#endif /* HAVE_LIBSODIUM */
+
+#undef CERT
+#include "misc.hh"
+
+#if (OPENSSL_VERSION_NUMBER < 0x1010000fL || (defined LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2090100fL)
+/* OpenSSL < 1.1.0 needs support for threading/locking in the calling application. */
+
+#include "lock.hh"
+static std::vector<std::mutex> openssllocks;
+
+extern "C" {
+static void openssl_pthreads_locking_callback(int mode, int type, const char *file, int line)
+{
+ if (mode & CRYPTO_LOCK) {
+ openssllocks.at(type).lock();
+
+ } else {
+ openssllocks.at(type).unlock();
+ }
+}
+
+static unsigned long openssl_pthreads_id_callback()
+{
+ return (unsigned long)pthread_self();
+}
+}
+
+static void openssl_thread_setup()
+{
+ openssllocks = std::vector<std::mutex>(CRYPTO_num_locks());
+ CRYPTO_set_id_callback(&openssl_pthreads_id_callback);
+ CRYPTO_set_locking_callback(&openssl_pthreads_locking_callback);
+}
+
+static void openssl_thread_cleanup()
+{
+ CRYPTO_set_locking_callback(nullptr);
+ openssllocks.clear();
+}
+
+#endif /* (OPENSSL_VERSION_NUMBER < 0x1010000fL || (defined LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2090100fL) */
+
+static std::atomic<uint64_t> s_users;
+static int s_ticketsKeyIndex{-1};
+static int s_countersIndex{-1};
+static int s_keyLogIndex{-1};
+
+void registerOpenSSLUser()
+{
+ if (s_users.fetch_add(1) == 0) {
+#ifdef HAVE_OPENSSL_INIT_CRYPTO
+ /* load the default configuration file (or one specified via OPENSSL_CONF),
+ which can then be used to load engines */
+ OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, nullptr);
+#endif
+
+#if (OPENSSL_VERSION_NUMBER < 0x1010000fL || (defined LIBRESSL_VERSION_NUMBER && LIBRESSL_VERSION_NUMBER < 0x2090100fL))
+ SSL_load_error_strings();
+ OpenSSL_add_ssl_algorithms();
+ openssl_thread_setup();
+#endif
+ s_ticketsKeyIndex = SSL_CTX_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr);
+
+ if (s_ticketsKeyIndex == -1) {
+ throw std::runtime_error("Error getting an index for tickets key");
+ }
+
+ s_countersIndex = SSL_CTX_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr);
+
+ if (s_countersIndex == -1) {
+ throw std::runtime_error("Error getting an index for counters");
+ }
+
+ s_keyLogIndex = SSL_CTX_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr);
+
+ if (s_keyLogIndex == -1) {
+ throw std::runtime_error("Error getting an index for TLS key logging");
+ }
+ }
+}
+
+void unregisterOpenSSLUser()
+{
+ if (s_users.fetch_sub(1) == 1) {
+#if (OPENSSL_VERSION_NUMBER < 0x1010000fL || (defined LIBRESSL_VERSION_NUMBER && LIBRESSL_VERSION_NUMBER < 0x2090100fL))
+ ERR_free_strings();
+
+ EVP_cleanup();
+
+ CONF_modules_finish();
+ CONF_modules_free();
+ CONF_modules_unload(1);
+
+ CRYPTO_cleanup_all_ex_data();
+ openssl_thread_cleanup();
+#endif
+ }
+}
+
+void* libssl_get_ticket_key_callback_data(SSL* s)
+{
+ SSL_CTX* sslCtx = SSL_get_SSL_CTX(s);
+ if (sslCtx == nullptr) {
+ return nullptr;
+ }
+
+ return SSL_CTX_get_ex_data(sslCtx, s_ticketsKeyIndex);
+}
+
+void libssl_set_ticket_key_callback_data(SSL_CTX* ctx, void* data)
+{
+ SSL_CTX_set_ex_data(ctx, s_ticketsKeyIndex, data);
+}
+
+int libssl_ticket_key_callback(SSL *s, OpenSSLTLSTicketKeysRing& keyring, unsigned char keyName[TLS_TICKETS_KEY_NAME_SIZE], unsigned char *iv, EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx, int enc)
+{
+ if (enc) {
+ const auto key = keyring.getEncryptionKey();
+ if (key == nullptr) {
+ return -1;
+ }
+
+ return key->encrypt(keyName, iv, ectx, hctx);
+ }
+
+ bool activeEncryptionKey = false;
+
+ const auto key = keyring.getDecryptionKey(keyName, activeEncryptionKey);
+ if (key == nullptr) {
+ /* we don't know this key, just create a new ticket */
+ return 0;
+ }
+
+ if (key->decrypt(iv, ectx, hctx) == false) {
+ return -1;
+ }
+
+ if (!activeEncryptionKey) {
+ /* this key is not active, please encrypt the ticket content with the currently active one */
+ return 2;
+ }
+
+ return 1;
+}
+
+static long libssl_server_name_callback(SSL* ssl, int* al, void* arg)
+{
+ (void) al;
+ (void) arg;
+
+ if (SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name)) {
+ return SSL_TLSEXT_ERR_OK;
+ }
+
+ return SSL_TLSEXT_ERR_NOACK;
+}
+
+static void libssl_info_callback(const SSL *ssl, int where, int ret)
+{
+ SSL_CTX* sslCtx = SSL_get_SSL_CTX(ssl);
+ if (sslCtx == nullptr) {
+ return;
+ }
+
+ TLSErrorCounters* counters = reinterpret_cast<TLSErrorCounters*>(SSL_CTX_get_ex_data(sslCtx, s_countersIndex));
+ if (counters == nullptr) {
+ return;
+ }
+
+ if (where & SSL_CB_ALERT) {
+ const long lastError = ERR_peek_last_error();
+ switch (ERR_GET_REASON(lastError)) {
+#ifdef SSL_R_DH_KEY_TOO_SMALL
+ case SSL_R_DH_KEY_TOO_SMALL:
+ ++counters->d_dhKeyTooSmall;
+ break;
+#endif /* SSL_R_DH_KEY_TOO_SMALL */
+ case SSL_R_NO_SHARED_CIPHER:
+ ++counters->d_noSharedCipher;
+ break;
+ case SSL_R_UNKNOWN_PROTOCOL:
+ ++counters->d_unknownProtocol;
+ break;
+ case SSL_R_UNSUPPORTED_PROTOCOL:
+#ifdef SSL_R_VERSION_TOO_LOW
+ case SSL_R_VERSION_TOO_LOW:
+#endif /* SSL_R_VERSION_TOO_LOW */
+ ++counters->d_unsupportedProtocol;
+ break;
+ case SSL_R_INAPPROPRIATE_FALLBACK:
+ ++counters->d_inappropriateFallBack;
+ break;
+ case SSL_R_UNKNOWN_CIPHER_TYPE:
+ ++counters->d_unknownCipherType;
+ break;
+ case SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE:
+ ++counters->d_unknownKeyExchangeType;
+ break;
+ case SSL_R_UNSUPPORTED_ELLIPTIC_CURVE:
+ ++counters->d_unsupportedEC;
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void libssl_set_error_counters_callback(std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>& ctx, TLSErrorCounters* counters)
+{
+ SSL_CTX_set_ex_data(ctx.get(), s_countersIndex, counters);
+ SSL_CTX_set_info_callback(ctx.get(), libssl_info_callback);
+}
+
+int libssl_ocsp_stapling_callback(SSL* ssl, const std::map<int, std::string>& ocspMap)
+{
+ auto pkey = SSL_get_privatekey(ssl);
+ if (pkey == nullptr) {
+ return SSL_TLSEXT_ERR_NOACK;
+ }
+
+ /* look for an OCSP response for the corresponding private key type (RSA, ECDSA..) */
+ const auto& data = ocspMap.find(EVP_PKEY_base_id(pkey));
+ if (data == ocspMap.end()) {
+ return SSL_TLSEXT_ERR_NOACK;
+ }
+
+ /* we need to allocate a copy because OpenSSL will free the pointer passed to SSL_set_tlsext_status_ocsp_resp() */
+ void* copy = OPENSSL_malloc(data->second.size());
+ if (copy == nullptr) {
+ return SSL_TLSEXT_ERR_NOACK;
+ }
+
+ memcpy(copy, data->second.data(), data->second.size());
+ SSL_set_tlsext_status_ocsp_resp(ssl, copy, data->second.size());
+ return SSL_TLSEXT_ERR_OK;
+}
+
+static bool libssl_validate_ocsp_response(const std::string& response)
+{
+ auto responsePtr = reinterpret_cast<const unsigned char *>(response.data());
+ std::unique_ptr<OCSP_RESPONSE, void(*)(OCSP_RESPONSE*)> resp(d2i_OCSP_RESPONSE(nullptr, &responsePtr, response.size()), OCSP_RESPONSE_free);
+ if (resp == nullptr) {
+ throw std::runtime_error("Unable to parse OCSP response");
+ }
+
+ int status = OCSP_response_status(resp.get());
+ if (status != OCSP_RESPONSE_STATUS_SUCCESSFUL) {
+ throw std::runtime_error("OCSP response status is not successful: " + std::to_string(status));
+ }
+
+ std::unique_ptr<OCSP_BASICRESP, void(*)(OCSP_BASICRESP*)> basic(OCSP_response_get1_basic(resp.get()), OCSP_BASICRESP_free);
+ if (basic == nullptr) {
+ throw std::runtime_error("Error getting a basic OCSP response");
+ }
+
+ if (OCSP_resp_count(basic.get()) != 1) {
+ throw std::runtime_error("More than one single response in an OCSP basic response");
+ }
+
+ auto singleResponse = OCSP_resp_get0(basic.get(), 0);
+ if (singleResponse == nullptr) {
+ throw std::runtime_error("Error getting a single response from the basic OCSP response");
+ }
+
+ int reason;
+ ASN1_GENERALIZEDTIME* revTime = nullptr;
+ ASN1_GENERALIZEDTIME* thisUpdate = nullptr;
+ ASN1_GENERALIZEDTIME* nextUpdate = nullptr;
+
+ auto singleResponseStatus = OCSP_single_get0_status(singleResponse, &reason, &revTime, &thisUpdate, &nextUpdate);
+ if (singleResponseStatus != V_OCSP_CERTSTATUS_GOOD) {
+ throw std::runtime_error("Invalid status for OCSP single response (" + std::to_string(singleResponseStatus) + ")");
+ }
+ if (thisUpdate == nullptr || nextUpdate == nullptr) {
+ throw std::runtime_error("Error getting validity of OCSP single response");
+ }
+
+ auto validityResult = OCSP_check_validity(thisUpdate, nextUpdate, /* 5 minutes of leeway */ 5 * 60, -1);
+ if (validityResult == 0) {
+ throw std::runtime_error("OCSP single response is not yet, or no longer, valid");
+ }
+
+ return true;
+}
+
+std::map<int, std::string> libssl_load_ocsp_responses(const std::vector<std::string>& ocspFiles, std::vector<int> keyTypes)
+{
+ std::map<int, std::string> ocspResponses;
+
+ if (ocspFiles.size() > keyTypes.size()) {
+ throw std::runtime_error("More OCSP files than certificates and keys loaded!");
+ }
+
+ size_t count = 0;
+ for (const auto& filename : ocspFiles) {
+ std::ifstream file(filename, std::ios::binary);
+ std::string content;
+ while(file) {
+ char buffer[4096];
+ file.read(buffer, sizeof(buffer));
+ if (file.bad()) {
+ file.close();
+ throw std::runtime_error("Unable to load OCSP response from '" + filename + "'");
+ }
+ content.append(buffer, file.gcount());
+ }
+ file.close();
+
+ try {
+ libssl_validate_ocsp_response(content);
+ ocspResponses.insert({keyTypes.at(count), std::move(content)});
+ }
+ catch (const std::exception& e) {
+ throw std::runtime_error("Error checking the validity of OCSP response from '" + filename + "': " + e.what());
+ }
+ ++count;
+ }
+
+ return ocspResponses;
+}
+
+int libssl_get_last_key_type(std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>& ctx)
+{
+#ifdef HAVE_SSL_CTX_GET0_PRIVATEKEY
+ auto pkey = SSL_CTX_get0_privatekey(ctx.get());
+#else
+ auto temp = std::unique_ptr<SSL, void(*)(SSL*)>(SSL_new(ctx.get()), SSL_free);
+ if (!temp) {
+ return -1;
+ }
+ auto pkey = SSL_get_privatekey(temp.get());
+#endif
+
+ if (!pkey) {
+ return -1;
+ }
+
+ return EVP_PKEY_base_id(pkey);
+}
+
+#ifdef HAVE_OCSP_BASIC_SIGN
+bool libssl_generate_ocsp_response(const std::string& certFile, const std::string& caCert, const std::string& caKey, const std::string& outFile, int ndays, int nmin)
+{
+ const EVP_MD* rmd = EVP_sha256();
+
+ auto fp = std::unique_ptr<FILE, int(*)(FILE*)>(fopen(certFile.c_str(), "r"), fclose);
+ if (!fp) {
+ throw std::runtime_error("Unable to open '" + certFile + "' when loading the certificate to generate an OCSP response");
+ }
+ auto cert = std::unique_ptr<X509, void(*)(X509*)>(PEM_read_X509_AUX(fp.get(), nullptr, nullptr, nullptr), X509_free);
+
+ fp = std::unique_ptr<FILE, int(*)(FILE*)>(fopen(caCert.c_str(), "r"), fclose);
+ if (!fp) {
+ throw std::runtime_error("Unable to open '" + caCert + "' when loading the issuer certificate to generate an OCSP response");
+ }
+ auto issuer = std::unique_ptr<X509, void(*)(X509*)>(PEM_read_X509_AUX(fp.get(), nullptr, nullptr, nullptr), X509_free);
+ fp = std::unique_ptr<FILE, int(*)(FILE*)>(fopen(caKey.c_str(), "r"), fclose);
+ if (!fp) {
+ throw std::runtime_error("Unable to open '" + caKey + "' when loading the issuer key to generate an OCSP response");
+ }
+ auto issuerKey = std::unique_ptr<EVP_PKEY, void(*)(EVP_PKEY*)>(PEM_read_PrivateKey(fp.get(), nullptr, nullptr, nullptr), EVP_PKEY_free);
+ fp.reset();
+
+ auto bs = std::unique_ptr<OCSP_BASICRESP, void(*)(OCSP_BASICRESP*)>(OCSP_BASICRESP_new(), OCSP_BASICRESP_free);
+ auto thisupd = std::unique_ptr<ASN1_TIME, void(*)(ASN1_TIME*)>(X509_gmtime_adj(nullptr, 0), ASN1_TIME_free);
+ auto nextupd = std::unique_ptr<ASN1_TIME, void(*)(ASN1_TIME*)>(X509_time_adj_ex(nullptr, ndays, nmin * 60, nullptr), ASN1_TIME_free);
+
+ auto cid = std::unique_ptr<OCSP_CERTID, void(*)(OCSP_CERTID*)>(OCSP_cert_to_id(rmd, cert.get(), issuer.get()), OCSP_CERTID_free);
+ OCSP_basic_add1_status(bs.get(), cid.get(), V_OCSP_CERTSTATUS_GOOD, 0, nullptr, thisupd.get(), nextupd.get());
+
+ if (OCSP_basic_sign(bs.get(), issuer.get(), issuerKey.get(), rmd, nullptr, OCSP_NOCERTS) != 1) {
+ throw std::runtime_error("Error while signing the OCSP response");
+ }
+
+ auto resp = std::unique_ptr<OCSP_RESPONSE, void(*)(OCSP_RESPONSE*)>(OCSP_response_create(OCSP_RESPONSE_STATUS_SUCCESSFUL, bs.get()), OCSP_RESPONSE_free);
+ auto bio = std::unique_ptr<BIO, void(*)(BIO*)>(BIO_new_file(outFile.c_str(), "wb"), BIO_vfree);
+ if (!bio) {
+ throw std::runtime_error("Error opening file for writing the OCSP response");
+ }
+
+ // i2d_OCSP_RESPONSE_bio(bio.get(), resp.get()) is unusable from C++ because of an invalid cast
+ ASN1_i2d_bio((i2d_of_void*)i2d_OCSP_RESPONSE, bio.get(), (unsigned char*)resp.get());
+
+ return true;
+}
+#endif /* HAVE_OCSP_BASIC_SIGN */
+
+LibsslTLSVersion libssl_tls_version_from_string(const std::string& str)
+{
+ if (str == "tls1.0") {
+ return LibsslTLSVersion::TLS10;
+ }
+ if (str == "tls1.1") {
+ return LibsslTLSVersion::TLS11;
+ }
+ if (str == "tls1.2") {
+ return LibsslTLSVersion::TLS12;
+ }
+ if (str == "tls1.3") {
+ return LibsslTLSVersion::TLS13;
+ }
+ throw std::runtime_error("Unknown TLS version '" + str);
+}
+
+const std::string& libssl_tls_version_to_string(LibsslTLSVersion version)
+{
+ static const std::map<LibsslTLSVersion, std::string> versions = {
+ { LibsslTLSVersion::TLS10, "tls1.0" },
+ { LibsslTLSVersion::TLS11, "tls1.1" },
+ { LibsslTLSVersion::TLS12, "tls1.2" },
+ { LibsslTLSVersion::TLS13, "tls1.3" }
+ };
+
+ const auto& it = versions.find(version);
+ if (it == versions.end()) {
+ throw std::runtime_error("Unknown TLS version (" + std::to_string((int)version) + ")");
+ }
+ return it->second;
+}
+
+bool libssl_set_min_tls_version(std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>& ctx, LibsslTLSVersion version)
+{
+#if defined(HAVE_SSL_CTX_SET_MIN_PROTO_VERSION) || defined(SSL_CTX_set_min_proto_version)
+ /* These functions have been introduced in 1.1.0, and the use of SSL_OP_NO_* is deprecated
+ Warning: SSL_CTX_set_min_proto_version is a function-like macro in OpenSSL */
+ int vers;
+ switch(version) {
+ case LibsslTLSVersion::TLS10:
+ vers = TLS1_VERSION;
+ break;
+ case LibsslTLSVersion::TLS11:
+ vers = TLS1_1_VERSION;
+ break;
+ case LibsslTLSVersion::TLS12:
+ vers = TLS1_2_VERSION;
+ break;
+ case LibsslTLSVersion::TLS13:
+#ifdef TLS1_3_VERSION
+ vers = TLS1_3_VERSION;
+#else
+ return false;
+#endif /* TLS1_3_VERSION */
+ break;
+ default:
+ return false;
+ }
+
+ if (SSL_CTX_set_min_proto_version(ctx.get(), vers) != 1) {
+ return false;
+ }
+ return true;
+#else
+ long vers = SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3;
+ switch(version) {
+ case LibsslTLSVersion::TLS10:
+ break;
+ case LibsslTLSVersion::TLS11:
+ vers |= SSL_OP_NO_TLSv1;
+ break;
+ case LibsslTLSVersion::TLS12:
+ vers |= SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1;
+ break;
+ case LibsslTLSVersion::TLS13:
+ vers |= SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1 | SSL_OP_NO_TLSv1_2;
+ break;
+ default:
+ return false;
+ }
+
+ long options = SSL_CTX_get_options(ctx.get());
+ SSL_CTX_set_options(ctx.get(), options | vers);
+ return true;
+#endif
+}
+
+OpenSSLTLSTicketKeysRing::OpenSSLTLSTicketKeysRing(size_t capacity)
+{
+ d_ticketKeys.write_lock()->set_capacity(capacity);
+}
+
+OpenSSLTLSTicketKeysRing::~OpenSSLTLSTicketKeysRing()
+{
+}
+
+void OpenSSLTLSTicketKeysRing::addKey(std::shared_ptr<OpenSSLTLSTicketKey> newKey)
+{
+ d_ticketKeys.write_lock()->push_front(newKey);
+}
+
+std::shared_ptr<OpenSSLTLSTicketKey> OpenSSLTLSTicketKeysRing::getEncryptionKey()
+{
+ return d_ticketKeys.read_lock()->front();
+}
+
+std::shared_ptr<OpenSSLTLSTicketKey> OpenSSLTLSTicketKeysRing::getDecryptionKey(unsigned char name[TLS_TICKETS_KEY_NAME_SIZE], bool& activeKey)
+{
+ auto keys = d_ticketKeys.read_lock();
+ for (auto& key : *keys) {
+ if (key->nameMatches(name)) {
+ activeKey = (key == keys->front());
+ return key;
+ }
+ }
+ return nullptr;
+}
+
+size_t OpenSSLTLSTicketKeysRing::getKeysCount()
+{
+ return d_ticketKeys.read_lock()->size();
+}
+
+void OpenSSLTLSTicketKeysRing::loadTicketsKeys(const std::string& keyFile)
+{
+ bool keyLoaded = false;
+ std::ifstream file(keyFile);
+ try {
+ do {
+ auto newKey = std::make_shared<OpenSSLTLSTicketKey>(file);
+ addKey(newKey);
+ keyLoaded = true;
+ }
+ while (!file.fail());
+ }
+ catch (const std::exception& e) {
+ /* if we haven't been able to load at least one key, fail */
+ if (!keyLoaded) {
+ throw;
+ }
+ }
+
+ file.close();
+}
+
+void OpenSSLTLSTicketKeysRing::rotateTicketsKey(time_t now)
+{
+ auto newKey = std::make_shared<OpenSSLTLSTicketKey>();
+ addKey(newKey);
+}
+
+OpenSSLTLSTicketKey::OpenSSLTLSTicketKey()
+{
+ if (RAND_bytes(d_name, sizeof(d_name)) != 1) {
+ throw std::runtime_error("Error while generating the name of the OpenSSL TLS ticket key");
+ }
+
+ if (RAND_bytes(d_cipherKey, sizeof(d_cipherKey)) != 1) {
+ throw std::runtime_error("Error while generating the cipher key of the OpenSSL TLS ticket key");
+ }
+
+ if (RAND_bytes(d_hmacKey, sizeof(d_hmacKey)) != 1) {
+ throw std::runtime_error("Error while generating the HMAC key of the OpenSSL TLS ticket key");
+ }
+#ifdef HAVE_LIBSODIUM
+ sodium_mlock(d_name, sizeof(d_name));
+ sodium_mlock(d_cipherKey, sizeof(d_cipherKey));
+ sodium_mlock(d_hmacKey, sizeof(d_hmacKey));
+#endif /* HAVE_LIBSODIUM */
+}
+
+OpenSSLTLSTicketKey::OpenSSLTLSTicketKey(std::ifstream& file)
+{
+ file.read(reinterpret_cast<char*>(d_name), sizeof(d_name));
+ file.read(reinterpret_cast<char*>(d_cipherKey), sizeof(d_cipherKey));
+ file.read(reinterpret_cast<char*>(d_hmacKey), sizeof(d_hmacKey));
+
+ if (file.fail()) {
+ throw std::runtime_error("Unable to load a ticket key from the OpenSSL tickets key file");
+ }
+#ifdef HAVE_LIBSODIUM
+ sodium_mlock(d_name, sizeof(d_name));
+ sodium_mlock(d_cipherKey, sizeof(d_cipherKey));
+ sodium_mlock(d_hmacKey, sizeof(d_hmacKey));
+#endif /* HAVE_LIBSODIUM */
+}
+
+OpenSSLTLSTicketKey::~OpenSSLTLSTicketKey()
+{
+#ifdef HAVE_LIBSODIUM
+ sodium_munlock(d_name, sizeof(d_name));
+ sodium_munlock(d_cipherKey, sizeof(d_cipherKey));
+ sodium_munlock(d_hmacKey, sizeof(d_hmacKey));
+#else
+ OPENSSL_cleanse(d_name, sizeof(d_name));
+ OPENSSL_cleanse(d_cipherKey, sizeof(d_cipherKey));
+ OPENSSL_cleanse(d_hmacKey, sizeof(d_hmacKey));
+#endif /* HAVE_LIBSODIUM */
+}
+
+bool OpenSSLTLSTicketKey::nameMatches(const unsigned char name[TLS_TICKETS_KEY_NAME_SIZE]) const
+{
+ return (memcmp(d_name, name, sizeof(d_name)) == 0);
+}
+
+int OpenSSLTLSTicketKey::encrypt(unsigned char keyName[TLS_TICKETS_KEY_NAME_SIZE], unsigned char *iv, EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx) const
+{
+ memcpy(keyName, d_name, sizeof(d_name));
+
+ if (RAND_bytes(iv, EVP_MAX_IV_LENGTH) != 1) {
+ return -1;
+ }
+
+ if (EVP_EncryptInit_ex(ectx, TLS_TICKETS_CIPHER_ALGO(), nullptr, d_cipherKey, iv) != 1) {
+ return -1;
+ }
+
+ if (HMAC_Init_ex(hctx, d_hmacKey, sizeof(d_hmacKey), TLS_TICKETS_MAC_ALGO(), nullptr) != 1) {
+ return -1;
+ }
+
+ return 1;
+}
+
+bool OpenSSLTLSTicketKey::decrypt(const unsigned char* iv, EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx) const
+{
+ if (HMAC_Init_ex(hctx, d_hmacKey, sizeof(d_hmacKey), TLS_TICKETS_MAC_ALGO(), nullptr) != 1) {
+ return false;
+ }
+
+ if (EVP_DecryptInit_ex(ectx, TLS_TICKETS_CIPHER_ALGO(), nullptr, d_cipherKey, iv) != 1) {
+ return false;
+ }
+
+ return true;
+}
+
+std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)> libssl_init_server_context(const TLSConfig& config,
+ std::map<int, std::string>& ocspResponses)
+{
+ auto ctx = std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>(SSL_CTX_new(SSLv23_server_method()), SSL_CTX_free);
+
+ int sslOptions =
+ SSL_OP_NO_SSLv2 |
+ SSL_OP_NO_SSLv3 |
+ SSL_OP_NO_COMPRESSION |
+ SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION |
+ SSL_OP_SINGLE_DH_USE |
+ SSL_OP_SINGLE_ECDH_USE;
+
+ if (!config.d_enableTickets || config.d_numberOfTicketsKeys == 0) {
+ /* for TLS 1.3 this means no stateless tickets, but stateful tickets might still be issued,
+ which is something we don't want. */
+ sslOptions |= SSL_OP_NO_TICKET;
+ /* really disable all tickets */
+#ifdef HAVE_SSL_CTX_SET_NUM_TICKETS
+ SSL_CTX_set_num_tickets(ctx.get(), 0);
+#endif /* HAVE_SSL_CTX_SET_NUM_TICKETS */
+ }
+
+ if (config.d_sessionTimeout > 0) {
+ SSL_CTX_set_timeout(ctx.get(), config.d_sessionTimeout);
+ }
+
+ if (config.d_preferServerCiphers) {
+ sslOptions |= SSL_OP_CIPHER_SERVER_PREFERENCE;
+#ifdef SSL_OP_PRIORITIZE_CHACHA
+ sslOptions |= SSL_OP_PRIORITIZE_CHACHA;
+#endif /* SSL_OP_PRIORITIZE_CHACHA */
+ }
+
+ if (!config.d_enableRenegotiation) {
+#ifdef SSL_OP_NO_RENEGOTIATION
+ sslOptions |= SSL_OP_NO_RENEGOTIATION;
+#elif defined(SSL_OP_NO_CLIENT_RENEGOTIATION)
+ sslOptions |= SSL_OP_NO_CLIENT_RENEGOTIATION;
+#endif
+ }
+
+ SSL_CTX_set_options(ctx.get(), sslOptions);
+ if (!libssl_set_min_tls_version(ctx, config.d_minTLSVersion)) {
+ throw std::runtime_error("Failed to set the minimum version to '" + libssl_tls_version_to_string(config.d_minTLSVersion));
+ }
+
+#ifdef SSL_CTX_set_ecdh_auto
+ SSL_CTX_set_ecdh_auto(ctx.get(), 1);
+#endif
+
+ if (config.d_maxStoredSessions == 0) {
+ /* disable stored sessions entirely */
+ SSL_CTX_set_session_cache_mode(ctx.get(), SSL_SESS_CACHE_OFF);
+ }
+ else {
+ /* use the internal built-in cache to store sessions */
+ SSL_CTX_set_session_cache_mode(ctx.get(), SSL_SESS_CACHE_SERVER);
+ SSL_CTX_sess_set_cache_size(ctx.get(), config.d_maxStoredSessions);
+ }
+
+#ifdef SSL_MODE_RELEASE_BUFFERS
+ if (config.d_releaseBuffers) {
+ SSL_CTX_set_mode(ctx.get(), SSL_MODE_RELEASE_BUFFERS);
+ }
+#endif
+
+ /* we need to set this callback to acknowledge the server name sent by the client,
+ otherwise it will not stored in the session and will not be accessible when the
+ session is resumed, causing SSL_get_servername to return nullptr */
+ SSL_CTX_set_tlsext_servername_callback(ctx.get(), &libssl_server_name_callback);
+
+ std::vector<int> keyTypes;
+ /* load certificate and private key */
+ for (const auto& pair : config.d_certKeyPairs) {
+ if (SSL_CTX_use_certificate_chain_file(ctx.get(), pair.first.c_str()) != 1) {
+ ERR_print_errors_fp(stderr);
+ throw std::runtime_error("An error occurred while trying to load the TLS server certificate file: " + pair.first);
+ }
+ if (SSL_CTX_use_PrivateKey_file(ctx.get(), pair.second.c_str(), SSL_FILETYPE_PEM) != 1) {
+ ERR_print_errors_fp(stderr);
+ throw std::runtime_error("An error occurred while trying to load the TLS server private key file: " + pair.second);
+ }
+ if (SSL_CTX_check_private_key(ctx.get()) != 1) {
+ ERR_print_errors_fp(stderr);
+ throw std::runtime_error("The key from '" + pair.second + "' does not match the certificate from '" + pair.first + "'");
+ }
+ /* store the type of the new key, we might need it later to select the right OCSP stapling response */
+ auto keyType = libssl_get_last_key_type(ctx);
+ if (keyType < 0) {
+ throw std::runtime_error("The key from '" + pair.second + "' has an unknown type");
+ }
+ keyTypes.push_back(keyType);
+ }
+
+ if (!config.d_ocspFiles.empty()) {
+ try {
+ ocspResponses = libssl_load_ocsp_responses(config.d_ocspFiles, keyTypes);
+ }
+ catch(const std::exception& e) {
+ throw std::runtime_error("Unable to load OCSP responses: " + std::string(e.what()));
+ }
+ }
+
+ if (!config.d_ciphers.empty() && SSL_CTX_set_cipher_list(ctx.get(), config.d_ciphers.c_str()) != 1) {
+ throw std::runtime_error("The TLS ciphers could not be set: " + config.d_ciphers);
+ }
+
+#ifdef HAVE_SSL_CTX_SET_CIPHERSUITES
+ if (!config.d_ciphers13.empty() && SSL_CTX_set_ciphersuites(ctx.get(), config.d_ciphers13.c_str()) != 1) {
+ throw std::runtime_error("The TLS 1.3 ciphers could not be set: " + config.d_ciphers13);
+ }
+#endif /* HAVE_SSL_CTX_SET_CIPHERSUITES */
+
+ return ctx;
+}
+
+#ifdef HAVE_SSL_CTX_SET_KEYLOG_CALLBACK
+static void libssl_key_log_file_callback(const SSL* ssl, const char* line)
+{
+ SSL_CTX* sslCtx = SSL_get_SSL_CTX(ssl);
+ if (sslCtx == nullptr) {
+ return;
+ }
+
+ auto fp = reinterpret_cast<FILE*>(SSL_CTX_get_ex_data(sslCtx, s_keyLogIndex));
+ if (fp == nullptr) {
+ return;
+ }
+
+ fprintf(fp, "%s\n", line);
+ fflush(fp);
+}
+#endif /* HAVE_SSL_CTX_SET_KEYLOG_CALLBACK */
+
+std::unique_ptr<FILE, int(*)(FILE*)> libssl_set_key_log_file(std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>& ctx, const std::string& logFile)
+{
+#ifdef HAVE_SSL_CTX_SET_KEYLOG_CALLBACK
+ int fd = open(logFile.c_str(), O_WRONLY | O_CREAT | O_APPEND, 0600);
+ if (fd == -1) {
+ unixDie("Error opening TLS log file '" + logFile + "'");
+ }
+ auto fp = std::unique_ptr<FILE, int(*)(FILE*)>(fdopen(fd, "a"), fclose);
+ if (!fp) {
+ int error = errno; // close might clobber errno
+ close(fd);
+ throw std::runtime_error("Error opening TLS log file '" + logFile + "': " + stringerror(error));
+ }
+
+ SSL_CTX_set_ex_data(ctx.get(), s_keyLogIndex, fp.get());
+ SSL_CTX_set_keylog_callback(ctx.get(), &libssl_key_log_file_callback);
+
+ return fp;
+#else
+ return std::unique_ptr<FILE, int(*)(FILE*)>(nullptr, fclose);
+#endif /* HAVE_SSL_CTX_SET_KEYLOG_CALLBACK */
+}
+
+/* called in a client context, if the client advertised more than one ALPN values and the server returned more than one as well, to select the one to use. */
+void libssl_set_npn_select_callback(SSL_CTX* ctx, int (*cb)(SSL* s, unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen, void* arg), void* arg)
+{
+#ifdef HAVE_SSL_CTX_SET_NEXT_PROTO_SELECT_CB
+ SSL_CTX_set_next_proto_select_cb(ctx, cb, arg);
+#endif
+}
+
+void libssl_set_alpn_select_callback(SSL_CTX* ctx, int (*cb)(SSL* s, const unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen, void* arg), void* arg)
+{
+#ifdef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
+ SSL_CTX_set_alpn_select_cb(ctx, cb, arg);
+#endif
+}
+
+bool libssl_set_alpn_protos(SSL_CTX* ctx, const std::vector<std::vector<uint8_t>>& protos)
+{
+#ifdef HAVE_SSL_CTX_SET_ALPN_PROTOS
+ std::vector<uint8_t> wire;
+ for (const auto& proto : protos) {
+ if (proto.size() > std::numeric_limits<uint8_t>::max()) {
+ throw std::runtime_error("Invalid ALPN value");
+ }
+ uint8_t length = proto.size();
+ wire.push_back(length);
+ wire.insert(wire.end(), proto.begin(), proto.end());
+ }
+ return SSL_CTX_set_alpn_protos(ctx, wire.data(), wire.size()) == 0;
+#else
+ return false;
+#endif
+}
+
+
+std::string libssl_get_error_string()
+{
+ BIO *mem = BIO_new(BIO_s_mem());
+ ERR_print_errors(mem);
+ char *p;
+ size_t len = BIO_get_mem_data(mem, &p);
+ std::string msg(p, len);
+ // replace newlines by /
+ if (msg.back() == '\n') {
+ msg.pop_back();
+ }
+ std::replace(msg.begin(), msg.end(), '\n', '/');
+ BIO_free(mem);
+ return msg;
+}
+#endif /* HAVE_LIBSSL */
diff --git a/libssl.hh b/libssl.hh
new file mode 100644
index 0000000..4561b4a
--- /dev/null
+++ b/libssl.hh
@@ -0,0 +1,138 @@
+#pragma once
+
+#include <atomic>
+#include <fstream>
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "config.h"
+#include "circular_buffer.hh"
+#include "lock.hh"
+
+enum class LibsslTLSVersion : uint8_t { Unknown, TLS10, TLS11, TLS12, TLS13 };
+
+class TLSConfig
+{
+public:
+ std::vector<std::pair<std::string, std::string>> d_certKeyPairs;
+ std::vector<std::string> d_ocspFiles;
+
+ std::string d_ciphers;
+ std::string d_ciphers13;
+ std::string d_ticketKeyFile;
+ std::string d_keyLogFile;
+
+ size_t d_maxStoredSessions{20480};
+ time_t d_sessionTimeout{0};
+ time_t d_ticketsKeyRotationDelay{43200};
+ uint8_t d_numberOfTicketsKeys{5};
+ LibsslTLSVersion d_minTLSVersion{LibsslTLSVersion::TLS10};
+
+ bool d_preferServerCiphers{true};
+ bool d_enableTickets{true};
+ /* whether OpenSSL will release I/O buffers when the connection
+ becomes idle, saving memory */
+ bool d_releaseBuffers{true};
+ /* whether so-called secure renegotiation should be allowed for TLS < 1.3 */
+ bool d_enableRenegotiation{false};
+};
+
+struct TLSErrorCounters
+{
+ std::atomic<uint64_t> d_dhKeyTooSmall{0}; /* the other side sent a DH value that is not large enough */
+ std::atomic<uint64_t> d_inappropriateFallBack{0}; /* SCSV indicates that the client previously tried a higher version,
+ something bad is happening */
+ std::atomic<uint64_t> d_noSharedCipher{0}; /* we could not agree on a cipher to use */
+ std::atomic<uint64_t> d_unknownCipherType{0}; /* unknown cipher type */
+ std::atomic<uint64_t> d_unknownKeyExchangeType{0}; /* * unknown exchange type, weird */
+ std::atomic<uint64_t> d_unknownProtocol{0}; /* unknown protocol (SSLv2 or TLS 1.4, who knows? */
+ std::atomic<uint64_t> d_unsupportedEC{0}; /* unsupported elliptic curve */
+ std::atomic<uint64_t> d_unsupportedProtocol{0}; /* we don't accept this TLS version, sorry */
+};
+
+#ifdef HAVE_LIBSSL
+#include <openssl/ssl.h>
+
+void registerOpenSSLUser();
+void unregisterOpenSSLUser();
+
+/* From rfc5077 Section 4. Recommended Ticket Construction */
+#define TLS_TICKETS_KEY_NAME_SIZE (16)
+
+/* AES-256 */
+#define TLS_TICKETS_CIPHER_KEY_SIZE (32)
+#define TLS_TICKETS_CIPHER_ALGO (EVP_aes_256_cbc)
+
+/* HMAC SHA-256 */
+#define TLS_TICKETS_MAC_KEY_SIZE (32)
+#define TLS_TICKETS_MAC_ALGO (EVP_sha256)
+
+class OpenSSLTLSTicketKey
+{
+public:
+ OpenSSLTLSTicketKey();
+ OpenSSLTLSTicketKey(std::ifstream& file);
+ ~OpenSSLTLSTicketKey();
+
+ bool nameMatches(const unsigned char name[TLS_TICKETS_KEY_NAME_SIZE]) const;
+ int encrypt(unsigned char keyName[TLS_TICKETS_KEY_NAME_SIZE], unsigned char *iv, EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx) const;
+ bool decrypt(const unsigned char* iv, EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx) const;
+
+private:
+ unsigned char d_name[TLS_TICKETS_KEY_NAME_SIZE];
+ unsigned char d_cipherKey[TLS_TICKETS_CIPHER_KEY_SIZE];
+ unsigned char d_hmacKey[TLS_TICKETS_MAC_KEY_SIZE];
+};
+
+class OpenSSLTLSTicketKeysRing
+{
+public:
+ OpenSSLTLSTicketKeysRing(size_t capacity);
+ ~OpenSSLTLSTicketKeysRing();
+ void addKey(std::shared_ptr<OpenSSLTLSTicketKey> newKey);
+ std::shared_ptr<OpenSSLTLSTicketKey> getEncryptionKey();
+ std::shared_ptr<OpenSSLTLSTicketKey> getDecryptionKey(unsigned char name[TLS_TICKETS_KEY_NAME_SIZE], bool& activeKey);
+ size_t getKeysCount();
+ void loadTicketsKeys(const std::string& keyFile);
+ void rotateTicketsKey(time_t now);
+
+private:
+ SharedLockGuarded<boost::circular_buffer<std::shared_ptr<OpenSSLTLSTicketKey> > > d_ticketKeys;
+};
+
+void* libssl_get_ticket_key_callback_data(SSL* s);
+void libssl_set_ticket_key_callback_data(SSL_CTX* ctx, void* data);
+int libssl_ticket_key_callback(SSL *s, OpenSSLTLSTicketKeysRing& keyring, unsigned char keyName[TLS_TICKETS_KEY_NAME_SIZE], unsigned char *iv, EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx, int enc);
+
+int libssl_ocsp_stapling_callback(SSL* ssl, const std::map<int, std::string>& ocspMap);
+
+std::map<int, std::string> libssl_load_ocsp_responses(const std::vector<std::string>& ocspFiles, std::vector<int> keyTypes);
+int libssl_get_last_key_type(std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>& ctx);
+
+#ifdef HAVE_OCSP_BASIC_SIGN
+bool libssl_generate_ocsp_response(const std::string& certFile, const std::string& caCert, const std::string& caKey, const std::string& outFile, int ndays, int nmin);
+#endif
+
+void libssl_set_error_counters_callback(std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>& ctx, TLSErrorCounters* counters);
+
+LibsslTLSVersion libssl_tls_version_from_string(const std::string& str);
+const std::string& libssl_tls_version_to_string(LibsslTLSVersion version);
+bool libssl_set_min_tls_version(std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>& ctx, LibsslTLSVersion version);
+
+std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)> libssl_init_server_context(const TLSConfig& config,
+ std::map<int, std::string>& ocspResponses);
+
+std::unique_ptr<FILE, int(*)(FILE*)> libssl_set_key_log_file(std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)>& ctx, const std::string& logFile);
+
+/* called in a client context, if the client advertised more than one ALPN values and the server returned more than one as well, to select the one to use. */
+void libssl_set_npn_select_callback(SSL_CTX* ctx, int (*cb)(SSL* s, unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen, void* arg), void* arg);
+/* called in a server context, to select an ALPN value advertised by the client if any */
+void libssl_set_alpn_select_callback(SSL_CTX* ctx, int (*cb)(SSL* s, const unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen, void* arg), void* arg);
+/* set the supported ALPN protos in client context */
+bool libssl_set_alpn_protos(SSL_CTX* ctx, const std::vector<std::vector<uint8_t>>& protos);
+
+std::string libssl_get_error_string();
+
+#endif /* HAVE_LIBSSL */
diff --git a/lock.hh b/lock.hh
new file mode 100644
index 0000000..e8bd829
--- /dev/null
+++ b/lock.hh
@@ -0,0 +1,452 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <mutex>
+#include <shared_mutex>
+
+/*
+ This file provides several features around locks:
+
+ - LockGuarded and SharedLockGuarded provide a way to wrap any data structure as
+ protected by a lock (mutex or shared mutex), while making it immediately clear
+ which data is protected by that lock, and preventing any access to the data without
+ holding the lock.
+
+ For example, to protect a set of integers with a simple mutex:
+
+ LockGuarded<std::set<int>> d_data;
+
+ or with a shared mutex instead:
+
+ SharedLockGuarded<std::set<int>> d_data;
+
+ Then the only ways to access the data is to call the lock(), read_only_lock() or try_lock() methods
+ for the simple case, or the read_lock(), write_lock(), try_read_lock() or try_write_lock() for the
+ shared one.
+ Doing so will return a "holder" object, which provides access to the protected data, checking that
+ the lock has really been acquired if needed (try_ cases). The data might be read-only if read_lock(),
+ try_read_lock() or read_only_lock() was called. Access is provided by dereferencing the holder object
+ via '*' or '->', allowing a quick-access syntax:
+
+ return d_data.lock()->size();
+
+ Or when the lock needs to be kept for a bit longer:
+
+ {
+ auto data = d_data.lock();
+ data->clear();
+ data->insert(42);
+ }
+
+ - ReadWriteLock is a very light wrapper around a std::shared_mutex.
+ It used to be useful as a RAII wrapper around pthread_rwlock, but since
+ C++17 we don't actually that, so it's mostly there for historical
+ reasons.
+
+ - ReadLock, WriteLock, TryReadLock and TryWriteLock are there as RAII
+ objects allowing to take a lock and be sure that it will always be unlocked
+ when we exit the block, even with a unforeseen exception.
+ They are light wrappers around std::unique_lock and std::shared_lock
+ since C++17.
+
+ Note that while the use of a shared mutex might be very efficient when the data
+ is predominantly concurrently accessed for reading by multiple threads and not
+ often written to (although if it is almost never updated our StateHolder in
+ sholder.hh might be a better fit), it is significantly more expensive than
+ a regular mutex, so that one might be a better choice if the contention is
+ low. It is wise to start with a regular mutex and actually measure the contention
+ under load before switching to a shared mutex.
+ */
+
+class ReadWriteLock
+{
+public:
+ ReadWriteLock()
+ {
+ }
+
+ ReadWriteLock(const ReadWriteLock& rhs) = delete;
+ ReadWriteLock(ReadWriteLock&& rhs) = delete;
+ ReadWriteLock& operator=(const ReadWriteLock& rhs) = delete;
+
+ std::shared_mutex& getLock()
+ {
+ return d_lock;
+ }
+
+private:
+ std::shared_mutex d_lock;
+};
+
+class ReadLock
+{
+public:
+ ReadLock(ReadWriteLock& lock): ReadLock(lock.getLock())
+ {
+ }
+
+ ReadLock(ReadWriteLock* lock): ReadLock(lock->getLock())
+ {
+ }
+
+ ReadLock(const ReadLock& rhs) = delete;
+ ReadLock& operator=(const ReadLock& rhs) = delete;
+ ReadLock(ReadLock&& rhs) : d_lock(std::move(rhs.d_lock))
+ {
+ }
+
+private:
+ ReadLock(std::shared_mutex& lock) : d_lock(lock)
+ {
+ }
+
+ std::shared_lock<std::shared_mutex> d_lock;
+};
+
+class WriteLock
+{
+public:
+ WriteLock(ReadWriteLock& lock): WriteLock(lock.getLock())
+ {
+ }
+
+ WriteLock(ReadWriteLock* lock): WriteLock(lock->getLock())
+ {
+ }
+
+ WriteLock(const WriteLock& rhs) = delete;
+ WriteLock& operator=(const WriteLock& rhs) = delete;
+ WriteLock(WriteLock&& rhs) : d_lock(std::move(rhs.d_lock))
+ {
+ }
+
+private:
+ WriteLock(std::shared_mutex& lock) : d_lock(lock)
+ {
+ }
+
+ std::unique_lock<std::shared_mutex> d_lock;
+};
+
+class TryReadLock
+{
+public:
+ TryReadLock(ReadWriteLock& lock): TryReadLock(lock.getLock())
+ {
+ }
+
+ TryReadLock(ReadWriteLock* lock): TryReadLock(lock->getLock())
+ {
+ }
+
+ TryReadLock(const TryReadLock& rhs) = delete;
+ TryReadLock& operator=(const TryReadLock& rhs) = delete;
+
+ bool gotIt() const
+ {
+ return d_lock.owns_lock();
+ }
+
+private:
+ TryReadLock(std::shared_mutex& lock) : d_lock(lock, std::try_to_lock)
+ {
+ }
+
+ std::shared_lock<std::shared_mutex> d_lock;
+};
+
+class TryWriteLock
+{
+public:
+ TryWriteLock(ReadWriteLock& lock): TryWriteLock(lock.getLock())
+ {
+ }
+
+ TryWriteLock(ReadWriteLock* lock): TryWriteLock(lock->getLock())
+ {
+ }
+
+ TryWriteLock(const TryWriteLock& rhs) = delete;
+ TryWriteLock& operator=(const TryWriteLock& rhs) = delete;
+
+ bool gotIt() const
+ {
+ return d_lock.owns_lock();
+ }
+
+private:
+ TryWriteLock(std::shared_mutex& lock) : d_lock(lock, std::try_to_lock)
+ {
+ }
+
+ std::unique_lock<std::shared_mutex> d_lock;
+};
+
+template <typename T>
+class LockGuardedHolder
+{
+public:
+ explicit LockGuardedHolder(T& value, std::mutex& mutex): d_lock(mutex), d_value(value)
+ {
+ }
+
+ T& operator*() const noexcept {
+ return d_value;
+ }
+
+ T* operator->() const noexcept {
+ return &d_value;
+ }
+
+private:
+ std::lock_guard<std::mutex> d_lock;
+ T& d_value;
+};
+
+template <typename T>
+class LockGuardedTryHolder
+{
+public:
+ explicit LockGuardedTryHolder(T& value, std::mutex& mutex): d_lock(mutex, std::try_to_lock), d_value(value)
+ {
+ }
+
+ T& operator*() const {
+ if (!owns_lock()) {
+ throw std::runtime_error("Trying to access data protected by a mutex while the lock has not been acquired");
+ }
+ return d_value;
+ }
+
+ T* operator->() const {
+ if (!owns_lock()) {
+ throw std::runtime_error("Trying to access data protected by a mutex while the lock has not been acquired");
+ }
+ return &d_value;
+ }
+
+ operator bool() const noexcept {
+ return d_lock.owns_lock();
+ }
+
+ bool owns_lock() const noexcept {
+ return d_lock.owns_lock();
+ }
+
+ void lock()
+ {
+ d_lock.lock();
+ }
+
+private:
+ std::unique_lock<std::mutex> d_lock;
+ T& d_value;
+};
+
+template <typename T>
+class LockGuarded
+{
+public:
+ explicit LockGuarded(const T& value): d_value(value)
+ {
+ }
+
+ explicit LockGuarded(T&& value): d_value(std::move(value))
+ {
+ }
+
+ explicit LockGuarded()
+ {
+ }
+
+ LockGuardedTryHolder<T> try_lock()
+ {
+ return LockGuardedTryHolder<T>(d_value, d_mutex);
+ }
+
+ LockGuardedHolder<T> lock()
+ {
+ return LockGuardedHolder<T>(d_value, d_mutex);
+ }
+
+ LockGuardedHolder<const T> read_only_lock() const
+ {
+ return LockGuardedHolder<const T>(d_value, d_mutex);
+ }
+
+private:
+ std::mutex d_mutex;
+ T d_value;
+};
+
+template <typename T>
+class SharedLockGuardedHolder
+{
+public:
+ explicit SharedLockGuardedHolder(T& value, std::shared_mutex& mutex): d_lock(mutex), d_value(value)
+ {
+ }
+
+ T& operator*() const noexcept {
+ return d_value;
+ }
+
+ T* operator->() const noexcept {
+ return &d_value;
+ }
+
+private:
+ std::lock_guard<std::shared_mutex> d_lock;
+ T& d_value;
+};
+
+template <typename T>
+class SharedLockGuardedTryHolder
+{
+public:
+ explicit SharedLockGuardedTryHolder(T& value, std::shared_mutex& mutex): d_lock(mutex, std::try_to_lock), d_value(value)
+ {
+ }
+
+ T& operator*() const {
+ if (!owns_lock()) {
+ throw std::runtime_error("Trying to access data protected by a mutex while the lock has not been acquired");
+ }
+ return d_value;
+ }
+
+ T* operator->() const {
+ if (!owns_lock()) {
+ throw std::runtime_error("Trying to access data protected by a mutex while the lock has not been acquired");
+ }
+ return &d_value;
+ }
+
+ operator bool() const noexcept {
+ return d_lock.owns_lock();
+ }
+
+ bool owns_lock() const noexcept {
+ return d_lock.owns_lock();
+ }
+
+private:
+ std::unique_lock<std::shared_mutex> d_lock;
+ T& d_value;
+};
+
+template <typename T>
+class SharedLockGuardedNonExclusiveHolder
+{
+public:
+ explicit SharedLockGuardedNonExclusiveHolder(const T& value, std::shared_mutex& mutex): d_lock(mutex), d_value(value)
+ {
+ }
+
+ const T& operator*() const noexcept {
+ return d_value;
+ }
+
+ const T* operator->() const noexcept {
+ return &d_value;
+ }
+
+private:
+ std::shared_lock<std::shared_mutex> d_lock;
+ const T& d_value;
+};
+
+template <typename T>
+class SharedLockGuardedNonExclusiveTryHolder
+{
+public:
+ explicit SharedLockGuardedNonExclusiveTryHolder(const T& value, std::shared_mutex& mutex): d_lock(mutex, std::try_to_lock), d_value(value)
+ {
+ }
+
+ const T& operator*() const {
+ if (!owns_lock()) {
+ throw std::runtime_error("Trying to access data protected by a mutex while the lock has not been acquired");
+ }
+ return d_value;
+ }
+
+ const T* operator->() const {
+ if (!owns_lock()) {
+ throw std::runtime_error("Trying to access data protected by a mutex while the lock has not been acquired");
+ }
+ return &d_value;
+ }
+
+ operator bool() const noexcept {
+ return d_lock.owns_lock();
+ }
+
+ bool owns_lock() const noexcept {
+ return d_lock.owns_lock();
+ }
+
+private:
+ std::shared_lock<std::shared_mutex> d_lock;
+ const T& d_value;
+};
+
+template <typename T>
+class SharedLockGuarded
+{
+public:
+ explicit SharedLockGuarded(const T& value): d_value(value)
+ {
+ }
+
+ explicit SharedLockGuarded(T&& value): d_value(std::move(value))
+ {
+ }
+
+ explicit SharedLockGuarded()
+ {
+ }
+
+ SharedLockGuardedTryHolder<T> try_write_lock()
+ {
+ return SharedLockGuardedTryHolder<T>(d_value, d_mutex);
+ }
+
+ SharedLockGuardedHolder<T> write_lock()
+ {
+ return SharedLockGuardedHolder<T>(d_value, d_mutex);
+ }
+
+ SharedLockGuardedNonExclusiveTryHolder<T> try_read_lock()
+ {
+ return SharedLockGuardedNonExclusiveTryHolder<T>(d_value, d_mutex);
+ }
+
+ SharedLockGuardedNonExclusiveHolder<T> read_lock()
+ {
+ return SharedLockGuardedNonExclusiveHolder<T>(d_value, d_mutex);
+ }
+
+private:
+ std::shared_mutex d_mutex;
+ T d_value;
+};
diff --git a/ltmain.sh b/ltmain.sh
new file mode 100644
index 0000000..bb9035a
--- /dev/null
+++ b/ltmain.sh
@@ -0,0 +1,11153 @@
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+## by inline-source v2014-01-03.01
+
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 <http://www.gnu.org/licenses/>.
+
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4.6
+package_revision=2.4.6
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# 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.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES 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 <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+ emulate sh
+ NULLCMD=:
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
+fi
+
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test set = \"\${$_G_var+set}\"; then
+ save_$_G_var=\$$_G_var
+ $_G_var=C
+ export $_G_var
+ _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
+ fi"
+done
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp $nl"
+
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+
+
+
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
+
+
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+}
+
+
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+ _G_progs_list=$1
+ _G_check_func=$2
+ _G_PATH=${3-"$PATH"}
+
+ _G_path_prog_max=0
+ _G_path_prog_found=false
+ _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+ for _G_dir in $_G_PATH; do
+ IFS=$_G_save_IFS
+ test -z "$_G_dir" && _G_dir=.
+ for _G_prog_name in $_G_progs_list; do
+ for _exeext in '' .EXE; do
+ _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+ func_executable_p "$_G_path_prog" || continue
+ case `"$_G_path_prog" --version 2>&1` in
+ *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+ *) $_G_check_func $_G_path_prog
+ func_path_progs_result=$func_check_prog_result
+ ;;
+ esac
+ $_G_path_prog_found && break 3
+ done
+ done
+ done
+ IFS=$_G_save_IFS
+ test -z "$func_path_progs_result" && {
+ echo "no acceptable sed could be found in \$PATH" >&2
+ exit 1
+ }
+}
+
+
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
+
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+ _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for _G_i in 1 2 3 4 5 6 7; do
+ _G_sed_script=$_G_sed_script$nl$_G_sed_script
+ done
+ echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+ _G_sed_script=
+
+ func_check_prog_sed ()
+ {
+ _G_path_prog=$1
+
+ _G_count=0
+ printf 0123456789 >conftest.in
+ while :
+ do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo '' >> conftest.nl
+ "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+ diff conftest.out conftest.nl >/dev/null 2>&1 || break
+ _G_count=`expr $_G_count + 1`
+ if test "$_G_count" -gt "$_G_path_prog_max"; then
+ # Best one so far, save it but keep looking for a better one
+ func_check_prog_result=$_G_path_prog
+ _G_path_prog_max=$_G_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test 10 -lt "$_G_count" && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out
+ }
+
+ func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+ rm -f conftest.sed
+ SED=$func_path_progs_result
+}
+
+
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+ func_check_prog_grep ()
+ {
+ _G_path_prog=$1
+
+ _G_count=0
+ _G_path_prog_max=0
+ printf 0123456789 >conftest.in
+ while :
+ do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo 'GREP' >> conftest.nl
+ "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+ diff conftest.out conftest.nl >/dev/null 2>&1 || break
+ _G_count=`expr $_G_count + 1`
+ if test "$_G_count" -gt "$_G_path_prog_max"; then
+ # Best one so far, save it but keep looking for a better one
+ func_check_prog_result=$_G_path_prog
+ _G_path_prog_max=$_G_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test 10 -lt "$_G_count" && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out
+ }
+
+ func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+ GREP=$func_path_progs_result
+}
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables. These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
+
+: ${CP="cp -f"}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+
+
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
+
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
+
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
+
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same. If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion. Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+ s/$_G_bs4/&\\
+/g
+ s/^$_G_bs2$_G_dollar/$_G_bs&/
+ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+ s/\n//g"
+
+
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
+
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
+
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
+
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
+
+# By convention, finish your script with:
+#
+# exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
+
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
+
+# Make sure we have an absolute progpath for reexecution:
+case $progpath in
+ [\\/]*|[A-Za-z]:\\*) ;;
+ *[\\/]*)
+ progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
+ progdir=`cd "$progdir" && pwd`
+ progpath=$progdir/$progname
+ ;;
+ *)
+ _G_IFS=$IFS
+ IFS=${PATH_SEPARATOR-:}
+ for progdir in $PATH; do
+ IFS=$_G_IFS
+ test -x "$progdir/$progname" && break
+ done
+ IFS=$_G_IFS
+ test -n "$progdir" || progdir=`pwd`
+ progpath=$progdir/$progname
+ ;;
+esac
+
+
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
+
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
+
+opt_dry_run=false
+opt_quiet=false
+opt_verbose=false
+
+# Categories 'all' and 'none' are always available. Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
+
+# By default, display warnings according to 'opt_warning_types'. Set
+# 'warning_func' to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
+
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
+{
+ $debug_cmd
+
+ test -t 1 && {
+ # COLORTERM and USE_ANSI_COLORS environment variables take
+ # precedence, because most terminfo databases neglect to describe
+ # whether color sequences are supported.
+ test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+ if test 1 = "$USE_ANSI_COLORS"; then
+ # Standard ANSI escape sequences
+ tc_reset=''
+ tc_bold=''; tc_standout=''
+ tc_red=''; tc_green=''
+ tc_blue=''; tc_cyan=''
+ else
+ # Otherwise trust the terminfo database after all.
+ test -n "`tput sgr0 2>/dev/null`" && {
+ tc_reset=`tput sgr0`
+ test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+ tc_standout=$tc_bold
+ test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+ test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+ test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+ test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+ test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+ }
+ fi
+ }
+
+ require_term_colors=:
+}
+
+
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+ # We should try to minimise forks, especially on Windows where they are
+ # unreasonably slow, so skip the feature probes when bash or zsh are
+ # being used:
+ if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+ : ${_G_HAVE_ARITH_OP="yes"}
+ : ${_G_HAVE_XSI_OPS="yes"}
+ # The += operator was introduced in bash 3.1
+ case $BASH_VERSION in
+ [12].* | 3.0 | 3.0*) ;;
+ *)
+ : ${_G_HAVE_PLUSEQ_OP="yes"}
+ ;;
+ esac
+ fi
+
+ # _G_HAVE_PLUSEQ_OP
+ # Can be empty, in which case the shell is probed, "yes" if += is
+ # useable or anything else if it does not work.
+ test -z "$_G_HAVE_PLUSEQ_OP" \
+ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+ && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_append ()
+ {
+ $debug_cmd
+
+ eval "$1+=\$2"
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_append ()
+ {
+ $debug_cmd
+
+ eval "$1=\$$1\$2"
+ }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+ eval 'func_append_quoted ()
+ {
+ $debug_cmd
+
+ func_quote_for_eval "$2"
+ eval "$1+=\\ \$func_quote_for_eval_result"
+ }'
+else
+ func_append_quoted ()
+ {
+ $debug_cmd
+
+ func_quote_for_eval "$2"
+ eval "$1=\$$1\\ \$func_quote_for_eval_result"
+ }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE. For example:
+#
+# func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+ $debug_cmd
+
+ eval _G_current_value='`$ECHO $'$1'`'
+ _G_delim=`expr "$2" : '\(.\)'`
+
+ case $_G_delim$_G_current_value$_G_delim in
+ *"$2$_G_delim"*) ;;
+ *) func_append "$@" ;;
+ esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+ test -z "$_G_HAVE_ARITH_OP" \
+ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+ && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+ eval 'func_arith ()
+ {
+ $debug_cmd
+
+ func_arith_result=$(( $* ))
+ }'
+else
+ func_arith ()
+ {
+ $debug_cmd
+
+ func_arith_result=`expr "$@"`
+ }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ # If this shell supports suffix pattern removal, then use it to avoid
+ # forking. Hide the definitions single quotes in case the shell chokes
+ # on unsupported syntax...
+ _b='func_basename_result=${1##*/}'
+ _d='case $1 in
+ */*) func_dirname_result=${1%/*}$2 ;;
+ * ) func_dirname_result=$3 ;;
+ esac'
+
+else
+ # ...otherwise fall back to using sed.
+ _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+ _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
+ if test "X$func_dirname_result" = "X$1"; then
+ func_dirname_result=$3
+ else
+ func_append func_dirname_result "$2"
+ fi'
+fi
+
+eval 'func_basename ()
+{
+ $debug_cmd
+
+ '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+ $debug_cmd
+
+ '"$_d"'
+}'
+
+
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+ $debug_cmd
+
+ '"$_b"'
+ '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+ $debug_cmd
+
+ _G_message=$*
+
+ func_echo_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_IFS
+ $ECHO "$progname: $_G_line"
+ done
+ IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+ $debug_cmd
+
+ $require_term_colors
+
+ _G_infix=$1; shift
+ _G_indent=$_G_infix
+ _G_prefix="$progname: $_G_infix: "
+ _G_message=$*
+
+ # Strip color escape sequences before counting printable length
+ for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+ do
+ test -n "$_G_tc" && {
+ _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+ _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+ }
+ done
+ _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
+
+ func_echo_infix_1_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_infix_1_IFS
+ $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+ _G_prefix=$_G_indent
+ done
+ IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+ $debug_cmd
+
+ $require_term_colors
+
+ func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+ $debug_cmd
+
+ func_error "$*"
+ exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+ $debug_cmd
+
+ $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+ test -z "$_G_HAVE_XSI_OPS" \
+ && (eval 'x=a/b/c;
+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+ && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_len ()
+ {
+ $debug_cmd
+
+ func_len_result=${#1}
+ }'
+else
+ func_len ()
+ {
+ $debug_cmd
+
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+ }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+ $debug_cmd
+
+ _G_directory_path=$1
+ _G_dir_list=
+
+ if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+ # Protect directory names starting with '-'
+ case $_G_directory_path in
+ -*) _G_directory_path=./$_G_directory_path ;;
+ esac
+
+ # While some portion of DIR does not yet exist...
+ while test ! -d "$_G_directory_path"; do
+ # ...make a list in topmost first order. Use a colon delimited
+ # list incase some portion of path contains whitespace.
+ _G_dir_list=$_G_directory_path:$_G_dir_list
+
+ # If the last portion added has no slash in it, the list is done
+ case $_G_directory_path in */*) ;; *) break ;; esac
+
+ # ...otherwise throw away the child directory and loop
+ _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
+ done
+ _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
+
+ func_mkdir_p_IFS=$IFS; IFS=:
+ for _G_dir in $_G_dir_list; do
+ IFS=$func_mkdir_p_IFS
+ # mkdir can fail with a 'File exist' error if two processes
+ # try to create one of the directories concurrently. Don't
+ # stop in that case!
+ $MKDIR "$_G_dir" 2>/dev/null || :
+ done
+ IFS=$func_mkdir_p_IFS
+
+ # Bail out if we (or some other process) failed to create a directory.
+ test -d "$_G_directory_path" || \
+ func_fatal_error "Failed to create '$1'"
+ fi
+}
+
+
+# func_mktempdir [BASENAME]
+# -------------------------
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, BASENAME is the basename for that directory.
+func_mktempdir ()
+{
+ $debug_cmd
+
+ _G_template=${TMPDIR-/tmp}/${1-$progname}
+
+ if test : = "$opt_dry_run"; then
+ # Return a directory name, but don't create it in dry-run mode
+ _G_tmpdir=$_G_template-$$
+ else
+
+ # If mktemp works, use that first and foremost
+ _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$_G_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ _G_tmpdir=$_G_template-${RANDOM-0}$$
+
+ func_mktempdir_umask=`umask`
+ umask 0077
+ $MKDIR "$_G_tmpdir"
+ umask $func_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$_G_tmpdir" || \
+ func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+ fi
+
+ $ECHO "$_G_tmpdir"
+}
+
+
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
+{
+ $debug_cmd
+
+ # These SED scripts presuppose an absolute path with a trailing slash.
+ _G_pathcar='s|^/\([^/]*\).*$|\1|'
+ _G_pathcdr='s|^/[^/]*||'
+ _G_removedotparts=':dotsl
+ s|/\./|/|g
+ t dotsl
+ s|/\.$|/|'
+ _G_collapseslashes='s|/\{1,\}|/|g'
+ _G_finalslash='s|/*$|/|'
+
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
+ ;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
+ *)
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
+ esac
+
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test / = "$func_normal_abspath_tpath"; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result"; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+ $debug_cmd
+
+ $opt_quiet || func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+ $debug_cmd
+
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=$func_dirname_result
+ if test -z "$func_relative_path_tlibdir"; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test -n "$func_stripname_result"; then
+ func_append func_relative_path_result "/$func_stripname_result"
+ fi
+
+ # Normalisation. If bindir is libdir, return '.' else relative path.
+ if test -n "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ fi
+
+ test -n "$func_relative_path_result" || func_relative_path_result=.
+
+ :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+# i) func_quote_for_eval_result
+# double-quoted, suitable for a subsequent eval
+# ii) func_quote_for_eval_unquoted_result
+# has all characters that are still active within double
+# quotes backslashified.
+func_quote_for_eval ()
+{
+ $debug_cmd
+
+ func_quote_for_eval_unquoted_result=
+ func_quote_for_eval_result=
+ while test 0 -lt $#; do
+ case $1 in
+ *[\\\`\"\$]*)
+ _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+ *)
+ _G_unquoted_arg=$1 ;;
+ esac
+ if test -n "$func_quote_for_eval_unquoted_result"; then
+ func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+ else
+ func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+ fi
+
+ case $_G_unquoted_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and variable expansion
+ # for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ _G_quoted_arg=\"$_G_unquoted_arg\"
+ ;;
+ *)
+ _G_quoted_arg=$_G_unquoted_arg
+ ;;
+ esac
+
+ if test -n "$func_quote_for_eval_result"; then
+ func_append func_quote_for_eval_result " $_G_quoted_arg"
+ else
+ func_append func_quote_for_eval_result "$_G_quoted_arg"
+ fi
+ shift
+ done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ $debug_cmd
+
+ case $1 in
+ *[\\\`\"]*)
+ _G_arg=`$ECHO "$1" | $SED \
+ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ _G_arg=$1 ;;
+ esac
+
+ case $_G_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ _G_arg=\"$_G_arg\"
+ ;;
+ esac
+
+ func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_stripname ()
+ {
+ $debug_cmd
+
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary variable first.
+ func_stripname_result=$3
+ func_stripname_result=${func_stripname_result#"$1"}
+ func_stripname_result=${func_stripname_result%"$2"}
+ }'
+else
+ func_stripname ()
+ {
+ $debug_cmd
+
+ case $2 in
+ .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+ *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+ esac
+ }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+ $debug_cmd
+
+ _G_cmd=$1
+ _G_fail_exp=${2-':'}
+
+ func_quote_for_expand "$_G_cmd"
+ eval "func_notquiet $func_quote_for_expand_result"
+
+ $opt_dry_run || {
+ eval "$_G_cmd"
+ _G_status=$?
+ if test 0 -ne "$_G_status"; then
+ eval "(exit $_G_status); $_G_fail_exp"
+ fi
+ }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it. Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+ $debug_cmd
+
+ _G_cmd=$1
+ _G_fail_exp=${2-':'}
+
+ $opt_quiet || {
+ func_quote_for_expand "$_G_cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+
+ $opt_dry_run || {
+ eval "$_G_user_locale
+ $_G_cmd"
+ _G_status=$?
+ eval "$_G_safe_locale"
+ if test 0 -ne "$_G_status"; then
+ eval "(exit $_G_status); $_G_fail_exp"
+ fi
+ }
+}
+
+
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ $debug_cmd
+
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+ $debug_cmd
+
+ $opt_verbose && func_echo "$*"
+
+ :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+ $debug_cmd
+
+ $require_term_colors
+
+ func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+ $debug_cmd
+
+ # CATEGORY must be in the warning_categories list!
+ case " $warning_categories " in
+ *" $1 "*) ;;
+ *) func_internal_error "invalid warning category '$1'" ;;
+ esac
+
+ _G_category=$1
+ shift
+
+ case " $opt_warning_types " in
+ *" $_G_category "*) $warning_func ${1+"$@"} ;;
+ esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+ $debug_cmd
+
+ printf '%s\n%s\n' "$1" "$2" \
+ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false. Use it like this:
+#
+# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+ $debug_cmd
+
+ test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2014-01-07.03; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# 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 <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+# #!/bin/sh
+# . relative/path/to/funclib.sh
+# . relative/path/to/options-parser
+# scriptversion=1.0
+# func_options ${1+"$@"}
+# eval set dummy "$func_options_result"; shift
+# ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'. Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+ --debug enable verbose shell tracing
+ -W, --warnings=CATEGORY
+ report the warnings falling in CATEGORY [all]
+ -v, --verbose verbosely report processing
+ --version print version information and exit
+ -h, --help print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+ 'all' show all warnings
+ 'none' turn off all the warnings
+ 'error' warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code. A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+ $debug_cmd
+
+ func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+ $debug_cmd
+
+ case " $hookable_fns " in
+ *" $1 "*) ;;
+ *) func_fatal_error "'$1' does not accept hook functions." ;;
+ esac
+
+ eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+ $debug_cmd
+
+ eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+ $debug_cmd
+
+ case " $hookable_fns " in
+ *" $1 "*) ;;
+ *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+ esac
+
+ eval _G_hook_fns=\$$1_hooks; shift
+
+ for _G_hook in $_G_hook_fns; do
+ eval $_G_hook '"$@"'
+
+ # store returned options list back into positional
+ # parameters for next 'cmd' execution.
+ eval _G_hook_result=\$${_G_hook}_result
+ eval set dummy "$_G_hook_result"; shift
+ done
+
+ func_quote_for_eval ${1+"$@"}
+ func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'. Like this:
+#
+# my_options_prep ()
+# {
+# $debug_cmd
+#
+# # Extend the existing usage message.
+# usage_message=$usage_message'
+# -s, --silent don'\''t print informational messages
+# '
+#
+# func_quote_for_eval ${1+"$@"}
+# my_options_prep_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_options_prep my_options_prep
+#
+#
+# my_silent_option ()
+# {
+# $debug_cmd
+#
+# # Note that for efficiency, we parse as many options as we can
+# # recognise in a loop before passing the remainder back to the
+# # caller on the first unrecognised argument we encounter.
+# while test $# -gt 0; do
+# opt=$1; shift
+# case $opt in
+# --silent|-s) opt_silent=: ;;
+# # Separate non-argument short options:
+# -s*) func_split_short_opt "$_G_opt"
+# set dummy "$func_split_short_opt_name" \
+# "-$func_split_short_opt_arg" ${1+"$@"}
+# shift
+# ;;
+# *) set dummy "$_G_opt" "$*"; shift; break ;;
+# esac
+# done
+#
+# func_quote_for_eval ${1+"$@"}
+# my_silent_option_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_parse_options my_silent_option
+#
+#
+# my_option_validation ()
+# {
+# $debug_cmd
+#
+# $opt_silent && $opt_verbose && func_fatal_help "\
+# '--silent' and '--verbose' options are mutually exclusive."
+#
+# func_quote_for_eval ${1+"$@"}
+# my_option_validation_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse. It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+ $debug_cmd
+
+ func_options_prep ${1+"$@"}
+ eval func_parse_options \
+ ${func_options_prep_result+"$func_options_prep_result"}
+ eval func_validate_options \
+ ${func_parse_options_result+"$func_parse_options_result"}
+
+ eval func_run_hooks func_options \
+ ${func_validate_options_result+"$func_validate_options_result"}
+
+ # save modified positional parameters for caller
+ func_options_result=$func_run_hooks_result
+}
+
+
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters. If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
+{
+ $debug_cmd
+
+ # Option defaults:
+ opt_verbose=false
+ opt_warning_types=
+
+ func_run_hooks func_options_prep ${1+"$@"}
+
+ # save modified positional parameters for caller
+ func_options_prep_result=$func_run_hooks_result
+}
+
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
+{
+ $debug_cmd
+
+ func_parse_options_result=
+
+ # this just eases exit handling
+ while test $# -gt 0; do
+ # Defer to hook functions for initial option parsing, so they
+ # get priority in the event of reusing an option name.
+ func_run_hooks func_parse_options ${1+"$@"}
+
+ # Adjust func_parse_options positional parameters to match
+ eval set dummy "$func_run_hooks_result"; shift
+
+ # Break out of the loop if we already parsed every option.
+ test $# -gt 0 || break
+
+ _G_opt=$1
+ shift
+ case $_G_opt in
+ --debug|-x) debug_cmd='set -x'
+ func_echo "enabling shell trace mode"
+ $debug_cmd
+ ;;
+
+ --no-warnings|--no-warning|--no-warn)
+ set dummy --warnings none ${1+"$@"}
+ shift
+ ;;
+
+ --warnings|--warning|-W)
+ test $# = 0 && func_missing_arg $_G_opt && break
+ case " $warning_categories $1" in
+ *" $1 "*)
+ # trailing space prevents matching last $1 above
+ func_append_uniq opt_warning_types " $1"
+ ;;
+ *all)
+ opt_warning_types=$warning_categories
+ ;;
+ *none)
+ opt_warning_types=none
+ warning_func=:
+ ;;
+ *error)
+ opt_warning_types=$warning_categories
+ warning_func=func_fatal_error
+ ;;
+ *)
+ func_fatal_error \
+ "unsupported warning category: '$1'"
+ ;;
+ esac
+ shift
+ ;;
+
+ --verbose|-v) opt_verbose=: ;;
+ --version) func_version ;;
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+
+ # Separate optargs to long options (plugins may need this):
+ --*=*) func_split_equals "$_G_opt"
+ set dummy "$func_split_equals_lhs" \
+ "$func_split_equals_rhs" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate optargs to short options:
+ -W*)
+ func_split_short_opt "$_G_opt"
+ set dummy "$func_split_short_opt_name" \
+ "$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-v*|-x*)
+ func_split_short_opt "$_G_opt"
+ set dummy "$func_split_short_opt_name" \
+ "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ func_parse_options_result=$func_quote_for_eval_result
+}
+
+
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
+{
+ $debug_cmd
+
+ # Display all warnings if -W was not given.
+ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+ func_run_hooks func_validate_options ${1+"$@"}
+
+ # Bail if the options were screwed!
+ $exit_cmd $EXIT_FAILURE
+
+ # save modified positional parameters for caller
+ func_validate_options_result=$func_run_hooks_result
+}
+
+
+
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ $debug_cmd
+
+ eval \$ECHO \""Usage: $usage"\"
+ eval \$ECHO \""$fatal_help"\"
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
+func_help ()
+{
+ $debug_cmd
+
+ func_usage_message
+ $ECHO "$long_help_message"
+ exit 0
+}
+
+
+# func_missing_arg ARGNAME
+# ------------------------
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+ $debug_cmd
+
+ func_error "Missing argument for '$1'."
+ exit_cmd=exit
+}
+
+
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+ && (eval 'x=a/b/c;
+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+ && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_split_equals ()
+ {
+ $debug_cmd
+
+ func_split_equals_lhs=${1%%=*}
+ func_split_equals_rhs=${1#*=}
+ test "x$func_split_equals_lhs" = "x$1" \
+ && func_split_equals_rhs=
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_split_equals ()
+ {
+ $debug_cmd
+
+ func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+ func_split_equals_rhs=
+ test "x$func_split_equals_lhs" = "x$1" \
+ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+ }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_split_short_opt ()
+ {
+ $debug_cmd
+
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_split_short_opt ()
+ {
+ $debug_cmd
+
+ func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+ func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+ }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+ $debug_cmd
+
+ func_usage_message
+ $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+ exit 0
+}
+
+
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
+{
+ $debug_cmd
+
+ eval \$ECHO \""Usage: $usage"\"
+ echo
+ $SED -n 's|^# ||
+ /^Written by/{
+ x;p;x
+ }
+ h
+ /^Written by/q' < "$progpath"
+ echo
+ eval \$ECHO \""$usage_message"\"
+}
+
+
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $debug_cmd
+
+ printf '%s\n' "$progname $scriptversion"
+ $SED -n '
+ /(C)/!b go
+ :more
+ /\./!{
+ N
+ s|\n# | |
+ b more
+ }
+ :go
+ /^# Written by /,/# warranty; / {
+ s|^# ||
+ s|^# *$||
+ s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+ p
+ }
+ /^# Written by / {
+ s|^# ||
+ p
+ }
+ /^warranty; /q' < "$progpath"
+
+ exit $?
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6'
+
+
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
+{
+ $debug_cmd
+
+ _G_message=$*
+
+ func_echo_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_IFS
+ $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+ done
+ IFS=$func_echo_IFS
+}
+
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
+{
+ $debug_cmd
+
+ $warning_func ${1+"$@"}
+}
+
+
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+ -n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --mode=MODE use operation mode MODE
+ --no-warnings equivalent to '-Wnone'
+ --preserve-dup-deps don't remove duplicate dependency libraries
+ --quiet, --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ -v, --verbose print more informational messages than default
+ --version print version information
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
+ -h, --help, --help-all print short, long, or detailed help message
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
+{
+ $debug_cmd
+
+ func_usage_message
+ $ECHO "$long_help_message
+
+MODE must be one of the following:
+
+ clean remove files from the build directory
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+ host-triplet: $host
+ shell: $SHELL
+ compiler: $LTCC
+ compiler flags: $LTCFLAGS
+ linker: $LD (gnu? $with_gnu_ld)
+ version: $progname (GNU libtool) 2.4.6
+ automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+ autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool@gnu.org>.
+GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+ exit 0
+}
+
+
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_lo2o ()
+ {
+ case $1 in
+ *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+ * ) func_lo2o_result=$1 ;;
+ esac
+ }'
+
+ # func_xform LIBOBJ-OR-SOURCE
+ # ---------------------------
+ # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+ # suffix to a '.lo' libtool-object suffix.
+ eval 'func_xform ()
+ {
+ func_xform_result=${1%.*}.lo
+ }'
+else
+ # ...otherwise fall back to using sed.
+ func_lo2o ()
+ {
+ func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+ }
+
+ func_xform ()
+ {
+ func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+ }
+fi
+
+
+# func_fatal_configuration ARG...
+# -------------------------------
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+ func__fatal_error ${1+"$@"} \
+ "See the $PACKAGE documentation for more information." \
+ "Fatal configuration error."
+}
+
+
+# func_config
+# -----------
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+ re_begincf='^# ### BEGIN LIBTOOL'
+ re_endcf='^# ### END LIBTOOL'
+
+ # Default configuration.
+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+ done
+
+ exit $?
+}
+
+
+# func_features
+# -------------
+# Display the features supported by this script.
+func_features ()
+{
+ echo "host: $host"
+ if test yes = "$build_libtool_libs"; then
+ echo "enable shared libraries"
+ else
+ echo "disable shared libraries"
+ fi
+ if test yes = "$build_old_libs"; then
+ echo "enable static libraries"
+ else
+ echo "disable static libraries"
+ fi
+
+ exit $?
+}
+
+
+# func_enable_tag TAGNAME
+# -----------------------
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+ # Global variable:
+ tagname=$1
+
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf=/$re_begincf/,/$re_endcf/p
+
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
+
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
+ *)
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
+
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
+}
+
+
+# func_check_version_match
+# ------------------------
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+ $debug_mode
+
+ # Option defaults:
+ opt_config=false
+ opt_dlopen=
+ opt_dry_run=false
+ opt_help=false
+ opt_mode=
+ opt_preserve_dup_deps=false
+ opt_quiet=false
+
+ nonopt=
+ preserve_args=
+
+ # Shorthand for --mode=foo, only valid as the first argument
+ case $1 in
+ clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+ compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+ execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+ finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+ link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+ esac
+
+ # Pass back the list of options.
+ func_quote_for_eval ${1+"$@"}
+ libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
+
+
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
+{
+ $debug_cmd
+
+ # Perform our own loop to consume as many options as possible in
+ # each iteration.
+ while test $# -gt 0; do
+ _G_opt=$1
+ shift
+ case $_G_opt in
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
+
+ --config) func_config ;;
+
+ --dlopen|-dlopen)
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+ shift
+ ;;
+
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=: ;;
+
+ --features) func_features ;;
+
+ --finish) set dummy --mode finish ${1+"$@"}; shift ;;
+
+ --help) opt_help=: ;;
+
+ --help-all) opt_help=': help-all' ;;
+
+ --mode) test $# = 0 && func_missing_arg $_G_opt && break
+ opt_mode=$1
+ case $1 in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $_G_opt"
+ exit_cmd=exit
+ break
+ ;;
+ esac
+ shift
+ ;;
+
+ --no-silent|--no-quiet)
+ opt_quiet=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --no-warnings|--no-warning|--no-warn)
+ opt_warning=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --no-verbose)
+ opt_verbose=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --silent|--quiet)
+ opt_quiet=:
+ opt_verbose=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --tag) test $# = 0 && func_missing_arg $_G_opt && break
+ opt_tag=$1
+ func_append preserve_args " $_G_opt $1"
+ func_enable_tag "$1"
+ shift
+ ;;
+
+ --verbose|-v) opt_quiet=false
+ opt_verbose=:
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ # An option not handled by this hook function:
+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
+
+
+
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+ # save first non-option argument
+ if test 0 -lt $#; then
+ nonopt=$1
+ shift
+ fi
+
+ # preserve --debug
+ test : = "$debug_cmd" || func_append preserve_args " --debug"
+
+ case $host in
+ # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+ # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+ *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
+
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ test yes != "$build_libtool_libs" \
+ && test yes != "$build_old_libs" \
+ && func_fatal_configuration "not configured to build any kind of library"
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+ func_error "unrecognized option '-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help=$help
+ help="Try '$progname --help --mode=$opt_mode' for more information."
+ }
+
+ # Pass back the unparsed argument list
+ func_quote_for_eval ${1+"$@"}
+ libtool_validate_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_validate_options libtool_validate_options
+
+
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
+
+
+## ----------- ##
+## Main. ##
+## ----------- ##
+
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+ $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_p file
+# True iff FILE is a libtool '.la' library or '.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+ test -f "$1" &&
+ $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool '.la' library or '.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs. To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway. Works if 'file' does not exist.
+func_lalib_unsafe_p ()
+{
+ lalib_p=no
+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+ for lalib_p_l in 1 2 3 4
+ do
+ read lalib_p_line
+ case $lalib_p_line in
+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+ esac
+ done
+ exec 0<&5 5<&-
+ fi
+ test yes = "$lalib_p"
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+ test -f "$1" &&
+ $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+ func_ltwrapper_exec_suffix=
+ case $1 in
+ *.exe) ;;
+ *) func_ltwrapper_exec_suffix=.exe ;;
+ esac
+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+ $debug_cmd
+
+ save_ifs=$IFS; IFS='~'
+ for cmd in $1; do
+ IFS=$sp$nl
+ eval cmd=\"$cmd\"
+ IFS=$save_ifs
+ func_show_eval "$cmd" "${2-:}"
+ done
+ IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)! Also, sourcing
+# 'FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+ $debug_cmd
+
+ case $1 in
+ */* | *\\*) . "$1" ;;
+ *) . "./$1" ;;
+ esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case $lt_sysroot:$1 in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result='='$func_stripname_result
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ $debug_cmd
+
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ func_append_quoted CC_quoted "$arg"
+ done
+ CC_expanded=`func_echo_all $CC`
+ CC_quoted_expanded=`func_echo_all $CC_quoted`
+ case "$@ " in
+ " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ func_echo "unable to infer tagged configuration"
+ func_fatal_error "specify a tag with '--tag'"
+# else
+# func_verbose "using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+ write_libobj=$1
+ if test yes = "$build_libtool_libs"; then
+ write_lobj=\'$2\'
+ else
+ write_lobj=none
+ fi
+
+ if test yes = "$build_old_libs"; then
+ write_oldobj=\'$3\'
+ else
+ write_oldobj=none
+ fi
+
+ $opt_dry_run || {
+ cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+ $MV "${write_libobj}T" "$write_libobj"
+ }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $debug_cmd
+
+ func_convert_core_file_wine_to_w32_result=$1
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $debug_cmd
+
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result"; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $debug_cmd
+
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $debug_cmd
+
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $debug_cmd
+
+ if test -z "$2" && test -n "$1"; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " '$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result=$1
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $debug_cmd
+
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " '$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result=$3
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $debug_cmd
+
+ case $4 in
+ $1 ) func_to_host_path_result=$3$func_to_host_path_result
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via '$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $debug_cmd
+
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $debug_cmd
+
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result=$1
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result=$func_convert_core_msys_to_w32_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result=$func_cygpath_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_file_result=$1
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result=$func_cygpath_result
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via '$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $debug_cmd
+
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd=func_convert_path_$func_stripname_result
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $debug_cmd
+
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result=$1
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result=$func_convert_core_msys_to_w32_result
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result=$func_cygpath_result
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $debug_cmd
+
+ func_to_host_path_result=$1
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result=$func_cygpath_result
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+ $debug_cmd
+
+ func_dll_def_p_tmp=`$SED -n \
+ -e 's/^[ ]*//' \
+ -e '/^\(;.*\)*$/d' \
+ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
+ -e q \
+ "$1"`
+ test DEF = "$func_dll_def_p_tmp"
+}
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+ $debug_cmd
+
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile=$nonopt # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+ pie_flag=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg=$arg
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj=$arg
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ test -n "$libobj" && \
+ func_fatal_error "you cannot specify '-o' more than once"
+ arg_mode=target
+ continue
+ ;;
+
+ -pie | -fpie | -fPIE)
+ func_append pie_flag " $arg"
+ continue
+ ;;
+
+ -shared | -static | -prefer-pic | -prefer-non-pic)
+ func_append later " $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ lastarg=
+ save_ifs=$IFS; IFS=,
+ for arg in $args; do
+ IFS=$save_ifs
+ func_append_quoted lastarg "$arg"
+ done
+ IFS=$save_ifs
+ func_stripname ' ' '' "$lastarg"
+ lastarg=$func_stripname_result
+
+ # Add the arguments to base_compile.
+ func_append base_compile " $lastarg"
+ continue
+ ;;
+
+ *)
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg=$srcfile
+ srcfile=$arg
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ func_append_quoted base_compile "$lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ func_fatal_error "you must specify an argument for -Xcompile"
+ ;;
+ target)
+ func_fatal_error "you must specify a target with '-o'"
+ ;;
+ *)
+ # Get the name of the library object.
+ test -z "$libobj" && {
+ func_basename "$srcfile"
+ libobj=$func_basename_result
+ }
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ case $libobj in
+ *.[cCFSifmso] | \
+ *.ada | *.adb | *.ads | *.asm | \
+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+ func_xform "$libobj"
+ libobj=$func_xform_result
+ ;;
+ esac
+
+ case $libobj in
+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+ *)
+ func_fatal_error "cannot determine name of library object from '$libobj'"
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -shared)
+ test yes = "$build_libtool_libs" \
+ || func_fatal_configuration "cannot build a shared library"
+ build_old_libs=no
+ continue
+ ;;
+
+ -static)
+ build_libtool_libs=no
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && func_warning "libobj name '$libobj' may not contain shell special characters."
+ func_dirname_and_basename "$obj" "/" ""
+ objname=$func_basename_result
+ xdir=$func_dirname_result
+ lobj=$xdir$objdir/$objname
+
+ test -z "$base_compile" && \
+ func_fatal_help "you must specify a compilation command"
+
+ # Delete any leftover library objects.
+ if test yes = "$build_old_libs"; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2* | cegcc*)
+ pic_mode=default
+ ;;
+ esac
+ if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test no = "$compiler_c_o"; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+ lockfile=$output_obj.lock
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test yes = "$need_locks"; then
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test warn = "$need_locks"; then
+ if test -f "$lockfile"; then
+ $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support '-c' and '-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+ func_append removelist " $output_obj"
+ $ECHO "$srcfile" > "$lockfile"
+ fi
+
+ $opt_dry_run || $RM $removelist
+ func_append removelist " $lockfile"
+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test yes = "$build_libtool_libs"; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test no != "$pic_mode"; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ func_mkdir_p "$xdir$objdir"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ func_append command " -o $lobj"
+ fi
+
+ func_show_eval_locale "$command" \
+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+ if test warn = "$need_locks" &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support '-c' and '-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ func_show_eval '$MV "$output_obj" "$lobj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+
+ # Allow error messages only from the first compilation.
+ if test yes = "$suppress_opt"; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test yes = "$build_old_libs"; then
+ if test yes != "$pic_mode"; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile$pie_flag"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test yes = "$compiler_c_o"; then
+ func_append command " -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ func_append command "$suppress_output"
+ func_show_eval_locale "$command" \
+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+ if test warn = "$need_locks" &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support '-c' and '-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $opt_dry_run || $RM $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ func_show_eval '$MV "$output_obj" "$obj"' \
+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+ fi
+ fi
+
+ $opt_dry_run || {
+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+ # Unlock the critical section if it was locked
+ if test no != "$need_locks"; then
+ removelist=$lockfile
+ $RM "$lockfile"
+ fi
+ }
+
+ exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+ test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+ # We need to display help for each of the modes.
+ case $opt_mode in
+ "")
+ # Generic help is extracted from the usage comments
+ # at the start of this file.
+ func_help
+ ;;
+
+ clean)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ compile)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -no-suppress do not suppress compiler output for multiple passes
+ -prefer-pic try to build PIC objects only
+ -prefer-non-pic try to build non-PIC objects only
+ -shared do not build a '.o' file suitable for static linking
+ -static only build a '.o' file suitable for static linking
+ -Wc,FLAG pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
+ ;;
+
+ execute)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to '-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+ finish)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the '--dry-run' option if you just want to see what would be executed."
+ ;;
+
+ install)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the 'install' or 'cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+ -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+ link)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -bindir BINDIR specify path to binaries directory (for systems where
+ libraries must be found in the PATH setting at runtime)
+ -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE use a list of object files found in FILE to specify objects
+ -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -shared only do dynamic linking of libtool libraries
+ -shrext SUFFIX override the standard shared library file extension
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+ -weak LIBNAME declare that the target provides the LIBNAME interface
+ -Wc,FLAG
+ -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wl,FLAG
+ -Xlinker FLAG pass linker-specific FLAG directly to the linker
+ -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with '-') are ignored.
+
+Every other argument is treated as a filename. Files ending in '.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
+
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+ uninstall)
+ $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+ *)
+ func_fatal_help "invalid operation mode '$opt_mode'"
+ ;;
+ esac
+
+ echo
+ $ECHO "Try '$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+ if test : = "$opt_help"; then
+ func_mode_help
+ else
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ func_mode_help
+ done
+ } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
+ {
+ func_help noexit
+ for opt_mode in compile link execute install finish uninstall clean; do
+ echo
+ func_mode_help
+ done
+ } |
+ $SED '1d
+ /^When reporting/,/^Report/{
+ H
+ d
+ }
+ $x
+ /information about other modes/d
+ /more detailed .*MODE/d
+ s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+ fi
+ exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+ $debug_cmd
+
+ # The first argument is the command name.
+ cmd=$nonopt
+ test -z "$cmd" && \
+ func_fatal_help "you must specify a COMMAND"
+
+ # Handle -dlopen flags immediately.
+ for file in $opt_dlopen; do
+ test -f "$file" \
+ || func_fatal_help "'$file' is not a file"
+
+ dir=
+ case $file in
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "'$lib' is not a valid libtool archive"
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+ func_source "$file"
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && \
+ func_warning "'$file' was not linked with '-export-dynamic'"
+ continue
+ fi
+
+ func_dirname "$file" "" "."
+ dir=$func_dirname_result
+
+ if test -f "$dir/$objdir/$dlname"; then
+ func_append dir "/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ func_dirname "$file" "" "."
+ dir=$func_dirname_result
+ ;;
+
+ *)
+ func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir=$absdir
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic=$magic
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -* | *.la | *.lo ) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if func_ltwrapper_script_p "$file"; then
+ func_source "$file"
+ # Transform arg to wrapped name.
+ file=$progdir/$program
+ elif func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ func_source "$func_ltwrapper_scriptname_result"
+ # Transform arg to wrapped name.
+ file=$progdir/$program
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ func_append_quoted args "$file"
+ done
+
+ if $opt_dry_run; then
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ else
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ else
+ $lt_unset $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd=\$cmd$args
+ fi
+}
+
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+ $debug_cmd
+
+ libs=
+ libdirs=
+ admincmds=
+
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "'$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument '$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and '=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ $opt_quiet && exit $EXIT_SUCCESS
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the '-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the '$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the '$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $ECHO " - use the '$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
+ fi
+ echo
+
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
+ exit $EXIT_SUCCESS
+}
+
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+ $debug_cmd
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
+ # Allow the use of GNU shtool's install command.
+ case $nonopt in *shtool*) :;; *) false;; esac
+ then
+ # Aesthetically quote it.
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
+ arg=$1
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
+ install_shared_prog=$install_prog
+ case " $install_prog " in
+ *[\\\ /]cp\ *) install_cp=: ;;
+ *) install_cp=false ;;
+ esac
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=false
+ stripme=
+ no_mode=:
+ for arg
+ do
+ arg2=
+ if test -n "$dest"; then
+ func_append files " $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=: ;;
+ -f)
+ if $install_cp; then :; else
+ prev=$arg
+ fi
+ ;;
+ -g | -m | -o)
+ prev=$arg
+ ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ if test X-m = "X$prev" && test -n "$install_override_mode"; then
+ arg2=$install_override_mode
+ no_mode=false
+ fi
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
+ if test -n "$arg2"; then
+ func_quote_for_eval "$arg2"
+ fi
+ func_append install_shared_prog " $func_quote_for_eval_result"
+ done
+
+ test -z "$install_prog" && \
+ func_fatal_help "you must specify an install program"
+
+ test -n "$prev" && \
+ func_fatal_help "the '$prev' option requires an argument"
+
+ if test -n "$install_override_mode" && $no_mode; then
+ if $install_cp; then :; else
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
+ fi
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ func_fatal_help "no file or destination specified"
+ else
+ func_fatal_help "you must specify a destination"
+ fi
+ fi
+
+ # Strip any trailing slash from the destination.
+ func_stripname '' '/' "$dest"
+ dest=$func_stripname_result
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=:
+ if $isdir; then
+ destdir=$dest
+ destname=
+ else
+ func_dirname_and_basename "$dest" "" "."
+ destdir=$func_dirname_result
+ destname=$func_basename_result
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files; shift
+ test "$#" -gt 1 && \
+ func_fatal_help "'$dest' is not a directory"
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ func_fatal_help "'$destdir' must be an absolute directory name"
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic=$magic
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ func_append staticlibs " $file"
+ ;;
+
+ *.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$file" \
+ || func_fatal_help "'$file' is not a valid libtool archive"
+
+ library_names=
+ old_library=
+ relink_command=
+ func_source "$file"
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append current_libdirs " $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) func_append future_libdirs " $libdir" ;;
+ esac
+ fi
+
+ func_dirname "$file" "/" ""
+ dir=$func_dirname_result
+ func_append dir "$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ test "$inst_prefix_dir" = "$destdir" && \
+ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ func_warning "relinking '$file'"
+ func_show_eval "$relink_command" \
+ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names; shift
+ if test -n "$1"; then
+ realname=$1
+ shift
+
+ srcname=$realname
+ test -n "$relink_command" && srcname=${realname}T
+
+ # Install the shared library and build the symlinks.
+ func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+ 'exit $?'
+ tstripme=$stripme
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $realname in
+ *.dll.a)
+ tstripme=
+ ;;
+ esac
+ ;;
+ os2*)
+ case $realname in
+ *_dll.a)
+ tstripme=
+ ;;
+ esac
+ ;;
+ esac
+ if test -n "$tstripme" && test -n "$striplib"; then
+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try 'ln -sf' first, because the 'ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ test "$linkname" != "$realname" \
+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib=$destdir/$realname
+ func_execute_cmds "$postinstall_cmds" 'exit $?'
+ fi
+
+ # Install the pseudo-library for information purposes.
+ func_basename "$file"
+ name=$func_basename_result
+ instname=$dir/${name}i
+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile=$destdir/$destname
+ else
+ func_basename "$file"
+ destfile=$func_basename_result
+ destfile=$destdir/$destfile
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ func_lo2o "$destfile"
+ staticdest=$func_lo2o_result
+ ;;
+ *.$objext)
+ staticdest=$destfile
+ destfile=
+ ;;
+ *)
+ func_fatal_help "cannot copy a libtool object to '$destfile'"
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ test -n "$destfile" && \
+ func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+ # Install the old object if enabled.
+ if test yes = "$build_old_libs"; then
+ # Deduce the name of the old-style object file.
+ func_lo2o "$file"
+ staticobj=$func_lo2o_result
+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile=$destdir/$destname
+ else
+ func_basename "$file"
+ destfile=$func_basename_result
+ destfile=$destdir/$destfile
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ stripped_ext=.exe
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin* | *mingw*)
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ wrapper=$func_ltwrapper_scriptname_result
+ else
+ func_stripname '' '.exe' "$file"
+ wrapper=$func_stripname_result
+ fi
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if func_ltwrapper_script_p "$wrapper"; then
+ notinst_deplibs=
+ relink_command=
+
+ func_source "$wrapper"
+
+ # Check the variables that should have been set.
+ test -z "$generated_by_libtool_version" && \
+ func_fatal_error "invalid libtool wrapper script '$wrapper'"
+
+ finalize=:
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ func_source "$lib"
+ fi
+ libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ func_warning "'$lib' has not been installed in '$libdir'"
+ finalize=false
+ fi
+ done
+
+ relink_command=
+ func_source "$wrapper"
+
+ outputname=
+ if test no = "$fast_install" && test -n "$relink_command"; then
+ $opt_dry_run || {
+ if $finalize; then
+ tmpdir=`func_mktempdir`
+ func_basename "$file$stripped_ext"
+ file=$func_basename_result
+ outputname=$tmpdir/$file
+ # Replace the output file specification.
+ relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $opt_quiet || {
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ if eval "$relink_command"; then :
+ else
+ func_error "error: relink '$file' with the above command before installing it"
+ $opt_dry_run || ${RM}r "$tmpdir"
+ continue
+ fi
+ file=$outputname
+ else
+ func_warning "cannot relink '$file'"
+ fi
+ }
+ else
+ # Install the binary that we compiled earlier.
+ file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ func_stripname '' '.exe' "$destfile"
+ destfile=$func_stripname_result
+ ;;
+ esac
+ ;;
+ esac
+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+ $opt_dry_run || if test -n "$outputname"; then
+ ${RM}r "$tmpdir"
+ fi
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ func_basename "$file"
+ name=$func_basename_result
+
+ # Set up the ranlib parameters.
+ oldlib=$destdir/$name
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+
+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+ fi
+
+ # Do each command in the postinstall commands.
+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+ done
+
+ test -n "$future_libdirs" && \
+ func_warning "remember to run '$progname --finish$future_libdirs'"
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+}
+
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+ $debug_cmd
+
+ my_outputname=$1
+ my_originator=$2
+ my_pic_p=${3-false}
+ my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
+ my_dlsyms=
+
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ my_dlsyms=${my_outputname}S.c
+ else
+ func_error "not configured to extract global symbols from dlpreopened files"
+ fi
+ fi
+
+ if test -n "$my_dlsyms"; then
+ case $my_dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist=$output_objdir/$my_outputname.nm
+
+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+ # Parse the name list into a source file.
+ func_verbose "creating $output_objdir/$my_dlsyms"
+
+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test yes = "$dlself"; then
+ func_verbose "generating symbol list for '$output'"
+
+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ for progfile in $progfiles; do
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $opt_dry_run || {
+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $opt_dry_run || {
+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ }
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols=$output_objdir/$outputname.exp
+ $opt_dry_run || {
+ $RM $export_symbols
+ eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ else
+ $opt_dry_run || {
+ eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ eval '$MV "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ }
+ fi
+ fi
+
+ for dlprefile in $dlprefiles; do
+ func_verbose "extracting global C symbols from '$dlprefile'"
+ func_basename "$dlprefile"
+ name=$func_basename_result
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname"; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename=$func_basename_result
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename"; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
+ done
+
+ $opt_dry_run || {
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $MV "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if $GREP -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ $GREP -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+ else
+ echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+ fi
+
+ func_show_eval '$RM "${nlist}I"'
+ if test -n "$global_symbol_to_import"; then
+ eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+ fi
+
+ echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols. */
+typedef struct {
+ const char *name;
+ void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+ if test -s "$nlist"I; then
+ echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+ LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+ for (; symbol->name; ++symbol)
+ {"
+ $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+ echo >> "$output_objdir/$my_dlsyms" "\
+ }
+}"
+ fi
+ echo >> "$output_objdir/$my_dlsyms" "\
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{ {\"$my_originator\", (void *) 0},"
+
+ if test -s "$nlist"I; then
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {\"@INIT@\", (void *) &lt_syminit},"
+ fi
+
+ case $need_lib_prefix in
+ no)
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ *)
+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+ ;;
+ esac
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ } # !$opt_dry_run
+
+ pic_flag_for_symtable=
+ case "$compile_command " in
+ *" -static "*) ;;
+ *)
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+ *-*-hpux*)
+ pic_flag_for_symtable=" $pic_flag" ;;
+ *)
+ $my_pic_p && pic_flag_for_symtable=" $pic_flag"
+ ;;
+ esac
+ ;;
+ esac
+ symtab_cflags=
+ for arg in $LTCFLAGS; do
+ case $arg in
+ -pie | -fpie | -fPIE) ;;
+ *) func_append symtab_cflags " $arg" ;;
+ esac
+ done
+
+ # Now compile the dynamic symbol file.
+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+ # Clean up the generated files.
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
+
+ # Transform the symbol file into the correct name.
+ symfileobj=$output_objdir/${my_outputname}S.$objext
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
+ ;;
+ *)
+ func_fatal_error "unknown suffix for '$my_dlsyms'"
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+ finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+ fi
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $debug_cmd
+
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $debug_cmd
+
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+ $debug_cmd
+
+ win32_libid_type=unknown
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+ $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+ case $nm_interface in
+ "MS dumpbin")
+ if func_cygming_ms_implib_p "$1" ||
+ func_cygming_gnu_implib_p "$1"
+ then
+ win32_nmres=import
+ else
+ win32_nmres=
+ fi
+ ;;
+ *)
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
+ 1,100{
+ / I /{
+ s|.*|import|
+ p
+ q
+ }
+ }'`
+ ;;
+ esac
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $debug_cmd
+
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $debug_cmd
+
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive that possess that section. Heuristic: eliminate
+ # all those that have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $debug_cmd
+
+ if func_cygming_gnu_implib_p "$1"; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1"; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ $debug_cmd
+
+ f_ex_an_ar_dir=$1; shift
+ f_ex_an_ar_oldlib=$1
+ if test yes = "$lock_old_archive_extraction"; then
+ lockfile=$f_ex_an_ar_oldlib.lock
+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+ func_echo "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ fi
+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+ 'stat=$?; rm -f "$lockfile"; exit $stat'
+ if test yes = "$lock_old_archive_extraction"; then
+ $opt_dry_run || rm -f "$lockfile"
+ fi
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+ fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ $debug_cmd
+
+ my_gentop=$1; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=
+ my_xlib=
+ my_xabs=
+ my_xdir=
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ func_basename "$my_xlib"
+ my_xlib=$func_basename_result
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ func_arith $extracted_serial + 1
+ extracted_serial=$func_arith_result
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir=$my_gentop/$my_xlib_u
+
+ func_mkdir_p "$my_xdir"
+
+ case $host in
+ *-darwin*)
+ func_verbose "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ $opt_dry_run || {
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ func_basename "$darwin_archive"
+ darwin_base_archive=$func_basename_result
+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches; do
+ func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+ $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+ cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+ func_extract_an_archive "`pwd`" "$darwin_base_archive"
+ cd "$darwin_curdir"
+ $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
+ done # $darwin_arches
+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ $LIPO -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ $RM -rf unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd $darwin_orig_dir
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ } # !$opt_dry_run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+ done
+
+ func_extract_archives_result=$my_oldobjs
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable. Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take. If 'yes', then the emitted script
+# will assume that the directory where it is stored is
+# the $objdir directory. This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+ func_emit_wrapper_arg1=${1-no}
+
+ $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variables:
+ generated_by_libtool_version='$macro_version'
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ file=\"\$0\""
+
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+ ECHO=\"$qECHO\"
+ fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ that is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options that match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+ lt_script_arg0=\$0
+ shift
+ for lt_opt
+ do
+ case \"\$lt_opt\" in
+ --lt-debug) lt_option_debug=1 ;;
+ --lt-dump-script)
+ lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+ test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+ lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+ cat \"\$lt_dump_D/\$lt_dump_F\"
+ exit 0
+ ;;
+ --lt-*)
+ \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+
+ # Print the debug banner immediately:
+ if test -n \"\$lt_option_debug\"; then
+ echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
+ fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+ lt_dump_args_N=1;
+ for lt_arg
+ do
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+ done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2* | *-cegcc*)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $ECHO "\
+ if test -n \"\$lt_option_debug\"; then
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
+ func_lt_dump_args \${1+\"\$@\"} 1>&2
+ fi
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $ECHO "\
+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+ exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
+ func_exec_program_core \${1+\"\$@\"}
+}
+
+ # Parse options
+ func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+ done
+
+ # Usually 'no', except on cygwin/mingw when embedded into
+ # the cwrapper.
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+ # special case for '.'
+ if test \"\$thisdir\" = \".\"; then
+ thisdir=\`pwd\`
+ fi
+ # remove .libs from thisdir
+ case \"\$thisdir\" in
+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+ $objdir ) thisdir=. ;;
+ esac
+ fi
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test yes = "$fast_install"; then
+ $ECHO "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" ||
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $MKDIR \"\$progdir\"
+ else
+ $RM \"\$progdir/\$file\"
+ fi"
+
+ $ECHO "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ \$ECHO \"\$relink_command_output\" >&2
+ $RM \"\$progdir/\$file\"
+ exit 1
+ fi
+ fi
+
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $RM \"\$progdir/\$program\";
+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $RM \"\$progdir/\$file\"
+ fi"
+ else
+ $ECHO "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $ECHO "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ # Export our shlibpath_var if we have one.
+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $ECHO "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ $ECHO "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+ func_exec_program \${1+\"\$@\"}
+ fi
+ else
+ # The program doesn't exist.
+ \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+ \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+ cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+*/
+EOF
+ cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+# include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
+/* declarations of non-ANSI functions */
+#if defined __MINGW32__
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined __CYGWIN__
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined other_platform || defined ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined _MSC_VER
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+# define S_IXUSR _S_IEXEC
+#elif defined __MINGW32__
+# define setmode _setmode
+# define stat _stat
+# define chmod _chmod
+# define getcwd _getcwd
+# define putenv _putenv
+#elif defined __CYGWIN__
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined other platforms ... */
+#endif
+
+#if defined PATH_MAX
+# define LT_PATHMAX PATH_MAX
+#elif defined MAXPATHLEN
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+ defined __OS2__
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free (stale); stale = 0; } \
+} while (0)
+
+#if defined LT_DEBUGWRAPPER
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+ cat <<EOF
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ func_to_host_path "$temp_rpath"
+ cat <<EOF
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * LIB_PATH_VALUE = "";
+EOF
+ fi
+
+ if test -n "$dllsearchpath"; then
+ func_to_host_path "$dllsearchpath:"
+ cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
+EOF
+ else
+ cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE = "";
+EOF
+ fi
+
+ if test yes = "$fast_install"; then
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+ else
+ cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+ fi
+
+
+ cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int newargc;
+ char *tmp_pathspec;
+ char *actual_cwrapper_path;
+ char *actual_cwrapper_name;
+ char *target_name;
+ char *lt_argv_zero;
+ int rval = 127;
+
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ newargz = XMALLOC (char *, (size_t) argc + 1);
+
+ /* very simple arg parsing; don't want to rely on getopt
+ * also, copy all non cwrapper options to newargz, except
+ * argz[0], which is handled differently
+ */
+ newargc=0;
+ for (i = 1; i < argc; i++)
+ {
+ if (STREQ (argv[i], dumpscript_opt))
+ {
+EOF
+ case $host in
+ *mingw* | *cygwin* )
+ # make stdout use "unix" line endings
+ echo " setmode(1,_O_BINARY);"
+ ;;
+ esac
+
+ cat <<"EOF"
+ lt_dump_script (stdout);
+ return 0;
+ }
+ if (STREQ (argv[i], debug_opt))
+ {
+ lt_debug = 1;
+ continue;
+ }
+ if (STREQ (argv[i], ltwrapper_option_prefix))
+ {
+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+ namespace, but it is not one of the ones we know about and
+ have already dealt with, above (inluding dump-script), then
+ report an error. Otherwise, targets might begin to believe
+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+ namespace. The first time any user complains about this, we'll
+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+ or a configure.ac-settable value.
+ */
+ lt_fatal (__FILE__, __LINE__,
+ "unrecognized %s option: '%s'",
+ ltwrapper_option_prefix, argv[i]);
+ }
+ /* otherwise ... */
+ newargz[++newargc] = xstrdup (argv[i]);
+ }
+ newargz[++newargc] = NULL;
+
+EOF
+ cat <<EOF
+ /* The GNU banner must be the first non-error debug message */
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
+EOF
+ cat <<"EOF"
+ lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+ tmp_pathspec = find_executable (argv[0]);
+ if (tmp_pathspec == NULL)
+ lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (before symlink chase) at: %s\n",
+ tmp_pathspec);
+
+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) found exe (after symlink chase) at: %s\n",
+ actual_cwrapper_path);
+ XFREE (tmp_pathspec);
+
+ actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+ /* wrapper name transforms */
+ strendzap (actual_cwrapper_name, ".exe");
+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+ XFREE (actual_cwrapper_name);
+ actual_cwrapper_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ /* target_name transforms -- use actual target program name; might have lt- prefix */
+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+ strendzap (target_name, ".exe");
+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+ XFREE (target_name);
+ target_name = tmp_pathspec;
+ tmp_pathspec = 0;
+
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) libtool target name: %s\n",
+ target_name);
+EOF
+
+ cat <<EOF
+ newargz[0] =
+ XMALLOC (char, (strlen (actual_cwrapper_path) +
+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+ strcpy (newargz[0], actual_cwrapper_path);
+ strcat (newargz[0], "$objdir");
+ strcat (newargz[0], "/");
+EOF
+
+ cat <<"EOF"
+ /* stop here, and copy so we don't have to do this twice */
+ tmp_pathspec = xstrdup (newargz[0]);
+
+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+ strcat (newargz[0], actual_cwrapper_name);
+
+ /* DO want the lt- prefix here if it exists, so use target_name */
+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+ XFREE (tmp_pathspec);
+ tmp_pathspec = NULL;
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ {
+ char* p;
+ while ((p = strchr (newargz[0], '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+ {
+ *p = '/';
+ }
+ }
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+ XFREE (target_name);
+ XFREE (actual_cwrapper_path);
+ XFREE (actual_cwrapper_name);
+
+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+ lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+ nonnull (lt_argv_zero));
+ for (i = 0; i < newargc; i++)
+ {
+ lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+ i, nonnull (newargz[i]));
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+ /* execv doesn't actually work on mingw as expected on unix */
+ newargz = prepare_spawn (newargz);
+ rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ if (rval == -1)
+ {
+ /* failed to start process */
+ lt_debugprintf (__FILE__, __LINE__,
+ "(main) failed to launch target \"%s\": %s\n",
+ lt_argv_zero, nonnull (strerror (errno)));
+ return 127;
+ }
+ return rval;
+EOF
+ ;;
+ *)
+ cat <<"EOF"
+ execv (lt_argv_zero, newargz);
+ return rval; /* =127, but avoids unused variable warning */
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void *p = (void *) malloc (num);
+ if (!p)
+ lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+ string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable (const char *path)
+{
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0)
+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+ return 1;
+ else
+ return 0;
+}
+
+int
+make_executable (const char *path)
+{
+ int rval = 0;
+ struct stat st;
+
+ lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+ nonempty (path));
+ if ((!path) || (!*path))
+ return 0;
+
+ if (stat (path, &st) >= 0)
+ {
+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+ }
+ return rval;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise
+ Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+ int has_slash = 0;
+ const char *p;
+ const char *p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ size_t tmp_len;
+ char *concat_name;
+
+ lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+ nonempty (wrapper));
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char *path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char *q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR (*q))
+ break;
+ p_len = (size_t) (q - p);
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name =
+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name =
+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+ nonnull (strerror (errno)));
+ tmp_len = strlen (tmp);
+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable (concat_name))
+ return concat_name;
+ XFREE (concat_name);
+ return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+ return xstrdup (pathspec);
+#else
+ char buf[LT_PATHMAX];
+ struct stat s;
+ char *tmp_pathspec = xstrdup (pathspec);
+ char *p;
+ int has_symlinks = 0;
+ while (strlen (tmp_pathspec) && !has_symlinks)
+ {
+ lt_debugprintf (__FILE__, __LINE__,
+ "checking path component for symlinks: %s\n",
+ tmp_pathspec);
+ if (lstat (tmp_pathspec, &s) == 0)
+ {
+ if (S_ISLNK (s.st_mode) != 0)
+ {
+ has_symlinks = 1;
+ break;
+ }
+
+ /* search backwards for last DIR_SEPARATOR */
+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ p--;
+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+ {
+ /* no more DIR_SEPARATORS left */
+ break;
+ }
+ *p = '\0';
+ }
+ else
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "error accessing file \"%s\": %s",
+ tmp_pathspec, nonnull (strerror (errno)));
+ }
+ }
+ XFREE (tmp_pathspec);
+
+ if (!has_symlinks)
+ {
+ return xstrdup (pathspec);
+ }
+
+ tmp_pathspec = realpath (pathspec, buf);
+ if (tmp_pathspec == 0)
+ {
+ lt_fatal (__FILE__, __LINE__,
+ "could not follow symlinks for %s", pathspec);
+ }
+ return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert (str != NULL);
+ assert (pat != NULL);
+
+ len = strlen (str);
+ patlen = strlen (pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (STREQ (str, pat))
+ *str = '\0';
+ }
+ return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ if (lt_debug)
+ {
+ (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+ va_start (args, fmt);
+ (void) vfprintf (stderr, fmt, args);
+ va_end (args);
+ }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+ int line, const char *mode,
+ const char *message, va_list ap)
+{
+ fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+ va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+ return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+ return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_setenv) setting '%s' to '%s'\n",
+ nonnull (name), nonnull (value));
+ {
+#ifdef HAVE_SETENV
+ /* always make a copy, for consistency with !HAVE_SETENV */
+ char *str = xstrdup (value);
+ setenv (name, str, 1);
+#else
+ size_t len = strlen (name) + 1 + strlen (value) + 1;
+ char *str = XMALLOC (char, len);
+ sprintf (str, "%s=%s", name, value);
+ if (putenv (str) != EXIT_SUCCESS)
+ {
+ XFREE (str);
+ }
+#endif
+ }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+ char *new_value;
+ if (orig_value && *orig_value)
+ {
+ size_t orig_value_len = strlen (orig_value);
+ size_t add_len = strlen (add);
+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
+ if (to_end)
+ {
+ strcpy (new_value, orig_value);
+ strcpy (new_value + orig_value_len, add);
+ }
+ else
+ {
+ strcpy (new_value, add);
+ strcpy (new_value + add_len, orig_value);
+ }
+ }
+ else
+ {
+ new_value = xstrdup (add);
+ }
+ return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ /* some systems can't cope with a ':'-terminated path #' */
+ size_t len = strlen (new_value);
+ while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ {
+ new_value[--len] = '\0';
+ }
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+ lt_debugprintf (__FILE__, __LINE__,
+ "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+ nonnull (name), nonnull (value));
+
+ if (name && *name && value && *value)
+ {
+ char *new_value = lt_extend_str (getenv (name), value, 0);
+ lt_setenv (name, new_value);
+ XFREE (new_value);
+ }
+}
+
+EOF
+ case $host_os in
+ mingw*)
+ cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+ Note that spawn() does not by itself call the command interpreter
+ (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+ ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&v);
+ v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+ }) ? "cmd.exe" : "command.com").
+ Instead it simply concatenates the arguments, separated by ' ', and calls
+ CreateProcess(). We must quote the arguments since Win32 CreateProcess()
+ interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+ special way:
+ - Space and tab are interpreted as delimiters. They are not treated as
+ delimiters if they are surrounded by double quotes: "...".
+ - Unescaped double quotes are removed from the input. Their only effect is
+ that within double quotes, space and tab are treated like normal
+ characters.
+ - Backslashes not followed by double quotes are not special.
+ - But 2*n+1 backslashes followed by a double quote become
+ n backslashes followed by a double quote (n >= 0):
+ \" -> "
+ \\\" -> \"
+ \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+ size_t argc;
+ char **new_argv;
+ size_t i;
+
+ /* Count number of arguments. */
+ for (argc = 0; argv[argc] != NULL; argc++)
+ ;
+
+ /* Allocate new argument vector. */
+ new_argv = XMALLOC (char *, argc + 1);
+
+ /* Put quoted arguments into the new argument vector. */
+ for (i = 0; i < argc; i++)
+ {
+ const char *string = argv[i];
+
+ if (string[0] == '\0')
+ new_argv[i] = xstrdup ("\"\"");
+ else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+ {
+ int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+ size_t length;
+ unsigned int backslashes;
+ const char *s;
+ char *quoted_string;
+ char *p;
+
+ length = 0;
+ backslashes = 0;
+ if (quote_around)
+ length++;
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ length += backslashes + 1;
+ length++;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ length += backslashes + 1;
+
+ quoted_string = XMALLOC (char, length + 1);
+
+ p = quoted_string;
+ backslashes = 0;
+ if (quote_around)
+ *p++ = '"';
+ for (s = string; *s != '\0'; s++)
+ {
+ char c = *s;
+ if (c == '"')
+ {
+ unsigned int j;
+ for (j = backslashes + 1; j > 0; j--)
+ *p++ = '\\';
+ }
+ *p++ = c;
+ if (c == '\\')
+ backslashes++;
+ else
+ backslashes = 0;
+ }
+ if (quote_around)
+ {
+ unsigned int j;
+ for (j = backslashes; j > 0; j--)
+ *p++ = '\\';
+ *p++ = '"';
+ }
+ *p = '\0';
+
+ new_argv[i] = quoted_string;
+ }
+ else
+ new_argv[i] = (char *) string;
+ }
+ new_argv[argc] = NULL;
+
+ return new_argv;
+}
+EOF
+ ;;
+ esac
+
+ cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+ func_emit_wrapper yes |
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
+ cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+ $debug_cmd
+
+ case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+ *import*) : ;;
+ *) false ;;
+ esac
+}
+
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+ $debug_cmd
+
+ case " $compile_command " in
+ *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+ suncc_use_cstd_abi=no
+ ;;
+ *)
+ suncc_use_cstd_abi=yes
+ ;;
+ esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+ $debug_cmd
+
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # what system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll that has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args=$nonopt
+ base_compile="$nonopt $@"
+ compile_command=$nonopt
+ finalize_command=$nonopt
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+ new_inherited_linker_flags=
+
+ avoid_version=no
+ bindir=
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ os2dllname=
+ non_pic_objects=
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=false
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ weak_libs=
+ single_module=$wl-single_module
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -shared)
+ test yes != "$build_libtool_libs" \
+ && func_fatal_configuration "cannot build a shared library"
+ build_old_libs=no
+ break
+ ;;
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
+ func_warning "complete static linking is impossible in this configuration"
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg=$1
+ shift
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ func_append compile_command " @OUTPUT@"
+ func_append finalize_command " @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ bindir)
+ bindir=$arg
+ prev=
+ continue
+ ;;
+ dlfiles|dlprefiles)
+ $preload || {
+ # Add the symbol object into the linking commands.
+ func_append compile_command " @SYMFILE@"
+ func_append finalize_command " @SYMFILE@"
+ preload=:
+ }
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test no = "$dlself"; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test dlprefiles = "$prev"; then
+ dlself=yes
+ elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test dlfiles = "$prev"; then
+ func_append dlfiles " $arg"
+ else
+ func_append dlprefiles " $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols=$arg
+ test -f "$arg" \
+ || func_fatal_error "symbol file '$arg' does not exist"
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex=$arg
+ prev=
+ continue
+ ;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.ltframework "*) ;;
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir=$arg
+ prev=
+ continue
+ ;;
+ mllvm)
+ # Clang does not use LLVM to link, so we can simply discard any
+ # '-mllvm $arg' options when doing the link step.
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat "$save_arg"`
+ do
+# func_append moreargs " $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test none = "$pic_object" &&
+ test none = "$non_pic_object"; then
+ func_fatal_error "cannot find name of object for '$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir=$func_dirname_result
+
+ if test none != "$pic_object"; then
+ # Prepend the subdirectory the object is found in.
+ pic_object=$xdir$pic_object
+
+ if test dlfiles = "$prev"; then
+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test dlprefiles = "$prev"; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg=$pic_object
+ fi
+
+ # Non-PIC object.
+ if test none != "$non_pic_object"; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object=$xdir$non_pic_object
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test none = "$pic_object"; then
+ arg=$non_pic_object
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object=$pic_object
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir=$func_dirname_result
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "'$arg' is not a valid libtool object"
+ fi
+ fi
+ done
+ else
+ func_fatal_error "link input file '$arg' does not exist"
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ os2dllname)
+ os2dllname=$arg
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex=$arg
+ prev=
+ continue
+ ;;
+ release)
+ release=-$arg
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ if test rpath = "$prev"; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) func_append rpath " $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) func_append xrpath " $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ shrext)
+ shrext_cmds=$arg
+ prev=
+ continue
+ ;;
+ weak)
+ func_append weak_libs " $arg"
+ prev=
+ continue
+ ;;
+ xcclinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xcompiler)
+ func_append compiler_flags " $qarg"
+ prev=
+ func_append compile_command " $qarg"
+ func_append finalize_command " $qarg"
+ continue
+ ;;
+ xlinker)
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
+ prev=
+ func_append compile_command " $wl$qarg"
+ func_append finalize_command " $wl$qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg=$arg
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ # See comment for -static flag below, for more details.
+ func_append compile_command " $link_static_flag"
+ func_append finalize_command " $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ func_fatal_error "'-allow-undefined' must not be used because it is the default"
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -bindir)
+ prev=bindir
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ func_fatal_error "more than one -exported-symbols argument is not allowed"
+ fi
+ if test X-export-symbols = "X$arg"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework)
+ prev=framework
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
+ if test "$#" -gt 0; then
+ func_fatal_error "require no space between '-L' and '$1'"
+ else
+ func_fatal_error "need path for '-L' option"
+ fi
+ fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ test -z "$absdir" && \
+ func_fatal_error "cannot determine absolute directory name of '$dir'"
+ dir=$absdir
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
+ *)
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ ::) dllsearchpath=$dir;;
+ *) func_append dllsearchpath ":$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test X-lc = "X$arg" || test X-lm = "X$arg"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test X-lc = "X$arg" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ # Do not include libc due to us having libc/libc_r.
+ test X-lc = "X$arg" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ func_append deplibs " System.ltframework"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test X-lc = "X$arg" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test X-lc = "X$arg" && continue
+ ;;
+ esac
+ elif test X-lc_r = "X$arg"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ func_append deplibs " $arg"
+ continue
+ ;;
+
+ -mllvm)
+ prev=mllvm
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ # Darwin uses the -arch flag to determine output architecture.
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ func_append compiler_flags " $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ continue
+ ;;
+
+ -multi_module)
+ single_module=$wl-multi_module
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ func_warning "'-no-install' is ignored for $host"
+ func_warning "assuming '-no-fast-install' instead"
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -os2dllname)
+ prev=os2dllname
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ func_stripname '-R' '' "$arg"
+ dir=$func_stripname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
+ *)
+ func_fatal_error "only absolute run-paths are allowed"
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ continue
+ ;;
+
+ -shared)
+ # The effects of -shared are defined in a previous loop.
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -weak)
+ prev=weak
+ continue
+ ;;
+
+ -Wc,*)
+ func_stripname '-Wc,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs=$IFS; IFS=,
+ for flag in $args; do
+ IFS=$save_ifs
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
+ done
+ IFS=$save_ifs
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Wl,*)
+ func_stripname '-Wl,' '' "$arg"
+ args=$func_stripname_result
+ arg=
+ save_ifs=$IFS; IFS=,
+ for flag in $args; do
+ IFS=$save_ifs
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
+ done
+ IFS=$save_ifs
+ func_stripname ' ' '' "$arg"
+ arg=$func_stripname_result
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # -msg_* for osf cc
+ -msg_*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ ;;
+
+ # Flags to be passed through unchanged, with rationale:
+ # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
+ # -r[0-9][0-9]* specify processor for the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+ # +DA*, +DD* enable 64-bit mode for the HP compiler
+ # -q* compiler args for the IBM compiler
+ # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+ # -F/path path to uninstalled frameworks, gcc on darwin
+ # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # -fstack-protector* stack protector flags for GCC
+ # @file GCC response files
+ # -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -stdlib=* select c++ std lib with clang
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ func_append compiler_flags " $arg"
+ continue
+ ;;
+
+ -Z*)
+ if test os2 = "`expr $host : '.*\(os2\)'`"; then
+ # OS/2 uses -Zxxx to specify OS/2-specific options
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case $arg in
+ -Zlinker | -Zstack)
+ prev=xcompiler
+ ;;
+ esac
+ continue
+ else
+ # Otherwise treat like 'Some other compiler flag' below
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ fi
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ ;;
+
+ *.$objext)
+ # A standard object.
+ func_append objs " $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if func_lalib_unsafe_p "$arg"; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ func_source "$arg"
+
+ if test -z "$pic_object" ||
+ test -z "$non_pic_object" ||
+ test none = "$pic_object" &&
+ test none = "$non_pic_object"; then
+ func_fatal_error "cannot find name of object for '$arg'"
+ fi
+
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir=$func_dirname_result
+
+ test none = "$pic_object" || {
+ # Prepend the subdirectory the object is found in.
+ pic_object=$xdir$pic_object
+
+ if test dlfiles = "$prev"; then
+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
+ func_append dlfiles " $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test dlprefiles = "$prev"; then
+ # Preload the old-style object.
+ func_append dlprefiles " $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ func_append libobjs " $pic_object"
+ arg=$pic_object
+ }
+
+ # Non-PIC object.
+ if test none != "$non_pic_object"; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object=$xdir$non_pic_object
+
+ # A standard non-PIC object
+ func_append non_pic_objects " $non_pic_object"
+ if test -z "$pic_object" || test none = "$pic_object"; then
+ arg=$non_pic_object
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object=$pic_object
+ func_append non_pic_objects " $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if $opt_dry_run; then
+ # Extract subdirectory from the argument.
+ func_dirname "$arg" "/" ""
+ xdir=$func_dirname_result
+
+ func_lo2o "$arg"
+ pic_object=$xdir$objdir/$func_lo2o_result
+ non_pic_object=$xdir$func_lo2o_result
+ func_append libobjs " $pic_object"
+ func_append non_pic_objects " $non_pic_object"
+ else
+ func_fatal_error "'$arg' is not a valid libtool object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ func_resolve_sysroot "$arg"
+ if test dlfiles = "$prev"; then
+ # This library was specified with -dlopen.
+ func_append dlfiles " $func_resolve_sysroot_result"
+ prev=
+ elif test dlprefiles = "$prev"; then
+ # The library was specified with -dlpreopen.
+ func_append dlprefiles " $func_resolve_sysroot_result"
+ prev=
+ else
+ func_append deplibs " $func_resolve_sysroot_result"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+ done # argument parsing loop
+
+ test -n "$prev" && \
+ func_fatal_help "the '$prevarg' option requires an argument"
+
+ if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ func_basename "$output"
+ outputname=$func_basename_result
+ libobjs_save=$libobjs
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ # Definition is injected by LT_CONFIG during libtool generation.
+ func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
+ func_dirname "$output" "/" ""
+ output_objdir=$func_dirname_result$objdir
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
+ # Create the object directory.
+ func_mkdir_p "$output_objdir"
+
+ # Determine the type of output
+ case $output in
+ "")
+ func_fatal_help "you must specify an output file"
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if $opt_preserve_dup_deps; then
+ case "$libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append libs " $deplib"
+ done
+
+ if test lib = "$linkmode"; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if $opt_duplicate_compiler_generated_deps; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ esac
+ func_append pre_post_deps " $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ notinst_path= # paths that contain not-installed libtool libraries
+
+ case $linkmode in
+ lib)
+ passes="conv dlpreopen link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=false
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+
+ for pass in $passes; do
+ # The preopen pass in lib mode reverses $deplibs; put it back here
+ # so that -L comes before libs that need it for instance...
+ if test lib,link = "$linkmode,$pass"; then
+ ## FIXME: Find the place where the list is rebuilt in the wrong
+ ## order, and fix it there properly
+ tmp_deplibs=
+ for deplib in $deplibs; do
+ tmp_deplibs="$deplib $tmp_deplibs"
+ done
+ deplibs=$tmp_deplibs
+ fi
+
+ if test lib,link = "$linkmode,$pass" ||
+ test prog,scan = "$linkmode,$pass"; then
+ libs=$deplibs
+ deplibs=
+ fi
+ if test prog = "$linkmode"; then
+ case $pass in
+ dlopen) libs=$dlfiles ;;
+ dlpreopen) libs=$dlprefiles ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test lib,dlpreopen = "$linkmode,$pass"; then
+ # Collect and forward deplibs of preopened libtool libs
+ for lib in $dlprefiles; do
+ # Ignore non-libtool-libs
+ dependency_libs=
+ func_resolve_sysroot "$lib"
+ case $lib in
+ *.la) func_source "$func_resolve_sysroot_result" ;;
+ esac
+
+ # Collect preopened libtool deplibs, except any this library
+ # has declared as weak libs
+ for deplib in $dependency_libs; do
+ func_basename "$deplib"
+ deplib_base=$func_basename_result
+ case " $weak_libs " in
+ *" $deplib_base "*) ;;
+ *) func_append deplibs " $deplib" ;;
+ esac
+ done
+ done
+ libs=$dlprefiles
+ fi
+ if test dlopen = "$pass"; then
+ # Collect dlpreopened libraries
+ save_deplibs=$deplibs
+ deplibs=
+ fi
+
+ for deplib in $libs; do
+ lib=
+ found=false
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append compiler_flags " $deplib"
+ if test lib = "$linkmode"; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -l*)
+ if test lib != "$linkmode" && test prog != "$linkmode"; then
+ func_warning "'-l' is ignored for archives/objects"
+ continue
+ fi
+ func_stripname '-l' '' "$deplib"
+ name=$func_stripname_result
+ if test lib = "$linkmode"; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib=$searchdir/lib$name$search_ext
+ if test -f "$lib"; then
+ if test .la = "$search_ext"; then
+ found=:
+ else
+ found=false
+ fi
+ break 2
+ fi
+ done
+ done
+ if $found; then
+ # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if func_lalib_p "$lib"; then
+ library_names=
+ old_library=
+ func_source "$lib"
+ for l in $old_library $library_names; do
+ ll=$l
+ done
+ if test "X$ll" = "X$old_library"; then # only static version available
+ found=false
+ func_dirname "$lib" "" "."
+ ladir=$func_dirname_result
+ lib=$ladir/$old_library
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ else
+ # deplib doesn't seem to be a libtool library
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ ;; # -l
+ *.ltframework)
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ if test lib = "$linkmode"; then
+ case "$new_inherited_linker_flags " in
+ *" $deplib "*) ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
+ esac
+ fi
+ fi
+ continue
+ ;;
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test conv = "$pass" && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ prog)
+ if test conv = "$pass"; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test scan = "$pass"; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ *)
+ func_warning "'-L' is ignored for archives/objects"
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test link = "$pass"; then
+ func_stripname '-R' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) func_append xrpath " $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
+ *.$libext)
+ if test conv = "$pass"; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ # Linking convenience modules into shared libraries is allowed,
+ # but linking other static libraries is non-portable.
+ case " $dlpreconveniencelibs " in
+ *" $deplib "*) ;;
+ *)
+ valid_a_lib=false
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=:
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=:
+ ;;
+ esac
+ if $valid_a_lib; then
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ else
+ echo
+ $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because the file extensions .$libext of this argument makes me believe"
+ echo "*** that it is just a static archive that I should not use here."
+ fi
+ ;;
+ esac
+ continue
+ ;;
+ prog)
+ if test link != "$pass"; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test conv = "$pass"; then
+ deplibs="$deplib $deplibs"
+ elif test prog = "$linkmode"; then
+ if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ func_append newdlprefiles " $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ func_append newdlfiles " $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=:
+ continue
+ ;;
+ esac # case $deplib
+
+ $found || test -f "$lib" \
+ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
+
+ # Check to see that this really is a libtool archive.
+ func_lalib_unsafe_p "$lib" \
+ || func_fatal_error "'$lib' is not a valid libtool archive"
+
+ func_dirname "$lib" "" "."
+ ladir=$func_dirname_result
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ inherited_linker_flags=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ func_source "$lib"
+
+ # Convert "-framework foo" to "foo.ltframework"
+ if test -n "$inherited_linker_flags"; then
+ tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+ for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ case " $new_inherited_linker_flags " in
+ *" $tmp_inherited_linker_flag "*) ;;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ esac
+ done
+ fi
+ dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ if test lib,link = "$linkmode,$pass" ||
+ test prog,scan = "$linkmode,$pass" ||
+ { test prog != "$linkmode" && test lib != "$linkmode"; }; then
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ fi
+
+ if test conv = "$pass"; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ func_fatal_error "cannot find name of link library for '$lib'"
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
+ elif test prog != "$linkmode" && test lib != "$linkmode"; then
+ func_fatal_error "'$lib' is not a convenience library"
+ fi
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ if test -n "$old_library" &&
+ { test yes = "$prefer_static_libs" ||
+ test built,no = "$prefer_static_libs,$installed"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib=$l
+ done
+ fi
+ if test -z "$linklib"; then
+ func_fatal_error "cannot find name of link library for '$lib'"
+ fi
+
+ # This library was specified with -dlopen.
+ if test dlopen = "$pass"; then
+ test -z "$libdir" \
+ && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
+ if test -z "$dlname" ||
+ test yes != "$dlopen_support" ||
+ test no = "$build_libtool_libs"
+ then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ func_append dlprefiles " $lib $dependency_libs"
+ else
+ func_append newdlfiles " $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ func_warning "cannot determine absolute directory name of '$ladir'"
+ func_warning "passing it literally to the linker, although it might fail"
+ abs_ladir=$ladir
+ fi
+ ;;
+ esac
+ func_basename "$lib"
+ laname=$func_basename_result
+
+ # Find the relevant object directory and library name.
+ if test yes = "$installed"; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ func_warning "library '$lib' was moved."
+ dir=$ladir
+ absdir=$abs_ladir
+ libdir=$abs_ladir
+ else
+ dir=$lt_sysroot$libdir
+ absdir=$lt_sysroot$libdir
+ fi
+ test yes = "$hardcode_automatic" && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir=$ladir
+ absdir=$abs_ladir
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ else
+ dir=$ladir/$objdir
+ absdir=$abs_ladir/$objdir
+ # Remove this search path later
+ func_append notinst_path " $abs_ladir"
+ fi
+ fi # $installed = yes
+ func_stripname 'lib' '.la' "$laname"
+ name=$func_stripname_result
+
+ # This library was specified with -dlpreopen.
+ if test dlpreopen = "$pass"; then
+ if test -z "$libdir" && test prog = "$linkmode"; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
+ fi
+ case $host in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test lib = "$linkmode"; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test prog = "$linkmode" && test link != "$pass"; then
+ func_append newlib_search_path " $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=false
+ if test no != "$link_all_deplibs" || test -z "$library_names" ||
+ test no = "$build_libtool_libs"; then
+ linkalldeplibs=:
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
+ ;;
+ esac
+ # Need to link against all dependency_libs?
+ if $linkalldeplibs; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if $opt_preserve_dup_deps; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test prog,link = "$linkmode,$pass"; then
+ if test -n "$library_names" &&
+ { { test no = "$prefer_static_libs" ||
+ test built,yes = "$prefer_static_libs,$installed"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
+ # Make sure the rpath contains only unique directories.
+ case $temp_rpath: in
+ *"$absdir:"*) ;;
+ *) func_append temp_rpath "$absdir:" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if $alldeplibs &&
+ { test pass_all = "$deplibs_check_method" ||
+ { test yes = "$build_libtool_libs" &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test built = "$use_static_libs" && test yes = "$installed"; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test no = "$use_static_libs" || test -z "$old_library"; }; then
+ case $host in
+ *cygwin* | *mingw* | *cegcc* | *os2*)
+ # No point in relinking DLLs because paths are not encoded
+ func_append notinst_deplibs " $lib"
+ need_relink=no
+ ;;
+ *)
+ if test no = "$installed"; then
+ func_append notinst_deplibs " $lib"
+ need_relink=yes
+ fi
+ ;;
+ esac
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some
+ # systems (darwin). Don't bleat about dlopened modules though!
+ dlopenmodule=
+ for dlpremoduletest in $dlprefiles; do
+ if test "X$dlpremoduletest" = "X$lib"; then
+ dlopenmodule=$dlpremoduletest
+ break
+ fi
+ done
+ if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
+ echo
+ if test prog = "$linkmode"; then
+ $ECHO "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $ECHO "*** $linklib is not portable!"
+ fi
+ if test lib = "$linkmode" &&
+ test yes = "$hardcode_into_libs"; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) func_append compile_rpath " $absdir" ;;
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ shift
+ realname=$1
+ shift
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname=$dlname
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw* | *cegcc* | *os2*)
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix=-$major
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname=$realname
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot=$soname
+ func_basename "$soroot"
+ soname=$func_basename_result
+ func_stripname 'lib' '.dll' "$soname"
+ newlib=libimp-$func_stripname_result.a
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ func_verbose "extracting exported symbol list from '$soname'"
+ func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ func_verbose "generating import library for '$soname'"
+ func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test prog = "$linkmode" || test relink != "$opt_mode"; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test no = "$hardcode_direct"; then
+ add=$dir/$linklib
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+ *-*-sysv4*uw2*) add_dir=-L$dir ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir=-L$dir ;;
+ *-*-darwin* )
+ # if the lib is a (non-dlopened) module then we cannot
+ # link against it, someone is ignoring the earlier warnings
+ if /usr/bin/file -L $add 2> /dev/null |
+ $GREP ": [^:]* bundle" >/dev/null; then
+ if test "X$dlopenmodule" != "X$lib"; then
+ $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+ if test -z "$old_library"; then
+ echo
+ echo "*** And there doesn't seem to be a static archive available"
+ echo "*** The link will probably fail, sorry"
+ else
+ add=$dir/$old_library
+ fi
+ elif test -n "$old_library"; then
+ add=$dir/$old_library
+ fi
+ fi
+ esac
+ elif test no = "$hardcode_minus_L"; then
+ case $host in
+ *-*-sunos*) add_shlibpath=$dir ;;
+ esac
+ add_dir=-L$dir
+ add=-l$name
+ elif test no = "$hardcode_shlibpath_var"; then
+ add_shlibpath=$dir
+ add=-l$name
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test yes = "$hardcode_direct" &&
+ test no = "$hardcode_direct_absolute"; then
+ add=$dir/$linklib
+ elif test yes = "$hardcode_minus_L"; then
+ add_dir=-L$absdir
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add=-l$name
+ elif test yes = "$hardcode_shlibpath_var"; then
+ add_shlibpath=$dir
+ add=-l$name
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test yes != "$lib_linked"; then
+ func_fatal_configuration "unsupported hardcode properties"
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ esac
+ fi
+ if test prog = "$linkmode"; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test yes != "$hardcode_direct" &&
+ test yes != "$hardcode_minus_L" &&
+ test yes = "$hardcode_shlibpath_var"; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test prog = "$linkmode" || test relink = "$opt_mode"; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test yes = "$hardcode_direct" &&
+ test no = "$hardcode_direct_absolute"; then
+ add=$libdir/$linklib
+ elif test yes = "$hardcode_minus_L"; then
+ add_dir=-L$libdir
+ add=-l$name
+ elif test yes = "$hardcode_shlibpath_var"; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
+ esac
+ add=-l$name
+ elif test yes = "$hardcode_automatic"; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib"; then
+ add=$inst_prefix_dir$libdir/$linklib
+ else
+ add=$libdir/$linklib
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$lt_sysroot$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ func_append add_dir " -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add=-l$name
+ fi
+
+ if test prog = "$linkmode"; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test prog = "$linkmode"; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test unsupported != "$hardcode_direct"; then
+ test -n "$old_library" && linklib=$old_library
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test yes = "$build_libtool_libs"; then
+ # Not a shared library
+ if test pass_all != "$deplibs_check_method"; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ echo
+ $ECHO "*** Warning: This system cannot link to static lib archive $lib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have."
+ if test yes = "$module"; then
+ echo "*** But as you try to build a module library, libtool will still create "
+ echo "*** a static module, that should work as long as the dlopening application"
+ echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** 'nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test no = "$build_old_libs"; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test lib = "$linkmode"; then
+ if test -n "$dependency_libs" &&
+ { test yes != "$hardcode_into_libs" ||
+ test yes = "$build_old_libs" ||
+ test yes = "$link_static"; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) func_stripname '-R' '' "$libdir"
+ temp_xrpath=$func_stripname_result
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) func_append xrpath " $temp_xrpath";;
+ esac;;
+ *) func_append temp_deplibs " $libdir";;
+ esac
+ done
+ dependency_libs=$temp_deplibs
+ fi
+
+ func_append newlib_search_path " $absdir"
+ # Link against this library
+ test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps; then
+ case "$tmp_libs " in
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ esac
+ fi
+ func_append tmp_libs " $func_resolve_sysroot_result"
+ done
+
+ if test no != "$link_all_deplibs"; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ path=
+ case $deplib in
+ -L*) path=$deplib ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
+ func_dirname "$deplib" "" "."
+ dir=$func_dirname_result
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ func_warning "cannot determine absolute directory name of '$dir'"
+ absdir=$dir
+ fi
+ ;;
+ esac
+ if $GREP "^installed=no" $deplib > /dev/null; then
+ case $host in
+ *-*-darwin*)
+ depdepl=
+ eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names"; then
+ for tmp in $deplibrary_names; do
+ depdepl=$tmp
+ done
+ if test -f "$absdir/$objdir/$depdepl"; then
+ depdepl=$absdir/$objdir/$depdepl
+ darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -z "$darwin_install_name"; then
+ darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ fi
+ func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+ func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
+ path=
+ fi
+ fi
+ ;;
+ *)
+ path=-L$absdir/$objdir
+ ;;
+ esac
+ else
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ test -z "$libdir" && \
+ func_fatal_error "'$deplib' is not a valid libtool archive"
+ test "$absdir" != "$libdir" && \
+ func_warning "'$deplib' seems to be moved"
+
+ path=-L$absdir
+ fi
+ ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ if test link = "$pass"; then
+ if test prog = "$linkmode"; then
+ compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+ finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ fi
+ fi
+ dependency_libs=$newdependency_libs
+ if test dlpreopen = "$pass"; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test dlopen != "$pass"; then
+ test conv = "$pass" || {
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) func_append lib_search_path " $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ }
+
+ if test prog,link = "$linkmode,$pass"; then
+ vars="compile_deplibs finalize_deplibs"
+ else
+ vars=deplibs
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append tmp_libs " $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+
+ # Add Sun CC postdeps if required:
+ test CXX = "$tagname" && {
+ case $host_os in
+ linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C++ 5.9
+ func_suncc_cstd_abi
+
+ if test no != "$suncc_use_cstd_abi"; then
+ func_append postdeps ' -library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ func_cc_basename "$CC"
+ case $func_cc_basename_result in
+ CC* | sunCC*)
+ func_suncc_cstd_abi
+
+ if test no != "$suncc_use_cstd_abi"; then
+ func_append postdeps ' -library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ }
+
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=
+ ;;
+ esac
+ if test -n "$i"; then
+ func_append tmp_libs " $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test prog = "$linkmode"; then
+ dlfiles=$newdlfiles
+ fi
+ if test prog = "$linkmode" || test lib = "$linkmode"; then
+ dlprefiles=$newdlprefiles
+ fi
+
+ case $linkmode in
+ oldlib)
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ func_warning "'-dlopen' is ignored for archives"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "'-l' and '-L' are ignored for archives" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "'-rpath' is ignored for archives"
+
+ test -n "$xrpath" && \
+ func_warning "'-R' is ignored for archives"
+
+ test -n "$vinfo" && \
+ func_warning "'-version-info/-version-number' is ignored for archives"
+
+ test -n "$release" && \
+ func_warning "'-release' is ignored for archives"
+
+ test -n "$export_symbols$export_symbols_regex" && \
+ func_warning "'-export-symbols' is ignored for archives"
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs=$output
+ func_append objs "$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form 'libNAME.la'.
+ case $outputname in
+ lib*)
+ func_stripname 'lib' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ test no = "$module" \
+ && func_fatal_help "libtool library '$output' must begin with 'lib'"
+
+ if test no != "$need_lib_prefix"; then
+ # Add the "lib" prefix for modules if required
+ func_stripname '' '.la' "$outputname"
+ name=$func_stripname_result
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ func_stripname '' '.la' "$outputname"
+ libname=$func_stripname_result
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test pass_all != "$deplibs_check_method"; then
+ func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
+ else
+ echo
+ $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ $ECHO "*** objects $objs is not portable!"
+ func_append libobjs " $objs"
+ fi
+ fi
+
+ test no = "$dlself" \
+ || func_warning "'-dlopen self' is ignored for libtool libraries"
+
+ set dummy $rpath
+ shift
+ test 1 -lt "$#" \
+ && func_warning "ignoring multiple '-rpath's for a libtool library"
+
+ install_libdir=$1
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test yes = "$build_libtool_libs"; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a '.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ test -n "$vinfo" && \
+ func_warning "'-version-info/-version-number' is ignored for convenience libraries"
+
+ test -n "$release" && \
+ func_warning "'-release' is ignored for convenience libraries"
+ else
+
+ # Parse the version information argument.
+ save_ifs=$IFS; IFS=:
+ set dummy $vinfo 0 0 0
+ shift
+ IFS=$save_ifs
+
+ test -n "$7" && \
+ func_fatal_help "too many parameters to '-version-info'"
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major=$1
+ number_minor=$2
+ number_revision=$3
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # that has an extra 1 added just for fun
+ #
+ case $version_type in
+ # correct linux to gnu/linux during the next big refactor
+ darwin|freebsd-elf|linux|osf|windows|none)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age=$number_minor
+ revision=$number_revision
+ ;;
+ freebsd-aout|qnx|sunos)
+ current=$number_major
+ revision=$number_minor
+ age=0
+ ;;
+ irix|nonstopux)
+ func_arith $number_major + $number_minor
+ current=$func_arith_result
+ age=$number_minor
+ revision=$number_minor
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current=$1
+ revision=$2
+ age=$3
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "CURRENT '$current' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "REVISION '$revision' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ func_error "AGE '$age' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ func_error "AGE '$age' is greater than the current interface number '$current'"
+ func_fatal_error "'$vinfo' is not valid version information"
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
+ # Darwin ld doesn't like 0 for these options...
+ func_arith $current + 1
+ minor_current=$func_arith_result
+ xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ # On Darwin other compilers
+ case $CC in
+ nagfor*)
+ verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+ ;;
+ *)
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+ esac
+ ;;
+
+ freebsd-aout)
+ major=.$current
+ versuffix=.$current.$revision
+ ;;
+
+ freebsd-elf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
+ ;;
+
+ irix | nonstopux)
+ if test no = "$lt_irix_increment"; then
+ func_arith $current - $age
+ else
+ func_arith $current - $age + 1
+ fi
+ major=$func_arith_result
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring=$verstring_prefix$major.$revision
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test 0 -ne "$loop"; do
+ func_arith $revision - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring=$verstring_prefix$major.$iface:$verstring
+ done
+
+ # Before this point, $major must not contain '.'.
+ major=.$major
+ versuffix=$major.$revision
+ ;;
+
+ linux) # correct to gnu/linux during the next big refactor
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
+ ;;
+
+ osf)
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=.$current.$age.$revision
+ verstring=$current.$age.$revision
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test 0 -ne "$loop"; do
+ func_arith $current - $loop
+ iface=$func_arith_result
+ func_arith $loop - 1
+ loop=$func_arith_result
+ verstring=$verstring:$iface.0
+ done
+
+ # Make executables depend on our current version.
+ func_append verstring ":$current.0"
+ ;;
+
+ qnx)
+ major=.$current
+ versuffix=.$current
+ ;;
+
+ sco)
+ major=.$current
+ versuffix=.$current
+ ;;
+
+ sunos)
+ major=.$current
+ versuffix=.$current.$revision
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 file systems.
+ func_arith $current - $age
+ major=$func_arith_result
+ versuffix=-$major
+ ;;
+
+ *)
+ func_fatal_configuration "unknown library version type '$version_type'"
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring=0.0
+ ;;
+ esac
+ if test no = "$need_version"; then
+ versuffix=
+ else
+ versuffix=.0.0
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test yes,no = "$avoid_version,$need_version"; then
+ major=
+ versuffix=
+ verstring=
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test yes = "$allow_undefined"; then
+ if test unsupported = "$allow_undefined_flag"; then
+ if test yes = "$build_old_libs"; then
+ func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+ build_libtool_libs=no
+ else
+ func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+ fi
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag=$no_undefined_flag
+ fi
+
+ fi
+
+ func_generate_dlsyms "$libname" "$libname" :
+ func_append libobjs " $symfileobj"
+ test " " = "$libobjs" && libobjs=
+
+ if test relink != "$opt_mode"; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$ECHO "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext | *.gcno)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+ if test -n "$precious_files_regex"; then
+ if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ func_append removelist " $p"
+ ;;
+ *) ;;
+ esac
+ done
+ test -n "$removelist" && \
+ func_show_eval "${RM}r \$removelist"
+ fi
+
+ # Now set the variables for building old libraries.
+ if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
+ func_append oldlibs " $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+ # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+ # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles=$dlfiles
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) func_append dlfiles " $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles=$dlprefiles
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) func_append dlprefiles " $lib" ;;
+ esac
+ done
+
+ if test yes = "$build_libtool_libs"; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ func_append deplibs " System.ltframework"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test yes = "$build_libtool_need_lc"; then
+ func_append deplibs " -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=
+ versuffix=
+ major=
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $opt_dry_run || $RM conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=
+ ;;
+ esac
+ fi
+ if test -n "$i"; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which I believe you do not have"
+ echo "*** because a test_compile did reveal that the linker did not use it for"
+ echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ case $i in
+ -l*)
+ func_stripname -l '' "$i"
+ name=$func_stripname_result
+ $opt_dry_run || $RM conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ func_append newdeplibs " $i"
+ i=
+ ;;
+ esac
+ fi
+ if test -n "$i"; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ set dummy $deplib_matches; shift
+ deplib_match=$1
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
+ func_append newdeplibs " $i"
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because a test_compile did reveal that the linker did not use this one"
+ echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
+ echo "*** make it link in! You will probably need to install it or some"
+ echo "*** library that it depends on before this library will be fully"
+ echo "*** functional. Installing it before continuing would be even better."
+ fi
+ ;;
+ *)
+ func_append newdeplibs " $i"
+ ;;
+ esac
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method; shift
+ file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib"; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test yes = "$want_nocaseglob"; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null |
+ $GREP " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib=$potent_lib
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+ *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ $SED -e 10q |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib"; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib"; then
+ $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method; shift
+ match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+ for a_deplib in $deplibs; do
+ case $a_deplib in
+ -l*)
+ func_stripname -l '' "$a_deplib"
+ name=$func_stripname_result
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib"; then
+ libname=`eval "\\$ECHO \"$libname_spec\""`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib=$potent_lib # see symlink-check above in file_magic test
+ if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ $EGREP "$match_pattern_regex" > /dev/null; then
+ func_append newdeplibs " $a_deplib"
+ a_deplib=
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib"; then
+ droppeddeps=yes
+ echo
+ $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+ echo "*** I have the capability to make that library automatically link in when"
+ echo "*** you link to this library. But I can only do this if you have a"
+ echo "*** shared version of the library, which you do not appear to have"
+ echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib"; then
+ $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $ECHO "*** with $libname and none of the candidates passed a file format test"
+ $ECHO "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ ;;
+ *)
+ # Add a -L argument.
+ func_append newdeplibs " $a_deplib"
+ ;;
+ esac
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=
+ tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ for i in $predeps $postdeps; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
+ done
+ fi
+ case $tmp_deplibs in
+ *[!\ \ ]*)
+ echo
+ if test none = "$deplibs_check_method"; then
+ echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ ;;
+ esac
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library with the System framework
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ if test yes = "$droppeddeps"; then
+ if test yes = "$module"; then
+ echo
+ echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
+ echo "*** a static module, that should work as long as the dlopening"
+ echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ echo
+ echo "*** However, this would only work if libtool was able to extract symbol"
+ echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
+ echo "*** not find such a program. So, this module is probably useless."
+ echo "*** 'nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test no = "$build_old_libs"; then
+ oldlibs=$output_objdir/$libname.$libext
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ echo "*** The inter-library dependencies that have been dropped here will be"
+ echo "*** automatically added whenever a program is linked with this library"
+ echo "*** or is declared to -dlopen it."
+
+ if test no = "$allow_undefined"; then
+ echo
+ echo "*** Since this library must not contain undefined symbols,"
+ echo "*** because either the platform does not support them or"
+ echo "*** it was explicitly requested with -no-undefined,"
+ echo "*** libtool will only create a static version of it."
+ if test no = "$build_old_libs"; then
+ oldlibs=$output_objdir/$libname.$libext
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ deplibs=$new_libs
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test yes = "$build_libtool_libs"; then
+ # Remove $wl instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
+ if test yes = "$hardcode_into_libs"; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath=$finalize_rpath
+ test relink = "$opt_mode" || rpath=$compile_rpath$rpath
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ func_stripname '=' '' "$libdir"
+ libdir=$func_stripname_result
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs=$libdir
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append dep_rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir=$hardcode_libdirs
+ eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath=$finalize_shlibpath
+ test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ shift
+ realname=$1
+ shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname=$realname
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib=$output_objdir/$realname
+ linknames=
+ for link
+ do
+ func_append linknames " $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ test "X$libobjs" = "X " && libobjs=
+
+ delfiles=
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ export_symbols=$output_objdir/$libname.uexp
+ func_append delfiles " $export_symbols"
+ fi
+
+ orig_export_symbols=
+ case $host_os in
+ cygwin* | mingw* | cegcc*)
+ if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+ # exporting using user supplied symfile
+ func_dll_def_p "$export_symbols" || {
+ # and it's NOT already a .def file. Must figure out
+ # which of the given symbols are data symbols and tag
+ # them as such. So, trigger use of export_symbols_cmds.
+ # export_symbols gets reassigned inside the "prepare
+ # the list of exported symbols" if statement, so the
+ # include_expsyms logic still works.
+ orig_export_symbols=$export_symbols
+ export_symbols=
+ always_export_symbols=yes
+ }
+ fi
+ ;;
+ esac
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for '$libname.la'"
+ export_symbols=$output_objdir/$libname.exp
+ $opt_dry_run || $RM $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs=$IFS; IFS='~'
+ for cmd1 in $cmds; do
+ IFS=$save_ifs
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test yes = "$try_normal_branch" \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
+ func_show_eval "$cmd" 'exit $?'
+ skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=$output_objdir/$output_la.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ func_verbose "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS=$save_ifs
+ if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols=$export_symbols
+ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands, which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ func_append tmp_deplibs " $test_deplib"
+ ;;
+ esac
+ done
+ deplibs=$tmp_deplibs
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec" &&
+ test yes = "$compiler_needs_object" &&
+ test -z "$libobjs"; then
+ # extract the archives, so we have objects to list.
+ # TODO: could optimize this to just extract one archive.
+ whole_archive_flag_spec=
+ fi
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ else
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ fi
+
+ if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ func_append linker_flags " $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test relink = "$opt_mode"; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test yes = "$module" && test -n "$module_cmds"; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test : != "$skipped_export" &&
+ func_len " $test_cmds" &&
+ len=$func_len_result &&
+ test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise
+ # or, if using GNU ld and skipped_export is not :, use a linker
+ # script.
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ func_basename "$output"
+ output_la=$func_basename_result
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ last_robj=
+ k=1
+
+ if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+ output=$output_objdir/$output_la.lnkscript
+ func_verbose "creating GNU ld script: $output"
+ echo 'INPUT (' > $output
+ for obj in $save_libobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ echo ')' >> $output
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
+ elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+ output=$output_objdir/$output_la.lnk
+ func_verbose "creating linker input file list: $output"
+ : > $output
+ set x $save_libobjs
+ shift
+ firstobj=
+ if test yes = "$compiler_needs_object"; then
+ firstobj="$1 "
+ shift
+ fi
+ for obj
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
+ done
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ else
+ if test -n "$save_libobjs"; then
+ func_verbose "creating reloadable object files..."
+ output=$output_objdir/$output_la-$k.$objext
+ eval test_cmds=\"$reload_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ if test -z "$objlist" ||
+ test "$len" -lt "$max_cmd_len"; then
+ func_append objlist " $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test 1 -eq "$k"; then
+ # The first file doesn't have a previous command to add.
+ reload_objs=$objlist
+ eval concat_cmds=\"$reload_cmds\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-$k.$objext
+ func_arith $k + 1
+ k=$func_arith_result
+ output=$output_objdir/$output_la-$k.$objext
+ objlist=" $obj"
+ func_len " $last_robj"
+ func_arith $len0 + $func_len_result
+ len=$func_arith_result
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ reload_objs="$objlist $last_robj"
+ eval concat_cmds=\"\$concat_cmds$reload_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ func_append delfiles " $output"
+
+ else
+ output=
+ fi
+
+ ${skipped_export-false} && {
+ func_verbose "generating symbol list for '$libname.la'"
+ export_symbols=$output_objdir/$libname.exp
+ $opt_dry_run || $RM $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ if test -n "$last_robj"; then
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ fi
+ }
+
+ test -n "$save_libobjs" &&
+ func_verbose "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs=$IFS; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS=$save_ifs
+ $opt_quiet || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test relink = "$opt_mode"; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS=$save_ifs
+
+ if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+ func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+
+ ${skipped_export-false} && {
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ tmp_export_symbols=$export_symbols
+ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
+ $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ fi
+
+ if test -n "$orig_export_symbols"; then
+ # The given exports_symbols file has to be filtered, so filter it.
+ func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
+ # FIXME: $output_objdir/$libname.filter potentially contains lots of
+ # 's' commands, which not all seds can handle. GNU sed should be fine
+ # though. Also, the filter scales superlinearly with the number of
+ # global variables. join(1) would be nice here, but unfortunately
+ # isn't a blessed tool.
+ $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ export_symbols=$output_objdir/$libname.def
+ $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ fi
+ }
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test yes = "$module" && test -n "$module_cmds"; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+ fi
+
+ if test -n "$delfiles"; then
+ # Append the command to remove temporary files to $cmds.
+ eval cmds=\"\$cmds~\$RM $delfiles\"
+ fi
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append libobjs " $func_extract_archives_result"
+ test "X$libobjs" = "X " && libobjs=
+ fi
+
+ save_ifs=$IFS; IFS='~'
+ for cmd in $cmds; do
+ IFS=$sp$nl
+ eval cmd=\"$cmd\"
+ IFS=$save_ifs
+ $opt_quiet || {
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
+ }
+ $opt_dry_run || eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test relink = "$opt_mode"; then
+ ( cd "$output_objdir" && \
+ $RM "${realname}T" && \
+ $MV "${realname}U" "$realname" )
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS=$save_ifs
+
+ # Restore the uninstalled library and exit
+ if test relink = "$opt_mode"; then
+ $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test yes = "$module" || test yes = "$export_dynamic"; then
+ # On all known operating systems, these are identical.
+ dlname=$soname
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ func_warning "'-dlopen' is ignored for objects"
+ fi
+
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ func_warning "'-l' and '-L' are ignored for objects" ;;
+ esac
+
+ test -n "$rpath" && \
+ func_warning "'-rpath' is ignored for objects"
+
+ test -n "$xrpath" && \
+ func_warning "'-R' is ignored for objects"
+
+ test -n "$vinfo" && \
+ func_warning "'-version-info' is ignored for objects"
+
+ test -n "$release" && \
+ func_warning "'-release' is ignored for objects"
+
+ case $output in
+ *.lo)
+ test -n "$objs$old_deplibs" && \
+ func_fatal_error "cannot build library object '$output' from non-libtool objects"
+
+ libobj=$output
+ func_lo2o "$libobj"
+ obj=$func_lo2o_result
+ ;;
+ *)
+ libobj=
+ obj=$output
+ ;;
+ esac
+
+ # Delete the old objects.
+ $opt_dry_run || $RM $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # if reload_cmds runs $LD directly, get rid of -Wl from
+ # whole_archive_flag_spec and hope we can get by with turning comma
+ # into space.
+ case $reload_cmds in
+ *\$LD[\ \$]*) wl= ;;
+ esac
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
+ else
+ gentop=$output_objdir/${obj}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # If we're not building shared, we need to use non_pic_objs
+ test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
+
+ # Create the old-style object.
+ reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
+
+ output=$obj
+ func_execute_cmds "$reload_cmds" 'exit $?'
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ test yes = "$build_libtool_libs" || {
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ }
+
+ if test -n "$pic_flag" || test default != "$pic_mode"; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output=$libobj
+ func_execute_cmds "$reload_cmds" 'exit $?'
+ fi
+
+ if test -n "$gentop"; then
+ func_show_eval '${RM}r "$gentop"'
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result.exe;;
+ esac
+ test -n "$vinfo" && \
+ func_warning "'-version-info' is ignored for programs"
+
+ test -n "$release" && \
+ func_warning "'-release' is ignored for programs"
+
+ $preload \
+ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+ ;;
+ esac
+
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ # But is supposedly fixed on 10.4 or later (yay!).
+ if test CXX = "$tagname"; then
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 10.[0123])
+ func_append compile_command " $wl-bind_at_load"
+ func_append finalize_command " $wl-bind_at_load"
+ ;;
+ esac
+ fi
+ # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+ compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ func_append new_libs " -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ ;;
+ *) func_append new_libs " $deplib" ;;
+ esac
+ done
+ compile_deplibs=$new_libs
+
+
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_rpath " $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
+ func_stripname '=' '' "$libdir"
+ libdir=$func_stripname_result
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs=$libdir
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append perm_rpath " $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+ testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ ::) dllsearchpath=$libdir;;
+ *) func_append dllsearchpath ":$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ ::) dllsearchpath=$testbindir;;
+ *) func_append dllsearchpath ":$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir=$hardcode_libdirs
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath=$rpath
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs=$libdir
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ func_append rpath " $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir=$hardcode_libdirs
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath=$rpath
+
+ if test -n "$libobjs" && test yes = "$build_old_libs"; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ fi
+
+ func_generate_dlsyms "$outputname" "@PROGRAM@" false
+
+ # template prelinking step
+ if test -n "$prelink_cmds"; then
+ func_execute_cmds "$prelink_cmds" 'exit $?'
+ fi
+
+ wrappers_required=:
+ case $host in
+ *cegcc* | *mingw32ce*)
+ # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+ wrappers_required=false
+ ;;
+ *cygwin* | *mingw* )
+ test yes = "$build_libtool_libs" || wrappers_required=false
+ ;;
+ *)
+ if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+ wrappers_required=false
+ fi
+ ;;
+ esac
+ $wrappers_required || {
+ # Replace the output file specification.
+ compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ link_command=$compile_command$compile_rpath
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ exit_status=0
+ func_show_eval "$link_command" 'exit_status=$?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Delete the generated files.
+ if test -f "$output_objdir/${outputname}S.$objext"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
+ fi
+
+ exit $exit_status
+ }
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ func_append rpath "$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test yes = "$no_install"; then
+ # We don't need to create a wrapper script.
+ link_command=$compile_var$compile_command$compile_rpath
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $opt_dry_run || $RM $output
+ # Link the executable and exit
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ case $hardcode_action,$fast_install in
+ relink,*)
+ # Fast installation is not supported
+ link_command=$compile_var$compile_command$compile_rpath
+ relink_command=$finalize_var$finalize_command$finalize_rpath
+
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "'$output' will be relinked during installation"
+ ;;
+ *,yes)
+ link_command=$finalize_var$compile_command$finalize_rpath
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ ;;
+ *,no)
+ link_command=$compile_var$compile_command$compile_rpath
+ relink_command=$finalize_var$finalize_command$finalize_rpath
+ ;;
+ *,needless)
+ link_command=$finalize_var$compile_command$finalize_rpath
+ relink_command=
+ ;;
+ esac
+
+ # Replace the output file specification.
+ link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
+ # Now create the wrapper script.
+ func_verbose "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if not in dry run mode.
+ $opt_dry_run || {
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) func_stripname '' '.exe' "$output"
+ output=$func_stripname_result ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ func_stripname '' '.exe' "$outputname"
+ outputname=$func_stripname_result ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ func_dirname_and_basename "$output" "" "."
+ output_name=$func_basename_result
+ output_path=$func_dirname_result
+ cwrappersource=$output_path/$objdir/lt-$output_name.c
+ cwrapper=$output_path/$output_name.exe
+ $RM $cwrappersource $cwrapper
+ trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_cwrapperexe_src > $cwrappersource
+
+ # The wrapper executable is built using the $host compiler,
+ # because it contains $host paths and files. If cross-
+ # compiling, it, like the target executable, must be
+ # executed on the $host or under an emulation environment.
+ $opt_dry_run || {
+ $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+ $STRIP $cwrapper
+ }
+
+ # Now, create the wrapper script for func_source use:
+ func_ltwrapper_scriptname $cwrapper
+ $RM $func_ltwrapper_scriptname_result
+ trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+ $opt_dry_run || {
+ # note: this script will not be executed, so do not chmod.
+ if test "x$build" = "x$host"; then
+ $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+ else
+ func_emit_wrapper no > $func_ltwrapper_scriptname_result
+ fi
+ }
+ ;;
+ * )
+ $RM $output
+ trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+ func_emit_wrapper no > $output
+ chmod +x $output
+ ;;
+ esac
+ }
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ case $build_libtool_libs in
+ convenience)
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs=$convenience
+ build_libtool_libs=no
+ ;;
+ module)
+ oldobjs=$libobjs_save
+ addlibs=$old_convenience
+ build_libtool_libs=no
+ ;;
+ *)
+ oldobjs="$old_deplibs $non_pic_objects"
+ $preload && test -f "$symfileobj" \
+ && func_append oldobjs " $symfileobj"
+ addlibs=$old_convenience
+ ;;
+ esac
+
+ if test -n "$addlibs"; then
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $addlibs
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
+ cmds=$old_archive_from_new_cmds
+ else
+
+ # Add any objects from preloaded convenience libraries
+ if test -n "$dlprefiles"; then
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+
+ func_extract_archives $gentop $dlprefiles
+ func_append oldobjs " $func_extract_archives_result"
+ fi
+
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ func_basename "$obj"
+ $ECHO "$func_basename_result"
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ echo "copying selected object files to avoid basename conflicts..."
+ gentop=$output_objdir/${outputname}x
+ func_append generated " $gentop"
+ func_mkdir_p "$gentop"
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ func_basename "$obj"
+ objbase=$func_basename_result
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ func_arith $counter + 1
+ counter=$func_arith_result
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
+ ;;
+ *) func_append oldobjs " $obj" ;;
+ esac
+ done
+ fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
+ eval cmds=\"$old_archive_cmds\"
+
+ func_len " $cmds"
+ len=$func_len_result
+ if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ func_verbose "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ oldobjs=
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ eval test_cmds=\"$old_archive_cmds\"
+ func_len " $test_cmds"
+ len0=$func_len_result
+ len=$len0
+ for obj in $save_oldobjs
+ do
+ func_len " $obj"
+ func_arith $len + $func_len_result
+ len=$func_arith_result
+ func_append objlist " $obj"
+ if test "$len" -lt "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj"; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
+ objlist=
+ len=$len0
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test -z "$oldobjs"; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ func_execute_cmds "$cmds" 'exit $?'
+ done
+
+ test -n "$generated" && \
+ func_show_eval "${RM}r$generated"
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test yes = "$build_old_libs" && old_library=$libname.$libext
+ func_verbose "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ if test yes = "$hardcode_automatic"; then
+ relink_command=
+ fi
+
+ # Only create the output if not a dry run.
+ $opt_dry_run || {
+ for installed in no yes; do
+ if test yes = "$installed"; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output=$output_objdir/${outputname}i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ func_basename "$deplib"
+ name=$func_basename_result
+ func_resolve_sysroot "$deplib"
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ test -z "$libdir" && \
+ func_fatal_error "'$deplib' is not a valid libtool archive"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
+ ;;
+ *) func_append newdependency_libs " $deplib" ;;
+ esac
+ done
+ dependency_libs=$newdependency_libs
+ newdlfiles=
+
+ for lib in $dlfiles; do
+ case $lib in
+ *.la)
+ func_basename "$lib"
+ name=$func_basename_result
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "'$lib' is not a valid libtool archive"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ *) func_append newdlfiles " $lib" ;;
+ esac
+ done
+ dlfiles=$newdlfiles
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ *.la)
+ # Only pass preopened files to the pseudo-archive (for
+ # eventual linking with the app. that links it) if we
+ # didn't already link the preopened objects directly into
+ # the library:
+ func_basename "$lib"
+ name=$func_basename_result
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ test -z "$libdir" && \
+ func_fatal_error "'$lib' is not a valid libtool archive"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ esac
+ done
+ dlprefiles=$newdlprefiles
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlfiles " $abs"
+ done
+ dlfiles=$newdlfiles
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ func_append newdlprefiles " $abs"
+ done
+ dlprefiles=$newdlprefiles
+ fi
+ $RM $output
+ # place dlname in correct position for cygwin
+ # In fact, it would be nice if we could use this code for all target
+ # systems that can't hard-code library paths into their executables
+ # and that have no shared library path variable independent of PATH,
+ # but it turns out we can't easily determine that from inspecting
+ # libtool variables, so we have to hard-code the OSs to which it
+ # applies here; at the moment, that means platforms that use the PE
+ # object format with DLL files. See the long comment at the top of
+ # tests/bindir.at for full details.
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+ # If a -bindir argument was supplied, place the dll there.
+ if test -n "$bindir"; then
+ func_relative_path "$install_libdir" "$bindir"
+ tdlname=$func_relative_path_result/$dlname
+ else
+ # Otherwise fall back on heuristic.
+ tdlname=../bin/$dlname
+ fi
+ ;;
+ esac
+ $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that cannot go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test no,yes = "$installed,$need_relink"; then
+ $ECHO >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ }
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+}
+
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+ func_mode_link ${1+"$@"}
+fi
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+ $debug_cmd
+
+ RM=$nonopt
+ files=
+ rmforce=false
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic=$magic
+
+ for arg
+ do
+ case $arg in
+ -f) func_append RM " $arg"; rmforce=: ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
+ esac
+ done
+
+ test -z "$RM" && \
+ func_fatal_help "you must specify an RM program"
+
+ rmdirs=
+
+ for file in $files; do
+ func_dirname "$file" "" "."
+ dir=$func_dirname_result
+ if test . = "$dir"; then
+ odir=$objdir
+ else
+ odir=$dir/$objdir
+ fi
+ func_basename "$file"
+ name=$func_basename_result
+ test uninstall = "$opt_mode" && odir=$dir
+
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test clean = "$opt_mode"; then
+ case " $rmdirs " in
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if { test -L "$file"; } >/dev/null 2>&1 ||
+ { test -h "$file"; } >/dev/null 2>&1 ||
+ test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif $rmforce; then
+ continue
+ fi
+
+ rmfiles=$file
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if func_lalib_p "$file"; then
+ func_source $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ func_append rmfiles " $odir/$n"
+ done
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+ case $opt_mode in
+ clean)
+ case " $library_names " in
+ *" $dlname "*) ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ esac
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if func_lalib_p "$file"; then
+
+ # Read the .lo file
+ func_source $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" && test none != "$pic_object"; then
+ func_append rmfiles " $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" && test none != "$non_pic_object"; then
+ func_append rmfiles " $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test clean = "$opt_mode"; then
+ noexename=$name
+ case $file in
+ *.exe)
+ func_stripname '' '.exe' "$file"
+ file=$func_stripname_result
+ func_stripname '' '.exe' "$name"
+ noexename=$func_stripname_result
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ func_append rmfiles " $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if func_ltwrapper_p "$file"; then
+ if func_ltwrapper_executable_p "$file"; then
+ func_ltwrapper_scriptname "$file"
+ relink_command=
+ func_source $func_ltwrapper_scriptname_result
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
+ else
+ relink_command=
+ func_source $dir/$noexename
+ fi
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+ if test yes = "$fast_install" && test -n "$relink_command"; then
+ func_append rmfiles " $odir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name"; then
+ func_append rmfiles " $odir/lt-$noexename.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ func_show_eval "$RM $rmfiles" 'exit_status=1'
+ done
+
+ # Try to remove the $objdir's in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ func_show_eval "rmdir $dir >/dev/null 2>&1"
+ fi
+ done
+
+ exit $exit_status
+}
+
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+ func_mode_uninstall ${1+"$@"}
+fi
+
+test -z "$opt_mode" && {
+ help=$generic_help
+ func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+ func_fatal_help "invalid operation mode '$opt_mode'"
+
+if test -n "$exec_cmd"; then
+ eval exec "$exec_cmd"
+ exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# where we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/lua_hpp.mk b/lua_hpp.mk
new file mode 100644
index 0000000..70502f4
--- /dev/null
+++ b/lua_hpp.mk
@@ -0,0 +1,6 @@
+lua.hpp:
+ $(AM_V_GEN)echo 'extern "C" {' > $@
+ @echo '#include "lua.h"' >> $@
+ @echo '#include "lualib.h"' >> $@
+ @echo '#include "lauxlib.h"' >> $@
+ @echo '}' >> $@
diff --git a/m4/ac_pthread_set_name.m4 b/m4/ac_pthread_set_name.m4
new file mode 100644
index 0000000..4b2cb23
--- /dev/null
+++ b/m4/ac_pthread_set_name.m4
@@ -0,0 +1,71 @@
+# PTHREAD_SET_NAME();
+# Check which variant (if any) of pthread_set_name_np we have.
+# -----------------------------------------------------------------------------
+AC_DEFUN([PTHREAD_SET_NAME],
+[
+ stored_LIBS="$LIBS"
+ LIBS="-lpthread"
+ # pthread setname (4 non-portable variants...)
+ AC_CHECK_HEADERS([pthread_np.h], [], [], [#include <pthread.h>])
+ define(pthread_np_preamble,[
+ #include <pthread.h>
+ #if HAVE_PTHREAD_NP_H
+ # include <pthread_np.h>
+ #endif
+ ])
+ # 2-arg setname (e.g. Linux/glibc, QNX, IBM)
+ AC_MSG_CHECKING([for 2-arg pthread_setname_np])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(pthread_np_preamble, [
+ pthread_setname_np(pthread_self(), "foo")
+ ])], [
+ AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_2, 1, [2-arg pthread_setname_np])
+ AC_MSG_RESULT([yes])
+ ], [
+ AC_MSG_RESULT([no])
+
+ # 2-arg set_name (e.g. FreeBSD, OpenBSD)
+ AC_MSG_CHECKING([for 2-arg pthread_set_name_np])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(pthread_np_preamble, [
+ return pthread_set_name_np(pthread_self(), "foo");
+ ])], [
+ AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP_2, 1, [2-arg pthread_set_name_np])
+ AC_MSG_RESULT([yes])
+ ], [
+ AC_MSG_RESULT([no])
+
+ # 2-arg void set_name (e.g. FreeBSD, OpenBSD)
+ AC_MSG_CHECKING([for 2-arg void pthread_set_name_np])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(pthread_np_preamble, [
+ pthread_set_name_np(pthread_self(), "foo");
+ ])], [
+ AC_DEFINE(HAVE_PTHREAD_SET_NAME_NP_2_VOID, 1, [2-arg void pthread_set_name_np])
+ AC_MSG_RESULT([yes])
+ ], [
+ AC_MSG_RESULT([no])
+
+ # 1-arg setname (e.g. Darwin)
+ AC_MSG_CHECKING([for 1-arg pthread_setname_np])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(pthread_np_preamble, [
+ return pthread_setname_np("foo");
+ ])], [
+ AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_1, 1, [1-arg pthread_setname_np])
+ AC_MSG_RESULT([yes])
+ ], [
+ AC_MSG_RESULT([no])
+
+ # 3-arg setname (e.g. NetBSD)
+ AC_MSG_CHECKING([for 3-arg pthread_setname_np])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(pthread_np_preamble, [
+ return pthread_setname_np(pthread_self(), "foo", NULL);
+ ])], [
+ AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_3, 1, [3-arg pthread_setname_np])
+ AC_MSG_RESULT([yes])
+ ], [
+ AC_MSG_RESULT([no])
+ ])
+ ])
+ ])
+ ])
+ ])
+ LIBS=$stored_LIBS
+])
diff --git a/m4/ax_arg_default_enable_disable.m4 b/m4/ax_arg_default_enable_disable.m4
new file mode 100644
index 0000000..66d99ab
--- /dev/null
+++ b/m4/ax_arg_default_enable_disable.m4
@@ -0,0 +1,21 @@
+AC_DEFUN([AX_ARG_DEFAULT_ENABLE], [
+AC_ARG_ENABLE([$1], AS_HELP_STRING([--disable-$1], [$2 (default is ENABLED$3)]))
+AX_PARSE_VALUE([$1], [y])
+])
+
+AC_DEFUN([AX_ARG_DEFAULT_DISABLE], [
+AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1], [$2 (default is DISABLED$3)]))
+AX_PARSE_VALUE([$1], [n])
+])
+
+dnl This function should not be called outside of this file
+AC_DEFUN([AX_PARSE_VALUE], [
+AS_IF([test "x$enable_$1" = "xno"], [
+ ax_cv_$1="n"
+], [test "x$enable_$1" = "xyes"], [
+ ax_cv_$1="y"
+], [test -z $ax_cv_$1], [
+ ax_cv_$1="$2"
+])
+$1=$ax_cv_$1
+AC_SUBST($1)])
diff --git a/m4/ax_check_sign.m4 b/m4/ax_check_sign.m4
new file mode 100644
index 0000000..acc1262
--- /dev/null
+++ b/m4/ax_check_sign.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_check_sign.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_SIGN (TYPE, [ACTION-IF-SIGNED], [ACTION-IF-UNSIGNED], [INCLUDES])
+#
+# DESCRIPTION
+#
+# Checks whether TYPE is signed or not. If no INCLUDES are specified, the
+# default includes are used. If ACTION-IF-SIGNED is given, it is
+# additional shell code to execute when the type is signed. If
+# ACTION-IF-UNSIGNED is given, it is executed when the type is unsigned.
+#
+# This macro assumes that the type exists. Therefore the existence of the
+# type should be checked before calling this macro. For example:
+#
+# AC_CHECK_HEADERS([wchar.h])
+# AC_CHECK_TYPE([wchar_t],,[ AC_MSG_ERROR([Type wchar_t not found.]) ])
+# AX_CHECK_SIGN([wchar_t],
+# [ AC_DEFINE(WCHAR_T_SIGNED, 1, [Define if wchar_t is signed]) ],
+# [ AC_DEFINE(WCHAR_T_UNSIGNED, 1, [Define if wchar_t is unsigned]) ], [
+# #ifdef HAVE_WCHAR_H
+# #include <wchar.h>
+# #endif
+# ])
+#
+# LICENSE
+#
+# Copyright (c) 2008 Ville Laurikari <vl@iki.fi>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 8
+
+AU_ALIAS([VL_CHECK_SIGN], [AX_CHECK_SIGN])
+AC_DEFUN([AX_CHECK_SIGN], [
+ typename=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g"`
+ AC_CACHE_CHECK([whether $1 is signed], ax_cv_decl_${typename}_signed, [
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[$4]],
+ [[ int foo @<:@ 1 - 2 * !((($1) -1) < 0) @:>@ ]])],
+ [ eval "ax_cv_decl_${typename}_signed=\"yes\"" ],
+ [ eval "ax_cv_decl_${typename}_signed=\"no\"" ])
+ ])
+ symbolname=`echo $1 | sed "s/@<:@^a-zA-Z0-9_@:>@/_/g" | tr "a-z" "A-Z"`
+ if eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"yes\""; then
+ $2
+ elif eval "test \"\${ax_cv_decl_${typename}_signed}\" = \"no\""; then
+ $3
+ fi
+])dnl
diff --git a/m4/ax_compile_check_sizeof.m4 b/m4/ax_compile_check_sizeof.m4
new file mode 100644
index 0000000..f834df6
--- /dev/null
+++ b/m4/ax_compile_check_sizeof.m4
@@ -0,0 +1,115 @@
+# ============================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_compile_check_sizeof.html
+# ============================================================================
+#
+# SYNOPSIS
+#
+# AX_COMPILE_CHECK_SIZEOF(TYPE [, HEADERS [, EXTRA_SIZES...]])
+#
+# DESCRIPTION
+#
+# This macro checks for the size of TYPE using compile checks, not run
+# checks. You can supply extra HEADERS to look into. the check will cycle
+# through 1 2 4 8 16 and any EXTRA_SIZES the user supplies. If a match is
+# found, it will #define SIZEOF_`TYPE' to that value. Otherwise it will
+# emit a configure time error indicating the size of the type could not be
+# determined.
+#
+# The trick is that C will not allow duplicate case labels. While this is
+# valid C code:
+#
+# switch (0) case 0: case 1:;
+#
+# The following is not:
+#
+# switch (0) case 0: case 0:;
+#
+# Thus, the AC_COMPILE_IFELSE will fail if the currently tried size does
+# not match.
+#
+# Here is an example skeleton configure.in script, demonstrating the
+# macro's usage:
+#
+# AC_PROG_CC
+# AC_CHECK_HEADERS(stddef.h unistd.h)
+# AC_TYPE_SIZE_T
+# AC_CHECK_TYPE(ssize_t, int)
+#
+# headers='#ifdef HAVE_STDDEF_H
+# #include <stddef.h>
+# #endif
+# #ifdef HAVE_UNISTD_H
+# #include <unistd.h>
+# #endif
+# '
+#
+# AX_COMPILE_CHECK_SIZEOF(char)
+# AX_COMPILE_CHECK_SIZEOF(short)
+# AX_COMPILE_CHECK_SIZEOF(int)
+# AX_COMPILE_CHECK_SIZEOF(long)
+# AX_COMPILE_CHECK_SIZEOF(unsigned char *)
+# AX_COMPILE_CHECK_SIZEOF(void *)
+# AX_COMPILE_CHECK_SIZEOF(size_t, $headers)
+# AX_COMPILE_CHECK_SIZEOF(ssize_t, $headers)
+# AX_COMPILE_CHECK_SIZEOF(ptrdiff_t, $headers)
+# AX_COMPILE_CHECK_SIZEOF(off_t, $headers)
+#
+# LICENSE
+#
+# Copyright (c) 2008 Kaveh Ghazi <ghazi@caip.rutgers.edu>
+# Copyright (c) 2017 Reini Urban <rurban@cpan.org>
+#
+# 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 <https://www.gnu.org/licenses/>.
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 8
+
+AU_ALIAS([AC_COMPILE_CHECK_SIZEOF], [AX_COMPILE_CHECK_SIZEOF])
+AC_DEFUN([AX_COMPILE_CHECK_SIZEOF],
+[changequote(<<, >>)dnl
+dnl The name to #define.
+define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
+dnl The cache variable name.
+define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
+changequote([, ])dnl
+AC_MSG_CHECKING(size of $1)
+AC_CACHE_VAL(AC_CV_NAME,
+[for ac_size in 4 8 1 2 16 $3 ; do # List sizes in rough order of prevalence.
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+$2
+]], [[switch (0) case 0: case (sizeof ($1) == $ac_size):;]])], [AC_CV_NAME=$ac_size])
+ if test x$AC_CV_NAME != x ; then break; fi
+done
+])
+if test x$AC_CV_NAME = x ; then
+ AC_MSG_ERROR([cannot determine a size for $1])
+fi
+AC_MSG_RESULT($AC_CV_NAME)
+AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
+undefine([AC_TYPE_NAME])dnl
+undefine([AC_CV_NAME])dnl
+])
diff --git a/m4/ax_cxx_compile_stdcxx.m4 b/m4/ax_cxx_compile_stdcxx.m4
new file mode 100644
index 0000000..43087b2
--- /dev/null
+++ b/m4/ax_cxx_compile_stdcxx.m4
@@ -0,0 +1,951 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
+#
+# DESCRIPTION
+#
+# Check for baseline language coverage in the compiler for the specified
+# version of the C++ standard. If necessary, add switches to CXX and
+# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
+# or '14' (for the C++14 standard).
+#
+# The second argument, if specified, indicates whether you insist on an
+# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
+# -std=c++11). If neither is specified, you get whatever works, with
+# preference for an extended mode.
+#
+# The third argument, if specified 'mandatory' or if left unspecified,
+# indicates that baseline support for the specified C++ standard is
+# required and that the macro should error out if no mode with that
+# support is found. If specified 'optional', then configuration proceeds
+# regardless, after defining HAVE_CXX${VERSION} if and only if a
+# supporting mode is found.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
+# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
+# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
+# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
+# Copyright (c) 2015 Paul Norman <penorman@mac.com>
+# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
+# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
+# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 11
+
+dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
+dnl (serial version number 13).
+
+AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
+ m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
+ [$1], [14], [ax_cxx_compile_alternatives="14 1y"],
+ [$1], [17], [ax_cxx_compile_alternatives="17 1z"],
+ [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
+ m4_if([$2], [], [],
+ [$2], [ext], [],
+ [$2], [noext], [],
+ [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
+ m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
+ [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
+ [$3], [optional], [ax_cxx_compile_cxx$1_required=false],
+ [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
+ AC_LANG_PUSH([C++])dnl
+ ac_success=no
+
+ m4_if([$2], [noext], [], [dnl
+ if test x$ac_success = xno; then
+ for alternative in ${ax_cxx_compile_alternatives}; do
+ switch="-std=gnu++${alternative}"
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
+ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
+ $cachevar,
+ [ac_save_CXX="$CXX"
+ CXX="$CXX $switch"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
+ [eval $cachevar=yes],
+ [eval $cachevar=no])
+ CXX="$ac_save_CXX"])
+ if eval test x\$$cachevar = xyes; then
+ CXX="$CXX $switch"
+ if test -n "$CXXCPP" ; then
+ CXXCPP="$CXXCPP $switch"
+ fi
+ ac_success=yes
+ break
+ fi
+ done
+ fi])
+
+ m4_if([$2], [ext], [], [dnl
+ if test x$ac_success = xno; then
+ dnl HP's aCC needs +std=c++11 according to:
+ dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
+ dnl Cray's crayCC needs "-h std=c++11"
+ for alternative in ${ax_cxx_compile_alternatives}; do
+ for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
+ cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
+ AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
+ $cachevar,
+ [ac_save_CXX="$CXX"
+ CXX="$CXX $switch"
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
+ [eval $cachevar=yes],
+ [eval $cachevar=no])
+ CXX="$ac_save_CXX"])
+ if eval test x\$$cachevar = xyes; then
+ CXX="$CXX $switch"
+ if test -n "$CXXCPP" ; then
+ CXXCPP="$CXXCPP $switch"
+ fi
+ ac_success=yes
+ break
+ fi
+ done
+ if test x$ac_success = xyes; then
+ break
+ fi
+ done
+ fi])
+ AC_LANG_POP([C++])
+ if test x$ax_cxx_compile_cxx$1_required = xtrue; then
+ if test x$ac_success = xno; then
+ AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
+ fi
+ fi
+ if test x$ac_success = xno; then
+ HAVE_CXX$1=0
+ AC_MSG_NOTICE([No compiler with C++$1 support was found])
+ else
+ HAVE_CXX$1=1
+ AC_DEFINE(HAVE_CXX$1,1,
+ [define if the compiler supports basic C++$1 syntax])
+ fi
+ AC_SUBST(HAVE_CXX$1)
+])
+
+
+dnl Test body for checking C++11 support
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
+)
+
+
+dnl Test body for checking C++14 support
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
+)
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14
+ _AX_CXX_COMPILE_STDCXX_testbody_new_in_17
+)
+
+dnl Tests for new features in C++11
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
+
+// If the compiler admits that it is not ready for C++11, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201103L
+
+#error "This is not a C++11 compiler"
+
+#else
+
+namespace cxx11
+{
+
+ namespace test_static_assert
+ {
+
+ template <typename T>
+ struct check
+ {
+ static_assert(sizeof(int) <= sizeof(T), "not big enough");
+ };
+
+ }
+
+ namespace test_final_override
+ {
+
+ struct Base
+ {
+ virtual ~Base() {}
+ virtual void f() {}
+ };
+
+ struct Derived : public Base
+ {
+ virtual ~Derived() override {}
+ virtual void f() override {}
+ };
+
+ }
+
+ namespace test_double_right_angle_brackets
+ {
+
+ template < typename T >
+ struct check {};
+
+ typedef check<void> single_type;
+ typedef check<check<void>> double_type;
+ typedef check<check<check<void>>> triple_type;
+ typedef check<check<check<check<void>>>> quadruple_type;
+
+ }
+
+ namespace test_decltype
+ {
+
+ int
+ f()
+ {
+ int a = 1;
+ decltype(a) b = 2;
+ return a + b;
+ }
+
+ }
+
+ namespace test_type_deduction
+ {
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static const bool value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static const bool value = true;
+ };
+
+ template < typename T1, typename T2 >
+ auto
+ add(T1 a1, T2 a2) -> decltype(a1 + a2)
+ {
+ return a1 + a2;
+ }
+
+ int
+ test(const int c, volatile int v)
+ {
+ static_assert(is_same<int, decltype(0)>::value == true, "");
+ static_assert(is_same<int, decltype(c)>::value == false, "");
+ static_assert(is_same<int, decltype(v)>::value == false, "");
+ auto ac = c;
+ auto av = v;
+ auto sumi = ac + av + 'x';
+ auto sumf = ac + av + 1.0;
+ static_assert(is_same<int, decltype(ac)>::value == true, "");
+ static_assert(is_same<int, decltype(av)>::value == true, "");
+ static_assert(is_same<int, decltype(sumi)>::value == true, "");
+ static_assert(is_same<int, decltype(sumf)>::value == false, "");
+ static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
+ return (sumf > 0.0) ? sumi : add(c, v);
+ }
+
+ }
+
+ namespace test_noexcept
+ {
+
+ int f() { return 0; }
+ int g() noexcept { return 0; }
+
+ static_assert(noexcept(f()) == false, "");
+ static_assert(noexcept(g()) == true, "");
+
+ }
+
+ namespace test_constexpr
+ {
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
+ {
+ return *s ? strlen_c_r(s + 1, acc + 1) : acc;
+ }
+
+ template < typename CharT >
+ unsigned long constexpr
+ strlen_c(const CharT *const s) noexcept
+ {
+ return strlen_c_r(s, 0UL);
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("1") == 1UL, "");
+ static_assert(strlen_c("example") == 7UL, "");
+ static_assert(strlen_c("another\0example") == 7UL, "");
+
+ }
+
+ namespace test_rvalue_references
+ {
+
+ template < int N >
+ struct answer
+ {
+ static constexpr int value = N;
+ };
+
+ answer<1> f(int&) { return answer<1>(); }
+ answer<2> f(const int&) { return answer<2>(); }
+ answer<3> f(int&&) { return answer<3>(); }
+
+ void
+ test()
+ {
+ int i = 0;
+ const int c = 0;
+ static_assert(decltype(f(i))::value == 1, "");
+ static_assert(decltype(f(c))::value == 2, "");
+ static_assert(decltype(f(0))::value == 3, "");
+ }
+
+ }
+
+ namespace test_uniform_initialization
+ {
+
+ struct test
+ {
+ static const int zero {};
+ static const int one {1};
+ };
+
+ static_assert(test::zero == 0, "");
+ static_assert(test::one == 1, "");
+
+ }
+
+ namespace test_lambdas
+ {
+
+ void
+ test1()
+ {
+ auto lambda1 = [](){};
+ auto lambda2 = lambda1;
+ lambda1();
+ lambda2();
+ }
+
+ int
+ test2()
+ {
+ auto a = [](int i, int j){ return i + j; }(1, 2);
+ auto b = []() -> int { return '0'; }();
+ auto c = [=](){ return a + b; }();
+ auto d = [&](){ return c; }();
+ auto e = [a, &b](int x) mutable {
+ const auto identity = [](int y){ return y; };
+ for (auto i = 0; i < a; ++i)
+ a += b--;
+ return x + identity(a + b);
+ }(0);
+ return a + b + c + d + e;
+ }
+
+ int
+ test3()
+ {
+ const auto nullary = [](){ return 0; };
+ const auto unary = [](int x){ return x; };
+ using nullary_t = decltype(nullary);
+ using unary_t = decltype(unary);
+ const auto higher1st = [](nullary_t f){ return f(); };
+ const auto higher2nd = [unary](nullary_t f1){
+ return [unary, f1](unary_t f2){ return f2(unary(f1())); };
+ };
+ return higher1st(nullary) + higher2nd(nullary)(unary);
+ }
+
+ }
+
+ namespace test_variadic_templates
+ {
+
+ template <int...>
+ struct sum;
+
+ template <int N0, int... N1toN>
+ struct sum<N0, N1toN...>
+ {
+ static constexpr auto value = N0 + sum<N1toN...>::value;
+ };
+
+ template <>
+ struct sum<>
+ {
+ static constexpr auto value = 0;
+ };
+
+ static_assert(sum<>::value == 0, "");
+ static_assert(sum<1>::value == 1, "");
+ static_assert(sum<23>::value == 23, "");
+ static_assert(sum<1, 2>::value == 3, "");
+ static_assert(sum<5, 5, 11>::value == 21, "");
+ static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
+
+ }
+
+ // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
+ // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
+ // because of this.
+ namespace test_template_alias_sfinae
+ {
+
+ struct foo {};
+
+ template<typename T>
+ using member = typename T::member_type;
+
+ template<typename T>
+ void func(...) {}
+
+ template<typename T>
+ void func(member<T>*) {}
+
+ void test();
+
+ void test() { func<foo>(0); }
+
+ }
+
+} // namespace cxx11
+
+#endif // __cplusplus >= 201103L
+
+]])
+
+
+dnl Tests for new features in C++14
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
+
+// If the compiler admits that it is not ready for C++14, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201402L
+
+#error "This is not a C++14 compiler"
+
+#else
+
+namespace cxx14
+{
+
+ namespace test_polymorphic_lambdas
+ {
+
+ int
+ test()
+ {
+ const auto lambda = [](auto&&... args){
+ const auto istiny = [](auto x){
+ return (sizeof(x) == 1UL) ? 1 : 0;
+ };
+ const int aretiny[] = { istiny(args)... };
+ return aretiny[0];
+ };
+ return lambda(1, 1L, 1.0f, '1');
+ }
+
+ }
+
+ namespace test_binary_literals
+ {
+
+ constexpr auto ivii = 0b0000000000101010;
+ static_assert(ivii == 42, "wrong value");
+
+ }
+
+ namespace test_generalized_constexpr
+ {
+
+ template < typename CharT >
+ constexpr unsigned long
+ strlen_c(const CharT *const s) noexcept
+ {
+ auto length = 0UL;
+ for (auto p = s; *p; ++p)
+ ++length;
+ return length;
+ }
+
+ static_assert(strlen_c("") == 0UL, "");
+ static_assert(strlen_c("x") == 1UL, "");
+ static_assert(strlen_c("test") == 4UL, "");
+ static_assert(strlen_c("another\0test") == 7UL, "");
+
+ }
+
+ namespace test_lambda_init_capture
+ {
+
+ int
+ test()
+ {
+ auto x = 0;
+ const auto lambda1 = [a = x](int b){ return a + b; };
+ const auto lambda2 = [a = lambda1(x)](){ return a; };
+ return lambda2();
+ }
+
+ }
+
+ namespace test_digit_separators
+ {
+
+ constexpr auto ten_million = 100'000'000;
+ static_assert(ten_million == 100000000, "");
+
+ }
+
+ namespace test_return_type_deduction
+ {
+
+ auto f(int& x) { return x; }
+ decltype(auto) g(int& x) { return x; }
+
+ template < typename T1, typename T2 >
+ struct is_same
+ {
+ static constexpr auto value = false;
+ };
+
+ template < typename T >
+ struct is_same<T, T>
+ {
+ static constexpr auto value = true;
+ };
+
+ int
+ test()
+ {
+ auto x = 0;
+ static_assert(is_same<int, decltype(f(x))>::value, "");
+ static_assert(is_same<int&, decltype(g(x))>::value, "");
+ return x;
+ }
+
+ }
+
+} // namespace cxx14
+
+#endif // __cplusplus >= 201402L
+
+]])
+
+
+dnl Tests for new features in C++17
+
+m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
+
+// If the compiler admits that it is not ready for C++17, why torture it?
+// Hopefully, this will speed up the test.
+
+#ifndef __cplusplus
+
+#error "This is not a C++ compiler"
+
+#elif __cplusplus < 201703L
+
+#error "This is not a C++17 compiler"
+
+#else
+
+#include <initializer_list>
+#include <utility>
+#include <type_traits>
+
+namespace cxx17
+{
+
+ namespace test_constexpr_lambdas
+ {
+
+ constexpr int foo = [](){return 42;}();
+
+ }
+
+ namespace test::nested_namespace::definitions
+ {
+
+ }
+
+ namespace test_fold_expression
+ {
+
+ template<typename... Args>
+ int multiply(Args... args)
+ {
+ return (args * ... * 1);
+ }
+
+ template<typename... Args>
+ bool all(Args... args)
+ {
+ return (args && ...);
+ }
+
+ }
+
+ namespace test_extended_static_assert
+ {
+
+ static_assert (true);
+
+ }
+
+ namespace test_auto_brace_init_list
+ {
+
+ auto foo = {5};
+ auto bar {5};
+
+ static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
+ static_assert(std::is_same<int, decltype(bar)>::value);
+ }
+
+ namespace test_typename_in_template_template_parameter
+ {
+
+ template<template<typename> typename X> struct D;
+
+ }
+
+ namespace test_fallthrough_nodiscard_maybe_unused_attributes
+ {
+
+ int f1()
+ {
+ return 42;
+ }
+
+ [[nodiscard]] int f2()
+ {
+ [[maybe_unused]] auto unused = f1();
+
+ switch (f1())
+ {
+ case 17:
+ f1();
+ [[fallthrough]];
+ case 42:
+ f1();
+ }
+ return f1();
+ }
+
+ }
+
+ namespace test_extended_aggregate_initialization
+ {
+
+ struct base1
+ {
+ int b1, b2 = 42;
+ };
+
+ struct base2
+ {
+ base2() {
+ b3 = 42;
+ }
+ int b3;
+ };
+
+ struct derived : base1, base2
+ {
+ int d;
+ };
+
+ derived d1 {{1, 2}, {}, 4}; // full initialization
+ derived d2 {{}, {}, 4}; // value-initialized bases
+
+ }
+
+ namespace test_general_range_based_for_loop
+ {
+
+ struct iter
+ {
+ int i;
+
+ int& operator* ()
+ {
+ return i;
+ }
+
+ const int& operator* () const
+ {
+ return i;
+ }
+
+ iter& operator++()
+ {
+ ++i;
+ return *this;
+ }
+ };
+
+ struct sentinel
+ {
+ int i;
+ };
+
+ bool operator== (const iter& i, const sentinel& s)
+ {
+ return i.i == s.i;
+ }
+
+ bool operator!= (const iter& i, const sentinel& s)
+ {
+ return !(i == s);
+ }
+
+ struct range
+ {
+ iter begin() const
+ {
+ return {0};
+ }
+
+ sentinel end() const
+ {
+ return {5};
+ }
+ };
+
+ void f()
+ {
+ range r {};
+
+ for (auto i : r)
+ {
+ [[maybe_unused]] auto v = i;
+ }
+ }
+
+ }
+
+ namespace test_lambda_capture_asterisk_this_by_value
+ {
+
+ struct t
+ {
+ int i;
+ int foo()
+ {
+ return [*this]()
+ {
+ return i;
+ }();
+ }
+ };
+
+ }
+
+ namespace test_enum_class_construction
+ {
+
+ enum class byte : unsigned char
+ {};
+
+ byte foo {42};
+
+ }
+
+ namespace test_constexpr_if
+ {
+
+ template <bool cond>
+ int f ()
+ {
+ if constexpr(cond)
+ {
+ return 13;
+ }
+ else
+ {
+ return 42;
+ }
+ }
+
+ }
+
+ namespace test_selection_statement_with_initializer
+ {
+
+ int f()
+ {
+ return 13;
+ }
+
+ int f2()
+ {
+ if (auto i = f(); i > 0)
+ {
+ return 3;
+ }
+
+ switch (auto i = f(); i + 4)
+ {
+ case 17:
+ return 2;
+
+ default:
+ return 1;
+ }
+ }
+
+ }
+
+ namespace test_template_argument_deduction_for_class_templates
+ {
+
+ template <typename T1, typename T2>
+ struct pair
+ {
+ pair (T1 p1, T2 p2)
+ : m1 {p1},
+ m2 {p2}
+ {}
+
+ T1 m1;
+ T2 m2;
+ };
+
+ void f()
+ {
+ [[maybe_unused]] auto p = pair{13, 42u};
+ }
+
+ }
+
+ namespace test_non_type_auto_template_parameters
+ {
+
+ template <auto n>
+ struct B
+ {};
+
+ B<5> b1;
+ B<'a'> b2;
+
+ }
+
+ namespace test_structured_bindings
+ {
+
+ int arr[2] = { 1, 2 };
+ std::pair<int, int> pr = { 1, 2 };
+
+ auto f1() -> int(&)[2]
+ {
+ return arr;
+ }
+
+ auto f2() -> std::pair<int, int>&
+ {
+ return pr;
+ }
+
+ struct S
+ {
+ int x1 : 2;
+ volatile double y1;
+ };
+
+ S f3()
+ {
+ return {};
+ }
+
+ auto [ x1, y1 ] = f1();
+ auto& [ xr1, yr1 ] = f1();
+ auto [ x2, y2 ] = f2();
+ auto& [ xr2, yr2 ] = f2();
+ const auto [ x3, y3 ] = f3();
+
+ }
+
+ namespace test_exception_spec_type_system
+ {
+
+ struct Good {};
+ struct Bad {};
+
+ void g1() noexcept;
+ void g2();
+
+ template<typename T>
+ Bad
+ f(T*, T*);
+
+ template<typename T1, typename T2>
+ Good
+ f(T1*, T2*);
+
+ static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
+
+ }
+
+ namespace test_inline_variables
+ {
+
+ template<class T> void f(T)
+ {}
+
+ template<class T> inline T g(T)
+ {
+ return T{};
+ }
+
+ template<> inline void f<>(int)
+ {}
+
+ template<> int g<>(int)
+ {
+ return 5;
+ }
+
+ }
+
+} // namespace cxx17
+
+#endif // __cplusplus < 201703L
+
+]])
diff --git a/m4/ax_cxx_compile_stdcxx_17.m4 b/m4/ax_cxx_compile_stdcxx_17.m4
new file mode 100644
index 0000000..a683417
--- /dev/null
+++ b/m4/ax_cxx_compile_stdcxx_17.m4
@@ -0,0 +1,35 @@
+# =============================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_17.html
+# =============================================================================
+#
+# SYNOPSIS
+#
+# AX_CXX_COMPILE_STDCXX_17([ext|noext], [mandatory|optional])
+#
+# DESCRIPTION
+#
+# Check for baseline language coverage in the compiler for the C++17
+# standard; if necessary, add switches to CXX and CXXCPP to enable
+# support.
+#
+# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX
+# macro with the version set to C++17. The two optional arguments are
+# forwarded literally as the second and third argument respectively.
+# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for
+# more information. If you want to use this macro, you also need to
+# download the ax_cxx_compile_stdcxx.m4 file.
+#
+# LICENSE
+#
+# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
+# Copyright (c) 2016 Krzesimir Nowak <qdlacz@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 2
+
+AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX])
+AC_DEFUN([AX_CXX_COMPILE_STDCXX_17], [AX_CXX_COMPILE_STDCXX([17], [$1], [$2])])
diff --git a/m4/ax_python_module.m4 b/m4/ax_python_module.m4
new file mode 100644
index 0000000..f0f873d
--- /dev/null
+++ b/m4/ax_python_module.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_python_module.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PYTHON_MODULE(modname[, fatal, python])
+#
+# DESCRIPTION
+#
+# Checks for Python module.
+#
+# If fatal is non-empty then absence of a module will trigger an error.
+# The third parameter can either be "python" for Python 2 or "python3" for
+# Python 3; defaults to Python 3.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Andrew Collier
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 9
+
+AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
+AC_DEFUN([AX_PYTHON_MODULE],[
+ if test -z $PYTHON;
+ then
+ if test -z "$3";
+ then
+ PYTHON="python3"
+ else
+ PYTHON="$3"
+ fi
+ fi
+ PYTHON_NAME=`basename $PYTHON`
+ AC_MSG_CHECKING($PYTHON_NAME module: $1)
+ $PYTHON -c "import $1" 2>/dev/null
+ if test $? -eq 0;
+ then
+ AC_MSG_RESULT(yes)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
+ else
+ AC_MSG_RESULT(no)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=no
+ #
+ if test -n "$2"
+ then
+ AC_MSG_ERROR(failed to find required module $1)
+ exit 1
+ fi
+ fi
+])
diff --git a/m4/boost.m4 b/m4/boost.m4
new file mode 100644
index 0000000..868899d
--- /dev/null
+++ b/m4/boost.m4
@@ -0,0 +1,1834 @@
+# boost.m4: Locate Boost headers and libraries for autoconf-based projects.
+# Copyright (C) 2007-2011, 2014 Benoit Sigoure <tsuna@lrde.epita.fr>
+#
+# 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.
+#
+# Additional permission under section 7 of the GNU General Public
+# License, version 3 ("GPLv3"):
+#
+# If you convey this file as part of a work that contains a
+# configuration script generated by Autoconf, you may do so under
+# terms of your choice.
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+m4_define([_BOOST_SERIAL], [m4_translit([
+# serial 36
+], [#
+], [])])
+
+# Original sources can be found at http://github.com/tsuna/boost.m4
+# You can fetch the latest version of the script by doing:
+# wget http://github.com/tsuna/boost.m4/raw/master/build-aux/boost.m4
+
+# ------ #
+# README #
+# ------ #
+
+# This file provides several macros to use the various Boost libraries.
+# The first macro is BOOST_REQUIRE. It will simply check if it's possible to
+# find the Boost headers of a given (optional) minimum version and it will
+# define BOOST_CPPFLAGS accordingly. It will add an option --with-boost to
+# your configure so that users can specify non standard locations.
+# If the user's environment contains BOOST_ROOT and --with-boost was not
+# specified, --with-boost=$BOOST_ROOT is implicitly used.
+# For more README and documentation, go to http://github.com/tsuna/boost.m4
+# Note: THESE MACROS ASSUME THAT YOU USE LIBTOOL. If you don't, don't worry,
+# simply read the README, it will show you what to do step by step.
+
+m4_pattern_forbid([^_?(BOOST|Boost)_])
+
+
+# _BOOST_SED_CPP(SED-PROGRAM, PROGRAM,
+# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
+# Same as AC_EGREP_CPP, but leave the result in conftest.i.
+#
+# SED-PROGRAM is *not* overquoted, as in AC_EGREP_CPP. It is expanded
+# in double-quotes, so escape your double quotes.
+#
+# It could be useful to turn this into a macro which extracts the
+# value of any macro.
+m4_define([_BOOST_SED_CPP],
+[AC_LANG_PUSH([C++])dnl
+AC_LANG_PREPROC_REQUIRE()dnl
+AC_REQUIRE([AC_PROG_SED])dnl
+AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
+AS_IF([dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+dnl Beware of Windows end-of-lines, for instance if we are running
+dnl some Windows programs under Wine. In that case, boost/version.hpp
+dnl is certainly using "\r\n", but the regular Unix shell will only
+dnl strip `\n' with backquotes, not the `\r'. This results in
+dnl boost_cv_lib_version='1_37\r' for instance, which breaks
+dnl everything else.
+dnl Cannot use 'dnl' after [$4] because a trailing dnl may break AC_CACHE_CHECK
+dnl
+dnl Beware that GCC 5, when expanding macros, may embed # line directives
+dnl a within single line:
+dnl
+dnl # 1 "conftest.cc"
+dnl # 1 "<built-in>"
+dnl # 1 "<command-line>"
+dnl # 1 "conftest.cc"
+dnl # 1 "/opt/local/include/boost/version.hpp" 1 3
+dnl # 2 "conftest.cc" 2
+dnl boost-lib-version =
+dnl # 2 "conftest.cc" 3
+dnl "1_56"
+dnl
+dnl So get rid of the # and empty lines, and glue the remaining ones together.
+(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ grep -v '#' |
+ grep -v '^[[[:space:]]]*$' |
+ tr -d '\r' |
+ tr -s '\n' ' ' |
+ $SED -n -e "$1" >conftest.i 2>&1],
+ [$3],
+ [$4])
+rm -rf conftest*
+AC_LANG_POP([C++])dnl
+])# _BOOST_SED_CPP
+
+
+
+# BOOST_REQUIRE([VERSION], [ACTION-IF-NOT-FOUND])
+# -----------------------------------------------
+# Look for Boost. If version is given, it must either be a literal of the form
+# "X.Y.Z" where X, Y and Z are integers (the ".Z" part being optional) or a
+# variable "$var".
+# Defines the value BOOST_CPPFLAGS. This macro only checks for headers with
+# the required version, it does not check for any of the Boost libraries.
+# On # success, defines HAVE_BOOST. On failure, calls the optional
+# ACTION-IF-NOT-FOUND action if one was supplied.
+# Otherwise aborts with an error message.
+AC_DEFUN_ONCE([BOOST_REQUIRE],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_PROG_GREP])dnl
+echo "$as_me: this is boost.m4[]_BOOST_SERIAL" >&AS_MESSAGE_LOG_FD
+boost_save_IFS=$IFS
+boost_version_req=$1
+IFS=.
+set x $boost_version_req 0 0 0
+IFS=$boost_save_IFS
+shift
+boost_version_req=`expr "$[1]" '*' 100000 + "$[2]" '*' 100 + "$[3]"`
+boost_version_req_string=$[1].$[2].$[3]
+AC_ARG_WITH([boost],
+ [AS_HELP_STRING([--with-boost=DIR],
+ [prefix of Boost $1 @<:@guess@:>@])])dnl
+AC_ARG_VAR([BOOST_ROOT],[Location of Boost installation])dnl
+# If BOOST_ROOT is set and the user has not provided a value to
+# --with-boost, then treat BOOST_ROOT as if it the user supplied it.
+if test x"$BOOST_ROOT" != x; then
+ if test x"$with_boost" = x; then
+ AC_MSG_NOTICE([Detected BOOST_ROOT; continuing with --with-boost=$BOOST_ROOT])
+ with_boost=$BOOST_ROOT
+ else
+ AC_MSG_NOTICE([Detected BOOST_ROOT=$BOOST_ROOT, but overridden by --with-boost=$with_boost])
+ fi
+fi
+AC_SUBST([DISTCHECK_CONFIGURE_FLAGS],
+ ["$DISTCHECK_CONFIGURE_FLAGS '--with-boost=$with_boost'"])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+ AC_CACHE_CHECK([for Boost headers version >= $boost_version_req_string],
+ [boost_cv_inc_path],
+ [boost_cv_inc_path=no
+AC_LANG_PUSH([C++])dnl
+m4_pattern_allow([^BOOST_VERSION$])dnl
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([[#include <boost/version.hpp>
+#if !defined BOOST_VERSION
+# error BOOST_VERSION is not defined
+#elif BOOST_VERSION < $boost_version_req
+# error Boost headers version < $boost_version_req
+#endif
+]])])
+ # If the user provided a value to --with-boost, use it and only it.
+ case $with_boost in #(
+ ''|yes) set x '' /opt/local/include /usr/local/include /opt/include \
+ /usr/include C:/Boost/include;; #(
+ *) set x "$with_boost/include" "$with_boost";;
+ esac
+ shift
+ for boost_dir
+ do
+ # Without --layout=system, Boost (or at least some versions) installs
+ # itself in <prefix>/include/boost-<version>. This inner loop helps to
+ # find headers in such directories.
+ #
+ # Any ${boost_dir}/boost-x_xx directories are searched in reverse version
+ # order followed by ${boost_dir}. The final '.' is a sentinel for
+ # searching $boost_dir" itself. Entries are whitespace separated.
+ #
+ # I didn't indent this loop on purpose (to avoid over-indented code)
+ boost_layout_system_search_list=`cd "$boost_dir" 2>/dev/null \
+ && ls -1 | "${GREP}" '^boost-' | sort -rn -t- -k2 \
+ && echo .`
+ for boost_inc in $boost_layout_system_search_list
+ do
+ if test x"$boost_inc" != x.; then
+ boost_inc="$boost_dir/$boost_inc"
+ else
+ boost_inc="$boost_dir" # Uses sentinel in boost_layout_system_search_list
+ fi
+ if test x"$boost_inc" != x; then
+ # We are going to check whether the version of Boost installed
+ # in $boost_inc is usable by running a compilation that
+ # #includes it. But if we pass a -I/some/path in which Boost
+ # is not installed, the compiler will just skip this -I and
+ # use other locations (either from CPPFLAGS, or from its list
+ # of system include directories). As a result we would use
+ # header installed on the machine instead of the /some/path
+ # specified by the user. So in that precise case (trying
+ # $boost_inc), make sure the version.hpp exists.
+ #
+ # Use test -e as there can be symlinks.
+ test -e "$boost_inc/boost/version.hpp" || continue
+ CPPFLAGS="$CPPFLAGS -I$boost_inc"
+ fi
+ AC_COMPILE_IFELSE([], [boost_cv_inc_path=yes], [boost_cv_version=no])
+ if test x"$boost_cv_inc_path" = xyes; then
+ if test x"$boost_inc" != x; then
+ boost_cv_inc_path=$boost_inc
+ fi
+ break 2
+ fi
+ done
+ done
+AC_LANG_POP([C++])dnl
+ ])
+ case $boost_cv_inc_path in #(
+ no)
+ boost_errmsg="cannot find Boost headers version >= $boost_version_req_string"
+ m4_if([$2], [], [AC_MSG_ERROR([$boost_errmsg])],
+ [AC_MSG_NOTICE([$boost_errmsg])])
+ $2
+ ;;#(
+ yes)
+ BOOST_CPPFLAGS=
+ ;;#(
+ *)
+ AC_SUBST([BOOST_CPPFLAGS], ["-I$boost_cv_inc_path"])dnl
+ ;;
+ esac
+ if test x"$boost_cv_inc_path" != xno; then
+ AC_DEFINE([HAVE_BOOST], [1],
+ [Defined if the requested minimum BOOST version is satisfied])
+ AC_CACHE_CHECK([for Boost's header version],
+ [boost_cv_lib_version],
+ [m4_pattern_allow([^BOOST_LIB_VERSION$])dnl
+ _BOOST_SED_CPP([[/^boost-lib-version = /{s///;s/[\" ]//g;p;q;}]],
+ [#include <boost/version.hpp>
+boost-lib-version = BOOST_LIB_VERSION],
+ [boost_cv_lib_version=`cat conftest.i`])])
+ # e.g. "134" for 1_34_1 or "135" for 1_35
+ boost_major_version=`echo "$boost_cv_lib_version" | sed 's/_//;s/_.*//'`
+ case $boost_major_version in #(
+ '' | *[[!0-9]]*)
+ AC_MSG_ERROR([invalid value: boost_major_version='$boost_major_version'])
+ ;;
+ esac
+fi
+CPPFLAGS=$boost_save_CPPFLAGS
+])# BOOST_REQUIRE
+
+
+# BOOST_STATIC()
+# --------------
+# Add the "--enable-static-boost" configure argument. If this argument is given
+# on the command line, static versions of the libraries will be looked up.
+AC_DEFUN([BOOST_STATIC],
+ [AC_ARG_ENABLE([static-boost],
+ [AS_HELP_STRING([--enable-static-boost],
+ [Prefer the static boost libraries over the shared ones [no]])],
+ [enable_static_boost=yes],
+ [enable_static_boost=no])])# BOOST_STATIC
+
+
+# BOOST_FIND_HEADER([HEADER-NAME], [ACTION-IF-NOT-FOUND], [ACTION-IF-FOUND])
+# --------------------------------------------------------------------------
+# Wrapper around AC_CHECK_HEADER for Boost headers. Useful to check for
+# some parts of the Boost library which are only made of headers and don't
+# require linking (such as Boost.Foreach).
+#
+# Default ACTION-IF-NOT-FOUND: Fail with a fatal error unless Boost couldn't be
+# found in the first place, in which case by default a notice is issued to the
+# user. Presumably if we haven't died already it's because it's OK to not have
+# Boost, which is why only a notice is issued instead of a hard error.
+#
+# Default ACTION-IF-FOUND: define the preprocessor symbol HAVE_<HEADER-NAME> in
+# case of success # (where HEADER-NAME is written LIKE_THIS, e.g.,
+# HAVE_BOOST_FOREACH_HPP).
+AC_DEFUN([BOOST_FIND_HEADER],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ m4_default([$2], [AC_MSG_NOTICE([Boost not available, not searching for $1])])
+else
+AC_LANG_PUSH([C++])dnl
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CHECK_HEADER([$1],
+ [m4_default([$3], [AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1],
+ [Define to 1 if you have <$1>])])],
+ [m4_default([$2], [AC_MSG_ERROR([cannot find $1])])])
+CPPFLAGS=$boost_save_CPPFLAGS
+AC_LANG_POP([C++])dnl
+fi
+])# BOOST_FIND_HEADER
+
+
+# BOOST_FIND_LIBS([COMPONENT-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE], [CXX-POST-INCLUDE-PROLOGUE],
+# [ERROR_ON_UNUSABLE])
+# --------------------------------------------------------------
+# Look for the Boost library COMPONENT-NAME (e.g., `thread', for
+# libboost_thread) under the possible CANDIDATE-LIB-NAMES (e.g.,
+# "thread_win32 thread"). Check that HEADER-NAME works and check that
+# libboost_LIB-NAME can link with the code CXX-TEST. The optional
+# argument CXX-PROLOGUE can be used to include some C++ code before
+# the `main' function. The CXX-POST-INCLUDE-PROLOGUE can be used to
+# include some code before the `main' function, but after the
+# `#include <HEADER-NAME>'.
+#
+# Invokes BOOST_FIND_HEADER([HEADER-NAME]) (see above).
+#
+# Boost libraries typically come compiled with several flavors (with different
+# runtime options) so PREFERRED-RT-OPT is the preferred suffix. A suffix is one
+# or more of the following letters: sgdpn (in that order). s = static
+# runtime, d = debug build, g = debug/diagnostic runtime, p = STLPort build,
+# n = (unsure) STLPort build without iostreams from STLPort (it looks like `n'
+# must always be used along with `p'). Additionally, PREFERRED-RT-OPT can
+# start with `mt-' to indicate that there is a preference for multi-thread
+# builds. Some sample values for PREFERRED-RT-OPT: (nothing), mt, d, mt-d, gdp
+# ... If you want to make sure you have a specific version of Boost
+# (eg, >= 1.33) you *must* invoke BOOST_REQUIRE before this macro.
+#
+# ERROR_ON_UNUSABLE can be set to "no" if the caller does not want their
+# configure to fail
+AC_DEFUN([BOOST_FIND_LIBS],
+[AC_REQUIRE([BOOST_REQUIRE])dnl
+AC_REQUIRE([_BOOST_FIND_COMPILER_TAG])dnl
+AC_REQUIRE([BOOST_STATIC])dnl
+AC_REQUIRE([_BOOST_GUESS_WHETHER_TO_USE_MT])dnl
+if test x"$boost_cv_inc_path" = xno; then
+ AC_MSG_NOTICE([Boost not available, not searching for the Boost $1 library])
+else
+dnl The else branch is huge and wasn't indented on purpose.
+AC_LANG_PUSH([C++])dnl
+AS_VAR_PUSHDEF([Boost_lib], [boost_cv_lib_$1])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDFLAGS], [boost_cv_lib_$1_LDFLAGS])dnl
+AS_VAR_PUSHDEF([Boost_lib_LDPATH], [boost_cv_lib_$1_LDPATH])dnl
+AS_VAR_PUSHDEF([Boost_lib_LIBS], [boost_cv_lib_$1_LIBS])dnl
+AS_IF([test x"$8" = "xno"], [not_found_header='true'])
+BOOST_FIND_HEADER([$4], [$not_found_header])
+boost_save_CPPFLAGS=$CPPFLAGS
+CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
+AC_CACHE_CHECK([for the Boost $1 library], [Boost_lib],
+ [_BOOST_FIND_LIBS($@)])
+case $Boost_lib in #(
+ (yes) _AC_MSG_LOG_CONFTEST
+ AC_DEFINE(AS_TR_CPP([HAVE_BOOST_$1]), [1], [Defined if the Boost $1 library is available])dnl
+ AC_SUBST(AS_TR_CPP([BOOST_$1_LDFLAGS]), [$Boost_lib_LDFLAGS])dnl
+ AC_SUBST(AS_TR_CPP([BOOST_$1_LDPATH]), [$Boost_lib_LDPATH])dnl
+ AC_SUBST([BOOST_LDPATH], [$Boost_lib_LDPATH])dnl
+ AC_SUBST(AS_TR_CPP([BOOST_$1_LIBS]), [$Boost_lib_LIBS])dnl
+ ;;
+ (no) _AC_MSG_LOG_CONFTEST
+ AS_IF([test x"$8" != "xno"], [
+ AC_MSG_ERROR([cannot find flags to link with the Boost $1 library (libboost-$1)])
+ ])
+ ;;
+esac
+CPPFLAGS=$boost_save_CPPFLAGS
+AS_VAR_POPDEF([Boost_lib])dnl
+AS_VAR_POPDEF([Boost_lib_LDFLAGS])dnl
+AS_VAR_POPDEF([Boost_lib_LDPATH])dnl
+AS_VAR_POPDEF([Boost_lib_LIBS])dnl
+AC_LANG_POP([C++])dnl
+fi
+])
+
+
+# BOOST_FIND_LIB([LIB-NAME],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE], [CXX-POST-INCLUDE-PROLOGUE],
+# [ERROR_ON_UNUSABLE])
+# --------------------------------------------------------------
+# Backward compatibility wrapper for BOOST_FIND_LIBS.
+# ERROR_ON_UNUSABLE can be set to "no" if the caller does not want their
+# configure to fail
+AC_DEFUN([BOOST_FIND_LIB],
+[BOOST_FIND_LIBS([$1], $@)])
+
+
+# _BOOST_FIND_LIBS([LIB-NAME], [CANDIDATE-LIB-NAMES],
+# [PREFERRED-RT-OPT], [HEADER-NAME], [CXX-TEST],
+# [CXX-PROLOGUE], [CXX-POST-INCLUDE-PROLOGUE],
+# [ERROR_ON_UNUSABLE])
+# --------------------------------------------------------------
+# Real implementation of BOOST_FIND_LIBS: rely on these local macros:
+# Boost_lib, Boost_lib_LDFLAGS, Boost_lib_LDPATH, Boost_lib_LIBS
+#
+# The algorithm is as follows: first look for a given library name
+# according to the user's PREFERRED-RT-OPT. For each library name, we
+# prefer to use the ones that carry the tag (toolset name). Each
+# library is searched through the various standard paths were Boost is
+# usually installed. If we can't find the standard variants, we try
+# to enforce -mt (for instance on MacOSX, libboost_thread.dylib
+# doesn't exist but there's -obviously- libboost_thread-mt.dylib).
+#
+# ERROR_ON_UNUSABLE can be set to "no" if the caller does not want their
+# configure to fail
+AC_DEFUN([_BOOST_FIND_LIBS],
+[Boost_lib=no
+ case "$3" in #(
+ (mt | mt-) boost_mt=-mt; boost_rtopt=;; #(
+ (mt* | mt-*) boost_mt=-mt; boost_rtopt=`expr "X$3" : 'Xmt-*\(.*\)'`;; #(
+ (*) boost_mt=; boost_rtopt=$3;;
+ esac
+ if test $enable_static_boost = yes; then
+ boost_rtopt="s$boost_rtopt"
+ fi
+ # Find the proper debug variant depending on what we've been asked to find.
+ case $boost_rtopt in #(
+ (*d*) boost_rt_d=$boost_rtopt;; #(
+ (*[[sgpn]]*) # Insert the `d' at the right place (in between `sg' and `pn')
+ boost_rt_d=`echo "$boost_rtopt" | sed 's/\(s*g*\)\(p*n*\)/\1\2/'`;; #(
+ (*) boost_rt_d='-d';;
+ esac
+ # If the PREFERRED-RT-OPT are not empty, prepend a `-'.
+ test -n "$boost_rtopt" && boost_rtopt="-$boost_rtopt"
+ $boost_guess_use_mt && boost_mt=-mt
+ # Look for the abs path the static archive.
+ # $libext is computed by Libtool but let's make sure it's non empty.
+ test -z "$libext" &&
+ AC_MSG_ERROR([the libext variable is empty, did you invoke Libtool?])
+ boost_save_ac_objext=$ac_objext
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([$7
+#include <$4>
+$6], [$5])])
+dnl Optimization hacks: compiling C++ is slow, especially with Boost. What
+dnl we're trying to do here is guess the right combination of link flags
+dnl (LIBS / LDFLAGS) to use a given library. This can take several
+dnl iterations before it succeeds and is thus *very* slow. So what we do
+dnl instead is that we compile the code first (and thus get an object file,
+dnl typically conftest.o). Then we try various combinations of link flags
+dnl until we succeed to link conftest.o in an executable. The problem is
+dnl that the various TRY_LINK / COMPILE_IFELSE macros of Autoconf always
+dnl remove all the temporary files including conftest.o. So the trick here
+dnl is to temporarily change the value of ac_objext so that conftest.o is
+dnl preserved accross tests. This is obviously fragile and I will burn in
+dnl hell for not respecting Autoconf's documented interfaces, but in the
+dnl mean time, it optimizes the macro by a factor of 5 to 30.
+dnl Another small optimization: the first argument of AC_COMPILE_IFELSE left
+dnl empty because the test file is generated only once above (before we
+dnl start the for loops).
+ AC_COMPILE_IFELSE([],
+ [ac_objext=do_not_rm_me_plz],
+ [AS_IF([test x"$8" != x"no"], [
+ AC_MSG_ERROR([cannot compile a test that uses Boost $1])
+ ])
+ ])
+ ac_objext=$boost_save_ac_objext
+ boost_failed_libs=
+# Don't bother to ident the following nested for loops, only the 2
+# innermost ones matter.
+for boost_lib_ in $2; do
+for boost_tag_ in -$boost_cv_lib_tag ''; do
+for boost_ver_ in -$boost_cv_lib_version ''; do
+for boost_mt_ in $boost_mt -mt ''; do
+for boost_rtopt_ in $boost_rtopt '' -d; do
+ for boost_full_suffix in \
+ $boost_last_suffix \
+ x$boost_tag_$boost_mt_$boost_rtopt_$boost_ver_ \
+ x$boost_tag_$boost_rtopt_$boost_ver_ \
+ x$boost_tag_$boost_mt_$boost_ver_ \
+ x$boost_tag_$boost_ver_
+ do
+ boost_real_suffix=`echo "$boost_full_suffix" | sed 's/^x//'`
+ boost_lib="boost_$boost_lib_$boost_real_suffix"
+ # Avoid testing twice the same lib
+ case $boost_failed_libs in #(
+ (*@$boost_lib@*) continue;;
+ esac
+ # If with_boost is empty, we'll search in /lib first, which is not quite
+ # right so instead we'll try to a location based on where the headers are.
+ boost_tmp_lib=$with_boost
+ test x"$with_boost" = x && boost_tmp_lib=${boost_cv_inc_path%/include}
+ for boost_ldpath in "$boost_tmp_lib/lib" '' \
+ /opt/local/lib* /usr/local/lib* /opt/lib* /usr/lib* \
+ "$with_boost" C:/Boost/lib /lib*
+ do
+ # Don't waste time with directories that don't exist.
+ if test x"$boost_ldpath" != x && test ! -e "$boost_ldpath"; then
+ continue
+ fi
+ boost_save_LDFLAGS=$LDFLAGS
+ # Are we looking for a static library?
+ case $boost_ldpath:$boost_rtopt_ in #(
+ (*?*:*s*) # Yes (Non empty boost_ldpath + s in rt opt)
+ Boost_lib_LIBS="$boost_ldpath/lib$boost_lib.$libext"
+ test -e "$Boost_lib_LIBS" || continue;; #(
+ (*) # No: use -lboost_foo to find the shared library.
+ Boost_lib_LIBS="-l$boost_lib";;
+ esac
+ boost_save_LIBS=$LIBS
+ LIBS="$Boost_lib_LIBS $LIBS"
+ test x"$boost_ldpath" != x && LDFLAGS="$LDFLAGS -L$boost_ldpath"
+dnl First argument of AC_LINK_IFELSE left empty because the test file is
+dnl generated only once above (before we start the for loops).
+ _BOOST_AC_LINK_IFELSE([],
+ [Boost_lib=yes], [Boost_lib=no])
+ ac_objext=$boost_save_ac_objext
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ if test x"$Boost_lib" = xyes; then
+ # Check or used cached result of whether or not using -R or
+ # -rpath makes sense. Some implementations of ld, such as for
+ # Mac OSX, require -rpath but -R is the flag known to work on
+ # other systems. https://github.com/tsuna/boost.m4/issues/19
+ AC_CACHE_VAL([boost_cv_rpath_link_ldflag],
+ [case $boost_ldpath in
+ '') # Nothing to do.
+ boost_cv_rpath_link_ldflag=
+ boost_rpath_link_ldflag_found=yes;;
+ *)
+ for boost_cv_rpath_link_ldflag in -Wl,-R, -Wl,-rpath,; do
+ LDFLAGS="$boost_save_LDFLAGS -L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ LIBS="$Boost_lib_LIBS $boost_save_LIBS"
+ _BOOST_AC_LINK_IFELSE([],
+ [boost_rpath_link_ldflag_found=yes
+ break],
+ [boost_rpath_link_ldflag_found=no])
+ done
+ ;;
+ esac
+ AS_IF([test "x$boost_rpath_link_ldflag_found" != "xyes"],
+ [AC_MSG_ERROR([Unable to determine whether to use -R or -rpath])])
+ LDFLAGS=$boost_save_LDFLAGS
+ LIBS=$boost_save_LIBS
+ ])
+ test x"$boost_ldpath" != x &&
+ Boost_lib_LDFLAGS="-L$boost_ldpath $boost_cv_rpath_link_ldflag$boost_ldpath"
+ Boost_lib_LDPATH="$boost_ldpath"
+ boost_last_suffix="$boost_full_suffix"
+ break 7
+ else
+ boost_failed_libs="$boost_failed_libs@$boost_lib@"
+ fi
+ done
+ done
+done
+done
+done
+done
+done # boost_lib_
+rm -f conftest.$ac_objext
+])
+
+
+
+# --------------------------------------- #
+# Checks for the various Boost libraries. #
+# --------------------------------------- #
+
+# List of boost libraries: http://www.boost.org/libs/libraries.htm
+# The page http://beta.boost.org/doc/libs is useful: it gives the first release
+# version of each library (among other things).
+
+# BOOST_DEFUN(LIBRARY, CODE)
+# --------------------------
+# Define BOOST_<LIBRARY-UPPERCASE> as a macro that runs CODE.
+#
+# Use indir to avoid the warning on underquoted macro name given to AC_DEFUN.
+m4_define([BOOST_DEFUN],
+[m4_indir([AC_DEFUN],
+ m4_toupper([BOOST_$1]),
+[m4_pushdef([BOOST_Library], [$1])dnl
+$2
+m4_popdef([BOOST_Library])dnl
+])
+])
+
+
+# BOOST_ANY()
+# ------------
+# Look for Boost.Any
+BOOST_DEFUN([Any],
+[BOOST_FIND_HEADER([boost/any.hpp])])
+
+
+# BOOST_ARRAY()
+# -------------
+# Look for Boost.Array
+BOOST_DEFUN([Array],
+[BOOST_FIND_HEADER([boost/array.hpp])])
+
+
+# BOOST_ASIO()
+# ------------
+# Look for Boost.Asio (new in Boost 1.35).
+BOOST_DEFUN([Asio],
+[AC_REQUIRE([BOOST_SYSTEM])dnl
+BOOST_FIND_HEADER([boost/asio.hpp])])
+
+# BOOST_BIMAP()
+# ------------
+# Look for Boost.Bimap
+BOOST_DEFUN([Bimap],
+[BOOST_FIND_HEADER([boost/bimap.hpp])])
+
+
+# BOOST_ASSIGN()
+# -------------
+# Look for Boost.Assign
+BOOST_DEFUN([Assign],
+[BOOST_FIND_HEADER([boost/assign.hpp])])
+
+
+# BOOST_ATOMIC([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -------------------------------
+# Look for Boost.Atomic. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Atomic],
+[BOOST_FIND_LIB([atomic], [$1],
+ [boost/atomic.hpp],
+ [boost::atomic<int> a;],
+ [ ],
+ [#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif], [$2])
+])# BOOST_ATOMIC
+
+
+# BOOST_BIND()
+# ------------
+# Look for Boost.Bind.
+BOOST_DEFUN([Bind],
+[BOOST_FIND_HEADER([boost/bind.hpp])])
+
+
+# BOOST_CAST()
+# ------------
+# Look for Boost.Cast
+BOOST_DEFUN([Cast],
+[BOOST_FIND_HEADER([boost/cast.hpp])])
+
+
+# BOOST_CHRONO([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# --------------
+# Look for Boost.Chrono.
+BOOST_DEFUN([Chrono],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1], [$2])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([chrono], [$1],
+ [boost/chrono.hpp],
+ [boost::chrono::thread_clock d;], [], [], [$2])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_CHRONO_LIBS="$BOOST_CHRONO_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_CHRONO
+
+
+# BOOST_CONTEXT([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -----------------------------------
+# Look for Boost.Context. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+#
+# * This library was introduced in Boost 1.51.0
+# * The signatures of make_fcontext() and jump_fcontext were changed in 1.56.0
+# * A dependency on boost_thread appears in 1.57.0
+# * The implementation details were moved to boost::context::detail in 1.61.0
+# * 1.61 also introduces execution_context_v2, which is the "lowest common
+# denominator" for boost::context presence since then.
+# * boost::context::fiber was introduced in 1.69 and execution_context_v2 was
+# removed in 1.72
+BOOST_DEFUN([Context],
+[boost_context_save_LIBS=$LIBS
+ boost_context_save_LDFLAGS=$LDFLAGS
+if test $boost_major_version -ge 157; then
+ BOOST_THREAD([$1], [$2])
+ m4_pattern_allow([^BOOST_THREAD_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_THREAD_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_THREAD_LDFLAGS"
+fi
+
+if test $boost_major_version -ge 169; then
+
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/fiber.hpp], [[
+namespace ctx=boost::context;
+int a;
+ctx::fiber source{[&a](ctx::fiber&& sink){
+ a=0;
+ int b=1;
+ for(;;){
+ sink=std::move(sink).resume();
+ int next=a+b;
+ a=b;
+ b=next;
+ }
+ return std::move(sink);
+}};
+for (int j=0;j<10;++j) {
+ source=std::move(source).resume();
+}
+return a == 34;
+]], [], [], [$2])
+
+elif test $boost_major_version -ge 161; then
+
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/execution_context_v2.hpp], [[
+namespace ctx=boost::context;
+int res=0;
+int n=35;
+ctx::execution_context<int> source(
+ [n, &res](ctx::execution_context<int> sink, int) mutable {
+ int a=0;
+ int b=1;
+ while(n-->0){
+ auto result=sink(a);
+ sink=std::move(std::get<0>(result));
+ auto next=a+b;
+ a=b;
+ b=next;
+ }
+ return sink;
+ });
+for(int i=0;i<10;++i){
+ auto result=source(i);
+ source=std::move(std::get<0>(result));
+ res = std::get<1>(result);
+}
+return res == 34;
+]], [], [], [$2])
+
+else
+
+BOOST_FIND_LIB([context], [$1],
+ [boost/context/fcontext.hpp],[[
+
+// creates a stack
+void * stack_pointer = new void*[4096];
+std::size_t const size = sizeof(void*[4096]);
+
+#if BOOST_VERSION <= 105100
+ctx::make_fcontext(&fc, f);
+return ctx::jump_fcontext(&fcm, &fc, 3) == 6;
+
+#else
+
+fc = ctx::make_fcontext(stack_pointer, size, f);
+return ctx::jump_fcontext(&fcm, fc, 3) == 6;
+
+#endif
+
+
+]],[dnl
+
+#include <boost/version.hpp>
+#if BOOST_VERSION <= 105100
+
+namespace ctx = boost::ctx;
+
+static ctx::fcontext_t fcm, fc;
+
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, &fcm, i * 2);
+}
+
+#elif BOOST_VERSION <= 105500
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, *fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(fc, &fcm, i * 2);
+}
+
+#else
+
+namespace ctx = boost::context;
+
+// context
+static ctx::fcontext_t fcm, fc;
+
+// context-function
+static void f(intptr_t i) {
+ ctx::jump_fcontext(&fc, fcm, i * 2);
+}
+#endif
+], [], [], [$2])
+
+fi
+
+LIBS=$boost_context_save_LIBS
+LDFLAGS=$boost_context_save_LDFLAGS
+])# BOOST_CONTEXT
+
+
+# BOOST_CONVERSION()
+# ------------------
+# Look for Boost.Conversion (cast / lexical_cast)
+BOOST_DEFUN([Conversion],
+[BOOST_FIND_HEADER([boost/cast.hpp])
+BOOST_FIND_HEADER([boost/lexical_cast.hpp])
+])# BOOST_CONVERSION
+
+
+# BOOST_COROUTINE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -----------------------------------
+# Look for Boost.Coroutine. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.53.0
+BOOST_DEFUN([Coroutine],
+[
+boost_coroutine_save_LIBS=$LIBS
+boost_coroutine_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from coroutine to context
+BOOST_CONTEXT([$1], [$2])
+# Starting from Boost 1.55 a dependency on Boost.System is added
+if test $boost_major_version -ge 155; then
+ BOOST_SYSTEM([$1], [$2])
+fi
+m4_pattern_allow([^BOOST_(CONTEXT|SYSTEM)_(LIBS|LDFLAGS)])
+LIBS="$LIBS $BOOST_CONTEXT_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+
+# in 1.53 coroutine was a header only library
+if test $boost_major_version -eq 153; then
+ AS_IF([test x"$2" = "xno"], [not_found_header='true'])
+ BOOST_FIND_HEADER([boost/coroutine/coroutine.hpp], [$not_found_header])
+else
+ BOOST_FIND_LIB([coroutine], [$1],
+ [boost/coroutine/coroutine.hpp],
+ [
+ #include <boost/version.hpp>
+ #if BOOST_VERSION <= 105500
+ boost::coroutines::coroutine<int(int)> coro; coro.get();
+ #else
+ boost::coroutines::asymmetric_coroutine<int>::pull_type coro; coro.get();
+ #endif
+ ], [], [], [$2])
+fi
+# Link-time dependency from coroutine to context, existed only in 1.53, in 1.54
+# coroutine doesn't use context from its headers but from its library.
+if test $boost_major_version -eq 153 || test $enable_static_boost = yes && test $boost_major_version -ge 154; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_CONTEXT_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_CONTEXT_LDFLAGS"
+fi
+if test $enable_static_boost = yes && test $boost_major_version -ge 155; then
+ BOOST_COROUTINE_LIBS="$BOOST_COROUTINE_LIBS $BOOST_SYSTEM_LIBS"
+ BOOST_COROUTINE_LDFLAGS="$BOOST_COROUTINE_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi
+LIBS=$boost_coroutine_save_LIBS
+LDFLAGS=$boost_coroutine_save_LDFLAGS
+])# BOOST_COROUTINE
+
+
+# BOOST_CRC()
+# -----------
+# Look for Boost.CRC
+BOOST_DEFUN([CRC],
+[BOOST_FIND_HEADER([boost/crc.hpp])
+])# BOOST_CRC
+
+
+# BOOST_DATE_TIME([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -----------------------------------
+# Look for Boost.Date_Time. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Date_Time],
+[BOOST_FIND_LIB([date_time], [$1],
+ [boost/date_time/posix_time/posix_time.hpp],
+ [boost::posix_time::ptime t;], [], [], [$2])
+])# BOOST_DATE_TIME
+
+
+# BOOST_EXCEPTION()
+# ------------
+# Look for Boost.Exception
+BOOST_DEFUN([Exception],
+[BOOST_FIND_HEADER([boost/exception/all.hpp])])
+
+
+# BOOST_FILESYSTEM([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# ------------------------------------
+# Look for Boost.Filesystem. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+# Do not check for boost/filesystem.hpp because this file was introduced in
+# 1.34.
+BOOST_DEFUN([Filesystem],
+[# Do we have to check for Boost.System? This link-time dependency was
+# added as of 1.35.0. If we have a version <1.35, we must not attempt to
+# find Boost.System as it didn't exist by then.
+if test $boost_major_version -ge 135; then
+ BOOST_SYSTEM([$1], [$2])
+fi # end of the Boost.System check.
+boost_filesystem_save_LIBS=$LIBS
+boost_filesystem_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([filesystem], [$1],
+ [boost/filesystem/path.hpp], [boost::filesystem::path p;],
+ [], [], [$2])
+if test $enable_static_boost = yes && test $boost_major_version -ge 135; then
+ BOOST_FILESYSTEM_LIBS="$BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+fi
+LIBS=$boost_filesystem_save_LIBS
+LDFLAGS=$boost_filesystem_save_LDFLAGS
+])# BOOST_FILESYSTEM
+
+
+# BOOST_FLYWEIGHT()
+# -----------------
+# Look for Boost.Flyweight.
+BOOST_DEFUN([Flyweight],
+[dnl There's a hidden dependency on pthreads.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+BOOST_FIND_HEADER([boost/flyweight.hpp])
+AC_SUBST([BOOST_FLYWEIGHT_LIBS], [$boost_cv_pthread_flag])
+])
+
+
+# BOOST_FOREACH()
+# ---------------
+# Look for Boost.Foreach.
+BOOST_DEFUN([Foreach],
+[BOOST_FIND_HEADER([boost/foreach.hpp])])
+
+
+# BOOST_FORMAT()
+# --------------
+# Look for Boost.Format.
+# Note: we can't check for boost/format/format_fwd.hpp because the header isn't
+# standalone. It can't be compiled because it triggers the following error:
+# boost/format/detail/config_macros.hpp:88: error: 'locale' in namespace 'std'
+# does not name a type
+BOOST_DEFUN([Format],
+[BOOST_FIND_HEADER([boost/format.hpp])])
+
+
+# BOOST_FUNCTION()
+# ----------------
+# Look for Boost.Function
+BOOST_DEFUN([Function],
+[BOOST_FIND_HEADER([boost/function.hpp])])
+
+
+# BOOST_FUSION()
+# -----------------
+# Look for Boost.Fusion
+BOOST_DEFUN([Fusion],
+[BOOST_FIND_HEADER([boost/fusion/sequence.hpp])])
+
+
+# BOOST_GEOMETRY()
+# ----------------
+# Look for Boost.Geometry (new since 1.47.0).
+BOOST_DEFUN([Geometry],
+[BOOST_FIND_HEADER([boost/geometry.hpp])
+])# BOOST_GEOMETRY
+
+
+# BOOST_GRAPH([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -------------------------------
+# Look for Boost.Graphs. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Graph],
+[boost_graph_save_LIBS=$LIBS
+boost_graph_save_LDFLAGS=$LDFLAGS
+# Link-time dependency from graph to regex was added as of 1.40.0.
+if test $boost_major_version -ge 140; then
+ BOOST_REGEX([$1], [$2])
+ m4_pattern_allow([^BOOST_REGEX_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_REGEX_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_REGEX_LDFLAGS"
+fi
+BOOST_FIND_LIB([graph], [$1],
+ [boost/graph/adjacency_list.hpp], [boost::adjacency_list<> g;],
+ [], [], [$2])
+LIBS=$boost_graph_save_LIBS
+LDFLAGS=$boost_graph_save_LDFLAGS
+])# BOOST_GRAPH
+
+
+# BOOST_HASH()
+# ------------
+# Look for Boost.Functional/Hash
+BOOST_DEFUN([Hash],
+[BOOST_FIND_HEADER([boost/functional/hash.hpp])])
+
+
+# BOOST_IOSTREAMS([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -----------------------------------
+# Look for Boost.IOStreams. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([IOStreams],
+[BOOST_FIND_LIB([iostreams], [$1],
+ [boost/iostreams/device/file_descriptor.hpp],
+ [boost::iostreams::file_descriptor fd; fd.close();],
+ [], [], [$2])
+])# BOOST_IOSTREAMS
+
+
+# BOOST_ITERATOR()
+# ------------
+# Look for Boost.Iterator
+BOOST_DEFUN([Iterator],
+[BOOST_FIND_HEADER([boost/iterator/iterator_adaptor.hpp])])
+
+
+# BOOST_LAMBDA()
+# --------------
+# Look for Boost.Lambda
+BOOST_DEFUN([Lambda],
+[BOOST_FIND_HEADER([boost/lambda/lambda.hpp])])
+
+
+# BOOST_LOCALE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# --------------
+# Look for Boost.Locale
+BOOST_DEFUN([Locale],
+[
+boost_locale_save_LIBS=$LIBS
+boost_locale_save_LDFLAGS=$LDFLAGS
+# require SYSTEM for boost-1.50.0 and up
+if test $boost_major_version -ge 150; then
+ BOOST_SYSTEM([$1], [$2])
+ m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+ LIBS="$LIBS $BOOST_SYSTEM_LIBS"
+ LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+fi # end of the Boost.System check.
+BOOST_FIND_LIB([locale], [$1],
+ [boost/locale.hpp],
+ [[boost::locale::generator gen; std::locale::global(gen(""));]], [], [], [$2])
+LIBS=$boost_locale_save_LIBS
+LDFLAGS=$boost_locale_save_LDFLAGS
+])# BOOST_LOCALE
+
+# BOOST_LOG([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -----------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log],
+[boost_log_save_LIBS=$LIBS
+boost_log_save_LDFLAGS=$LDFLAGS
+BOOST_SYSTEM([$1], [$2])
+BOOST_FILESYSTEM([$1], [$2])
+BOOST_DATE_TIME([$1], [$2])
+m4_pattern_allow([^BOOST_(SYSTEM|FILESYSTEM|DATE_TIME)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_DATE_TIME_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_SYSTEM_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_DATE_TIME_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+BOOST_FIND_LIB([log], [$1],
+ [boost/log/core/core.hpp],
+ [boost::log::attribute a; a.get_value();], [], [], [$2])
+LIBS=$boost_log_save_LIBS
+LDFLAGS=$boost_log_save_LDFLAGS
+])# BOOST_LOG
+
+
+# BOOST_LOG_SETUP([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -----------------------------------
+# Look for Boost.Log. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Log_Setup],
+[boost_log_setup_save_LIBS=$LIBS
+boost_log_setup_save_LDFLAGS=$LDFLAGS
+BOOST_LOG([$1])
+m4_pattern_allow([^BOOST_LOG_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_LOG_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_LOG_LDFLAGS"
+BOOST_FIND_LIB([log_setup], [$1],
+ [boost/log/utility/setup/from_settings.hpp],
+ [boost::log::basic_settings<char> bs; bs.empty();], [], [], [$2])
+LIBS=$boost_log_setup_save_LIBS
+LDFLAGS=$boost_log_setup_save_LDFLAGS
+])# BOOST_LOG_SETUP
+
+
+# BOOST_MATH()
+# ------------
+# Look for Boost.Math
+# TODO: This library isn't header-only but it comes in multiple different
+# flavors that don't play well with BOOST_FIND_LIB (e.g, libboost_math_c99,
+# libboost_math_c99f, libboost_math_c99l, libboost_math_tr1,
+# libboost_math_tr1f, libboost_math_tr1l). This macro must be fixed to do the
+# right thing anyway.
+BOOST_DEFUN([Math],
+[BOOST_FIND_HEADER([boost/math/special_functions.hpp])])
+
+
+# BOOST_MPI([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -------------------------------
+# Look for Boost MPI. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. Uses MPICXX variable if it is
+# set, otherwise tries CXX
+#
+BOOST_DEFUN([MPI],
+[boost_save_CXX=${CXX}
+boost_save_CXXCPP=${CXXCPP}
+if test x"${MPICXX}" != x; then
+ CXX=${MPICXX}
+ CXXCPP="${MPICXX} -E"
+fi
+BOOST_FIND_LIB([mpi], [$1],
+ [boost/mpi.hpp],
+ [int argc = 0;
+ char **argv = 0;
+ boost::mpi::environment env(argc,argv);],
+ [], [], [$2])
+CXX=${boost_save_CXX}
+CXXCPP=${boost_save_CXXCPP}
+])# BOOST_MPI
+
+
+# BOOST_MPL()
+# ------------------
+# Look for Boost.MPL
+BOOST_DEFUN([MPL],
+[BOOST_FIND_HEADER([boost/mpl/for_each.hpp])])
+
+
+# BOOST_MULTIARRAY()
+# ------------------
+# Look for Boost.MultiArray
+BOOST_DEFUN([MultiArray],
+[BOOST_FIND_HEADER([boost/multi_array.hpp])])
+
+
+# BOOST_MULTIINDEXCCONTAINER()
+# ------------------
+# Look for Boost.MultiIndexContainer
+BOOST_DEFUN([MultiIndexContainer],
+[BOOST_FIND_HEADER([boost/multi_index_container.hpp])])
+
+
+# BOOST_NUMERIC_UBLAS()
+# --------------------------
+# Look for Boost.NumericUblas (Basic Linear Algebra)
+BOOST_DEFUN([Numeric_Ublas],
+[BOOST_FIND_HEADER([boost/numeric/ublas/vector.hpp])
+])# BOOST_NUMERIC_UBLAS
+
+
+# BOOST_NUMERIC_CONVERSION()
+# --------------------------
+# Look for Boost.NumericConversion (policy-based numeric conversion)
+BOOST_DEFUN([Numeric_Conversion],
+[BOOST_FIND_HEADER([boost/numeric/conversion/converter.hpp])
+])# BOOST_NUMERIC_CONVERSION
+
+
+# BOOST_OPTIONAL()
+# ----------------
+# Look for Boost.Optional
+BOOST_DEFUN([Optional],
+[BOOST_FIND_HEADER([boost/optional.hpp])])
+
+
+# BOOST_PREPROCESSOR()
+# --------------------
+# Look for Boost.Preprocessor
+BOOST_DEFUN([Preprocessor],
+[BOOST_FIND_HEADER([boost/preprocessor/repeat.hpp])])
+
+
+# BOOST_PROPERTY_TREE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -----------------------------------------
+# Look for Boost.Property_Tree. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Property_Tree],
+[BOOST_FIND_LIB([property_tree], [$1],
+ [boost/property_tree/ptree.hpp],
+ [boost::property_tree::ptree pt; boost::property_tree::read_xml d("test", pt);],
+ [], [], [$2])
+])# BOOST_PROPERTY_TREE
+
+
+# BOOST_RANDOM()
+# --------------------
+# Look for Boost.Random
+BOOST_DEFUN([Random],
+[BOOST_FIND_HEADER([boost/random/random_number_generator.hpp])])
+
+
+# BOOST_RANGE()
+# --------------------
+# Look for Boost.Range
+BOOST_DEFUN([Range],
+[BOOST_FIND_HEADER([boost/range/adaptors.hpp])])
+
+# BOOST_UNORDERED()
+# -----------------
+# Look for Boost.Unordered
+BOOST_DEFUN([Unordered],
+[BOOST_FIND_HEADER([boost/unordered_map.hpp])])
+
+
+# BOOST_UUID()
+# ------------
+# Look for Boost.Uuid
+BOOST_DEFUN([Uuid],
+[BOOST_FIND_HEADER([boost/uuid/uuid.hpp])])
+
+
+# BOOST_PROGRAM_OPTIONS([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -----------------------------------------
+# Look for Boost.Program_options. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Program_Options],
+[BOOST_FIND_LIB([program_options], [$1],
+ [boost/program_options.hpp],
+ [boost::program_options::options_description d("test");],
+ [], [], [$2])
+])# BOOST_PROGRAM_OPTIONS
+
+
+
+# _BOOST_PYTHON_CONFIG(VARIABLE, FLAG)
+# ------------------------------------
+# Save VARIABLE, and define it via `python-config --FLAG`.
+# Substitute BOOST_PYTHON_VARIABLE.
+m4_define([_BOOST_PYTHON_CONFIG],
+[AC_SUBST([BOOST_PYTHON_$1],
+ [`python-config --$2 2>/dev/null`])dnl
+boost_python_save_$1=$$1
+$1="$$1 $BOOST_PYTHON_$1"])
+
+
+# BOOST_PYTHON([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# --------------------------------
+# Look for Boost.Python. For the documentation of PREFERRED-RT-OPT,
+# see the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Python],
+[_BOOST_PYTHON_CONFIG([CPPFLAGS], [includes])
+_BOOST_PYTHON_CONFIG([LDFLAGS], [ldflags])
+_BOOST_PYTHON_CONFIG([LIBS], [libs])
+m4_pattern_allow([^BOOST_PYTHON_MODULE$])dnl
+BOOST_FIND_LIBS([python], [python python3], [$1],
+ [boost/python.hpp],
+ [], [BOOST_PYTHON_MODULE(empty) {}], [], [$2])
+CPPFLAGS=$boost_python_save_CPPFLAGS
+LDFLAGS=$boost_python_save_LDFLAGS
+LIBS=$boost_python_save_LIBS
+])# BOOST_PYTHON
+
+
+# BOOST_REF()
+# -----------
+# Look for Boost.Ref
+BOOST_DEFUN([Ref],
+[BOOST_FIND_HEADER([boost/ref.hpp])])
+
+
+# BOOST_REGEX([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# -------------------------------
+# Look for Boost.Regex. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Regex],
+[BOOST_FIND_LIB([regex], [$1],
+ [boost/regex.hpp],
+ [boost::regex exp("*"); boost::regex_match("foo", exp);],
+ [], [], [$2])
+])# BOOST_REGEX
+
+
+# BOOST_SCOPE_EXIT()
+# ------------
+# Look for Boost.ScopeExit.
+BOOST_DEFUN([SCOPE_EXIT],
+[BOOST_FIND_HEADER([boost/scope_exit.hpp])])
+
+
+# BOOST_SERIALIZATION([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# ---------------------------------------
+# Look for Boost.Serialization. For the documentation of PREFERRED-RT-OPT, see
+# the documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Serialization],
+[BOOST_FIND_LIB([serialization], [$1],
+ [boost/archive/text_oarchive.hpp],
+ [std::ostream* o = 0; // Cheap way to get an ostream...
+ boost::archive::text_oarchive t(*o);],
+ [], [], [$2])
+])# BOOST_SERIALIZATION
+
+
+# BOOST_SIGNALS([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# ---------------------------------
+# Look for Boost.Signals. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Signals],
+[BOOST_FIND_LIB([signals], [$1],
+ [boost/signal.hpp],
+ [boost::signal<void ()> s;],
+ [], [], [$2])
+])# BOOST_SIGNALS
+
+
+# BOOST_SIGNALS2()
+# ----------------
+# Look for Boost.Signals2 (new since 1.39.0).
+BOOST_DEFUN([Signals2],
+[BOOST_FIND_HEADER([boost/signals2.hpp])
+])# BOOST_SIGNALS2
+
+
+# BOOST_SMART_PTR()
+# -----------------
+# Look for Boost.SmartPtr
+BOOST_DEFUN([Smart_Ptr],
+[BOOST_FIND_HEADER([boost/scoped_ptr.hpp])
+BOOST_FIND_HEADER([boost/shared_ptr.hpp])
+])
+
+
+# BOOST_STATICASSERT()
+# --------------------
+# Look for Boost.StaticAssert
+BOOST_DEFUN([StaticAssert],
+[BOOST_FIND_HEADER([boost/static_assert.hpp])])
+
+
+# BOOST_STRING_ALGO()
+# -------------------
+# Look for Boost.StringAlgo
+BOOST_DEFUN([String_Algo],
+[BOOST_FIND_HEADER([boost/algorithm/string.hpp])
+])
+
+
+# BOOST_SYSTEM([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# --------------------------------
+# Look for Boost.System. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above. This library was introduced in Boost
+# 1.35.0.
+BOOST_DEFUN([System],
+[BOOST_FIND_LIB([system], [$1],
+ [boost/system/error_code.hpp],
+ [boost::system::error_code e; e.clear();], [], [], [$2])
+])# BOOST_SYSTEM
+
+
+# BOOST_TEST([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# ------------------------------
+# Look for Boost.Test. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Test],
+[m4_pattern_allow([^BOOST_CHECK$])dnl
+BOOST_FIND_LIB([unit_test_framework], [$1],
+ [boost/test/unit_test.hpp], [BOOST_CHECK(2 == 2);],
+ [using boost::unit_test::test_suite;
+ test_suite* init_unit_test_suite(int argc, char ** argv)
+ { return NULL; }], [], [$2])
+])# BOOST_TEST
+
+
+# BOOST_THREAD([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# ---------------------------------
+# Look for Boost.Thread. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Thread],
+[dnl Having the pthread flag is required at least on GCC3 where
+dnl boost/thread.hpp would complain if we try to compile without
+dnl -pthread on GNU/Linux.
+AC_REQUIRE([_BOOST_PTHREAD_FLAG])dnl
+boost_thread_save_LIBS=$LIBS
+boost_thread_save_LDFLAGS=$LDFLAGS
+boost_thread_save_CPPFLAGS=$CPPFLAGS
+# Link-time dependency from thread to system was added as of 1.49.0.
+if test $boost_major_version -ge 149; then
+BOOST_SYSTEM([$1], [$2])
+fi # end of the Boost.System check.
+m4_pattern_allow([^BOOST_SYSTEM_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS"
+CPPFLAGS="$CPPFLAGS $boost_cv_pthread_flag"
+
+# When compiling for the Windows platform, the threads library is named
+# differently. This suffix doesn't exist in new versions of Boost, or
+# possibly new versions of GCC on mingw I am assuming it's Boost's change for
+# now and I am setting version to 1.48, for lack of knowledge as to when this
+# change occurred.
+if test $boost_major_version -lt 148; then
+ case $host_os in
+ (*mingw*) boost_thread_lib_ext=_win32;;
+ esac
+fi
+BOOST_FIND_LIBS([thread], [thread$boost_thread_lib_ext],
+ [$1],
+ [boost/thread.hpp], [boost::thread t; boost::mutex m;], [], [], [$2])
+
+case $host_os in
+ (*mingw*) boost_thread_w32_socket_link=-lws2_32;;
+esac
+
+BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS $BOOST_SYSTEM_LIBS $boost_cv_pthread_flag $boost_thread_w32_socket_link"
+BOOST_THREAD_LDFLAGS="$BOOST_SYSTEM_LDFLAGS"
+BOOST_CPPFLAGS="$BOOST_CPPFLAGS $boost_cv_pthread_flag"
+LIBS=$boost_thread_save_LIBS
+LDFLAGS=$boost_thread_save_LDFLAGS
+CPPFLAGS=$boost_thread_save_CPPFLAGS
+])# BOOST_THREAD
+
+AU_ALIAS([BOOST_THREADS], [BOOST_THREAD])
+
+
+# BOOST_TOKENIZER()
+# -----------------
+# Look for Boost.Tokenizer
+BOOST_DEFUN([Tokenizer],
+[BOOST_FIND_HEADER([boost/tokenizer.hpp])])
+
+
+# BOOST_TRIBOOL()
+# ---------------
+# Look for Boost.Tribool
+BOOST_DEFUN([Tribool],
+[BOOST_FIND_HEADER([boost/logic/tribool_fwd.hpp])
+BOOST_FIND_HEADER([boost/logic/tribool.hpp])
+])
+
+
+# BOOST_TUPLE()
+# -------------
+# Look for Boost.Tuple
+BOOST_DEFUN([Tuple],
+[BOOST_FIND_HEADER([boost/tuple/tuple.hpp])])
+
+
+# BOOST_TYPETRAITS()
+# --------------------
+# Look for Boost.TypeTraits
+BOOST_DEFUN([TypeTraits],
+[BOOST_FIND_HEADER([boost/type_traits.hpp])])
+
+
+# BOOST_UTILITY()
+# ---------------
+# Look for Boost.Utility (noncopyable, result_of, base-from-member idiom,
+# etc.)
+BOOST_DEFUN([Utility],
+[BOOST_FIND_HEADER([boost/utility.hpp])])
+
+
+# BOOST_VARIANT()
+# ---------------
+# Look for Boost.Variant.
+BOOST_DEFUN([Variant],
+[BOOST_FIND_HEADER([boost/variant/variant_fwd.hpp])
+BOOST_FIND_HEADER([boost/variant.hpp])])
+
+
+# BOOST_POINTER_CONTAINER()
+# ------------------------
+# Look for Boost.PointerContainer
+BOOST_DEFUN([Pointer_Container],
+[BOOST_FIND_HEADER([boost/ptr_container/ptr_deque.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_list.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_vector.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_array.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_set.hpp])
+BOOST_FIND_HEADER([boost/ptr_container/ptr_map.hpp])
+])# BOOST_POINTER_CONTAINER
+
+
+# BOOST_WAVE([PREFERRED-RT-OPT], [ERROR_ON_UNUSABLE])
+# ------------------------------
+# NOTE: If you intend to use Wave/Spirit with thread support, make sure you
+# call BOOST_THREAD first.
+# Look for Boost.Wave. For the documentation of PREFERRED-RT-OPT, see the
+# documentation of BOOST_FIND_LIB above.
+BOOST_DEFUN([Wave],
+[AC_REQUIRE([BOOST_FILESYSTEM])dnl
+AC_REQUIRE([BOOST_DATE_TIME])dnl
+boost_wave_save_LIBS=$LIBS
+boost_wave_save_LDFLAGS=$LDFLAGS
+m4_pattern_allow([^BOOST_((FILE)?SYSTEM|DATE_TIME|THREAD)_(LIBS|LDFLAGS)$])dnl
+LIBS="$LIBS $BOOST_SYSTEM_LIBS $BOOST_FILESYSTEM_LIBS $BOOST_DATE_TIME_LIBS \
+$BOOST_THREAD_LIBS"
+LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LDFLAGS $BOOST_FILESYSTEM_LDFLAGS \
+$BOOST_DATE_TIME_LDFLAGS $BOOST_THREAD_LDFLAGS"
+BOOST_FIND_LIB([wave], [$1],
+ [boost/wave.hpp],
+ [boost::wave::token_id id; get_token_name(id);], [], [], [$2])
+LIBS=$boost_wave_save_LIBS
+LDFLAGS=$boost_wave_save_LDFLAGS
+])# BOOST_WAVE
+
+
+# BOOST_XPRESSIVE()
+# -----------------
+# Look for Boost.Xpressive (new since 1.36.0).
+BOOST_DEFUN([Xpressive],
+[BOOST_FIND_HEADER([boost/xpressive/xpressive.hpp])])
+
+
+# ----------------- #
+# Internal helpers. #
+# ----------------- #
+
+
+# _BOOST_PTHREAD_FLAG()
+# ---------------------
+# Internal helper for BOOST_THREAD. Computes boost_cv_pthread_flag
+# which must be used in CPPFLAGS and LIBS.
+#
+# Yes, we *need* to put the -pthread thing in CPPFLAGS because with GCC3,
+# boost/thread.hpp will trigger a #error if -pthread isn't used:
+# boost/config/requires_threads.hpp:47:5: #error "Compiler threading support
+# is not turned on. Please set the correct command line options for
+# threading: -pthread (Linux), -pthreads (Solaris) or -mthreads (Mingw32)"
+#
+# Based on ACX_PTHREAD: http://autoconf-archive.cryp.to/acx_pthread.html
+AC_DEFUN([_BOOST_PTHREAD_FLAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_LANG_PUSH([C++])dnl
+AC_CACHE_CHECK([for the flags needed to use pthreads], [boost_cv_pthread_flag],
+[ boost_cv_pthread_flag=
+ # The ordering *is* (sometimes) important. Some notes on the
+ # individual items follow:
+ # (none): in case threads are in libc; should be tried before -Kthread and
+ # other compiler flags to prevent continual compiler warnings
+ # -lpthreads: AIX (must check this before -lpthread)
+ # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # -llthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+ # -pthread: GNU Linux/GCC (kernel threads), BSD/GCC (userland threads)
+ # -pthreads: Solaris/GCC
+ # -mthreads: MinGW32/GCC, Lynx/GCC
+ # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+ # doesn't hurt to check since this sometimes defines pthreads too;
+ # also defines -D_REENTRANT)
+ # ... -mt is also the pthreads flag for HP/aCC
+ # -lpthread: GNU Linux, etc.
+ # --thread-safe: KAI C++
+ case $host_os in #(
+ *solaris*)
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthreads/-mt/
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+ boost_pthread_flags="-pthreads -lpthread -mt -pthread";; #(
+ *)
+ boost_pthread_flags="-lpthreads -Kthread -kthread -llthread -pthread \
+ -pthreads -mthreads -lpthread --thread-safe -mt";;
+ esac
+ # Generate the test file.
+ AC_LANG_CONFTEST([AC_LANG_PROGRAM([#include <pthread.h>
+ void *f(void*){ return 0; }],
+ [pthread_t th; pthread_create(&th,0,f,0); pthread_join(th,0);
+ pthread_attr_t attr; pthread_attr_init(&attr); pthread_cleanup_push(0, 0);
+ pthread_cleanup_pop(0);])])
+ for boost_pthread_flag in '' $boost_pthread_flags; do
+ boost_pthread_ok=false
+dnl Re-use the test file already generated.
+ boost_pthreads__save_LIBS=$LIBS
+ LIBS="$LIBS $boost_pthread_flag"
+ AC_LINK_IFELSE([],
+ [if grep ".*$boost_pthread_flag" conftest.err; then
+ echo "This flag seems to have triggered warnings" >&AS_MESSAGE_LOG_FD
+ else
+ boost_pthread_ok=:; boost_cv_pthread_flag=$boost_pthread_flag
+ fi])
+ LIBS=$boost_pthreads__save_LIBS
+ $boost_pthread_ok && break
+ done
+])
+AC_LANG_POP([C++])dnl
+])# _BOOST_PTHREAD_FLAG
+
+
+# _BOOST_gcc_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_gcc_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC @ gcc$1$2"])dnl
+
+# _BOOST_mingw_test(MAJOR, MINOR)
+# -----------------------------
+# Internal helper for _BOOST_FIND_COMPILER_TAG.
+m4_define([_BOOST_mingw_test],
+["defined __GNUC__ && __GNUC__ == $1 && __GNUC_MINOR__ == $2 && !defined __ICC && \
+ (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw$1$2"])dnl
+
+
+# _BOOST_FIND_COMPILER_TAG()
+# --------------------------
+# Internal. When Boost is installed without --layout=system, each library
+# filename will hold a suffix that encodes the compiler used during the
+# build. The Boost build system seems to call this a `tag'.
+AC_DEFUN([_BOOST_FIND_COMPILER_TAG],
+[AC_REQUIRE([AC_PROG_CXX])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_CACHE_CHECK([for the toolset name used by Boost for $CXX],
+ [boost_cv_lib_tag],
+[boost_cv_lib_tag=unknown
+if test x$boost_cv_inc_path != xno; then
+ AC_LANG_PUSH([C++])dnl
+ # The following tests are mostly inspired by boost/config/auto_link.hpp
+ # The list is sorted to most recent/common to oldest compiler (in order
+ # to increase the likelihood of finding the right compiler with the
+ # least number of compilation attempt).
+ # Beware that some tests are sensible to the order (for instance, we must
+ # look for MinGW before looking for GCC3).
+ # I used one compilation test per compiler with a #error to recognize
+ # each compiler so that it works even when cross-compiling (let me know
+ # if you know a better approach).
+ # Known missing tags (known from Boost's tools/build/v2/tools/common.jam):
+ # como, edg, kcc, bck, mp, sw, tru, xlc
+ # I'm not sure about my test for `il' (be careful: Intel's ICC pre-defines
+ # the same defines as GCC's).
+ for i in \
+ "defined __clang__ && __clang_major__ == 12 && __clang_minor__ == 0 @ clang120" \
+ "defined __clang__ && __clang_major__ == 11 && __clang_minor__ == 1 @ clang111" \
+ "defined __clang__ && __clang_major__ == 11 && __clang_minor__ == 0 @ clang110" \
+ "defined __clang__ && __clang_major__ == 10 && __clang_minor__ == 0 @ clang100" \
+ "defined __clang__ && __clang_major__ == 9 && __clang_minor__ == 0 @ clang90" \
+ "defined __clang__ && __clang_major__ == 8 && __clang_minor__ == 0 @ clang80" \
+ "defined __clang__ && __clang_major__ == 7 && __clang_minor__ == 0 @ clang70" \
+ "defined __clang__ && __clang_major__ == 6 && __clang_minor__ == 0 @ clang60" \
+ "defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 @ clang50" \
+ "defined __clang__ && __clang_major__ == 4 && __clang_minor__ == 0 @ clang40" \
+ "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 9 @ clang39" \
+ "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 8 @ clang38" \
+ "defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 7 @ clang37" \
+ _BOOST_mingw_test(11, 1) \
+ _BOOST_gcc_test(11, 1) \
+ _BOOST_mingw_test(10, 3) \
+ _BOOST_gcc_test(10, 3) \
+ _BOOST_mingw_test(10, 2) \
+ _BOOST_gcc_test(10, 2) \
+ _BOOST_mingw_test(10, 1) \
+ _BOOST_gcc_test(10, 1) \
+ _BOOST_mingw_test(9, 3) \
+ _BOOST_gcc_test(9, 3) \
+ _BOOST_mingw_test(9, 2) \
+ _BOOST_gcc_test(9, 2) \
+ _BOOST_mingw_test(9, 1) \
+ _BOOST_gcc_test(9, 1) \
+ _BOOST_mingw_test(9, 0) \
+ _BOOST_gcc_test(9, 0) \
+ _BOOST_mingw_test(8, 5) \
+ _BOOST_gcc_test(8, 5) \
+ _BOOST_mingw_test(8, 4) \
+ _BOOST_gcc_test(8, 4) \
+ _BOOST_mingw_test(8, 3) \
+ _BOOST_gcc_test(8, 3) \
+ _BOOST_mingw_test(8, 2) \
+ _BOOST_gcc_test(8, 2) \
+ _BOOST_mingw_test(8, 1) \
+ _BOOST_gcc_test(8, 1) \
+ _BOOST_mingw_test(8, 0) \
+ _BOOST_gcc_test(8, 0) \
+ _BOOST_mingw_test(7, 4) \
+ _BOOST_gcc_test(7, 4) \
+ _BOOST_mingw_test(7, 3) \
+ _BOOST_gcc_test(7, 3) \
+ _BOOST_mingw_test(7, 2) \
+ _BOOST_gcc_test(7, 2) \
+ _BOOST_mingw_test(7, 1) \
+ _BOOST_gcc_test(7, 1) \
+ _BOOST_mingw_test(7, 0) \
+ _BOOST_gcc_test(7, 0) \
+ _BOOST_mingw_test(6, 5) \
+ _BOOST_gcc_test(6, 5) \
+ _BOOST_mingw_test(6, 4) \
+ _BOOST_gcc_test(6, 4) \
+ _BOOST_mingw_test(6, 3) \
+ _BOOST_gcc_test(6, 3) \
+ _BOOST_mingw_test(6, 2) \
+ _BOOST_gcc_test(6, 2) \
+ _BOOST_mingw_test(6, 1) \
+ _BOOST_gcc_test(6, 1) \
+ _BOOST_mingw_test(6, 0) \
+ _BOOST_gcc_test(6, 0) \
+ _BOOST_mingw_test(5, 5) \
+ _BOOST_gcc_test(5, 5) \
+ _BOOST_mingw_test(5, 4) \
+ _BOOST_gcc_test(5, 4) \
+ _BOOST_mingw_test(5, 3) \
+ _BOOST_gcc_test(5, 3) \
+ _BOOST_mingw_test(5, 2) \
+ _BOOST_gcc_test(5, 2) \
+ _BOOST_mingw_test(5, 1) \
+ _BOOST_gcc_test(5, 1) \
+ _BOOST_mingw_test(5, 0) \
+ _BOOST_gcc_test(5, 0) \
+ _BOOST_mingw_test(4, 10) \
+ _BOOST_gcc_test(4, 10) \
+ _BOOST_mingw_test(4, 9) \
+ _BOOST_gcc_test(4, 9) \
+ _BOOST_mingw_test(4, 8) \
+ _BOOST_gcc_test(4, 8) \
+ _BOOST_mingw_test(4, 7) \
+ _BOOST_gcc_test(4, 7) \
+ _BOOST_mingw_test(4, 6) \
+ _BOOST_gcc_test(4, 6) \
+ _BOOST_mingw_test(4, 5) \
+ _BOOST_gcc_test(4, 5) \
+ _BOOST_mingw_test(4, 4) \
+ _BOOST_gcc_test(4, 4) \
+ _BOOST_mingw_test(4, 3) \
+ _BOOST_gcc_test(4, 3) \
+ _BOOST_mingw_test(4, 2) \
+ _BOOST_gcc_test(4, 2) \
+ _BOOST_mingw_test(4, 1) \
+ _BOOST_gcc_test(4, 1) \
+ _BOOST_mingw_test(4, 0) \
+ _BOOST_gcc_test(4, 0) \
+ "defined __GNUC__ && __GNUC__ == 3 && !defined __ICC \
+ && (defined WIN32 || defined WINNT || defined _WIN32 || defined __WIN32 \
+ || defined __WIN32__ || defined __WINNT || defined __WINNT__) @ mgw" \
+ _BOOST_gcc_test(3, 4) \
+ _BOOST_gcc_test(3, 3) \
+ "defined _MSC_VER && _MSC_VER >= 1500 @ vc90" \
+ "defined _MSC_VER && _MSC_VER == 1400 @ vc80" \
+ _BOOST_gcc_test(3, 2) \
+ "defined _MSC_VER && _MSC_VER == 1310 @ vc71" \
+ _BOOST_gcc_test(3, 1) \
+ _BOOST_gcc_test(3, 0) \
+ "defined __BORLANDC__ @ bcb" \
+ "defined __ICC && (defined __unix || defined __unix__) @ il" \
+ "defined __ICL @ iw" \
+ "defined _MSC_VER && _MSC_VER == 1300 @ vc7" \
+ _BOOST_gcc_test(2, 95) \
+ "defined __MWERKS__ && __MWERKS__ <= 0x32FF @ cw9" \
+ "defined _MSC_VER && _MSC_VER < 1300 && !defined UNDER_CE @ vc6" \
+ "defined _MSC_VER && _MSC_VER < 1300 && defined UNDER_CE @ evc4" \
+ "defined __MWERKS__ && __MWERKS__ <= 0x31FF @ cw8"
+ do
+ boost_tag_test=`expr "X$i" : 'X\([[^@]]*\) @ '`
+ boost_tag=`expr "X$i" : 'X[[^@]]* @ \(.*\)'`
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if $boost_tag_test
+/* OK */
+#else
+# error $boost_tag_test
+#endif
+]])], [boost_cv_lib_tag=$boost_tag; break], [])
+ done
+AC_LANG_POP([C++])dnl
+ case $boost_cv_lib_tag in #(
+ # Some newer (>= 1.35?) versions of Boost seem to only use "gcc" as opposed
+ # to "gcc41" for instance.
+ *-gcc | *'-gcc ') :;; #( Don't re-add -gcc: it's already in there.
+ gcc*)
+ boost_tag_x=
+ case $host_os in #(
+ darwin*)
+ if test $boost_major_version -ge 136; then
+ # The `x' added in r46793 of Boost.
+ boost_tag_x=x
+ fi;;
+ esac
+ # We can specify multiple tags in this variable because it's used by
+ # BOOST_FIND_LIB that does a `for tag in -$boost_cv_lib_tag' ...
+ boost_cv_lib_tag="$boost_tag_x$boost_cv_lib_tag -${boost_tag_x}gcc"
+ ;; #(
+ unknown)
+ AC_MSG_WARN([[could not figure out which toolset name to use for $CXX]])
+ boost_cv_lib_tag=
+ ;;
+ esac
+fi])dnl end of AC_CACHE_CHECK
+])# _BOOST_FIND_COMPILER_TAG
+
+
+# _BOOST_GUESS_WHETHER_TO_USE_MT()
+# --------------------------------
+# Compile a small test to try to guess whether we should favor MT (Multi
+# Thread) flavors of Boost. Sets boost_guess_use_mt accordingly.
+AC_DEFUN([_BOOST_GUESS_WHETHER_TO_USE_MT],
+[# Check whether we do better use `mt' even though we weren't ask to.
+AC_LANG_PUSH([C++])dnl
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#if defined _REENTRANT || defined _MT || defined __MT__
+/* use -mt */
+#else
+# error MT not needed
+#endif
+]])], [boost_guess_use_mt=:], [boost_guess_use_mt=false])
+AC_LANG_POP([C++])dnl
+])
+
+# _BOOST_AC_LINK_IFELSE(PROGRAM, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+# -------------------------------------------------------------------
+# Fork of _AC_LINK_IFELSE that preserves conftest.o across calls. Fragile,
+# will break when Autoconf changes its internals. Requires that you manually
+# rm -f conftest.$ac_objext in between to really different tests, otherwise
+# you will try to link a conftest.o left behind by a previous test.
+# Used to aggressively optimize BOOST_FIND_LIB (see the big comment in this
+# macro).
+#
+# Don't use "break" in the actions, as it would short-circuit some code
+# this macro runs after the actions.
+m4_define([_BOOST_AC_LINK_IFELSE],
+[m4_ifvaln([$1], [AC_LANG_CONFTEST([$1])])dnl
+rm -f conftest$ac_exeext
+boost_save_ac_ext=$ac_ext
+boost_use_source=:
+# If we already have a .o, re-use it. We change $ac_ext so that $ac_link
+# tries to link the existing object file instead of compiling from source.
+test -f conftest.$ac_objext && ac_ext=$ac_objext && boost_use_source=false &&
+ _AS_ECHO_LOG([re-using the existing conftest.$ac_objext])
+AS_IF([_AC_DO_STDERR($ac_link) && {
+ test -z "$ac_[]_AC_LANG_ABBREV[]_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ $as_executable_p conftest$ac_exeext
+dnl FIXME: use AS_TEST_X instead when 2.61 is widespread enough.
+ }],
+ [$2],
+ [if $boost_use_source; then
+ _AC_MSG_LOG_CONFTEST
+ fi
+ $3])
+ac_objext=$boost_save_ac_objext
+ac_ext=$boost_save_ac_ext
+dnl Delete also the IPA/IPO (Inter Procedural Analysis/Optimization)
+dnl information created by the PGI compiler (conftest_ipa8_conftest.oo),
+dnl as it would interfere with the next link command.
+rm -f core conftest.err conftest_ipa8_conftest.oo \
+ conftest$ac_exeext m4_ifval([$1], [conftest.$ac_ext])[]dnl
+])# _BOOST_AC_LINK_IFELSE
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/m4/dnsdist_enable_dnscrypt.m4 b/m4/dnsdist_enable_dnscrypt.m4
new file mode 100644
index 0000000..6e86d19
--- /dev/null
+++ b/m4/dnsdist_enable_dnscrypt.m4
@@ -0,0 +1,18 @@
+AC_DEFUN([DNSDIST_ENABLE_DNSCRYPT], [
+ AC_MSG_CHECKING([whether to enable DNSCrypt support])
+ AC_ARG_ENABLE([dnscrypt],
+ AS_HELP_STRING([--enable-dnscrypt], [enable DNSCrypt support (requires libsodium) @<:@default=no@:>@]),
+ [enable_dnscrypt=$enableval],
+ [enable_dnscrypt=no]
+ )
+ AC_MSG_RESULT([$enable_dnscrypt])
+ AM_CONDITIONAL([DNSCRYPT], [test "x$enable_dnscrypt" != "xno"])
+
+ AM_COND_IF([DNSCRYPT], [
+ AM_COND_IF([LIBSODIUM], [
+ AC_DEFINE([HAVE_DNSCRYPT], [1], [Define to 1 if you enable dnscrypt support])
+ ],[
+ AC_MSG_ERROR([dnscrypt support requested but libsodium is not available])
+ ])
+ ])
+])
diff --git a/m4/dnsdist_enable_doh.m4 b/m4/dnsdist_enable_doh.m4
new file mode 100644
index 0000000..876a218
--- /dev/null
+++ b/m4/dnsdist_enable_doh.m4
@@ -0,0 +1,15 @@
+AC_DEFUN([DNSDIST_ENABLE_DNS_OVER_HTTPS], [
+ AC_MSG_CHECKING([whether to enable incoming DNS over HTTPS (DoH) support])
+ AC_ARG_ENABLE([dns-over-https],
+ AS_HELP_STRING([--enable-dns-over-https], [enable incoming DNS over HTTPS (DoH) support (requires libh2o) @<:@default=no@:>@]),
+ [enable_dns_over_https=$enableval],
+ [enable_dns_over_https=no]
+ )
+ AC_MSG_RESULT([$enable_dns_over_https])
+ AM_CONDITIONAL([HAVE_DNS_OVER_HTTPS], [test "x$enable_dns_over_https" != "xno"])
+
+ AM_COND_IF([HAVE_DNS_OVER_HTTPS], [
+ AC_DEFINE([HAVE_DNS_OVER_HTTPS], [1], [Define to 1 if you enable DNS over HTTPS support])
+ ])
+])
+
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644
index 0000000..a3bc337
--- /dev/null
+++ b/m4/libtool.m4
@@ -0,0 +1,8369 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
+# Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the same
+# distribution terms that you use for the rest of that program.
+#
+# GNU Libtool 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 <http://www.gnu.org/licenses/>.
+])
+
+# serial 58 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+ [m4_default([$3],
+ [m4_fatal([Libtool version $1 or higher is required],
+ 63)])],
+ [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+ *\ * | *\ *)
+ AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS=$ltmain
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in @S|@*""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
+m4_defun([_LT_CC_BASENAME],
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+m4_require([_LT_CMD_TRUNCATE])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options that allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+old_CC=$CC
+old_CFLAGS=$CFLAGS
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ _LT_PATH_MAGIC
+ fi
+ ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from 'configure', and 'config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain=$ac_aux_dir/ltmain.sh
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the 'libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+ [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+ [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+ [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME. Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+ [m4_ifval([$1], [$1], [$2])])
+ lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+ m4_ifval([$4],
+ [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+ lt_dict_add_subkey([lt_decl_dict], [$2],
+ [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+ [0], [m4_fatal([$0: too few arguments: $#])],
+ [1], [m4_fatal([$0: too few arguments: $#: $1])],
+ [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+ [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+ [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+ m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+ m4_if([$2], [],
+ m4_quote(lt_decl_varnames),
+ m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+ lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'. VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly. In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+# <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+ [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags='_LT_TAGS'dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+# # Some comment about what VAR is for.
+# visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+ [description])))[]dnl
+m4_pushdef([_libtool_name],
+ m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+ [0], [_libtool_name=[$]$1],
+ [1], [_libtool_name=$lt_[]$1],
+ [2], [_libtool_name=$lt_[]$1],
+ [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
+# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+ m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+ [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into 'config.status', and then the shell code to quote escape them in
+# for loops in 'config.status'. Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+ dnl If the libtool generation code has been placed in $CONFIG_LT,
+ dnl instead of duplicating it all over again into config.status,
+ dnl then we will have config.status run $CONFIG_LT later, so it
+ dnl needs to know what name is stored there:
+ [AC_CONFIG_COMMANDS([libtool],
+ [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+ dnl If the libtool generation code is destined for config.status,
+ dnl expand the accumulated commands and init code now:
+ [AC_CONFIG_COMMANDS([libtool],
+ [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+ case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+ *[[\\\\\\\`\\"\\\$]]*)
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
+ ;;
+ *)
+ eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+ ;;
+ esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable. If COMMENT is supplied, it is inserted after the
+# '#!' sequence but before initialization text begins. After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script. The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+ echo
+ AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+'$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2011 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test 0 != $[#]
+do
+ case $[1] in
+ --version | --v* | -V )
+ echo "$lt_cl_version"; exit 0 ;;
+ --help | --h* | -h )
+ echo "$lt_cl_help"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --quiet | --q* | --silent | --s* | -q )
+ lt_cl_silent=: ;;
+
+ -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try '$[0] --help' for more information.]) ;;
+
+ *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try '$[0] --help' for more information.]) ;;
+ esac
+ shift
+done
+
+if $lt_cl_silent; then
+ exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure. Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test yes = "$silent" &&
+ lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars. Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+ m4_if(_LT_TAG, [C], [
+ # See if we are running on zsh, and set the options that allow our
+ # commands through without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}"; then
+ setopt NO_GLOB_SUBST
+ fi
+
+ cfgfile=${ofile}T
+ trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+ $RM "$cfgfile"
+
+ cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+ cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
+ case $host_os in
+ aix3*)
+ cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test set != "${COLLECT_NAMES+set}"; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+_LT_EOF
+ ;;
+ esac
+
+ _LT_PROG_LTMAIN
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" ||
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+ PACKAGE='$PACKAGE'
+ VERSION='$VERSION'
+ RM='$RM'
+ ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+# autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+ [C], [_LT_LANG(C)],
+ [C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
+ [Java], [_LT_LANG(GCJ)],
+ [Fortran 77], [_LT_LANG(F77)],
+ [Fortran], [_LT_LANG(FC)],
+ [Windows Resource], [_LT_LANG(RC)],
+ [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+ [_LT_LANG($1)],
+ [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+ [LT_SUPPORTED_TAG([$1])dnl
+ m4_append([_LT_TAGS], [$1 ])dnl
+ m4_define([_LT_LANG_]$1[_enabled], [])dnl
+ _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [LT_LANG(CXX)],
+ [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [LT_LANG(F77)],
+ [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+ [LT_LANG(FC)],
+ [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+ [LT_LANG(GCJ)],
+ [m4_ifdef([AC_PROG_GCJ],
+ [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([A][M_PROG_GCJ],
+ [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+ m4_ifdef([LT_PROG_GCJ],
+ [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+ [LT_LANG(RC)],
+ [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+ AC_CHECK_TOOL([LIPO], [lipo], [:])
+ AC_CHECK_TOOL([OTOOL], [otool], [:])
+ AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+ _LT_DECL([], [DSYMUTIL], [1],
+ [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+ _LT_DECL([], [NMEDIT], [1],
+ [Tool to change global to local symbols on Mac OS X])
+ _LT_DECL([], [LIPO], [1],
+ [Tool to manipulate fat objects and archives on Mac OS X])
+ _LT_DECL([], [OTOOL], [1],
+ [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+ _LT_DECL([], [OTOOL64], [1],
+ [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "$LT_MULTI_MODULE"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ rm -rf libconftest.dylib*
+ echo "int foo(void){return 1;}" > conftest.c
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+ _lt_result=$?
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
+ lt_cv_apple_cc_single_mod=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -rf libconftest.dylib*
+ rm -f conftest.*
+ fi])
+
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS=$save_LDFLAGS
+ ])
+
+ AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+ [lt_cv_ld_force_load=no
+ cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+ cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+ echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+ $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+ _lt_result=$?
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
+ lt_cv_ld_force_load=yes
+ else
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ fi
+ rm -f conftest.err libconftest.a conftest conftest.c
+ rm -rf conftest.dSYM
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ darwin*) # darwin 5.x on
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]][[,.]]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test yes = "$lt_cv_apple_cc_single_mod"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test yes = "$lt_cv_ld_exported_symbols_list"; then
+ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
+ else
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
+ fi
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
+ _lt_dsymutil='~$DSYMUTIL $lib || :'
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+ m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ if test yes = "$lt_cv_ld_force_load"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
+ case $cc_basename in
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
+ *) _lt_dar_can_shared=$GCC ;;
+ esac
+ if test yes = "$_lt_dar_can_shared"; then
+ output_verbose_link_cmd=func_echo_all
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ m4_if([$1], [CXX],
+[ if test yes != "$lt_cv_apple_cc_single_mod"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+ fi
+],[])
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test set = "${lt_cv_aix_libpath+set}"; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+ ECHO='printf %s\n'
+else
+ # Use this function as a fallback that always works.
+ func_fallback_echo ()
+ {
+ eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+ }
+ ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+ $ECHO "$*"
+}
+
+case $ECHO in
+ printf*) AC_MSG_RESULT([printf]) ;;
+ print*) AC_MSG_RESULT([print -r]) ;;
+ *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ PATH=/empty FPATH=/empty; export PATH FPATH
+ test "X`printf %s $ECHO`" = "X$ECHO" \
+ || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+ [Search for dependent libraries within DIR (or the compiler's sysroot
+ if not specified).])],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case $with_sysroot in #(
+ yes)
+ if test yes = "$GCC"; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([$with_sysroot])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and where our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AS_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE=32
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE=64
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ emul=elf
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
+ x86_64-*linux*)
+ case `/usr/bin/file conftest.o` in
+ *x86-64*)
+ LD="${LD-ld} -m elf32_x86_64"
+ ;;
+ *)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ esac
+ ;;
+ powerpc64le-*linux*)
+ LD="${LD-ld} -m elf32lppclinux"
+ ;;
+ powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ powerpcle-*linux*)
+ LD="${LD-ld} -m elf64lppc"
+ ;;
+ powerpc-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*|s390*-*tpf*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test yes != "$lt_cv_cc_needs_belf"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS=$SAVE_CFLAGS
+ fi
+ ;;
+*-*solaris*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*)
+ case $host in
+ i?86-*-solaris*|x86_64-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD=${LD-ld}_sol2
+ fi
+ ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+esac
+
+need_locks=$enable_libtool_lock
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test 0 -eq "$ac_status"; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test 0 -ne "$ac_status"; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test no = "$lt_cv_ar_at_file"; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+ [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ bitrig* | openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+ darwin*)
+ lock_old_archive_extraction=yes ;;
+ *)
+ lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+ [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+ [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $RM conftest*
+])
+
+if test yes = "[$]$2"; then
+ m4_if([$5], , :, [$5])
+else
+ m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS $3"
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $RM -r conftest*
+ LDFLAGS=$save_LDFLAGS
+])
+
+if test yes = "[$]$2"; then
+ m4_if([$4], , :, [$4])
+else
+ m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring=ABCD
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw* | cegcc*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ mint*)
+ # On MiNT this can take a long time and run out of memory.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len" && \
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ # Make teststring a little bigger before we do anything with it.
+ # a 1K string should be a reasonable start.
+ for i in 1 2 3 4 5 6 7 8; do
+ teststring=$teststring$teststring
+ done
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
+ = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+ test 17 != "$i" # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ # Only check the string length outside the loop.
+ lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on
+ # massive amounts of additional arguments before passing them to the
+ # linker. It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
+ ;;
+ esac
+])
+if test -n "$lt_cv_sys_max_cmd_len"; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+ [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test yes = "$cross_compiling"; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+/* When -fvisibility=hidden is used, assume the code has been annotated
+ correspondingly for the symbols needed. */
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else
+ {
+ if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ else puts (dlerror ());
+ }
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ return status;
+}]
+_LT_EOF
+ if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test yes != "$enable_dlopen"; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen=load_add_on
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32* | cegcc*)
+ lt_cv_dlopen=LoadLibrary
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
+ lt_cv_dlopen=dyld
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen=shl_load],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen=dlopen],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test no = "$lt_cv_dlopen"; then
+ enable_dlopen=no
+ else
+ enable_dlopen=yes
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS=$LDFLAGS
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS=$LIBS
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test yes = "$lt_cv_dlopen_self"; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+ [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+ [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+ [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $RM -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $RM conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+ $RM out/* && rmdir out
+ cd ..
+ $RM -r conftest
+ $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+ [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $RM conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test no = "$hard_links"; then
+ AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+ [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+ [Define to the sub-directory where libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+ test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+ test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
+
+ # We can hardcode non-existent directories.
+ if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+ test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+ test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+ [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP"; then
+ striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x@S|@2 in
+ x)
+ ;;
+ *:)
+ eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
+ ;;
+ x:*)
+ eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+ ;;
+ *)
+ eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+ [], [
+if test yes = "$GCC"; then
+ case $host_os in
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
+ esac
+ case $host_os in
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+ case $lt_search_path_spec in
+ *\;*)
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+ ;;
+ *)
+ lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ esac
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary...
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+ elif test -n "$lt_multi_os_dir"; then
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS = " "; FS = "/|\n";} {
+ lt_foo = "";
+ lt_count = 0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo = "/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ # AWK program above erroneously prepends '/' to C:/dos/paths
+ # for these hosts.
+ case $host_os in
+ mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
+ esac
+ sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=.so
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
+case $host_os in
+aix3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+
+aix[[4-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 supports IA64
+ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line '#! .'. This would cause the generated library to
+ # depend on '.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # Using Import Files as archive members, it is possible to support
+ # filename-based versioning of shared library archives on AIX. While
+ # this would work for both with and without runtime linking, it will
+ # prevent static linking of such archives. So we do filename-based
+ # shared library versioning with .so extension only, which is used
+ # when both runtime linking and shared linking is enabled.
+ # Unfortunately, runtime linking may impact performance, so we do
+ # not want this to be the default eventually. Also, we use the
+ # versioned .so libs for executables only if there is the -brtl
+ # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # To allow for filename-based versioning support, we need to create
+ # libNAME.so.V as an archive file, containing:
+ # *) an Import File, referring to the versioned filename of the
+ # archive as well as the shared archive member, telling the
+ # bitwidth (32 or 64) of that shared object, and providing the
+ # list of exported symbols of that shared object, eventually
+ # decorated with the 'weak' keyword
+ # *) the shared object with the F_LOADONLY flag set, to really avoid
+ # it being seen by the linker.
+ # At run time we better use the real file rather than another symlink,
+ # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+ case $with_aix_soname,$aix_use_runtimelinking in
+ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ aix,yes) # traditional libtool
+ dynamic_linker='AIX unversionable lib.so'
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ aix,no) # traditional AIX only
+ dynamic_linker='AIX lib.a[(]lib.so.V[)]'
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ svr4,*) # full svr4 only
+ dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,yes) # both, prefer svr4
+ dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # unpreferred sharedlib libNAME.a needs extra handling
+ postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+ postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,no) # both, prefer aix
+ dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+ postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+ postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+ ;;
+ esac
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ case $host_cpu in
+ powerpc)
+ # Since July 2007 AmigaOS4 officially supports .so libraries.
+ # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ m68k)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+ esac
+ ;;
+
+beos*)
+ library_names_spec='$libname$shared_ext'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+ ;;
+ mingw* | cegcc*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec=$LIB
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
+ ;;
+
+ *)
+ # Assume MSVC wrapper
+ library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
+ dynamic_linker='Win32 ld.exe'
+ ;;
+ esac
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[23]].*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2.*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ *) # from 4.6 on, and DragonFly
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+haiku*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ dynamic_linker="$host_os runtime_loader"
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ if test 32 = "$HPUX_IA64_MODE"; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux32
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux64
+ fi
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+ postinstall_cmds='chmod 555 $lib'
+ # or fails outright, so override atomically:
+ install_override_mode=555
+ ;;
+
+interix[[3-9]]*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test yes = "$lt_cv_prog_gnu_ld"; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+
+ # Some binutils ld are patched to set DT_RUNPATH
+ AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+ [lt_cv_shlibpath_overrides_runpath=no
+ save_LDFLAGS=$LDFLAGS
+ save_libdir=$libdir
+ eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+ [lt_cv_shlibpath_overrides_runpath=yes])])
+ LDFLAGS=$save_LDFLAGS
+ libdir=$save_libdir
+ ])
+ shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Ideally, we could use ldconfig to report *all* directores which are
+ # searched for libraries, however this is still not possible. Aside from not
+ # being certain /sbin/ldconfig is available, command
+ # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+ # even though it is searched at run-time. Try to do the best guess by
+ # appending ld.so.conf contents (and includes) to the search path.
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+*nto* | *qnx*)
+ version_type=qnx
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='ldqnx.so'
+ ;;
+
+openbsd* | bitrig*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec=/usr/lib
+ need_lib_prefix=no
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
+ else
+ need_version=yes
+ fi
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+os2*)
+ libname_spec='$name'
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
+ need_lib_prefix=no
+ # OS/2 can only load a DLL with a base name of 8 characters or less.
+ soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+ v=$($ECHO $release$versuffix | tr -d .-);
+ n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+ $ECHO $n$v`$shared_ext'
+ library_names_spec='${libname}_dll.$libext'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+
+rdos*)
+ dynamic_linker=no
+ ;;
+
+solaris*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test yes = "$with_gnu_ld"; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec; then
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=sco
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ if test yes = "$with_gnu_ld"; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+tpf*)
+ # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
+ version_type=linux # correct to gnu/linux during the next big refactor
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+uts4*)
+ version_type=linux # correct to gnu/linux during the next big refactor
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test no = "$dynamic_linker" && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test yes = "$GCC"; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
+fi
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
+fi
+
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+ [Variables whose values should be saved in libtool wrapper scripts and
+ restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+ [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+ [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+ [[List of archive names. First name is the real one, the rest are links.
+ The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+ [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+ [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+ [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+ [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+ [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+ [[As "finish_cmds", except a single script fragment to be evaled but
+ not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+ [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+ [Compile-time system search path for libraries])
+_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
+ [Detected run-time system search path for libraries])
+_LT_DECL([], [configure_time_lt_sys_library_path], [2],
+ [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program that can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="m4_if([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$1"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
+ ;;
+esac])
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+ [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program that can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+ [AS_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test no = "$withval" || with_gnu_ld=yes],
+ [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test yes = "$GCC"; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return, which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+ while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD=$ac_prog
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test yes = "$with_gnu_ld"; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD=$ac_dir/$ac_prog
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test no != "$with_gnu_ld" && break
+ ;;
+ *)
+ test yes != "$with_gnu_ld" && break
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+else
+ lt_cv_path_LD=$LD # Let the user override the test with a path.
+fi])
+LD=$lt_cv_path_LD
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test yes != "$GCC"; then
+ reload_cmds=false
+ fi
+ ;;
+ darwin*)
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_PATH_DD
+# -----------
+# find a working dd
+m4_defun([_LT_PATH_DD],
+[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
+[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi])
+rm -f conftest.i conftest2.i conftest.out])
+])# _LT_PATH_DD
+
+
+# _LT_CMD_TRUNCATE
+# ----------------
+# find command to truncate a binary pipe
+m4_defun([_LT_CMD_TRUNCATE],
+[m4_require([_LT_PATH_DD])
+AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
+_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
+ [Command to truncate a binary pipe])
+])# _LT_CMD_TRUNCATE
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# 'unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ # Keep this pattern in sync with the one in func_win32_libid.
+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
+ ;;
+
+cegcc*)
+ # use the weaker test based on 'objdump'. See mingw*.
+ lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | dragonfly*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+haiku*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix[[3-9]]*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+*nto* | *qnx*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+openbsd* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+tpf*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+ [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM=$NM
+else
+ lt_nm_to_check=${ac_tool_prefix}nm
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS=$lt_save_ifs
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm=$ac_dir/$lt_tmp_nm
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+ case $build_os in
+ mingw*) lt_bad_file=conftest.nm/nofile ;;
+ *) lt_bad_file=/dev/null ;;
+ esac
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ *$lt_bad_file* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break 2
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break 2
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS=$lt_save_ifs
+ done
+ : ${lt_cv_path_NM=no}
+fi])
+if test no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
+else
+ # Didn't find any BSD compatible name lister, look for dumpbin.
+ if test -n "$DUMPBIN"; then :
+ # Let the user override the test.
+ else
+ AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ *COFF*)
+ DUMPBIN="$DUMPBIN -symbols -headers"
+ ;;
+ *)
+ DUMPBIN=:
+ ;;
+ esac
+ fi
+ AC_SUBST([DUMPBIN])
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
+ fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+ [lt_cv_nm_interface="BSD nm"
+ echo "int some_variable = 0;" > conftest.$ac_ext
+ (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$ac_compile" 2>conftest.err)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+ cat conftest.out >&AS_MESSAGE_LOG_FD
+ if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+ lt_cv_nm_interface="MS dumpbin"
+ fi
+ rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test yes != "$lt_cv_path_mainfest_tool"; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+ test DEF = "`$SED -n dnl
+ -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
+ -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
+ -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
+ -e q dnl Only consider the first "real" line
+ $1`" dnl
+])# _LT_DLL_DEF_P
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM=-lm)
+ ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test yes = "$GCC"; then
+ case $cc_basename in
+ nvcc*)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+ esac
+
+ _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+ [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32* | cegcc*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*)
+ if test ia64 = "$host_cpu"; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Fake it for dumpbin and say T for any non-static function,
+ # D for any global variable and I for any imported variable.
+ # Also find C++ and __fastcall symbols from MSVC++,
+ # which start with @ or ?.
+ lt_cv_sys_global_symbol_pipe="$AWK ['"\
+" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
+" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
+" \$ 0!~/External *\|/{next};"\
+" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+" {if(hide[section]) next};"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
+" ' prfx=^$ac_symprfx]"
+ else
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined __osf__
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+ cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols. */
+LT@&t@_DLSYM_CONST struct {
+ const char *name;
+ void *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+ { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ cat <<\_LT_EOF >> conftest.$ac_ext
+ {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
+ LIBS=conftstm.$ac_objext
+ CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
+ pipe_works=yes
+ fi
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -rf conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test yes = "$pipe_works"; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+ [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+ [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+ [Transform the output of nm into a list of symbols to manually relocate])
+_LT_DECL([global_symbol_to_c_name_address],
+ [lt_cv_sys_global_symbol_to_c_name_address], [1],
+ [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+ [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+ [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+ [The name lister interface])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+ # C++ specific cases for pic, static, wl, etc.
+ if test yes = "$GXX"; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix[[4-9]]*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ if test ia64 != "$host_cpu"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ ecpc* )
+ # old Intel C++ for x86_64, which still supported -KPIC.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ icpc* )
+ # Intel C++, used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+ # IBM XL 8.0, 9.0 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ *qnx* | *nto*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ m68k)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ esac
+ ;;
+
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ haiku*)
+ # PIC is the default for Haiku.
+ # The "-static" flag exists, but is broken.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ ;;
+
+ hpux*)
+ # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+ # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
+ # sets the default TLS model and affects inlining.
+ case $host_cpu in
+ hppa*64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+
+ case $cc_basename in
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test ia64 = "$host_cpu"; then
+ # AIX 5 now supports IA64 processor
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+
+ mingw* | cygwin* | pw32* | os2* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ # old Intel for x86_64, which still supported -KPIC.
+ ecc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # icc used to be incompatible with GCC.
+ # ICC 10 doesn't accept -KPIC any more.
+ icc* | ifort*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ # Lahey Fortran 8.1.
+ lf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ ;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ xl* | bgxl* | bgf* | mpixl*)
+ # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *nto* | *qnx*)
+ # QNX uses GNU C++, but need to define -shared option too, otherwise
+ # it will coredump.
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ rdos*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+case $host_os in
+ # For platforms that do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+ [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ case $host_os in
+ aix[[4-9]]*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
+ ;;
+ cygwin* | mingw* | cegcc*)
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+], [
+ runpath_var=
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(archive_cmds, $1)=
+ _LT_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_TAGVAR(compiler_needs_object, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(hardcode_automatic, $1)=no
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_TAGVAR(inherit_rpath, $1)=no
+ _LT_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_TAGVAR(module_cmds, $1)=
+ _LT_TAGVAR(module_expsym_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+ _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ' (' and ')$', so one must not match beginning or
+ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+ # as well as any symbol that contains 'd'.
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test yes != "$GCC"; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd* | bitrig*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+
+ # On some targets, GNU ld is compatible enough with the native linker
+ # that we're better off using the native interface for both.
+ lt_use_gnu_ld_interface=no
+ if test yes = "$with_gnu_ld"; then
+ case $host_os in
+ aix*)
+ # The AIX port of GNU ld has always aspired to compatibility
+ # with the native linker. However, as the warning in the GNU ld
+ # block says, versions before 2.19.5* couldn't really create working
+ # shared libraries, regardless of the interface used.
+ case `$LD -v 2>&1` in
+ *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+ *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+ *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ ;;
+ *)
+ lt_use_gnu_ld_interface=yes
+ ;;
+ esac
+ fi
+
+ if test yes = "$lt_use_gnu_ld_interface"; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='$wl'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
+ *GNU\ gold*) supports_anon_versioning=yes ;;
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix[[3-9]]*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test ia64 != "$host_cpu"; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+ tmp_diet=no
+ if test linux-dietlibc = "$host_os"; then
+ case $cc_basename in
+ diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
+ esac
+ fi
+ if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ && test no = "$tmp_diet"
+ then
+ tmp_addflag=' $pic_flag'
+ tmp_sharedflag='-shared'
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95* | pgfortran*)
+ # Portland Group f77 and f90 compilers
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ lf95*) # Lahey Fortran 8.1
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
+ xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+ tmp_sharedflag='-qmkshrobj'
+ tmp_addflag= ;;
+ nvcc*) # Cuda Compiler Driver 2.2
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ ;;
+ esac
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+
+ if test yes = "$supports_anon_versioning"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+
+ case $cc_basename in
+ tcc*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
+ ;;
+ xlf* | bgf* | bgxlf* | mpixlf*)
+ # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ esac
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
+ runpath_var=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test ia64 = "$host_cpu"; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
+ if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # traditional, no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ ;;
+ esac
+
+ if test yes = "$GCC"; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`$CC -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
+ fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
+ else
+ shared_flag='$wl-bM:SRE'
+ fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ case $host_cpu in
+ powerpc)
+ # see comment about AmigaOS4 .so support
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)=''
+ ;;
+ m68k)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ ;;
+
+ bsdi[[45]]*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
+ ;;
+
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ dgux*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2.*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | dragonfly*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ ;;
+
+ hpux10*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ m4_if($1, [], [
+ # Older versions of the 11.00 compiler do not understand -b yet
+ # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+ _LT_LINKER_OPTION([if $CC understands -b],
+ _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ ;;
+ esac
+ fi
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ # Try to use the -exported_symbol ld option, if it does not
+ # work, assume that -exports_file does not work either and
+ # implicitly export all symbols.
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS=$save_LDFLAGS])
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+ fi
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ linux*)
+ case $cc_basename in
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *nto* | *qnx*)
+ ;;
+
+ openbsd* | bitrig*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ fi
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ osf3*)
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ else
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ else
+ case `$CC -V 2>&1` in
+ *"Compilers 5.0"*)
+ wlarc=''
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ ;;
+ *)
+ wlarc='$wl'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ ;;
+ esac
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'. GCC discards it without '$wl',
+ # but is careful enough not to reorder.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test sequent = "$host_vendor"; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We CANNOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ if test sni = "$host_vendor"; then
+ case $host in
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
+ ;;
+ esac
+ fi
+ fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+ [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test yes,yes = "$GCC,$enable_shared"; then
+ case $_LT_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+ [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+ [$RM conftest*
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+ _LT_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+ then
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $RM conftest*
+ ])
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+ [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+ [enable_shared_with_static_runtimes], [0],
+ [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+ [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+ [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+ [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+ [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+ [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+ [Commands used to build a loadable module if different from building
+ a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+ [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+ [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+ [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+ [Flag to hardcode $libdir into a binary during linking.
+ This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+ [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+ DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
+ DIR into the resulting binary and the resulting library dependency is
+ "absolute", i.e impossible to change by setting $shlibpath_var if the
+ library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+ [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+ [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+ into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+ [Set to "yes" if building a shared library automatically hardcodes DIR
+ into the library and all subsequent libraries and executables linked
+ against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+ [Set to yes if linker adds runtime paths of dependent libraries
+ to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+ [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+ [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+ [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+ [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+ [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+ [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+ [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC=$CC
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+ LT_SYS_DLOPEN_SELF
+ _LT_CMD_STRIPLIB
+
+ # Report what library types will actually be built
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test no = "$can_build_shared" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+ aix[[4-9]]*)
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test yes = "$enable_shared" || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC=$lt_save_CC
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined. These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test no != "$CXX" &&
+ ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+ (test g++ != "$CXX"))); then
+ AC_PROG_CXXCPP
+else
+ _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_caught_CXX_error"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="int some_variable = 0;"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
+ lt_save_LD=$LD
+ lt_save_GCC=$GCC
+ GCC=$GXX
+ lt_save_with_gnu_ld=$with_gnu_ld
+ lt_save_path_LD=$lt_cv_path_LD
+ if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+ else
+ $as_unset lt_cv_prog_gnu_ld
+ fi
+ if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+ else
+ $as_unset lt_cv_path_LD
+ fi
+ test -z "${LDCXX+set}" || LD=$LDCXX
+ CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ # We don't want -fno-exception when compiling C++ code, so set the
+ # no_builtin_flag separately
+ if test yes = "$GXX"; then
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+ else
+ _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+ fi
+
+ if test yes = "$GXX"; then
+ # Set up default GNU C++ configuration
+
+ LT_PATH_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test yes = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='$wl'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+ $GREP 'no-whole-archive' > /dev/null; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ else
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+ fi
+
+ # PORTME: fill in a description of your system's C++ link characteristics
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix[[4-9]]*)
+ if test ia64 = "$host_cpu"; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_TAGVAR(archive_cmds, $1)=''
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ ;;
+ esac
+
+ if test yes = "$GXX"; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`$CC -print-prog-name=collect2`
+ if test -f "$collect2name" &&
+ strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ :
+ else
+ # We have old collect2
+ _LT_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag=$shared_flag' $wl-G'
+ fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
+ else
+ # not using gcc
+ if test ia64 = "$host_cpu"; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
+ else
+ shared_flag='$wl-bM:SRE'
+ fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
+ fi
+ fi
+
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to
+ # export.
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ # The "-G" linker flag allows undefined symbols.
+ _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
+ # Determine the default libpath from the value encoded in an empty
+ # executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
+ else
+ if test ia64 = "$host_cpu"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
+ _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an
+ # empty executable.
+ _LT_SYS_MODULE_PATH_AIX([$1])
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
+ # We only use this code for GNU lds that support --whole-archive.
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+ else
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ fi
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared
+ # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32* | cegcc*)
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=.dll
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ darwin* | rhapsody*)
+ _LT_DARWIN_LINKER_FEATURES($1)
+ ;;
+
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ freebsd2.*)
+ # C++ shared libraries reported to be fairly broken before
+ # switch to ELF
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ freebsd-elf*)
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+
+ freebsd* | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ haiku*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ hpux9*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ hpux10*|hpux11*)
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ interix[[3-9]]*)
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ else
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
+ fi
+ fi
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_TAGVAR(inherit_rpath, $1)=yes
+ ;;
+
+ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc* | ecpc* )
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
+ ;;
+ pgCC* | pgcpp*)
+ # Portland Group C++ compiler
+ case `$CC -V` in
+ *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+ _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
+ _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 6 and above use weak symbols
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ ;;
+ xl* | mpixl* | bgxl*)
+ # IBM XL 8.0 on PPC, with GNU ld
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
+ fi
+ ;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
+ _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+
+ *nto* | *qnx*)
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+
+ openbsd* | bitrig*)
+ if test -f /usr/libexec/ld.so; then
+ _LT_TAGVAR(hardcode_direct, $1)=yes
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
+ fi
+ output_verbose_link_cmd=func_echo_all
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ case $host in
+ osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+ *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+ esac
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ case $host in
+ osf3*)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ ;;
+ *)
+ _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+ $RM $lib.exp'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ ;;
+ *)
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ case $host in
+ osf3*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ ;;
+ esac
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ case $cc_basename in
+ CC* | sunCC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine and reorder linker options,
+ # but understands '-z linker_flag'.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ ;;
+ esac
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='func_echo_all'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
+ if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ else
+ # g++ 2.7 appears to require '-G' NOT '-shared' on this
+ # platform.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ fi
+
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We CANNOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
+ _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+ '"$_LT_TAGVAR(reload_cmds, $1)"
+ ;;
+ *)
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+
+ AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+ test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
+
+ _LT_TAGVAR(GCC, $1)=$GXX
+ _LT_TAGVAR(LD, $1)=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+ LDCXX=$LD
+ LD=$lt_save_LD
+ GCC=$lt_save_GCC
+ with_gnu_ld=$lt_save_with_gnu_ld
+ lt_cv_path_LDCXX=$lt_cv_path_LD
+ lt_cv_path_LD=$lt_save_path_LD
+ lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test yes != "$_lt_caught_CXX_error"
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case @S|@2 in
+ .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+ *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+ subroutine foo
+ implicit none
+ integer a
+ a=0
+ return
+ end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ for p in `eval "$output_verbose_link_cmd"`; do
+ case $prev$p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test x-L = "$p" ||
+ test x-R = "$p"; then
+ prev=$p
+ continue
+ fi
+
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
+ if test no = "$pre_test_object_deps_done"; then
+ case $prev in
+ -L | -R)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
+ else
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+ _LT_TAGVAR(postdeps, $1)=$prev$p
+ else
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
+ fi
+ fi
+ prev=
+ ;;
+
+ *.lto.$objext) ;; # Ignore GCC LTO objects
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test no = "$pre_test_object_deps_done"; then
+ if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+ _LT_TAGVAR(predep_objects, $1)=$p
+ else
+ _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+ _LT_TAGVAR(postdep_objects, $1)=$p
+ else
+ _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_TAGVAR(predep_objects,$1)=
+ _LT_TAGVAR(postdep_objects,$1)=
+ _LT_TAGVAR(postdeps,$1)=
+ ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+ [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+ [Dependencies to place before and after the objects being linked to
+ create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+ [The library search path used internally by the compiler when linking
+ a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test no = "$F77"; then
+ _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_F77"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+ GCC=$G77
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test no = "$can_build_shared" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test yes = "$enable_shared" || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)=$G77
+ _LT_TAGVAR(LD, $1)=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test no = "$FC"; then
+ _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working. Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test yes != "$_lt_disable_FC"; then
+ # Code to be used in simple compile tests
+ lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
+
+ # Code to be used in simple link tests
+ lt_simple_link_test_code="\
+ program t
+ end
+"
+
+ # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+ _LT_TAG_COMPILER
+
+ # save warnings/boilerplate of simple test code
+ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+
+ # Allow CC to be a program name with arguments.
+ lt_save_CC=$CC
+ lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
+ CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
+ compiler=$CC
+ GCC=$ac_cv_fc_compiler_gnu
+
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+
+ if test -n "$compiler"; then
+ AC_MSG_CHECKING([if libtool supports shared libraries])
+ AC_MSG_RESULT([$can_build_shared])
+
+ AC_MSG_CHECKING([whether to build shared libraries])
+ test no = "$can_build_shared" && enable_shared=no
+
+ # On AIX, shared libraries and static libraries use the same namespace, and
+ # are all built from PIC.
+ case $host_os in
+ aix3*)
+ test yes = "$enable_shared" && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+ aix[[4-9]]*)
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
+ fi
+ ;;
+ esac
+ AC_MSG_RESULT([$enable_shared])
+
+ AC_MSG_CHECKING([whether to build static libraries])
+ # Make sure either enable_shared or enable_static is yes.
+ test yes = "$enable_shared" || enable_static=yes
+ AC_MSG_RESULT([$enable_static])
+
+ _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+ _LT_TAGVAR(LD, $1)=$LD
+
+ ## CAVEAT EMPTOR:
+ ## There is no encapsulation within the following macros, do not change
+ ## the running order or otherwise move them around unless you know exactly
+ ## what you are doing...
+ _LT_SYS_HIDDEN_LIBDEPS($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_SYS_DYNAMIC_LINKER($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+ fi # test -n "$compiler"
+
+ GCC=$lt_save_GCC
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_FC"
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)=$LD
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to 'libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=$lt_simple_compile_test_code
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+ :
+ _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+ [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+ [AC_CHECK_TOOL(GCJ, gcj,)
+ test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+ [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f "$lt_ac_sed" && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test 10 -lt "$lt_ac_count" && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test "$lt_ac_count" -gt "$lt_ac_max"; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ lt_unset=unset
+else
+ lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ lt_SP2NL='tr \040 \012'
+ lt_NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ lt_SP2NL='tr \100 \n'
+ lt_NL2SP='tr \r\n \100\100'
+ ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine what file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
new file mode 100644
index 0000000..94b0829
--- /dev/null
+++ b/m4/ltoptions.m4
@@ -0,0 +1,437 @@
+# Helper functions for option handling. -*- Autoconf -*-
+#
+# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
+# Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 8 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it. Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+ _LT_MANGLE_DEFUN([$1], [$2]),
+ [m4_warning([Unknown $1 option '$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+ [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME. If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+ [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+ dnl
+ dnl Simply set some default values (i.e off) if boolean options were not
+ dnl specified:
+ _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+ ])
+ _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+ ])
+ dnl
+ dnl If no reference was made to various pairs of opposing options, then
+ dnl we run the default mode handler for the pair. For example, if neither
+ dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
+ dnl archives by default:
+ _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+ _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+ _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+ [_LT_ENABLE_FAST_INSTALL])
+ _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+ [_LT_WITH_AIX_SONAME([aix])])
+ ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS], [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+ [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+ _LT_DECL([build_libtool_libs], [enable_shared], [0],
+ [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+ [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+ _LT_DECL([build_old_libs], [enable_static], [0],
+ [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+ [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for pkg in $enableval; do
+ IFS=$lt_save_ifs
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+ [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the 'disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+ AC_MSG_CHECKING([which variant of shared library versioning to provide])
+ AC_ARG_WITH([aix-soname],
+ [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+ [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+ [case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname],
+ [AC_CACHE_VAL([lt_cv_with_aix_soname],
+ [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+ with_aix_soname=$lt_cv_with_aix_soname])
+ AC_MSG_RESULT([$with_aix_soname])
+ if test aix != "$with_aix_soname"; then
+ # For the AIX way of multilib, we name the shared archive member
+ # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+ # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+ # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+ # the AIX toolchain works better with OBJECT_MODE set (default 32).
+ if test 64 = "${OBJECT_MODE-32}"; then
+ shared_archive_member_spec=shr_64
+ else
+ shared_archive_member_spec=shr
+ fi
+ fi
+ ;;
+*)
+ with_aix_soname=aix
+ ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+ [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
+# LT_INIT options.
+# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
+ for lt_pkg in $withval; do
+ IFS=$lt_save_ifs
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS=$lt_save_ifs
+ ;;
+ esac],
+ [pic_mode=m4_default([$1], [default])])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the 'pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+ [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+ [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+ [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+ [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+ [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
new file mode 100644
index 0000000..48bc934
--- /dev/null
+++ b/m4/ltsugar.m4
@@ -0,0 +1,124 @@
+# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
+#
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+ [$#], [2], [[$2]],
+ [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+ [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59, which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+ [$#], 1, [],
+ [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+ m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+ [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+ [m4_foreach([_Lt_suffix],
+ ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+ [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+ [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+ [lt_append([$1], [$2], [$3])$4],
+ [$5])],
+ [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+ m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+ m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+ [$5],
+ [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+ [lt_join(m4_quote(m4_default([$4], [[, ]])),
+ lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+ [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
new file mode 100644
index 0000000..fa04b52
--- /dev/null
+++ b/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers -*- Autoconf -*-
+#
+# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
+# Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 4179 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.6])
+m4_define([LT_PACKAGE_REVISION], [2.4.6])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.6'
+macro_revision='2.4.6'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c6b26f8
--- /dev/null
+++ b/m4/lt~obsolete.m4
@@ -0,0 +1,99 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
+#
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
+# Foundation, Inc.
+# Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else. This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/m4/pdns_check_cdb.m4 b/m4/pdns_check_cdb.m4
new file mode 100644
index 0000000..3d1e349
--- /dev/null
+++ b/m4/pdns_check_cdb.m4
@@ -0,0 +1,21 @@
+AC_DEFUN([PDNS_CHECK_CDB],[
+ PKG_CHECK_MODULES([CDB], [libcdb], [
+ AC_DEFINE([HAVE_CDB], [1], [Define to 1 if you have CDB])
+ [HAVE_CDB=1]
+ ],
+ [AC_CHECK_HEADERS([cdb.h],
+ [AC_CHECK_LIB([cdb], [cdb_find],
+ [
+ CDB_LIBS="-lcdb"
+ AC_DEFINE([HAVE_CDB], [1], [Define to 1 if you have CDB])
+ [HAVE_CDB=1]
+ ],
+ [:]
+ )],
+ [:]
+ )]
+ )
+ AC_SUBST(CDB_LIBS)
+ AC_SUBST(CDB_CFLAGS)
+ AM_CONDITIONAL([HAVE_CDB], [test "x$CDB_LIBS" != "x"])
+])
diff --git a/m4/pdns_check_clock_gettime.m4 b/m4/pdns_check_clock_gettime.m4
new file mode 100644
index 0000000..b2d3207
--- /dev/null
+++ b/m4/pdns_check_clock_gettime.m4
@@ -0,0 +1,6 @@
+AC_DEFUN([PDNS_CHECK_CLOCK_GETTIME],[
+ OLD_LIBS="$LIBS"; LIBS=""
+ AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Define to 1 if you have clock_gettime])])
+ AC_SUBST([RT_LIBS],[$LIBS])
+ LIBS="$OLD_LIBS"
+])
diff --git a/m4/pdns_check_dnstap.m4 b/m4/pdns_check_dnstap.m4
new file mode 100644
index 0000000..1be83c6
--- /dev/null
+++ b/m4/pdns_check_dnstap.m4
@@ -0,0 +1,31 @@
+AC_DEFUN([PDNS_CHECK_DNSTAP], [
+ AC_MSG_CHECKING([whether we will have dnstap])
+ AC_ARG_ENABLE([dnstap],
+ AS_HELP_STRING([--enable-dnstap],[enable dnstap support @<:@default=$1@:>@]),
+ [enable_dnstap=$enableval],
+ [enable_dnstap=$1],
+ )
+ AC_MSG_RESULT([$enable_dnstap])
+
+ AS_IF([test "x$enable_dnstap" != "xno"], [
+ AS_IF([test "x$enable_dnstap" = "xyes" -o "x$enable_dnstap" = "xauto"], [
+ PKG_CHECK_MODULES([FSTRM], [libfstrm], [
+ AC_DEFINE([HAVE_FSTRM], [1], [Define to 1 if you have libfstrm])
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$FSTRM_CFLAGS $CFLAGS"
+ LIBS="$FSTRM_LIBS $LIBS"
+ AC_CHECK_FUNCS([fstrm_tcp_writer_init])
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+ ], [ : ])
+ ])
+ ])
+
+ AM_CONDITIONAL([FSTRM], [test "x$FSTRM_LIBS" != "x"])
+ AS_IF([test "x$enable_dnstap" = "xyes"], [
+ AS_IF([test x"$FSTRM_LIBS" = "x"], [
+ AC_MSG_ERROR([dnstap requested but libfstrm was not found])
+ ])
+ ])
+])
diff --git a/m4/pdns_check_libcrypto.m4 b/m4/pdns_check_libcrypto.m4
new file mode 100644
index 0000000..8e1219a
--- /dev/null
+++ b/m4/pdns_check_libcrypto.m4
@@ -0,0 +1,129 @@
+# SYNOPSIS
+#
+# PDNS_CHECK_LIBCRYPTO([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+# Look for OpenSSL's libcrypto in a number of default spots, or in a
+# user-selected spot (via --with-libcrypto). Sets
+#
+# LIBCRYPTO_INCLUDES to the include directives required
+# LIBCRYPTO_LIBS to the -l directives required
+# LIBCRYPTO_LDFLAGS to the -L or -R flags required
+#
+# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+# This macro sets LIBCRYPTO_INCLUDES such that source files should use the
+# openssl/ directory in include directives:
+#
+# #include <openssl/hmac.h>
+#
+# LICENSE
+#
+# Taken and modified from AX_CHECK_OPENSSL by:
+# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
+# Copyright (c) 2009,2010 Dustin J. Mitchell <dustin@zmanda.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 1
+
+AU_ALIAS([CHECK_LIBCRYPTO], [PDNS_CHECK_LIBCRYPTO])
+AC_DEFUN([PDNS_CHECK_LIBCRYPTO], [
+ found=false
+ AC_ARG_WITH([libcrypto],
+ [AS_HELP_STRING([--with-libcrypto=DIR],
+ [root of the OpenSSL directory])],
+ [
+ case "$withval" in
+ "" | y | ye | yes | n | no)
+ AC_MSG_ERROR([Invalid --with-libcrypto value])
+ ;;
+ *) ssldirs="$withval"
+ ;;
+ esac
+ ], [
+ # if pkg-config is installed and openssl has installed a .pc file,
+ # then use that information and don't search ssldirs
+ AC_CHECK_TOOL([PKG_CONFIG], [pkg-config])
+ if test x"$PKG_CONFIG" != x""; then
+ LIBCRYPTO_LDFLAGS=`$PKG_CONFIG libcrypto --libs-only-L 2>/dev/null`
+ if test $? = 0; then
+ LIBCRYPTO_LIBS=`$PKG_CONFIG libcrypto --libs-only-l 2>/dev/null`
+ LIBCRYPTO_INCLUDES=`$PKG_CONFIG libcrypto --cflags-only-I 2>/dev/null`
+ ssldir=`$PKG_CONFIG libcrypto --variable=prefix 2>/dev/null`
+ found=true
+ fi
+ fi
+
+ # no such luck; use some default ssldirs
+ if ! $found; then
+ ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
+ fi
+ ]
+ )
+
+
+ # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
+ # an 'openssl' subdirectory
+
+ if ! $found; then
+ LIBCRYPTO_INCLUDES=
+ for ssldir in $ssldirs; do
+ AC_MSG_CHECKING([for openssl/crypto.h in $ssldir])
+ if test -f "$ssldir/include/openssl/crypto.h"; then
+ LIBCRYPTO_INCLUDES="-I$ssldir/include"
+ LIBCRYPTO_LDFLAGS="-L$ssldir/lib"
+ LIBCRYPTO_LIBS="-lcrypto"
+ found=true
+ AC_MSG_RESULT([yes])
+ break
+ else
+ AC_MSG_RESULT([no])
+ fi
+ done
+
+ # if the file wasn't found, well, go ahead and try the link anyway -- maybe
+ # it will just work!
+ fi
+
+ if $found; then
+ AC_DEFINE([HAVE_LIBCRYPTO], [1], [Define to 1 if you have OpenSSL libcrypto])
+ fi
+
+ # try the preprocessor and linker with our new flags,
+ # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+ AC_MSG_CHECKING([whether compiling and linking against OpenSSL's libcrypto works])
+ echo "Trying link with LIBCRYPTO_LDFLAGS=$LIBCRYPTO_LDFLAGS;" \
+ "LIBCRYPTO_LIBS=$LIBCRYPTO_LIBS; LIBCRYPTO_INCLUDES=$LIBCRYPTO_INCLUDES" >&AS_MESSAGE_LOG_FD
+
+ save_LIBS="$LIBS"
+ save_LDFLAGS="$LDFLAGS"
+ save_CPPFLAGS="$CPPFLAGS"
+ LDFLAGS="$LDFLAGS $LIBCRYPTO_LDFLAGS"
+ LIBS="$LIBCRYPTO_LIBS $LIBS"
+ CPPFLAGS="$LIBCRYPTO_INCLUDES $CPPFLAGS"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([#include <openssl/crypto.h>], [ERR_load_CRYPTO_strings()])],
+ [
+ AC_MSG_RESULT([yes])
+ AC_CHECK_FUNCS([RAND_bytes RAND_pseudo_bytes CRYPTO_memcmp OPENSSL_init_crypto EVP_MD_CTX_new EVP_MD_CTX_free RSA_get0_key])
+ AC_CHECK_DECL(EVP_PKEY_CTX_set1_scrypt_salt, [AC_DEFINE([HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT], [1], [Define to 1 if you have EVP_PKEY_CTX_set1_scrypt_salt])], [], [#include <openssl/kdf.h>])
+ $1
+ ], [
+ AC_MSG_RESULT([no])
+ $2
+ ])
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+
+ AC_SUBST([LIBCRYPTO_INCLUDES])
+ AC_SUBST([LIBCRYPTO_LIBS])
+ AC_SUBST([LIBCRYPTO_LDFLAGS])
+ AM_CONDITIONAL([HAVE_LIBCRYPTO], [test "x$LIBCRYPTO_LIBS" != "x"])
+])
diff --git a/m4/pdns_check_libedit.m4 b/m4/pdns_check_libedit.m4
new file mode 100644
index 0000000..14fde4f
--- /dev/null
+++ b/m4/pdns_check_libedit.m4
@@ -0,0 +1,3 @@
+AC_DEFUN([PDNS_CHECK_LIBEDIT], [
+ PKG_CHECK_MODULES([LIBEDIT], [libedit])
+])
diff --git a/m4/pdns_check_libh2o_evloop.m4 b/m4/pdns_check_libh2o_evloop.m4
new file mode 100644
index 0000000..00781ce
--- /dev/null
+++ b/m4/pdns_check_libh2o_evloop.m4
@@ -0,0 +1,21 @@
+AC_DEFUN([PDNS_CHECK_LIBH2OEVLOOP], [
+ HAVE_LIBH2OEVLOOP=0
+ PKG_CHECK_MODULES([LIBH2OEVLOOP], [libh2o-evloop], [
+ [HAVE_LIBH2OEVLOOP=1]
+ AC_DEFINE([HAVE_LIBH2OEVLOOP], [1], [Define to 1 if you have libh2o-evloop])
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$LIBH2OEVLOOP_CFLAGS $CFLAGS"
+ LIBS="$LIBH2OEVLOOP_LIBS $LIBS"
+ AC_CHECK_DECLS([h2o_socket_get_ssl_server_name], [
+ AC_DEFINE([HAVE_H2O_SOCKET_GET_SSL_SERVER_NAME], [1], [define to 1 if h2o_socket_get_ssl_server_name is available.])
+ ],
+ [ : ],
+ [AC_INCLUDES_DEFAULT
+ #include <h2o/socket.h>
+ ])
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+ ], [ : ])
+ AM_CONDITIONAL([HAVE_LIBH2OEVLOOP], [test "x$LIBH2OEVLOOP_LIBS" != "x"])
+])
diff --git a/m4/pdns_check_lmdb.m4 b/m4/pdns_check_lmdb.m4
new file mode 100644
index 0000000..5a54f07
--- /dev/null
+++ b/m4/pdns_check_lmdb.m4
@@ -0,0 +1,49 @@
+dnl invoking this makes lmdb a requirement
+AC_DEFUN([PDNS_CHECK_LMDB], [
+ AC_MSG_CHECKING([where to find the lmdb library and headers])
+ AC_ARG_WITH([lmdb],
+ AS_HELP_STRING([--with-lmdb], [lmdb library to use @<:@default=auto@:>@]),[
+ with_lmdb=$withval
+ ],[
+ with_lmdb=auto
+ ])
+ AC_MSG_RESULT([$with_lmdb])
+
+ AS_IF([test "$with_lmdb" != "no"], [
+ AS_IF([test "x$with_lmdb" = "xyes" -o "x$with_lmdb" = "xauto"], [
+ PKG_CHECK_MODULES([LMDB], [lmdb], [
+ AC_DEFINE([HAVE_LMDB], [1], [Define to 1 if you have LMDB])
+ [HAVE_LMDB=1]
+ ], [ : ]
+ )
+ ], [
+ save_CPPFLAGS=$CPPFLAGS
+ save_LIBS=$LIBS
+ AS_IF([test -d "$with_lmdb/include"], [
+ LMDB_CFLAGS="-I$with_lmdb/include"
+ LMDB_LIBS="-L$with_lmdb/lib"
+ ],[
+ LMDB_CFLAGS="-I$with_lmdb"
+ LMDB_LIBS="-L$with_lmdb"
+ ])
+ CPPFLAGS="$LMDB_CFLAGS"
+ LIBS="$LMDB_LIBS"
+
+ AC_SEARCH_LIBS([mdb_env_open], [lmdb], [
+ AC_CHECK_HEADERS([lmdb.h], [
+ dnl ac_cv_search_mdb_env_open contains '-llmdb'
+ LMDB_LIBS="$LMDB_LIBS $ac_cv_search_mdb_env_open"
+ AC_DEFINE([HAVE_LMDB], [1], [Define to 1 if you have LMDB])
+ [HAVE_LMDB=1]
+ ], [
+ AC_MSG_ERROR([lmdb headers not found in $with_lmdb])
+ ])
+ CPPFLAGS="$save_CPPFLAGS"
+ LIBS="$save_LIBS"
+ AC_SUBST([LMDB_CFLAGS])
+ AC_SUBST([LMDB_LIBS])
+ ])
+ ])
+ ])
+ AM_CONDITIONAL([HAVE_LMDB], [test "x$LMDB_LIBS" != "x"])
+])
diff --git a/m4/pdns_check_lua_hpp.m4 b/m4/pdns_check_lua_hpp.m4
new file mode 100644
index 0000000..7cc8f5e
--- /dev/null
+++ b/m4/pdns_check_lua_hpp.m4
@@ -0,0 +1,10 @@
+AC_DEFUN([PDNS_CHECK_LUA_HPP],[
+ AC_REQUIRE([PDNS_WITH_LUA])
+ AS_IF([test "x$LUAPC" != "x" ], [
+ OLD_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $LUA_CFLAGS"
+ AC_CHECK_HEADER([lua.hpp], [ have_lua_hpp=y ])
+ CPPFLAGS="$OLD_CPPFLAGS"
+ ])
+ AM_CONDITIONAL([HAVE_LUA_HPP], [ test x"$have_lua_hpp" = "xy" ])
+])
diff --git a/m4/pdns_check_network_libs.m4 b/m4/pdns_check_network_libs.m4
new file mode 100644
index 0000000..d8b020c
--- /dev/null
+++ b/m4/pdns_check_network_libs.m4
@@ -0,0 +1,7 @@
+AC_DEFUN([PDNS_CHECK_NETWORK_LIBS],[
+ AC_SEARCH_LIBS([inet_aton], [resolv])
+ AC_SEARCH_LIBS([gethostbyname], [nsl])
+ AC_SEARCH_LIBS([socket], [socket])
+ AC_SEARCH_LIBS([gethostent], [nsl])
+ AC_CHECK_FUNCS([recvmmsg sendmmsg accept4])
+])
diff --git a/m4/pdns_check_os.m4 b/m4/pdns_check_os.m4
new file mode 100644
index 0000000..bb5f2fd
--- /dev/null
+++ b/m4/pdns_check_os.m4
@@ -0,0 +1,63 @@
+AC_DEFUN([PDNS_CHECK_OS],[
+ THREADFLAGS=""
+
+ case "$host_os" in
+ solaris2.1*)
+ LIBS="-lposix4 -lpthread $LIBS"
+ CXXFLAGS="-D_REENTRANT $CXXFLAGS"
+ have_solaris="yes"
+ ;;
+ solaris2.8 | solaris2.9 )
+ AC_DEFINE(NEED_POSIX_TYPEDEF,,[If POSIX typedefs need to be defined])
+ AC_DEFINE(NEED_INET_NTOP_PROTO,,[If your OS is so broken that it needs an additional prototype])
+ LIBS="-lposix4 -lpthread $LIBS"
+ CXXFLAGS="-D_REENTRANT $CXXFLAGS"
+ have_solaris="yes"
+ ;;
+ linux*)
+ THREADFLAGS="-pthread"
+ have_linux="yes"
+ ;;
+ darwin*)
+ CXXFLAGS="-D__APPLE_USE_RFC_3542 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE $CXXFLAGS"
+ have_darwin="yes"
+ ;;
+ freebsd*)
+ THREADFLAGS="-pthread"
+ have_freebsd="yes"
+ ;;
+ openbsd*)
+ THREADFLAGS="-pthread"
+ have_openbsd="yes"
+ ;;
+ *)
+ LDFLAGS="-pthread $LDFLAGS"
+ CXXFLAGS="-pthread $CXXFLAGS"
+ ;;
+ esac
+
+ AM_CONDITIONAL([HAVE_FREEBSD], [test "x$have_freebsd" = "xyes"])
+ AM_CONDITIONAL([HAVE_OPENBSD], [test "x$have_openbsd" = "xyes"])
+ AM_CONDITIONAL([HAVE_LINUX], [test "x$have_linux" = "xyes"])
+ AM_CONDITIONAL([HAVE_DARWIN], [test "x$have_darwin" = "xyes"])
+ AM_CONDITIONAL([HAVE_SOLARIS], [test "x$have_solaris" = "xyes"])
+
+ AC_MSG_CHECKING([whether -latomic is needed for __atomic builtins])
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stdint.h>]],
+ [[uint64_t val = 0; __atomic_add_fetch(&val, 1, __ATOMIC_RELAXED);]]
+ )],
+ [AC_MSG_RESULT([no])],
+ [LIBS="$LIBS -latomic"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[#include <stdint.h>]],
+ [[uint64_t val = 0; __atomic_add_fetch(&val, 1, __ATOMIC_RELAXED);]]
+ )],
+ [AC_MSG_RESULT([yes])],
+ [AC_MSG_FAILURE([libatomic needed, but linking with -latomic failed, cannot continue])]
+ )]
+ )
+
+ AC_SUBST(THREADFLAGS)
+ AC_SUBST([DYNLINKFLAGS], [-export-dynamic])
+])
diff --git a/m4/pdns_check_pthread_np.m4 b/m4/pdns_check_pthread_np.m4
new file mode 100644
index 0000000..93bd249
--- /dev/null
+++ b/m4/pdns_check_pthread_np.m4
@@ -0,0 +1,6 @@
+AC_DEFUN([PDNS_CHECK_PTHREAD_NP],[
+ AC_SEARCH_LIBS([pthread_setaffinity_np], [pthread], [AC_DEFINE(HAVE_PTHREAD_SETAFFINITY_NP, [1], [Define to 1 if you have pthread_setaffinity_np])])
+ AC_SEARCH_LIBS([pthread_getattr_np], [pthread], [AC_DEFINE(HAVE_PTHREAD_GETATTR_NP, [1], [Define to 1 if you have pthread_getattr_np])])
+ AC_SEARCH_LIBS([pthread_get_stackaddr_np], [pthread], [AC_DEFINE(HAVE_PTHREAD_GET_STACKADDR_NP, [1], [Define to 1 if you have pthread_get_stackaddr_np])])
+ AC_SEARCH_LIBS([pthread_get_stacksize_np], [pthread], [AC_DEFINE(HAVE_PTHREAD_GET_STACKSIZE_NP, [1], [Define to 1 if you have pthread_get_stacksize_np])])
+])
diff --git a/m4/pdns_check_python_venv.m4 b/m4/pdns_check_python_venv.m4
new file mode 100644
index 0000000..41830b2
--- /dev/null
+++ b/m4/pdns_check_python_venv.m4
@@ -0,0 +1,9 @@
+AC_DEFUN([PDNS_CHECK_PYTHON_VENV], [
+ dnl Check for optional Python, at least version 3.6.
+ AM_PATH_PYTHON([3.6],,[:])
+ dnl Check for Python venv module
+ AS_IF([test "${PYTHON}" != ":"], [
+ AX_PYTHON_MODULE([venv],[])
+ ])
+ AM_CONDITIONAL([HAVE_VENV], [test "x${HAVE_PYMOD_VENV}" = "xyes"])
+])
diff --git a/m4/pdns_check_ragel.m4 b/m4/pdns_check_ragel.m4
new file mode 100644
index 0000000..f06c7d7
--- /dev/null
+++ b/m4/pdns_check_ragel.m4
@@ -0,0 +1,8 @@
+AC_DEFUN([PDNS_CHECK_RAGEL], [
+ AC_CHECK_PROG([RAGEL], [ragel], [ragel])
+ if test "x$RAGEL" = "x"; then
+ if test ! -f "${srcdir}/$1"; then
+ AC_MSG_ERROR([ragel is missing and you don't have ${srcdir}/$1. Install ragel or download sources from $2])
+ fi
+ fi
+])
diff --git a/m4/pdns_check_secure_memset.m4 b/m4/pdns_check_secure_memset.m4
new file mode 100644
index 0000000..4f58219
--- /dev/null
+++ b/m4/pdns_check_secure_memset.m4
@@ -0,0 +1,3 @@
+AC_DEFUN([PDNS_CHECK_SECURE_MEMSET], [
+ AC_CHECK_FUNCS([explicit_bzero explicit_memset])
+])
diff --git a/m4/pdns_check_time_t.m4 b/m4/pdns_check_time_t.m4
new file mode 100644
index 0000000..c3d274b
--- /dev/null
+++ b/m4/pdns_check_time_t.m4
@@ -0,0 +1,7 @@
+AC_DEFUN([PDNS_CHECK_TIME_T], [
+AX_COMPILE_CHECK_SIZEOF(time_t)
+AS_IF([test $ac_size -lt 8], [AC_MSG_ERROR([size of time_t is $ac_size, which is not large enough to fix the y2k38 bug])])
+AX_CHECK_SIGN([time_t], [:], [AC_MSG_ERROR([time_t is unsigned, PowerDNS code relies on it being signed])], [
+ #include <sys/types.h>
+])
+])
diff --git a/m4/pdns_d_fortify_source.m4 b/m4/pdns_d_fortify_source.m4
new file mode 100644
index 0000000..68e9be5
--- /dev/null
+++ b/m4/pdns_d_fortify_source.m4
@@ -0,0 +1,28 @@
+dnl
+dnl Check for support D_FORTIFY_SOURCE
+dnl
+dnl Copyright (C) 2013 Red Hat, Inc.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([AC_CC_D_FORTIFY_SOURCE],[
+ OLD_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="-Wall -W -Werror $CXXFLAGS"
+ gl_COMPILER_OPTION_IF([-D_FORTIFY_SOURCE=2], [
+ CFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $CFLAGS"
+ CXXFLAGS="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 $OLD_CXXFLAGS"
+ ], [CXXFLAGS="$OLD_CXXFLAGS"], [AC_LANG_PROGRAM([[#include <stdio.h>]],[])])
+])
diff --git a/m4/pdns_enable_sanitizers.m4 b/m4/pdns_enable_sanitizers.m4
new file mode 100644
index 0000000..6773e1a
--- /dev/null
+++ b/m4/pdns_enable_sanitizers.m4
@@ -0,0 +1,167 @@
+AC_DEFUN([PDNS_ENABLE_SANITIZERS], [
+ PDNS_ENABLE_ASAN
+ PDNS_ENABLE_MSAN
+ PDNS_ENABLE_TSAN
+ PDNS_ENABLE_LSAN
+ PDNS_ENABLE_UBSAN
+
+ AS_IF([test "x$enable_asan" != "xno" -a "x$enable_tsan" != "xno"],[
+ AC_MSG_ERROR([Address Sanitizer is not compatible with Thread Sanitizer])
+ ])
+
+ AS_IF([test "x$enable_msan" != "xno" -a "x$enable_asan" != "xno"],[
+ AC_MSG_ERROR([Memory Sanitizer is not compatible with Address Sanitizer])
+ ])
+
+ AS_IF([test "x$enable_msan" != "xno" -a "x$enable_lsan" != "xno"],[
+ AC_MSG_ERROR([Memory Sanitizer is not compatible with Leak Sanitizer])
+ ])
+
+ AS_IF([test "x$enable_msan" != "xno" -a "x$enable_tsan" != "xno"],[
+ AC_MSG_ERROR([Memory Sanitizer is not compatible with Thread Sanitizer])
+ ])
+
+ AS_IF([test "x$enable_asan" != "xno" -o "x$enable_tsan" != "xno" -o "x$enable_lsan" != "xno" -o "x$enable_ubsan" != "xno" -o "x$enable_msan" != "xno"], [
+ gl_WARN_ADD([-fno-omit-frame-pointer])
+ ])
+])
+
+AC_DEFUN([PDNS_ENABLE_ASAN], [
+ AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+ AC_MSG_CHECKING([whether to enable AddressSanitizer])
+ AC_ARG_ENABLE([asan],
+ AS_HELP_STRING([--enable-asan],
+ [enable AddressSanitizer @<:@default=no@:>@]),
+ [enable_asan=$enableval],
+ [enable_asan=no]
+ )
+ AC_MSG_RESULT([$enable_asan])
+
+ AS_IF([test "x$enable_asan" != "xno"], [
+ gl_COMPILER_OPTION_IF([-fsanitize=address],
+ [
+ [SANITIZER_FLAGS="-fsanitize=address $SANITIZER_FLAGS"]
+ AC_CHECK_HEADERS([sanitizer/common_interface_defs.h], asan_headers=yes, asan_headers=no)
+ AS_IF([test x"$asan_headers" = "xyes" ],
+ [AC_CHECK_DECL(__sanitizer_start_switch_fiber,
+ [
+ AC_MSG_CHECKING([for the exact signature of __sanitizer_finish_switch_fiber])
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [#include <sanitizer/common_interface_defs.h>],
+ [
+ __sanitizer_finish_switch_fiber(nullptr);
+ ])
+ ], [
+ AC_MSG_RESULT([a single pointer])
+ AC_DEFINE([HAVE_FIBER_SANITIZER], [1], [Define if ASAN fiber annotation interface is available.])
+ AC_DEFINE(HAVE_SANITIZER_FINISH_SWITCH_FIBER_SINGLE_PTR, [1], [Define to 1 if __sanitizer_finish_switch_fiber takes only a pointer])
+ ], [
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(
+ [#include <sanitizer/common_interface_defs.h>],
+ [
+ __sanitizer_finish_switch_fiber(nullptr, nullptr, nullptr);
+ ])
+ ], [
+ AC_MSG_RESULT([three pointers])
+ AC_DEFINE([HAVE_FIBER_SANITIZER], [1], [Define if ASAN fiber annotation interface is available.])
+ AC_DEFINE(HAVE_SANITIZER_FINISH_SWITCH_FIBER_THREE_PTRS, [1], [Define to 1 if __sanitizer_finish_switch_fiber takes three pointers])
+ ], [
+ AC_MSG_RESULT([unknown])
+ AC_MSG_NOTICE([ASAN fiber switching is not available due to an unknown API version])
+ ])
+ ])
+ ], [
+ AC_MSG_NOTICE([ASAN fiber switching is not available])
+ ],
+ [#include <sanitizer/common_interface_defs.h>]
+ )]
+ )
+ ],
+ [AC_MSG_ERROR([Cannot enable AddressSanitizer])]
+ )
+ ])
+ AC_SUBST([SANITIZER_FLAGS])
+])
+
+AC_DEFUN([PDNS_ENABLE_TSAN], [
+ AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+ AC_MSG_CHECKING([whether to enable ThreadSanitizer])
+ AC_ARG_ENABLE([tsan],
+ AS_HELP_STRING([--enable-tsan],
+ [enable ThreadSanitizer @<:@default=no@:>@]),
+ [enable_tsan=$enableval],
+ [enable_tsan=no]
+ )
+ AC_MSG_RESULT([$enable_tsan])
+
+ AS_IF([test "x$enable_tsan" != "xno"], [
+ gl_COMPILER_OPTION_IF([-fsanitize=thread],
+ [SANITIZER_FLAGS="-fsanitize=thread $SANITIZER_FLAGS"],
+ [AC_MSG_ERROR([Cannot enable ThreadSanitizer])]
+ )
+ ])
+ AC_SUBST([SANITIZER_FLAGS])
+])
+
+AC_DEFUN([PDNS_ENABLE_LSAN], [
+ AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+ AC_MSG_CHECKING([whether to enable LeakSanitizer])
+ AC_ARG_ENABLE([lsan],
+ AS_HELP_STRING([--enable-lsan],
+ [enable LeakSanitizer @<:@default=no@:>@]),
+ [enable_lsan=$enableval],
+ [enable_lsan=no]
+ )
+ AC_MSG_RESULT([$enable_lsan])
+
+ AS_IF([test "x$enable_lsan" != "xno"], [
+ gl_COMPILER_OPTION_IF([-fsanitize=leak],
+ [SANITIZER_FLAGS="-fsanitize=leak $SANITIZER_FLAGS"],
+ [AC_MSG_ERROR([Cannot enable LeakSanitizer])]
+ )
+ ])
+ AC_SUBST([SANITIZER_FLAGS])
+])
+
+AC_DEFUN([PDNS_ENABLE_UBSAN], [
+ AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+ AC_MSG_CHECKING([whether to enable Undefined Behaviour Sanitizer])
+ AC_ARG_ENABLE([ubsan],
+ AS_HELP_STRING([--enable-ubsan],
+ [enable Undefined Behaviour Sanitizer @<:@default=no@:>@]),
+ [enable_ubsan=$enableval],
+ [enable_ubsan=no]
+ )
+ AC_MSG_RESULT([$enable_ubsan])
+
+ AS_IF([test "x$enable_ubsan" != "xno"], [
+ gl_COMPILER_OPTION_IF([-fsanitize=undefined],
+ [SANITIZER_FLAGS="-fsanitize=undefined $SANITIZER_FLAGS"],
+ [AC_MSG_ERROR([Cannot enable Undefined Behaviour Sanitizer])]
+ )
+ ])
+ AC_SUBST([SANITIZER_FLAGS])
+])
+
+AC_DEFUN([PDNS_ENABLE_MSAN], [
+ AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+ AC_MSG_CHECKING([whether to enable MemorySanitizer])
+ AC_ARG_ENABLE([msan],
+ AS_HELP_STRING([--enable-msan],
+ [enable MemorySanitizer @<:@default=no@:>@]),
+ [enable_msan=$enableval],
+ [enable_msan=no]
+ )
+ AC_MSG_RESULT([$enable_msan])
+
+ AS_IF([test "x$enable_msan" != "xno"], [
+ gl_COMPILER_OPTION_IF([-fsanitize=memory],
+ [SANITIZER_FLAGS="-fsanitize=memory $SANITIZER_FLAGS"],
+ [AC_MSG_ERROR([Cannot enable MemorySanitizer])]
+ )
+ ])
+ AC_SUBST([SANITIZER_FLAGS])
+])
+
diff --git a/m4/pdns_enable_tls.m4 b/m4/pdns_enable_tls.m4
new file mode 100644
index 0000000..a31591f
--- /dev/null
+++ b/m4/pdns_enable_tls.m4
@@ -0,0 +1,14 @@
+AC_DEFUN([PDNS_ENABLE_DNS_OVER_TLS], [
+ AC_MSG_CHECKING([whether to enable DNS over TLS support])
+ AC_ARG_ENABLE([dns-over-tls],
+ AS_HELP_STRING([--enable-dns-over-tls], [enable DNS over TLS support (requires GnuTLS or OpenSSL) @<:@default=no@:>@]),
+ [enable_dns_over_tls=$enableval],
+ [enable_dns_over_tls=no]
+ )
+ AC_MSG_RESULT([$enable_dns_over_tls])
+ AM_CONDITIONAL([HAVE_DNS_OVER_TLS], [test "x$enable_dns_over_tls" != "xno"])
+
+ AM_COND_IF([HAVE_DNS_OVER_TLS], [
+ AC_DEFINE([HAVE_DNS_OVER_TLS], [1], [Define to 1 if you enable DNS over TLS support])
+ ])
+])
diff --git a/m4/pdns_enable_unit_tests.m4 b/m4/pdns_enable_unit_tests.m4
new file mode 100644
index 0000000..f34fbe0
--- /dev/null
+++ b/m4/pdns_enable_unit_tests.m4
@@ -0,0 +1,18 @@
+AC_DEFUN([PDNS_ENABLE_UNIT_TESTS], [
+ AC_MSG_CHECKING([whether to enable unit test building])
+ AC_ARG_ENABLE([unit-tests],
+ AS_HELP_STRING([--enable-unit-tests],
+ [enable unit test building @<:@default=no@:>@]),
+ [enable_unit_tests=$enableval],
+ [enable_unit_tests=no]
+ )
+ AC_MSG_RESULT([$enable_unit_tests])
+ AM_CONDITIONAL([UNIT_TESTS], [test "x$enable_unit_tests" != "xno"])
+
+ AS_IF([test "x$enable_unit_tests" != "xno"], [
+ BOOST_TEST([mt])
+ AS_IF([test "$boost_cv_lib_unit_test_framework" = "no"], [
+ AC_MSG_ERROR([Boost Unit Test library not found])
+ ])
+ ])
+])
diff --git a/m4/pdns_param_ssp_buffer_size.m4 b/m4/pdns_param_ssp_buffer_size.m4
new file mode 100644
index 0000000..05c1bae
--- /dev/null
+++ b/m4/pdns_param_ssp_buffer_size.m4
@@ -0,0 +1,26 @@
+dnl
+dnl Check for support for ssp parameter buffer size
+dnl
+dnl Copyright (C) 2013 Red Hat, Inc.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([AC_CC_PARAM_SSP_BUFFER_SIZE],[
+ gl_COMPILER_OPTION_IF([--param ssp-buffer-size=$1], [
+ CFLAGS="--param ssp-buffer-size=$1 $CFLAGS"
+ CXXFLAGS="--param ssp-buffer-size=$1 $CXXFLAGS"
+ ])
+])
diff --git a/m4/pdns_pie.m4 b/m4/pdns_pie.m4
new file mode 100644
index 0000000..98d3923
--- /dev/null
+++ b/m4/pdns_pie.m4
@@ -0,0 +1,55 @@
+dnl
+dnl Check for support for position independent executables
+dnl
+dnl Copyright (C) 2013 Red Hat, Inc.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([AC_CC_PIE],[
+ AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+ PIE_CFLAGS=
+ PIE_LDFLAGS=
+ OLD_CXXFLAGS=$CXXFLAGS
+ case "$host" in
+ *-*-mingw* | *-*-msvc* | *-*-cygwin* )
+ ;; dnl All code is position independent on Win32 target
+ *)
+ CXXFLAGS="-fPIE -DPIE"
+ gl_COMPILER_OPTION_IF([-pie], [
+ PIE_CFLAGS="-fPIE -DPIE"
+ PIE_LDFLAGS="-pie"
+ ], [
+ dnl some versions of clang require -Wl,-pie instead of -pie
+ gl_COMPILER_OPTION_IF([[-Wl,-pie]], [
+ PIE_CFLAGS="-fPIE -DPIE"
+ PIE_LDFLAGS="-Wl,-pie"
+ ], [],
+ [AC_LANG_PROGRAM([[
+#include <pthread.h>
+__thread unsigned int t_id;
+ ]], [[t_id = 1;]])]
+ )
+ ],
+ [AC_LANG_PROGRAM([[
+#include <pthread.h>
+__thread unsigned int t_id;
+ ]], [[t_id = 1;]])]
+ )
+ esac
+ CXXFLAGS=$OLD_CXXFLAGS
+ AC_SUBST([PIE_CFLAGS])
+ AC_SUBST([PIE_LDFLAGS])
+])
diff --git a/m4/pdns_relro.m4 b/m4/pdns_relro.m4
new file mode 100644
index 0000000..4f93629
--- /dev/null
+++ b/m4/pdns_relro.m4
@@ -0,0 +1,37 @@
+dnl
+dnl Check for -z now and -z relro linker flags
+dnl
+dnl Copyright (C) 2013 Red Hat, Inc.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([AC_LD_RELRO],[
+ AC_MSG_CHECKING([for how to force completely read-only GOT table])
+
+ RELRO_LDFLAGS=
+ ld_help=`$CXX -Wl,-help 2>&1`
+ case $ld_help in
+ *"-z relro"*) RELRO_LDFLAGS="-Wl,-z -Wl,relro" ;;
+ esac
+ case $ld_help in
+ *"-z now"*) RELRO_LDFLAGS="$RELRO_LDFLAGS -Wl,-z -Wl,now" ;;
+ esac
+ AC_SUBST([RELRO_LDFLAGS])
+ AS_IF([test "x$RELRO_LDFLAGS" != "x"],
+ [AC_MSG_RESULT([$RELRO_LDFLAGS])],
+ [AC_MSG_RESULT([unknown])]
+ )
+])
diff --git a/m4/pdns_stack_protector.m4 b/m4/pdns_stack_protector.m4
new file mode 100644
index 0000000..388035c
--- /dev/null
+++ b/m4/pdns_stack_protector.m4
@@ -0,0 +1,26 @@
+dnl
+dnl Check for support for enabling stack protector
+dnl
+dnl Copyright (C) 2013 Red Hat, Inc.
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library. If not, see
+dnl <http://www.gnu.org/licenses/>.
+dnl
+
+AC_DEFUN([AC_CC_STACK_PROTECTOR],[
+ gl_COMPILER_OPTION_IF([-fstack-protector], [
+ CFLAGS="-fstack-protector $CFLAGS"
+ CXXFLAGS="-fstack-protector $CXXFLAGS"
+ ])
+])
diff --git a/m4/pdns_with_ebpf.m4 b/m4/pdns_with_ebpf.m4
new file mode 100644
index 0000000..760bd65
--- /dev/null
+++ b/m4/pdns_with_ebpf.m4
@@ -0,0 +1,38 @@
+AC_DEFUN([PDNS_WITH_EBPF],[
+ AC_MSG_CHECKING([if we have eBPF support])
+ AC_ARG_WITH([ebpf],
+ AS_HELP_STRING([--with-ebpf],[enable eBPF support @<:@default=auto@:>@]),
+ [with_ebpf=$withval],
+ [with_ebpf=auto],
+ )
+ AC_MSG_RESULT([$with_ebpf])
+
+ AS_IF([test "x$with_ebpf" != "xno"], [
+ AS_IF([test "x$with_ebpf" = "xyes" -o "x$with_ebpf" = "xauto"], [
+ AC_CHECK_HEADERS([linux/bpf.h], bpf_headers=yes, bpf_headers=no)
+ ])
+ ])
+ AS_IF([test "x$with_ebpf" = "xyes"], [
+ AS_IF([test x"$bpf_headers" = "no"], [
+ AC_MSG_ERROR([EBPF support requested but required eBPF headers were not found])
+ ])
+ ])
+ AM_CONDITIONAL([HAVE_EBPF], [test x"$bpf_headers" = "xyes" ])
+ AS_IF([test x"$bpf_headers" = "xyes" ],
+ [AC_CHECK_DECL(BPF_FUNC_tail_call,
+ [ AC_CHECK_DECL(SO_ATTACH_BPF,
+ [ AC_DEFINE([HAVE_EBPF], [1], [Define if using eBPF.]) ],
+ [ AS_IF([test "x$with_ebpf" = "xyes"], [
+ AC_MSG_ERROR([EBPF support requested but SO_ATTACH_BPF not found])
+ ])],
+ [#include <sys/socket.h>
+ ]
+ )],
+ [ AS_IF([test "x$with_ebpf" = "xyes"], [
+ AC_MSG_ERROR([EBPF support requested but BPF_FUNC_tail_call not found in the eBPF headers])
+ ])],
+ [#include <linux/bpf.h>
+ ]
+ )]
+ )
+])
diff --git a/m4/pdns_with_gnutls.m4 b/m4/pdns_with_gnutls.m4
new file mode 100644
index 0000000..b6ad100
--- /dev/null
+++ b/m4/pdns_with_gnutls.m4
@@ -0,0 +1,34 @@
+AC_DEFUN([PDNS_WITH_GNUTLS], [
+ AC_MSG_CHECKING([whether we will be linking in GnuTLS])
+ HAVE_GNUTLS=0
+ AC_ARG_WITH([gnutls],
+ AS_HELP_STRING([--with-gnutls],[use GnuTLS @<:@default=auto@:>@]),
+ [with_gnutls=$withval],
+ [with_gnutls=auto],
+ )
+ AC_MSG_RESULT([$with_gnutls])
+
+ AS_IF([test "x$with_gnutls" != "xno"], [
+ AS_IF([test "x$with_gnutls" = "xyes" -o "x$with_gnutls" = "xauto"], [
+ # we require gnutls_certificate_set_x509_key_file, added in 3.1.11
+ PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.1.11], [
+ [HAVE_GNUTLS=1]
+ AC_DEFINE([HAVE_GNUTLS], [1], [Define to 1 if you have GnuTLS])
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$GNUTLS_CFLAGS $CFLAGS"
+ LIBS="$GNUTLS_LIBS $LIBS"
+ AC_CHECK_FUNCS([gnutls_memset gnutls_session_set_verify_cert gnutls_session_get_verify_cert_status gnutls_alpn_set_protocols])
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+
+ ], [ : ])
+ ])
+ ])
+ AM_CONDITIONAL([HAVE_GNUTLS], [test "x$GNUTLS_LIBS" != "x"])
+ AS_IF([test "x$with_gnutls" = "xyes"], [
+ AS_IF([test x"$GNUTLS_LIBS" = "x"], [
+ AC_MSG_ERROR([GnuTLS requested but libraries were not found])
+ ])
+ ])
+])
diff --git a/m4/pdns_with_libcap.m4 b/m4/pdns_with_libcap.m4
new file mode 100644
index 0000000..0dba5da
--- /dev/null
+++ b/m4/pdns_with_libcap.m4
@@ -0,0 +1,25 @@
+AC_DEFUN([PDNS_WITH_LIBCAP], [
+ AC_MSG_CHECKING([whether we will be linking in libcap])
+ HAVE_LIBCAPS=0
+ AC_ARG_WITH([libcap],
+ AS_HELP_STRING([--with-libcap],[use libcap @<:@default=auto@:>@]),
+ [with_libcap=$withval],
+ [with_libcap=auto],
+ )
+ AC_MSG_RESULT([$with_libcap])
+
+ AS_IF([test "x$with_libcap" != "xno"], [
+ AS_IF([test "x$with_libcap" = "xyes" -o "x$with_libcap" = "xauto"], [
+ PKG_CHECK_MODULES([LIBCAP], [libcap] , [
+ [HAVE_LIBCAP=1]
+ AC_DEFINE([HAVE_LIBCAP], [1], [Define to 1 if you have libcap])
+ ], [ : ])
+ ])
+ ])
+ AM_CONDITIONAL([HAVE_LIBCAP], [test "x$LIBCAP_LIBS" != "x"])
+ AS_IF([test "x$with_libcap" = "xyes"], [
+ AS_IF([test x"$LIBCAP_LIBS" = "x"], [
+ AC_MSG_ERROR([libcap requested but libraries were not found])
+ ])
+ ])
+])
diff --git a/m4/pdns_with_libsodium.m4 b/m4/pdns_with_libsodium.m4
new file mode 100644
index 0000000..fbe60d2
--- /dev/null
+++ b/m4/pdns_with_libsodium.m4
@@ -0,0 +1,30 @@
+AC_DEFUN([PDNS_WITH_LIBSODIUM], [
+ AC_MSG_CHECKING([whether we will be linking in libsodium])
+ AC_ARG_WITH([libsodium],
+ AS_HELP_STRING([--with-libsodium],[use libsodium @<:@default=auto@:>@]),
+ [with_libsodium=$withval],
+ [with_libsodium=auto],
+ )
+ AC_MSG_RESULT([$with_libsodium])
+
+ AS_IF([test "x$with_libsodium" != "xno"], [
+ AS_IF([test "x$with_libsodium" = "xyes" -o "x$with_libsodium" = "xauto"], [
+ PKG_CHECK_MODULES([LIBSODIUM], [libsodium], [
+ AC_DEFINE([HAVE_LIBSODIUM], [1], [Define to 1 if you have libsodium])
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$LIBSODIUM_CFLAGS $CFLAGS"
+ LIBS="$LIBSODIUM_LIBS $LIBS"
+ AC_CHECK_FUNCS([crypto_box_easy_afternm crypto_box_curve25519xchacha20poly1305_easy randombytes_stir sodium_memcmp crypto_shorthash])
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+ ], [ : ])
+ ])
+ ])
+ AM_CONDITIONAL([LIBSODIUM], [test "x$LIBSODIUM_LIBS" != "x"])
+ AS_IF([test "x$with_libsodium" = "xyes"], [
+ AS_IF([test x"$LIBSODIUM_LIBS" = "x"], [
+ AC_MSG_ERROR([libsodium requested but libraries were not found])
+ ])
+ ])
+])
diff --git a/m4/pdns_with_libssl.m4 b/m4/pdns_with_libssl.m4
new file mode 100644
index 0000000..3e32bc4
--- /dev/null
+++ b/m4/pdns_with_libssl.m4
@@ -0,0 +1,33 @@
+AC_DEFUN([PDNS_WITH_LIBSSL], [
+ AC_MSG_CHECKING([whether we will be linking in OpenSSL libssl])
+ HAVE_LIBSSL=0
+ AC_ARG_WITH([libssl],
+ AS_HELP_STRING([--with-libssl],[use OpenSSL libssl @<:@default=auto@:>@]),
+ [with_libssl=$withval],
+ [with_libssl=auto],
+ )
+ AC_MSG_RESULT([$with_libssl])
+
+ AS_IF([test "x$with_libssl" != "xno"], [
+ AS_IF([test "x$with_libssl" = "xyes" -o "x$with_libssl" = "xauto"], [
+ PKG_CHECK_MODULES([LIBSSL], [libssl], [
+ [HAVE_LIBSSL=1]
+ AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if you have OpenSSL libssl])
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$LIBSSL_CFLAGS $CFLAGS"
+ LIBS="$LIBSSL_LIBS -lcrypto $LIBS"
+ AC_CHECK_FUNCS([SSL_CTX_set_ciphersuites OCSP_basic_sign SSL_CTX_set_num_tickets SSL_CTX_set_keylog_callback SSL_CTX_get0_privatekey SSL_CTX_set_min_proto_version SSL_set_hostflags SSL_CTX_set_alpn_protos SSL_CTX_set_next_proto_select_cb SSL_get0_alpn_selected SSL_get0_next_proto_negotiated SSL_CTX_set_alpn_select_cb])
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+
+ ], [ : ])
+ ])
+ ])
+ AM_CONDITIONAL([HAVE_LIBSSL], [test "x$LIBSSL_LIBS" != "x"])
+ AS_IF([test "x$with_libssl" = "xyes"], [
+ AS_IF([test x"$LIBSSL_LIBS" = "x"], [
+ AC_MSG_ERROR([OpenSSL libssl requested but libraries were not found])
+ ])
+ ])
+])
diff --git a/m4/pdns_with_lua.m4 b/m4/pdns_with_lua.m4
new file mode 100644
index 0000000..e280c1b
--- /dev/null
+++ b/m4/pdns_with_lua.m4
@@ -0,0 +1,62 @@
+AC_DEFUN([PDNS_WITH_LUA],[
+ AC_PROG_GREP()dnl Ensure we have grep
+ AC_MSG_CHECKING([which Lua implementation to use])
+ AC_ARG_WITH([lua],
+ [AS_HELP_STRING([--with-lua], [select Lua implementation @<:@default=auto@:>@])
+ ], [
+ with_lua=$withval
+ ], [
+ with_lua=auto
+ ])
+
+ AS_IF([test "x$with_lua" = "xyes"], [
+ dnl --with-lua was passed, make it auto
+ with_lua=auto
+ ])
+
+ AC_MSG_RESULT([$with_lua])
+
+ AS_IF([test "x$with_lua" = "xno" -a "$1" = "mandatory"], [
+ AC_MSG_ERROR([--without-lua specified, but Lua is not optional])
+ ])
+
+ LUAPC=""
+ luajit_min_version='2.0.2'
+ lua_min_version='5.1'
+
+ AS_IF([test "x$with_lua" != "xno"], [
+ AS_IF([test "x$with_lua" != "xauto"], [
+ with_lua_version=${lua_min_version}
+ AS_IF([echo "x$with_lua" | ${GREP} 'jit' >/dev/null 2>&1], [with_lua_version=${luajit_min_version}])
+ PKG_CHECK_MODULES([LUA], $with_lua >= $with_lua_version, [
+ AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have Lua])
+ LUAPC=$with_lua
+ ], [
+ AC_MSG_ERROR([Selected Lua ($with_lua) not found])
+ ])
+ ], [
+ PKG_CHECK_MODULES([LUA], [luajit >= ${luajit_min_version}], [
+ LUAPC=luajit
+ AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have Lua])
+ ], [ : ])
+ AS_IF([test -z "$LUAPC"], [
+ found_lua=n
+ m4_foreach_w([luapc], [lua5.3 lua-5.3 lua53 lua5.2 lua-5.2 lua52 lua5.1 lua-5.1 lua51 lua], [
+ AS_IF([test "$found_lua" != "y"], [
+ PKG_CHECK_MODULES([LUA], [luapc >= ${lua_min_version}], [
+ AC_DEFINE([HAVE_LUA], [1], [Define to 1 if you have lua])
+ found_lua=y
+ LUAPC=luapc
+ ], [ : ])
+ ])
+ ])
+ ])
+ ])
+ ])
+
+ AS_IF([test -z "$LUAPC" -a "$1" = "mandatory"], [
+ AC_MSG_ERROR([No Lua not found, but is mandatory])
+ ])
+
+ AM_CONDITIONAL([LUA], [test -n "x$LUAPC"])
+])
diff --git a/m4/pdns_with_net_snmp.m4 b/m4/pdns_with_net_snmp.m4
new file mode 100644
index 0000000..d4cfcfa
--- /dev/null
+++ b/m4/pdns_with_net_snmp.m4
@@ -0,0 +1,35 @@
+AC_DEFUN([PDNS_WITH_NET_SNMP], [
+ AC_MSG_CHECKING([if we need to link in Net SNMP])
+ AC_ARG_WITH([net-snmp],
+ AS_HELP_STRING([--with-net-snmp],[enable net snmp support @<:@default=auto@:>@]),
+ [with_net_snmp=$withval],
+ [with_net_snmp=auto],
+ )
+ AC_MSG_RESULT([$with_net_snmp])
+
+ AS_IF([test "x$with_net_snmp" != "xno"], [
+ AS_IF([test "x$with_net_snmp" = "xyes" -o "x$with_net_snmp" = "xauto"], [
+ AC_CHECK_PROG([NET_SNMP_CFLAGS], [net-snmp-config], [`net-snmp-config --cflags`])
+ AC_CHECK_PROG([NET_SNMP_LIBS], [net-snmp-config], [`net-snmp-config --netsnmp-agent-libs`])
+ AC_CHECK_DECLS([snmp_select_info2], [
+ AC_DEFINE([HAVE_SNMP_SELECT_INFO2], [1], [define to 1 if snmp_select_info2 is available.])
+ ],
+ [ : ],
+ [AC_INCLUDES_DEFAULT
+ #include <net-snmp/net-snmp-config.h>
+ #include <net-snmp/definitions.h>
+ #include <net-snmp/types.h>
+ #include <net-snmp/utilities.h>
+ #include <net-snmp/config_api.h>
+ #include <net-snmp/session_api.h>
+ ])
+ ])
+ ])
+ AS_IF([test "x$with_net_snmp" = "xyes"], [
+ AS_IF([test x"$NET_SNMP_LIBS" = "x"], [
+ AC_MSG_ERROR([Net SNMP requested but libraries were not found])
+ ])
+ ])
+ AM_CONDITIONAL([HAVE_NET_SNMP], [test x"$NET_SNMP_LIBS" != "x"])
+ AS_IF([test x"$NET_SNMP_LIBS" != "x"], [AC_DEFINE([HAVE_NET_SNMP], [1], [Define if using Net SNMP.])])
+])
diff --git a/m4/pdns_with_nghttp2.m4 b/m4/pdns_with_nghttp2.m4
new file mode 100644
index 0000000..aa6a5c2
--- /dev/null
+++ b/m4/pdns_with_nghttp2.m4
@@ -0,0 +1,32 @@
+AC_DEFUN([PDNS_WITH_NGHTTP2], [
+ AC_MSG_CHECKING([whether we will be linking in nghttp2])
+ HAVE_NGHTTP2=0
+ AC_ARG_WITH([nghttp2],
+ AS_HELP_STRING([--with-nghttp2],[use nghttp2 @<:@default=auto@:>@]),
+ [with_nghttp2=$withval],
+ [with_nghttp2=auto],
+ )
+ AC_MSG_RESULT([$with_nghttp2])
+
+ AS_IF([test "x$with_nghttp2" != "xno"], [
+ AS_IF([test "x$with_nghttp2" = "xyes" -o "x$with_nghttp2" = "xauto"], [
+ PKG_CHECK_MODULES([NGHTTP2], [libnghttp2], [
+ [HAVE_NGHTTP2=1]
+ AC_DEFINE([HAVE_NGHTTP2], [1], [Define to 1 if you have nghttp2])
+ save_CFLAGS=$CFLAGS
+ save_LIBS=$LIBS
+ CFLAGS="$NGHTTP2_CFLAGS $CFLAGS"
+ LIBS="$NGHTTP2_LIBS $LIBS"
+ CFLAGS=$save_CFLAGS
+ LIBS=$save_LIBS
+
+ ], [ : ])
+ ])
+ ])
+ AM_CONDITIONAL([HAVE_NGHTTP2], [test "x$NGHTTP2_LIBS" != "x"])
+ AS_IF([test "x$with_nghttp2" = "xyes"], [
+ AS_IF([test x"$NGHTTP2_LIBS" = "x"], [
+ AC_MSG_ERROR([nghttp2 requested but libraries were not found])
+ ])
+ ])
+])
diff --git a/m4/pdns_with_re2.m4 b/m4/pdns_with_re2.m4
new file mode 100644
index 0000000..daaa501
--- /dev/null
+++ b/m4/pdns_with_re2.m4
@@ -0,0 +1,22 @@
+AC_DEFUN([PDNS_WITH_RE2], [
+ HAVE_RE2=0
+ AC_MSG_CHECKING([if we should compile in libre2 for dnsdist])
+ AC_ARG_WITH([re2], [AS_HELP_STRING([--with-re2],[with libre2 @<:@default=no@:>@])],
+ [with_re2=$withval],
+ [with_re2=no]
+ )
+ AC_MSG_RESULT([$with_re2])
+ AS_IF([test "x$with_re2" = "xyes"], [
+ PKG_CHECK_MODULES([RE2], [re2], [
+ HAVE_RE2=1 ], [
+ AC_CHECK_HEADER([re2/re2.h], [
+ AC_CHECK_LIB([re2], [main], [
+ HAVE_RE2=1
+ RE2_LIBS="-lre2" ], [ : ])
+ ])
+ ])
+ AS_IF([test "$HAVE_RE2" -ne 1], [AC_MSG_ERROR([Could not find libre2])])
+ ])
+ AM_CONDITIONAL([HAVE_RE2], [test "$HAVE_RE2" -eq 1])
+ AS_IF([test "$HAVE_RE2" -eq 1], [AC_DEFINE([HAVE_RE2], [1], [Define if using RE2.])])
+])
diff --git a/m4/pdns_with_service_user.m4 b/m4/pdns_with_service_user.m4
new file mode 100644
index 0000000..246b544
--- /dev/null
+++ b/m4/pdns_with_service_user.m4
@@ -0,0 +1,17 @@
+AC_DEFUN([PDNS_WITH_SERVICE_USER], [
+ AC_MSG_CHECKING([What user and group will be used by service])
+ AC_ARG_WITH([service-user],
+ AS_HELP_STRING([--with-service-user], [User to use by service when running the service @<:@default=$1@:>@. Only the setuid setting and User in the systemd unit file are affected, the user is not created.]),
+ [AC_SUBST([service_user], [$withval])],
+ [AC_SUBST([service_user], [$1])]
+ )
+
+ AC_ARG_WITH([service-group],
+ AS_HELP_STRING([--with-service-group], [Group to use by service when running the service @<:@default=$1@:>@. Only the setgid setting and Group in the systemd unit file are affected, the group is not created.]),
+ [AC_SUBST([service_group], [$withval])],
+ [AC_SUBST([service_group], [$1])]
+ )
+
+ AS_IF([test -z "$service_user"], [AC_MSG_ERROR([No service user has been defined!])], [ : ])
+ AC_MSG_RESULT([$service_user])
+])
diff --git a/m4/systemd.m4 b/m4/systemd.m4
new file mode 100644
index 0000000..66dc62c
--- /dev/null
+++ b/m4/systemd.m4
@@ -0,0 +1,223 @@
+# systemd.m4 - Macros to check for and enable systemd -*- Autoconf -*-
+#
+# Copyright (C) 2014 Luis R. Rodriguez <mcgrof@suse.com>
+# Copyright (C) 2016 Pieter Lexis <pieter.lexis@powerdns.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+#serial 2
+
+dnl Some optional path options
+AC_DEFUN([AX_SYSTEMD_OPTIONS], [
+ AC_ARG_WITH(systemd, [ --with-systemd set directory for systemd service files],
+ SYSTEMD_DIR="$withval", SYSTEMD_DIR="")
+ AC_SUBST(SYSTEMD_DIR)
+
+ AC_ARG_WITH(systemd, [ --with-systemd-modules-load set directory for systemd modules load files],
+ SYSTEMD_MODULES_LOAD="$withval", SYSTEMD_MODULES_LOAD="")
+ AC_SUBST(SYSTEMD_MODULES_LOAD)
+])
+
+AC_DEFUN([AX_ENABLE_SYSTEMD_OPTS], [
+ AX_ARG_DEFAULT_ENABLE([systemd], [Disable systemd support])
+ AX_SYSTEMD_OPTIONS()
+])
+
+AC_DEFUN([AX_ALLOW_SYSTEMD_OPTS], [
+ AX_ARG_DEFAULT_DISABLE([systemd], [Enable systemd support], [$1])
+ AX_SYSTEMD_OPTIONS()
+])
+
+AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
+ AC_REQUIRE([AX_CHECK_SYSTEMD_DETECT_AND_ENABLE])
+ AS_IF([test "x$libsystemd" = x], [
+ AC_MSG_ERROR([Unable to find a suitable libsystemd library])
+ ])
+
+ PKG_CHECK_MODULES([SYSTEMD], [$libsystemd_daemon])
+ dnl pkg-config older than 0.24 does not set these for
+ dnl PKG_CHECK_MODULES() worth also noting is that as of version 208
+ dnl of systemd pkg-config --cflags currently yields no extra flags yet.
+ AC_SUBST([SYSTEMD_CFLAGS])
+ AC_SUBST([SYSTEMD_LIBS])
+
+ AS_IF([test "x$SYSTEMD_DIR" = x], [
+ dnl In order to use the line below we need to fix upstream systemd
+ dnl to properly ${prefix} for child variables in
+ dnl src/core/systemd.pc.in but this is a bit complex at the
+ dnl moment as they depend on another rootprefix, which can vary
+ dnl from prefix in practice. We provide our own definition as we
+ dnl *know* where systemd will dump this to, but this does limit
+ dnl us to stick to a non custom systemdsystemunitdir, dnl to work
+ dnl around this we provide the additional configure option
+ dnl --with-systemd where you can specify the directory for the unit
+ dnl files. It would also be best to just extend the upstream
+ dnl pkg-config pkg.m4 with an AC_DEFUN() to do this neatly.
+ dnl SYSTEMD_DIR="`$PKG_CONFIG --define-variable=prefix=$PREFIX --variable=systemdsystemunitdir systemd`"
+ SYSTEMD_DIR="\$(prefix)/lib/systemd/system/"
+ ], [])
+
+ AS_IF([test "x$SYSTEMD_DIR" = x], [
+ AC_MSG_ERROR([SYSTEMD_DIR is unset])
+ ], [])
+
+ dnl There is no variable for this yet for some reason
+ AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [
+ SYSTEMD_MODULES_LOAD="\$(prefix)/lib/modules-load.d/"
+ ], [])
+
+ AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [
+ AC_MSG_ERROR([SYSTEMD_MODULES_LOAD is unset])
+ ], [])
+])
+
+AC_DEFUN([AX_CHECK_SYSTEMD], [
+ dnl Respect user override to disable
+ AS_IF([test "x$enable_systemd" != "xno"], [
+ AS_IF([test "x$systemd" = "xy" ], [
+ AC_DEFINE([HAVE_SYSTEMD], [1], [Systemd available and enabled])
+ systemd=y
+ AX_CHECK_SYSTEMD_LIBS()
+ ],[systemd=n])
+ ],[systemd=n])
+])
+
+AC_DEFUN([AX_CHECK_SYSTEMD_DETECT_AND_ENABLE], [
+ AC_CHECK_HEADER([systemd/sd-daemon.h], [
+ for libname in systemd-daemon systemd; do
+ AC_CHECK_LIB([$libname], [sd_listen_fds], [
+ libsystemd_daemon="lib$libname"
+ systemd=y
+ libsystemd=y
+ ])
+ done
+ ])
+])
+
+dnl Enables systemd by default and requires a --disable-systemd option flag
+dnl to configure if you want to disable.
+AC_DEFUN([AX_ENABLE_SYSTEMD], [
+ AX_ENABLE_SYSTEMD_OPTS()
+ AX_CHECK_SYSTEMD()
+])
+
+dnl Systemd will be disabled by default and requires you to run configure with
+dnl --enable-systemd to look for and enable systemd.
+AC_DEFUN([AX_ALLOW_SYSTEMD], [
+ AX_ALLOW_SYSTEMD_OPTS()
+ AX_CHECK_SYSTEMD()
+])
+
+dnl Systemd will be disabled by default but if your build system is detected
+dnl to have systemd build libraries it will be enabled. You can always force
+dnl disable with --disable-systemd
+AC_DEFUN([AX_AVAILABLE_SYSTEMD], [
+ AX_ALLOW_SYSTEMD_OPTS([, but will be enabled when libraries are found])
+ AX_CHECK_SYSTEMD_DETECT_AND_ENABLE()
+ AX_CHECK_SYSTEMD()
+])
+
+AC_DEFUN([AX_CHECK_SYSTEMD_FEATURES], [
+ AS_IF([test x"$systemd" = "xy"], [
+ AC_PATH_PROG([SYSTEMCTL], [systemctl], [no])
+ AS_IF([test "$SYSTEMCTL" = "no"],
+ [AC_MSG_ERROR([systemctl not found])], [
+ _systemd_version=`${SYSTEMCTL} --version|head -1 |cut -d" " -f 2`
+ if test $_systemd_version -ge 183; then
+ systemd_private_tmp=y
+ fi
+ if test $_systemd_version -ge 209; then
+ systemd_system_call_architectures=y
+ systemd_private_devices=y
+ fi
+ if test $_systemd_version -ge 211; then
+ systemd_restrict_address_families=y
+ fi
+ if test $_systemd_version -ge 214; then
+ systemd_protect_system=y
+ systemd_protect_home=y
+ fi
+ if test $_systemd_version -ge 231; then
+ systemd_restrict_realtime=y
+ systemd_memory_deny_write_execute=y
+ fi
+ if test $_systemd_version -ge 232; then
+ systemd_protect_control_groups=y
+ systemd_protect_kernel_modules=y
+ systemd_protect_kernel_tunables=y
+ systemd_remove_ipc=y
+ systemd_dynamic_user=y
+ systemd_private_users=y
+ systemd_protect_system_strict=y
+ fi
+ if test $_systemd_version -ge 233; then
+ systemd_restrict_namespaces=y
+ fi
+ if test $_systemd_version -ge 235; then
+ systemd_lock_personality=y
+ # while SystemCallFilter is technically available starting with 187,
+ # we use the pre-defined call filter sets that have been introduced later.
+ # Initial support for these landed in 231
+ # @filesystem @reboot @swap in 233
+ # @aio, @sync, @chown, @setuid, @memlock, @signal and @timer in 235
+ systemd_system_call_filter=y
+ fi
+ if test $_systemd_version -ge 236; then
+ systemd_percent_t=y
+ fi
+ if test $_systemd_version -ge 239; then
+ systemd_private_mounts=y
+ fi
+ if test $_systemd_version -ge 240; then
+ systemd_with_runtime_dir_env=y
+ fi
+ if test $_systemd_version -ge 242; then
+ systemd_protect_hostname=y
+ systemd_restrict_suidsgid=y
+ fi
+ if test $_systemd_version -ge 244; then
+ systemd_protect_kernel_logs=y
+ fi
+ if test $_systemd_version -ge 245; then
+ systemd_protect_clock=y
+ fi
+ ])
+ ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_DYNAMIC_USER], [ test x"$systemd_dynamic_user" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_LOCK_PERSONALITY], [ test x"$systemd_lock_personality" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_MEMORY_DENY_WRITE_EXECUTE], [ test x"$systemd_memory_deny_write_execute" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PERCENT_T], [ test x"$systemd_percent_t" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PRIVATE_DEVICES], [ test x"$systemd_private_devices" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PRIVATE_MOUNTS], [ test x"$systemd_private_mounts" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PRIVATE_TMP], [ test x"$systemd_private_tmp" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PRIVATE_USERS], [ test x"$systemd_private_users" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PROTECT_CLOCK], [ test x"$systemd_protect_clock" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PROTECT_CONTROL_GROUPS], [ test x"$systemd_protect_control_groups" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PROTECT_HOME], [ test x"$systemd_protect_home" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PROTECT_HOSTNAME], [ test x"$systemd_protect_hostname" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PROTECT_KERNEL_LOGS], [ test x"$systemd_protect_kernel_logs" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PROTECT_KERNEL_MODULES], [ test x"$systemd_protect_kernel_modules" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PROTECT_KERNEL_TUNABLES], [ test x"$systemd_protect_kernel_tunables" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PROTECT_SYSTEM], [ test x"$systemd_protect_system" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_PROTECT_SYSTEM_STRICT], [ test x"$systemd_protect_system_strict" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_REMOVE_IPC], [ test x"$systemd_remove_ipc" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_RESTRICT_ADDRESS_FAMILIES], [ test x"$systemd_restrict_address_families" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_RESTRICT_NAMESPACES], [ test x"$systemd_restrict_namespaces" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_RESTRICT_REALTIME], [ test x"$systemd_restrict_realtime" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_RESTRICT_SUIDSGID], [ test x"$systemd_restrict_suidsgid" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_SYSTEM_CALL_ARCHITECTURES], [ test x"$systemd_system_call_architectures" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_SYSTEM_CALL_FILTER], [ test x"$systemd_system_call_filter" = "xy" ])
+ AM_CONDITIONAL([HAVE_SYSTEMD_WITH_RUNTIME_DIR_ENV], [ test x"$systemd_with_runtime_dir_env" = "xy" ])
+])
diff --git a/m4/warnings.m4 b/m4/warnings.m4
new file mode 100644
index 0000000..5ae01de
--- /dev/null
+++ b/m4/warnings.m4
@@ -0,0 +1,79 @@
+# warnings.m4 serial 11
+dnl Copyright (C) 2008-2015 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson
+
+# gl_AS_VAR_APPEND(VAR, VALUE)
+# ----------------------------
+# Provide the functionality of AS_VAR_APPEND if Autoconf does not have it.
+m4_ifdef([AS_VAR_APPEND],
+[m4_copy([AS_VAR_APPEND], [gl_AS_VAR_APPEND])],
+[m4_define([gl_AS_VAR_APPEND],
+[AS_VAR_SET([$1], [AS_VAR_GET([$1])$2])])])
+
+
+# gl_COMPILER_OPTION_IF(OPTION, [IF-SUPPORTED], [IF-NOT-SUPPORTED],
+# [PROGRAM = AC_LANG_PROGRAM()])
+# -----------------------------------------------------------------
+# Check if the compiler supports OPTION when compiling PROGRAM.
+#
+# FIXME: gl_Warn must be used unquoted until we can assume Autoconf
+# 2.64 or newer.
+AC_DEFUN([gl_COMPILER_OPTION_IF],
+[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
+AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
+AS_LITERAL_IF([$1],
+ [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))],
+ [gl_positive="$1"
+case $gl_positive in
+ -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
+esac
+m4_pushdef([gl_Positive], [$gl_positive])])dnl
+AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
+ gl_save_compiler_FLAGS="$gl_Flags"
+ gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
+ [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["])
+ AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
+ [AS_VAR_SET(gl_Warn, [yes])],
+ [AS_VAR_SET(gl_Warn, [no])])
+ gl_Flags="$gl_save_compiler_FLAGS"
+])
+AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
+m4_popdef([gl_Positive])dnl
+AS_VAR_POPDEF([gl_Flags])dnl
+AS_VAR_POPDEF([gl_Warn])dnl
+])
+
+# gl_UNKNOWN_WARNINGS_ARE_ERRORS
+# ------------------------------
+# Clang doesn't complain about unknown warning options unless one also
+# specifies -Wunknown-warning-option -Werror. Detect this.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
+[gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
+ [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
+ [gl_unknown_warnings_are_errors=])])
+
+# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
+# [PROGRAM = AC_LANG_PROGRAM()])
+# ---------------------------------------------
+# Adds parameter to WARN_CFLAGS if the compiler supports it when
+# compiling PROGRAM. For example, gl_WARN_ADD([-Wparentheses]).
+#
+# If VARIABLE is a variable name, AC_SUBST it.
+AC_DEFUN([gl_WARN_ADD],
+[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+gl_COMPILER_OPTION_IF([$1],
+ [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
+ [],
+ [$3])
+m4_ifval([$2],
+ [AS_LITERAL_IF([$2], [AC_SUBST([$2])])],
+ [AC_SUBST([WARN_CFLAGS])])dnl
+])
+
+# Local Variables:
+# mode: autoconf
+# End:
diff --git a/misc.cc b/misc.cc
new file mode 100644
index 0000000..c243386
--- /dev/null
+++ b/misc.cc
@@ -0,0 +1,1752 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <sys/param.h>
+#include <sys/socket.h>
+#include <fcntl.h>
+#include <netdb.h>
+#include <sys/time.h>
+#include <time.h>
+#include <sys/resource.h>
+#include <netinet/in.h>
+#include <sys/un.h>
+#include <unistd.h>
+#include <fstream>
+#include "misc.hh"
+#include <vector>
+#include <sstream>
+#include <errno.h>
+#include <cstring>
+#include <iostream>
+#include <sys/types.h>
+#include <dirent.h>
+#include <algorithm>
+#include <poll.h>
+#include <iomanip>
+#include <netinet/tcp.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "pdnsexception.hh"
+#include <sys/types.h>
+#include <boost/algorithm/string.hpp>
+#include "iputils.hh"
+#include "dnsparser.hh"
+#include <sys/types.h>
+#include <pwd.h>
+#include <grp.h>
+#include <limits.h>
+#ifdef __FreeBSD__
+# include <pthread_np.h>
+#endif
+#ifdef __NetBSD__
+# include <pthread.h>
+# include <sched.h>
+#endif
+
+size_t writen2(int fd, const void *buf, size_t count)
+{
+ const char *ptr = reinterpret_cast<const char*>(buf);
+ const char *eptr = ptr + count;
+
+ ssize_t res;
+ while(ptr != eptr) {
+ res = ::write(fd, ptr, eptr - ptr);
+ if(res < 0) {
+ if (errno == EAGAIN)
+ throw std::runtime_error("used writen2 on non-blocking socket, got EAGAIN");
+ else
+ unixDie("failed in writen2");
+ }
+ else if (res == 0)
+ throw std::runtime_error("could not write all bytes, got eof in writen2");
+
+ ptr += (size_t) res;
+ }
+
+ return count;
+}
+
+size_t readn2(int fd, void* buffer, size_t len)
+{
+ size_t pos=0;
+ ssize_t res;
+ for(;;) {
+ res = read(fd, (char*)buffer + pos, len - pos);
+ if(res == 0)
+ throw runtime_error("EOF while reading message");
+ if(res < 0) {
+ if (errno == EAGAIN)
+ throw std::runtime_error("used readn2 on non-blocking socket, got EAGAIN");
+ else
+ unixDie("failed in readn2");
+ }
+
+ pos+=(size_t)res;
+ if(pos == len)
+ break;
+ }
+ return len;
+}
+
+size_t readn2WithTimeout(int fd, void* buffer, size_t len, const struct timeval& idleTimeout, const struct timeval& totalTimeout, bool allowIncomplete)
+{
+ size_t pos = 0;
+ struct timeval start{0,0};
+ struct timeval remainingTime = totalTimeout;
+ if (totalTimeout.tv_sec != 0 || totalTimeout.tv_usec != 0) {
+ gettimeofday(&start, nullptr);
+ }
+
+ do {
+ ssize_t got = read(fd, (char *)buffer + pos, len - pos);
+ if (got > 0) {
+ pos += (size_t) got;
+ if (allowIncomplete) {
+ break;
+ }
+ }
+ else if (got == 0) {
+ throw runtime_error("EOF while reading message");
+ }
+ else {
+ if (errno == EAGAIN) {
+ struct timeval w = ((totalTimeout.tv_sec == 0 && totalTimeout.tv_usec == 0) || idleTimeout <= remainingTime) ? idleTimeout : remainingTime;
+ int res = waitForData(fd, w.tv_sec, w.tv_usec);
+ if (res > 0) {
+ /* there is data available */
+ }
+ else if (res == 0) {
+ throw runtime_error("Timeout while waiting for data to read");
+ } else {
+ throw runtime_error("Error while waiting for data to read");
+ }
+ }
+ else {
+ unixDie("failed in readn2WithTimeout");
+ }
+ }
+
+ if (totalTimeout.tv_sec != 0 || totalTimeout.tv_usec != 0) {
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ struct timeval elapsed = now - start;
+ if (remainingTime < elapsed) {
+ throw runtime_error("Timeout while reading data");
+ }
+ start = now;
+ remainingTime = remainingTime - elapsed;
+ }
+ }
+ while (pos < len);
+
+ return len;
+}
+
+size_t writen2WithTimeout(int fd, const void * buffer, size_t len, const struct timeval& timeout)
+{
+ size_t pos = 0;
+ do {
+ ssize_t written = write(fd, reinterpret_cast<const char *>(buffer) + pos, len - pos);
+
+ if (written > 0) {
+ pos += (size_t) written;
+ }
+ else if (written == 0)
+ throw runtime_error("EOF while writing message");
+ else {
+ if (errno == EAGAIN) {
+ int res = waitForRWData(fd, false, timeout.tv_sec, timeout.tv_usec);
+ if (res > 0) {
+ /* there is room available */
+ }
+ else if (res == 0) {
+ throw runtime_error("Timeout while waiting to write data");
+ } else {
+ throw runtime_error("Error while waiting for room to write data");
+ }
+ }
+ else {
+ unixDie("failed in write2WithTimeout");
+ }
+ }
+ }
+ while (pos < len);
+
+ return len;
+}
+
+string nowTime()
+{
+ time_t now = time(nullptr);
+ struct tm tm;
+ localtime_r(&now, &tm);
+ char buffer[30];
+ // YYYY-mm-dd HH:MM:SS TZOFF
+ strftime(buffer, sizeof(buffer), "%F %T %z", &tm);
+ buffer[sizeof(buffer)-1] = '\0';
+ return string(buffer);
+}
+
+uint16_t getShort(const unsigned char *p)
+{
+ return p[0] * 256 + p[1];
+}
+
+
+uint16_t getShort(const char *p)
+{
+ return getShort((const unsigned char *)p);
+}
+
+uint32_t getLong(const unsigned char* p)
+{
+ return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3];
+}
+
+uint32_t getLong(const char* p)
+{
+ return getLong(reinterpret_cast<const unsigned char *>(p));
+}
+
+static bool ciEqual(const string& a, const string& b)
+{
+ if(a.size()!=b.size())
+ return false;
+
+ string::size_type pos=0, epos=a.size();
+ for(;pos < epos; ++pos)
+ if(dns_tolower(a[pos])!=dns_tolower(b[pos]))
+ return false;
+ return true;
+}
+
+/** does domain end on suffix? Is smart about "wwwds9a.nl" "ds9a.nl" not matching */
+static bool endsOn(const string &domain, const string &suffix)
+{
+ if( suffix.empty() || ciEqual(domain, suffix) )
+ return true;
+
+ if(domain.size()<=suffix.size())
+ return false;
+
+ string::size_type dpos=domain.size()-suffix.size()-1, spos=0;
+
+ if(domain[dpos++]!='.')
+ return false;
+
+ for(; dpos < domain.size(); ++dpos, ++spos)
+ if(dns_tolower(domain[dpos]) != dns_tolower(suffix[spos]))
+ return false;
+
+ return true;
+}
+
+/** strips a domain suffix from a domain, returns true if it stripped */
+bool stripDomainSuffix(string *qname, const string &domain)
+{
+ if(!endsOn(*qname, domain))
+ return false;
+
+ if(toLower(*qname)==toLower(domain))
+ *qname="@";
+ else {
+ if((*qname)[qname->size()-domain.size()-1]!='.')
+ return false;
+
+ qname->resize(qname->size()-domain.size()-1);
+ }
+ return true;
+}
+
+static void parseService4(const string &descr, ServiceTuple &st)
+{
+ vector<string>parts;
+ stringtok(parts,descr,":");
+ if(parts.empty())
+ throw PDNSException("Unable to parse '"+descr+"' as a service");
+ st.host=parts[0];
+ if(parts.size()>1)
+ st.port=pdns_stou(parts[1]);
+}
+
+static void parseService6(const string &descr, ServiceTuple &st)
+{
+ string::size_type pos=descr.find(']');
+ if(pos == string::npos)
+ throw PDNSException("Unable to parse '"+descr+"' as an IPv6 service");
+
+ st.host=descr.substr(1, pos-1);
+ if(pos + 2 < descr.length())
+ st.port=pdns_stou(descr.substr(pos+2));
+}
+
+
+void parseService(const string &descr, ServiceTuple &st)
+{
+ if(descr.empty())
+ throw PDNSException("Unable to parse '"+descr+"' as a service");
+
+ vector<string> parts;
+ stringtok(parts, descr, ":");
+
+ if(descr[0]=='[') {
+ parseService6(descr, st);
+ }
+ else if(descr[0]==':' || parts.size() > 2 || descr.find("::") != string::npos) {
+ st.host=descr;
+ }
+ else {
+ parseService4(descr, st);
+ }
+}
+
+// returns -1 in case if error, 0 if no data is available, 1 if there is. In the first two cases, errno is set
+int waitForData(int fd, int seconds, int useconds)
+{
+ return waitForRWData(fd, true, seconds, useconds);
+}
+
+int waitForRWData(int fd, bool waitForRead, int seconds, int useconds, bool* error, bool* disconnected)
+{
+ int ret;
+
+ struct pollfd pfd;
+ memset(&pfd, 0, sizeof(pfd));
+ pfd.fd = fd;
+
+ if(waitForRead)
+ pfd.events=POLLIN;
+ else
+ pfd.events=POLLOUT;
+
+ ret = poll(&pfd, 1, seconds * 1000 + useconds/1000);
+ if (ret > 0) {
+ if (error && (pfd.revents & POLLERR)) {
+ *error = true;
+ }
+ if (disconnected && (pfd.revents & POLLHUP)) {
+ *disconnected = true;
+ }
+ }
+
+ return ret;
+}
+
+// returns -1 in case of error, 0 if no data is available, 1 if there is. In the first two cases, errno is set
+int waitForMultiData(const set<int>& fds, const int seconds, const int useconds, int* fdOut) {
+ set<int> realFDs;
+ for (const auto& fd : fds) {
+ if (fd >= 0 && realFDs.count(fd) == 0) {
+ realFDs.insert(fd);
+ }
+ }
+
+ std::vector<struct pollfd> pfds(realFDs.size());
+ memset(pfds.data(), 0, realFDs.size()*sizeof(struct pollfd));
+ int ctr = 0;
+ for (const auto& fd : realFDs) {
+ pfds[ctr].fd = fd;
+ pfds[ctr].events = POLLIN;
+ ctr++;
+ }
+
+ int ret;
+ if(seconds >= 0)
+ ret = poll(pfds.data(), realFDs.size(), seconds * 1000 + useconds/1000);
+ else
+ ret = poll(pfds.data(), realFDs.size(), -1);
+ if(ret <= 0)
+ return ret;
+
+ set<int> pollinFDs;
+ for (const auto& pfd : pfds) {
+ if (pfd.revents & POLLIN) {
+ pollinFDs.insert(pfd.fd);
+ }
+ }
+ set<int>::const_iterator it(pollinFDs.begin());
+ advance(it, random() % pollinFDs.size());
+ *fdOut = *it;
+ return 1;
+}
+
+// returns -1 in case of error, 0 if no data is available, 1 if there is. In the first two cases, errno is set
+int waitFor2Data(int fd1, int fd2, int seconds, int useconds, int*fd)
+{
+ int ret;
+
+ struct pollfd pfds[2];
+ memset(&pfds[0], 0, 2*sizeof(struct pollfd));
+ pfds[0].fd = fd1;
+ pfds[1].fd = fd2;
+
+ pfds[0].events= pfds[1].events = POLLIN;
+
+ int nsocks = 1 + (fd2 >= 0); // fd2 can optionally be -1
+
+ if(seconds >= 0)
+ ret = poll(pfds, nsocks, seconds * 1000 + useconds/1000);
+ else
+ ret = poll(pfds, nsocks, -1);
+ if(!ret || ret < 0)
+ return ret;
+
+ if((pfds[0].revents & POLLIN) && !(pfds[1].revents & POLLIN))
+ *fd = pfds[0].fd;
+ else if((pfds[1].revents & POLLIN) && !(pfds[0].revents & POLLIN))
+ *fd = pfds[1].fd;
+ else if(ret == 2) {
+ *fd = pfds[random()%2].fd;
+ }
+ else
+ *fd = -1; // should never happen
+
+ return 1;
+}
+
+
+string humanDuration(time_t passed)
+{
+ ostringstream ret;
+ if(passed<60)
+ ret<<passed<<" seconds";
+ else if(passed<3600)
+ ret<<std::setprecision(2)<<passed/60.0<<" minutes";
+ else if(passed<86400)
+ ret<<std::setprecision(3)<<passed/3600.0<<" hours";
+ else if(passed<(86400*30.41))
+ ret<<std::setprecision(3)<<passed/86400.0<<" days";
+ else
+ ret<<std::setprecision(3)<<passed/(86400*30.41)<<" months";
+
+ return ret.str();
+}
+
+const string unquotify(const string &item)
+{
+ if(item.size()<2)
+ return item;
+
+ string::size_type bpos=0, epos=item.size();
+
+ if(item[0]=='"')
+ bpos=1;
+
+ if(item[epos-1]=='"')
+ epos-=1;
+
+ return item.substr(bpos,epos-bpos);
+}
+
+void stripLine(string &line)
+{
+ string::size_type pos=line.find_first_of("\r\n");
+ if(pos!=string::npos) {
+ line.resize(pos);
+ }
+}
+
+string urlEncode(const string &text)
+{
+ string ret;
+ for(char i : text)
+ if(i==' ')ret.append("%20");
+ else ret.append(1,i);
+ return ret;
+}
+
+string getHostname()
+{
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN 255
+#endif
+
+ char tmp[MAXHOSTNAMELEN];
+ if(gethostname(tmp, MAXHOSTNAMELEN))
+ return "UNKNOWN";
+
+ return string(tmp);
+}
+
+string itoa(int i)
+{
+ ostringstream o;
+ o<<i;
+ return o.str();
+}
+
+string uitoa(unsigned int i) // MSVC 6 doesn't grok overloading (un)signed
+{
+ ostringstream o;
+ o<<i;
+ return o.str();
+}
+
+string bitFlip(const string &str)
+{
+ string::size_type pos=0, epos=str.size();
+ string ret;
+ ret.reserve(epos);
+ for(;pos < epos; ++pos)
+ ret.append(1, ~str[pos]);
+ return ret;
+}
+
+string stringerror(int err)
+{
+ return strerror(err);
+}
+
+string stringerror()
+{
+ return strerror(errno);
+}
+
+void cleanSlashes(string &str)
+{
+ string::const_iterator i;
+ string out;
+ for(i=str.begin();i!=str.end();++i) {
+ if(*i=='/' && i!=str.begin() && *(i-1)=='/')
+ continue;
+ out.append(1,*i);
+ }
+ str=out;
+}
+
+
+bool IpToU32(const string &str, uint32_t *ip)
+{
+ if(str.empty()) {
+ *ip=0;
+ return true;
+ }
+
+ struct in_addr inp;
+ if(inet_aton(str.c_str(), &inp)) {
+ *ip=inp.s_addr;
+ return true;
+ }
+ return false;
+}
+
+string U32ToIP(uint32_t val)
+{
+ char tmp[17];
+ snprintf(tmp, sizeof(tmp), "%u.%u.%u.%u",
+ (val >> 24)&0xff,
+ (val >> 16)&0xff,
+ (val >> 8)&0xff,
+ (val )&0xff);
+ return string(tmp);
+}
+
+
+string makeHexDump(const string& str)
+{
+ char tmp[5];
+ string ret;
+ ret.reserve((int)(str.size()*2.2));
+
+ for(char n : str) {
+ snprintf(tmp, sizeof(tmp), "%02x ", (unsigned char)n);
+ ret+=tmp;
+ }
+ return ret;
+}
+
+string makeBytesFromHex(const string &in) {
+ if (in.size() % 2 != 0) {
+ throw std::range_error("odd number of bytes in hex string");
+ }
+ string ret;
+ ret.reserve(in.size());
+ unsigned int num;
+ for (size_t i = 0; i < in.size(); i+=2) {
+ string numStr = in.substr(i, 2);
+ num = 0;
+ sscanf(numStr.c_str(), "%02x", &num);
+ ret.push_back((uint8_t)num);
+ }
+ return ret;
+}
+
+void normalizeTV(struct timeval& tv)
+{
+ if(tv.tv_usec > 1000000) {
+ ++tv.tv_sec;
+ tv.tv_usec-=1000000;
+ }
+ else if(tv.tv_usec < 0) {
+ --tv.tv_sec;
+ tv.tv_usec+=1000000;
+ }
+}
+
+const struct timeval operator+(const struct timeval& lhs, const struct timeval& rhs)
+{
+ struct timeval ret;
+ ret.tv_sec=lhs.tv_sec + rhs.tv_sec;
+ ret.tv_usec=lhs.tv_usec + rhs.tv_usec;
+ normalizeTV(ret);
+ return ret;
+}
+
+const struct timeval operator-(const struct timeval& lhs, const struct timeval& rhs)
+{
+ struct timeval ret;
+ ret.tv_sec=lhs.tv_sec - rhs.tv_sec;
+ ret.tv_usec=lhs.tv_usec - rhs.tv_usec;
+ normalizeTV(ret);
+ return ret;
+}
+
+pair<string, string> splitField(const string& inp, char sepa)
+{
+ pair<string, string> ret;
+ string::size_type cpos=inp.find(sepa);
+ if(cpos==string::npos)
+ ret.first=inp;
+ else {
+ ret.first=inp.substr(0, cpos);
+ ret.second=inp.substr(cpos+1);
+ }
+ return ret;
+}
+
+int logFacilityToLOG(unsigned int facility)
+{
+ switch(facility) {
+ case 0:
+ return LOG_LOCAL0;
+ case 1:
+ return(LOG_LOCAL1);
+ case 2:
+ return(LOG_LOCAL2);
+ case 3:
+ return(LOG_LOCAL3);
+ case 4:
+ return(LOG_LOCAL4);
+ case 5:
+ return(LOG_LOCAL5);
+ case 6:
+ return(LOG_LOCAL6);
+ case 7:
+ return(LOG_LOCAL7);
+ default:
+ return -1;
+ }
+}
+
+string stripDot(const string& dom)
+{
+ if(dom.empty())
+ return dom;
+
+ if(dom[dom.size()-1]!='.')
+ return dom;
+
+ return dom.substr(0,dom.size()-1);
+}
+
+
+
+int makeIPv6sockaddr(const std::string& addr, struct sockaddr_in6* ret)
+{
+ if(addr.empty())
+ return -1;
+ string ourAddr(addr);
+ bool portSet = false;
+ unsigned int port;
+ if(addr[0]=='[') { // [::]:53 style address
+ string::size_type pos = addr.find(']');
+ if(pos == string::npos)
+ return -1;
+ ourAddr.assign(addr.c_str() + 1, pos-1);
+ if (pos + 1 != addr.size()) { // complete after ], no port specified
+ if (pos + 2 > addr.size() || addr[pos+1]!=':')
+ return -1;
+ try {
+ port = pdns_stou(addr.substr(pos+2));
+ portSet = true;
+ }
+ catch(const std::out_of_range&) {
+ return -1;
+ }
+ }
+ }
+ ret->sin6_scope_id=0;
+ ret->sin6_family=AF_INET6;
+
+ if(inet_pton(AF_INET6, ourAddr.c_str(), (void*)&ret->sin6_addr) != 1) {
+ struct addrinfo* res;
+ struct addrinfo hints;
+ memset(&hints, 0, sizeof(hints));
+
+ hints.ai_family = AF_INET6;
+ hints.ai_flags = AI_NUMERICHOST;
+
+ // getaddrinfo has anomalous return codes, anything nonzero is an error, positive or negative
+ if (getaddrinfo(ourAddr.c_str(), nullptr, &hints, &res) != 0) {
+ return -1;
+ }
+
+ memcpy(ret, res->ai_addr, res->ai_addrlen);
+ freeaddrinfo(res);
+ }
+
+ if(portSet) {
+ if(port > 65535)
+ return -1;
+
+ ret->sin6_port = htons(port);
+ }
+
+ return 0;
+}
+
+int makeIPv4sockaddr(const std::string& str, struct sockaddr_in* ret)
+{
+ if(str.empty()) {
+ return -1;
+ }
+ struct in_addr inp;
+
+ string::size_type pos = str.find(':');
+ if(pos == string::npos) { // no port specified, not touching the port
+ if(inet_aton(str.c_str(), &inp)) {
+ ret->sin_addr.s_addr=inp.s_addr;
+ return 0;
+ }
+ return -1;
+ }
+ if(!*(str.c_str() + pos + 1)) // trailing :
+ return -1;
+
+ char *eptr = const_cast<char*>(str.c_str()) + str.size();
+ int port = strtol(str.c_str() + pos + 1, &eptr, 10);
+ if (port < 0 || port > 65535)
+ return -1;
+
+ if(*eptr)
+ return -1;
+
+ ret->sin_port = htons(port);
+ if(inet_aton(str.substr(0, pos).c_str(), &inp)) {
+ ret->sin_addr.s_addr=inp.s_addr;
+ return 0;
+ }
+ return -1;
+}
+
+int makeUNsockaddr(const std::string& path, struct sockaddr_un* ret)
+{
+ if (path.empty())
+ return -1;
+
+ memset(ret, 0, sizeof(struct sockaddr_un));
+ ret->sun_family = AF_UNIX;
+ if (path.length() >= sizeof(ret->sun_path))
+ return -1;
+
+ path.copy(ret->sun_path, sizeof(ret->sun_path), 0);
+ return 0;
+}
+
+//! read a line of text from a FILE* to a std::string, returns false on 'no data'
+bool stringfgets(FILE* fp, std::string& line)
+{
+ char buffer[1024];
+ line.clear();
+
+ do {
+ if(!fgets(buffer, sizeof(buffer), fp))
+ return !line.empty();
+
+ line.append(buffer);
+ } while(!strchr(buffer, '\n'));
+ return true;
+}
+
+bool readFileIfThere(const char* fname, std::string* line)
+{
+ line->clear();
+ auto fp = std::unique_ptr<FILE, int(*)(FILE*)>(fopen(fname, "r"), fclose);
+ if(!fp)
+ return false;
+ stringfgets(fp.get(), *line);
+ fp.reset();
+
+ return true;
+}
+
+Regex::Regex(const string &expr)
+{
+ if(regcomp(&d_preg, expr.c_str(), REG_ICASE|REG_NOSUB|REG_EXTENDED))
+ throw PDNSException("Regular expression did not compile");
+}
+
+// if you end up here because valgrind told you were are doing something wrong
+// with msgh->msg_controllen, please refer to https://github.com/PowerDNS/pdns/pull/3962
+// first.
+// Note that cmsgbuf should be aligned the same as a struct cmsghdr
+void addCMsgSrcAddr(struct msghdr* msgh, cmsgbuf_aligned* cmsgbuf, const ComboAddress* source, int itfIndex)
+{
+ struct cmsghdr *cmsg = nullptr;
+
+ if(source->sin4.sin_family == AF_INET6) {
+ struct in6_pktinfo *pkt;
+
+ msgh->msg_control = cmsgbuf;
+#if !defined( __APPLE__ )
+ /* CMSG_SPACE is not a constexpr on macOS */
+ static_assert(CMSG_SPACE(sizeof(*pkt)) <= sizeof(*cmsgbuf), "Buffer is too small for in6_pktinfo");
+#else /* __APPLE__ */
+ if (CMSG_SPACE(sizeof(*pkt)) > sizeof(*cmsgbuf)) {
+ throw std::runtime_error("Buffer is too small for in6_pktinfo");
+ }
+#endif /* __APPLE__ */
+ msgh->msg_controllen = CMSG_SPACE(sizeof(*pkt));
+
+ cmsg = CMSG_FIRSTHDR(msgh);
+ cmsg->cmsg_level = IPPROTO_IPV6;
+ cmsg->cmsg_type = IPV6_PKTINFO;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(*pkt));
+
+ pkt = (struct in6_pktinfo *) CMSG_DATA(cmsg);
+ // Include the padding to stop valgrind complaining about passing uninitialized data
+ memset(pkt, 0, CMSG_SPACE(sizeof(*pkt)));
+ pkt->ipi6_addr = source->sin6.sin6_addr;
+ pkt->ipi6_ifindex = itfIndex;
+ }
+ else {
+#if defined(IP_PKTINFO)
+ struct in_pktinfo *pkt;
+
+ msgh->msg_control = cmsgbuf;
+#if !defined( __APPLE__ )
+ /* CMSG_SPACE is not a constexpr on macOS */
+ static_assert(CMSG_SPACE(sizeof(*pkt)) <= sizeof(*cmsgbuf), "Buffer is too small for in_pktinfo");
+#else /* __APPLE__ */
+ if (CMSG_SPACE(sizeof(*pkt)) > sizeof(*cmsgbuf)) {
+ throw std::runtime_error("Buffer is too small for in_pktinfo");
+ }
+#endif /* __APPLE__ */
+ msgh->msg_controllen = CMSG_SPACE(sizeof(*pkt));
+
+ cmsg = CMSG_FIRSTHDR(msgh);
+ cmsg->cmsg_level = IPPROTO_IP;
+ cmsg->cmsg_type = IP_PKTINFO;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(*pkt));
+
+ pkt = (struct in_pktinfo *) CMSG_DATA(cmsg);
+ // Include the padding to stop valgrind complaining about passing uninitialized data
+ memset(pkt, 0, CMSG_SPACE(sizeof(*pkt)));
+ pkt->ipi_spec_dst = source->sin4.sin_addr;
+ pkt->ipi_ifindex = itfIndex;
+#elif defined(IP_SENDSRCADDR)
+ struct in_addr *in;
+
+ msgh->msg_control = cmsgbuf;
+#if !defined( __APPLE__ )
+ static_assert(CMSG_SPACE(sizeof(*in)) <= sizeof(*cmsgbuf), "Buffer is too small for in_addr");
+#else /* __APPLE__ */
+ if (CMSG_SPACE(sizeof(*in)) > sizeof(*cmsgbuf)) {
+ throw std::runtime_error("Buffer is too small for in_addr");
+ }
+#endif /* __APPLE__ */
+ msgh->msg_controllen = CMSG_SPACE(sizeof(*in));
+
+ cmsg = CMSG_FIRSTHDR(msgh);
+ cmsg->cmsg_level = IPPROTO_IP;
+ cmsg->cmsg_type = IP_SENDSRCADDR;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(*in));
+
+ // Include the padding to stop valgrind complaining about passing uninitialized data
+ in = (struct in_addr *) CMSG_DATA(cmsg);
+ memset(in, 0, CMSG_SPACE(sizeof(*in)));
+ *in = source->sin4.sin_addr;
+#endif
+ }
+}
+
+unsigned int getFilenumLimit(bool hardOrSoft)
+{
+ struct rlimit rlim;
+ if(getrlimit(RLIMIT_NOFILE, &rlim) < 0)
+ unixDie("Requesting number of available file descriptors");
+ return hardOrSoft ? rlim.rlim_max : rlim.rlim_cur;
+}
+
+void setFilenumLimit(unsigned int lim)
+{
+ struct rlimit rlim;
+
+ if(getrlimit(RLIMIT_NOFILE, &rlim) < 0)
+ unixDie("Requesting number of available file descriptors");
+ rlim.rlim_cur=lim;
+ if(setrlimit(RLIMIT_NOFILE, &rlim) < 0)
+ unixDie("Setting number of available file descriptors");
+}
+
+#define burtlemix(a,b,c) \
+{ \
+ a -= b; a -= c; a ^= (c>>13); \
+ b -= c; b -= a; b ^= (a<<8); \
+ c -= a; c -= b; c ^= (b>>13); \
+ a -= b; a -= c; a ^= (c>>12); \
+ b -= c; b -= a; b ^= (a<<16); \
+ c -= a; c -= b; c ^= (b>>5); \
+ a -= b; a -= c; a ^= (c>>3); \
+ b -= c; b -= a; b ^= (a<<10); \
+ c -= a; c -= b; c ^= (b>>15); \
+}
+
+uint32_t burtle(const unsigned char* k, uint32_t length, uint32_t initval)
+{
+ uint32_t a,b,c,len;
+
+ /* Set up the internal state */
+ len = length;
+ a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */
+ c = initval; /* the previous hash value */
+
+ /*---------------------------------------- handle most of the key */
+ while (len >= 12) {
+ a += (k[0] +((uint32_t)k[1]<<8) +((uint32_t)k[2]<<16) +((uint32_t)k[3]<<24));
+ b += (k[4] +((uint32_t)k[5]<<8) +((uint32_t)k[6]<<16) +((uint32_t)k[7]<<24));
+ c += (k[8] +((uint32_t)k[9]<<8) +((uint32_t)k[10]<<16)+((uint32_t)k[11]<<24));
+ burtlemix(a,b,c);
+ k += 12; len -= 12;
+ }
+
+ /*------------------------------------- handle the last 11 bytes */
+ c += length;
+ switch(len) { /* all the case statements fall through */
+ case 11: c+=((uint32_t)k[10]<<24);
+ /* fall-through */
+ case 10: c+=((uint32_t)k[9]<<16);
+ /* fall-through */
+ case 9 : c+=((uint32_t)k[8]<<8);
+ /* the first byte of c is reserved for the length */
+ /* fall-through */
+ case 8 : b+=((uint32_t)k[7]<<24);
+ /* fall-through */
+ case 7 : b+=((uint32_t)k[6]<<16);
+ /* fall-through */
+ case 6 : b+=((uint32_t)k[5]<<8);
+ /* fall-through */
+ case 5 : b+=k[4];
+ /* fall-through */
+ case 4 : a+=((uint32_t)k[3]<<24);
+ /* fall-through */
+ case 3 : a+=((uint32_t)k[2]<<16);
+ /* fall-through */
+ case 2 : a+=((uint32_t)k[1]<<8);
+ /* fall-through */
+ case 1 : a+=k[0];
+ /* case 0: nothing left to add */
+ }
+ burtlemix(a,b,c);
+ /*-------------------------------------------- report the result */
+ return c;
+}
+
+uint32_t burtleCI(const unsigned char* k, uint32_t length, uint32_t initval)
+{
+ uint32_t a,b,c,len;
+
+ /* Set up the internal state */
+ len = length;
+ a = b = 0x9e3779b9; /* the golden ratio; an arbitrary value */
+ c = initval; /* the previous hash value */
+
+ /*---------------------------------------- handle most of the key */
+ while (len >= 12) {
+ a += (dns_tolower(k[0]) +((uint32_t)dns_tolower(k[1])<<8) +((uint32_t)dns_tolower(k[2])<<16) +((uint32_t)dns_tolower(k[3])<<24));
+ b += (dns_tolower(k[4]) +((uint32_t)dns_tolower(k[5])<<8) +((uint32_t)dns_tolower(k[6])<<16) +((uint32_t)dns_tolower(k[7])<<24));
+ c += (dns_tolower(k[8]) +((uint32_t)dns_tolower(k[9])<<8) +((uint32_t)dns_tolower(k[10])<<16)+((uint32_t)dns_tolower(k[11])<<24));
+ burtlemix(a,b,c);
+ k += 12; len -= 12;
+ }
+
+ /*------------------------------------- handle the last 11 bytes */
+ c += length;
+ switch(len) { /* all the case statements fall through */
+ case 11: c+=((uint32_t)dns_tolower(k[10])<<24);
+ /* fall-through */
+ case 10: c+=((uint32_t)dns_tolower(k[9])<<16);
+ /* fall-through */
+ case 9 : c+=((uint32_t)dns_tolower(k[8])<<8);
+ /* the first byte of c is reserved for the length */
+ /* fall-through */
+ case 8 : b+=((uint32_t)dns_tolower(k[7])<<24);
+ /* fall-through */
+ case 7 : b+=((uint32_t)dns_tolower(k[6])<<16);
+ /* fall-through */
+ case 6 : b+=((uint32_t)dns_tolower(k[5])<<8);
+ /* fall-through */
+ case 5 : b+=dns_tolower(k[4]);
+ /* fall-through */
+ case 4 : a+=((uint32_t)dns_tolower(k[3])<<24);
+ /* fall-through */
+ case 3 : a+=((uint32_t)dns_tolower(k[2])<<16);
+ /* fall-through */
+ case 2 : a+=((uint32_t)dns_tolower(k[1])<<8);
+ /* fall-through */
+ case 1 : a+=dns_tolower(k[0]);
+ /* case 0: nothing left to add */
+ }
+ burtlemix(a,b,c);
+ /*-------------------------------------------- report the result */
+ return c;
+}
+
+
+bool setSocketTimestamps(int fd)
+{
+#ifdef SO_TIMESTAMP
+ int on=1;
+ return setsockopt(fd, SOL_SOCKET, SO_TIMESTAMP, (char*)&on, sizeof(on)) == 0;
+#else
+ return true; // we pretend this happened.
+#endif
+}
+
+bool setTCPNoDelay(int sock)
+{
+ int flag = 1;
+ return setsockopt(sock, /* socket affected */
+ IPPROTO_TCP, /* set option at TCP level */
+ TCP_NODELAY, /* name of option */
+ (char *) &flag, /* the cast is historical cruft */
+ sizeof(flag)) == 0; /* length of option value */
+}
+
+
+bool setNonBlocking(int sock)
+{
+ int flags=fcntl(sock,F_GETFL,0);
+ if(flags<0 || fcntl(sock, F_SETFL,flags|O_NONBLOCK) <0)
+ return false;
+ return true;
+}
+
+bool setBlocking(int sock)
+{
+ int flags=fcntl(sock,F_GETFL,0);
+ if(flags<0 || fcntl(sock, F_SETFL,flags&(~O_NONBLOCK)) <0)
+ return false;
+ return true;
+}
+
+bool setReuseAddr(int sock)
+{
+ int tmp = 1;
+ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char*)&tmp, static_cast<unsigned>(sizeof tmp))<0)
+ throw PDNSException(string("Setsockopt failed: ")+stringerror());
+ return true;
+}
+
+bool isNonBlocking(int sock)
+{
+ int flags=fcntl(sock,F_GETFL,0);
+ return flags & O_NONBLOCK;
+}
+
+bool setReceiveSocketErrors(int sock, int af)
+{
+#ifdef __linux__
+ int tmp = 1, ret;
+ if (af == AF_INET) {
+ ret = setsockopt(sock, IPPROTO_IP, IP_RECVERR, &tmp, sizeof(tmp));
+ } else {
+ ret = setsockopt(sock, IPPROTO_IPV6, IPV6_RECVERR, &tmp, sizeof(tmp));
+ }
+ if (ret < 0) {
+ throw PDNSException(string("Setsockopt failed: ") + stringerror());
+ }
+#endif
+ return true;
+}
+
+// Closes a socket.
+int closesocket( int socket )
+{
+ int ret=::close(socket);
+ if(ret < 0 && errno == ECONNRESET) // see ticket 192, odd BSD behaviour
+ return 0;
+ if(ret < 0)
+ throw PDNSException("Error closing socket: "+stringerror());
+ return ret;
+}
+
+bool setCloseOnExec(int sock)
+{
+ int flags=fcntl(sock,F_GETFD,0);
+ if(flags<0 || fcntl(sock, F_SETFD,flags|FD_CLOEXEC) <0)
+ return false;
+ return true;
+}
+
+string getMACAddress(const ComboAddress& ca)
+{
+ string ret;
+#ifdef __linux__
+ ifstream ifs("/proc/net/arp");
+ if(!ifs)
+ return ret;
+ string line;
+ string match=ca.toString()+' ';
+ while(getline(ifs, line)) {
+ if(boost::starts_with(line, match)) {
+ vector<string> parts;
+ stringtok(parts, line, " \n\t\r");
+ if(parts.size() < 4)
+ return ret;
+ unsigned int tmp[6];
+ if (sscanf(parts[3].c_str(), "%02x:%02x:%02x:%02x:%02x:%02x", tmp, tmp+1, tmp+2, tmp+3, tmp+4, tmp+5) != 6) {
+ return ret;
+ }
+ for(unsigned int i : tmp)
+ ret.append(1, (char)i);
+ return ret;
+ }
+ }
+#endif
+ return ret;
+}
+
+uint64_t udpErrorStats(const std::string& str)
+{
+#ifdef __linux__
+ ifstream ifs("/proc/net/snmp");
+ if (!ifs) {
+ return 0;
+ }
+
+ string line;
+ while (getline(ifs, line)) {
+ if (boost::starts_with(line, "Udp: ") && isdigit(line.at(5))) {
+ vector<string> parts;
+ stringtok(parts, line, " \n\t\r");
+
+ if (parts.size() < 7) {
+ break;
+ }
+
+ if (str == "udp-rcvbuf-errors") {
+ return std::stoull(parts.at(5));
+ }
+ else if (str == "udp-sndbuf-errors") {
+ return std::stoull(parts.at(6));
+ }
+ else if (str == "udp-noport-errors") {
+ return std::stoull(parts.at(2));
+ }
+ else if (str == "udp-in-errors") {
+ return std::stoull(parts.at(3));
+ }
+ else if (parts.size() >= 8 && str == "udp-in-csum-errors") {
+ return std::stoull(parts.at(7));
+ }
+ else {
+ return 0;
+ }
+ }
+ }
+#endif
+ return 0;
+}
+
+uint64_t udp6ErrorStats(const std::string& str)
+{
+#ifdef __linux__
+ const std::map<std::string, std::string> keys = {
+ { "udp6-in-errors", "Udp6InErrors" },
+ { "udp6-recvbuf-errors", "Udp6RcvbufErrors" },
+ { "udp6-sndbuf-errors", "Udp6SndbufErrors" },
+ { "udp6-noport-errors", "Udp6NoPorts" },
+ { "udp6-in-csum-errors", "Udp6InCsumErrors" }
+ };
+
+ auto key = keys.find(str);
+ if (key == keys.end()) {
+ return 0;
+ }
+
+ ifstream ifs("/proc/net/snmp6");
+ if (!ifs) {
+ return 0;
+ }
+
+ std::string line;
+ while (getline(ifs, line)) {
+ if (!boost::starts_with(line, key->second)) {
+ continue;
+ }
+
+ std::vector<std::string> parts;
+ stringtok(parts, line, " \n\t\r");
+
+ if (parts.size() != 2) {
+ return 0;
+ }
+
+ return std::stoull(parts.at(1));
+ }
+#endif
+ return 0;
+}
+
+uint64_t tcpErrorStats(const std::string& str)
+{
+#ifdef __linux__
+ ifstream ifs("/proc/net/netstat");
+ if (!ifs) {
+ return 0;
+ }
+
+ string line;
+ vector<string> parts;
+ while (getline(ifs,line)) {
+ if (line.size() > 9 && boost::starts_with(line, "TcpExt: ") && isdigit(line.at(8))) {
+ stringtok(parts, line, " \n\t\r");
+
+ if (parts.size() < 21) {
+ break;
+ }
+
+ return std::stoull(parts.at(20));
+ }
+ }
+#endif
+ return 0;
+}
+
+uint64_t getCPUIOWait(const std::string& str)
+{
+#ifdef __linux__
+ ifstream ifs("/proc/stat");
+ if (!ifs) {
+ return 0;
+ }
+
+ string line;
+ vector<string> parts;
+ while (getline(ifs, line)) {
+ if (boost::starts_with(line, "cpu ")) {
+ stringtok(parts, line, " \n\t\r");
+
+ if (parts.size() < 6) {
+ break;
+ }
+
+ return std::stoull(parts[5]);
+ }
+ }
+#endif
+ return 0;
+}
+
+uint64_t getCPUSteal(const std::string& str)
+{
+#ifdef __linux__
+ ifstream ifs("/proc/stat");
+ if (!ifs) {
+ return 0;
+ }
+
+ string line;
+ vector<string> parts;
+ while (getline(ifs, line)) {
+ if (boost::starts_with(line, "cpu ")) {
+ stringtok(parts, line, " \n\t\r");
+
+ if (parts.size() < 9) {
+ break;
+ }
+
+ return std::stoull(parts[8]);
+ }
+ }
+#endif
+ return 0;
+}
+
+bool getTSIGHashEnum(const DNSName& algoName, TSIGHashEnum& algoEnum)
+{
+ if (algoName == DNSName("hmac-md5.sig-alg.reg.int") || algoName == DNSName("hmac-md5"))
+ algoEnum = TSIG_MD5;
+ else if (algoName == DNSName("hmac-sha1"))
+ algoEnum = TSIG_SHA1;
+ else if (algoName == DNSName("hmac-sha224"))
+ algoEnum = TSIG_SHA224;
+ else if (algoName == DNSName("hmac-sha256"))
+ algoEnum = TSIG_SHA256;
+ else if (algoName == DNSName("hmac-sha384"))
+ algoEnum = TSIG_SHA384;
+ else if (algoName == DNSName("hmac-sha512"))
+ algoEnum = TSIG_SHA512;
+ else if (algoName == DNSName("gss-tsig"))
+ algoEnum = TSIG_GSS;
+ else {
+ return false;
+ }
+ return true;
+}
+
+DNSName getTSIGAlgoName(TSIGHashEnum& algoEnum)
+{
+ switch(algoEnum) {
+ case TSIG_MD5: return DNSName("hmac-md5.sig-alg.reg.int.");
+ case TSIG_SHA1: return DNSName("hmac-sha1.");
+ case TSIG_SHA224: return DNSName("hmac-sha224.");
+ case TSIG_SHA256: return DNSName("hmac-sha256.");
+ case TSIG_SHA384: return DNSName("hmac-sha384.");
+ case TSIG_SHA512: return DNSName("hmac-sha512.");
+ case TSIG_GSS: return DNSName("gss-tsig.");
+ }
+ throw PDNSException("getTSIGAlgoName does not understand given algorithm, please fix!");
+}
+
+uint64_t getOpenFileDescriptors(const std::string&)
+{
+#ifdef __linux__
+ DIR* dirhdl=opendir(("/proc/"+std::to_string(getpid())+"/fd/").c_str());
+ if(!dirhdl)
+ return 0;
+
+ struct dirent *entry;
+ int ret=0;
+ while((entry = readdir(dirhdl))) {
+ uint32_t num;
+ try {
+ num = pdns_stou(entry->d_name);
+ } catch (...) {
+ continue; // was not a number.
+ }
+ if(std::to_string(num) == entry->d_name)
+ ret++;
+ }
+ closedir(dirhdl);
+ return ret;
+
+#elif defined(__OpenBSD__)
+ // FreeBSD also has this in libopenbsd, but I don't know if that's available always
+ return getdtablecount();
+#else
+ return 0;
+#endif
+}
+
+uint64_t getRealMemoryUsage(const std::string&)
+{
+#ifdef __linux__
+ ifstream ifs("/proc/self/statm");
+ if(!ifs)
+ return 0;
+
+ uint64_t size, resident, shared, text, lib, data;
+ ifs >> size >> resident >> shared >> text >> lib >> data;
+
+ // We used to use "data" here, but it proves unreliable and even is marked "broken"
+ // in https://www.kernel.org/doc/html/latest/filesystems/proc.html
+ return resident * getpagesize();
+#else
+ struct rusage ru;
+ if (getrusage(RUSAGE_SELF, &ru) != 0)
+ return 0;
+ return ru.ru_maxrss * 1024;
+#endif
+}
+
+
+uint64_t getSpecialMemoryUsage(const std::string&)
+{
+#ifdef __linux__
+ ifstream ifs("/proc/self/smaps");
+ if(!ifs)
+ return 0;
+ string line;
+ uint64_t bytes=0;
+ string header("Private_Dirty:");
+ while(getline(ifs, line)) {
+ if(boost::starts_with(line, header)) {
+ bytes += std::stoull(line.substr(header.length() + 1))*1024;
+ }
+ }
+ return bytes;
+#else
+ return 0;
+#endif
+}
+
+uint64_t getCPUTimeUser(const std::string&)
+{
+ struct rusage ru;
+ getrusage(RUSAGE_SELF, &ru);
+ return (ru.ru_utime.tv_sec*1000ULL + ru.ru_utime.tv_usec/1000);
+}
+
+uint64_t getCPUTimeSystem(const std::string&)
+{
+ struct rusage ru;
+ getrusage(RUSAGE_SELF, &ru);
+ return (ru.ru_stime.tv_sec*1000ULL + ru.ru_stime.tv_usec/1000);
+}
+
+double DiffTime(const struct timespec& first, const struct timespec& second)
+{
+ int seconds=second.tv_sec - first.tv_sec;
+ int nseconds=second.tv_nsec - first.tv_nsec;
+
+ if(nseconds < 0) {
+ seconds-=1;
+ nseconds+=1000000000;
+ }
+ return seconds + nseconds/1000000000.0;
+}
+
+double DiffTime(const struct timeval& first, const struct timeval& second)
+{
+ int seconds=second.tv_sec - first.tv_sec;
+ int useconds=second.tv_usec - first.tv_usec;
+
+ if(useconds < 0) {
+ seconds-=1;
+ useconds+=1000000;
+ }
+ return seconds + useconds/1000000.0;
+}
+
+uid_t strToUID(const string &str)
+{
+ uid_t result = 0;
+ const char * cstr = str.c_str();
+ struct passwd * pwd = getpwnam(cstr);
+
+ if (pwd == nullptr) {
+ long long val;
+
+ try {
+ val = stoll(str);
+ }
+ catch(std::exception& e) {
+ throw runtime_error((boost::format("Error: Unable to parse user ID %s") % cstr).str() );
+ }
+
+ if (val < std::numeric_limits<uid_t>::min() || val > std::numeric_limits<uid_t>::max()) {
+ throw runtime_error((boost::format("Error: Unable to parse user ID %s") % cstr).str() );
+ }
+
+ result = static_cast<uid_t>(val);
+ }
+ else {
+ result = pwd->pw_uid;
+ }
+
+ return result;
+}
+
+gid_t strToGID(const string &str)
+{
+ gid_t result = 0;
+ const char * cstr = str.c_str();
+ struct group * grp = getgrnam(cstr);
+
+ if (grp == nullptr) {
+ long long val;
+
+ try {
+ val = stoll(str);
+ }
+ catch(std::exception& e) {
+ throw runtime_error((boost::format("Error: Unable to parse group ID %s") % cstr).str() );
+ }
+
+ if (val < std::numeric_limits<gid_t>::min() || val > std::numeric_limits<gid_t>::max()) {
+ throw runtime_error((boost::format("Error: Unable to parse group ID %s") % cstr).str() );
+ }
+
+ result = static_cast<gid_t>(val);
+ }
+ else {
+ result = grp->gr_gid;
+ }
+
+ return result;
+}
+
+unsigned int pdns_stou(const std::string& str, size_t * idx, int base)
+{
+ if (str.empty()) return 0; // compatibility
+ unsigned long result;
+ try {
+ result = std::stoul(str, idx, base);
+ }
+ catch(std::invalid_argument& e) {
+ throw std::invalid_argument(string(e.what()) + "; (invalid argument during std::stoul); data was \""+str+"\"");
+ }
+ catch(std::out_of_range& e) {
+ throw std::out_of_range(string(e.what()) + "; (out of range during std::stoul); data was \""+str+"\"");
+ }
+ if (result > std::numeric_limits<unsigned int>::max()) {
+ throw std::out_of_range("stoul returned result out of unsigned int range; data was \""+str+"\"");
+ }
+ return static_cast<unsigned int>(result);
+}
+
+bool isSettingThreadCPUAffinitySupported()
+{
+#ifdef HAVE_PTHREAD_SETAFFINITY_NP
+ return true;
+#else
+ return false;
+#endif
+}
+
+int mapThreadToCPUList(pthread_t tid, const std::set<int>& cpus)
+{
+#ifdef HAVE_PTHREAD_SETAFFINITY_NP
+# ifdef __NetBSD__
+ cpuset_t *cpuset;
+ cpuset = cpuset_create();
+ for (const auto cpuID : cpus) {
+ cpuset_set(cpuID, cpuset);
+ }
+
+ return pthread_setaffinity_np(tid,
+ cpuset_size(cpuset),
+ cpuset);
+# else
+# ifdef __FreeBSD__
+# define cpu_set_t cpuset_t
+# endif
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ for (const auto cpuID : cpus) {
+ CPU_SET(cpuID, &cpuset);
+ }
+
+ return pthread_setaffinity_np(tid,
+ sizeof(cpuset),
+ &cpuset);
+# endif
+#else
+ return ENOSYS;
+#endif /* HAVE_PTHREAD_SETAFFINITY_NP */
+}
+
+std::vector<ComboAddress> getResolvers(const std::string& resolvConfPath)
+{
+ std::vector<ComboAddress> results;
+
+ ifstream ifs(resolvConfPath);
+ if (!ifs) {
+ return results;
+ }
+
+ string line;
+ while(std::getline(ifs, line)) {
+ boost::trim_right_if(line, boost::is_any_of(" \r\n\x1a"));
+ boost::trim_left(line); // leading spaces, let's be nice
+
+ string::size_type tpos = line.find_first_of(";#");
+ if (tpos != string::npos) {
+ line.resize(tpos);
+ }
+
+ if (boost::starts_with(line, "nameserver ") || boost::starts_with(line, "nameserver\t")) {
+ vector<string> parts;
+ stringtok(parts, line, " \t,"); // be REALLY nice
+ for(vector<string>::const_iterator iter = parts.begin() + 1; iter != parts.end(); ++iter) {
+ try {
+ results.emplace_back(*iter, 53);
+ }
+ catch(...)
+ {
+ }
+ }
+ }
+ }
+
+ return results;
+}
+
+size_t getPipeBufferSize(int fd)
+{
+#ifdef F_GETPIPE_SZ
+ int res = fcntl(fd, F_GETPIPE_SZ);
+ if (res == -1) {
+ return 0;
+ }
+ return res;
+#else
+ errno = ENOSYS;
+ return 0;
+#endif /* F_GETPIPE_SZ */
+}
+
+bool setPipeBufferSize(int fd, size_t size)
+{
+#ifdef F_SETPIPE_SZ
+ if (size > static_cast<size_t>(std::numeric_limits<int>::max())) {
+ errno = EINVAL;
+ return false;
+ }
+ int newSize = static_cast<int>(size);
+ int res = fcntl(fd, F_SETPIPE_SZ, newSize);
+ if (res == -1) {
+ return false;
+ }
+ return true;
+#else
+ errno = ENOSYS;
+ return false;
+#endif /* F_SETPIPE_SZ */
+}
+
+DNSName reverseNameFromIP(const ComboAddress& ip)
+{
+ if (ip.isIPv4()) {
+ std::string result("in-addr.arpa.");
+ auto ptr = reinterpret_cast<const uint8_t*>(&ip.sin4.sin_addr.s_addr);
+ for (size_t idx = 0; idx < sizeof(ip.sin4.sin_addr.s_addr); idx++) {
+ result = std::to_string(ptr[idx]) + "." + result;
+ }
+ return DNSName(result);
+ }
+ else if (ip.isIPv6()) {
+ std::string result("ip6.arpa.");
+ auto ptr = reinterpret_cast<const uint8_t*>(&ip.sin6.sin6_addr.s6_addr[0]);
+ for (size_t idx = 0; idx < sizeof(ip.sin6.sin6_addr.s6_addr); idx++) {
+ std::stringstream stream;
+ stream << std::hex << (ptr[idx] & 0x0F);
+ stream << '.';
+ stream << std::hex << (((ptr[idx]) >> 4) & 0x0F);
+ stream << '.';
+ result = stream.str() + result;
+ }
+ return DNSName(result);
+ }
+
+ throw std::runtime_error("Calling reverseNameFromIP() for an address which is neither an IPv4 nor an IPv6");
+}
+
+static size_t getMaxHostNameSize()
+{
+#if defined(HOST_NAME_MAX)
+ return HOST_NAME_MAX;
+#endif
+
+#if defined(_SC_HOST_NAME_MAX)
+ auto tmp = sysconf(_SC_HOST_NAME_MAX);
+ if (tmp != -1) {
+ return tmp;
+ }
+#endif
+
+ /* _POSIX_HOST_NAME_MAX */
+ return 255;
+}
+
+std::string getCarbonHostName()
+{
+ std::string hostname;
+ hostname.resize(getMaxHostNameSize() + 1, 0);
+
+ if (gethostname(const_cast<char*>(hostname.c_str()), hostname.size()) != 0) {
+ throw std::runtime_error(stringerror());
+ }
+
+ boost::replace_all(hostname, ".", "_");
+ hostname.resize(strlen(hostname.c_str()));
+
+ return hostname;
+}
+
+std::string makeLuaString(const std::string& in)
+{
+ ostringstream str;
+
+ str<<'"';
+
+ char item[5];
+ for (unsigned char n : in) {
+ if (islower(n) || isupper(n)) {
+ item[0] = n;
+ item[1] = 0;
+ }
+ else {
+ snprintf(item, sizeof(item), "\\%03d", n);
+ }
+ str << item;
+ }
+
+ str<<'"';
+
+ return str.str();
+}
+
+size_t parseSVCBValueList(const std::string &in, vector<std::string> &val) {
+ std::string parsed;
+ auto ret = parseRFC1035CharString(in, parsed);
+ parseSVCBValueListFromParsedRFC1035CharString(parsed, val);
+ return ret;
+};
+
+#ifdef HAVE_CRYPTO_MEMCMP
+#include <openssl/crypto.h>
+#else /* HAVE_CRYPTO_MEMCMP */
+#ifdef HAVE_SODIUM_MEMCMP
+#include <sodium.h>
+#endif /* HAVE_SODIUM_MEMCMP */
+#endif /* HAVE_CRYPTO_MEMCMP */
+
+bool constantTimeStringEquals(const std::string& a, const std::string& b)
+{
+ if (a.size() != b.size()) {
+ return false;
+ }
+ const size_t size = a.size();
+#ifdef HAVE_CRYPTO_MEMCMP
+ return CRYPTO_memcmp(a.c_str(), b.c_str(), size) == 0;
+#else /* HAVE_CRYPTO_MEMCMP */
+#ifdef HAVE_SODIUM_MEMCMP
+ return sodium_memcmp(a.c_str(), b.c_str(), size) == 0;
+#else /* HAVE_SODIUM_MEMCMP */
+ const volatile unsigned char *_a = (const volatile unsigned char *) a.c_str();
+ const volatile unsigned char *_b = (const volatile unsigned char *) b.c_str();
+ unsigned char res = 0;
+
+ for (size_t idx = 0; idx < size; idx++) {
+ res |= _a[idx] ^ _b[idx];
+ }
+
+ return res == 0;
+#endif /* !HAVE_SODIUM_MEMCMP */
+#endif /* !HAVE_CRYPTO_MEMCMP */
+}
diff --git a/misc.hh b/misc.hh
new file mode 100644
index 0000000..3c8c5db
--- /dev/null
+++ b/misc.hh
@@ -0,0 +1,692 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <inttypes.h>
+#include <cstring>
+#include <cstdio>
+#include <regex.h>
+#include <limits.h>
+#include <type_traits>
+#include <boost/algorithm/string.hpp>
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/tuple/tuple_comparison.hpp>
+#include <boost/multi_index/key_extractors.hpp>
+#include <boost/multi_index/sequenced_index.hpp>
+
+using namespace ::boost::multi_index;
+
+#include "dns.hh"
+#include <atomic>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <time.h>
+#include <syslog.h>
+#include <deque>
+#include <stdexcept>
+#include <string>
+#include <ctype.h>
+#include <vector>
+
+#include "namespaces.hh"
+#include "dnsname.hh"
+
+typedef enum { TSIG_MD5, TSIG_SHA1, TSIG_SHA224, TSIG_SHA256, TSIG_SHA384, TSIG_SHA512, TSIG_GSS } TSIGHashEnum;
+
+string nowTime();
+const string unquotify(const string &item);
+string humanDuration(time_t passed);
+bool stripDomainSuffix(string *qname, const string &domain);
+void stripLine(string &line);
+string getHostname();
+string urlEncode(const string &text);
+int waitForData(int fd, int seconds, int useconds=0);
+int waitFor2Data(int fd1, int fd2, int seconds, int useconds, int* fd);
+int waitForMultiData(const set<int>& fds, const int seconds, const int useconds, int* fd);
+int waitForRWData(int fd, bool waitForRead, int seconds, int useconds, bool* error=nullptr, bool* disconnected=nullptr);
+uint16_t getShort(const unsigned char *p);
+uint16_t getShort(const char *p);
+uint32_t getLong(const unsigned char *p);
+uint32_t getLong(const char *p);
+bool getTSIGHashEnum(const DNSName& algoName, TSIGHashEnum& algoEnum);
+DNSName getTSIGAlgoName(TSIGHashEnum& algoEnum);
+
+int logFacilityToLOG(unsigned int facility);
+
+struct ServiceTuple
+{
+ string host;
+ uint16_t port;
+};
+void parseService(const string &descr, ServiceTuple &st);
+
+template<typename Container>
+void
+stringtok (Container &container, string const &in,
+ const char * const delimiters = " \t\n")
+{
+ const string::size_type len = in.length();
+ string::size_type i = 0;
+
+ while (i<len) {
+ // eat leading whitespace
+ i = in.find_first_not_of (delimiters, i);
+ if (i == string::npos)
+ return; // nothing left but white space
+
+ // find the end of the token
+ string::size_type j = in.find_first_of (delimiters, i);
+
+ // push token
+ if (j == string::npos) {
+ container.push_back (in.substr(i));
+ return;
+ } else
+ container.push_back (in.substr(i, j-i));
+
+ // set up for next loop
+ i = j + 1;
+ }
+}
+
+template<typename T> bool rfc1982LessThan(T a, T b)
+{
+ static_assert(std::is_unsigned<T>::value, "rfc1982LessThan only works for unsigned types");
+ typedef typename std::make_signed<T>::type signed_t;
+ return static_cast<signed_t>(a - b) < 0;
+}
+
+// fills container with ranges, so {posbegin,posend}
+template <typename Container>
+void
+vstringtok (Container &container, string const &in,
+ const char * const delimiters = " \t\n")
+{
+ const string::size_type len = in.length();
+ string::size_type i = 0;
+
+ while (i<len) {
+ // eat leading whitespace
+ i = in.find_first_not_of (delimiters, i);
+ if (i == string::npos)
+ return; // nothing left but white space
+
+ // find the end of the token
+ string::size_type j = in.find_first_of (delimiters, i);
+
+ // push token
+ if (j == string::npos) {
+ container.emplace_back(i, len);
+ return;
+ } else
+ container.emplace_back(i, j);
+
+ // set up for next loop
+ i = j + 1;
+ }
+}
+
+size_t writen2(int fd, const void *buf, size_t count);
+inline size_t writen2(int fd, const std::string &s) { return writen2(fd, s.data(), s.size()); }
+size_t readn2(int fd, void* buffer, size_t len);
+size_t readn2WithTimeout(int fd, void* buffer, size_t len, const struct timeval& idleTimeout, const struct timeval& totalTimeout={0,0}, bool allowIncomplete=false);
+size_t writen2WithTimeout(int fd, const void * buffer, size_t len, const struct timeval& timeout);
+
+void toLowerInPlace(string& str);
+const string toLower(const string &upper);
+const string toLowerCanonic(const string &upper);
+bool IpToU32(const string &str, uint32_t *ip);
+string U32ToIP(uint32_t);
+string stringerror(int);
+string stringerror();
+string itoa(int i);
+string uitoa(unsigned int i);
+string bitFlip(const string &str);
+
+void dropPrivs(int uid, int gid);
+void cleanSlashes(string &str);
+
+#if defined(_POSIX_THREAD_CPUTIME) && defined(CLOCK_THREAD_CPUTIME_ID)
+/** CPUTime measurements */
+class CPUTime
+{
+public:
+ void start()
+ {
+ clock_gettime(CLOCK_THREAD_CPUTIME_ID, &d_start);
+ }
+ uint64_t ndiff()
+ {
+ struct timespec now;
+ clock_gettime(CLOCK_THREAD_CPUTIME_ID, &now);
+ return 1000000000ULL*(now.tv_sec - d_start.tv_sec) + (now.tv_nsec - d_start.tv_nsec);
+ }
+private:
+ struct timespec d_start;
+};
+#endif
+
+/** The DTime class can be used for timing statistics with microsecond resolution.
+On 32 bits systems this means that 2147 seconds is the longest time that can be measured. */
+class DTime
+{
+public:
+ //!< Does not set the timer for you! Saves lots of gettimeofday() calls
+ DTime() = default;
+ DTime(const DTime &dt) = default;
+ DTime & operator=(const DTime &dt) = default;
+ inline time_t time() const;
+ inline void set(); //!< Reset the timer
+ inline int udiff(bool reset = true); //!< Return the number of microseconds since the timer was last set.
+
+ int udiffNoReset() //!< Return the number of microseconds since the timer was last set.
+ {
+ return udiff(false);
+ }
+ void setTimeval(const struct timeval& tv)
+ {
+ d_set=tv;
+ }
+ struct timeval getTimeval() const
+ {
+ return d_set;
+ }
+private:
+struct timeval d_set{0, 0};
+};
+
+inline time_t DTime::time() const
+{
+ return d_set.tv_sec;
+}
+
+inline void DTime::set()
+{
+ gettimeofday(&d_set, nullptr);
+}
+
+inline int DTime::udiff(bool reset)
+{
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ int ret=1000000*(now.tv_sec-d_set.tv_sec)+(now.tv_usec-d_set.tv_usec);
+
+ if (reset) {
+ d_set = now;
+ }
+
+ return ret;
+}
+
+inline void toLowerInPlace(string& str)
+{
+ const size_t length = str.length();
+ char c;
+ for (size_t i = 0; i < length; ++i) {
+ c = dns_tolower(str[i]);
+ if (c != str[i]) {
+ str[i] = c;
+ }
+ }
+}
+
+inline const string toLower(const string &upper)
+{
+ string reply(upper);
+
+ toLowerInPlace(reply);
+
+ return reply;
+}
+
+inline const string toLowerCanonic(const string &upper)
+{
+ string reply(upper);
+ if(!upper.empty()) {
+ unsigned int i, limit= ( unsigned int ) reply.length();
+ unsigned char c;
+ for(i = 0; i < limit ; i++) {
+ c = dns_tolower(upper[i]);
+ if(c != upper[i])
+ reply[i] = c;
+ }
+ if(upper[i-1]=='.')
+ reply.resize(i-1);
+ }
+
+ return reply;
+}
+
+
+
+// Make s uppercase:
+inline string toUpper( const string& s )
+{
+ string r(s);
+ for( unsigned int i = 0; i < s.length(); i++ ) {
+ r[i] = dns_toupper(r[i]);
+ }
+ return r;
+}
+
+inline double getTime()
+{
+ struct timeval now;
+ gettimeofday(&now,0);
+
+ return now.tv_sec+now.tv_usec/1000000.0;
+}
+
+inline void unixDie(const string &why)
+{
+ throw runtime_error(why+": "+stringerror());
+}
+
+string makeHexDump(const string& str);
+//! Convert the hexstring in to a byte string
+string makeBytesFromHex(const string &in);
+
+void normalizeTV(struct timeval& tv);
+const struct timeval operator+(const struct timeval& lhs, const struct timeval& rhs);
+const struct timeval operator-(const struct timeval& lhs, const struct timeval& rhs);
+inline float makeFloat(const struct timeval& tv)
+{
+ return tv.tv_sec + tv.tv_usec/1000000.0f;
+}
+inline uint64_t uSec(const struct timeval& tv)
+{
+ return tv.tv_sec * 1000000 + tv.tv_usec;
+}
+
+inline bool operator<(const struct timeval& lhs, const struct timeval& rhs)
+{
+ return tie(lhs.tv_sec, lhs.tv_usec) < tie(rhs.tv_sec, rhs.tv_usec);
+}
+inline bool operator<=(const struct timeval& lhs, const struct timeval& rhs)
+{
+ return tie(lhs.tv_sec, lhs.tv_usec) <= tie(rhs.tv_sec, rhs.tv_usec);
+}
+
+inline bool operator<(const struct timespec& lhs, const struct timespec& rhs)
+{
+ return tie(lhs.tv_sec, lhs.tv_nsec) < tie(rhs.tv_sec, rhs.tv_nsec);
+}
+
+
+inline bool pdns_ilexicographical_compare(const std::string& a, const std::string& b) __attribute__((pure));
+inline bool pdns_ilexicographical_compare(const std::string& a, const std::string& b)
+{
+ const unsigned char *aPtr = (const unsigned char*)a.c_str(), *bPtr = (const unsigned char*)b.c_str();
+ const unsigned char *aEptr = aPtr + a.length(), *bEptr = bPtr + b.length();
+ while(aPtr != aEptr && bPtr != bEptr) {
+ if ((*aPtr != *bPtr) && (dns_tolower(*aPtr) - dns_tolower(*bPtr)))
+ return (dns_tolower(*aPtr) - dns_tolower(*bPtr)) < 0;
+ aPtr++;
+ bPtr++;
+ }
+ if(aPtr == aEptr && bPtr == bEptr) // strings are equal (in length)
+ return false;
+ return aPtr == aEptr; // true if first string was shorter
+}
+
+inline bool pdns_iequals(const std::string& a, const std::string& b) __attribute__((pure));
+inline bool pdns_iequals(const std::string& a, const std::string& b)
+{
+ if (a.length() != b.length())
+ return false;
+
+ const char *aPtr = a.c_str(), *bPtr = b.c_str();
+ const char *aEptr = aPtr + a.length();
+ while(aPtr != aEptr) {
+ if((*aPtr != *bPtr) && (dns_tolower(*aPtr) != dns_tolower(*bPtr)))
+ return false;
+ aPtr++;
+ bPtr++;
+ }
+ return true;
+}
+
+inline bool pdns_iequals_ch(const char a, const char b) __attribute__((pure));
+inline bool pdns_iequals_ch(const char a, const char b)
+{
+ if ((a != b) && (dns_tolower(a) != dns_tolower(b)))
+ return false;
+
+ return true;
+}
+
+
+typedef unsigned long AtomicCounterInner;
+typedef std::atomic<AtomicCounterInner> AtomicCounter ;
+
+// FIXME400 this should probably go?
+struct CIStringCompare
+{
+ bool operator()(const string& a, const string& b) const
+ {
+ return pdns_ilexicographical_compare(a, b);
+ }
+};
+
+struct CIStringComparePOSIX
+{
+ bool operator() (const std::string& lhs, const std::string& rhs)
+ {
+ std::string::const_iterator a,b;
+ const std::locale &loc = std::locale("POSIX");
+ a=lhs.begin();b=rhs.begin();
+ while(a!=lhs.end()) {
+ if (b==rhs.end() || std::tolower(*b,loc)<std::tolower(*a,loc)) return false;
+ else if (std::tolower(*a,loc)<std::tolower(*b,loc)) return true;
+ ++a;++b;
+ }
+ return (b!=rhs.end());
+ }
+};
+
+struct CIStringPairCompare
+{
+ bool operator()(const pair<string, uint16_t>& a, const pair<string, uint16_t>& b) const
+ {
+ if(pdns_ilexicographical_compare(a.first, b.first))
+ return true;
+ if(pdns_ilexicographical_compare(b.first, a.first))
+ return false;
+ return a.second < b.second;
+ }
+};
+
+inline size_t pdns_ci_find(const string& haystack, const string& needle)
+{
+ string::const_iterator it = std::search(haystack.begin(), haystack.end(),
+ needle.begin(), needle.end(), pdns_iequals_ch);
+ if (it == haystack.end()) {
+ // not found
+ return string::npos;
+ } else {
+ return it - haystack.begin();
+ }
+}
+
+pair<string, string> splitField(const string& inp, char sepa);
+
+inline bool isCanonical(const string& qname)
+{
+ if(qname.empty())
+ return false;
+ return qname[qname.size()-1]=='.';
+}
+
+inline DNSName toCanonic(const DNSName& zone, const string& qname)
+{
+ if(qname.size()==1 && qname[0]=='@')
+ return zone;
+ if(isCanonical(qname))
+ return DNSName(qname);
+ return DNSName(qname) += zone;
+}
+
+string stripDot(const string& dom);
+
+int makeIPv6sockaddr(const std::string& addr, struct sockaddr_in6* ret);
+int makeIPv4sockaddr(const std::string& str, struct sockaddr_in* ret);
+int makeUNsockaddr(const std::string& path, struct sockaddr_un* ret);
+bool stringfgets(FILE* fp, std::string& line);
+
+template<typename Index>
+std::pair<typename Index::iterator,bool>
+replacing_insert(Index& i,const typename Index::value_type& x)
+{
+ std::pair<typename Index::iterator,bool> res=i.insert(x);
+ if(!res.second)res.second=i.replace(res.first,x);
+ return res;
+}
+
+/** very small regex wrapper */
+class Regex
+{
+public:
+ /** constructor that accepts the expression to regex */
+ Regex(const string &expr);
+
+ ~Regex()
+ {
+ regfree(&d_preg);
+ }
+ /** call this to find out if 'line' matches your expression */
+ bool match(const string &line) const
+ {
+ return regexec(&d_preg,line.c_str(),0,0,0)==0;
+ }
+ bool match(const DNSName& name) const
+ {
+ return match(name.toStringNoDot());
+ }
+
+private:
+ regex_t d_preg;
+};
+
+class SimpleMatch
+{
+public:
+ SimpleMatch(const string &mask, bool caseFold = false): d_mask(mask), d_fold(caseFold)
+ {
+ }
+
+ bool match(string::const_iterator mi, string::const_iterator mend, string::const_iterator vi, string::const_iterator vend) const
+ {
+ for(;;++mi) {
+ if (mi == mend) {
+ return vi == vend;
+ } else if (*mi == '?') {
+ if (vi == vend) return false;
+ ++vi;
+ } else if (*mi == '*') {
+ while(mi != mend && *mi == '*') ++mi;
+ if (mi == mend) return true;
+ while(vi != vend) {
+ if (match(mi,mend,vi,vend)) return true;
+ ++vi;
+ }
+ return false;
+ } else {
+ if ((mi == mend && vi != vend)||
+ (mi != mend && vi == vend)) return false;
+ if (d_fold) {
+ if (dns_tolower(*mi) != dns_tolower(*vi)) return false;
+ } else {
+ if (*mi != *vi) return false;
+ }
+ ++vi;
+ }
+ }
+ }
+
+ bool match(const string& value) const {
+ return match(d_mask.begin(), d_mask.end(), value.begin(), value.end());
+ }
+
+ bool match(const DNSName& name) const {
+ return match(name.toStringNoDot());
+ }
+
+private:
+ const string d_mask;
+ const bool d_fold;
+};
+
+union ComboAddress;
+
+// An aligned type to hold cmsgbufs. See https://man.openbsd.org/CMSG_DATA
+typedef union { struct cmsghdr hdr; char buf[256]; } cmsgbuf_aligned;
+
+/* itfIndex is an interface index, as returned by if_nametoindex(). 0 means default. */
+void addCMsgSrcAddr(struct msghdr* msgh, cmsgbuf_aligned* cbuf, const ComboAddress* source, int itfIndex);
+
+unsigned int getFilenumLimit(bool hardOrSoft=0);
+void setFilenumLimit(unsigned int lim);
+bool readFileIfThere(const char* fname, std::string* line);
+uint32_t burtle(const unsigned char* k, uint32_t length, uint32_t init);
+bool setSocketTimestamps(int fd);
+
+//! Sets the socket into blocking mode.
+bool setBlocking( int sock );
+
+//! Sets the socket into non-blocking mode.
+bool setNonBlocking( int sock );
+bool setTCPNoDelay(int sock);
+bool setReuseAddr(int sock);
+bool isNonBlocking(int sock);
+bool setReceiveSocketErrors(int sock, int af);
+int closesocket(int fd);
+bool setCloseOnExec(int sock);
+
+size_t getPipeBufferSize(int fd);
+bool setPipeBufferSize(int fd, size_t size);
+
+uint64_t udpErrorStats(const std::string& str);
+uint64_t udp6ErrorStats(const std::string& str);
+uint64_t tcpErrorStats(const std::string& str);
+uint64_t getRealMemoryUsage(const std::string&);
+uint64_t getSpecialMemoryUsage(const std::string&);
+uint64_t getOpenFileDescriptors(const std::string&);
+uint64_t getCPUTimeUser(const std::string&);
+uint64_t getCPUTimeSystem(const std::string&);
+uint64_t getCPUIOWait(const std::string&);
+uint64_t getCPUSteal(const std::string&);
+std::string getMACAddress(const ComboAddress& ca);
+
+template<typename T>
+const T& defTer(const T& a, const T& b)
+{
+ return a ? a : b;
+}
+
+template<typename P, typename T>
+T valueOrEmpty(const P val) {
+ if (!val) return T{};
+ return T(val);
+}
+
+
+// I'm not very OCD, but I appreciate loglines like "processing 1 delta", "processing 2 deltas" :-)
+template <typename Integer,
+typename std::enable_if_t<std::is_integral<Integer>::value, bool> = true>
+const char* addS(Integer siz, const char* singular = "", const char *plural = "s")
+{
+ if (siz == 1) {
+ return singular;
+ }
+ return plural;
+}
+
+template <typename C,
+typename std::enable_if_t<std::is_class<C>::value, bool> = true>
+const char* addS(const C& c, const char* singular = "", const char *plural = "s")
+{
+ return addS(c.size(), singular, plural);
+}
+
+template<typename C>
+const typename C::value_type::second_type* rplookup(const C& c, const typename C::value_type::first_type& key)
+{
+ auto fnd = c.find(key);
+ if(fnd == c.end())
+ return 0;
+ return &fnd->second;
+}
+
+double DiffTime(const struct timespec& first, const struct timespec& second);
+double DiffTime(const struct timeval& first, const struct timeval& second);
+uid_t strToUID(const string &str);
+gid_t strToGID(const string &str);
+
+unsigned int pdns_stou(const std::string& str, size_t * idx = 0, int base = 10);
+
+bool isSettingThreadCPUAffinitySupported();
+int mapThreadToCPUList(pthread_t tid, const std::set<int>& cpus);
+
+std::vector<ComboAddress> getResolvers(const std::string& resolvConfPath);
+
+DNSName reverseNameFromIP(const ComboAddress& ip);
+
+std::string getCarbonHostName();
+size_t parseRFC1035CharString(const std::string &in, std::string &val); // from ragel
+size_t parseSVCBValueListFromParsedRFC1035CharString(const std::string &in, vector<std::string> &val); // from ragel
+size_t parseSVCBValueList(const std::string &in, vector<std::string> &val);
+
+std::string makeLuaString(const std::string& in);
+
+bool constantTimeStringEquals(const std::string& a, const std::string& b);
+
+// Used in NID and L64 records
+struct NodeOrLocatorID { uint8_t content[8]; };
+
+struct FDWrapper
+{
+ FDWrapper()
+ {
+ }
+
+ FDWrapper(int desc): d_fd(desc)
+ {
+ }
+
+ ~FDWrapper()
+ {
+ if (d_fd != -1) {
+ close(d_fd);
+ d_fd = -1;
+ }
+ }
+
+ FDWrapper(FDWrapper&& rhs): d_fd(rhs.d_fd)
+ {
+ rhs.d_fd = -1;
+ }
+
+ FDWrapper& operator=(FDWrapper&& rhs)
+ {
+ if (d_fd != -1) {
+ close(d_fd);
+ }
+ d_fd = rhs.d_fd;
+ rhs.d_fd = -1;
+ return *this;
+ }
+
+ int getHandle() const
+ {
+ return d_fd;
+ }
+
+ operator int() const
+ {
+ return d_fd;
+ }
+
+private:
+ int d_fd{-1};
+};
diff --git a/missing b/missing
new file mode 100755
index 0000000..625aeb1
--- /dev/null
+++ b/missing
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, 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 <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+fi
+
+case $1 in
+
+ --is-lightweight)
+ # Used by our autoconf macros to check whether the available missing
+ # script is modern enough.
+ exit 0
+ ;;
+
+ --run)
+ # Back-compat with the calling convention used by older automake.
+ shift
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
+to PROGRAM being missing or too old.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+
+Supported PROGRAM values:
+ aclocal autoconf autoheader autom4te automake makeinfo
+ bison yacc flex lex help2man
+
+Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
+'g' are ignored when checking the name.
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: unknown '$1' option"
+ echo 1>&2 "Try '$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Run the given program, remember its exit status.
+"$@"; st=$?
+
+# If it succeeded, we are done.
+test $st -eq 0 && exit 0
+
+# Also exit now if we it failed (or wasn't found), and '--version' was
+# passed; such an option is passed most likely to detect whether the
+# program is present and works.
+case $2 in --version|--help) exit $st;; esac
+
+# Exit code 63 means version mismatch. This often happens when the user
+# tries to use an ancient version of a tool on a file that requires a
+# minimum version.
+if test $st -eq 63; then
+ msg="probably too old"
+elif test $st -eq 127; then
+ # Program was missing.
+ msg="missing on your system"
+else
+ # Program was found and executed, but failed. Give up.
+ exit $st
+fi
+
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
+
+program_details ()
+{
+ case $1 in
+ aclocal|automake)
+ echo "The '$1' program is part of the GNU Automake package:"
+ echo "<$gnu_software_URL/automake>"
+ echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/autoconf>"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ autoconf|autom4te|autoheader)
+ echo "The '$1' program is part of the GNU Autoconf package:"
+ echo "<$gnu_software_URL/autoconf/>"
+ echo "It also requires GNU m4 and Perl in order to run:"
+ echo "<$gnu_software_URL/m4/>"
+ echo "<$perl_URL>"
+ ;;
+ esac
+}
+
+give_advice ()
+{
+ # Normalize program name to check for.
+ normalized_program=`echo "$1" | sed '
+ s/^gnu-//; t
+ s/^gnu//; t
+ s/^g//; t'`
+
+ printf '%s\n' "'$1' is $msg."
+
+ configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
+ case $normalized_program in
+ autoconf*)
+ echo "You should only need it if you modified 'configure.ac',"
+ echo "or m4 files included by it."
+ program_details 'autoconf'
+ ;;
+ autoheader*)
+ echo "You should only need it if you modified 'acconfig.h' or"
+ echo "$configure_deps."
+ program_details 'autoheader'
+ ;;
+ automake*)
+ echo "You should only need it if you modified 'Makefile.am' or"
+ echo "$configure_deps."
+ program_details 'automake'
+ ;;
+ aclocal*)
+ echo "You should only need it if you modified 'acinclude.m4' or"
+ echo "$configure_deps."
+ program_details 'aclocal'
+ ;;
+ autom4te*)
+ echo "You might have modified some maintainer files that require"
+ echo "the 'autom4te' program to be rebuilt."
+ program_details 'autom4te'
+ ;;
+ bison*|yacc*)
+ echo "You should only need it if you modified a '.y' file."
+ echo "You may want to install the GNU Bison package:"
+ echo "<$gnu_software_URL/bison/>"
+ ;;
+ lex*|flex*)
+ echo "You should only need it if you modified a '.l' file."
+ echo "You may want to install the Fast Lexical Analyzer package:"
+ echo "<$flex_URL>"
+ ;;
+ help2man*)
+ echo "You should only need it if you modified a dependency" \
+ "of a man page."
+ echo "You may want to install the GNU Help2man package:"
+ echo "<$gnu_software_URL/help2man/>"
+ ;;
+ makeinfo*)
+ echo "You should only need it if you modified a '.texi' file, or"
+ echo "any other file indirectly affecting the aspect of the manual."
+ echo "You might want to install the Texinfo package:"
+ echo "<$gnu_software_URL/texinfo/>"
+ echo "The spurious makeinfo call might also be the consequence of"
+ echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
+ echo "want to install GNU make:"
+ echo "<$gnu_software_URL/make/>"
+ ;;
+ *)
+ echo "You might have modified some files without having the proper"
+ echo "tools for further handling them. Check the 'README' file, it"
+ echo "often tells you about the needed prerequisites for installing"
+ echo "this package. You may also peek at any GNU archive site, in"
+ echo "case some other package contains this missing '$1' program."
+ ;;
+ esac
+}
+
+give_advice "$1" | sed -e '1s/^/WARNING: /' \
+ -e '2,$s/^/ /' >&2
+
+# Propagate the correct exit status (expected to be 127 for a program
+# not found, 63 for a program that failed due to version mismatch).
+exit $st
+
+# Local variables:
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/mplexer.hh b/mplexer.hh
new file mode 100644
index 0000000..d85efe9
--- /dev/null
+++ b/mplexer.hh
@@ -0,0 +1,314 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <boost/function.hpp>
+#include <boost/any.hpp>
+#include <boost/shared_array.hpp>
+#include <boost/tuple/tuple.hpp>
+#include <boost/tuple/tuple_comparison.hpp>
+#include <boost/multi_index_container.hpp>
+#include <boost/multi_index/ordered_index.hpp>
+#include <boost/multi_index/hashed_index.hpp>
+#include <boost/multi_index/key_extractors.hpp>
+#include <vector>
+#include <map>
+#include <stdexcept>
+#include <string>
+#include <sys/time.h>
+
+using namespace ::boost::multi_index;
+
+class FDMultiplexerException : public std::runtime_error
+{
+public:
+ FDMultiplexerException(const std::string& str) :
+ std::runtime_error(str)
+ {}
+};
+
+/** Very simple FD multiplexer, based on callbacks and boost::any parameters
+ As a special service, this parameter is kept around and can be modified,
+ allowing for state to be stored inside the multiplexer.
+
+ It has some "interesting" semantics
+*/
+
+class FDMultiplexer
+{
+public:
+ typedef boost::any funcparam_t;
+ typedef boost::function<void(int, funcparam_t&)> callbackfunc_t;
+ enum class EventKind : uint8_t
+ {
+ Read,
+ Write,
+ Both
+ };
+
+protected:
+ struct Callback
+ {
+ callbackfunc_t d_callback;
+ mutable funcparam_t d_parameter;
+ struct timeval d_ttd;
+ int d_fd;
+ };
+
+public:
+ FDMultiplexer() :
+ d_inrun(false)
+ {}
+ virtual ~FDMultiplexer()
+ {}
+
+ static FDMultiplexer* getMultiplexerSilent();
+
+ /* tv will be updated to 'now' before run returns */
+ /* timeout is in ms */
+ /* returns 0 on timeout, -1 in case of error (but all implementations
+ actually throw in that case) and the number of ready events otherwise.
+ Note that We might have two events (read AND write) for the same descriptor */
+ virtual int run(struct timeval* tv, int timeout = 500) = 0;
+
+ /* timeout is in ms, 0 will return immediately, -1 will block until at least one FD is ready */
+ virtual void getAvailableFDs(std::vector<int>& fds, int timeout) = 0;
+
+ //! Add an fd to the read watch list - currently an fd can only be on one list at a time!
+ void addReadFD(int fd, callbackfunc_t toDo, const funcparam_t& parameter = funcparam_t(), const struct timeval* ttd = nullptr)
+ {
+ bool alreadyWatched = d_writeCallbacks.count(fd) > 0;
+
+ if (alreadyWatched) {
+ this->alterFD(fd, EventKind::Write, EventKind::Both);
+ }
+ else {
+ this->addFD(fd, EventKind::Read);
+ }
+
+ /* do the addition _after_ so the entry is not added if there is an error */
+ accountingAddFD(d_readCallbacks, fd, toDo, parameter, ttd);
+ }
+
+ //! Add an fd to the write watch list - currently an fd can only be on one list at a time!
+ void addWriteFD(int fd, callbackfunc_t toDo, const funcparam_t& parameter = funcparam_t(), const struct timeval* ttd = nullptr)
+ {
+ bool alreadyWatched = d_readCallbacks.count(fd) > 0;
+
+ if (alreadyWatched) {
+ this->alterFD(fd, EventKind::Read, EventKind::Both);
+ }
+ else {
+ this->addFD(fd, EventKind::Write);
+ }
+
+ /* do the addition _after_ so the entry is not added if there is an error */
+ accountingAddFD(d_writeCallbacks, fd, toDo, parameter, ttd);
+ }
+
+ //! Remove an fd from the read watch list. You can't call this function on an fd that is closed already!
+ /** WARNING: references to 'parameter' become invalid after this function! */
+ void removeReadFD(int fd)
+ {
+ const auto& iter = d_writeCallbacks.find(fd);
+ accountingRemoveFD(d_readCallbacks, fd);
+
+ if (iter != d_writeCallbacks.end()) {
+ this->alterFD(fd, EventKind::Both, EventKind::Write);
+ }
+ else {
+ this->removeFD(fd, EventKind::Read);
+ }
+ }
+
+ //! Remove an fd from the write watch list. You can't call this function on an fd that is closed already!
+ /** WARNING: references to 'parameter' become invalid after this function! */
+ void removeWriteFD(int fd)
+ {
+ const auto& iter = d_readCallbacks.find(fd);
+ accountingRemoveFD(d_writeCallbacks, fd);
+
+ if (iter != d_readCallbacks.end()) {
+ this->alterFD(fd, EventKind::Both, EventKind::Read);
+ }
+ else {
+ this->removeFD(fd, EventKind::Write);
+ }
+ }
+
+ void setReadTTD(int fd, struct timeval tv, int timeout)
+ {
+ const auto& it = d_readCallbacks.find(fd);
+ if (it == d_readCallbacks.end()) {
+ throw FDMultiplexerException("attempt to timestamp fd not in the multiplexer");
+ }
+
+ auto newEntry = *it;
+ tv.tv_sec += timeout;
+ newEntry.d_ttd = tv;
+ d_readCallbacks.replace(it, newEntry);
+ }
+
+ void setWriteTTD(int fd, struct timeval tv, int timeout)
+ {
+ const auto& it = d_writeCallbacks.find(fd);
+ if (it == d_writeCallbacks.end()) {
+ throw FDMultiplexerException("attempt to timestamp fd not in the multiplexer");
+ }
+
+ auto newEntry = *it;
+ tv.tv_sec += timeout;
+ newEntry.d_ttd = tv;
+ d_writeCallbacks.replace(it, newEntry);
+ }
+
+ void alterFDToRead(int fd, callbackfunc_t toDo, const funcparam_t& parameter = funcparam_t(), const struct timeval* ttd = nullptr)
+ {
+ accountingRemoveFD(d_writeCallbacks, fd);
+ this->alterFD(fd, EventKind::Write, EventKind::Read);
+ accountingAddFD(d_readCallbacks, fd, toDo, parameter, ttd);
+ }
+
+ void alterFDToWrite(int fd, callbackfunc_t toDo, const funcparam_t& parameter = funcparam_t(), const struct timeval* ttd = nullptr)
+ {
+ accountingRemoveFD(d_readCallbacks, fd);
+ this->alterFD(fd, EventKind::Read, EventKind::Write);
+ accountingAddFD(d_writeCallbacks, fd, toDo, parameter, ttd);
+ }
+
+ std::vector<std::pair<int, funcparam_t>> getTimeouts(const struct timeval& tv, bool writes = false)
+ {
+ std::vector<std::pair<int, funcparam_t>> ret;
+ const auto tied = boost::tie(tv.tv_sec, tv.tv_usec);
+ auto& idx = writes ? d_writeCallbacks.get<TTDOrderedTag>() : d_readCallbacks.get<TTDOrderedTag>();
+
+ for (auto it = idx.begin(); it != idx.end(); ++it) {
+ if (it->d_ttd.tv_sec == 0 || tied <= boost::tie(it->d_ttd.tv_sec, it->d_ttd.tv_usec)) {
+ break;
+ }
+ ret.emplace_back(it->d_fd, it->d_parameter);
+ }
+
+ return ret;
+ }
+
+ typedef FDMultiplexer* getMultiplexer_t();
+ typedef std::multimap<int, getMultiplexer_t*> FDMultiplexermap_t;
+
+ static FDMultiplexermap_t& getMultiplexerMap()
+ {
+ static FDMultiplexermap_t theMap;
+ return theMap;
+ }
+
+ virtual std::string getName() const = 0;
+
+ size_t getWatchedFDCount(bool writeFDs) const
+ {
+ return writeFDs ? d_writeCallbacks.size() : d_readCallbacks.size();
+ }
+
+ void runForAllWatchedFDs(void (*watcher)(bool isRead, int fd, const funcparam_t&, struct timeval))
+ {
+ for (const auto& entry : d_readCallbacks) {
+ watcher(true, entry.d_fd, entry.d_parameter, entry.d_ttd);
+ }
+ for (const auto& entry : d_writeCallbacks) {
+ watcher(false, entry.d_fd, entry.d_parameter, entry.d_ttd);
+ }
+ }
+
+protected:
+ struct FDBasedTag
+ {
+ };
+ struct TTDOrderedTag
+ {
+ };
+ struct ttd_compare
+ {
+ /* we want a 0 TTD (no timeout) to come _after_ everything else */
+ bool operator()(const struct timeval& lhs, const struct timeval& rhs) const
+ {
+ /* special treatment if at least one of the TTD is 0,
+ normal comparison otherwise */
+ if (lhs.tv_sec == 0 && rhs.tv_sec == 0) {
+ return false;
+ }
+ if (lhs.tv_sec == 0 && rhs.tv_sec != 0) {
+ return false;
+ }
+ if (lhs.tv_sec != 0 && rhs.tv_sec == 0) {
+ return true;
+ }
+
+ return std::tie(lhs.tv_sec, lhs.tv_usec) < std::tie(rhs.tv_sec, rhs.tv_usec);
+ }
+ };
+
+ typedef multi_index_container<
+ Callback,
+ indexed_by<
+ hashed_unique<tag<FDBasedTag>,
+ member<Callback, int, &Callback::d_fd>>,
+ ordered_non_unique<tag<TTDOrderedTag>,
+ member<Callback, struct timeval, &Callback::d_ttd>,
+ ttd_compare>>>
+ callbackmap_t;
+
+ callbackmap_t d_readCallbacks, d_writeCallbacks;
+ bool d_inrun;
+
+ void accountingAddFD(callbackmap_t& cbmap, int fd, callbackfunc_t toDo, const funcparam_t& parameter, const struct timeval* ttd)
+ {
+ Callback cb;
+ cb.d_fd = fd;
+ cb.d_callback = toDo;
+ cb.d_parameter = parameter;
+ memset(&cb.d_ttd, 0, sizeof(cb.d_ttd));
+ if (ttd) {
+ cb.d_ttd = *ttd;
+ }
+
+ auto pair = cbmap.insert(std::move(cb));
+ if (!pair.second) {
+ throw FDMultiplexerException("Tried to add fd " + std::to_string(fd) + " to multiplexer twice");
+ }
+ }
+
+ void accountingRemoveFD(callbackmap_t& cbmap, int fd)
+ {
+ if (!cbmap.erase(fd)) {
+ throw FDMultiplexerException("Tried to remove unlisted fd " + std::to_string(fd) + " from multiplexer");
+ }
+ }
+
+ virtual void addFD(int fd, EventKind kind) = 0;
+ /* most implementations do not care about which event has to be removed, except for kqueue */
+ virtual void removeFD(int fd, EventKind kind) = 0;
+ /* most implementations do not care about which event has to be removed, except for kqueue */
+ virtual void alterFD(int fd, EventKind from, EventKind to)
+ {
+ /* naive implementation */
+ removeFD(fd, from);
+ addFD(fd, to);
+ }
+};
diff --git a/namespaces.hh b/namespaces.hh
new file mode 100644
index 0000000..9e1f3ad
--- /dev/null
+++ b/namespaces.hh
@@ -0,0 +1,60 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <boost/tuple/tuple.hpp>
+#include <boost/format.hpp>
+#include <boost/optional.hpp>
+#include <iostream>
+#include <map>
+#include <memory>
+#include <set>
+#include <string>
+#include <vector>
+
+// We have a few paces where boost::tuple is used, and other places where an unscoped tuple is used
+// prefer the boost one for now. We might want to switch to std::tuple one day. Same for tie.
+using boost::make_tuple;
+using boost::tuple;
+using boost::tie;
+
+using std::cerr;
+using std::clog;
+using std::cout;
+using std::endl;
+using std::ifstream;
+using std::make_unique;
+using std::map;
+using std::max;
+using std::min;
+using std::ofstream;
+using std::ostream;
+using std::ostringstream;
+using std::pair;
+using std::runtime_error;
+using std::set;
+using std::shared_ptr;
+using std::string;
+using std::unique_ptr;
+using std::vector;
+
+using pdns_string_view = std::string_view;
diff --git a/noinitvector.hh b/noinitvector.hh
new file mode 100644
index 0000000..cc7efc3
--- /dev/null
+++ b/noinitvector.hh
@@ -0,0 +1,67 @@
+#pragma once
+
+#include <memory>
+#include <new>
+#include <utility>
+#include <vector>
+
+// based on boost::core::noinit_adaptor
+// The goal is to avoid initialization of the content of a container,
+// because setting several kB of uint8_t to 0 has a real cost if you
+// do 100k times per second.
+template<class Allocator>
+struct noinit_adaptor: Allocator
+{
+ template<class U>
+ struct rebind {
+ typedef noinit_adaptor<typename std::allocator_traits<Allocator>::template
+ rebind_alloc<U> > other;
+ };
+
+ noinit_adaptor(): Allocator() { }
+
+ template<class U>
+ noinit_adaptor(U&& u) noexcept : Allocator(std::forward<U>(u)) { }
+
+ template<class U>
+ noinit_adaptor(const noinit_adaptor<U>& u) noexcept : Allocator(static_cast<const U&>(u)) { }
+
+ template<class U>
+ void construct(U* p) {
+ ::new((void*)p) U;
+ }
+
+ template<class U, class V, class... Args>
+ void construct(U* p, V&& v, Args&&... args) {
+ ::new((void*)p) U(std::forward<V>(v), std::forward<Args>(args)...);
+ }
+
+ template<class U>
+ void destroy(U* p) {
+ p->~U();
+ }
+};
+
+template<class T, class U>
+inline bool operator==(const noinit_adaptor<T>& lhs,
+ const noinit_adaptor<U>& rhs) noexcept
+{
+ return static_cast<const T&>(lhs) == static_cast<const U&>(rhs);
+}
+
+template<class T, class U>
+inline bool operator!=(const noinit_adaptor<T>& lhs,
+ const noinit_adaptor<U>& rhs) noexcept
+{
+ return !(lhs == rhs);
+}
+
+template<class Allocator>
+inline noinit_adaptor<Allocator> noinit_adapt(const Allocator& a) noexcept
+{
+ return noinit_adaptor<Allocator>(a);
+}
+
+template<class T> using NoInitVector = std::vector<T, noinit_adaptor<std::allocator<T>>>;
+
+using PacketBuffer = NoInitVector<uint8_t>;
diff --git a/packetcache.hh b/packetcache.hh
new file mode 100644
index 0000000..15f9d2d
--- /dev/null
+++ b/packetcache.hh
@@ -0,0 +1,233 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "ednsoptions.hh"
+#include "misc.hh"
+#include "iputils.hh"
+
+class PacketCache : public boost::noncopyable
+{
+public:
+
+ /* hash the packet from the provided position, which should point right after tje qname. This skips:
+ - the query ID ;
+ - EDNS Cookie options, if any ;
+ - Any given option code present in optionsToSkip
+ */
+ static uint32_t hashAfterQname(const pdns_string_view& packet, uint32_t currentHash, size_t pos, const std::unordered_set<uint16_t>& optionsToSkip = {EDNSOptionCode::COOKIE})
+ {
+ const size_t packetSize = packet.size();
+ assert(packetSize >= sizeof(dnsheader));
+
+ /* we need at least 2 (QTYPE) + 2 (QCLASS)
+
+ + OPT root label (1), type (2), class (2) and ttl (4)
+ + the OPT RR rdlen (2)
+ = 15
+ */
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(packet.data());
+ if (ntohs(dh->qdcount) != 1 || ntohs(dh->ancount) != 0 || ntohs(dh->nscount) != 0 || ntohs(dh->arcount) != 1 || (pos + 15) >= packetSize) {
+ if (packetSize > pos) {
+ currentHash = burtle(reinterpret_cast<const unsigned char*>(&packet.at(pos)), packetSize - pos, currentHash);
+ }
+ return currentHash;
+ }
+
+ currentHash = burtle(reinterpret_cast<const unsigned char*>(&packet.at(pos)), 15, currentHash);
+ /* skip the qtype (2), qclass (2) */
+ /* root label (1), type (2), class (2) and ttl (4) */
+ /* already hashed above */
+ pos += 13;
+
+ const uint16_t rdLen = ((static_cast<uint16_t>(packet.at(pos)) * 256) + static_cast<uint16_t>(packet.at(pos + 1)));
+ /* skip the rd length */
+ /* already hashed above */
+ pos += 2;
+
+ if (rdLen > (packetSize - pos)) {
+ if (pos < packetSize) {
+ currentHash = burtle(reinterpret_cast<const unsigned char*>(&packet.at(pos)), packetSize - pos, currentHash);
+ }
+ return currentHash;
+ }
+
+ uint16_t rdataRead = 0;
+ uint16_t optionCode;
+ uint16_t optionLen;
+
+ while (pos < packetSize && rdataRead < rdLen && getNextEDNSOption(&packet.at(pos), rdLen - rdataRead, optionCode, optionLen)) {
+ if (optionLen > (rdLen - rdataRead - 4)) {
+ if (packetSize > pos) {
+ currentHash = burtle(reinterpret_cast<const unsigned char*>(&packet.at(pos)), packetSize - pos, currentHash);
+ }
+ return currentHash;
+ }
+
+ if (optionsToSkip.count(optionCode) == 0) {
+ /* hash the option code, length and content */
+ currentHash = burtle(reinterpret_cast<const unsigned char*>(&packet.at(pos)), 4 + optionLen, currentHash);
+ }
+ else {
+ /* skip option: hash only its code and length */
+ currentHash = burtle(reinterpret_cast<const unsigned char*>(&packet.at(pos)), 4, currentHash);
+ }
+
+ pos += 4 + optionLen;
+ rdataRead += 4 + optionLen;
+ }
+
+ if (pos < packetSize) {
+ currentHash = burtle(reinterpret_cast<const unsigned char*>(&packet.at(pos)), packetSize - pos, currentHash);
+ }
+
+ return currentHash;
+ }
+
+ static uint32_t hashHeaderAndQName(const std::string& packet, size_t& pos)
+ {
+ uint32_t currentHash = 0;
+ const size_t packetSize = packet.size();
+ assert(packetSize >= sizeof(dnsheader));
+ currentHash = burtle(reinterpret_cast<const unsigned char*>(&packet.at(2)), sizeof(dnsheader) - 2, currentHash); // rest of dnsheader, skip id
+ pos = sizeof(dnsheader);
+
+ for (; pos < packetSize; ) {
+ const unsigned char labelLen = static_cast<unsigned char>(packet.at(pos));
+ currentHash = burtle(&labelLen, 1, currentHash);
+ ++pos;
+ if (labelLen == 0) {
+ break;
+ }
+
+ for (size_t idx = 0; idx < labelLen && pos < packetSize; ++idx, ++pos) {
+ const unsigned char l = dns_tolower(packet.at(pos));
+ currentHash = burtle(&l, 1, currentHash);
+ }
+ }
+
+ return currentHash;
+ }
+
+ /* hash the packet from the beginning, including the qname. This skips:
+ - the query ID ;
+ - EDNS Cookie options, if any ;
+ - Any given option code present in optionsToSkip
+ */
+ static uint32_t canHashPacket(const std::string& packet, const std::unordered_set<uint16_t>& optionsToSkip = {EDNSOptionCode::COOKIE})
+ {
+ size_t pos = 0;
+ uint32_t currentHash = hashHeaderAndQName(packet, pos);
+ size_t packetSize = packet.size();
+
+ if (pos >= packetSize) {
+ return currentHash;
+ }
+
+ return hashAfterQname(packet, currentHash, pos, optionsToSkip);
+ }
+
+ static bool queryHeaderMatches(const std::string& cachedQuery, const std::string& query)
+ {
+ if (cachedQuery.size() != query.size()) {
+ return false;
+ }
+
+ return (cachedQuery.compare(/* skip the ID */ 2, sizeof(dnsheader) - 2, query, 2, sizeof(dnsheader) - 2) == 0);
+ }
+
+ static bool queryMatches(const std::string& cachedQuery, const std::string& query, const DNSName& qname, const std::unordered_set<uint16_t>& optionsToIgnore)
+ {
+ const size_t querySize = query.size();
+ const size_t cachedQuerySize = cachedQuery.size();
+ if (querySize != cachedQuerySize) {
+ return false;
+ }
+
+ if (!queryHeaderMatches(cachedQuery, query)) {
+ return false;
+ }
+
+ size_t pos = sizeof(dnsheader) + qname.wirelength();
+
+ /* we need at least 2 (QTYPE) + 2 (QCLASS)
+ + OPT root label (1), type (2), class (2) and ttl (4)
+ + the OPT RR rdlen (2)
+ = 15
+ */
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(query.data());
+ if (ntohs(dh->qdcount) != 1 || ntohs(dh->ancount) != 0 || ntohs(dh->nscount) != 0 || ntohs(dh->arcount) != 1 || (pos + 15) >= querySize || optionsToIgnore.empty()) {
+ return cachedQuery.compare(pos, cachedQuerySize - pos, query, pos, querySize - pos) == 0;
+ }
+
+ /* compare up to the first option, if any */
+ if (cachedQuery.compare(pos, 15, query, pos, 15) != 0) {
+ return false;
+ }
+
+ /* skip the qtype (2), qclass (2) */
+ /* root label (1), type (2), class (2) and ttl (4) */
+ /* already compared above */
+ pos += 13;
+
+ const uint16_t rdLen = ((static_cast<unsigned char>(query.at(pos)) * 256) + static_cast<unsigned char>(query.at(pos + 1)));
+ /* skip the rd length */
+ /* already compared above */
+ pos += sizeof(uint16_t);
+
+ if (rdLen > (querySize - pos)) {
+ /* something is wrong, let's just compare everything */
+ return cachedQuery.compare(pos, cachedQuerySize - pos, query, pos, querySize - pos) == 0;
+ }
+
+ uint16_t rdataRead = 0;
+ uint16_t optionCode;
+ uint16_t optionLen;
+
+ while (pos < querySize && rdataRead < rdLen && getNextEDNSOption(&query.at(pos), rdLen - rdataRead, optionCode, optionLen)) {
+ if (optionLen > (rdLen - rdataRead)) {
+ return cachedQuery.compare(pos, cachedQuerySize - pos, query, pos, querySize - pos) == 0;
+ }
+
+ /* compare the option code and length */
+ if (cachedQuery.compare(pos, 4, query, pos, 4) != 0) {
+ return false;
+ }
+ pos += 4;
+ rdataRead += 4;
+
+ if (optionLen > 0 && optionsToIgnore.count(optionCode) == 0) {
+ if (cachedQuery.compare(pos, optionLen, query, pos, optionLen) != 0) {
+ return false;
+ }
+ }
+ pos += optionLen;
+ rdataRead += optionLen;
+ }
+
+ if (pos >= querySize) {
+ return true;
+ }
+
+ return cachedQuery.compare(pos, cachedQuerySize - pos, query, pos, querySize - pos) == 0;
+ }
+
+};
diff --git a/pdnsexception.hh b/pdnsexception.hh
new file mode 100644
index 0000000..8960816
--- /dev/null
+++ b/pdnsexception.hh
@@ -0,0 +1,42 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include<string>
+
+#include "namespaces.hh"
+
+//! Generic Exception thrown
+class PDNSException
+{
+public:
+ PDNSException() : reason("Unspecified") {};
+ PDNSException(const string& r) : reason(r) {};
+
+ string reason; //! Print this to tell the user what went wrong
+};
+
+class TimeoutException : public PDNSException
+{
+public:
+ TimeoutException() : PDNSException() {}
+ TimeoutException(const string& r) : PDNSException(r) {}
+};
diff --git a/pollmplexer.cc b/pollmplexer.cc
new file mode 100644
index 0000000..05ab28b
--- /dev/null
+++ b/pollmplexer.cc
@@ -0,0 +1,199 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "mplexer.hh"
+#include "sstuff.hh"
+#include <iostream>
+#include <poll.h>
+#include <unordered_map>
+#include "misc.hh"
+#include "namespaces.hh"
+
+FDMultiplexer* FDMultiplexer::getMultiplexerSilent()
+{
+ FDMultiplexer* ret = nullptr;
+ for (const auto& i : FDMultiplexer::getMultiplexerMap()) {
+ try {
+ ret = i.second();
+ return ret;
+ }
+ catch (const FDMultiplexerException& fe) {
+ }
+ catch (...) {
+ }
+ }
+ return ret;
+}
+
+class PollFDMultiplexer : public FDMultiplexer
+{
+public:
+ PollFDMultiplexer()
+ {}
+ ~PollFDMultiplexer()
+ {
+ }
+
+ int run(struct timeval* tv, int timeout = 500) override;
+ void getAvailableFDs(std::vector<int>& fds, int timeout) override;
+
+ void addFD(int fd, FDMultiplexer::EventKind) override;
+ void removeFD(int fd, FDMultiplexer::EventKind) override;
+
+ string getName() const override
+ {
+ return "poll";
+ }
+
+private:
+ std::unordered_map<int, struct pollfd> d_pollfds;
+ vector<struct pollfd> preparePollFD() const;
+};
+
+static FDMultiplexer* make()
+{
+ return new PollFDMultiplexer();
+}
+
+static struct RegisterOurselves
+{
+ RegisterOurselves()
+ {
+ FDMultiplexer::getMultiplexerMap().emplace(2, &make);
+ }
+} doIt;
+
+static int convertEventKind(FDMultiplexer::EventKind kind)
+{
+ switch (kind) {
+ case FDMultiplexer::EventKind::Read:
+ return POLLIN;
+ case FDMultiplexer::EventKind::Write:
+ return POLLOUT;
+ case FDMultiplexer::EventKind::Both:
+ return POLLIN | POLLOUT;
+ }
+ throw std::runtime_error("Unhandled event kind in the ports multiplexer");
+}
+
+void PollFDMultiplexer::addFD(int fd, FDMultiplexer::EventKind kind)
+{
+ if (d_pollfds.count(fd) == 0) {
+ auto& pollfd = d_pollfds[fd];
+ pollfd.fd = fd;
+ pollfd.events = 0;
+ }
+ auto& pollfd = d_pollfds.at(fd);
+ pollfd.events |= convertEventKind(kind);
+}
+
+void PollFDMultiplexer::removeFD(int fd, FDMultiplexer::EventKind)
+{
+ d_pollfds.erase(fd);
+}
+
+vector<struct pollfd> PollFDMultiplexer::preparePollFD() const
+{
+ std::vector<struct pollfd> result;
+ result.reserve(d_pollfds.size());
+ for (const auto& entry : d_pollfds) {
+ result.push_back(entry.second);
+ }
+
+ return result;
+}
+
+void PollFDMultiplexer::getAvailableFDs(std::vector<int>& fds, int timeout)
+{
+ auto pollfds = preparePollFD();
+ if (pollfds.empty()) {
+ return;
+ }
+
+ int ret = poll(&pollfds[0], pollfds.size(), timeout);
+
+ if (ret < 0 && errno != EINTR) {
+ throw FDMultiplexerException("poll returned error: " + stringerror());
+ }
+
+ for (const auto& pollfd : pollfds) {
+ if (pollfd.revents & POLLIN || pollfd.revents & POLLOUT || pollfd.revents & POLLERR || pollfd.revents & POLLHUP) {
+ fds.push_back(pollfd.fd);
+ }
+ }
+}
+
+int PollFDMultiplexer::run(struct timeval* now, int timeout)
+{
+ if (d_inrun) {
+ throw FDMultiplexerException("FDMultiplexer::run() is not reentrant!\n");
+ }
+
+ auto pollfds = preparePollFD();
+ if (pollfds.empty()) {
+ gettimeofday(now, nullptr); // MANDATORY!
+ return 0;
+ }
+
+ int ret = poll(&pollfds[0], pollfds.size(), timeout);
+ gettimeofday(now, nullptr); // MANDATORY!
+
+ if (ret < 0 && errno != EINTR) {
+ throw FDMultiplexerException("poll returned error: " + stringerror());
+ }
+
+ d_inrun = true;
+ int count = 0;
+ for (const auto& pollfd : pollfds) {
+ if (pollfd.revents & POLLIN || pollfd.revents & POLLERR || pollfd.revents & POLLHUP) {
+ const auto& iter = d_readCallbacks.find(pollfd.fd);
+ if (iter != d_readCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ count++;
+ }
+ }
+
+ if (pollfd.revents & POLLOUT || pollfd.revents & POLLERR) {
+ const auto& iter = d_writeCallbacks.find(pollfd.fd);
+ if (iter != d_writeCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ count++;
+ }
+ }
+ }
+
+ d_inrun = false;
+ return count;
+}
+
+#if 0
+
+void acceptData(int fd, boost::any& parameter)
+{
+ cout<<"Have data on fd "<<fd<<endl;
+ Socket* sock=boost::any_cast<Socket*>(parameter);
+ string packet;
+ IPEndpoint rem;
+ sock->recvFrom(packet, rem);
+ cout<<"Received "<<packet.size()<<" bytes!\n";
+}
+
+
+int main()
+{
+ Socket s(AF_INET, SOCK_DGRAM);
+
+ IPEndpoint loc("0.0.0.0", 2000);
+ s.bind(loc);
+
+ PollFDMultiplexer sfm;
+
+ sfm.addReadFD(s.getHandle(), &acceptData, &s);
+
+ for(int n=0; n < 100 ; ++n) {
+ sfm.run();
+ }
+ sfm.removeReadFD(s.getHandle());
+ sfm.removeReadFD(s.getHandle());
+}
+#endif
diff --git a/portsmplexer.cc b/portsmplexer.cc
new file mode 100644
index 0000000..d4f3659
--- /dev/null
+++ b/portsmplexer.cc
@@ -0,0 +1,241 @@
+#if defined(__sun__) && defined(__svr4__)
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <port.h>
+#include <sys/port_impl.h>
+#endif
+#include <unistd.h>
+#include "mplexer.hh"
+#include "sstuff.hh"
+#include <iostream>
+
+#include "misc.hh"
+
+#include "namespaces.hh"
+
+class PortsFDMultiplexer : public FDMultiplexer
+{
+public:
+ PortsFDMultiplexer();
+ ~PortsFDMultiplexer()
+ {
+ close(d_portfd);
+ }
+
+ int run(struct timeval* tv, int timeout = 500) override;
+ void getAvailableFDs(std::vector<int>& fds, int timeout) override;
+
+ void addFD(int fd, FDMultiplexer::EventKind kind) override;
+ void removeFD(int fd, FDMultiplexer::EventKind kind) override;
+
+ string getName() const override
+ {
+ return "solaris completion ports";
+ }
+
+private:
+ int d_portfd;
+ boost::shared_array<port_event_t> d_pevents;
+ static int s_maxevents; // not a hard maximum
+};
+
+static FDMultiplexer* makePorts()
+{
+ return new PortsFDMultiplexer();
+}
+
+static struct PortsRegisterOurselves
+{
+ PortsRegisterOurselves()
+ {
+ FDMultiplexer::getMultiplexerMap().emplace(0, &makePorts); // priority 0!
+ }
+} doItPorts;
+
+int PortsFDMultiplexer::s_maxevents = 1024;
+
+PortsFDMultiplexer::PortsFDMultiplexer() :
+ d_pevents(new port_event_t[s_maxevents])
+{
+ d_portfd = port_create(); // not hard max
+ if (d_portfd < 0) {
+ throw FDMultiplexerException("Setting up port: " + stringerror());
+ }
+}
+
+static int convertEventKind(FDMultiplexer::EventKind kind)
+{
+ switch (kind) {
+ case FDMultiplexer::EventKind::Read:
+ return POLLIN;
+ case FDMultiplexer::EventKind::Write:
+ return POLLOUT;
+ case FDMultiplexer::EventKind::Both:
+ return POLLIN | POLLOUT;
+ }
+ throw std::runtime_error("Unhandled event kind in the ports multiplexer");
+}
+
+void PortsFDMultiplexer::addFD(int fd, FDMultiplexer::EventKind kind)
+{
+ if (port_associate(d_portfd, PORT_SOURCE_FD, fd, convertEventKind(kind), 0) < 0) {
+ throw FDMultiplexerException("Adding fd to port set: " + stringerror());
+ }
+}
+
+void PortsFDMultiplexer::removeFD(int fd, FDMultiplexer::EventKind)
+{
+ if (port_dissociate(d_portfd, PORT_SOURCE_FD, fd) < 0 && errno != ENOENT) { // it appears under some circumstances, ENOENT will be returned, without this being an error. Apache has this same "fix"
+ throw FDMultiplexerException("Removing fd from port set: " + stringerror());
+ }
+}
+
+void PortsFDMultiplexer::getAvailableFDs(std::vector<int>& fds, int timeout)
+{
+ struct timespec timeoutspec;
+ timeoutspec.tv_sec = timeout / 1000;
+ timeoutspec.tv_nsec = (timeout % 1000) * 1000000;
+ unsigned int numevents = 1;
+ int ret = port_getn(d_portfd, d_pevents.get(), min(PORT_MAX_LIST, s_maxevents), &numevents, &timeoutspec);
+
+ /* port_getn has an unusual API - (ret == -1, errno == ETIME) can
+ mean partial success; you must check (*numevents) in this case
+ and process anything in there, otherwise you'll never see any
+ events from that object again. We don't care about pure timeouts
+ (ret == -1, errno == ETIME, *numevents == 0) so we don't bother
+ with that case. */
+ if (ret == -1 && errno != ETIME) {
+ if (errno != EINTR) {
+ throw FDMultiplexerException("completion port_getn returned error: " + stringerror());
+ }
+
+ // EINTR is not really an error
+ return;
+ }
+
+ if (numevents == 0) {
+ // nothing
+ return;
+ }
+
+ fds.reserve(numevents);
+
+ for (unsigned int n = 0; n < numevents; ++n) {
+ const auto fd = d_pevents[n].portev_object;
+
+ /* we need to re-associate the FD */
+ if ((d_pevents[n].portev_events & POLLIN || d_pevents[n].portev_events & POLLERR || d_pevents[n].portev_events & POLLHUP)) {
+ if (d_readCallbacks.count(fd)) {
+ if (port_associate(d_portfd, PORT_SOURCE_FD, fd, d_writeCallbacks.count(fd) > 0 ? POLLIN | POLLOUT : POLLIN, 0) < 0) {
+ throw FDMultiplexerException("Unable to add fd back to ports (read): " + stringerror());
+ }
+ }
+ }
+ else if ((d_pevents[n].portev_events & POLLOUT || d_pevents[n].portev_events & POLLERR)) {
+ if (d_writeCallbacks.count(fd)) {
+ if (port_associate(d_portfd, PORT_SOURCE_FD, fd, d_readCallbacks.count(fd) > 0 ? POLLIN | POLLOUT : POLLOUT, 0) < 0) {
+ throw FDMultiplexerException("Unable to add fd back to ports (write): " + stringerror());
+ }
+ }
+ }
+ else {
+ /* not registered, this is unexpected */
+ continue;
+ }
+
+ fds.push_back(fd);
+ }
+}
+
+int PortsFDMultiplexer::run(struct timeval* now, int timeout)
+{
+ if (d_inrun) {
+ throw FDMultiplexerException("FDMultiplexer::run() is not reentrant!\n");
+ }
+
+ struct timespec timeoutspec;
+ timeoutspec.tv_sec = timeout / 1000;
+ timeoutspec.tv_nsec = (timeout % 1000) * 1000000;
+ unsigned int numevents = 1;
+ int ret = port_getn(d_portfd, d_pevents.get(), min(PORT_MAX_LIST, s_maxevents), &numevents, &timeoutspec);
+
+ /* port_getn has an unusual API - (ret == -1, errno == ETIME) can
+ mean partial success; you must check (*numevents) in this case
+ and process anything in there, otherwise you'll never see any
+ events from that object again. We don't care about pure timeouts
+ (ret == -1, errno == ETIME, *numevents == 0) so we don't bother
+ with that case. */
+ if (ret == -1 && errno != ETIME) {
+ if (errno != EINTR) {
+ throw FDMultiplexerException("completion port_getn returned error: " + stringerror());
+ }
+ // EINTR is not really an error
+ gettimeofday(now, nullptr);
+ return 0;
+ }
+ gettimeofday(now, nullptr);
+ if (!numevents) {
+ // nothing
+ return 0;
+ }
+
+ d_inrun = true;
+ int count = 0;
+ for (unsigned int n = 0; n < numevents; ++n) {
+ if (d_pevents[n].portev_events & POLLIN || d_pevents[n].portev_events & POLLERR || d_pevents[n].portev_events & POLLHUP) {
+ const auto& iter = d_readCallbacks.find(d_pevents[n].portev_object);
+ if (iter != d_readCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ count++;
+ if (d_readCallbacks.count(d_pevents[n].portev_object) && port_associate(d_portfd, PORT_SOURCE_FD, d_pevents[n].portev_object, d_writeCallbacks.count(d_pevents[n].portev_object) ? POLLIN | POLLOUT : POLLIN, 0) < 0) {
+ throw FDMultiplexerException("Unable to add fd back to ports (read): " + stringerror());
+ }
+ }
+ }
+ if (d_pevents[n].portev_events & POLLOUT || d_pevents[n].portev_events & POLLERR) {
+ const auto& iter = d_writeCallbacks.find(d_pevents[n].portev_object);
+ if (iter != d_writeCallbacks.end()) {
+ iter->d_callback(iter->d_fd, iter->d_parameter);
+ count++;
+ if (d_writeCallbacks.count(d_pevents[n].portev_object) && port_associate(d_portfd, PORT_SOURCE_FD, d_pevents[n].portev_object, d_readCallbacks.count(d_pevents[n].portev_object) ? POLLIN | POLLOUT : POLLOUT, 0) < 0) {
+ throw FDMultiplexerException("Unable to add fd back to ports (write): " + stringerror());
+ }
+ }
+ }
+ }
+
+ d_inrun = false;
+ return count;
+}
+
+#if 0
+void acceptData(int fd, boost::any& parameter)
+{
+ cout<<"Have data on fd "<<fd<<endl;
+ Socket* sock=boost::any_cast<Socket*>(parameter);
+ string packet;
+ IPEndpoint rem;
+ sock->recvFrom(packet, rem);
+ cout<<"Received "<<packet.size()<<" bytes!\n";
+}
+
+
+int main()
+{
+ Socket s(AF_INET, SOCK_DGRAM);
+
+ IPEndpoint loc("0.0.0.0", 2000);
+ s.bind(loc);
+
+ PortsFDMultiplexer sfm;
+
+ sfm.addReadFD(s.getHandle(), &acceptData, &s);
+
+ for(int n=0; n < 100 ; ++n) {
+ sfm.run();
+ }
+ sfm.removeReadFD(s.getHandle());
+ sfm.removeReadFD(s.getHandle());
+}
+#endif
diff --git a/protozero.cc b/protozero.cc
new file mode 100644
index 0000000..7d13a9c
--- /dev/null
+++ b/protozero.cc
@@ -0,0 +1,159 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "protozero.hh"
+#include "dnsparser.hh"
+
+void pdns::ProtoZero::Message::encodeComboAddress(const protozero::pbf_tag_type type, const ComboAddress& ca)
+{
+ if (ca.sin4.sin_family == AF_INET) {
+ d_message.add_bytes(type, reinterpret_cast<const char*>(&ca.sin4.sin_addr.s_addr), sizeof(ca.sin4.sin_addr.s_addr));
+ }
+ else if (ca.sin4.sin_family == AF_INET6) {
+ d_message.add_bytes(type, reinterpret_cast<const char*>(&ca.sin6.sin6_addr.s6_addr), sizeof(ca.sin6.sin6_addr.s6_addr));
+ }
+}
+
+void pdns::ProtoZero::Message::encodeNetmask(const protozero::pbf_tag_type type, const Netmask& subnet, uint8_t mask)
+{
+ if (!subnet.empty()) {
+ ComboAddress ca(subnet.getNetwork());
+ ca.truncate(mask);
+ if (ca.sin4.sin_family == AF_INET) {
+ d_message.add_bytes(type, reinterpret_cast<const char*>(&ca.sin4.sin_addr.s_addr), sizeof(ca.sin4.sin_addr.s_addr));
+ }
+ else if (ca.sin4.sin_family == AF_INET6) {
+ d_message.add_bytes(type, reinterpret_cast<const char*>(&ca.sin6.sin6_addr.s6_addr), sizeof(ca.sin6.sin6_addr.s6_addr));
+ }
+ }
+}
+
+void pdns::ProtoZero::Message::encodeDNSName(protozero::pbf_writer& pbf, std::string& buffer, const protozero::pbf_tag_type type, const DNSName& name)
+{
+ // this will append the tag, mark the current position then reserve enough place to write the size
+ protozero::pbf_writer pbf_name{pbf, type};
+ // we append the name to the buffer
+ name.toString(buffer);
+ // leaving the block will cause the sub writer to compute how much was written based on the new size and update the size accordingly
+}
+
+void pdns::ProtoZero::Message::setRequest(const boost::uuids::uuid& uniqueId, const ComboAddress& requestor, const ComboAddress& local, const DNSName& qname, uint16_t qtype, uint16_t qclass, uint16_t id, pdns::ProtoZero::Message::TransportProtocol proto, size_t len)
+{
+ setMessageIdentity(uniqueId);
+ setSocketFamily(requestor.sin4.sin_family);
+ setSocketProtocol(proto);
+ setFrom(requestor);
+ setTo(local);
+ setInBytes(len);
+ setTime();
+ setId(id);
+ setQuestion(qname, qtype, qclass);
+ setFromPort(requestor.getPort());
+ setToPort(local.getPort());
+}
+
+void pdns::ProtoZero::Message::setResponse(const DNSName& qname, uint16_t qtype, uint16_t qclass)
+{
+ setType(pdns::ProtoZero::Message::MessageType::DNSResponseType);
+ setQuestion(qname, qtype, qclass);
+}
+
+void pdns::ProtoZero::Message::addRRsFromPacket(const char* packet, const size_t len, bool includeCNAME)
+{
+ if (len < sizeof(struct dnsheader)) {
+ return;
+ }
+
+ const struct dnsheader* dh = reinterpret_cast<const struct dnsheader*>(packet);
+
+ if (ntohs(dh->ancount) == 0) {
+ return;
+ }
+
+ if (ntohs(dh->qdcount) == 0) {
+ return;
+ }
+
+ PacketReader pr(pdns_string_view(packet, len));
+
+ size_t idx = 0;
+ DNSName rrname;
+ uint16_t qdcount = ntohs(dh->qdcount);
+ uint16_t ancount = ntohs(dh->ancount);
+ uint16_t rrtype;
+ uint16_t rrclass;
+ string blob;
+ struct dnsrecordheader ah;
+
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+ (void) rrtype;
+ (void) rrclass;
+
+ /* consume remaining qd if any */
+ if (qdcount > 1) {
+ for(idx = 1; idx < qdcount; idx++) {
+ rrname = pr.getName();
+ rrtype = pr.get16BitInt();
+ rrclass = pr.get16BitInt();
+ (void) rrtype;
+ (void) rrclass;
+ }
+ }
+
+ /* parse AN */
+ for (idx = 0; idx < ancount; idx++) {
+ rrname = pr.getName();
+ pr.getDnsrecordheader(ah);
+
+ if (ah.d_type == QType::A || ah.d_type == QType::AAAA) {
+ pr.xfrBlob(blob);
+
+ addRR(rrname, ah.d_type, ah.d_class, ah.d_ttl, blob);
+
+ } else if (ah.d_type == QType::CNAME && includeCNAME) {
+ protozero::pbf_writer pbf_rr{d_response, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::ResponseField::rrs)};
+
+ encodeDNSName(pbf_rr, d_buffer, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::name), rrname);
+ pbf_rr.add_uint32(static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::type), ah.d_type);
+ pbf_rr.add_uint32(static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::class_), ah.d_class);
+ pbf_rr.add_uint32(static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::ttl), ah.d_ttl);
+ DNSName target;
+ pr.xfrName(target, true);
+ encodeDNSName(pbf_rr, d_buffer, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::rdata), target);
+ }
+ else {
+ pr.xfrBlob(blob);
+ }
+ }
+}
+
+void pdns::ProtoZero::Message::addRR(const DNSName& name, uint16_t uType, uint16_t uClass, uint32_t uTTL, const std::string& blob)
+{
+ protozero::pbf_writer pbf_rr{d_response, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::ResponseField::rrs)};
+ encodeDNSName(pbf_rr, d_buffer, static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::name), name);
+ pbf_rr.add_uint32(static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::type), uType);
+ pbf_rr.add_uint32(static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::class_), uClass);
+ pbf_rr.add_uint32(static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::ttl), uTTL);
+ pbf_rr.add_string(static_cast<protozero::pbf_tag_type>(pdns::ProtoZero::Message::RRField::rdata), blob);
+}
diff --git a/protozero.hh b/protozero.hh
new file mode 100644
index 0000000..61d009a
--- /dev/null
+++ b/protozero.hh
@@ -0,0 +1,272 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <protozero/pbf_writer.hpp>
+
+#include "config.h"
+#include "iputils.hh"
+#include "gettime.hh"
+#include "uuid-utils.hh"
+
+namespace pdns {
+ namespace ProtoZero {
+ class Message {
+ public:
+
+ enum class MetaValueField : protozero::pbf_tag_type { stringVal = 1, intVal = 2 };
+ enum class MetaField : protozero::pbf_tag_type { key = 1, value = 2 };
+ enum class Event : protozero::pbf_tag_type { ts = 1, event = 2, start = 3, boolVal = 4, intVal = 5, stringVal = 6, bytesVal = 7, custom = 8 };
+ enum class MessageType : int32_t { DNSQueryType = 1, DNSResponseType = 2, DNSOutgoingQueryType = 3, DNSIncomingResponseType = 4 };
+ enum class Field : protozero::pbf_tag_type { type = 1, messageId = 2, serverIdentity = 3, socketFamily = 4, socketProtocol = 5, from = 6, to = 7, inBytes = 8, timeSec = 9, timeUsec = 10, id = 11, question = 12, response = 13, originalRequestorSubnet = 14, requestorId = 15, initialRequestId = 16, deviceId = 17, newlyObservedDomain = 18, deviceName = 19, fromPort = 20, toPort = 21, meta = 22, trace = 23 };
+ enum class QuestionField : protozero::pbf_tag_type { qName = 1, qType = 2, qClass = 3 };
+ enum class ResponseField : protozero::pbf_tag_type { rcode = 1, rrs = 2, appliedPolicy = 3, tags = 4, queryTimeSec = 5, queryTimeUsec = 6, appliedPolicyType = 7, appliedPolicyTrigger = 8, appliedPolicyHit = 9, appliedPolicyKind = 10, validationState = 11 };
+ enum class RRField : protozero::pbf_tag_type { name = 1, type = 2, class_ = 3, ttl = 4, rdata = 5, udr = 6 };
+ enum class TransportProtocol : protozero::pbf_tag_type { UDP = 1, TCP = 2, DoT = 3, DoH = 4, DNSCryptUDP = 5, DNSCryptTCP = 6 };
+
+ Message(std::string& buffer): d_buffer(buffer), d_message{d_buffer}
+ {
+ }
+
+ Message(const Message&) = delete;
+ Message(Message&&) = delete;
+ Message& operator=(const Message&) = delete;
+ Message& operator=(Message&&) = delete;
+
+ void setRequest(const boost::uuids::uuid& uniqueId, const ComboAddress& requestor, const ComboAddress& local, const DNSName& qname, uint16_t qtype, uint16_t qclass, uint16_t id, TransportProtocol proto, size_t len);
+ void setResponse(const DNSName& qname, uint16_t qtype, uint16_t qclass);
+
+ void setType(MessageType mtype)
+ {
+ add_enum(d_message, Field::type, static_cast<int32_t>(mtype));
+ }
+
+ void setMessageIdentity(const boost::uuids::uuid& uniqueId)
+ {
+ add_bytes(d_message, Field::messageId, reinterpret_cast<const char*>(uniqueId.begin()), uniqueId.size());
+ }
+
+ void setServerIdentity(const std::string& serverIdentity)
+ {
+ add_bytes(d_message, Field::serverIdentity, serverIdentity.data(), serverIdentity.length());
+ }
+
+ void setSocketFamily(int family)
+ {
+ add_enum(d_message, Field::socketFamily, family == AF_INET ? 1 : 2);
+ }
+
+ void setSocketProtocol(TransportProtocol proto)
+ {
+ add_enum(d_message, Field::socketProtocol, static_cast<int32_t>(proto));
+ }
+
+ void setFrom(const ComboAddress& ca)
+ {
+ encodeComboAddress(static_cast<protozero::pbf_tag_type>(Field::from), ca);
+ }
+
+ void setTo(const ComboAddress& ca)
+ {
+ encodeComboAddress(static_cast<protozero::pbf_tag_type>(Field::to), ca);
+ }
+
+ void setInBytes(uint64_t len)
+ {
+ add_uint64(d_message, Field::inBytes, len);
+ }
+
+ void setTime()
+ {
+ struct timespec ts;
+ gettime(&ts, true);
+
+ setTime(ts.tv_sec, ts.tv_nsec / 1000);
+ }
+
+ void setTime(time_t sec, uint32_t usec)
+ {
+ add_uint32(d_message, Field::timeSec, sec);
+ add_uint32(d_message, Field::timeUsec, usec);
+ }
+
+ void setId(uint16_t id)
+ {
+ add_uint32(d_message, Field::id, ntohs(id));
+ }
+
+ void setQuestion(const DNSName& qname, uint16_t qtype, uint16_t qclass)
+ {
+ protozero::pbf_writer pbf_question{d_message, static_cast<protozero::pbf_tag_type>(Field::question)};
+ encodeDNSName(pbf_question, d_buffer, static_cast<protozero::pbf_tag_type>(QuestionField::qName), qname);
+ pbf_question.add_uint32(static_cast<protozero::pbf_tag_type>(QuestionField::qType), qtype);
+ pbf_question.add_uint32(static_cast<protozero::pbf_tag_type>(QuestionField::qClass), qclass);
+ }
+
+ void setMeta(const std::string& key, const std::unordered_set<std::string>& stringVal, const std::unordered_set<int64_t>& intVal)
+ {
+ protozero::pbf_writer pbf_meta{d_message, static_cast<protozero::pbf_tag_type>(Field::meta)};
+ pbf_meta.add_string(static_cast<protozero::pbf_tag_type>(MetaField::key), key);
+ protozero::pbf_writer pbf_meta_value{pbf_meta, static_cast<protozero::pbf_tag_type>(MetaField::value)};
+ for (const auto& s: stringVal) {
+ pbf_meta_value.add_string(static_cast<protozero::pbf_tag_type>(MetaValueField::stringVal), s);
+ }
+ for (const auto& i: intVal) {
+ pbf_meta_value.add_uint64(static_cast<protozero::pbf_tag_type>(MetaValueField::intVal), i);
+ }
+ }
+
+ void setEDNSSubnet(const Netmask& nm, uint8_t mask)
+ {
+ encodeNetmask(static_cast<protozero::pbf_tag_type>(Field::originalRequestorSubnet), nm, mask);
+ }
+
+ void setRequestorId(const std::string& req)
+ {
+ if (!req.empty()) {
+ add_string(d_message, Field::requestorId, req);
+ }
+ }
+
+ void setInitialRequestID(const boost::uuids::uuid& uniqueId)
+ {
+ add_bytes(d_message, Field::initialRequestId, reinterpret_cast<const char*>(uniqueId.begin()), uniqueId.size());
+ }
+
+ void setDeviceId(const std::string& id)
+ {
+ if (!id.empty()) {
+ add_string(d_message, Field::deviceId, id);
+ }
+ }
+
+ void setNewlyObservedDomain(bool nod)
+ {
+ add_bool(d_message, Field::newlyObservedDomain, nod);
+ }
+
+ void setDeviceName(const std::string& name)
+ {
+ if (!name.empty()) {
+ add_string(d_message, Field::deviceName, name);
+ }
+ }
+
+ void setFromPort(in_port_t port)
+ {
+ add_uint32(d_message, Field::fromPort, port);
+ }
+
+ void setToPort(in_port_t port)
+ {
+ add_uint32(d_message, Field::toPort, port);
+ }
+
+ void startResponse()
+ {
+ d_response = protozero::pbf_writer{d_message, static_cast<protozero::pbf_tag_type>(Field::response)};
+ }
+
+ void commitResponse()
+ {
+ d_response.commit();
+ }
+
+ void setResponseCode(uint8_t rcode)
+ {
+ d_response.add_uint32(static_cast<protozero::pbf_tag_type>(ResponseField::rcode), rcode);
+ }
+
+ void setNetworkErrorResponseCode()
+ {
+ /* special code meaning 'network error', like a timeout */
+ d_response.add_uint32(static_cast<protozero::pbf_tag_type>(ResponseField::rcode), 65536);
+ }
+
+ void setAppliedPolicy(const std::string& policy)
+ {
+ d_response.add_string(static_cast<protozero::pbf_tag_type>(ResponseField::appliedPolicy), policy);
+ }
+
+ void addPolicyTags(const std::unordered_set<std::string>& tags)
+ {
+ for (const auto& tag : tags) {
+ addPolicyTag(tag);
+ }
+ }
+
+ void addPolicyTag(const string& tag)
+ {
+ d_response.add_string(static_cast<protozero::pbf_tag_type>(ResponseField::tags), tag);
+ }
+
+ void setQueryTime(uint32_t sec, uint32_t usec)
+ {
+ d_response.add_uint32(static_cast<protozero::pbf_tag_type>(ResponseField::queryTimeSec), sec);
+ d_response.add_uint32(static_cast<protozero::pbf_tag_type>(ResponseField::queryTimeUsec), usec);
+ }
+
+ void addRRsFromPacket(const char* packet, const size_t len, bool includeCNAME=false);
+ void addRR(const DNSName& name, uint16_t uType, uint16_t uClass, uint32_t uTTL, const std::string& blob);
+
+ protected:
+ void encodeComboAddress(protozero::pbf_tag_type type, const ComboAddress& ca);
+ void encodeNetmask(protozero::pbf_tag_type type, const Netmask& subnet, uint8_t mask);
+ void encodeDNSName(protozero::pbf_writer& pbf, std::string& buffer, protozero::pbf_tag_type type, const DNSName& name);
+
+ static void add_enum(protozero::pbf_writer& writer, Field type, int32_t value)
+ {
+ writer.add_enum(static_cast<protozero::pbf_tag_type>(type), value);
+ }
+
+ static void add_bool(protozero::pbf_writer& writer, Field type, bool value)
+ {
+ writer.add_bool(static_cast<protozero::pbf_tag_type>(type), value);
+ }
+
+ static void add_uint32(protozero::pbf_writer& writer, Field type, uint32_t value)
+ {
+ writer.add_uint32(static_cast<protozero::pbf_tag_type>(type), value);
+ }
+
+ static void add_uint64(protozero::pbf_writer& writer, Field type, uint64_t value)
+ {
+ writer.add_uint64(static_cast<protozero::pbf_tag_type>(type), value);
+ }
+
+ static void add_bytes(protozero::pbf_writer& writer, Field type, const char* data, size_t len)
+ {
+ writer.add_bytes(static_cast<protozero::pbf_tag_type>(type), data, len);
+ }
+
+ static void add_string(protozero::pbf_writer& writer, Field type, const std::string& str)
+ {
+ writer.add_string(static_cast<protozero::pbf_tag_type>(type), str);
+ }
+
+
+ std::string& d_buffer;
+ protozero::pbf_writer d_message;
+ protozero::pbf_writer d_response;
+ };
+ };
+};
diff --git a/proxy-protocol.cc b/proxy-protocol.cc
new file mode 100644
index 0000000..b7c7270
--- /dev/null
+++ b/proxy-protocol.cc
@@ -0,0 +1,263 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "proxy-protocol.hh"
+
+// TODO: maybe use structs instead of explicitly working byte by byte, like https://github.com/dovecot/core/blob/master/src/lib-master/master-service-haproxy.c
+
+#define PROXYMAGIC "\x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A"
+#define PROXYMAGICLEN sizeof(PROXYMAGIC)-1
+
+static string proxymagic(PROXYMAGIC, PROXYMAGICLEN);
+
+static std::string makeSimpleHeader(uint8_t command, uint8_t protocol, uint16_t contentLen)
+{
+ std::string ret;
+ const uint8_t versioncommand = (0x20 | command);
+
+ ret.reserve(proxymagic.size() + sizeof(versioncommand) + sizeof(protocol) + sizeof(contentLen) + contentLen);
+
+ ret.append(proxymagic);
+
+ ret.append(reinterpret_cast<const char*>(&versioncommand), sizeof(versioncommand));
+ ret.append(reinterpret_cast<const char*>(&protocol), sizeof(protocol));
+
+ ret.append(reinterpret_cast<const char*>(&contentLen), sizeof(contentLen));
+
+ return ret;
+}
+
+std::string makeLocalProxyHeader()
+{
+ return makeSimpleHeader(0x00, 0, 0);
+}
+
+std::string makeProxyHeader(bool tcp, const ComboAddress& source, const ComboAddress& destination, const std::vector<ProxyProtocolValue>& values)
+{
+ if (source.sin4.sin_family != destination.sin4.sin_family) {
+ throw std::runtime_error("The PROXY destination and source addresses must be of the same family");
+ }
+
+ const uint8_t command = 0x01;
+ const uint8_t protocol = (source.isIPv4() ? 0x10 : 0x20) | (tcp ? 0x01 : 0x02);
+ const size_t addrSize = source.isIPv4() ? sizeof(source.sin4.sin_addr.s_addr) : sizeof(source.sin6.sin6_addr.s6_addr);
+ const uint16_t sourcePort = source.sin4.sin_port;
+ const uint16_t destinationPort = destination.sin4.sin_port;
+
+ size_t valuesSize = 0;
+ for (const auto& value : values) {
+ if (value.content.size() > std::numeric_limits<uint16_t>::max()) {
+ throw std::runtime_error("The size of proxy protocol values is limited to " + std::to_string(std::numeric_limits<uint16_t>::max()) + ", trying to add a value of size " + std::to_string(value.content.size()));
+ }
+ valuesSize += sizeof(uint8_t) + sizeof(uint8_t) * 2 + value.content.size();
+ if (valuesSize > std::numeric_limits<uint16_t>::max()) {
+ throw std::runtime_error("The total size of proxy protocol values is limited to " + std::to_string(std::numeric_limits<uint16_t>::max()));
+ }
+ }
+
+ size_t total = (addrSize * 2) + sizeof(sourcePort) + sizeof(destinationPort) + valuesSize;
+ if (total > std::numeric_limits<uint16_t>::max()) {
+ throw std::runtime_error("The size of a proxy protocol header is limited to " + std::to_string(std::numeric_limits<uint16_t>::max()) + ", trying to send one of size " + std::to_string(total));
+ }
+
+ const uint16_t contentlen = htons(static_cast<uint16_t>(total));
+ std::string ret = makeSimpleHeader(command, protocol, contentlen);
+
+ // We already established source and destination sin_family equivalence
+ if (source.isIPv4()) {
+ assert(addrSize == sizeof(source.sin4.sin_addr.s_addr));
+ ret.append(reinterpret_cast<const char*>(&source.sin4.sin_addr.s_addr), addrSize);
+ assert(addrSize == sizeof(destination.sin4.sin_addr.s_addr));
+ ret.append(reinterpret_cast<const char*>(&destination.sin4.sin_addr.s_addr), addrSize);
+ }
+ else {
+ assert(addrSize == sizeof(source.sin6.sin6_addr.s6_addr));
+ ret.append(reinterpret_cast<const char*>(&source.sin6.sin6_addr.s6_addr), addrSize);
+ assert(addrSize == sizeof(destination.sin6.sin6_addr.s6_addr));
+ ret.append(reinterpret_cast<const char*>(&destination.sin6.sin6_addr.s6_addr), addrSize);
+ }
+
+ ret.append(reinterpret_cast<const char*>(&sourcePort), sizeof(sourcePort));
+ ret.append(reinterpret_cast<const char*>(&destinationPort), sizeof(destinationPort));
+
+ for (const auto& value : values) {
+ uint16_t contentSize = htons(static_cast<uint16_t>(value.content.size()));
+ ret.append(reinterpret_cast<const char*>(&value.type), sizeof(value.type));
+ ret.append(reinterpret_cast<const char*>(&contentSize), sizeof(contentSize));
+ ret.append(reinterpret_cast<const char*>(value.content.data()), value.content.size());
+ }
+
+ return ret;
+}
+
+/* returns: number of bytes consumed (positive) after successful parse
+ or number of bytes missing (negative)
+ or unfixable parse error (0)*/
+template<typename Container> ssize_t isProxyHeaderComplete(const Container& header, bool* proxy, bool* tcp, size_t* addrSizeOut, uint8_t* protocolOut)
+{
+ static const size_t addr4Size = sizeof(ComboAddress::sin4.sin_addr.s_addr);
+ static const size_t addr6Size = sizeof(ComboAddress::sin6.sin6_addr.s6_addr);
+ size_t addrSize = 0;
+ uint8_t versioncommand;
+ uint8_t protocol;
+
+ if (header.size() < s_proxyProtocolMinimumHeaderSize) {
+ // this is too short to be a complete proxy header
+ return -(s_proxyProtocolMinimumHeaderSize - header.size());
+ }
+
+ if (std::memcmp(&header.at(0), &proxymagic.at(0), proxymagic.size()) != 0) {
+ // wrong magic, can not be a proxy header
+ return 0;
+ }
+
+ versioncommand = header.at(12);
+ /* check version */
+ if (!(versioncommand & 0x20)) {
+ return 0;
+ }
+
+ /* remove the version to get the command */
+ uint8_t command = versioncommand & ~0x20;
+
+ if (command == 0x01) {
+ protocol = header.at(13);
+ if ((protocol & 0xf) == 1) {
+ if (tcp) {
+ *tcp = true;
+ }
+ } else if ((protocol & 0xf) == 2) {
+ if (tcp) {
+ *tcp = false;
+ }
+ } else {
+ return 0;
+ }
+
+ protocol = protocol >> 4;
+
+ if (protocol == 1) {
+ if (protocolOut) {
+ *protocolOut = 4;
+ }
+ addrSize = addr4Size; // IPv4
+ } else if (protocol == 2) {
+ if (protocolOut) {
+ *protocolOut = 6;
+ }
+ addrSize = addr6Size; // IPv6
+ } else {
+ // invalid protocol
+ return 0;
+ }
+
+ if (addrSizeOut) {
+ *addrSizeOut = addrSize;
+ }
+
+ if (proxy) {
+ *proxy = true;
+ }
+ }
+ else if (command == 0x00) {
+ if (proxy) {
+ *proxy = false;
+ }
+ }
+ else {
+ /* unsupported command */
+ return 0;
+ }
+
+ uint16_t contentlen = (static_cast<uint8_t>(header.at(14)) << 8) + static_cast<uint8_t>(header.at(15));
+ uint16_t expectedlen = 0;
+ if (command != 0x00) {
+ expectedlen = (addrSize * 2) + sizeof(ComboAddress::sin4.sin_port) + sizeof(ComboAddress::sin4.sin_port);
+ }
+
+ if (contentlen < expectedlen) {
+ return 0;
+ }
+
+ if (header.size() < s_proxyProtocolMinimumHeaderSize + contentlen) {
+ return -((s_proxyProtocolMinimumHeaderSize + contentlen) - header.size());
+ }
+
+ return s_proxyProtocolMinimumHeaderSize + contentlen;
+}
+
+/* returns: number of bytes consumed (positive) after successful parse
+ or number of bytes missing (negative)
+ or unfixable parse error (0)*/
+template<typename Container> ssize_t parseProxyHeader(const Container& header, bool& proxy, ComboAddress& source, ComboAddress& destination, bool& tcp, std::vector<ProxyProtocolValue>& values)
+{
+ size_t addrSize = 0;
+ uint8_t protocol = 0;
+ ssize_t got = isProxyHeaderComplete(header, &proxy, &tcp, &addrSize, &protocol);
+ if (got <= 0) {
+ return got;
+ }
+
+ size_t pos = s_proxyProtocolMinimumHeaderSize;
+
+ if (proxy) {
+ source = makeComboAddressFromRaw(protocol, reinterpret_cast<const char*>(&header.at(pos)), addrSize);
+ pos = pos + addrSize;
+ destination = makeComboAddressFromRaw(protocol, reinterpret_cast<const char*>(&header.at(pos)), addrSize);
+ pos = pos + addrSize;
+ source.setPort((static_cast<uint8_t>(header.at(pos)) << 8) + static_cast<uint8_t>(header.at(pos+1)));
+ pos = pos + sizeof(uint16_t);
+ destination.setPort((static_cast<uint8_t>(header.at(pos)) << 8) + static_cast<uint8_t>(header.at(pos+1)));
+ pos = pos + sizeof(uint16_t);
+ }
+
+ size_t remaining = got - pos;
+ while (remaining >= (sizeof(uint8_t) + sizeof(uint16_t))) {
+ /* we still have TLV values to parse */
+ uint8_t type = static_cast<uint8_t>(header.at(pos));
+ pos += sizeof(uint8_t);
+ uint16_t len = (static_cast<uint8_t>(header.at(pos)) << 8) + static_cast<uint8_t>(header.at(pos + 1));
+ pos += sizeof(uint16_t);
+
+ if (len > 0) {
+ if (len > (got - pos)) {
+ return 0;
+ }
+
+ values.push_back({std::string(reinterpret_cast<const char*>(&header.at(pos)), len), type});
+ pos += len;
+ }
+ else {
+ values.push_back({"", type});
+ }
+
+ remaining = got - pos;
+ }
+
+ return pos;
+}
+
+#include "noinitvector.hh"
+template ssize_t isProxyHeaderComplete<std::string>(const std::string& header, bool* proxy, bool* tcp, size_t* addrSizeOut, uint8_t* protocolOut);
+template ssize_t isProxyHeaderComplete<PacketBuffer>(const PacketBuffer& header, bool* proxy, bool* tcp, size_t* addrSizeOut, uint8_t* protocolOut);
+template ssize_t parseProxyHeader<std::string>(const std::string& header, bool& proxy, ComboAddress& source, ComboAddress& destination, bool& tcp, std::vector<ProxyProtocolValue>& values);
+template ssize_t parseProxyHeader<PacketBuffer>(const PacketBuffer& header, bool& proxy, ComboAddress& source, ComboAddress& destination, bool& tcp, std::vector<ProxyProtocolValue>& values);
diff --git a/proxy-protocol.hh b/proxy-protocol.hh
new file mode 100644
index 0000000..373a750
--- /dev/null
+++ b/proxy-protocol.hh
@@ -0,0 +1,51 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#pragma once
+
+#include "iputils.hh"
+
+struct ProxyProtocolValue
+{
+ std::string content;
+ uint8_t type;
+
+ bool operator==(const ProxyProtocolValue& rhs) const
+ {
+ return type == rhs.type && content == rhs.content;
+ }
+};
+
+static const size_t s_proxyProtocolMinimumHeaderSize = 16;
+
+std::string makeLocalProxyHeader();
+std::string makeProxyHeader(bool tcp, const ComboAddress& source, const ComboAddress& destination, const std::vector<ProxyProtocolValue>& values);
+
+/* returns: number of bytes consumed (positive) after successful parse
+ or number of bytes missing (negative)
+ or unfixable parse error (0)*/
+template<typename Container> ssize_t isProxyHeaderComplete(const Container& header, bool* proxy=nullptr, bool* tcp=nullptr, size_t* addrSizeOut=nullptr, uint8_t* protocolOut=nullptr);
+
+/* returns: number of bytes consumed (positive) after successful parse
+ or number of bytes missing (negative)
+ or unfixable parse error (0)*/
+template<typename Container> ssize_t parseProxyHeader(const Container& header, bool& proxy, ComboAddress& source, ComboAddress& destination, bool& tcp, std::vector<ProxyProtocolValue>& values);
diff --git a/qtype.cc b/qtype.cc
new file mode 100644
index 0000000..8f4302b
--- /dev/null
+++ b/qtype.cc
@@ -0,0 +1,183 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "dns.hh"
+#include <iostream>
+#include <string>
+#include <vector>
+#include <utility>
+#include <sstream>
+#include "qtype.hh"
+#include "misc.hh"
+
+static_assert(sizeof(QType) == 2, "QType is not 2 bytes in size, something is wrong!");
+
+const map<const string, uint16_t> QType::names = {
+ {"A", 1},
+ {"NS", 2},
+ {"CNAME", 5},
+ {"SOA", 6},
+ {"MB", 7},
+ {"MG", 8},
+ {"MR", 9},
+ {"PTR", 12},
+ {"HINFO", 13},
+ {"MINFO", 14},
+ {"MX", 15},
+ {"TXT", 16},
+ {"RP", 17},
+ {"AFSDB", 18},
+ {"SIG", 24},
+ {"KEY", 25},
+ {"AAAA", 28},
+ {"LOC", 29},
+ {"SRV", 33},
+ {"NAPTR", 35},
+ {"KX", 36},
+ {"CERT", 37},
+ {"A6", 38},
+ {"DNAME", 39},
+ {"OPT", 41},
+ {"APL", 42},
+ {"DS", 43},
+ {"SSHFP", 44},
+ {"IPSECKEY", 45},
+ {"RRSIG", 46},
+ {"NSEC", 47},
+ {"DNSKEY", 48},
+ {"DHCID", 49},
+ {"NSEC3", 50},
+ {"NSEC3PARAM", 51},
+ {"TLSA", 52},
+ {"SMIMEA", 53},
+ {"RKEY", 57},
+ {"CDS", 59},
+ {"CDNSKEY", 60},
+ {"OPENPGPKEY", 61},
+ {"CSYNC", 62},
+ {"SVCB", 64},
+ {"HTTPS", 65},
+ {"SPF", 99},
+ {"NID", 104},
+ {"L32", 105},
+ {"L64", 106},
+ {"LP", 107},
+ {"EUI48", 108},
+ {"EUI64", 109},
+ {"TKEY", 249},
+ // {"TSIG", 250},
+ {"IXFR", 251},
+ {"AXFR", 252},
+ {"MAILB", 253},
+ {"MAILA", 254},
+ {"ANY", 255},
+ {"URI", 256},
+ {"CAA", 257},
+ {"DLV", 32769},
+ {"ADDR", 65400},
+ {"ALIAS", 65401},
+ {"LUA", 65402},
+};
+
+static map<uint16_t, const string> swapElements(const map<const string, uint16_t>& names) {
+ map<uint16_t, const string> ret;
+
+ for (const auto& n : names) {
+ ret.emplace(n.second, n.first);
+ }
+ return ret;
+}
+
+const map<uint16_t, const string> QType::numbers = swapElements(names);
+
+
+bool QType::isSupportedType() const
+{
+ return numbers.count(code) == 1;
+}
+
+bool QType::isMetadataType() const
+{
+ if (code == QType::AXFR ||
+ code == QType::MAILA ||
+ code == QType::MAILB ||
+ code == QType::TSIG ||
+ code == QType::IXFR)
+ return true;
+
+ return false;
+}
+
+const string QType::toString() const
+{
+ const auto& name = numbers.find(code);
+ if (name != numbers.cend()) {
+ return name->second;
+ }
+ return "TYPE" + itoa(code);
+}
+
+uint16_t QType::chartocode(const char *p)
+{
+ string P = toUpper(p);
+
+ const auto& num = names.find(P);
+ if (num != names.cend()) {
+ return num->second;
+ }
+ if (*p == '#') {
+ return static_cast<uint16_t>(atoi(p + 1));
+ }
+
+ if (boost::starts_with(P, "TYPE")) {
+ return static_cast<uint16_t>(atoi(p + 4));
+ }
+
+ return 0;
+}
+
+QType &QType::operator=(const char *p)
+{
+ code = chartocode(p);
+ return *this;
+}
+
+QType &QType::operator=(const string &s)
+{
+ code = chartocode(s.c_str());
+ return *this;
+}
+
+const std::string QClass::toString() const
+{
+ switch (qclass) {
+ case IN:
+ return "IN";
+ case CHAOS:
+ return "CHAOS";
+ case NONE:
+ return "NONE";
+ case ANY:
+ return "ANY";
+ default :
+ return "CLASS" + std::to_string(qclass);
+ }
+}
diff --git a/qtype.hh b/qtype.hh
new file mode 100644
index 0000000..d76ccfc
--- /dev/null
+++ b/qtype.hh
@@ -0,0 +1,181 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "namespaces.hh"
+
+/** The QType class is meant to deal easily with the different kind of resource types, like 'A', 'NS',
+ * 'CNAME' etcetera. These types have both a name and a number. This class can seamlessly move between
+ * them. Use it like this:
+
+\code
+ QType t;
+ t="CNAME";
+ cout<<t.getCode()<<endl; // prints '5'
+ t=6;
+ cout<<t.toString()<<endl; // prints 'SOA'
+\endcode
+
+*/
+
+class QType
+{
+public:
+ QType(uint16_t qtype = 0) : code(qtype) {}
+ QType &operator=(const char *);
+ QType &operator=(const string &);
+
+ operator uint16_t() const {
+ return code;
+ }
+
+ const string toString() const;
+ uint16_t getCode() const
+ {
+ return code;
+ }
+
+ bool isSupportedType() const;
+ bool isMetadataType() const;
+
+ static uint16_t chartocode(const char* p);
+
+ enum typeenum : uint16_t {
+ ENT = 0,
+ A = 1,
+ NS = 2,
+ CNAME = 5,
+ SOA = 6,
+ MB = 7,
+ MG = 8,
+ MR = 9,
+ PTR = 12,
+ HINFO = 13,
+ MINFO = 14,
+ MX = 15,
+ TXT = 16,
+ RP = 17,
+ AFSDB = 18,
+ SIG = 24,
+ KEY = 25,
+ AAAA = 28,
+ LOC = 29,
+ SRV = 33,
+ NAPTR = 35,
+ KX = 36,
+ CERT = 37,
+ A6 = 38,
+ DNAME = 39,
+ OPT = 41,
+ APL = 42,
+ DS = 43,
+ SSHFP = 44,
+ IPSECKEY = 45,
+ RRSIG = 46,
+ NSEC = 47,
+ DNSKEY = 48,
+ DHCID = 49,
+ NSEC3 = 50,
+ NSEC3PARAM = 51,
+ TLSA = 52,
+ SMIMEA = 53,
+ RKEY = 57,
+ CDS = 59,
+ CDNSKEY = 60,
+ OPENPGPKEY = 61,
+ CSYNC = 62,
+ SVCB = 64,
+ HTTPS = 65,
+ SPF = 99,
+ NID = 104,
+ L32 = 105,
+ L64 = 106,
+ LP = 107,
+ EUI48 = 108,
+ EUI64 = 109,
+ TKEY = 249,
+ TSIG = 250,
+ IXFR = 251,
+ AXFR = 252,
+ MAILB = 253,
+ MAILA = 254,
+ ANY = 255,
+ URI = 256,
+ CAA = 257,
+ DLV = 32769,
+ ADDR = 65400,
+ ALIAS = 65401,
+ LUA = 65402
+ };
+
+ const static map<const string, uint16_t> names;
+ const static map<uint16_t, const string> numbers;
+
+private:
+
+ uint16_t code;
+};
+
+// Define hash function on QType. See https://en.cppreference.com/w/cpp/utility/hash
+namespace std {
+ template<> struct hash<QType> {
+ std::size_t operator()(QType qtype) const noexcept {
+ return std::hash<uint16_t>{}(qtype.getCode());
+ }
+ };
+}
+
+// Used by e.g. boost multi-index
+inline size_t hash_value(const QType qtype) {
+ return qtype.getCode();
+}
+
+struct QClass
+{
+ constexpr QClass(uint16_t code = 0) : qclass(code) {}
+
+ constexpr operator uint16_t() const {
+ return qclass;
+ }
+ constexpr uint16_t getCode() const
+ {
+ return qclass;
+ }
+ const std::string toString() const;
+
+ static const QClass IN;
+ static const QClass CHAOS;
+ static const QClass NONE;
+ static const QClass ANY;
+
+private:
+ uint16_t qclass;
+};
+
+constexpr QClass QClass::IN(1);
+constexpr QClass QClass::CHAOS(3);
+constexpr QClass QClass::NONE(254);
+constexpr QClass QClass::ANY(255);
+
+inline std::ostream& operator<<(std::ostream& s, QClass qclass)
+{
+ return s << qclass.toString();
+}
diff --git a/remote_logger.cc b/remote_logger.cc
new file mode 100644
index 0000000..96e5968
--- /dev/null
+++ b/remote_logger.cc
@@ -0,0 +1,237 @@
+#include <unistd.h>
+#include "threadname.hh"
+#include "remote_logger.hh"
+#include <sys/uio.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#ifdef PDNS_CONFIG_ARGS
+#include "logger.hh"
+#define WE_ARE_RECURSOR
+#else
+#include "dolog.hh"
+#endif
+
+bool CircularWriteBuffer::hasRoomFor(const std::string& str) const
+{
+ if (d_buffer.size() + 2 + str.size() > d_buffer.capacity()) {
+ return false;
+ }
+
+ return true;
+}
+
+bool CircularWriteBuffer::write(const std::string& str)
+{
+ if (str.size() > std::numeric_limits<uint16_t>::max() || !hasRoomFor(str)) {
+ return false;
+ }
+
+ uint16_t len = htons(str.size());
+ const char* ptr = reinterpret_cast<const char*>(&len);
+ d_buffer.insert(d_buffer.end(), ptr, ptr + 2);
+ d_buffer.insert(d_buffer.end(), str.begin(), str.end());
+
+ return true;
+}
+
+bool CircularWriteBuffer::flush(int fd)
+{
+ if (d_buffer.empty()) {
+ // not optional, we report EOF otherwise
+ return false;
+ }
+
+ auto arr1 = d_buffer.array_one();
+ auto arr2 = d_buffer.array_two();
+
+ struct iovec iov[2];
+ int pos = 0;
+ for(const auto& arr : {arr1, arr2}) {
+ if(arr.second) {
+ iov[pos].iov_base = arr.first;
+ iov[pos].iov_len = arr.second;
+ ++pos;
+ }
+ }
+
+ ssize_t res = 0;
+ do {
+ res = writev(fd, iov, pos);
+
+ if (res < 0) {
+ if (errno == EINTR) {
+ continue;
+ }
+
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
+ return false;
+ }
+
+ /* we can't be sure we haven't sent a partial message,
+ and we don't want to send the remaining part after reconnecting */
+ d_buffer.clear();
+ throw std::runtime_error("Couldn't flush a thing: " + stringerror());
+ }
+ else if (!res) {
+ /* we can't be sure we haven't sent a partial message,
+ and we don't want to send the remaining part after reconnecting */
+ d_buffer.clear();
+ throw std::runtime_error("EOF");
+ }
+ }
+ while (res < 0);
+
+ if (static_cast<size_t>(res) == d_buffer.size()) {
+ d_buffer.clear();
+ }
+ else {
+ while (res--) {
+ d_buffer.pop_front();
+ }
+ }
+
+ return true;
+}
+
+RemoteLogger::RemoteLogger(const ComboAddress& remote, uint16_t timeout, uint64_t maxQueuedBytes, uint8_t reconnectWaitTime, bool asyncConnect): d_remote(remote), d_timeout(timeout), d_reconnectWaitTime(reconnectWaitTime), d_asyncConnect(asyncConnect), d_runtime({CircularWriteBuffer(maxQueuedBytes), nullptr})
+{
+ if (!d_asyncConnect) {
+ reconnect();
+ }
+
+ d_thread = std::thread(&RemoteLogger::maintenanceThread, this);
+}
+
+bool RemoteLogger::reconnect()
+{
+ try {
+ auto newSock = make_unique<Socket>(d_remote.sin4.sin_family, SOCK_STREAM, 0);
+ newSock->setNonBlocking();
+ newSock->connect(d_remote, d_timeout);
+
+ {
+ /* we are now successfully connected, time to take the lock and update the
+ socket */
+ auto runtime = d_runtime.lock();
+ runtime->d_socket = std::move(newSock);
+ }
+ }
+ catch (const std::exception& e) {
+#ifdef WE_ARE_RECURSOR
+ g_log<<Logger::Warning<<"Error connecting to remote logger "<<d_remote.toStringWithPort()<<": "<<e.what()<<std::endl;
+#else
+ warnlog("Error connecting to remote logger %s: %s", d_remote.toStringWithPort(), e.what());
+#endif
+
+ return false;
+ }
+ return true;
+}
+
+void RemoteLogger::queueData(const std::string& data)
+{
+ if (data.size() > std::numeric_limits<uint16_t>::max()) {
+ throw std::runtime_error("Got a request to write an object of size " + std::to_string(data.size()));
+ }
+
+ auto runtime = d_runtime.lock();
+
+ if (!runtime->d_writer.hasRoomFor(data)) {
+ /* not connected, queue is full, just drop */
+ if (!runtime->d_socket) {
+ ++d_drops;
+ return;
+ }
+ try {
+ /* we try to flush some data */
+ if (!runtime->d_writer.flush(runtime->d_socket->getHandle())) {
+ /* but failed, let's just drop */
+ ++d_drops;
+ return;
+ }
+
+ /* see if we freed enough data */
+ if (!runtime->d_writer.hasRoomFor(data)) {
+ /* we didn't */
+ ++d_drops;
+ return;
+ }
+ }
+ catch(const std::exception& e) {
+ // cout << "Got exception writing: "<<e.what()<<endl;
+ ++d_drops;
+ runtime->d_socket.reset();
+ return;
+ }
+ }
+
+ runtime->d_writer.write(data);
+ ++d_processed;
+}
+
+void RemoteLogger::maintenanceThread()
+{
+ try {
+#ifdef WE_ARE_RECURSOR
+ string threadName = "pdns-r/remLog";
+#else
+ string threadName = "dnsdist/remLog";
+#endif
+ setThreadName(threadName);
+
+ for (;;) {
+ if (d_exiting) {
+ break;
+ }
+
+ bool connected = true;
+ if (d_runtime.lock()->d_socket == nullptr) {
+ // if it was unset, it will remain so, we are the only ones setting it!
+ connected = reconnect();
+ }
+
+ /* we will just go to sleep if the reconnection just failed */
+ if (connected) {
+ try {
+ /* we don't want to take the lock while trying to reconnect */
+ auto runtime = d_runtime.lock();
+ if (runtime->d_socket) { // check if it is set
+ /* if flush() returns false, it means that we couldn't flush anything yet
+ either because there is nothing to flush, or because the outgoing TCP
+ buffer is full. That's fine by us */
+ runtime->d_writer.flush(runtime->d_socket->getHandle());
+ }
+ else {
+ connected = false;
+ }
+ }
+ catch (const std::exception& e) {
+ d_runtime.lock()->d_socket.reset();
+ connected = false;
+ }
+
+ if (!connected) {
+ /* let's try to reconnect right away, we are about to sleep anyway */
+ reconnect();
+ }
+ }
+
+ sleep(d_reconnectWaitTime);
+ }
+ }
+ catch (const std::exception& e)
+ {
+ cerr << "Remote Logger's maintenance thead died on: " << e.what() << endl;
+ }
+ catch (...) {
+ cerr << "Remote Logger's maintenance thead died on unknown exception" << endl;
+ }
+}
+
+RemoteLogger::~RemoteLogger()
+{
+ d_exiting = true;
+
+ d_thread.join();
+}
diff --git a/remote_logger.hh b/remote_logger.hh
new file mode 100644
index 0000000..04db3b5
--- /dev/null
+++ b/remote_logger.hh
@@ -0,0 +1,120 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <atomic>
+#include <queue>
+#include <thread>
+
+#include "iputils.hh"
+#include "circular_buffer.hh"
+#include "lock.hh"
+#include "sstuff.hh"
+
+/* Writes can be submitted and they are atomically accepted. Either the whole write
+ ends up in the buffer or nothing ends up in the buffer.
+ In case nothing ends up in the buffer, an exception is thrown.
+ Similarly, EOF leads to this treatment
+
+ The filedescriptor can be in non-blocking mode.
+
+ This class is not threadsafe.
+*/
+
+class CircularWriteBuffer
+{
+public:
+ explicit CircularWriteBuffer(size_t size) : d_buffer(size)
+ {
+ }
+
+ bool hasRoomFor(const std::string& str) const;
+ bool write(const std::string& str);
+ bool flush(int fd);
+private:
+ boost::circular_buffer<char> d_buffer;
+};
+
+class RemoteLoggerInterface
+{
+public:
+ virtual ~RemoteLoggerInterface() {};
+ virtual void queueData(const std::string& data) = 0;
+ virtual std::string toString() const = 0;
+
+ bool logQueries(void) const { return d_logQueries; }
+ bool logResponses(void) const { return d_logResponses; }
+ void setLogQueries(bool flag) { d_logQueries = flag; }
+ void setLogResponses(bool flag) { d_logResponses = flag; }
+
+private:
+ bool d_logQueries{true};
+ bool d_logResponses{true};
+};
+
+/* Thread safe. Will connect asynchronously on request.
+ Runs a reconnection thread that also periodicall flushes.
+ Note that the buffer only runs as long as there is a connection.
+ If there is no connection we don't buffer a thing
+*/
+class RemoteLogger : public RemoteLoggerInterface
+{
+public:
+ RemoteLogger(const ComboAddress& remote, uint16_t timeout=2,
+ uint64_t maxQueuedBytes=100000,
+ uint8_t reconnectWaitTime=1,
+ bool asyncConnect=false);
+ ~RemoteLogger();
+ void queueData(const std::string& data) override;
+ std::string toString() const override
+ {
+ return d_remote.toStringWithPort() + " (" + std::to_string(d_processed) + " processed, " + std::to_string(d_drops) + " dropped)";
+ }
+ void stop()
+ {
+ d_exiting = true;
+ }
+
+private:
+ bool reconnect();
+ void maintenanceThread();
+
+ struct RuntimeData
+ {
+ CircularWriteBuffer d_writer;
+ std::unique_ptr<Socket> d_socket{nullptr};
+ };
+
+ ComboAddress d_remote;
+ std::atomic<uint64_t> d_drops{0};
+ std::atomic<uint64_t> d_processed{0};
+ uint16_t d_timeout;
+ uint8_t d_reconnectWaitTime;
+ std::atomic<bool> d_exiting{false};
+ bool d_asyncConnect{false};
+
+ LockGuarded<RuntimeData> d_runtime;
+ std::thread d_thread;
+};
diff --git a/sholder.hh b/sholder.hh
new file mode 100644
index 0000000..2a4f758
--- /dev/null
+++ b/sholder.hh
@@ -0,0 +1,145 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <memory>
+#include <atomic>
+
+#include "lock.hh"
+
+/** This is sort of a light-weight RCU idea.
+ Suitable for when you frequently consult some "readonly" state, which infrequently
+ gets changed. One way of dealing with this is fully locking access to the state, but
+ this is rather wasteful.
+
+ Instead, in the code below, the frequent users of the state get a "readonly" copy of it,
+ which they can consult. On access, we atomically compare if the local copy is still current
+ with the global one. If it isn't we do the lock thing, and create a new local copy.
+
+ Meanwhile, to upgrade the global state, methods are offered that do appropriate locking
+ and upgrade the 'generation' counter, signaling to the local copies that they need to be
+ refreshed on the next access.
+
+ Two ways to change the global copy are available:
+ getCopy(), which delivers a deep copy of the current state, followed by setState()
+ modify(), which accepts a (lambda)function that modifies the state
+
+ NOTE: The actual destruction of the 'old' state happens when the last local state
+ relinquishes its access to the state.
+
+ "read-only"
+ Sometimes, a 'state' can contain parts that can safely be modified by multiple users, for
+ example, atomic counters. In such cases, it may be useful to explicitly declare such counters
+ as mutable. */
+
+template<typename T> class GlobalStateHolder;
+
+template<typename T>
+class LocalStateHolder
+{
+public:
+ explicit LocalStateHolder(GlobalStateHolder<T>* source) : d_source(source)
+ {}
+
+ const T* operator->() // fast const-only access, but see "read-only" above
+ {
+ if(d_source->getGeneration() != d_generation) {
+ d_source->getState(&d_state, & d_generation);
+ }
+
+ return d_state.get();
+ }
+ const T& operator*() // fast const-only access, but see "read-only" above
+ {
+ return *operator->();
+ }
+
+ void reset()
+ {
+ d_generation=0;
+ d_state.reset();
+ }
+private:
+ std::shared_ptr<T> d_state;
+ unsigned int d_generation{0};
+ const GlobalStateHolder<T>* d_source;
+};
+
+template<typename T>
+class GlobalStateHolder
+{
+public:
+ GlobalStateHolder() : d_state(std::make_shared<T>())
+ {}
+ LocalStateHolder<T> getLocal()
+ {
+ return LocalStateHolder<T>(this);
+ }
+
+ void setState(const T& state) //!< Safely & slowly change the global state
+ {
+ std::shared_ptr<T> newState = std::make_shared<T>(state);
+ {
+ *(d_state.lock()) = std::move(newState);
+ d_generation++;
+ }
+ }
+
+ void setState(T&& state) //!< Safely & slowly change the global state
+ {
+ std::shared_ptr<T> newState = std::make_shared<T>(std::move(state));
+ {
+ *(d_state.lock()) = std::move(newState);
+ d_generation++;
+ }
+ }
+
+ T getCopy() const //!< Safely & slowly get a copy of the global state
+ {
+ return *(*(d_state.lock()));
+ }
+
+ //! Safely & slowly modify the global state
+ template<typename F>
+ void modify(F act) {
+ auto state = d_state.lock();
+ auto newState = *(*state); // and yes, these three steps are necessary, can't ever modify state in place, even when locked!
+ act(newState);
+ *state = std::make_shared<T>(std::move(newState));
+ ++d_generation;
+ }
+
+ typedef T value_type;
+private:
+ unsigned int getGeneration() const
+ {
+ return d_generation;
+ }
+ void getState(std::shared_ptr<T>* state, unsigned int* generation) const
+ {
+ *state = *d_state.lock();
+ *generation = d_generation;
+ }
+ friend class LocalStateHolder<T>;
+
+ mutable LockGuarded<std::shared_ptr<T>> d_state;
+ std::atomic<unsigned int> d_generation{1};
+};
diff --git a/snmp-agent.cc b/snmp-agent.cc
new file mode 100644
index 0000000..4b2bc6b
--- /dev/null
+++ b/snmp-agent.cc
@@ -0,0 +1,206 @@
+#include "snmp-agent.hh"
+#include "misc.hh"
+#include "threadname.hh"
+#ifdef RECURSOR
+#include "logger.hh"
+#else
+#include "dolog.hh"
+#endif
+
+#ifdef HAVE_NET_SNMP
+
+#ifndef HAVE_SNMP_SELECT_INFO2
+/* that's terrible, because it means we are going to have trouble with large
+ FD numbers at some point.. */
+# define netsnmp_large_fd_set fd_set
+# define snmp_read2 snmp_read
+# define snmp_select_info2 snmp_select_info
+# define netsnmp_large_fd_set_init(...)
+# define netsnmp_large_fd_set_cleanup(...)
+# define NETSNMP_LARGE_FD_SET FD_SET
+# define NETSNMP_LARGE_FD_CLR FD_CLR
+# define NETSNMP_LARGE_FD_ZERO FD_ZERO
+# define NETSNMP_LARGE_FD_ISSET FD_ISSET
+#else
+# include <net-snmp/library/large_fd_set.h>
+#endif
+
+const oid SNMPAgent::snmpTrapOID[] = { 1, 3, 6, 1, 6, 3, 1, 1, 4, 1, 0 };
+const size_t SNMPAgent::snmpTrapOIDLen = OID_LENGTH(SNMPAgent::snmpTrapOID);
+
+int SNMPAgent::setCounter64Value(netsnmp_request_info* request,
+ uint64_t value)
+{
+ struct counter64 val64;
+ val64.high = value >> 32;
+ val64.low = value & 0xffffffff;
+ snmp_set_var_typed_value(request->requestvb,
+ ASN_COUNTER64,
+ &val64,
+ sizeof(val64));
+ return SNMP_ERR_NOERROR;
+}
+
+bool SNMPAgent::sendTrap(int fd,
+ netsnmp_variable_list* varList)
+{
+ ssize_t written = write(fd, &varList, sizeof(varList));
+
+ if (written != sizeof(varList)) {
+ snmp_free_varbind(varList);
+ return false;
+ }
+ return true;
+}
+
+void SNMPAgent::handleTrapsEvent()
+{
+ netsnmp_variable_list* varList = nullptr;
+ ssize_t got = 0;
+
+ do {
+ got = read(d_trapPipe[0], &varList, sizeof(varList));
+
+ if (got == sizeof(varList)) {
+ send_v2trap(varList);
+ snmp_free_varbind(varList);
+ }
+ }
+ while (got > 0);
+}
+
+void SNMPAgent::handleSNMPQueryEvent(int fd)
+{
+ netsnmp_large_fd_set fdset;
+ netsnmp_large_fd_set_init(&fdset, FD_SETSIZE);
+ NETSNMP_LARGE_FD_ZERO(&fdset);
+ NETSNMP_LARGE_FD_SET(fd, &fdset);
+ snmp_read2(&fdset);
+}
+
+void SNMPAgent::handleTrapsCB(int fd, FDMultiplexer::funcparam_t& var)
+{
+ SNMPAgent** agent = boost::any_cast<SNMPAgent*>(&var);
+ if (!agent || !*agent)
+ throw std::runtime_error("Invalid value received in SNMP trap callback");
+
+ (*agent)->handleTrapsEvent();
+}
+
+void SNMPAgent::handleSNMPQueryCB(int fd, FDMultiplexer::funcparam_t& var)
+{
+ SNMPAgent** agent = boost::any_cast<SNMPAgent*>(&var);
+ if (!agent || !*agent)
+ throw std::runtime_error("Invalid value received in SNMP trap callback");
+
+ (*agent)->handleSNMPQueryEvent(fd);
+}
+
+#endif /* HAVE_NET_SNMP */
+
+void SNMPAgent::worker()
+{
+#ifdef HAVE_NET_SNMP
+ FDMultiplexer* mplexer = FDMultiplexer::getMultiplexerSilent();
+ if (mplexer == nullptr) {
+ throw std::runtime_error("No FD multiplexer found for the SNMP agent!");
+ }
+
+#ifdef RECURSOR
+ string threadName = "pdns-r/SNMP";
+#else
+ string threadName = "dnsdist/SNMP";
+#endif
+ setThreadName(threadName);
+
+ int maxfd = 0;
+ int block = 1;
+ netsnmp_large_fd_set fdset;
+ struct timeval timeout = { 0, 0 };
+ struct timeval now;
+
+ /* we want to be notified if a trap is waiting
+ to be sent */
+ mplexer->addReadFD(d_trapPipe[0], &handleTrapsCB, this);
+
+ while(true) {
+ netsnmp_large_fd_set_init(&fdset, FD_SETSIZE);
+ NETSNMP_LARGE_FD_ZERO(&fdset);
+
+ block = 1;
+ timeout = { 0, 0 };
+ snmp_select_info2(&maxfd, &fdset, &timeout, &block);
+
+ for (int fd = 0; fd < maxfd; fd++) {
+ if (NETSNMP_LARGE_FD_ISSET(fd, &fdset)) {
+ mplexer->addReadFD(fd, &handleSNMPQueryCB, this);
+ }
+ }
+
+ /* run updates now */
+ int res = mplexer->run(&now, (timeout.tv_sec * 1000) + (timeout.tv_usec / 1000));
+
+ /* we handle timeouts here, the rest has already been handled by callbacks */
+ if (res == 0) {
+ snmp_timeout();
+ run_alarms();
+ }
+
+ for (int fd = 0; fd < maxfd; fd++) {
+ if (NETSNMP_LARGE_FD_ISSET(fd, &fdset)) {
+ try {
+ mplexer->removeReadFD(fd);
+ }
+ catch(const FDMultiplexerException& e) {
+ /* we might get an exception when removing a closed file descriptor,
+ just ignore it */
+ }
+ }
+ }
+ }
+#endif /* HAVE_NET_SNMP */
+}
+
+SNMPAgent::SNMPAgent(const std::string& name, const std::string& daemonSocket)
+{
+#ifdef HAVE_NET_SNMP
+ netsnmp_enable_subagent();
+ snmp_disable_log();
+ if (!daemonSocket.empty()) {
+ netsnmp_ds_set_string(NETSNMP_DS_APPLICATION_ID,
+ NETSNMP_DS_AGENT_X_SOCKET,
+ daemonSocket.c_str());
+ }
+ /* no need to load any MIBS,
+ and it causes import errors if some modules are not present */
+ setenv("MIBS", "", 1);
+
+ init_agent(name.c_str());
+
+ /* we use select() so don't use SIGALARM to handle alarms.
+ Note that we need to handle alarms for automatic reconnection
+ to the daemon to work.
+ */
+ netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID,
+ NETSNMP_DS_LIB_ALARM_DONT_USE_SIG,
+ 1);
+
+ init_snmp(name.c_str());
+
+ if (pipe(d_trapPipe) < 0)
+ unixDie("Creating pipe");
+
+ if (!setNonBlocking(d_trapPipe[0])) {
+ close(d_trapPipe[0]);
+ close(d_trapPipe[1]);
+ unixDie("Setting pipe non-blocking");
+ }
+
+ if (!setNonBlocking(d_trapPipe[1])) {
+ close(d_trapPipe[0]);
+ close(d_trapPipe[1]);
+ unixDie("Setting pipe non-blocking");
+ }
+
+#endif /* HAVE_NET_SNMP */
+}
diff --git a/snmp-agent.hh b/snmp-agent.hh
new file mode 100644
index 0000000..e4ba134
--- /dev/null
+++ b/snmp-agent.hh
@@ -0,0 +1,64 @@
+#pragma once
+#include "config.h"
+
+#include <string>
+#include <thread>
+#include <unistd.h>
+
+#ifdef HAVE_NET_SNMP
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/definitions.h>
+#include <net-snmp/types.h>
+#include <net-snmp/utilities.h>
+#include <net-snmp/config_api.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#undef INET6 /* SRSLY? */
+#endif /* HAVE_NET_SNMP */
+
+#include "mplexer.hh"
+
+class SNMPAgent
+{
+public:
+ SNMPAgent(const std::string& name, const std::string& daemonSocket);
+ virtual ~SNMPAgent()
+ {
+#ifdef HAVE_NET_SNMP
+
+ close(d_trapPipe[0]);
+ close(d_trapPipe[1]);
+#endif /* HAVE_NET_SNMP */
+ }
+
+ void run()
+ {
+#ifdef HAVE_NET_SNMP
+ d_thread = std::thread(&SNMPAgent::worker, this);
+ d_thread.detach();
+#endif /* HAVE_NET_SNMP */
+ }
+
+#ifdef HAVE_NET_SNMP
+ static int setCounter64Value(netsnmp_request_info* request,
+ uint64_t value);
+#endif /* HAVE_NET_SNMP */
+protected:
+#ifdef HAVE_NET_SNMP
+ /* OID for snmpTrapOID.0 */
+ static const oid snmpTrapOID[];
+ static const size_t snmpTrapOIDLen;
+
+ static bool sendTrap(int fd,
+ netsnmp_variable_list* varList);
+
+ int d_trapPipe[2] = { -1, -1};
+#endif /* HAVE_NET_SNMP */
+private:
+ void worker();
+ static void handleTrapsCB(int fd, FDMultiplexer::funcparam_t& var);
+ static void handleSNMPQueryCB(int fd, FDMultiplexer::funcparam_t& var);
+ void handleTrapsEvent();
+ void handleSNMPQueryEvent(int fd);
+
+ std::thread d_thread;
+};
diff --git a/sodcrypto.cc b/sodcrypto.cc
new file mode 100644
index 0000000..b92c6e0
--- /dev/null
+++ b/sodcrypto.cc
@@ -0,0 +1,354 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include <iostream>
+#include "namespaces.hh"
+#include "noinitvector.hh"
+#include "misc.hh"
+#include "base64.hh"
+#include "sodcrypto.hh"
+
+
+#ifdef HAVE_LIBSODIUM
+
+string newKey()
+{
+ std::string key;
+ key.resize(crypto_secretbox_KEYBYTES);
+
+ randombytes_buf(reinterpret_cast<unsigned char*>(&key.at(0)), key.size());
+
+ return "\""+Base64Encode(key)+"\"";
+}
+
+bool sodIsValidKey(const std::string& key)
+{
+ return key.size() == crypto_secretbox_KEYBYTES;
+}
+
+std::string sodEncryptSym(const std::string& msg, const std::string& key, SodiumNonce& nonce)
+{
+ if (!sodIsValidKey(key)) {
+ throw std::runtime_error("Invalid encryption key of size " + std::to_string(key.size()) + ", use setKey() to set a valid key");
+ }
+
+ std::string ciphertext;
+ ciphertext.resize(msg.length() + crypto_secretbox_MACBYTES);
+ crypto_secretbox_easy(reinterpret_cast<unsigned char*>(&ciphertext.at(0)),
+ reinterpret_cast<const unsigned char*>(msg.c_str()),
+ msg.length(),
+ nonce.value,
+ reinterpret_cast<const unsigned char*>(key.c_str()));
+
+ nonce.increment();
+ return ciphertext;
+}
+
+std::string sodDecryptSym(const std::string& msg, const std::string& key, SodiumNonce& nonce)
+{
+ std::string decrypted;
+
+ if (msg.length() < crypto_secretbox_MACBYTES) {
+ throw std::runtime_error("Could not decrypt message of size " + std::to_string(msg.length()));
+ }
+
+ if (!sodIsValidKey(key)) {
+ throw std::runtime_error("Invalid decryption key of size " + std::to_string(key.size()) + ", use setKey() to set a valid key");
+ }
+
+ decrypted.resize(msg.length() - crypto_secretbox_MACBYTES);
+
+ if (crypto_secretbox_open_easy(reinterpret_cast<unsigned char*>(const_cast<char *>(decrypted.data())),
+ reinterpret_cast<const unsigned char*>(msg.c_str()),
+ msg.length(),
+ nonce.value,
+ reinterpret_cast<const unsigned char*>(key.c_str())) != 0) {
+ throw std::runtime_error("Could not decrypt message, please check that the key configured with setKey() is correct");
+ }
+
+ nonce.increment();
+ return decrypted;
+}
+#else
+std::string sodEncryptSym(const std::string& msg, const std::string& key, SodiumNonce& nonce)
+{
+ return msg;
+}
+std::string sodDecryptSym(const std::string& msg, const std::string& key, SodiumNonce& nonce)
+{
+ return msg;
+}
+
+string newKey()
+{
+ return "\"plaintext\"";
+}
+
+bool sodIsValidKey(const std::string& key)
+{
+ return true;
+}
+
+#endif
+
+
+#include "base64.hh"
+#include <inttypes.h>
+
+namespace anonpdns {
+static char B64Decode1(char cInChar)
+{
+ // The incoming character will be A-Z, a-z, 0-9, +, /, or =.
+ // The idea is to quickly determine which grouping the
+ // letter belongs to and return the associated value
+ // without having to search the global encoding string
+ // (the value we're looking for would be the resulting
+ // index into that string).
+ //
+ // To do that, we'll play some tricks...
+ unsigned char iIndex = '\0';
+ switch ( cInChar ) {
+ case '+':
+ iIndex = 62;
+ break;
+
+ case '/':
+ iIndex = 63;
+ break;
+
+ case '=':
+ iIndex = 0;
+ break;
+
+ default:
+ // Must be 'A'-'Z', 'a'-'z', '0'-'9', or an error...
+ //
+ // Numerically, small letters are "greater" in value than
+ // capital letters and numerals (ASCII value), and capital
+ // letters are "greater" than numerals (again, ASCII value),
+ // so we check for numerals first, then capital letters,
+ // and finally small letters.
+ iIndex = '9' - cInChar;
+ if ( iIndex > 0x3F ) {
+ // Not from '0' to '9'...
+ iIndex = 'Z' - cInChar;
+ if ( iIndex > 0x3F ) {
+ // Not from 'A' to 'Z'...
+ iIndex = 'z' - cInChar;
+ if ( iIndex > 0x3F ) {
+ // Invalid character...cannot
+ // decode!
+ iIndex = 0x80; // set the high bit
+ } // if
+ else {
+ // From 'a' to 'z'
+ iIndex = (('z' - iIndex) - 'a') + 26;
+ } // else
+ } // if
+ else {
+ // From 'A' to 'Z'
+ iIndex = ('Z' - iIndex) - 'A';
+ } // else
+ } // if
+ else {
+ // Adjust the index...
+ iIndex = (('9' - iIndex) - '0') + 52;
+ } // else
+ break;
+
+ } // switch
+
+ return iIndex;
+}
+
+static inline char B64Encode1(unsigned char uc)
+{
+ if (uc < 26)
+ {
+ return 'A'+uc;
+ }
+ if (uc < 52)
+ {
+ return 'a'+(uc-26);
+ }
+ if (uc < 62)
+ {
+ return '0'+(uc-52);
+ }
+ if (uc == 62)
+ {
+ return '+';
+ }
+ return '/';
+};
+
+
+
+}
+using namespace anonpdns;
+
+template<typename Container> int B64Decode(const std::string& strInput, Container& strOutput)
+{
+ // Set up a decoding buffer
+ long cBuf = 0;
+ char* pBuf = (char*)&cBuf;
+
+ // Decoding management...
+ int iBitGroup = 0, iInNum = 0;
+
+ // While there are characters to process...
+ //
+ // We'll decode characters in blocks of 4, as
+ // there are 4 groups of 6 bits in 3 bytes. The
+ // incoming Base64 character is first decoded, and
+ // then it is inserted into the decode buffer
+ // (with any relevant shifting, as required).
+ // Later, after all 3 bytes have been reconstituted,
+ // we assign them to the output string, ultimately
+ // to be returned as the original message.
+ int iInSize = strInput.size();
+ unsigned char cChar = '\0';
+ uint8_t pad = 0;
+ while ( iInNum < iInSize ) {
+ // Fill the decode buffer with 4 groups of 6 bits
+ cBuf = 0; // clear
+ pad = 0;
+ for ( iBitGroup = 0; iBitGroup < 4; ++iBitGroup ) {
+ if ( iInNum < iInSize ) {
+ // Decode a character
+ if(strInput.at(iInNum)=='=')
+ pad++;
+ while(isspace(strInput.at(iInNum)))
+ iInNum++;
+ cChar = B64Decode1(strInput.at(iInNum++));
+
+ } // if
+ else {
+ // Decode a padded zero
+ cChar = '\0';
+ } // else
+
+ // Check for valid decode
+ if ( cChar > 0x7F )
+ return -1;
+
+ // Adjust the bits
+ switch ( iBitGroup ) {
+ case 0:
+ // The first group is copied into
+ // the least significant 6 bits of
+ // the decode buffer...these 6 bits
+ // will eventually shift over to be
+ // the most significant bits of the
+ // third byte.
+ cBuf = cBuf | cChar;
+ break;
+
+ default:
+ // For groupings 1-3, simply shift
+ // the bits in the decode buffer over
+ // by 6 and insert the 6 from the
+ // current decode character.
+ cBuf = (cBuf << 6) | cChar;
+ break;
+
+ } // switch
+ } // for
+
+ // Interpret the resulting 3 bytes...note there
+ // may have been padding, so those padded bytes
+ // are actually ignored.
+#if BYTE_ORDER == BIG_ENDIAN
+ strOutput.push_back(pBuf[sizeof(long)-3]);
+ strOutput.push_back(pBuf[sizeof(long)-2]);
+ strOutput.push_back(pBuf[sizeof(long)-1]);
+#else
+ strOutput.push_back(pBuf[2]);
+ strOutput.push_back(pBuf[1]);
+ strOutput.push_back(pBuf[0]);
+#endif
+ } // while
+ if(pad)
+ strOutput.resize(strOutput.size()-pad);
+
+ return 1;
+}
+
+template int B64Decode<std::vector<uint8_t>>(const std::string& strInput, std::vector<uint8_t>& strOutput);
+template int B64Decode<PacketBuffer>(const std::string& strInput, PacketBuffer& strOutput);
+template int B64Decode<std::string>(const std::string& strInput, std::string& strOutput);
+
+/*
+www.kbcafe.com
+Copyright 2001-2002 Randy Charles Morin
+The Encode static method takes an array of 8-bit values and returns a base-64 stream.
+*/
+
+
+std::string Base64Encode (const std::string& vby)
+{
+ std::string retval;
+ if (vby.size () == 0)
+ {
+ return retval;
+ };
+ for (unsigned int i = 0; i < vby.size (); i += 3)
+ {
+ unsigned char by1 = 0, by2 = 0, by3 = 0;
+ by1 = vby[i];
+ if (i + 1 < vby.size ())
+ {
+ by2 = vby[i + 1];
+ };
+ if (i + 2 < vby.size ())
+ {
+ by3 = vby[i + 2];
+ }
+ unsigned char by4 = 0, by5 = 0, by6 = 0, by7 = 0;
+ by4 = by1 >> 2;
+ by5 = ((by1 & 0x3) << 4) | (by2 >> 4);
+ by6 = ((by2 & 0xf) << 2) | (by3 >> 6);
+ by7 = by3 & 0x3f;
+ retval += B64Encode1 (by4);
+ retval += B64Encode1 (by5);
+ if (i + 1 < vby.size ())
+ {
+ retval += B64Encode1 (by6);
+ }
+ else
+ {
+ retval += "=";
+ };
+ if (i + 2 < vby.size ())
+ {
+ retval += B64Encode1 (by7);
+ }
+ else
+ {
+ retval += "=";
+ };
+ /* if ((i % (76 / 4 * 3)) == 0)
+ {
+ retval += "\r\n";
+ }*/
+ };
+ return retval;
+};
diff --git a/sodcrypto.hh b/sodcrypto.hh
new file mode 100644
index 0000000..ca35631
--- /dev/null
+++ b/sodcrypto.hh
@@ -0,0 +1,78 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "config.h"
+#include <string>
+#include <stdint.h>
+
+#include <arpa/inet.h>
+
+#ifndef HAVE_LIBSODIUM
+struct SodiumNonce
+{
+ void init(){};
+ void merge(const SodiumNonce& lower, const SodiumNonce& higher) {};
+ void increment(){};
+ unsigned char value[1]{0};
+};
+#else
+#include <sodium.h>
+
+struct SodiumNonce
+{
+ SodiumNonce()
+ {
+ memset(&value, 0, sizeof(value));
+ }
+
+ void init()
+ {
+ randombytes_buf(value, sizeof value);
+ }
+
+ void merge(const SodiumNonce& lower, const SodiumNonce& higher)
+ {
+ static const size_t halfSize = (sizeof value) / 2;
+ memcpy(value, lower.value, halfSize);
+ memcpy(value + halfSize, higher.value + halfSize, halfSize);
+ }
+
+ void increment()
+ {
+ uint32_t* p = (uint32_t*)value;
+ uint32_t count=htonl(*p);
+ *p=ntohl(++count);
+ }
+
+ string toString() const
+ {
+ return string((const char*)value, crypto_secretbox_NONCEBYTES);
+ }
+
+ unsigned char value[crypto_secretbox_NONCEBYTES];
+};
+#endif
+std::string newKeypair();
+std::string sodEncryptSym(const std::string& msg, const std::string& key, SodiumNonce&);
+std::string sodDecryptSym(const std::string& msg, const std::string& key, SodiumNonce&);
+std::string newKey();
+bool sodIsValidKey(const std::string& key);
diff --git a/src_js/SOURCES b/src_js/SOURCES
new file mode 100644
index 0000000..de11d2d
--- /dev/null
+++ b/src_js/SOURCES
@@ -0,0 +1,4 @@
+http://code.jquery.com/jquery-1.12.0.js
+https://github.com/mbostock/d3/releases/download/v3.5.13/d3.zip
+https://github.com/shutterstock/rickshaw/archive/v1.5.1.tar.gz
+https://github.com/moment/moment/archive/2.11.1.tar.gz
diff --git a/src_js/d3.js b/src_js/d3.js
new file mode 100644
index 0000000..a7a616c
--- /dev/null
+++ b/src_js/d3.js
@@ -0,0 +1,9553 @@
+!function() {
+ var d3 = {
+ version: "3.5.13"
+ };
+ var d3_arraySlice = [].slice, d3_array = function(list) {
+ return d3_arraySlice.call(list);
+ };
+ var d3_document = this.document;
+ function d3_documentElement(node) {
+ return node && (node.ownerDocument || node.document || node).documentElement;
+ }
+ function d3_window(node) {
+ return node && (node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView);
+ }
+ if (d3_document) {
+ try {
+ d3_array(d3_document.documentElement.childNodes)[0].nodeType;
+ } catch (e) {
+ d3_array = function(list) {
+ var i = list.length, array = new Array(i);
+ while (i--) array[i] = list[i];
+ return array;
+ };
+ }
+ }
+ if (!Date.now) Date.now = function() {
+ return +new Date();
+ };
+ if (d3_document) {
+ try {
+ d3_document.createElement("DIV").style.setProperty("opacity", 0, "");
+ } catch (error) {
+ var d3_element_prototype = this.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = this.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;
+ d3_element_prototype.setAttribute = function(name, value) {
+ d3_element_setAttribute.call(this, name, value + "");
+ };
+ d3_element_prototype.setAttributeNS = function(space, local, value) {
+ d3_element_setAttributeNS.call(this, space, local, value + "");
+ };
+ d3_style_prototype.setProperty = function(name, value, priority) {
+ d3_style_setProperty.call(this, name, value + "", priority);
+ };
+ }
+ }
+ d3.ascending = d3_ascending;
+ function d3_ascending(a, b) {
+ return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
+ }
+ d3.descending = function(a, b) {
+ return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
+ };
+ d3.min = function(array, f) {
+ var i = -1, n = array.length, a, b;
+ if (arguments.length === 1) {
+ while (++i < n) if ((b = array[i]) != null && b >= b) {
+ a = b;
+ break;
+ }
+ while (++i < n) if ((b = array[i]) != null && a > b) a = b;
+ } else {
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
+ a = b;
+ break;
+ }
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
+ }
+ return a;
+ };
+ d3.max = function(array, f) {
+ var i = -1, n = array.length, a, b;
+ if (arguments.length === 1) {
+ while (++i < n) if ((b = array[i]) != null && b >= b) {
+ a = b;
+ break;
+ }
+ while (++i < n) if ((b = array[i]) != null && b > a) a = b;
+ } else {
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
+ a = b;
+ break;
+ }
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
+ }
+ return a;
+ };
+ d3.extent = function(array, f) {
+ var i = -1, n = array.length, a, b, c;
+ if (arguments.length === 1) {
+ while (++i < n) if ((b = array[i]) != null && b >= b) {
+ a = c = b;
+ break;
+ }
+ while (++i < n) if ((b = array[i]) != null) {
+ if (a > b) a = b;
+ if (c < b) c = b;
+ }
+ } else {
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
+ a = c = b;
+ break;
+ }
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
+ if (a > b) a = b;
+ if (c < b) c = b;
+ }
+ }
+ return [ a, c ];
+ };
+ function d3_number(x) {
+ return x === null ? NaN : +x;
+ }
+ function d3_numeric(x) {
+ return !isNaN(x);
+ }
+ d3.sum = function(array, f) {
+ var s = 0, n = array.length, a, i = -1;
+ if (arguments.length === 1) {
+ while (++i < n) if (d3_numeric(a = +array[i])) s += a;
+ } else {
+ while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a;
+ }
+ return s;
+ };
+ d3.mean = function(array, f) {
+ var s = 0, n = array.length, a, i = -1, j = n;
+ if (arguments.length === 1) {
+ while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j;
+ } else {
+ while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j;
+ }
+ if (j) return s / j;
+ };
+ d3.quantile = function(values, p) {
+ var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;
+ return e ? v + e * (values[h] - v) : v;
+ };
+ d3.median = function(array, f) {
+ var numbers = [], n = array.length, a, i = -1;
+ if (arguments.length === 1) {
+ while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a);
+ } else {
+ while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a);
+ }
+ if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), .5);
+ };
+ d3.variance = function(array, f) {
+ var n = array.length, m = 0, a, d, s = 0, i = -1, j = 0;
+ if (arguments.length === 1) {
+ while (++i < n) {
+ if (d3_numeric(a = d3_number(array[i]))) {
+ d = a - m;
+ m += d / ++j;
+ s += d * (a - m);
+ }
+ }
+ } else {
+ while (++i < n) {
+ if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) {
+ d = a - m;
+ m += d / ++j;
+ s += d * (a - m);
+ }
+ }
+ }
+ if (j > 1) return s / (j - 1);
+ };
+ d3.deviation = function() {
+ var v = d3.variance.apply(this, arguments);
+ return v ? Math.sqrt(v) : v;
+ };
+ function d3_bisector(compare) {
+ return {
+ left: function(a, x, lo, hi) {
+ if (arguments.length < 3) lo = 0;
+ if (arguments.length < 4) hi = a.length;
+ while (lo < hi) {
+ var mid = lo + hi >>> 1;
+ if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid;
+ }
+ return lo;
+ },
+ right: function(a, x, lo, hi) {
+ if (arguments.length < 3) lo = 0;
+ if (arguments.length < 4) hi = a.length;
+ while (lo < hi) {
+ var mid = lo + hi >>> 1;
+ if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1;
+ }
+ return lo;
+ }
+ };
+ }
+ var d3_bisect = d3_bisector(d3_ascending);
+ d3.bisectLeft = d3_bisect.left;
+ d3.bisect = d3.bisectRight = d3_bisect.right;
+ d3.bisector = function(f) {
+ return d3_bisector(f.length === 1 ? function(d, x) {
+ return d3_ascending(f(d), x);
+ } : f);
+ };
+ d3.shuffle = function(array, i0, i1) {
+ if ((m = arguments.length) < 3) {
+ i1 = array.length;
+ if (m < 2) i0 = 0;
+ }
+ var m = i1 - i0, t, i;
+ while (m) {
+ i = Math.random() * m-- | 0;
+ t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t;
+ }
+ return array;
+ };
+ d3.permute = function(array, indexes) {
+ var i = indexes.length, permutes = new Array(i);
+ while (i--) permutes[i] = array[indexes[i]];
+ return permutes;
+ };
+ d3.pairs = function(array) {
+ var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);
+ while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];
+ return pairs;
+ };
+ d3.zip = function() {
+ if (!(n = arguments.length)) return [];
+ for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) {
+ for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) {
+ zip[j] = arguments[j][i];
+ }
+ }
+ return zips;
+ };
+ function d3_zipLength(d) {
+ return d.length;
+ }
+ d3.transpose = function(matrix) {
+ return d3.zip.apply(d3, matrix);
+ };
+ d3.keys = function(map) {
+ var keys = [];
+ for (var key in map) keys.push(key);
+ return keys;
+ };
+ d3.values = function(map) {
+ var values = [];
+ for (var key in map) values.push(map[key]);
+ return values;
+ };
+ d3.entries = function(map) {
+ var entries = [];
+ for (var key in map) entries.push({
+ key: key,
+ value: map[key]
+ });
+ return entries;
+ };
+ d3.merge = function(arrays) {
+ var n = arrays.length, m, i = -1, j = 0, merged, array;
+ while (++i < n) j += arrays[i].length;
+ merged = new Array(j);
+ while (--n >= 0) {
+ array = arrays[n];
+ m = array.length;
+ while (--m >= 0) {
+ merged[--j] = array[m];
+ }
+ }
+ return merged;
+ };
+ var abs = Math.abs;
+ d3.range = function(start, stop, step) {
+ if (arguments.length < 3) {
+ step = 1;
+ if (arguments.length < 2) {
+ stop = start;
+ start = 0;
+ }
+ }
+ if ((stop - start) / step === Infinity) throw new Error("infinite range");
+ var range = [], k = d3_range_integerScale(abs(step)), i = -1, j;
+ start *= k, stop *= k, step *= k;
+ if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k);
+ return range;
+ };
+ function d3_range_integerScale(x) {
+ var k = 1;
+ while (x * k % 1) k *= 10;
+ return k;
+ }
+ function d3_class(ctor, properties) {
+ for (var key in properties) {
+ Object.defineProperty(ctor.prototype, key, {
+ value: properties[key],
+ enumerable: false
+ });
+ }
+ }
+ d3.map = function(object, f) {
+ var map = new d3_Map();
+ if (object instanceof d3_Map) {
+ object.forEach(function(key, value) {
+ map.set(key, value);
+ });
+ } else if (Array.isArray(object)) {
+ var i = -1, n = object.length, o;
+ if (arguments.length === 1) while (++i < n) map.set(i, object[i]); else while (++i < n) map.set(f.call(object, o = object[i], i), o);
+ } else {
+ for (var key in object) map.set(key, object[key]);
+ }
+ return map;
+ };
+ function d3_Map() {
+ this._ = Object.create(null);
+ }
+ var d3_map_proto = "__proto__", d3_map_zero = "\x00";
+ d3_class(d3_Map, {
+ has: d3_map_has,
+ get: function(key) {
+ return this._[d3_map_escape(key)];
+ },
+ set: function(key, value) {
+ return this._[d3_map_escape(key)] = value;
+ },
+ remove: d3_map_remove,
+ keys: d3_map_keys,
+ values: function() {
+ var values = [];
+ for (var key in this._) values.push(this._[key]);
+ return values;
+ },
+ entries: function() {
+ var entries = [];
+ for (var key in this._) entries.push({
+ key: d3_map_unescape(key),
+ value: this._[key]
+ });
+ return entries;
+ },
+ size: d3_map_size,
+ empty: d3_map_empty,
+ forEach: function(f) {
+ for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]);
+ }
+ });
+ function d3_map_escape(key) {
+ return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key;
+ }
+ function d3_map_unescape(key) {
+ return (key += "")[0] === d3_map_zero ? key.slice(1) : key;
+ }
+ function d3_map_has(key) {
+ return d3_map_escape(key) in this._;
+ }
+ function d3_map_remove(key) {
+ return (key = d3_map_escape(key)) in this._ && delete this._[key];
+ }
+ function d3_map_keys() {
+ var keys = [];
+ for (var key in this._) keys.push(d3_map_unescape(key));
+ return keys;
+ }
+ function d3_map_size() {
+ var size = 0;
+ for (var key in this._) ++size;
+ return size;
+ }
+ function d3_map_empty() {
+ for (var key in this._) return false;
+ return true;
+ }
+ d3.nest = function() {
+ var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
+ function map(mapType, array, depth) {
+ if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
+ var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
+ while (++i < n) {
+ if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
+ values.push(object);
+ } else {
+ valuesByKey.set(keyValue, [ object ]);
+ }
+ }
+ if (mapType) {
+ object = mapType();
+ setter = function(keyValue, values) {
+ object.set(keyValue, map(mapType, values, depth));
+ };
+ } else {
+ object = {};
+ setter = function(keyValue, values) {
+ object[keyValue] = map(mapType, values, depth);
+ };
+ }
+ valuesByKey.forEach(setter);
+ return object;
+ }
+ function entries(map, depth) {
+ if (depth >= keys.length) return map;
+ var array = [], sortKey = sortKeys[depth++];
+ map.forEach(function(key, keyMap) {
+ array.push({
+ key: key,
+ values: entries(keyMap, depth)
+ });
+ });
+ return sortKey ? array.sort(function(a, b) {
+ return sortKey(a.key, b.key);
+ }) : array;
+ }
+ nest.map = function(array, mapType) {
+ return map(mapType, array, 0);
+ };
+ nest.entries = function(array) {
+ return entries(map(d3.map, array, 0), 0);
+ };
+ nest.key = function(d) {
+ keys.push(d);
+ return nest;
+ };
+ nest.sortKeys = function(order) {
+ sortKeys[keys.length - 1] = order;
+ return nest;
+ };
+ nest.sortValues = function(order) {
+ sortValues = order;
+ return nest;
+ };
+ nest.rollup = function(f) {
+ rollup = f;
+ return nest;
+ };
+ return nest;
+ };
+ d3.set = function(array) {
+ var set = new d3_Set();
+ if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);
+ return set;
+ };
+ function d3_Set() {
+ this._ = Object.create(null);
+ }
+ d3_class(d3_Set, {
+ has: d3_map_has,
+ add: function(key) {
+ this._[d3_map_escape(key += "")] = true;
+ return key;
+ },
+ remove: d3_map_remove,
+ values: d3_map_keys,
+ size: d3_map_size,
+ empty: d3_map_empty,
+ forEach: function(f) {
+ for (var key in this._) f.call(this, d3_map_unescape(key));
+ }
+ });
+ d3.behavior = {};
+ function d3_identity(d) {
+ return d;
+ }
+ d3.rebind = function(target, source) {
+ var i = 1, n = arguments.length, method;
+ while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
+ return target;
+ };
+ function d3_rebind(target, source, method) {
+ return function() {
+ var value = method.apply(source, arguments);
+ return value === source ? target : value;
+ };
+ }
+ function d3_vendorSymbol(object, name) {
+ if (name in object) return name;
+ name = name.charAt(0).toUpperCase() + name.slice(1);
+ for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) {
+ var prefixName = d3_vendorPrefixes[i] + name;
+ if (prefixName in object) return prefixName;
+ }
+ }
+ var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ];
+ function d3_noop() {}
+ d3.dispatch = function() {
+ var dispatch = new d3_dispatch(), i = -1, n = arguments.length;
+ while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
+ return dispatch;
+ };
+ function d3_dispatch() {}
+ d3_dispatch.prototype.on = function(type, listener) {
+ var i = type.indexOf("."), name = "";
+ if (i >= 0) {
+ name = type.slice(i + 1);
+ type = type.slice(0, i);
+ }
+ if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener);
+ if (arguments.length === 2) {
+ if (listener == null) for (type in this) {
+ if (this.hasOwnProperty(type)) this[type].on(name, null);
+ }
+ return this;
+ }
+ };
+ function d3_dispatch_event(dispatch) {
+ var listeners = [], listenerByName = new d3_Map();
+ function event() {
+ var z = listeners, i = -1, n = z.length, l;
+ while (++i < n) if (l = z[i].on) l.apply(this, arguments);
+ return dispatch;
+ }
+ event.on = function(name, listener) {
+ var l = listenerByName.get(name), i;
+ if (arguments.length < 2) return l && l.on;
+ if (l) {
+ l.on = null;
+ listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));
+ listenerByName.remove(name);
+ }
+ if (listener) listeners.push(listenerByName.set(name, {
+ on: listener
+ }));
+ return dispatch;
+ };
+ return event;
+ }
+ d3.event = null;
+ function d3_eventPreventDefault() {
+ d3.event.preventDefault();
+ }
+ function d3_eventSource() {
+ var e = d3.event, s;
+ while (s = e.sourceEvent) e = s;
+ return e;
+ }
+ function d3_eventDispatch(target) {
+ var dispatch = new d3_dispatch(), i = 0, n = arguments.length;
+ while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
+ dispatch.of = function(thiz, argumentz) {
+ return function(e1) {
+ try {
+ var e0 = e1.sourceEvent = d3.event;
+ e1.target = target;
+ d3.event = e1;
+ dispatch[e1.type].apply(thiz, argumentz);
+ } finally {
+ d3.event = e0;
+ }
+ };
+ };
+ return dispatch;
+ }
+ d3.requote = function(s) {
+ return s.replace(d3_requote_re, "\\$&");
+ };
+ var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
+ var d3_subclass = {}.__proto__ ? function(object, prototype) {
+ object.__proto__ = prototype;
+ } : function(object, prototype) {
+ for (var property in prototype) object[property] = prototype[property];
+ };
+ function d3_selection(groups) {
+ d3_subclass(groups, d3_selectionPrototype);
+ return groups;
+ }
+ var d3_select = function(s, n) {
+ return n.querySelector(s);
+ }, d3_selectAll = function(s, n) {
+ return n.querySelectorAll(s);
+ }, d3_selectMatches = function(n, s) {
+ var d3_selectMatcher = n.matches || n[d3_vendorSymbol(n, "matchesSelector")];
+ d3_selectMatches = function(n, s) {
+ return d3_selectMatcher.call(n, s);
+ };
+ return d3_selectMatches(n, s);
+ };
+ if (typeof Sizzle === "function") {
+ d3_select = function(s, n) {
+ return Sizzle(s, n)[0] || null;
+ };
+ d3_selectAll = Sizzle;
+ d3_selectMatches = Sizzle.matchesSelector;
+ }
+ d3.selection = function() {
+ return d3.select(d3_document.documentElement);
+ };
+ var d3_selectionPrototype = d3.selection.prototype = [];
+ d3_selectionPrototype.select = function(selector) {
+ var subgroups = [], subgroup, subnode, group, node;
+ selector = d3_selection_selector(selector);
+ for (var j = -1, m = this.length; ++j < m; ) {
+ subgroups.push(subgroup = []);
+ subgroup.parentNode = (group = this[j]).parentNode;
+ for (var i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) {
+ subgroup.push(subnode = selector.call(node, node.__data__, i, j));
+ if (subnode && "__data__" in node) subnode.__data__ = node.__data__;
+ } else {
+ subgroup.push(null);
+ }
+ }
+ }
+ return d3_selection(subgroups);
+ };
+ function d3_selection_selector(selector) {
+ return typeof selector === "function" ? selector : function() {
+ return d3_select(selector, this);
+ };
+ }
+ d3_selectionPrototype.selectAll = function(selector) {
+ var subgroups = [], subgroup, node;
+ selector = d3_selection_selectorAll(selector);
+ for (var j = -1, m = this.length; ++j < m; ) {
+ for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) {
+ subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));
+ subgroup.parentNode = node;
+ }
+ }
+ }
+ return d3_selection(subgroups);
+ };
+ function d3_selection_selectorAll(selector) {
+ return typeof selector === "function" ? selector : function() {
+ return d3_selectAll(selector, this);
+ };
+ }
+ var d3_nsPrefix = {
+ svg: "http://www.w3.org/2000/svg",
+ xhtml: "http://www.w3.org/1999/xhtml",
+ xlink: "http://www.w3.org/1999/xlink",
+ xml: "http://www.w3.org/XML/1998/namespace",
+ xmlns: "http://www.w3.org/2000/xmlns/"
+ };
+ d3.ns = {
+ prefix: d3_nsPrefix,
+ qualify: function(name) {
+ var i = name.indexOf(":"), prefix = name;
+ if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
+ return d3_nsPrefix.hasOwnProperty(prefix) ? {
+ space: d3_nsPrefix[prefix],
+ local: name
+ } : name;
+ }
+ };
+ d3_selectionPrototype.attr = function(name, value) {
+ if (arguments.length < 2) {
+ if (typeof name === "string") {
+ var node = this.node();
+ name = d3.ns.qualify(name);
+ return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name);
+ }
+ for (value in name) this.each(d3_selection_attr(value, name[value]));
+ return this;
+ }
+ return this.each(d3_selection_attr(name, value));
+ };
+ function d3_selection_attr(name, value) {
+ name = d3.ns.qualify(name);
+ function attrNull() {
+ this.removeAttribute(name);
+ }
+ function attrNullNS() {
+ this.removeAttributeNS(name.space, name.local);
+ }
+ function attrConstant() {
+ this.setAttribute(name, value);
+ }
+ function attrConstantNS() {
+ this.setAttributeNS(name.space, name.local, value);
+ }
+ function attrFunction() {
+ var x = value.apply(this, arguments);
+ if (x == null) this.removeAttribute(name); else this.setAttribute(name, x);
+ }
+ function attrFunctionNS() {
+ var x = value.apply(this, arguments);
+ if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x);
+ }
+ return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant;
+ }
+ function d3_collapse(s) {
+ return s.trim().replace(/\s+/g, " ");
+ }
+ d3_selectionPrototype.classed = function(name, value) {
+ if (arguments.length < 2) {
+ if (typeof name === "string") {
+ var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1;
+ if (value = node.classList) {
+ while (++i < n) if (!value.contains(name[i])) return false;
+ } else {
+ value = node.getAttribute("class");
+ while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false;
+ }
+ return true;
+ }
+ for (value in name) this.each(d3_selection_classed(value, name[value]));
+ return this;
+ }
+ return this.each(d3_selection_classed(name, value));
+ };
+ function d3_selection_classedRe(name) {
+ return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g");
+ }
+ function d3_selection_classes(name) {
+ return (name + "").trim().split(/^|\s+/);
+ }
+ function d3_selection_classed(name, value) {
+ name = d3_selection_classes(name).map(d3_selection_classedName);
+ var n = name.length;
+ function classedConstant() {
+ var i = -1;
+ while (++i < n) name[i](this, value);
+ }
+ function classedFunction() {
+ var i = -1, x = value.apply(this, arguments);
+ while (++i < n) name[i](this, x);
+ }
+ return typeof value === "function" ? classedFunction : classedConstant;
+ }
+ function d3_selection_classedName(name) {
+ var re = d3_selection_classedRe(name);
+ return function(node, value) {
+ if (c = node.classList) return value ? c.add(name) : c.remove(name);
+ var c = node.getAttribute("class") || "";
+ if (value) {
+ re.lastIndex = 0;
+ if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name));
+ } else {
+ node.setAttribute("class", d3_collapse(c.replace(re, " ")));
+ }
+ };
+ }
+ d3_selectionPrototype.style = function(name, value, priority) {
+ var n = arguments.length;
+ if (n < 3) {
+ if (typeof name !== "string") {
+ if (n < 2) value = "";
+ for (priority in name) this.each(d3_selection_style(priority, name[priority], value));
+ return this;
+ }
+ if (n < 2) {
+ var node = this.node();
+ return d3_window(node).getComputedStyle(node, null).getPropertyValue(name);
+ }
+ priority = "";
+ }
+ return this.each(d3_selection_style(name, value, priority));
+ };
+ function d3_selection_style(name, value, priority) {
+ function styleNull() {
+ this.style.removeProperty(name);
+ }
+ function styleConstant() {
+ this.style.setProperty(name, value, priority);
+ }
+ function styleFunction() {
+ var x = value.apply(this, arguments);
+ if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority);
+ }
+ return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant;
+ }
+ d3_selectionPrototype.property = function(name, value) {
+ if (arguments.length < 2) {
+ if (typeof name === "string") return this.node()[name];
+ for (value in name) this.each(d3_selection_property(value, name[value]));
+ return this;
+ }
+ return this.each(d3_selection_property(name, value));
+ };
+ function d3_selection_property(name, value) {
+ function propertyNull() {
+ delete this[name];
+ }
+ function propertyConstant() {
+ this[name] = value;
+ }
+ function propertyFunction() {
+ var x = value.apply(this, arguments);
+ if (x == null) delete this[name]; else this[name] = x;
+ }
+ return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant;
+ }
+ d3_selectionPrototype.text = function(value) {
+ return arguments.length ? this.each(typeof value === "function" ? function() {
+ var v = value.apply(this, arguments);
+ this.textContent = v == null ? "" : v;
+ } : value == null ? function() {
+ this.textContent = "";
+ } : function() {
+ this.textContent = value;
+ }) : this.node().textContent;
+ };
+ d3_selectionPrototype.html = function(value) {
+ return arguments.length ? this.each(typeof value === "function" ? function() {
+ var v = value.apply(this, arguments);
+ this.innerHTML = v == null ? "" : v;
+ } : value == null ? function() {
+ this.innerHTML = "";
+ } : function() {
+ this.innerHTML = value;
+ }) : this.node().innerHTML;
+ };
+ d3_selectionPrototype.append = function(name) {
+ name = d3_selection_creator(name);
+ return this.select(function() {
+ return this.appendChild(name.apply(this, arguments));
+ });
+ };
+ function d3_selection_creator(name) {
+ function create() {
+ var document = this.ownerDocument, namespace = this.namespaceURI;
+ return namespace ? document.createElementNS(namespace, name) : document.createElement(name);
+ }
+ function createNS() {
+ return this.ownerDocument.createElementNS(name.space, name.local);
+ }
+ return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? createNS : create;
+ }
+ d3_selectionPrototype.insert = function(name, before) {
+ name = d3_selection_creator(name);
+ before = d3_selection_selector(before);
+ return this.select(function() {
+ return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null);
+ });
+ };
+ d3_selectionPrototype.remove = function() {
+ return this.each(d3_selectionRemove);
+ };
+ function d3_selectionRemove() {
+ var parent = this.parentNode;
+ if (parent) parent.removeChild(this);
+ }
+ d3_selectionPrototype.data = function(value, key) {
+ var i = -1, n = this.length, group, node;
+ if (!arguments.length) {
+ value = new Array(n = (group = this[0]).length);
+ while (++i < n) {
+ if (node = group[i]) {
+ value[i] = node.__data__;
+ }
+ }
+ return value;
+ }
+ function bind(group, groupData) {
+ var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;
+ if (key) {
+ var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue;
+ for (i = -1; ++i < n; ) {
+ if (node = group[i]) {
+ if (nodeByKeyValue.has(keyValue = key.call(node, node.__data__, i))) {
+ exitNodes[i] = node;
+ } else {
+ nodeByKeyValue.set(keyValue, node);
+ }
+ keyValues[i] = keyValue;
+ }
+ }
+ for (i = -1; ++i < m; ) {
+ if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) {
+ enterNodes[i] = d3_selection_dataNode(nodeData);
+ } else if (node !== true) {
+ updateNodes[i] = node;
+ node.__data__ = nodeData;
+ }
+ nodeByKeyValue.set(keyValue, true);
+ }
+ for (i = -1; ++i < n; ) {
+ if (i in keyValues && nodeByKeyValue.get(keyValues[i]) !== true) {
+ exitNodes[i] = group[i];
+ }
+ }
+ } else {
+ for (i = -1; ++i < n0; ) {
+ node = group[i];
+ nodeData = groupData[i];
+ if (node) {
+ node.__data__ = nodeData;
+ updateNodes[i] = node;
+ } else {
+ enterNodes[i] = d3_selection_dataNode(nodeData);
+ }
+ }
+ for (;i < m; ++i) {
+ enterNodes[i] = d3_selection_dataNode(groupData[i]);
+ }
+ for (;i < n; ++i) {
+ exitNodes[i] = group[i];
+ }
+ }
+ enterNodes.update = updateNodes;
+ enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode;
+ enter.push(enterNodes);
+ update.push(updateNodes);
+ exit.push(exitNodes);
+ }
+ var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]);
+ if (typeof value === "function") {
+ while (++i < n) {
+ bind(group = this[i], value.call(group, group.parentNode.__data__, i));
+ }
+ } else {
+ while (++i < n) {
+ bind(group = this[i], value);
+ }
+ }
+ update.enter = function() {
+ return enter;
+ };
+ update.exit = function() {
+ return exit;
+ };
+ return update;
+ };
+ function d3_selection_dataNode(data) {
+ return {
+ __data__: data
+ };
+ }
+ d3_selectionPrototype.datum = function(value) {
+ return arguments.length ? this.property("__data__", value) : this.property("__data__");
+ };
+ d3_selectionPrototype.filter = function(filter) {
+ var subgroups = [], subgroup, group, node;
+ if (typeof filter !== "function") filter = d3_selection_filter(filter);
+ for (var j = 0, m = this.length; j < m; j++) {
+ subgroups.push(subgroup = []);
+ subgroup.parentNode = (group = this[j]).parentNode;
+ for (var i = 0, n = group.length; i < n; i++) {
+ if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
+ subgroup.push(node);
+ }
+ }
+ }
+ return d3_selection(subgroups);
+ };
+ function d3_selection_filter(selector) {
+ return function() {
+ return d3_selectMatches(this, selector);
+ };
+ }
+ d3_selectionPrototype.order = function() {
+ for (var j = -1, m = this.length; ++j < m; ) {
+ for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
+ if (node = group[i]) {
+ if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
+ next = node;
+ }
+ }
+ }
+ return this;
+ };
+ d3_selectionPrototype.sort = function(comparator) {
+ comparator = d3_selection_sortComparator.apply(this, arguments);
+ for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator);
+ return this.order();
+ };
+ function d3_selection_sortComparator(comparator) {
+ if (!arguments.length) comparator = d3_ascending;
+ return function(a, b) {
+ return a && b ? comparator(a.__data__, b.__data__) : !a - !b;
+ };
+ }
+ d3_selectionPrototype.each = function(callback) {
+ return d3_selection_each(this, function(node, i, j) {
+ callback.call(node, node.__data__, i, j);
+ });
+ };
+ function d3_selection_each(groups, callback) {
+ for (var j = 0, m = groups.length; j < m; j++) {
+ for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) {
+ if (node = group[i]) callback(node, i, j);
+ }
+ }
+ return groups;
+ }
+ d3_selectionPrototype.call = function(callback) {
+ var args = d3_array(arguments);
+ callback.apply(args[0] = this, args);
+ return this;
+ };
+ d3_selectionPrototype.empty = function() {
+ return !this.node();
+ };
+ d3_selectionPrototype.node = function() {
+ for (var j = 0, m = this.length; j < m; j++) {
+ for (var group = this[j], i = 0, n = group.length; i < n; i++) {
+ var node = group[i];
+ if (node) return node;
+ }
+ }
+ return null;
+ };
+ d3_selectionPrototype.size = function() {
+ var n = 0;
+ d3_selection_each(this, function() {
+ ++n;
+ });
+ return n;
+ };
+ function d3_selection_enter(selection) {
+ d3_subclass(selection, d3_selection_enterPrototype);
+ return selection;
+ }
+ var d3_selection_enterPrototype = [];
+ d3.selection.enter = d3_selection_enter;
+ d3.selection.enter.prototype = d3_selection_enterPrototype;
+ d3_selection_enterPrototype.append = d3_selectionPrototype.append;
+ d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;
+ d3_selection_enterPrototype.node = d3_selectionPrototype.node;
+ d3_selection_enterPrototype.call = d3_selectionPrototype.call;
+ d3_selection_enterPrototype.size = d3_selectionPrototype.size;
+ d3_selection_enterPrototype.select = function(selector) {
+ var subgroups = [], subgroup, subnode, upgroup, group, node;
+ for (var j = -1, m = this.length; ++j < m; ) {
+ upgroup = (group = this[j]).update;
+ subgroups.push(subgroup = []);
+ subgroup.parentNode = group.parentNode;
+ for (var i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) {
+ subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j));
+ subnode.__data__ = node.__data__;
+ } else {
+ subgroup.push(null);
+ }
+ }
+ }
+ return d3_selection(subgroups);
+ };
+ d3_selection_enterPrototype.insert = function(name, before) {
+ if (arguments.length < 2) before = d3_selection_enterInsertBefore(this);
+ return d3_selectionPrototype.insert.call(this, name, before);
+ };
+ function d3_selection_enterInsertBefore(enter) {
+ var i0, j0;
+ return function(d, i, j) {
+ var group = enter[j].update, n = group.length, node;
+ if (j != j0) j0 = j, i0 = 0;
+ if (i >= i0) i0 = i + 1;
+ while (!(node = group[i0]) && ++i0 < n) ;
+ return node;
+ };
+ }
+ d3.select = function(node) {
+ var group;
+ if (typeof node === "string") {
+ group = [ d3_select(node, d3_document) ];
+ group.parentNode = d3_document.documentElement;
+ } else {
+ group = [ node ];
+ group.parentNode = d3_documentElement(node);
+ }
+ return d3_selection([ group ]);
+ };
+ d3.selectAll = function(nodes) {
+ var group;
+ if (typeof nodes === "string") {
+ group = d3_array(d3_selectAll(nodes, d3_document));
+ group.parentNode = d3_document.documentElement;
+ } else {
+ group = d3_array(nodes);
+ group.parentNode = null;
+ }
+ return d3_selection([ group ]);
+ };
+ d3_selectionPrototype.on = function(type, listener, capture) {
+ var n = arguments.length;
+ if (n < 3) {
+ if (typeof type !== "string") {
+ if (n < 2) listener = false;
+ for (capture in type) this.each(d3_selection_on(capture, type[capture], listener));
+ return this;
+ }
+ if (n < 2) return (n = this.node()["__on" + type]) && n._;
+ capture = false;
+ }
+ return this.each(d3_selection_on(type, listener, capture));
+ };
+ function d3_selection_on(type, listener, capture) {
+ var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener;
+ if (i > 0) type = type.slice(0, i);
+ var filter = d3_selection_onFilters.get(type);
+ if (filter) type = filter, wrap = d3_selection_onFilter;
+ function onRemove() {
+ var l = this[name];
+ if (l) {
+ this.removeEventListener(type, l, l.$);
+ delete this[name];
+ }
+ }
+ function onAdd() {
+ var l = wrap(listener, d3_array(arguments));
+ onRemove.call(this);
+ this.addEventListener(type, this[name] = l, l.$ = capture);
+ l._ = listener;
+ }
+ function removeAll() {
+ var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match;
+ for (var name in this) {
+ if (match = name.match(re)) {
+ var l = this[name];
+ this.removeEventListener(match[1], l, l.$);
+ delete this[name];
+ }
+ }
+ }
+ return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll;
+ }
+ var d3_selection_onFilters = d3.map({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+ });
+ if (d3_document) {
+ d3_selection_onFilters.forEach(function(k) {
+ if ("on" + k in d3_document) d3_selection_onFilters.remove(k);
+ });
+ }
+ function d3_selection_onListener(listener, argumentz) {
+ return function(e) {
+ var o = d3.event;
+ d3.event = e;
+ argumentz[0] = this.__data__;
+ try {
+ listener.apply(this, argumentz);
+ } finally {
+ d3.event = o;
+ }
+ };
+ }
+ function d3_selection_onFilter(listener, argumentz) {
+ var l = d3_selection_onListener(listener, argumentz);
+ return function(e) {
+ var target = this, related = e.relatedTarget;
+ if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) {
+ l.call(target, e);
+ }
+ };
+ }
+ var d3_event_dragSelect, d3_event_dragId = 0;
+ function d3_event_dragSuppress(node) {
+ var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window(node)).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault);
+ if (d3_event_dragSelect == null) {
+ d3_event_dragSelect = "onselectstart" in node ? false : d3_vendorSymbol(node.style, "userSelect");
+ }
+ if (d3_event_dragSelect) {
+ var style = d3_documentElement(node).style, select = style[d3_event_dragSelect];
+ style[d3_event_dragSelect] = "none";
+ }
+ return function(suppressClick) {
+ w.on(name, null);
+ if (d3_event_dragSelect) style[d3_event_dragSelect] = select;
+ if (suppressClick) {
+ var off = function() {
+ w.on(click, null);
+ };
+ w.on(click, function() {
+ d3_eventPreventDefault();
+ off();
+ }, true);
+ setTimeout(off, 0);
+ }
+ };
+ }
+ d3.mouse = function(container) {
+ return d3_mousePoint(container, d3_eventSource());
+ };
+ var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;
+ function d3_mousePoint(container, e) {
+ if (e.changedTouches) e = e.changedTouches[0];
+ var svg = container.ownerSVGElement || container;
+ if (svg.createSVGPoint) {
+ var point = svg.createSVGPoint();
+ if (d3_mouse_bug44083 < 0) {
+ var window = d3_window(container);
+ if (window.scrollX || window.scrollY) {
+ svg = d3.select("body").append("svg").style({
+ position: "absolute",
+ top: 0,
+ left: 0,
+ margin: 0,
+ padding: 0,
+ border: "none"
+ }, "important");
+ var ctm = svg[0][0].getScreenCTM();
+ d3_mouse_bug44083 = !(ctm.f || ctm.e);
+ svg.remove();
+ }
+ }
+ if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX,
+ point.y = e.clientY;
+ point = point.matrixTransform(container.getScreenCTM().inverse());
+ return [ point.x, point.y ];
+ }
+ var rect = container.getBoundingClientRect();
+ return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ];
+ }
+ d3.touch = function(container, touches, identifier) {
+ if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;
+ if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {
+ if ((touch = touches[i]).identifier === identifier) {
+ return d3_mousePoint(container, touch);
+ }
+ }
+ };
+ d3.behavior.drag = function() {
+ var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_window, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_identity, "touchmove", "touchend");
+ function drag() {
+ this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart);
+ }
+ function dragstart(id, position, subject, move, end) {
+ return function() {
+ var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId);
+ if (origin) {
+ dragOffset = origin.apply(that, arguments);
+ dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];
+ } else {
+ dragOffset = [ 0, 0 ];
+ }
+ dispatch({
+ type: "dragstart"
+ });
+ function moved() {
+ var position1 = position(parent, dragId), dx, dy;
+ if (!position1) return;
+ dx = position1[0] - position0[0];
+ dy = position1[1] - position0[1];
+ dragged |= dx | dy;
+ position0 = position1;
+ dispatch({
+ type: "drag",
+ x: position1[0] + dragOffset[0],
+ y: position1[1] + dragOffset[1],
+ dx: dx,
+ dy: dy
+ });
+ }
+ function ended() {
+ if (!position(parent, dragId)) return;
+ dragSubject.on(move + dragName, null).on(end + dragName, null);
+ dragRestore(dragged);
+ dispatch({
+ type: "dragend"
+ });
+ }
+ };
+ }
+ drag.origin = function(x) {
+ if (!arguments.length) return origin;
+ origin = x;
+ return drag;
+ };
+ return d3.rebind(drag, event, "on");
+ };
+ function d3_behavior_dragTouchId() {
+ return d3.event.changedTouches[0].identifier;
+ }
+ d3.touches = function(container, touches) {
+ if (arguments.length < 2) touches = d3_eventSource().touches;
+ return touches ? d3_array(touches).map(function(touch) {
+ var point = d3_mousePoint(container, touch);
+ point.identifier = touch.identifier;
+ return point;
+ }) : [];
+ };
+ var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;
+ function d3_sgn(x) {
+ return x > 0 ? 1 : x < 0 ? -1 : 0;
+ }
+ function d3_cross2d(a, b, c) {
+ return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
+ }
+ function d3_acos(x) {
+ return x > 1 ? 0 : x < -1 ? π : Math.acos(x);
+ }
+ function d3_asin(x) {
+ return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);
+ }
+ function d3_sinh(x) {
+ return ((x = Math.exp(x)) - 1 / x) / 2;
+ }
+ function d3_cosh(x) {
+ return ((x = Math.exp(x)) + 1 / x) / 2;
+ }
+ function d3_tanh(x) {
+ return ((x = Math.exp(2 * x)) - 1) / (x + 1);
+ }
+ function d3_haversin(x) {
+ return (x = Math.sin(x / 2)) * x;
+ }
+ var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4;
+ d3.interpolateZoom = function(p0, p1) {
+ var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2], dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, i, S;
+ if (d2 < ε2) {
+ S = Math.log(w1 / w0) / ρ;
+ i = function(t) {
+ return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * t * S) ];
+ };
+ } else {
+ var d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
+ S = (r1 - r0) / ρ;
+ i = function(t) {
+ var s = t * S, coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0));
+ return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ];
+ };
+ }
+ i.duration = S * 1e3;
+ return i;
+ };
+ d3.behavior.zoom = function() {
+ var view = {
+ x: 0,
+ y: 0,
+ k: 1
+ }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, duration = 250, zooming = 0, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1;
+ if (!d3_behavior_zoomWheel) {
+ d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() {
+ return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);
+ }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() {
+ return d3.event.wheelDelta;
+ }, "mousewheel") : (d3_behavior_zoomDelta = function() {
+ return -d3.event.detail;
+ }, "MozMousePixelScroll");
+ }
+ function zoom(g) {
+ g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
+ }
+ zoom.event = function(g) {
+ g.each(function() {
+ var dispatch = event.of(this, arguments), view1 = view;
+ if (d3_transitionInheritId) {
+ d3.select(this).transition().each("start.zoom", function() {
+ view = this.__chart__ || {
+ x: 0,
+ y: 0,
+ k: 1
+ };
+ zoomstarted(dispatch);
+ }).tween("zoom:zoom", function() {
+ var dx = size[0], dy = size[1], cx = center0 ? center0[0] : dx / 2, cy = center0 ? center0[1] : dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]);
+ return function(t) {
+ var l = i(t), k = dx / l[2];
+ this.__chart__ = view = {
+ x: cx - l[0] * k,
+ y: cy - l[1] * k,
+ k: k
+ };
+ zoomed(dispatch);
+ };
+ }).each("interrupt.zoom", function() {
+ zoomended(dispatch);
+ }).each("end.zoom", function() {
+ zoomended(dispatch);
+ });
+ } else {
+ this.__chart__ = view;
+ zoomstarted(dispatch);
+ zoomed(dispatch);
+ zoomended(dispatch);
+ }
+ });
+ };
+ zoom.translate = function(_) {
+ if (!arguments.length) return [ view.x, view.y ];
+ view = {
+ x: +_[0],
+ y: +_[1],
+ k: view.k
+ };
+ rescale();
+ return zoom;
+ };
+ zoom.scale = function(_) {
+ if (!arguments.length) return view.k;
+ view = {
+ x: view.x,
+ y: view.y,
+ k: null
+ };
+ scaleTo(+_);
+ rescale();
+ return zoom;
+ };
+ zoom.scaleExtent = function(_) {
+ if (!arguments.length) return scaleExtent;
+ scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ];
+ return zoom;
+ };
+ zoom.center = function(_) {
+ if (!arguments.length) return center;
+ center = _ && [ +_[0], +_[1] ];
+ return zoom;
+ };
+ zoom.size = function(_) {
+ if (!arguments.length) return size;
+ size = _ && [ +_[0], +_[1] ];
+ return zoom;
+ };
+ zoom.duration = function(_) {
+ if (!arguments.length) return duration;
+ duration = +_;
+ return zoom;
+ };
+ zoom.x = function(z) {
+ if (!arguments.length) return x1;
+ x1 = z;
+ x0 = z.copy();
+ view = {
+ x: 0,
+ y: 0,
+ k: 1
+ };
+ return zoom;
+ };
+ zoom.y = function(z) {
+ if (!arguments.length) return y1;
+ y1 = z;
+ y0 = z.copy();
+ view = {
+ x: 0,
+ y: 0,
+ k: 1
+ };
+ return zoom;
+ };
+ function location(p) {
+ return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ];
+ }
+ function point(l) {
+ return [ l[0] * view.k + view.x, l[1] * view.k + view.y ];
+ }
+ function scaleTo(s) {
+ view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s));
+ }
+ function translateTo(p, l) {
+ l = point(l);
+ view.x += p[0] - l[0];
+ view.y += p[1] - l[1];
+ }
+ function zoomTo(that, p, l, k) {
+ that.__chart__ = {
+ x: view.x,
+ y: view.y,
+ k: view.k
+ };
+ scaleTo(Math.pow(2, k));
+ translateTo(center0 = p, l);
+ that = d3.select(that);
+ if (duration > 0) that = that.transition().duration(duration);
+ that.call(zoom.event);
+ }
+ function rescale() {
+ if (x1) x1.domain(x0.range().map(function(x) {
+ return (x - view.x) / view.k;
+ }).map(x0.invert));
+ if (y1) y1.domain(y0.range().map(function(y) {
+ return (y - view.y) / view.k;
+ }).map(y0.invert));
+ }
+ function zoomstarted(dispatch) {
+ if (!zooming++) dispatch({
+ type: "zoomstart"
+ });
+ }
+ function zoomed(dispatch) {
+ rescale();
+ dispatch({
+ type: "zoom",
+ scale: view.k,
+ translate: [ view.x, view.y ]
+ });
+ }
+ function zoomended(dispatch) {
+ if (!--zooming) dispatch({
+ type: "zoomend"
+ }), center0 = null;
+ }
+ function mousedowned() {
+ var that = this, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);
+ d3_selection_interrupt.call(that);
+ zoomstarted(dispatch);
+ function moved() {
+ dragged = 1;
+ translateTo(d3.mouse(that), location0);
+ zoomed(dispatch);
+ }
+ function ended() {
+ subject.on(mousemove, null).on(mouseup, null);
+ dragRestore(dragged);
+ zoomended(dispatch);
+ }
+ }
+ function touchstarted() {
+ var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(that);
+ started();
+ zoomstarted(dispatch);
+ subject.on(mousedown, null).on(touchstart, started);
+ function relocate() {
+ var touches = d3.touches(that);
+ scale0 = view.k;
+ touches.forEach(function(t) {
+ if (t.identifier in locations0) locations0[t.identifier] = location(t);
+ });
+ return touches;
+ }
+ function started() {
+ var target = d3.event.target;
+ d3.select(target).on(touchmove, moved).on(touchend, ended);
+ targets.push(target);
+ var changed = d3.event.changedTouches;
+ for (var i = 0, n = changed.length; i < n; ++i) {
+ locations0[changed[i].identifier] = null;
+ }
+ var touches = relocate(), now = Date.now();
+ if (touches.length === 1) {
+ if (now - touchtime < 500) {
+ var p = touches[0];
+ zoomTo(that, p, locations0[p.identifier], Math.floor(Math.log(view.k) / Math.LN2) + 1);
+ d3_eventPreventDefault();
+ }
+ touchtime = now;
+ } else if (touches.length > 1) {
+ var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1];
+ distance0 = dx * dx + dy * dy;
+ }
+ }
+ function moved() {
+ var touches = d3.touches(that), p0, l0, p1, l1;
+ d3_selection_interrupt.call(that);
+ for (var i = 0, n = touches.length; i < n; ++i, l1 = null) {
+ p1 = touches[i];
+ if (l1 = locations0[p1.identifier]) {
+ if (l0) break;
+ p0 = p1, l0 = l1;
+ }
+ }
+ if (l1) {
+ var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0);
+ p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ];
+ l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ];
+ scaleTo(scale1 * scale0);
+ }
+ touchtime = null;
+ translateTo(p0, l0);
+ zoomed(dispatch);
+ }
+ function ended() {
+ if (d3.event.touches.length) {
+ var changed = d3.event.changedTouches;
+ for (var i = 0, n = changed.length; i < n; ++i) {
+ delete locations0[changed[i].identifier];
+ }
+ for (var identifier in locations0) {
+ return void relocate();
+ }
+ }
+ d3.selectAll(targets).on(zoomName, null);
+ subject.on(mousedown, mousedowned).on(touchstart, touchstarted);
+ dragRestore();
+ zoomended(dispatch);
+ }
+ }
+ function mousewheeled() {
+ var dispatch = event.of(this, arguments);
+ if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this),
+ translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch);
+ mousewheelTimer = setTimeout(function() {
+ mousewheelTimer = null;
+ zoomended(dispatch);
+ }, 50);
+ d3_eventPreventDefault();
+ scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);
+ translateTo(center0, translate0);
+ zoomed(dispatch);
+ }
+ function dblclicked() {
+ var p = d3.mouse(this), k = Math.log(view.k) / Math.LN2;
+ zoomTo(this, p, location(p), d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1);
+ }
+ return d3.rebind(zoom, event, "on");
+ };
+ var d3_behavior_zoomInfinity = [ 0, Infinity ], d3_behavior_zoomDelta, d3_behavior_zoomWheel;
+ d3.color = d3_color;
+ function d3_color() {}
+ d3_color.prototype.toString = function() {
+ return this.rgb() + "";
+ };
+ d3.hsl = d3_hsl;
+ function d3_hsl(h, s, l) {
+ return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);
+ }
+ var d3_hslPrototype = d3_hsl.prototype = new d3_color();
+ d3_hslPrototype.brighter = function(k) {
+ k = Math.pow(.7, arguments.length ? k : 1);
+ return new d3_hsl(this.h, this.s, this.l / k);
+ };
+ d3_hslPrototype.darker = function(k) {
+ k = Math.pow(.7, arguments.length ? k : 1);
+ return new d3_hsl(this.h, this.s, k * this.l);
+ };
+ d3_hslPrototype.rgb = function() {
+ return d3_hsl_rgb(this.h, this.s, this.l);
+ };
+ function d3_hsl_rgb(h, s, l) {
+ var m1, m2;
+ h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h;
+ s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s;
+ l = l < 0 ? 0 : l > 1 ? 1 : l;
+ m2 = l <= .5 ? l * (1 + s) : l + s - l * s;
+ m1 = 2 * l - m2;
+ function v(h) {
+ if (h > 360) h -= 360; else if (h < 0) h += 360;
+ if (h < 60) return m1 + (m2 - m1) * h / 60;
+ if (h < 180) return m2;
+ if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;
+ return m1;
+ }
+ function vv(h) {
+ return Math.round(v(h) * 255);
+ }
+ return new d3_rgb(vv(h + 120), vv(h), vv(h - 120));
+ }
+ d3.hcl = d3_hcl;
+ function d3_hcl(h, c, l) {
+ return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l);
+ }
+ var d3_hclPrototype = d3_hcl.prototype = new d3_color();
+ d3_hclPrototype.brighter = function(k) {
+ return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));
+ };
+ d3_hclPrototype.darker = function(k) {
+ return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));
+ };
+ d3_hclPrototype.rgb = function() {
+ return d3_hcl_lab(this.h, this.c, this.l).rgb();
+ };
+ function d3_hcl_lab(h, c, l) {
+ if (isNaN(h)) h = 0;
+ if (isNaN(c)) c = 0;
+ return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);
+ }
+ d3.lab = d3_lab;
+ function d3_lab(l, a, b) {
+ return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b);
+ }
+ var d3_lab_K = 18;
+ var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883;
+ var d3_labPrototype = d3_lab.prototype = new d3_color();
+ d3_labPrototype.brighter = function(k) {
+ return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
+ };
+ d3_labPrototype.darker = function(k) {
+ return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
+ };
+ d3_labPrototype.rgb = function() {
+ return d3_lab_rgb(this.l, this.a, this.b);
+ };
+ function d3_lab_rgb(l, a, b) {
+ var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200;
+ x = d3_lab_xyz(x) * d3_lab_X;
+ y = d3_lab_xyz(y) * d3_lab_Y;
+ z = d3_lab_xyz(z) * d3_lab_Z;
+ return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));
+ }
+ function d3_lab_hcl(l, a, b) {
+ return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l);
+ }
+ function d3_lab_xyz(x) {
+ return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037;
+ }
+ function d3_xyz_lab(x) {
+ return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;
+ }
+ function d3_xyz_rgb(r) {
+ return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055));
+ }
+ d3.rgb = d3_rgb;
+ function d3_rgb(r, g, b) {
+ return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);
+ }
+ function d3_rgbNumber(value) {
+ return new d3_rgb(value >> 16, value >> 8 & 255, value & 255);
+ }
+ function d3_rgbString(value) {
+ return d3_rgbNumber(value) + "";
+ }
+ var d3_rgbPrototype = d3_rgb.prototype = new d3_color();
+ d3_rgbPrototype.brighter = function(k) {
+ k = Math.pow(.7, arguments.length ? k : 1);
+ var r = this.r, g = this.g, b = this.b, i = 30;
+ if (!r && !g && !b) return new d3_rgb(i, i, i);
+ if (r && r < i) r = i;
+ if (g && g < i) g = i;
+ if (b && b < i) b = i;
+ return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k));
+ };
+ d3_rgbPrototype.darker = function(k) {
+ k = Math.pow(.7, arguments.length ? k : 1);
+ return new d3_rgb(k * this.r, k * this.g, k * this.b);
+ };
+ d3_rgbPrototype.hsl = function() {
+ return d3_rgb_hsl(this.r, this.g, this.b);
+ };
+ d3_rgbPrototype.toString = function() {
+ return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);
+ };
+ function d3_rgb_hex(v) {
+ return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16);
+ }
+ function d3_rgb_parse(format, rgb, hsl) {
+ var r = 0, g = 0, b = 0, m1, m2, color;
+ m1 = /([a-z]+)\((.*)\)/.exec(format = format.toLowerCase());
+ if (m1) {
+ m2 = m1[2].split(",");
+ switch (m1[1]) {
+ case "hsl":
+ {
+ return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100);
+ }
+
+ case "rgb":
+ {
+ return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2]));
+ }
+ }
+ }
+ if (color = d3_rgb_names.get(format)) {
+ return rgb(color.r, color.g, color.b);
+ }
+ if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) {
+ if (format.length === 4) {
+ r = (color & 3840) >> 4;
+ r = r >> 4 | r;
+ g = color & 240;
+ g = g >> 4 | g;
+ b = color & 15;
+ b = b << 4 | b;
+ } else if (format.length === 7) {
+ r = (color & 16711680) >> 16;
+ g = (color & 65280) >> 8;
+ b = color & 255;
+ }
+ }
+ return rgb(r, g, b);
+ }
+ function d3_rgb_hsl(r, g, b) {
+ var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2;
+ if (d) {
+ s = l < .5 ? d / (max + min) : d / (2 - max - min);
+ if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4;
+ h *= 60;
+ } else {
+ h = NaN;
+ s = l > 0 && l < 1 ? 0 : h;
+ }
+ return new d3_hsl(h, s, l);
+ }
+ function d3_rgb_lab(r, g, b) {
+ r = d3_rgb_xyz(r);
+ g = d3_rgb_xyz(g);
+ b = d3_rgb_xyz(b);
+ var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z);
+ return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z));
+ }
+ function d3_rgb_xyz(r) {
+ return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4);
+ }
+ function d3_rgb_parseNumber(c) {
+ var f = parseFloat(c);
+ return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f;
+ }
+ var d3_rgb_names = d3.map({
+ aliceblue: 15792383,
+ antiquewhite: 16444375,
+ aqua: 65535,
+ aquamarine: 8388564,
+ azure: 15794175,
+ beige: 16119260,
+ bisque: 16770244,
+ black: 0,
+ blanchedalmond: 16772045,
+ blue: 255,
+ blueviolet: 9055202,
+ brown: 10824234,
+ burlywood: 14596231,
+ cadetblue: 6266528,
+ chartreuse: 8388352,
+ chocolate: 13789470,
+ coral: 16744272,
+ cornflowerblue: 6591981,
+ cornsilk: 16775388,
+ crimson: 14423100,
+ cyan: 65535,
+ darkblue: 139,
+ darkcyan: 35723,
+ darkgoldenrod: 12092939,
+ darkgray: 11119017,
+ darkgreen: 25600,
+ darkgrey: 11119017,
+ darkkhaki: 12433259,
+ darkmagenta: 9109643,
+ darkolivegreen: 5597999,
+ darkorange: 16747520,
+ darkorchid: 10040012,
+ darkred: 9109504,
+ darksalmon: 15308410,
+ darkseagreen: 9419919,
+ darkslateblue: 4734347,
+ darkslategray: 3100495,
+ darkslategrey: 3100495,
+ darkturquoise: 52945,
+ darkviolet: 9699539,
+ deeppink: 16716947,
+ deepskyblue: 49151,
+ dimgray: 6908265,
+ dimgrey: 6908265,
+ dodgerblue: 2003199,
+ firebrick: 11674146,
+ floralwhite: 16775920,
+ forestgreen: 2263842,
+ fuchsia: 16711935,
+ gainsboro: 14474460,
+ ghostwhite: 16316671,
+ gold: 16766720,
+ goldenrod: 14329120,
+ gray: 8421504,
+ green: 32768,
+ greenyellow: 11403055,
+ grey: 8421504,
+ honeydew: 15794160,
+ hotpink: 16738740,
+ indianred: 13458524,
+ indigo: 4915330,
+ ivory: 16777200,
+ khaki: 15787660,
+ lavender: 15132410,
+ lavenderblush: 16773365,
+ lawngreen: 8190976,
+ lemonchiffon: 16775885,
+ lightblue: 11393254,
+ lightcoral: 15761536,
+ lightcyan: 14745599,
+ lightgoldenrodyellow: 16448210,
+ lightgray: 13882323,
+ lightgreen: 9498256,
+ lightgrey: 13882323,
+ lightpink: 16758465,
+ lightsalmon: 16752762,
+ lightseagreen: 2142890,
+ lightskyblue: 8900346,
+ lightslategray: 7833753,
+ lightslategrey: 7833753,
+ lightsteelblue: 11584734,
+ lightyellow: 16777184,
+ lime: 65280,
+ limegreen: 3329330,
+ linen: 16445670,
+ magenta: 16711935,
+ maroon: 8388608,
+ mediumaquamarine: 6737322,
+ mediumblue: 205,
+ mediumorchid: 12211667,
+ mediumpurple: 9662683,
+ mediumseagreen: 3978097,
+ mediumslateblue: 8087790,
+ mediumspringgreen: 64154,
+ mediumturquoise: 4772300,
+ mediumvioletred: 13047173,
+ midnightblue: 1644912,
+ mintcream: 16121850,
+ mistyrose: 16770273,
+ moccasin: 16770229,
+ navajowhite: 16768685,
+ navy: 128,
+ oldlace: 16643558,
+ olive: 8421376,
+ olivedrab: 7048739,
+ orange: 16753920,
+ orangered: 16729344,
+ orchid: 14315734,
+ palegoldenrod: 15657130,
+ palegreen: 10025880,
+ paleturquoise: 11529966,
+ palevioletred: 14381203,
+ papayawhip: 16773077,
+ peachpuff: 16767673,
+ peru: 13468991,
+ pink: 16761035,
+ plum: 14524637,
+ powderblue: 11591910,
+ purple: 8388736,
+ rebeccapurple: 6697881,
+ red: 16711680,
+ rosybrown: 12357519,
+ royalblue: 4286945,
+ saddlebrown: 9127187,
+ salmon: 16416882,
+ sandybrown: 16032864,
+ seagreen: 3050327,
+ seashell: 16774638,
+ sienna: 10506797,
+ silver: 12632256,
+ skyblue: 8900331,
+ slateblue: 6970061,
+ slategray: 7372944,
+ slategrey: 7372944,
+ snow: 16775930,
+ springgreen: 65407,
+ steelblue: 4620980,
+ tan: 13808780,
+ teal: 32896,
+ thistle: 14204888,
+ tomato: 16737095,
+ turquoise: 4251856,
+ violet: 15631086,
+ wheat: 16113331,
+ white: 16777215,
+ whitesmoke: 16119285,
+ yellow: 16776960,
+ yellowgreen: 10145074
+ });
+ d3_rgb_names.forEach(function(key, value) {
+ d3_rgb_names.set(key, d3_rgbNumber(value));
+ });
+ function d3_functor(v) {
+ return typeof v === "function" ? v : function() {
+ return v;
+ };
+ }
+ d3.functor = d3_functor;
+ d3.xhr = d3_xhrType(d3_identity);
+ function d3_xhrType(response) {
+ return function(url, mimeType, callback) {
+ if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType,
+ mimeType = null;
+ return d3_xhr(url, mimeType, response, callback);
+ };
+ }
+ function d3_xhr(url, mimeType, response, callback) {
+ var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
+ if (this.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
+ "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {
+ request.readyState > 3 && respond();
+ };
+ function respond() {
+ var status = request.status, result;
+ if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) {
+ try {
+ result = response.call(xhr, request);
+ } catch (e) {
+ dispatch.error.call(xhr, e);
+ return;
+ }
+ dispatch.load.call(xhr, result);
+ } else {
+ dispatch.error.call(xhr, request);
+ }
+ }
+ request.onprogress = function(event) {
+ var o = d3.event;
+ d3.event = event;
+ try {
+ dispatch.progress.call(xhr, request);
+ } finally {
+ d3.event = o;
+ }
+ };
+ xhr.header = function(name, value) {
+ name = (name + "").toLowerCase();
+ if (arguments.length < 2) return headers[name];
+ if (value == null) delete headers[name]; else headers[name] = value + "";
+ return xhr;
+ };
+ xhr.mimeType = function(value) {
+ if (!arguments.length) return mimeType;
+ mimeType = value == null ? null : value + "";
+ return xhr;
+ };
+ xhr.responseType = function(value) {
+ if (!arguments.length) return responseType;
+ responseType = value;
+ return xhr;
+ };
+ xhr.response = function(value) {
+ response = value;
+ return xhr;
+ };
+ [ "get", "post" ].forEach(function(method) {
+ xhr[method] = function() {
+ return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));
+ };
+ });
+ xhr.send = function(method, data, callback) {
+ if (arguments.length === 2 && typeof data === "function") callback = data, data = null;
+ request.open(method, url, true);
+ if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*";
+ if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]);
+ if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType);
+ if (responseType != null) request.responseType = responseType;
+ if (callback != null) xhr.on("error", callback).on("load", function(request) {
+ callback(null, request);
+ });
+ dispatch.beforesend.call(xhr, request);
+ request.send(data == null ? null : data);
+ return xhr;
+ };
+ xhr.abort = function() {
+ request.abort();
+ return xhr;
+ };
+ d3.rebind(xhr, dispatch, "on");
+ return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback));
+ }
+ function d3_xhr_fixCallback(callback) {
+ return callback.length === 1 ? function(error, request) {
+ callback(error == null ? request : null);
+ } : callback;
+ }
+ function d3_xhrHasResponse(request) {
+ var type = request.responseType;
+ return type && type !== "text" ? request.response : request.responseText;
+ }
+ d3.dsv = function(delimiter, mimeType) {
+ var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0);
+ function dsv(url, row, callback) {
+ if (arguments.length < 3) callback = row, row = null;
+ var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);
+ xhr.row = function(_) {
+ return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row;
+ };
+ return xhr;
+ }
+ function response(request) {
+ return dsv.parse(request.responseText);
+ }
+ function typedResponse(f) {
+ return function(request) {
+ return dsv.parse(request.responseText, f);
+ };
+ }
+ dsv.parse = function(text, f) {
+ var o;
+ return dsv.parseRows(text, function(row, i) {
+ if (o) return o(row, i - 1);
+ var a = new Function("d", "return {" + row.map(function(name, i) {
+ return JSON.stringify(name) + ": d[" + i + "]";
+ }).join(",") + "}");
+ o = f ? function(row, i) {
+ return f(a(row), i);
+ } : a;
+ });
+ };
+ dsv.parseRows = function(text, f) {
+ var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol;
+ function token() {
+ if (I >= N) return EOF;
+ if (eol) return eol = false, EOL;
+ var j = I;
+ if (text.charCodeAt(j) === 34) {
+ var i = j;
+ while (i++ < N) {
+ if (text.charCodeAt(i) === 34) {
+ if (text.charCodeAt(i + 1) !== 34) break;
+ ++i;
+ }
+ }
+ I = i + 2;
+ var c = text.charCodeAt(i + 1);
+ if (c === 13) {
+ eol = true;
+ if (text.charCodeAt(i + 2) === 10) ++I;
+ } else if (c === 10) {
+ eol = true;
+ }
+ return text.slice(j + 1, i).replace(/""/g, '"');
+ }
+ while (I < N) {
+ var c = text.charCodeAt(I++), k = 1;
+ if (c === 10) eol = true; else if (c === 13) {
+ eol = true;
+ if (text.charCodeAt(I) === 10) ++I, ++k;
+ } else if (c !== delimiterCode) continue;
+ return text.slice(j, I - k);
+ }
+ return text.slice(j);
+ }
+ while ((t = token()) !== EOF) {
+ var a = [];
+ while (t !== EOL && t !== EOF) {
+ a.push(t);
+ t = token();
+ }
+ if (f && (a = f(a, n++)) == null) continue;
+ rows.push(a);
+ }
+ return rows;
+ };
+ dsv.format = function(rows) {
+ if (Array.isArray(rows[0])) return dsv.formatRows(rows);
+ var fieldSet = new d3_Set(), fields = [];
+ rows.forEach(function(row) {
+ for (var field in row) {
+ if (!fieldSet.has(field)) {
+ fields.push(fieldSet.add(field));
+ }
+ }
+ });
+ return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) {
+ return fields.map(function(field) {
+ return formatValue(row[field]);
+ }).join(delimiter);
+ })).join("\n");
+ };
+ dsv.formatRows = function(rows) {
+ return rows.map(formatRow).join("\n");
+ };
+ function formatRow(row) {
+ return row.map(formatValue).join(delimiter);
+ }
+ function formatValue(text) {
+ return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text;
+ }
+ return dsv;
+ };
+ d3.csv = d3.dsv(",", "text/csv");
+ d3.tsv = d3.dsv(" ", "text/tab-separated-values");
+ var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) {
+ setTimeout(callback, 17);
+ };
+ d3.timer = function() {
+ d3_timer.apply(this, arguments);
+ };
+ function d3_timer(callback, delay, then) {
+ var n = arguments.length;
+ if (n < 2) delay = 0;
+ if (n < 3) then = Date.now();
+ var time = then + delay, timer = {
+ c: callback,
+ t: time,
+ n: null
+ };
+ if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer;
+ d3_timer_queueTail = timer;
+ if (!d3_timer_interval) {
+ d3_timer_timeout = clearTimeout(d3_timer_timeout);
+ d3_timer_interval = 1;
+ d3_timer_frame(d3_timer_step);
+ }
+ return timer;
+ }
+ function d3_timer_step() {
+ var now = d3_timer_mark(), delay = d3_timer_sweep() - now;
+ if (delay > 24) {
+ if (isFinite(delay)) {
+ clearTimeout(d3_timer_timeout);
+ d3_timer_timeout = setTimeout(d3_timer_step, delay);
+ }
+ d3_timer_interval = 0;
+ } else {
+ d3_timer_interval = 1;
+ d3_timer_frame(d3_timer_step);
+ }
+ }
+ d3.timer.flush = function() {
+ d3_timer_mark();
+ d3_timer_sweep();
+ };
+ function d3_timer_mark() {
+ var now = Date.now(), timer = d3_timer_queueHead;
+ while (timer) {
+ if (now >= timer.t && timer.c(now - timer.t)) timer.c = null;
+ timer = timer.n;
+ }
+ return now;
+ }
+ function d3_timer_sweep() {
+ var t0, t1 = d3_timer_queueHead, time = Infinity;
+ while (t1) {
+ if (t1.c) {
+ if (t1.t < time) time = t1.t;
+ t1 = (t0 = t1).n;
+ } else {
+ t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;
+ }
+ }
+ d3_timer_queueTail = t0;
+ return time;
+ }
+ function d3_format_precision(x, p) {
+ return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1);
+ }
+ d3.round = function(x, n) {
+ return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x);
+ };
+ var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix);
+ d3.formatPrefix = function(value, precision) {
+ var i = 0;
+ if (value = +value) {
+ if (value < 0) value *= -1;
+ if (precision) value = d3.round(value, d3_format_precision(value, precision));
+ i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
+ i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3));
+ }
+ return d3_formatPrefixes[8 + i / 3];
+ };
+ function d3_formatPrefix(d, i) {
+ var k = Math.pow(10, abs(8 - i) * 3);
+ return {
+ scale: i > 8 ? function(d) {
+ return d / k;
+ } : function(d) {
+ return d * k;
+ },
+ symbol: d
+ };
+ }
+ function d3_locale_numberFormat(locale) {
+ var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) {
+ var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0;
+ while (i > 0 && g > 0) {
+ if (length + g + 1 > width) g = Math.max(1, width - length);
+ t.push(value.substring(i -= g, i + g));
+ if ((length += g + 1) > width) break;
+ g = locale_grouping[j = (j + 1) % locale_grouping.length];
+ }
+ return t.reverse().join(locale_thousands);
+ } : d3_identity;
+ return function(specifier) {
+ var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "-", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false, exponent = true;
+ if (precision) precision = +precision.substring(1);
+ if (zfill || fill === "0" && align === "=") {
+ zfill = fill = "0";
+ align = "=";
+ }
+ switch (type) {
+ case "n":
+ comma = true;
+ type = "g";
+ break;
+
+ case "%":
+ scale = 100;
+ suffix = "%";
+ type = "f";
+ break;
+
+ case "p":
+ scale = 100;
+ suffix = "%";
+ type = "r";
+ break;
+
+ case "b":
+ case "o":
+ case "x":
+ case "X":
+ if (symbol === "#") prefix = "0" + type.toLowerCase();
+
+ case "c":
+ exponent = false;
+
+ case "d":
+ integer = true;
+ precision = 0;
+ break;
+
+ case "s":
+ scale = -1;
+ type = "r";
+ break;
+ }
+ if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1];
+ if (type == "r" && !precision) type = "g";
+ if (precision != null) {
+ if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision));
+ }
+ type = d3_format_types.get(type) || d3_format_typeDefault;
+ var zcomma = zfill && comma;
+ return function(value) {
+ var fullSuffix = suffix;
+ if (integer && value % 1) return "";
+ var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign === "-" ? "" : sign;
+ if (scale < 0) {
+ var unit = d3.formatPrefix(value, precision);
+ value = unit.scale(value);
+ fullSuffix = unit.symbol + suffix;
+ } else {
+ value *= scale;
+ }
+ value = type(value, precision);
+ var i = value.lastIndexOf("."), before, after;
+ if (i < 0) {
+ var j = exponent ? value.lastIndexOf("e") : -1;
+ if (j < 0) before = value, after = ""; else before = value.substring(0, j), after = value.substring(j);
+ } else {
+ before = value.substring(0, i);
+ after = locale_decimal + value.substring(i + 1);
+ }
+ if (!zfill && comma) before = formatGroup(before, Infinity);
+ var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : "";
+ if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity);
+ negative += prefix;
+ value = before + after;
+ return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix;
+ };
+ };
+ }
+ var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i;
+ var d3_format_types = d3.map({
+ b: function(x) {
+ return x.toString(2);
+ },
+ c: function(x) {
+ return String.fromCharCode(x);
+ },
+ o: function(x) {
+ return x.toString(8);
+ },
+ x: function(x) {
+ return x.toString(16);
+ },
+ X: function(x) {
+ return x.toString(16).toUpperCase();
+ },
+ g: function(x, p) {
+ return x.toPrecision(p);
+ },
+ e: function(x, p) {
+ return x.toExponential(p);
+ },
+ f: function(x, p) {
+ return x.toFixed(p);
+ },
+ r: function(x, p) {
+ return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p))));
+ }
+ });
+ function d3_format_typeDefault(x) {
+ return x + "";
+ }
+ var d3_time = d3.time = {}, d3_date = Date;
+ function d3_date_utc() {
+ this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);
+ }
+ d3_date_utc.prototype = {
+ getDate: function() {
+ return this._.getUTCDate();
+ },
+ getDay: function() {
+ return this._.getUTCDay();
+ },
+ getFullYear: function() {
+ return this._.getUTCFullYear();
+ },
+ getHours: function() {
+ return this._.getUTCHours();
+ },
+ getMilliseconds: function() {
+ return this._.getUTCMilliseconds();
+ },
+ getMinutes: function() {
+ return this._.getUTCMinutes();
+ },
+ getMonth: function() {
+ return this._.getUTCMonth();
+ },
+ getSeconds: function() {
+ return this._.getUTCSeconds();
+ },
+ getTime: function() {
+ return this._.getTime();
+ },
+ getTimezoneOffset: function() {
+ return 0;
+ },
+ valueOf: function() {
+ return this._.valueOf();
+ },
+ setDate: function() {
+ d3_time_prototype.setUTCDate.apply(this._, arguments);
+ },
+ setDay: function() {
+ d3_time_prototype.setUTCDay.apply(this._, arguments);
+ },
+ setFullYear: function() {
+ d3_time_prototype.setUTCFullYear.apply(this._, arguments);
+ },
+ setHours: function() {
+ d3_time_prototype.setUTCHours.apply(this._, arguments);
+ },
+ setMilliseconds: function() {
+ d3_time_prototype.setUTCMilliseconds.apply(this._, arguments);
+ },
+ setMinutes: function() {
+ d3_time_prototype.setUTCMinutes.apply(this._, arguments);
+ },
+ setMonth: function() {
+ d3_time_prototype.setUTCMonth.apply(this._, arguments);
+ },
+ setSeconds: function() {
+ d3_time_prototype.setUTCSeconds.apply(this._, arguments);
+ },
+ setTime: function() {
+ d3_time_prototype.setTime.apply(this._, arguments);
+ }
+ };
+ var d3_time_prototype = Date.prototype;
+ function d3_time_interval(local, step, number) {
+ function round(date) {
+ var d0 = local(date), d1 = offset(d0, 1);
+ return date - d0 < d1 - date ? d0 : d1;
+ }
+ function ceil(date) {
+ step(date = local(new d3_date(date - 1)), 1);
+ return date;
+ }
+ function offset(date, k) {
+ step(date = new d3_date(+date), k);
+ return date;
+ }
+ function range(t0, t1, dt) {
+ var time = ceil(t0), times = [];
+ if (dt > 1) {
+ while (time < t1) {
+ if (!(number(time) % dt)) times.push(new Date(+time));
+ step(time, 1);
+ }
+ } else {
+ while (time < t1) times.push(new Date(+time)), step(time, 1);
+ }
+ return times;
+ }
+ function range_utc(t0, t1, dt) {
+ try {
+ d3_date = d3_date_utc;
+ var utc = new d3_date_utc();
+ utc._ = t0;
+ return range(utc, t1, dt);
+ } finally {
+ d3_date = Date;
+ }
+ }
+ local.floor = local;
+ local.round = round;
+ local.ceil = ceil;
+ local.offset = offset;
+ local.range = range;
+ var utc = local.utc = d3_time_interval_utc(local);
+ utc.floor = utc;
+ utc.round = d3_time_interval_utc(round);
+ utc.ceil = d3_time_interval_utc(ceil);
+ utc.offset = d3_time_interval_utc(offset);
+ utc.range = range_utc;
+ return local;
+ }
+ function d3_time_interval_utc(method) {
+ return function(date, k) {
+ try {
+ d3_date = d3_date_utc;
+ var utc = new d3_date_utc();
+ utc._ = date;
+ return method(utc, k)._;
+ } finally {
+ d3_date = Date;
+ }
+ };
+ }
+ d3_time.year = d3_time_interval(function(date) {
+ date = d3_time.day(date);
+ date.setMonth(0, 1);
+ return date;
+ }, function(date, offset) {
+ date.setFullYear(date.getFullYear() + offset);
+ }, function(date) {
+ return date.getFullYear();
+ });
+ d3_time.years = d3_time.year.range;
+ d3_time.years.utc = d3_time.year.utc.range;
+ d3_time.day = d3_time_interval(function(date) {
+ var day = new d3_date(2e3, 0);
+ day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
+ return day;
+ }, function(date, offset) {
+ date.setDate(date.getDate() + offset);
+ }, function(date) {
+ return date.getDate() - 1;
+ });
+ d3_time.days = d3_time.day.range;
+ d3_time.days.utc = d3_time.day.utc.range;
+ d3_time.dayOfYear = function(date) {
+ var year = d3_time.year(date);
+ return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);
+ };
+ [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) {
+ i = 7 - i;
+ var interval = d3_time[day] = d3_time_interval(function(date) {
+ (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7);
+ return date;
+ }, function(date, offset) {
+ date.setDate(date.getDate() + Math.floor(offset) * 7);
+ }, function(date) {
+ var day = d3_time.year(date).getDay();
+ return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i);
+ });
+ d3_time[day + "s"] = interval.range;
+ d3_time[day + "s"].utc = interval.utc.range;
+ d3_time[day + "OfYear"] = function(date) {
+ var day = d3_time.year(date).getDay();
+ return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7);
+ };
+ });
+ d3_time.week = d3_time.sunday;
+ d3_time.weeks = d3_time.sunday.range;
+ d3_time.weeks.utc = d3_time.sunday.utc.range;
+ d3_time.weekOfYear = d3_time.sundayOfYear;
+ function d3_locale_timeFormat(locale) {
+ var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths;
+ function d3_time_format(template) {
+ var n = template.length;
+ function format(date) {
+ var string = [], i = -1, j = 0, c, p, f;
+ while (++i < n) {
+ if (template.charCodeAt(i) === 37) {
+ string.push(template.slice(j, i));
+ if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i);
+ if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p);
+ string.push(c);
+ j = i + 1;
+ }
+ }
+ string.push(template.slice(j, i));
+ return string.join("");
+ }
+ format.parse = function(string) {
+ var d = {
+ y: 1900,
+ m: 0,
+ d: 1,
+ H: 0,
+ M: 0,
+ S: 0,
+ L: 0,
+ Z: null
+ }, i = d3_time_parse(d, template, string, 0);
+ if (i != string.length) return null;
+ if ("p" in d) d.H = d.H % 12 + d.p * 12;
+ var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)();
+ if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("W" in d || "U" in d) {
+ if (!("w" in d)) d.w = "W" in d ? 1 : 0;
+ date.setFullYear(d.y, 0, 1);
+ date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7);
+ } else date.setFullYear(d.y, d.m, d.d);
+ date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L);
+ return localZ ? date._ : date;
+ };
+ format.toString = function() {
+ return template;
+ };
+ return format;
+ }
+ function d3_time_parse(date, template, string, j) {
+ var c, p, t, i = 0, n = template.length, m = string.length;
+ while (i < n) {
+ if (j >= m) return -1;
+ c = template.charCodeAt(i++);
+ if (c === 37) {
+ t = template.charAt(i++);
+ p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t];
+ if (!p || (j = p(date, string, j)) < 0) return -1;
+ } else if (c != string.charCodeAt(j++)) {
+ return -1;
+ }
+ }
+ return j;
+ }
+ d3_time_format.utc = function(template) {
+ var local = d3_time_format(template);
+ function format(date) {
+ try {
+ d3_date = d3_date_utc;
+ var utc = new d3_date();
+ utc._ = date;
+ return local(utc);
+ } finally {
+ d3_date = Date;
+ }
+ }
+ format.parse = function(string) {
+ try {
+ d3_date = d3_date_utc;
+ var date = local.parse(string);
+ return date && date._;
+ } finally {
+ d3_date = Date;
+ }
+ };
+ format.toString = local.toString;
+ return format;
+ };
+ d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti;
+ var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths);
+ locale_periods.forEach(function(p, i) {
+ d3_time_periodLookup.set(p.toLowerCase(), i);
+ });
+ var d3_time_formats = {
+ a: function(d) {
+ return locale_shortDays[d.getDay()];
+ },
+ A: function(d) {
+ return locale_days[d.getDay()];
+ },
+ b: function(d) {
+ return locale_shortMonths[d.getMonth()];
+ },
+ B: function(d) {
+ return locale_months[d.getMonth()];
+ },
+ c: d3_time_format(locale_dateTime),
+ d: function(d, p) {
+ return d3_time_formatPad(d.getDate(), p, 2);
+ },
+ e: function(d, p) {
+ return d3_time_formatPad(d.getDate(), p, 2);
+ },
+ H: function(d, p) {
+ return d3_time_formatPad(d.getHours(), p, 2);
+ },
+ I: function(d, p) {
+ return d3_time_formatPad(d.getHours() % 12 || 12, p, 2);
+ },
+ j: function(d, p) {
+ return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3);
+ },
+ L: function(d, p) {
+ return d3_time_formatPad(d.getMilliseconds(), p, 3);
+ },
+ m: function(d, p) {
+ return d3_time_formatPad(d.getMonth() + 1, p, 2);
+ },
+ M: function(d, p) {
+ return d3_time_formatPad(d.getMinutes(), p, 2);
+ },
+ p: function(d) {
+ return locale_periods[+(d.getHours() >= 12)];
+ },
+ S: function(d, p) {
+ return d3_time_formatPad(d.getSeconds(), p, 2);
+ },
+ U: function(d, p) {
+ return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2);
+ },
+ w: function(d) {
+ return d.getDay();
+ },
+ W: function(d, p) {
+ return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2);
+ },
+ x: d3_time_format(locale_date),
+ X: d3_time_format(locale_time),
+ y: function(d, p) {
+ return d3_time_formatPad(d.getFullYear() % 100, p, 2);
+ },
+ Y: function(d, p) {
+ return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);
+ },
+ Z: d3_time_zone,
+ "%": function() {
+ return "%";
+ }
+ };
+ var d3_time_parsers = {
+ a: d3_time_parseWeekdayAbbrev,
+ A: d3_time_parseWeekday,
+ b: d3_time_parseMonthAbbrev,
+ B: d3_time_parseMonth,
+ c: d3_time_parseLocaleFull,
+ d: d3_time_parseDay,
+ e: d3_time_parseDay,
+ H: d3_time_parseHour24,
+ I: d3_time_parseHour24,
+ j: d3_time_parseDayOfYear,
+ L: d3_time_parseMilliseconds,
+ m: d3_time_parseMonthNumber,
+ M: d3_time_parseMinutes,
+ p: d3_time_parseAmPm,
+ S: d3_time_parseSeconds,
+ U: d3_time_parseWeekNumberSunday,
+ w: d3_time_parseWeekdayNumber,
+ W: d3_time_parseWeekNumberMonday,
+ x: d3_time_parseLocaleDate,
+ X: d3_time_parseLocaleTime,
+ y: d3_time_parseYear,
+ Y: d3_time_parseFullYear,
+ Z: d3_time_parseZone,
+ "%": d3_time_parseLiteralPercent
+ };
+ function d3_time_parseWeekdayAbbrev(date, string, i) {
+ d3_time_dayAbbrevRe.lastIndex = 0;
+ var n = d3_time_dayAbbrevRe.exec(string.slice(i));
+ return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
+ }
+ function d3_time_parseWeekday(date, string, i) {
+ d3_time_dayRe.lastIndex = 0;
+ var n = d3_time_dayRe.exec(string.slice(i));
+ return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
+ }
+ function d3_time_parseMonthAbbrev(date, string, i) {
+ d3_time_monthAbbrevRe.lastIndex = 0;
+ var n = d3_time_monthAbbrevRe.exec(string.slice(i));
+ return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
+ }
+ function d3_time_parseMonth(date, string, i) {
+ d3_time_monthRe.lastIndex = 0;
+ var n = d3_time_monthRe.exec(string.slice(i));
+ return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
+ }
+ function d3_time_parseLocaleFull(date, string, i) {
+ return d3_time_parse(date, d3_time_formats.c.toString(), string, i);
+ }
+ function d3_time_parseLocaleDate(date, string, i) {
+ return d3_time_parse(date, d3_time_formats.x.toString(), string, i);
+ }
+ function d3_time_parseLocaleTime(date, string, i) {
+ return d3_time_parse(date, d3_time_formats.X.toString(), string, i);
+ }
+ function d3_time_parseAmPm(date, string, i) {
+ var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase());
+ return n == null ? -1 : (date.p = n, i);
+ }
+ return d3_time_format;
+ }
+ var d3_time_formatPads = {
+ "-": "",
+ _: " ",
+ "0": "0"
+ }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/;
+ function d3_time_formatPad(value, fill, width) {
+ var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length;
+ return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
+ }
+ function d3_time_formatRe(names) {
+ return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i");
+ }
+ function d3_time_formatLookup(names) {
+ var map = new d3_Map(), i = -1, n = names.length;
+ while (++i < n) map.set(names[i].toLowerCase(), i);
+ return map;
+ }
+ function d3_time_parseWeekdayNumber(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 1));
+ return n ? (date.w = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseWeekNumberSunday(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i));
+ return n ? (date.U = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseWeekNumberMonday(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i));
+ return n ? (date.W = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseFullYear(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 4));
+ return n ? (date.y = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseYear(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;
+ }
+ function d3_time_parseZone(date, string, i) {
+ return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string,
+ i + 5) : -1;
+ }
+ function d3_time_expandYear(d) {
+ return d + (d > 68 ? 1900 : 2e3);
+ }
+ function d3_time_parseMonthNumber(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.m = n[0] - 1, i + n[0].length) : -1;
+ }
+ function d3_time_parseDay(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.d = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseDayOfYear(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 3));
+ return n ? (date.j = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseHour24(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.H = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseMinutes(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.M = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseSeconds(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.S = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseMilliseconds(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 3));
+ return n ? (date.L = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_zone(d) {
+ var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60;
+ return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2);
+ }
+ function d3_time_parseLiteralPercent(date, string, i) {
+ d3_time_percentRe.lastIndex = 0;
+ var n = d3_time_percentRe.exec(string.slice(i, i + 1));
+ return n ? i + n[0].length : -1;
+ }
+ function d3_time_formatMulti(formats) {
+ var n = formats.length, i = -1;
+ while (++i < n) formats[i][0] = this(formats[i][0]);
+ return function(date) {
+ var i = 0, f = formats[i];
+ while (!f[1](date)) f = formats[++i];
+ return f[0](date);
+ };
+ }
+ d3.locale = function(locale) {
+ return {
+ numberFormat: d3_locale_numberFormat(locale),
+ timeFormat: d3_locale_timeFormat(locale)
+ };
+ };
+ var d3_locale_enUS = d3.locale({
+ decimal: ".",
+ thousands: ",",
+ grouping: [ 3 ],
+ currency: [ "$", "" ],
+ dateTime: "%a %b %e %X %Y",
+ date: "%m/%d/%Y",
+ time: "%H:%M:%S",
+ periods: [ "AM", "PM" ],
+ days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
+ shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
+ months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ],
+ shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
+ });
+ d3.format = d3_locale_enUS.numberFormat;
+ d3.geo = {};
+ function d3_adder() {}
+ d3_adder.prototype = {
+ s: 0,
+ t: 0,
+ add: function(y) {
+ d3_adderSum(y, this.t, d3_adderTemp);
+ d3_adderSum(d3_adderTemp.s, this.s, this);
+ if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t;
+ },
+ reset: function() {
+ this.s = this.t = 0;
+ },
+ valueOf: function() {
+ return this.s;
+ }
+ };
+ var d3_adderTemp = new d3_adder();
+ function d3_adderSum(a, b, o) {
+ var x = o.s = a + b, bv = x - a, av = x - bv;
+ o.t = a - av + (b - bv);
+ }
+ d3.geo.stream = function(object, listener) {
+ if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) {
+ d3_geo_streamObjectType[object.type](object, listener);
+ } else {
+ d3_geo_streamGeometry(object, listener);
+ }
+ };
+ function d3_geo_streamGeometry(geometry, listener) {
+ if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) {
+ d3_geo_streamGeometryType[geometry.type](geometry, listener);
+ }
+ }
+ var d3_geo_streamObjectType = {
+ Feature: function(feature, listener) {
+ d3_geo_streamGeometry(feature.geometry, listener);
+ },
+ FeatureCollection: function(object, listener) {
+ var features = object.features, i = -1, n = features.length;
+ while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);
+ }
+ };
+ var d3_geo_streamGeometryType = {
+ Sphere: function(object, listener) {
+ listener.sphere();
+ },
+ Point: function(object, listener) {
+ object = object.coordinates;
+ listener.point(object[0], object[1], object[2]);
+ },
+ MultiPoint: function(object, listener) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]);
+ },
+ LineString: function(object, listener) {
+ d3_geo_streamLine(object.coordinates, listener, 0);
+ },
+ MultiLineString: function(object, listener) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0);
+ },
+ Polygon: function(object, listener) {
+ d3_geo_streamPolygon(object.coordinates, listener);
+ },
+ MultiPolygon: function(object, listener) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);
+ },
+ GeometryCollection: function(object, listener) {
+ var geometries = object.geometries, i = -1, n = geometries.length;
+ while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
+ }
+ };
+ function d3_geo_streamLine(coordinates, listener, closed) {
+ var i = -1, n = coordinates.length - closed, coordinate;
+ listener.lineStart();
+ while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]);
+ listener.lineEnd();
+ }
+ function d3_geo_streamPolygon(coordinates, listener) {
+ var i = -1, n = coordinates.length;
+ listener.polygonStart();
+ while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1);
+ listener.polygonEnd();
+ }
+ d3.geo.area = function(object) {
+ d3_geo_areaSum = 0;
+ d3.geo.stream(object, d3_geo_area);
+ return d3_geo_areaSum;
+ };
+ var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder();
+ var d3_geo_area = {
+ sphere: function() {
+ d3_geo_areaSum += 4 * π;
+ },
+ point: d3_noop,
+ lineStart: d3_noop,
+ lineEnd: d3_noop,
+ polygonStart: function() {
+ d3_geo_areaRingSum.reset();
+ d3_geo_area.lineStart = d3_geo_areaRingStart;
+ },
+ polygonEnd: function() {
+ var area = 2 * d3_geo_areaRingSum;
+ d3_geo_areaSum += area < 0 ? 4 * π + area : area;
+ d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop;
+ }
+ };
+ function d3_geo_areaRingStart() {
+ var λ00, φ00, λ0, cosφ0, sinφ0;
+ d3_geo_area.point = function(λ, φ) {
+ d3_geo_area.point = nextPoint;
+ λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4),
+ sinφ0 = Math.sin(φ);
+ };
+ function nextPoint(λ, φ) {
+ λ *= d3_radians;
+ φ = φ * d3_radians / 2 + π / 4;
+ var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ);
+ d3_geo_areaRingSum.add(Math.atan2(v, u));
+ λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;
+ }
+ d3_geo_area.lineEnd = function() {
+ nextPoint(λ00, φ00);
+ };
+ }
+ function d3_geo_cartesian(spherical) {
+ var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ);
+ return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ];
+ }
+ function d3_geo_cartesianDot(a, b) {
+ return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
+ }
+ function d3_geo_cartesianCross(a, b) {
+ return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ];
+ }
+ function d3_geo_cartesianAdd(a, b) {
+ a[0] += b[0];
+ a[1] += b[1];
+ a[2] += b[2];
+ }
+ function d3_geo_cartesianScale(vector, k) {
+ return [ vector[0] * k, vector[1] * k, vector[2] * k ];
+ }
+ function d3_geo_cartesianNormalize(d) {
+ var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
+ d[0] /= l;
+ d[1] /= l;
+ d[2] /= l;
+ }
+ function d3_geo_spherical(cartesian) {
+ return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ];
+ }
+ function d3_geo_sphericalEqual(a, b) {
+ return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε;
+ }
+ d3.geo.bounds = function() {
+ var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range;
+ var bound = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ bound.point = ringPoint;
+ bound.lineStart = ringStart;
+ bound.lineEnd = ringEnd;
+ dλSum = 0;
+ d3_geo_area.polygonStart();
+ },
+ polygonEnd: function() {
+ d3_geo_area.polygonEnd();
+ bound.point = point;
+ bound.lineStart = lineStart;
+ bound.lineEnd = lineEnd;
+ if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90;
+ range[0] = λ0, range[1] = λ1;
+ }
+ };
+ function point(λ, φ) {
+ ranges.push(range = [ λ0 = λ, λ1 = λ ]);
+ if (φ < φ0) φ0 = φ;
+ if (φ > φ1) φ1 = φ;
+ }
+ function linePoint(λ, φ) {
+ var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]);
+ if (p0) {
+ var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal);
+ d3_geo_cartesianNormalize(inflection);
+ inflection = d3_geo_spherical(inflection);
+ var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180;
+ if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
+ var φi = inflection[1] * d3_degrees;
+ if (φi > φ1) φ1 = φi;
+ } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
+ var φi = -inflection[1] * d3_degrees;
+ if (φi < φ0) φ0 = φi;
+ } else {
+ if (φ < φ0) φ0 = φ;
+ if (φ > φ1) φ1 = φ;
+ }
+ if (antimeridian) {
+ if (λ < λ_) {
+ if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
+ } else {
+ if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
+ }
+ } else {
+ if (λ1 >= λ0) {
+ if (λ < λ0) λ0 = λ;
+ if (λ > λ1) λ1 = λ;
+ } else {
+ if (λ > λ_) {
+ if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
+ } else {
+ if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
+ }
+ }
+ }
+ } else {
+ point(λ, φ);
+ }
+ p0 = p, λ_ = λ;
+ }
+ function lineStart() {
+ bound.point = linePoint;
+ }
+ function lineEnd() {
+ range[0] = λ0, range[1] = λ1;
+ bound.point = point;
+ p0 = null;
+ }
+ function ringPoint(λ, φ) {
+ if (p0) {
+ var dλ = λ - λ_;
+ dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ;
+ } else λ__ = λ, φ__ = φ;
+ d3_geo_area.point(λ, φ);
+ linePoint(λ, φ);
+ }
+ function ringStart() {
+ d3_geo_area.lineStart();
+ }
+ function ringEnd() {
+ ringPoint(λ__, φ__);
+ d3_geo_area.lineEnd();
+ if (abs(dλSum) > ε) λ0 = -(λ1 = 180);
+ range[0] = λ0, range[1] = λ1;
+ p0 = null;
+ }
+ function angle(λ0, λ1) {
+ return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1;
+ }
+ function compareRanges(a, b) {
+ return a[0] - b[0];
+ }
+ function withinRange(x, range) {
+ return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
+ }
+ return function(feature) {
+ φ1 = λ1 = -(λ0 = φ0 = Infinity);
+ ranges = [];
+ d3.geo.stream(feature, bound);
+ var n = ranges.length;
+ if (n) {
+ ranges.sort(compareRanges);
+ for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) {
+ b = ranges[i];
+ if (withinRange(b[0], a) || withinRange(b[1], a)) {
+ if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];
+ if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];
+ } else {
+ merged.push(a = b);
+ }
+ }
+ var best = -Infinity, dλ;
+ for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) {
+ b = merged[i];
+ if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1];
+ }
+ }
+ ranges = range = null;
+ return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ];
+ };
+ }();
+ d3.geo.centroid = function(object) {
+ d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
+ d3.geo.stream(object, d3_geo_centroid);
+ var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z;
+ if (m < ε2) {
+ x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1;
+ if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0;
+ m = x * x + y * y + z * z;
+ if (m < ε2) return [ NaN, NaN ];
+ }
+ return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ];
+ };
+ var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2;
+ var d3_geo_centroid = {
+ sphere: d3_noop,
+ point: d3_geo_centroidPoint,
+ lineStart: d3_geo_centroidLineStart,
+ lineEnd: d3_geo_centroidLineEnd,
+ polygonStart: function() {
+ d3_geo_centroid.lineStart = d3_geo_centroidRingStart;
+ },
+ polygonEnd: function() {
+ d3_geo_centroid.lineStart = d3_geo_centroidLineStart;
+ }
+ };
+ function d3_geo_centroidPoint(λ, φ) {
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians);
+ d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ));
+ }
+ function d3_geo_centroidPointXYZ(x, y, z) {
+ ++d3_geo_centroidW0;
+ d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0;
+ d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0;
+ d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0;
+ }
+ function d3_geo_centroidLineStart() {
+ var x0, y0, z0;
+ d3_geo_centroid.point = function(λ, φ) {
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians);
+ x0 = cosφ * Math.cos(λ);
+ y0 = cosφ * Math.sin(λ);
+ z0 = Math.sin(φ);
+ d3_geo_centroid.point = nextPoint;
+ d3_geo_centroidPointXYZ(x0, y0, z0);
+ };
+ function nextPoint(λ, φ) {
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);
+ d3_geo_centroidW1 += w;
+ d3_geo_centroidX1 += w * (x0 + (x0 = x));
+ d3_geo_centroidY1 += w * (y0 + (y0 = y));
+ d3_geo_centroidZ1 += w * (z0 + (z0 = z));
+ d3_geo_centroidPointXYZ(x0, y0, z0);
+ }
+ }
+ function d3_geo_centroidLineEnd() {
+ d3_geo_centroid.point = d3_geo_centroidPoint;
+ }
+ function d3_geo_centroidRingStart() {
+ var λ00, φ00, x0, y0, z0;
+ d3_geo_centroid.point = function(λ, φ) {
+ λ00 = λ, φ00 = φ;
+ d3_geo_centroid.point = nextPoint;
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians);
+ x0 = cosφ * Math.cos(λ);
+ y0 = cosφ * Math.sin(λ);
+ z0 = Math.sin(φ);
+ d3_geo_centroidPointXYZ(x0, y0, z0);
+ };
+ d3_geo_centroid.lineEnd = function() {
+ nextPoint(λ00, φ00);
+ d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd;
+ d3_geo_centroid.point = d3_geo_centroidPoint;
+ };
+ function nextPoint(λ, φ) {
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u);
+ d3_geo_centroidX2 += v * cx;
+ d3_geo_centroidY2 += v * cy;
+ d3_geo_centroidZ2 += v * cz;
+ d3_geo_centroidW1 += w;
+ d3_geo_centroidX1 += w * (x0 + (x0 = x));
+ d3_geo_centroidY1 += w * (y0 + (y0 = y));
+ d3_geo_centroidZ1 += w * (z0 + (z0 = z));
+ d3_geo_centroidPointXYZ(x0, y0, z0);
+ }
+ }
+ function d3_geo_compose(a, b) {
+ function compose(x, y) {
+ return x = a(x, y), b(x[0], x[1]);
+ }
+ if (a.invert && b.invert) compose.invert = function(x, y) {
+ return x = b.invert(x, y), x && a.invert(x[0], x[1]);
+ };
+ return compose;
+ }
+ function d3_true() {
+ return true;
+ }
+ function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
+ var subject = [], clip = [];
+ segments.forEach(function(segment) {
+ if ((n = segment.length - 1) <= 0) return;
+ var n, p0 = segment[0], p1 = segment[n];
+ if (d3_geo_sphericalEqual(p0, p1)) {
+ listener.lineStart();
+ for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]);
+ listener.lineEnd();
+ return;
+ }
+ var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false);
+ a.o = b;
+ subject.push(a);
+ clip.push(b);
+ a = new d3_geo_clipPolygonIntersection(p1, segment, null, false);
+ b = new d3_geo_clipPolygonIntersection(p1, null, a, true);
+ a.o = b;
+ subject.push(a);
+ clip.push(b);
+ });
+ clip.sort(compare);
+ d3_geo_clipPolygonLinkCircular(subject);
+ d3_geo_clipPolygonLinkCircular(clip);
+ if (!subject.length) return;
+ for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) {
+ clip[i].e = entry = !entry;
+ }
+ var start = subject[0], points, point;
+ while (1) {
+ var current = start, isSubject = true;
+ while (current.v) if ((current = current.n) === start) return;
+ points = current.z;
+ listener.lineStart();
+ do {
+ current.v = current.o.v = true;
+ if (current.e) {
+ if (isSubject) {
+ for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]);
+ } else {
+ interpolate(current.x, current.n.x, 1, listener);
+ }
+ current = current.n;
+ } else {
+ if (isSubject) {
+ points = current.p.z;
+ for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]);
+ } else {
+ interpolate(current.x, current.p.x, -1, listener);
+ }
+ current = current.p;
+ }
+ current = current.o;
+ points = current.z;
+ isSubject = !isSubject;
+ } while (!current.v);
+ listener.lineEnd();
+ }
+ }
+ function d3_geo_clipPolygonLinkCircular(array) {
+ if (!(n = array.length)) return;
+ var n, i = 0, a = array[0], b;
+ while (++i < n) {
+ a.n = b = array[i];
+ b.p = a;
+ a = b;
+ }
+ a.n = b = array[0];
+ b.p = a;
+ }
+ function d3_geo_clipPolygonIntersection(point, points, other, entry) {
+ this.x = point;
+ this.z = points;
+ this.o = other;
+ this.e = entry;
+ this.v = false;
+ this.n = this.p = null;
+ }
+ function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) {
+ return function(rotate, listener) {
+ var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]);
+ var clip = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ clip.point = pointRing;
+ clip.lineStart = ringStart;
+ clip.lineEnd = ringEnd;
+ segments = [];
+ polygon = [];
+ },
+ polygonEnd: function() {
+ clip.point = point;
+ clip.lineStart = lineStart;
+ clip.lineEnd = lineEnd;
+ segments = d3.merge(segments);
+ var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);
+ if (segments.length) {
+ if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
+ d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);
+ } else if (clipStartInside) {
+ if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
+ listener.lineStart();
+ interpolate(null, null, 1, listener);
+ listener.lineEnd();
+ }
+ if (polygonStarted) listener.polygonEnd(), polygonStarted = false;
+ segments = polygon = null;
+ },
+ sphere: function() {
+ listener.polygonStart();
+ listener.lineStart();
+ interpolate(null, null, 1, listener);
+ listener.lineEnd();
+ listener.polygonEnd();
+ }
+ };
+ function point(λ, φ) {
+ var point = rotate(λ, φ);
+ if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ);
+ }
+ function pointLine(λ, φ) {
+ var point = rotate(λ, φ);
+ line.point(point[0], point[1]);
+ }
+ function lineStart() {
+ clip.point = pointLine;
+ line.lineStart();
+ }
+ function lineEnd() {
+ clip.point = point;
+ line.lineEnd();
+ }
+ var segments;
+ var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring;
+ function pointRing(λ, φ) {
+ ring.push([ λ, φ ]);
+ var point = rotate(λ, φ);
+ ringListener.point(point[0], point[1]);
+ }
+ function ringStart() {
+ ringListener.lineStart();
+ ring = [];
+ }
+ function ringEnd() {
+ pointRing(ring[0][0], ring[0][1]);
+ ringListener.lineEnd();
+ var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length;
+ ring.pop();
+ polygon.push(ring);
+ ring = null;
+ if (!n) return;
+ if (clean & 1) {
+ segment = ringSegments[0];
+ var n = segment.length - 1, i = -1, point;
+ if (n > 0) {
+ if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
+ listener.lineStart();
+ while (++i < n) listener.point((point = segment[i])[0], point[1]);
+ listener.lineEnd();
+ }
+ return;
+ }
+ if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
+ segments.push(ringSegments.filter(d3_geo_clipSegmentLength1));
+ }
+ return clip;
+ };
+ }
+ function d3_geo_clipSegmentLength1(segment) {
+ return segment.length > 1;
+ }
+ function d3_geo_clipBufferListener() {
+ var lines = [], line;
+ return {
+ lineStart: function() {
+ lines.push(line = []);
+ },
+ point: function(λ, φ) {
+ line.push([ λ, φ ]);
+ },
+ lineEnd: d3_noop,
+ buffer: function() {
+ var buffer = lines;
+ lines = [];
+ line = null;
+ return buffer;
+ },
+ rejoin: function() {
+ if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
+ }
+ };
+ }
+ function d3_geo_clipSort(a, b) {
+ return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);
+ }
+ var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]);
+ function d3_geo_clipAntimeridianLine(listener) {
+ var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;
+ return {
+ lineStart: function() {
+ listener.lineStart();
+ clean = 1;
+ },
+ point: function(λ1, φ1) {
+ var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0);
+ if (abs(dλ - π) < ε) {
+ listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ);
+ listener.point(sλ0, φ0);
+ listener.lineEnd();
+ listener.lineStart();
+ listener.point(sλ1, φ0);
+ listener.point(λ1, φ0);
+ clean = 0;
+ } else if (sλ0 !== sλ1 && dλ >= π) {
+ if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε;
+ if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε;
+ φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1);
+ listener.point(sλ0, φ0);
+ listener.lineEnd();
+ listener.lineStart();
+ listener.point(sλ1, φ0);
+ clean = 0;
+ }
+ listener.point(λ0 = λ1, φ0 = φ1);
+ sλ0 = sλ1;
+ },
+ lineEnd: function() {
+ listener.lineEnd();
+ λ0 = φ0 = NaN;
+ },
+ clean: function() {
+ return 2 - clean;
+ }
+ };
+ }
+ function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) {
+ var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1);
+ return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2;
+ }
+ function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) {
+ var φ;
+ if (from == null) {
+ φ = direction * halfπ;
+ listener.point(-π, φ);
+ listener.point(0, φ);
+ listener.point(π, φ);
+ listener.point(π, 0);
+ listener.point(π, -φ);
+ listener.point(0, -φ);
+ listener.point(-π, -φ);
+ listener.point(-π, 0);
+ listener.point(-π, φ);
+ } else if (abs(from[0] - to[0]) > ε) {
+ var s = from[0] < to[0] ? π : -π;
+ φ = direction * s / 2;
+ listener.point(-s, φ);
+ listener.point(0, φ);
+ listener.point(s, φ);
+ } else {
+ listener.point(to[0], to[1]);
+ }
+ }
+ function d3_geo_pointInPolygon(point, polygon) {
+ var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
+ d3_geo_areaRingSum.reset();
+ for (var i = 0, n = polygon.length; i < n; ++i) {
+ var ring = polygon[i], m = ring.length;
+ if (!m) continue;
+ var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;
+ while (true) {
+ if (j === m) j = 0;
+ point = ring[j];
+ var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ;
+ d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));
+ polarAngle += antimeridian ? dλ + sdλ * τ : dλ;
+ if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
+ var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
+ d3_geo_cartesianNormalize(arc);
+ var intersection = d3_geo_cartesianCross(meridianNormal, arc);
+ d3_geo_cartesianNormalize(intersection);
+ var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]);
+ if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {
+ winding += antimeridian ^ dλ >= 0 ? 1 : -1;
+ }
+ }
+ if (!j++) break;
+ λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;
+ }
+ }
+ return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1;
+ }
+ function d3_geo_clipCircle(radius) {
+ var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);
+ return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);
+ function visible(λ, φ) {
+ return Math.cos(λ) * Math.cos(φ) > cr;
+ }
+ function clipLine(listener) {
+ var point0, c0, v0, v00, clean;
+ return {
+ lineStart: function() {
+ v00 = v0 = false;
+ clean = 1;
+ },
+ point: function(λ, φ) {
+ var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;
+ if (!point0 && (v00 = v0 = v)) listener.lineStart();
+ if (v !== v0) {
+ point2 = intersect(point0, point1);
+ if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) {
+ point1[0] += ε;
+ point1[1] += ε;
+ v = visible(point1[0], point1[1]);
+ }
+ }
+ if (v !== v0) {
+ clean = 0;
+ if (v) {
+ listener.lineStart();
+ point2 = intersect(point1, point0);
+ listener.point(point2[0], point2[1]);
+ } else {
+ point2 = intersect(point0, point1);
+ listener.point(point2[0], point2[1]);
+ listener.lineEnd();
+ }
+ point0 = point2;
+ } else if (notHemisphere && point0 && smallRadius ^ v) {
+ var t;
+ if (!(c & c0) && (t = intersect(point1, point0, true))) {
+ clean = 0;
+ if (smallRadius) {
+ listener.lineStart();
+ listener.point(t[0][0], t[0][1]);
+ listener.point(t[1][0], t[1][1]);
+ listener.lineEnd();
+ } else {
+ listener.point(t[1][0], t[1][1]);
+ listener.lineEnd();
+ listener.lineStart();
+ listener.point(t[0][0], t[0][1]);
+ }
+ }
+ }
+ if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) {
+ listener.point(point1[0], point1[1]);
+ }
+ point0 = point1, v0 = v, c0 = c;
+ },
+ lineEnd: function() {
+ if (v0) listener.lineEnd();
+ point0 = null;
+ },
+ clean: function() {
+ return clean | (v00 && v0) << 1;
+ }
+ };
+ }
+ function intersect(a, b, two) {
+ var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b);
+ var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
+ if (!determinant) return !two && a;
+ var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2);
+ d3_geo_cartesianAdd(A, B);
+ var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1);
+ if (t2 < 0) return;
+ var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu);
+ d3_geo_cartesianAdd(q, A);
+ q = d3_geo_spherical(q);
+ if (!two) return q;
+ var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z;
+ if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z;
+ var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε;
+ if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z;
+ if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) {
+ var q1 = d3_geo_cartesianScale(u, (-w + t) / uu);
+ d3_geo_cartesianAdd(q1, A);
+ return [ q, d3_geo_spherical(q1) ];
+ }
+ }
+ function code(λ, φ) {
+ var r = smallRadius ? radius : π - radius, code = 0;
+ if (λ < -r) code |= 1; else if (λ > r) code |= 2;
+ if (φ < -r) code |= 4; else if (φ > r) code |= 8;
+ return code;
+ }
+ }
+ function d3_geom_clipLine(x0, y0, x1, y1) {
+ return function(line) {
+ var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;
+ r = x0 - ax;
+ if (!dx && r > 0) return;
+ r /= dx;
+ if (dx < 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ } else if (dx > 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ }
+ r = x1 - ax;
+ if (!dx && r < 0) return;
+ r /= dx;
+ if (dx < 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ } else if (dx > 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ }
+ r = y0 - ay;
+ if (!dy && r > 0) return;
+ r /= dy;
+ if (dy < 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ } else if (dy > 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ }
+ r = y1 - ay;
+ if (!dy && r < 0) return;
+ r /= dy;
+ if (dy < 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ } else if (dy > 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ }
+ if (t0 > 0) line.a = {
+ x: ax + t0 * dx,
+ y: ay + t0 * dy
+ };
+ if (t1 < 1) line.b = {
+ x: ax + t1 * dx,
+ y: ay + t1 * dy
+ };
+ return line;
+ };
+ }
+ var d3_geo_clipExtentMAX = 1e9;
+ d3.geo.clipExtent = function() {
+ var x0, y0, x1, y1, stream, clip, clipExtent = {
+ stream: function(output) {
+ if (stream) stream.valid = false;
+ stream = clip(output);
+ stream.valid = true;
+ return stream;
+ },
+ extent: function(_) {
+ if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
+ clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]);
+ if (stream) stream.valid = false, stream = null;
+ return clipExtent;
+ }
+ };
+ return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]);
+ };
+ function d3_geo_clipExtent(x0, y0, x1, y1) {
+ return function(listener) {
+ var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring;
+ var clip = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ listener = bufferListener;
+ segments = [];
+ polygon = [];
+ clean = true;
+ },
+ polygonEnd: function() {
+ listener = listener_;
+ segments = d3.merge(segments);
+ var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length;
+ if (inside || visible) {
+ listener.polygonStart();
+ if (inside) {
+ listener.lineStart();
+ interpolate(null, null, 1, listener);
+ listener.lineEnd();
+ }
+ if (visible) {
+ d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener);
+ }
+ listener.polygonEnd();
+ }
+ segments = polygon = ring = null;
+ }
+ };
+ function insidePolygon(p) {
+ var wn = 0, n = polygon.length, y = p[1];
+ for (var i = 0; i < n; ++i) {
+ for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) {
+ b = v[j];
+ if (a[1] <= y) {
+ if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn;
+ } else {
+ if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn;
+ }
+ a = b;
+ }
+ }
+ return wn !== 0;
+ }
+ function interpolate(from, to, direction, listener) {
+ var a = 0, a1 = 0;
+ if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) {
+ do {
+ listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);
+ } while ((a = (a + direction + 4) % 4) !== a1);
+ } else {
+ listener.point(to[0], to[1]);
+ }
+ }
+ function pointVisible(x, y) {
+ return x0 <= x && x <= x1 && y0 <= y && y <= y1;
+ }
+ function point(x, y) {
+ if (pointVisible(x, y)) listener.point(x, y);
+ }
+ var x__, y__, v__, x_, y_, v_, first, clean;
+ function lineStart() {
+ clip.point = linePoint;
+ if (polygon) polygon.push(ring = []);
+ first = true;
+ v_ = false;
+ x_ = y_ = NaN;
+ }
+ function lineEnd() {
+ if (segments) {
+ linePoint(x__, y__);
+ if (v__ && v_) bufferListener.rejoin();
+ segments.push(bufferListener.buffer());
+ }
+ clip.point = point;
+ if (v_) listener.lineEnd();
+ }
+ function linePoint(x, y) {
+ x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));
+ y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));
+ var v = pointVisible(x, y);
+ if (polygon) ring.push([ x, y ]);
+ if (first) {
+ x__ = x, y__ = y, v__ = v;
+ first = false;
+ if (v) {
+ listener.lineStart();
+ listener.point(x, y);
+ }
+ } else {
+ if (v && v_) listener.point(x, y); else {
+ var l = {
+ a: {
+ x: x_,
+ y: y_
+ },
+ b: {
+ x: x,
+ y: y
+ }
+ };
+ if (clipLine(l)) {
+ if (!v_) {
+ listener.lineStart();
+ listener.point(l.a.x, l.a.y);
+ }
+ listener.point(l.b.x, l.b.y);
+ if (!v) listener.lineEnd();
+ clean = false;
+ } else if (v) {
+ listener.lineStart();
+ listener.point(x, y);
+ clean = false;
+ }
+ }
+ }
+ x_ = x, y_ = y, v_ = v;
+ }
+ return clip;
+ };
+ function corner(p, direction) {
+ return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
+ }
+ function compare(a, b) {
+ return comparePoints(a.x, b.x);
+ }
+ function comparePoints(a, b) {
+ var ca = corner(a, 1), cb = corner(b, 1);
+ return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];
+ }
+ }
+ function d3_geo_conic(projectAt) {
+ var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1);
+ p.parallels = function(_) {
+ if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ];
+ return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180);
+ };
+ return p;
+ }
+ function d3_geo_conicEqualArea(φ0, φ1) {
+ var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n;
+ function forward(λ, φ) {
+ var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n;
+ return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ];
+ }
+ forward.invert = function(x, y) {
+ var ρ0_y = ρ0 - y;
+ return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ];
+ };
+ return forward;
+ }
+ (d3.geo.conicEqualArea = function() {
+ return d3_geo_conic(d3_geo_conicEqualArea);
+ }).raw = d3_geo_conicEqualArea;
+ d3.geo.albers = function() {
+ return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);
+ };
+ d3.geo.albersUsa = function() {
+ var lower48 = d3.geo.albers();
+ var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);
+ var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]);
+ var point, pointStream = {
+ point: function(x, y) {
+ point = [ x, y ];
+ }
+ }, lower48Point, alaskaPoint, hawaiiPoint;
+ function albersUsa(coordinates) {
+ var x = coordinates[0], y = coordinates[1];
+ point = null;
+ (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y);
+ return point;
+ }
+ albersUsa.invert = function(coordinates) {
+ var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
+ return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates);
+ };
+ albersUsa.stream = function(stream) {
+ var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream);
+ return {
+ point: function(x, y) {
+ lower48Stream.point(x, y);
+ alaskaStream.point(x, y);
+ hawaiiStream.point(x, y);
+ },
+ sphere: function() {
+ lower48Stream.sphere();
+ alaskaStream.sphere();
+ hawaiiStream.sphere();
+ },
+ lineStart: function() {
+ lower48Stream.lineStart();
+ alaskaStream.lineStart();
+ hawaiiStream.lineStart();
+ },
+ lineEnd: function() {
+ lower48Stream.lineEnd();
+ alaskaStream.lineEnd();
+ hawaiiStream.lineEnd();
+ },
+ polygonStart: function() {
+ lower48Stream.polygonStart();
+ alaskaStream.polygonStart();
+ hawaiiStream.polygonStart();
+ },
+ polygonEnd: function() {
+ lower48Stream.polygonEnd();
+ alaskaStream.polygonEnd();
+ hawaiiStream.polygonEnd();
+ }
+ };
+ };
+ albersUsa.precision = function(_) {
+ if (!arguments.length) return lower48.precision();
+ lower48.precision(_);
+ alaska.precision(_);
+ hawaii.precision(_);
+ return albersUsa;
+ };
+ albersUsa.scale = function(_) {
+ if (!arguments.length) return lower48.scale();
+ lower48.scale(_);
+ alaska.scale(_ * .35);
+ hawaii.scale(_);
+ return albersUsa.translate(lower48.translate());
+ };
+ albersUsa.translate = function(_) {
+ if (!arguments.length) return lower48.translate();
+ var k = lower48.scale(), x = +_[0], y = +_[1];
+ lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point;
+ alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
+ hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
+ return albersUsa;
+ };
+ return albersUsa.scale(1070);
+ };
+ var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = {
+ point: d3_noop,
+ lineStart: d3_noop,
+ lineEnd: d3_noop,
+ polygonStart: function() {
+ d3_geo_pathAreaPolygon = 0;
+ d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart;
+ },
+ polygonEnd: function() {
+ d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop;
+ d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2);
+ }
+ };
+ function d3_geo_pathAreaRingStart() {
+ var x00, y00, x0, y0;
+ d3_geo_pathArea.point = function(x, y) {
+ d3_geo_pathArea.point = nextPoint;
+ x00 = x0 = x, y00 = y0 = y;
+ };
+ function nextPoint(x, y) {
+ d3_geo_pathAreaPolygon += y0 * x - x0 * y;
+ x0 = x, y0 = y;
+ }
+ d3_geo_pathArea.lineEnd = function() {
+ nextPoint(x00, y00);
+ };
+ }
+ var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1;
+ var d3_geo_pathBounds = {
+ point: d3_geo_pathBoundsPoint,
+ lineStart: d3_noop,
+ lineEnd: d3_noop,
+ polygonStart: d3_noop,
+ polygonEnd: d3_noop
+ };
+ function d3_geo_pathBoundsPoint(x, y) {
+ if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;
+ if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;
+ if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;
+ if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;
+ }
+ function d3_geo_pathBuffer() {
+ var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = [];
+ var stream = {
+ point: point,
+ lineStart: function() {
+ stream.point = pointLineStart;
+ },
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ stream.lineEnd = lineEndPolygon;
+ },
+ polygonEnd: function() {
+ stream.lineEnd = lineEnd;
+ stream.point = point;
+ },
+ pointRadius: function(_) {
+ pointCircle = d3_geo_pathBufferCircle(_);
+ return stream;
+ },
+ result: function() {
+ if (buffer.length) {
+ var result = buffer.join("");
+ buffer = [];
+ return result;
+ }
+ }
+ };
+ function point(x, y) {
+ buffer.push("M", x, ",", y, pointCircle);
+ }
+ function pointLineStart(x, y) {
+ buffer.push("M", x, ",", y);
+ stream.point = pointLine;
+ }
+ function pointLine(x, y) {
+ buffer.push("L", x, ",", y);
+ }
+ function lineEnd() {
+ stream.point = point;
+ }
+ function lineEndPolygon() {
+ buffer.push("Z");
+ }
+ return stream;
+ }
+ function d3_geo_pathBufferCircle(radius) {
+ return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z";
+ }
+ var d3_geo_pathCentroid = {
+ point: d3_geo_pathCentroidPoint,
+ lineStart: d3_geo_pathCentroidLineStart,
+ lineEnd: d3_geo_pathCentroidLineEnd,
+ polygonStart: function() {
+ d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart;
+ },
+ polygonEnd: function() {
+ d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
+ d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart;
+ d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd;
+ }
+ };
+ function d3_geo_pathCentroidPoint(x, y) {
+ d3_geo_centroidX0 += x;
+ d3_geo_centroidY0 += y;
+ ++d3_geo_centroidZ0;
+ }
+ function d3_geo_pathCentroidLineStart() {
+ var x0, y0;
+ d3_geo_pathCentroid.point = function(x, y) {
+ d3_geo_pathCentroid.point = nextPoint;
+ d3_geo_pathCentroidPoint(x0 = x, y0 = y);
+ };
+ function nextPoint(x, y) {
+ var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
+ d3_geo_centroidX1 += z * (x0 + x) / 2;
+ d3_geo_centroidY1 += z * (y0 + y) / 2;
+ d3_geo_centroidZ1 += z;
+ d3_geo_pathCentroidPoint(x0 = x, y0 = y);
+ }
+ }
+ function d3_geo_pathCentroidLineEnd() {
+ d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
+ }
+ function d3_geo_pathCentroidRingStart() {
+ var x00, y00, x0, y0;
+ d3_geo_pathCentroid.point = function(x, y) {
+ d3_geo_pathCentroid.point = nextPoint;
+ d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y);
+ };
+ function nextPoint(x, y) {
+ var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
+ d3_geo_centroidX1 += z * (x0 + x) / 2;
+ d3_geo_centroidY1 += z * (y0 + y) / 2;
+ d3_geo_centroidZ1 += z;
+ z = y0 * x - x0 * y;
+ d3_geo_centroidX2 += z * (x0 + x);
+ d3_geo_centroidY2 += z * (y0 + y);
+ d3_geo_centroidZ2 += z * 3;
+ d3_geo_pathCentroidPoint(x0 = x, y0 = y);
+ }
+ d3_geo_pathCentroid.lineEnd = function() {
+ nextPoint(x00, y00);
+ };
+ }
+ function d3_geo_pathContext(context) {
+ var pointRadius = 4.5;
+ var stream = {
+ point: point,
+ lineStart: function() {
+ stream.point = pointLineStart;
+ },
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ stream.lineEnd = lineEndPolygon;
+ },
+ polygonEnd: function() {
+ stream.lineEnd = lineEnd;
+ stream.point = point;
+ },
+ pointRadius: function(_) {
+ pointRadius = _;
+ return stream;
+ },
+ result: d3_noop
+ };
+ function point(x, y) {
+ context.moveTo(x + pointRadius, y);
+ context.arc(x, y, pointRadius, 0, τ);
+ }
+ function pointLineStart(x, y) {
+ context.moveTo(x, y);
+ stream.point = pointLine;
+ }
+ function pointLine(x, y) {
+ context.lineTo(x, y);
+ }
+ function lineEnd() {
+ stream.point = point;
+ }
+ function lineEndPolygon() {
+ context.closePath();
+ }
+ return stream;
+ }
+ function d3_geo_resample(project) {
+ var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16;
+ function resample(stream) {
+ return (maxDepth ? resampleRecursive : resampleNone)(stream);
+ }
+ function resampleNone(stream) {
+ return d3_geo_transformPoint(stream, function(x, y) {
+ x = project(x, y);
+ stream.point(x[0], x[1]);
+ });
+ }
+ function resampleRecursive(stream) {
+ var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0;
+ var resample = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ stream.polygonStart();
+ resample.lineStart = ringStart;
+ },
+ polygonEnd: function() {
+ stream.polygonEnd();
+ resample.lineStart = lineStart;
+ }
+ };
+ function point(x, y) {
+ x = project(x, y);
+ stream.point(x[0], x[1]);
+ }
+ function lineStart() {
+ x0 = NaN;
+ resample.point = linePoint;
+ stream.lineStart();
+ }
+ function linePoint(λ, φ) {
+ var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ);
+ resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
+ stream.point(x0, y0);
+ }
+ function lineEnd() {
+ resample.point = point;
+ stream.lineEnd();
+ }
+ function ringStart() {
+ lineStart();
+ resample.point = ringPoint;
+ resample.lineEnd = ringEnd;
+ }
+ function ringPoint(λ, φ) {
+ linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;
+ resample.point = linePoint;
+ }
+ function ringEnd() {
+ resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream);
+ resample.lineEnd = lineEnd;
+ lineEnd();
+ }
+ return resample;
+ }
+ function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) {
+ var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy;
+ if (d2 > 4 * δ2 && depth--) {
+ var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2;
+ if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
+ resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream);
+ stream.point(x2, y2);
+ resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream);
+ }
+ }
+ }
+ resample.precision = function(_) {
+ if (!arguments.length) return Math.sqrt(δ2);
+ maxDepth = (δ2 = _ * _) > 0 && 16;
+ return resample;
+ };
+ return resample;
+ }
+ d3.geo.path = function() {
+ var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream;
+ function path(object) {
+ if (object) {
+ if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
+ if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream);
+ d3.geo.stream(object, cacheStream);
+ }
+ return contextStream.result();
+ }
+ path.area = function(object) {
+ d3_geo_pathAreaSum = 0;
+ d3.geo.stream(object, projectStream(d3_geo_pathArea));
+ return d3_geo_pathAreaSum;
+ };
+ path.centroid = function(object) {
+ d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
+ d3.geo.stream(object, projectStream(d3_geo_pathCentroid));
+ return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ];
+ };
+ path.bounds = function(object) {
+ d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity);
+ d3.geo.stream(object, projectStream(d3_geo_pathBounds));
+ return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ];
+ };
+ path.projection = function(_) {
+ if (!arguments.length) return projection;
+ projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity;
+ return reset();
+ };
+ path.context = function(_) {
+ if (!arguments.length) return context;
+ contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_);
+ if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
+ return reset();
+ };
+ path.pointRadius = function(_) {
+ if (!arguments.length) return pointRadius;
+ pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_);
+ return path;
+ };
+ function reset() {
+ cacheStream = null;
+ return path;
+ }
+ return path.projection(d3.geo.albersUsa()).context(null);
+ };
+ function d3_geo_pathProjectStream(project) {
+ var resample = d3_geo_resample(function(x, y) {
+ return project([ x * d3_degrees, y * d3_degrees ]);
+ });
+ return function(stream) {
+ return d3_geo_projectionRadians(resample(stream));
+ };
+ }
+ d3.geo.transform = function(methods) {
+ return {
+ stream: function(stream) {
+ var transform = new d3_geo_transform(stream);
+ for (var k in methods) transform[k] = methods[k];
+ return transform;
+ }
+ };
+ };
+ function d3_geo_transform(stream) {
+ this.stream = stream;
+ }
+ d3_geo_transform.prototype = {
+ point: function(x, y) {
+ this.stream.point(x, y);
+ },
+ sphere: function() {
+ this.stream.sphere();
+ },
+ lineStart: function() {
+ this.stream.lineStart();
+ },
+ lineEnd: function() {
+ this.stream.lineEnd();
+ },
+ polygonStart: function() {
+ this.stream.polygonStart();
+ },
+ polygonEnd: function() {
+ this.stream.polygonEnd();
+ }
+ };
+ function d3_geo_transformPoint(stream, point) {
+ return {
+ point: point,
+ sphere: function() {
+ stream.sphere();
+ },
+ lineStart: function() {
+ stream.lineStart();
+ },
+ lineEnd: function() {
+ stream.lineEnd();
+ },
+ polygonStart: function() {
+ stream.polygonStart();
+ },
+ polygonEnd: function() {
+ stream.polygonEnd();
+ }
+ };
+ }
+ d3.geo.projection = d3_geo_projection;
+ d3.geo.projectionMutator = d3_geo_projectionMutator;
+ function d3_geo_projection(project) {
+ return d3_geo_projectionMutator(function() {
+ return project;
+ })();
+ }
+ function d3_geo_projectionMutator(projectAt) {
+ var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {
+ x = project(x, y);
+ return [ x[0] * k + δx, δy - x[1] * k ];
+ }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;
+ function projection(point) {
+ point = projectRotate(point[0] * d3_radians, point[1] * d3_radians);
+ return [ point[0] * k + δx, δy - point[1] * k ];
+ }
+ function invert(point) {
+ point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k);
+ return point && [ point[0] * d3_degrees, point[1] * d3_degrees ];
+ }
+ projection.stream = function(output) {
+ if (stream) stream.valid = false;
+ stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output))));
+ stream.valid = true;
+ return stream;
+ };
+ projection.clipAngle = function(_) {
+ if (!arguments.length) return clipAngle;
+ preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians);
+ return invalidate();
+ };
+ projection.clipExtent = function(_) {
+ if (!arguments.length) return clipExtent;
+ clipExtent = _;
+ postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity;
+ return invalidate();
+ };
+ projection.scale = function(_) {
+ if (!arguments.length) return k;
+ k = +_;
+ return reset();
+ };
+ projection.translate = function(_) {
+ if (!arguments.length) return [ x, y ];
+ x = +_[0];
+ y = +_[1];
+ return reset();
+ };
+ projection.center = function(_) {
+ if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ];
+ λ = _[0] % 360 * d3_radians;
+ φ = _[1] % 360 * d3_radians;
+ return reset();
+ };
+ projection.rotate = function(_) {
+ if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ];
+ δλ = _[0] % 360 * d3_radians;
+ δφ = _[1] % 360 * d3_radians;
+ δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0;
+ return reset();
+ };
+ d3.rebind(projection, projectResample, "precision");
+ function reset() {
+ projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project);
+ var center = project(λ, φ);
+ δx = x - center[0] * k;
+ δy = y + center[1] * k;
+ return invalidate();
+ }
+ function invalidate() {
+ if (stream) stream.valid = false, stream = null;
+ return projection;
+ }
+ return function() {
+ project = projectAt.apply(this, arguments);
+ projection.invert = project.invert && invert;
+ return reset();
+ };
+ }
+ function d3_geo_projectionRadians(stream) {
+ return d3_geo_transformPoint(stream, function(x, y) {
+ stream.point(x * d3_radians, y * d3_radians);
+ });
+ }
+ function d3_geo_equirectangular(λ, φ) {
+ return [ λ, φ ];
+ }
+ (d3.geo.equirectangular = function() {
+ return d3_geo_projection(d3_geo_equirectangular);
+ }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular;
+ d3.geo.rotation = function(rotate) {
+ rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0);
+ function forward(coordinates) {
+ coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
+ return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
+ }
+ forward.invert = function(coordinates) {
+ coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
+ return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
+ };
+ return forward;
+ };
+ function d3_geo_identityRotation(λ, φ) {
+ return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
+ }
+ d3_geo_identityRotation.invert = d3_geo_equirectangular;
+ function d3_geo_rotation(δλ, δφ, δγ) {
+ return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;
+ }
+ function d3_geo_forwardRotationλ(δλ) {
+ return function(λ, φ) {
+ return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
+ };
+ }
+ function d3_geo_rotationλ(δλ) {
+ var rotation = d3_geo_forwardRotationλ(δλ);
+ rotation.invert = d3_geo_forwardRotationλ(-δλ);
+ return rotation;
+ }
+ function d3_geo_rotationφγ(δφ, δγ) {
+ var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ);
+ function rotation(λ, φ) {
+ var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;
+ return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ];
+ }
+ rotation.invert = function(λ, φ) {
+ var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;
+ return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ];
+ };
+ return rotation;
+ }
+ d3.geo.circle = function() {
+ var origin = [ 0, 0 ], angle, precision = 6, interpolate;
+ function circle() {
+ var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = [];
+ interpolate(null, null, 1, {
+ point: function(x, y) {
+ ring.push(x = rotate(x, y));
+ x[0] *= d3_degrees, x[1] *= d3_degrees;
+ }
+ });
+ return {
+ type: "Polygon",
+ coordinates: [ ring ]
+ };
+ }
+ circle.origin = function(x) {
+ if (!arguments.length) return origin;
+ origin = x;
+ return circle;
+ };
+ circle.angle = function(x) {
+ if (!arguments.length) return angle;
+ interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians);
+ return circle;
+ };
+ circle.precision = function(_) {
+ if (!arguments.length) return precision;
+ interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians);
+ return circle;
+ };
+ return circle.angle(90);
+ };
+ function d3_geo_circleInterpolate(radius, precision) {
+ var cr = Math.cos(radius), sr = Math.sin(radius);
+ return function(from, to, direction, listener) {
+ var step = direction * precision;
+ if (from != null) {
+ from = d3_geo_circleAngle(cr, from);
+ to = d3_geo_circleAngle(cr, to);
+ if (direction > 0 ? from < to : from > to) from += direction * τ;
+ } else {
+ from = radius + direction * τ;
+ to = radius - .5 * step;
+ }
+ for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) {
+ listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]);
+ }
+ };
+ }
+ function d3_geo_circleAngle(cr, point) {
+ var a = d3_geo_cartesian(point);
+ a[0] -= cr;
+ d3_geo_cartesianNormalize(a);
+ var angle = d3_acos(-a[1]);
+ return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);
+ }
+ d3.geo.distance = function(a, b) {
+ var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t;
+ return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);
+ };
+ d3.geo.graticule = function() {
+ var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;
+ function graticule() {
+ return {
+ type: "MultiLineString",
+ coordinates: lines()
+ };
+ }
+ function lines() {
+ return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) {
+ return abs(x % DX) > ε;
+ }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) {
+ return abs(y % DY) > ε;
+ }).map(y));
+ }
+ graticule.lines = function() {
+ return lines().map(function(coordinates) {
+ return {
+ type: "LineString",
+ coordinates: coordinates
+ };
+ });
+ };
+ graticule.outline = function() {
+ return {
+ type: "Polygon",
+ coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ]
+ };
+ };
+ graticule.extent = function(_) {
+ if (!arguments.length) return graticule.minorExtent();
+ return graticule.majorExtent(_).minorExtent(_);
+ };
+ graticule.majorExtent = function(_) {
+ if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ];
+ X0 = +_[0][0], X1 = +_[1][0];
+ Y0 = +_[0][1], Y1 = +_[1][1];
+ if (X0 > X1) _ = X0, X0 = X1, X1 = _;
+ if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;
+ return graticule.precision(precision);
+ };
+ graticule.minorExtent = function(_) {
+ if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
+ x0 = +_[0][0], x1 = +_[1][0];
+ y0 = +_[0][1], y1 = +_[1][1];
+ if (x0 > x1) _ = x0, x0 = x1, x1 = _;
+ if (y0 > y1) _ = y0, y0 = y1, y1 = _;
+ return graticule.precision(precision);
+ };
+ graticule.step = function(_) {
+ if (!arguments.length) return graticule.minorStep();
+ return graticule.majorStep(_).minorStep(_);
+ };
+ graticule.majorStep = function(_) {
+ if (!arguments.length) return [ DX, DY ];
+ DX = +_[0], DY = +_[1];
+ return graticule;
+ };
+ graticule.minorStep = function(_) {
+ if (!arguments.length) return [ dx, dy ];
+ dx = +_[0], dy = +_[1];
+ return graticule;
+ };
+ graticule.precision = function(_) {
+ if (!arguments.length) return precision;
+ precision = +_;
+ x = d3_geo_graticuleX(y0, y1, 90);
+ y = d3_geo_graticuleY(x0, x1, precision);
+ X = d3_geo_graticuleX(Y0, Y1, 90);
+ Y = d3_geo_graticuleY(X0, X1, precision);
+ return graticule;
+ };
+ return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]);
+ };
+ function d3_geo_graticuleX(y0, y1, dy) {
+ var y = d3.range(y0, y1 - ε, dy).concat(y1);
+ return function(x) {
+ return y.map(function(y) {
+ return [ x, y ];
+ });
+ };
+ }
+ function d3_geo_graticuleY(x0, x1, dx) {
+ var x = d3.range(x0, x1 - ε, dx).concat(x1);
+ return function(y) {
+ return x.map(function(x) {
+ return [ x, y ];
+ });
+ };
+ }
+ function d3_source(d) {
+ return d.source;
+ }
+ function d3_target(d) {
+ return d.target;
+ }
+ d3.geo.greatArc = function() {
+ var source = d3_source, source_, target = d3_target, target_;
+ function greatArc() {
+ return {
+ type: "LineString",
+ coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ]
+ };
+ }
+ greatArc.distance = function() {
+ return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments));
+ };
+ greatArc.source = function(_) {
+ if (!arguments.length) return source;
+ source = _, source_ = typeof _ === "function" ? null : _;
+ return greatArc;
+ };
+ greatArc.target = function(_) {
+ if (!arguments.length) return target;
+ target = _, target_ = typeof _ === "function" ? null : _;
+ return greatArc;
+ };
+ greatArc.precision = function() {
+ return arguments.length ? greatArc : 0;
+ };
+ return greatArc;
+ };
+ d3.geo.interpolate = function(source, target) {
+ return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians);
+ };
+ function d3_geo_interpolate(x0, y0, x1, y1) {
+ var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d);
+ var interpolate = d ? function(t) {
+ var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;
+ return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ];
+ } : function() {
+ return [ x0 * d3_degrees, y0 * d3_degrees ];
+ };
+ interpolate.distance = d;
+ return interpolate;
+ }
+ d3.geo.length = function(object) {
+ d3_geo_lengthSum = 0;
+ d3.geo.stream(object, d3_geo_length);
+ return d3_geo_lengthSum;
+ };
+ var d3_geo_lengthSum;
+ var d3_geo_length = {
+ sphere: d3_noop,
+ point: d3_noop,
+ lineStart: d3_geo_lengthLineStart,
+ lineEnd: d3_noop,
+ polygonStart: d3_noop,
+ polygonEnd: d3_noop
+ };
+ function d3_geo_lengthLineStart() {
+ var λ0, sinφ0, cosφ0;
+ d3_geo_length.point = function(λ, φ) {
+ λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ);
+ d3_geo_length.point = nextPoint;
+ };
+ d3_geo_length.lineEnd = function() {
+ d3_geo_length.point = d3_geo_length.lineEnd = d3_noop;
+ };
+ function nextPoint(λ, φ) {
+ var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t);
+ d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ);
+ λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ;
+ }
+ }
+ function d3_geo_azimuthal(scale, angle) {
+ function azimuthal(λ, φ) {
+ var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ);
+ return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ];
+ }
+ azimuthal.invert = function(x, y) {
+ var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c);
+ return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ];
+ };
+ return azimuthal;
+ }
+ var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) {
+ return Math.sqrt(2 / (1 + cosλcosφ));
+ }, function(ρ) {
+ return 2 * Math.asin(ρ / 2);
+ });
+ (d3.geo.azimuthalEqualArea = function() {
+ return d3_geo_projection(d3_geo_azimuthalEqualArea);
+ }).raw = d3_geo_azimuthalEqualArea;
+ var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) {
+ var c = Math.acos(cosλcosφ);
+ return c && c / Math.sin(c);
+ }, d3_identity);
+ (d3.geo.azimuthalEquidistant = function() {
+ return d3_geo_projection(d3_geo_azimuthalEquidistant);
+ }).raw = d3_geo_azimuthalEquidistant;
+ function d3_geo_conicConformal(φ0, φ1) {
+ var cosφ0 = Math.cos(φ0), t = function(φ) {
+ return Math.tan(π / 4 + φ / 2);
+ }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;
+ if (!n) return d3_geo_mercator;
+ function forward(λ, φ) {
+ if (F > 0) {
+ if (φ < -halfπ + ε) φ = -halfπ + ε;
+ } else {
+ if (φ > halfπ - ε) φ = halfπ - ε;
+ }
+ var ρ = F / Math.pow(t(φ), n);
+ return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ];
+ }
+ forward.invert = function(x, y) {
+ var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y);
+ return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ];
+ };
+ return forward;
+ }
+ (d3.geo.conicConformal = function() {
+ return d3_geo_conic(d3_geo_conicConformal);
+ }).raw = d3_geo_conicConformal;
+ function d3_geo_conicEquidistant(φ0, φ1) {
+ var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0;
+ if (abs(n) < ε) return d3_geo_equirectangular;
+ function forward(λ, φ) {
+ var ρ = G - φ;
+ return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ];
+ }
+ forward.invert = function(x, y) {
+ var ρ0_y = G - y;
+ return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ];
+ };
+ return forward;
+ }
+ (d3.geo.conicEquidistant = function() {
+ return d3_geo_conic(d3_geo_conicEquidistant);
+ }).raw = d3_geo_conicEquidistant;
+ var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) {
+ return 1 / cosλcosφ;
+ }, Math.atan);
+ (d3.geo.gnomonic = function() {
+ return d3_geo_projection(d3_geo_gnomonic);
+ }).raw = d3_geo_gnomonic;
+ function d3_geo_mercator(λ, φ) {
+ return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];
+ }
+ d3_geo_mercator.invert = function(x, y) {
+ return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ];
+ };
+ function d3_geo_mercatorProjection(project) {
+ var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto;
+ m.scale = function() {
+ var v = scale.apply(m, arguments);
+ return v === m ? clipAuto ? m.clipExtent(null) : m : v;
+ };
+ m.translate = function() {
+ var v = translate.apply(m, arguments);
+ return v === m ? clipAuto ? m.clipExtent(null) : m : v;
+ };
+ m.clipExtent = function(_) {
+ var v = clipExtent.apply(m, arguments);
+ if (v === m) {
+ if (clipAuto = _ == null) {
+ var k = π * scale(), t = translate();
+ clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]);
+ }
+ } else if (clipAuto) {
+ v = null;
+ }
+ return v;
+ };
+ return m.clipExtent(null);
+ }
+ (d3.geo.mercator = function() {
+ return d3_geo_mercatorProjection(d3_geo_mercator);
+ }).raw = d3_geo_mercator;
+ var d3_geo_orthographic = d3_geo_azimuthal(function() {
+ return 1;
+ }, Math.asin);
+ (d3.geo.orthographic = function() {
+ return d3_geo_projection(d3_geo_orthographic);
+ }).raw = d3_geo_orthographic;
+ var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) {
+ return 1 / (1 + cosλcosφ);
+ }, function(ρ) {
+ return 2 * Math.atan(ρ);
+ });
+ (d3.geo.stereographic = function() {
+ return d3_geo_projection(d3_geo_stereographic);
+ }).raw = d3_geo_stereographic;
+ function d3_geo_transverseMercator(λ, φ) {
+ return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ];
+ }
+ d3_geo_transverseMercator.invert = function(x, y) {
+ return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ];
+ };
+ (d3.geo.transverseMercator = function() {
+ var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate;
+ projection.center = function(_) {
+ return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);
+ };
+ projection.rotate = function(_) {
+ return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(),
+ [ _[0], _[1], _[2] - 90 ]);
+ };
+ return rotate([ 0, 0, 90 ]);
+ }).raw = d3_geo_transverseMercator;
+ d3.geom = {};
+ function d3_geom_pointX(d) {
+ return d[0];
+ }
+ function d3_geom_pointY(d) {
+ return d[1];
+ }
+ d3.geom.hull = function(vertices) {
+ var x = d3_geom_pointX, y = d3_geom_pointY;
+ if (arguments.length) return hull(vertices);
+ function hull(data) {
+ if (data.length < 3) return [];
+ var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = [];
+ for (i = 0; i < n; i++) {
+ points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]);
+ }
+ points.sort(d3_geom_hullOrder);
+ for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]);
+ var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints);
+ var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = [];
+ for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]);
+ for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]);
+ return polygon;
+ }
+ hull.x = function(_) {
+ return arguments.length ? (x = _, hull) : x;
+ };
+ hull.y = function(_) {
+ return arguments.length ? (y = _, hull) : y;
+ };
+ return hull;
+ };
+ function d3_geom_hullUpper(points) {
+ var n = points.length, hull = [ 0, 1 ], hs = 2;
+ for (var i = 2; i < n; i++) {
+ while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs;
+ hull[hs++] = i;
+ }
+ return hull.slice(0, hs);
+ }
+ function d3_geom_hullOrder(a, b) {
+ return a[0] - b[0] || a[1] - b[1];
+ }
+ d3.geom.polygon = function(coordinates) {
+ d3_subclass(coordinates, d3_geom_polygonPrototype);
+ return coordinates;
+ };
+ var d3_geom_polygonPrototype = d3.geom.polygon.prototype = [];
+ d3_geom_polygonPrototype.area = function() {
+ var i = -1, n = this.length, a, b = this[n - 1], area = 0;
+ while (++i < n) {
+ a = b;
+ b = this[i];
+ area += a[1] * b[0] - a[0] * b[1];
+ }
+ return area * .5;
+ };
+ d3_geom_polygonPrototype.centroid = function(k) {
+ var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c;
+ if (!arguments.length) k = -1 / (6 * this.area());
+ while (++i < n) {
+ a = b;
+ b = this[i];
+ c = a[0] * b[1] - b[0] * a[1];
+ x += (a[0] + b[0]) * c;
+ y += (a[1] + b[1]) * c;
+ }
+ return [ x * k, y * k ];
+ };
+ d3_geom_polygonPrototype.clip = function(subject) {
+ var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d;
+ while (++i < n) {
+ input = subject.slice();
+ subject.length = 0;
+ b = this[i];
+ c = input[(m = input.length - closed) - 1];
+ j = -1;
+ while (++j < m) {
+ d = input[j];
+ if (d3_geom_polygonInside(d, a, b)) {
+ if (!d3_geom_polygonInside(c, a, b)) {
+ subject.push(d3_geom_polygonIntersect(c, d, a, b));
+ }
+ subject.push(d);
+ } else if (d3_geom_polygonInside(c, a, b)) {
+ subject.push(d3_geom_polygonIntersect(c, d, a, b));
+ }
+ c = d;
+ }
+ if (closed) subject.push(subject[0]);
+ a = b;
+ }
+ return subject;
+ };
+ function d3_geom_polygonInside(p, a, b) {
+ return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);
+ }
+ function d3_geom_polygonIntersect(c, d, a, b) {
+ var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21);
+ return [ x1 + ua * x21, y1 + ua * y21 ];
+ }
+ function d3_geom_polygonClosed(coordinates) {
+ var a = coordinates[0], b = coordinates[coordinates.length - 1];
+ return !(a[0] - b[0] || a[1] - b[1]);
+ }
+ var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = [];
+ function d3_geom_voronoiBeach() {
+ d3_geom_voronoiRedBlackNode(this);
+ this.edge = this.site = this.circle = null;
+ }
+ function d3_geom_voronoiCreateBeach(site) {
+ var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach();
+ beach.site = site;
+ return beach;
+ }
+ function d3_geom_voronoiDetachBeach(beach) {
+ d3_geom_voronoiDetachCircle(beach);
+ d3_geom_voronoiBeaches.remove(beach);
+ d3_geom_voronoiBeachPool.push(beach);
+ d3_geom_voronoiRedBlackNode(beach);
+ }
+ function d3_geom_voronoiRemoveBeach(beach) {
+ var circle = beach.circle, x = circle.x, y = circle.cy, vertex = {
+ x: x,
+ y: y
+ }, previous = beach.P, next = beach.N, disappearing = [ beach ];
+ d3_geom_voronoiDetachBeach(beach);
+ var lArc = previous;
+ while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) {
+ previous = lArc.P;
+ disappearing.unshift(lArc);
+ d3_geom_voronoiDetachBeach(lArc);
+ lArc = previous;
+ }
+ disappearing.unshift(lArc);
+ d3_geom_voronoiDetachCircle(lArc);
+ var rArc = next;
+ while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) {
+ next = rArc.N;
+ disappearing.push(rArc);
+ d3_geom_voronoiDetachBeach(rArc);
+ rArc = next;
+ }
+ disappearing.push(rArc);
+ d3_geom_voronoiDetachCircle(rArc);
+ var nArcs = disappearing.length, iArc;
+ for (iArc = 1; iArc < nArcs; ++iArc) {
+ rArc = disappearing[iArc];
+ lArc = disappearing[iArc - 1];
+ d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);
+ }
+ lArc = disappearing[0];
+ rArc = disappearing[nArcs - 1];
+ rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex);
+ d3_geom_voronoiAttachCircle(lArc);
+ d3_geom_voronoiAttachCircle(rArc);
+ }
+ function d3_geom_voronoiAddBeach(site) {
+ var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._;
+ while (node) {
+ dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x;
+ if (dxl > ε) node = node.L; else {
+ dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix);
+ if (dxr > ε) {
+ if (!node.R) {
+ lArc = node;
+ break;
+ }
+ node = node.R;
+ } else {
+ if (dxl > -ε) {
+ lArc = node.P;
+ rArc = node;
+ } else if (dxr > -ε) {
+ lArc = node;
+ rArc = node.N;
+ } else {
+ lArc = rArc = node;
+ }
+ break;
+ }
+ }
+ }
+ var newArc = d3_geom_voronoiCreateBeach(site);
+ d3_geom_voronoiBeaches.insert(lArc, newArc);
+ if (!lArc && !rArc) return;
+ if (lArc === rArc) {
+ d3_geom_voronoiDetachCircle(lArc);
+ rArc = d3_geom_voronoiCreateBeach(lArc.site);
+ d3_geom_voronoiBeaches.insert(newArc, rArc);
+ newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
+ d3_geom_voronoiAttachCircle(lArc);
+ d3_geom_voronoiAttachCircle(rArc);
+ return;
+ }
+ if (!rArc) {
+ newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
+ return;
+ }
+ d3_geom_voronoiDetachCircle(lArc);
+ d3_geom_voronoiDetachCircle(rArc);
+ var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = {
+ x: (cy * hb - by * hc) / d + ax,
+ y: (bx * hc - cx * hb) / d + ay
+ };
+ d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex);
+ newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex);
+ rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex);
+ d3_geom_voronoiAttachCircle(lArc);
+ d3_geom_voronoiAttachCircle(rArc);
+ }
+ function d3_geom_voronoiLeftBreakPoint(arc, directrix) {
+ var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix;
+ if (!pby2) return rfocx;
+ var lArc = arc.P;
+ if (!lArc) return -Infinity;
+ site = lArc.site;
+ var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix;
+ if (!plby2) return lfocx;
+ var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2;
+ if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;
+ return (rfocx + lfocx) / 2;
+ }
+ function d3_geom_voronoiRightBreakPoint(arc, directrix) {
+ var rArc = arc.N;
+ if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix);
+ var site = arc.site;
+ return site.y === directrix ? site.x : Infinity;
+ }
+ function d3_geom_voronoiCell(site) {
+ this.site = site;
+ this.edges = [];
+ }
+ d3_geom_voronoiCell.prototype.prepare = function() {
+ var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge;
+ while (iHalfEdge--) {
+ edge = halfEdges[iHalfEdge].edge;
+ if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1);
+ }
+ halfEdges.sort(d3_geom_voronoiHalfEdgeOrder);
+ return halfEdges.length;
+ };
+ function d3_geom_voronoiCloseCells(extent) {
+ var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end;
+ while (iCell--) {
+ cell = cells[iCell];
+ if (!cell || !cell.prepare()) continue;
+ halfEdges = cell.edges;
+ nHalfEdges = halfEdges.length;
+ iHalfEdge = 0;
+ while (iHalfEdge < nHalfEdges) {
+ end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y;
+ start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y;
+ if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
+ halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
+ x: x0,
+ y: abs(x2 - x0) < ε ? y2 : y1
+ } : abs(y3 - y1) < ε && x1 - x3 > ε ? {
+ x: abs(y2 - y1) < ε ? x2 : x1,
+ y: y1
+ } : abs(x3 - x1) < ε && y3 - y0 > ε ? {
+ x: x1,
+ y: abs(x2 - x1) < ε ? y2 : y0
+ } : abs(y3 - y0) < ε && x3 - x0 > ε ? {
+ x: abs(y2 - y0) < ε ? x2 : x0,
+ y: y0
+ } : null), cell.site, null));
+ ++nHalfEdges;
+ }
+ }
+ }
+ }
+ function d3_geom_voronoiHalfEdgeOrder(a, b) {
+ return b.angle - a.angle;
+ }
+ function d3_geom_voronoiCircle() {
+ d3_geom_voronoiRedBlackNode(this);
+ this.x = this.y = this.arc = this.site = this.cy = null;
+ }
+ function d3_geom_voronoiAttachCircle(arc) {
+ var lArc = arc.P, rArc = arc.N;
+ if (!lArc || !rArc) return;
+ var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;
+ if (lSite === rSite) return;
+ var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by;
+ var d = 2 * (ax * cy - ay * cx);
+ if (d >= -ε2) return;
+ var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by;
+ var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle();
+ circle.arc = arc;
+ circle.site = cSite;
+ circle.x = x + bx;
+ circle.y = cy + Math.sqrt(x * x + y * y);
+ circle.cy = cy;
+ arc.circle = circle;
+ var before = null, node = d3_geom_voronoiCircles._;
+ while (node) {
+ if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) {
+ if (node.L) node = node.L; else {
+ before = node.P;
+ break;
+ }
+ } else {
+ if (node.R) node = node.R; else {
+ before = node;
+ break;
+ }
+ }
+ }
+ d3_geom_voronoiCircles.insert(before, circle);
+ if (!before) d3_geom_voronoiFirstCircle = circle;
+ }
+ function d3_geom_voronoiDetachCircle(arc) {
+ var circle = arc.circle;
+ if (circle) {
+ if (!circle.P) d3_geom_voronoiFirstCircle = circle.N;
+ d3_geom_voronoiCircles.remove(circle);
+ d3_geom_voronoiCirclePool.push(circle);
+ d3_geom_voronoiRedBlackNode(circle);
+ arc.circle = null;
+ }
+ }
+ function d3_geom_voronoiClipEdges(extent) {
+ var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e;
+ while (i--) {
+ e = edges[i];
+ if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) {
+ e.a = e.b = null;
+ edges.splice(i, 1);
+ }
+ }
+ }
+ function d3_geom_voronoiConnectEdge(edge, extent) {
+ var vb = edge.b;
+ if (vb) return true;
+ var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;
+ if (ry === ly) {
+ if (fx < x0 || fx >= x1) return;
+ if (lx > rx) {
+ if (!va) va = {
+ x: fx,
+ y: y0
+ }; else if (va.y >= y1) return;
+ vb = {
+ x: fx,
+ y: y1
+ };
+ } else {
+ if (!va) va = {
+ x: fx,
+ y: y1
+ }; else if (va.y < y0) return;
+ vb = {
+ x: fx,
+ y: y0
+ };
+ }
+ } else {
+ fm = (lx - rx) / (ry - ly);
+ fb = fy - fm * fx;
+ if (fm < -1 || fm > 1) {
+ if (lx > rx) {
+ if (!va) va = {
+ x: (y0 - fb) / fm,
+ y: y0
+ }; else if (va.y >= y1) return;
+ vb = {
+ x: (y1 - fb) / fm,
+ y: y1
+ };
+ } else {
+ if (!va) va = {
+ x: (y1 - fb) / fm,
+ y: y1
+ }; else if (va.y < y0) return;
+ vb = {
+ x: (y0 - fb) / fm,
+ y: y0
+ };
+ }
+ } else {
+ if (ly < ry) {
+ if (!va) va = {
+ x: x0,
+ y: fm * x0 + fb
+ }; else if (va.x >= x1) return;
+ vb = {
+ x: x1,
+ y: fm * x1 + fb
+ };
+ } else {
+ if (!va) va = {
+ x: x1,
+ y: fm * x1 + fb
+ }; else if (va.x < x0) return;
+ vb = {
+ x: x0,
+ y: fm * x0 + fb
+ };
+ }
+ }
+ }
+ edge.a = va;
+ edge.b = vb;
+ return true;
+ }
+ function d3_geom_voronoiEdge(lSite, rSite) {
+ this.l = lSite;
+ this.r = rSite;
+ this.a = this.b = null;
+ }
+ function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) {
+ var edge = new d3_geom_voronoiEdge(lSite, rSite);
+ d3_geom_voronoiEdges.push(edge);
+ if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va);
+ if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb);
+ d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite));
+ d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite));
+ return edge;
+ }
+ function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) {
+ var edge = new d3_geom_voronoiEdge(lSite, null);
+ edge.a = va;
+ edge.b = vb;
+ d3_geom_voronoiEdges.push(edge);
+ return edge;
+ }
+ function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) {
+ if (!edge.a && !edge.b) {
+ edge.a = vertex;
+ edge.l = lSite;
+ edge.r = rSite;
+ } else if (edge.l === rSite) {
+ edge.b = vertex;
+ } else {
+ edge.a = vertex;
+ }
+ }
+ function d3_geom_voronoiHalfEdge(edge, lSite, rSite) {
+ var va = edge.a, vb = edge.b;
+ this.edge = edge;
+ this.site = lSite;
+ this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y);
+ }
+ d3_geom_voronoiHalfEdge.prototype = {
+ start: function() {
+ return this.edge.l === this.site ? this.edge.a : this.edge.b;
+ },
+ end: function() {
+ return this.edge.l === this.site ? this.edge.b : this.edge.a;
+ }
+ };
+ function d3_geom_voronoiRedBlackTree() {
+ this._ = null;
+ }
+ function d3_geom_voronoiRedBlackNode(node) {
+ node.U = node.C = node.L = node.R = node.P = node.N = null;
+ }
+ d3_geom_voronoiRedBlackTree.prototype = {
+ insert: function(after, node) {
+ var parent, grandpa, uncle;
+ if (after) {
+ node.P = after;
+ node.N = after.N;
+ if (after.N) after.N.P = node;
+ after.N = node;
+ if (after.R) {
+ after = after.R;
+ while (after.L) after = after.L;
+ after.L = node;
+ } else {
+ after.R = node;
+ }
+ parent = after;
+ } else if (this._) {
+ after = d3_geom_voronoiRedBlackFirst(this._);
+ node.P = null;
+ node.N = after;
+ after.P = after.L = node;
+ parent = after;
+ } else {
+ node.P = node.N = null;
+ this._ = node;
+ parent = null;
+ }
+ node.L = node.R = null;
+ node.U = parent;
+ node.C = true;
+ after = node;
+ while (parent && parent.C) {
+ grandpa = parent.U;
+ if (parent === grandpa.L) {
+ uncle = grandpa.R;
+ if (uncle && uncle.C) {
+ parent.C = uncle.C = false;
+ grandpa.C = true;
+ after = grandpa;
+ } else {
+ if (after === parent.R) {
+ d3_geom_voronoiRedBlackRotateLeft(this, parent);
+ after = parent;
+ parent = after.U;
+ }
+ parent.C = false;
+ grandpa.C = true;
+ d3_geom_voronoiRedBlackRotateRight(this, grandpa);
+ }
+ } else {
+ uncle = grandpa.L;
+ if (uncle && uncle.C) {
+ parent.C = uncle.C = false;
+ grandpa.C = true;
+ after = grandpa;
+ } else {
+ if (after === parent.L) {
+ d3_geom_voronoiRedBlackRotateRight(this, parent);
+ after = parent;
+ parent = after.U;
+ }
+ parent.C = false;
+ grandpa.C = true;
+ d3_geom_voronoiRedBlackRotateLeft(this, grandpa);
+ }
+ }
+ parent = after.U;
+ }
+ this._.C = false;
+ },
+ remove: function(node) {
+ if (node.N) node.N.P = node.P;
+ if (node.P) node.P.N = node.N;
+ node.N = node.P = null;
+ var parent = node.U, sibling, left = node.L, right = node.R, next, red;
+ if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right);
+ if (parent) {
+ if (parent.L === node) parent.L = next; else parent.R = next;
+ } else {
+ this._ = next;
+ }
+ if (left && right) {
+ red = next.C;
+ next.C = node.C;
+ next.L = left;
+ left.U = next;
+ if (next !== right) {
+ parent = next.U;
+ next.U = node.U;
+ node = next.R;
+ parent.L = node;
+ next.R = right;
+ right.U = next;
+ } else {
+ next.U = parent;
+ parent = next;
+ node = next.R;
+ }
+ } else {
+ red = node.C;
+ node = next;
+ }
+ if (node) node.U = parent;
+ if (red) return;
+ if (node && node.C) {
+ node.C = false;
+ return;
+ }
+ do {
+ if (node === this._) break;
+ if (node === parent.L) {
+ sibling = parent.R;
+ if (sibling.C) {
+ sibling.C = false;
+ parent.C = true;
+ d3_geom_voronoiRedBlackRotateLeft(this, parent);
+ sibling = parent.R;
+ }
+ if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
+ if (!sibling.R || !sibling.R.C) {
+ sibling.L.C = false;
+ sibling.C = true;
+ d3_geom_voronoiRedBlackRotateRight(this, sibling);
+ sibling = parent.R;
+ }
+ sibling.C = parent.C;
+ parent.C = sibling.R.C = false;
+ d3_geom_voronoiRedBlackRotateLeft(this, parent);
+ node = this._;
+ break;
+ }
+ } else {
+ sibling = parent.L;
+ if (sibling.C) {
+ sibling.C = false;
+ parent.C = true;
+ d3_geom_voronoiRedBlackRotateRight(this, parent);
+ sibling = parent.L;
+ }
+ if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
+ if (!sibling.L || !sibling.L.C) {
+ sibling.R.C = false;
+ sibling.C = true;
+ d3_geom_voronoiRedBlackRotateLeft(this, sibling);
+ sibling = parent.L;
+ }
+ sibling.C = parent.C;
+ parent.C = sibling.L.C = false;
+ d3_geom_voronoiRedBlackRotateRight(this, parent);
+ node = this._;
+ break;
+ }
+ }
+ sibling.C = true;
+ node = parent;
+ parent = parent.U;
+ } while (!node.C);
+ if (node) node.C = false;
+ }
+ };
+ function d3_geom_voronoiRedBlackRotateLeft(tree, node) {
+ var p = node, q = node.R, parent = p.U;
+ if (parent) {
+ if (parent.L === p) parent.L = q; else parent.R = q;
+ } else {
+ tree._ = q;
+ }
+ q.U = parent;
+ p.U = q;
+ p.R = q.L;
+ if (p.R) p.R.U = p;
+ q.L = p;
+ }
+ function d3_geom_voronoiRedBlackRotateRight(tree, node) {
+ var p = node, q = node.L, parent = p.U;
+ if (parent) {
+ if (parent.L === p) parent.L = q; else parent.R = q;
+ } else {
+ tree._ = q;
+ }
+ q.U = parent;
+ p.U = q;
+ p.L = q.R;
+ if (p.L) p.L.U = p;
+ q.R = p;
+ }
+ function d3_geom_voronoiRedBlackFirst(node) {
+ while (node.L) node = node.L;
+ return node;
+ }
+ function d3_geom_voronoi(sites, bbox) {
+ var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;
+ d3_geom_voronoiEdges = [];
+ d3_geom_voronoiCells = new Array(sites.length);
+ d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();
+ d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree();
+ while (true) {
+ circle = d3_geom_voronoiFirstCircle;
+ if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) {
+ if (site.x !== x0 || site.y !== y0) {
+ d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site);
+ d3_geom_voronoiAddBeach(site);
+ x0 = site.x, y0 = site.y;
+ }
+ site = sites.pop();
+ } else if (circle) {
+ d3_geom_voronoiRemoveBeach(circle.arc);
+ } else {
+ break;
+ }
+ }
+ if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox);
+ var diagram = {
+ cells: d3_geom_voronoiCells,
+ edges: d3_geom_voronoiEdges
+ };
+ d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null;
+ return diagram;
+ }
+ function d3_geom_voronoiVertexOrder(a, b) {
+ return b.y - a.y || b.x - a.x;
+ }
+ d3.geom.voronoi = function(points) {
+ var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent;
+ if (points) return voronoi(points);
+ function voronoi(data) {
+ var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1];
+ d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) {
+ var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) {
+ var s = e.start();
+ return [ s.x, s.y ];
+ }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : [];
+ polygon.point = data[i];
+ });
+ return polygons;
+ }
+ function sites(data) {
+ return data.map(function(d, i) {
+ return {
+ x: Math.round(fx(d, i) / ε) * ε,
+ y: Math.round(fy(d, i) / ε) * ε,
+ i: i
+ };
+ });
+ }
+ voronoi.links = function(data) {
+ return d3_geom_voronoi(sites(data)).edges.filter(function(edge) {
+ return edge.l && edge.r;
+ }).map(function(edge) {
+ return {
+ source: data[edge.l.i],
+ target: data[edge.r.i]
+ };
+ });
+ };
+ voronoi.triangles = function(data) {
+ var triangles = [];
+ d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) {
+ var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l;
+ while (++j < m) {
+ e0 = e1;
+ s0 = s1;
+ e1 = edges[j].edge;
+ s1 = e1.l === site ? e1.r : e1.l;
+ if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) {
+ triangles.push([ data[i], data[s0.i], data[s1.i] ]);
+ }
+ }
+ });
+ return triangles;
+ };
+ voronoi.x = function(_) {
+ return arguments.length ? (fx = d3_functor(x = _), voronoi) : x;
+ };
+ voronoi.y = function(_) {
+ return arguments.length ? (fy = d3_functor(y = _), voronoi) : y;
+ };
+ voronoi.clipExtent = function(_) {
+ if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent;
+ clipExtent = _ == null ? d3_geom_voronoiClipExtent : _;
+ return voronoi;
+ };
+ voronoi.size = function(_) {
+ if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1];
+ return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]);
+ };
+ return voronoi;
+ };
+ var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ];
+ function d3_geom_voronoiTriangleArea(a, b, c) {
+ return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y);
+ }
+ d3.geom.delaunay = function(vertices) {
+ return d3.geom.voronoi().triangles(vertices);
+ };
+ d3.geom.quadtree = function(points, x1, y1, x2, y2) {
+ var x = d3_geom_pointX, y = d3_geom_pointY, compat;
+ if (compat = arguments.length) {
+ x = d3_geom_quadtreeCompatX;
+ y = d3_geom_quadtreeCompatY;
+ if (compat === 3) {
+ y2 = y1;
+ x2 = x1;
+ y1 = x1 = 0;
+ }
+ return quadtree(points);
+ }
+ function quadtree(data) {
+ var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;
+ if (x1 != null) {
+ x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;
+ } else {
+ x2_ = y2_ = -(x1_ = y1_ = Infinity);
+ xs = [], ys = [];
+ n = data.length;
+ if (compat) for (i = 0; i < n; ++i) {
+ d = data[i];
+ if (d.x < x1_) x1_ = d.x;
+ if (d.y < y1_) y1_ = d.y;
+ if (d.x > x2_) x2_ = d.x;
+ if (d.y > y2_) y2_ = d.y;
+ xs.push(d.x);
+ ys.push(d.y);
+ } else for (i = 0; i < n; ++i) {
+ var x_ = +fx(d = data[i], i), y_ = +fy(d, i);
+ if (x_ < x1_) x1_ = x_;
+ if (y_ < y1_) y1_ = y_;
+ if (x_ > x2_) x2_ = x_;
+ if (y_ > y2_) y2_ = y_;
+ xs.push(x_);
+ ys.push(y_);
+ }
+ }
+ var dx = x2_ - x1_, dy = y2_ - y1_;
+ if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy;
+ function insert(n, d, x, y, x1, y1, x2, y2) {
+ if (isNaN(x) || isNaN(y)) return;
+ if (n.leaf) {
+ var nx = n.x, ny = n.y;
+ if (nx != null) {
+ if (abs(nx - x) + abs(ny - y) < .01) {
+ insertChild(n, d, x, y, x1, y1, x2, y2);
+ } else {
+ var nPoint = n.point;
+ n.x = n.y = n.point = null;
+ insertChild(n, nPoint, nx, ny, x1, y1, x2, y2);
+ insertChild(n, d, x, y, x1, y1, x2, y2);
+ }
+ } else {
+ n.x = x, n.y = y, n.point = d;
+ }
+ } else {
+ insertChild(n, d, x, y, x1, y1, x2, y2);
+ }
+ }
+ function insertChild(n, d, x, y, x1, y1, x2, y2) {
+ var xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym, i = below << 1 | right;
+ n.leaf = false;
+ n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());
+ if (right) x1 = xm; else x2 = xm;
+ if (below) y1 = ym; else y2 = ym;
+ insert(n, d, x, y, x1, y1, x2, y2);
+ }
+ var root = d3_geom_quadtreeNode();
+ root.add = function(d) {
+ insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_);
+ };
+ root.visit = function(f) {
+ d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_);
+ };
+ root.find = function(point) {
+ return d3_geom_quadtreeFind(root, point[0], point[1], x1_, y1_, x2_, y2_);
+ };
+ i = -1;
+ if (x1 == null) {
+ while (++i < n) {
+ insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_);
+ }
+ --i;
+ } else data.forEach(root.add);
+ xs = ys = data = d = null;
+ return root;
+ }
+ quadtree.x = function(_) {
+ return arguments.length ? (x = _, quadtree) : x;
+ };
+ quadtree.y = function(_) {
+ return arguments.length ? (y = _, quadtree) : y;
+ };
+ quadtree.extent = function(_) {
+ if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ];
+ if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0],
+ y2 = +_[1][1];
+ return quadtree;
+ };
+ quadtree.size = function(_) {
+ if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ];
+ if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1];
+ return quadtree;
+ };
+ return quadtree;
+ };
+ function d3_geom_quadtreeCompatX(d) {
+ return d.x;
+ }
+ function d3_geom_quadtreeCompatY(d) {
+ return d.y;
+ }
+ function d3_geom_quadtreeNode() {
+ return {
+ leaf: true,
+ nodes: [],
+ point: null,
+ x: null,
+ y: null
+ };
+ }
+ function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {
+ if (!f(node, x1, y1, x2, y2)) {
+ var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes;
+ if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy);
+ if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy);
+ if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2);
+ if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2);
+ }
+ }
+ function d3_geom_quadtreeFind(root, x, y, x0, y0, x3, y3) {
+ var minDistance2 = Infinity, closestPoint;
+ (function find(node, x1, y1, x2, y2) {
+ if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return;
+ if (point = node.point) {
+ var point, dx = x - node.x, dy = y - node.y, distance2 = dx * dx + dy * dy;
+ if (distance2 < minDistance2) {
+ var distance = Math.sqrt(minDistance2 = distance2);
+ x0 = x - distance, y0 = y - distance;
+ x3 = x + distance, y3 = y + distance;
+ closestPoint = point;
+ }
+ }
+ var children = node.nodes, xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym;
+ for (var i = below << 1 | right, j = i + 4; i < j; ++i) {
+ if (node = children[i & 3]) switch (i & 3) {
+ case 0:
+ find(node, x1, y1, xm, ym);
+ break;
+
+ case 1:
+ find(node, xm, y1, x2, ym);
+ break;
+
+ case 2:
+ find(node, x1, ym, xm, y2);
+ break;
+
+ case 3:
+ find(node, xm, ym, x2, y2);
+ break;
+ }
+ }
+ })(root, x0, y0, x3, y3);
+ return closestPoint;
+ }
+ d3.interpolateRgb = d3_interpolateRgb;
+ function d3_interpolateRgb(a, b) {
+ a = d3.rgb(a);
+ b = d3.rgb(b);
+ var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab;
+ return function(t) {
+ return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t));
+ };
+ }
+ d3.interpolateObject = d3_interpolateObject;
+ function d3_interpolateObject(a, b) {
+ var i = {}, c = {}, k;
+ for (k in a) {
+ if (k in b) {
+ i[k] = d3_interpolate(a[k], b[k]);
+ } else {
+ c[k] = a[k];
+ }
+ }
+ for (k in b) {
+ if (!(k in a)) {
+ c[k] = b[k];
+ }
+ }
+ return function(t) {
+ for (k in i) c[k] = i[k](t);
+ return c;
+ };
+ }
+ d3.interpolateNumber = d3_interpolateNumber;
+ function d3_interpolateNumber(a, b) {
+ a = +a, b = +b;
+ return function(t) {
+ return a * (1 - t) + b * t;
+ };
+ }
+ d3.interpolateString = d3_interpolateString;
+ function d3_interpolateString(a, b) {
+ var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
+ a = a + "", b = b + "";
+ while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) {
+ if ((bs = bm.index) > bi) {
+ bs = b.slice(bi, bs);
+ if (s[i]) s[i] += bs; else s[++i] = bs;
+ }
+ if ((am = am[0]) === (bm = bm[0])) {
+ if (s[i]) s[i] += bm; else s[++i] = bm;
+ } else {
+ s[++i] = null;
+ q.push({
+ i: i,
+ x: d3_interpolateNumber(am, bm)
+ });
+ }
+ bi = d3_interpolate_numberB.lastIndex;
+ }
+ if (bi < b.length) {
+ bs = b.slice(bi);
+ if (s[i]) s[i] += bs; else s[++i] = bs;
+ }
+ return s.length < 2 ? q[0] ? (b = q[0].x, function(t) {
+ return b(t) + "";
+ }) : function() {
+ return b;
+ } : (b = q.length, function(t) {
+ for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ });
+ }
+ var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g");
+ d3.interpolate = d3_interpolate;
+ function d3_interpolate(a, b) {
+ var i = d3.interpolators.length, f;
+ while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ;
+ return f;
+ }
+ d3.interpolators = [ function(a, b) {
+ var t = typeof b;
+ return (t === "string" ? d3_rgb_names.has(b.toLowerCase()) || /^(#|rgb\(|hsl\()/i.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);
+ } ];
+ d3.interpolateArray = d3_interpolateArray;
+ function d3_interpolateArray(a, b) {
+ var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i;
+ for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));
+ for (;i < na; ++i) c[i] = a[i];
+ for (;i < nb; ++i) c[i] = b[i];
+ return function(t) {
+ for (i = 0; i < n0; ++i) c[i] = x[i](t);
+ return c;
+ };
+ }
+ var d3_ease_default = function() {
+ return d3_identity;
+ };
+ var d3_ease = d3.map({
+ linear: d3_ease_default,
+ poly: d3_ease_poly,
+ quad: function() {
+ return d3_ease_quad;
+ },
+ cubic: function() {
+ return d3_ease_cubic;
+ },
+ sin: function() {
+ return d3_ease_sin;
+ },
+ exp: function() {
+ return d3_ease_exp;
+ },
+ circle: function() {
+ return d3_ease_circle;
+ },
+ elastic: d3_ease_elastic,
+ back: d3_ease_back,
+ bounce: function() {
+ return d3_ease_bounce;
+ }
+ });
+ var d3_ease_mode = d3.map({
+ "in": d3_identity,
+ out: d3_ease_reverse,
+ "in-out": d3_ease_reflect,
+ "out-in": function(f) {
+ return d3_ease_reflect(d3_ease_reverse(f));
+ }
+ });
+ d3.ease = function(name) {
+ var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in";
+ t = d3_ease.get(t) || d3_ease_default;
+ m = d3_ease_mode.get(m) || d3_identity;
+ return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));
+ };
+ function d3_ease_clamp(f) {
+ return function(t) {
+ return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
+ };
+ }
+ function d3_ease_reverse(f) {
+ return function(t) {
+ return 1 - f(1 - t);
+ };
+ }
+ function d3_ease_reflect(f) {
+ return function(t) {
+ return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t));
+ };
+ }
+ function d3_ease_quad(t) {
+ return t * t;
+ }
+ function d3_ease_cubic(t) {
+ return t * t * t;
+ }
+ function d3_ease_cubicInOut(t) {
+ if (t <= 0) return 0;
+ if (t >= 1) return 1;
+ var t2 = t * t, t3 = t2 * t;
+ return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75);
+ }
+ function d3_ease_poly(e) {
+ return function(t) {
+ return Math.pow(t, e);
+ };
+ }
+ function d3_ease_sin(t) {
+ return 1 - Math.cos(t * halfπ);
+ }
+ function d3_ease_exp(t) {
+ return Math.pow(2, 10 * (t - 1));
+ }
+ function d3_ease_circle(t) {
+ return 1 - Math.sqrt(1 - t * t);
+ }
+ function d3_ease_elastic(a, p) {
+ var s;
+ if (arguments.length < 2) p = .45;
+ if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4;
+ return function(t) {
+ return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p);
+ };
+ }
+ function d3_ease_back(s) {
+ if (!s) s = 1.70158;
+ return function(t) {
+ return t * t * ((s + 1) * t - s);
+ };
+ }
+ function d3_ease_bounce(t) {
+ return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
+ }
+ d3.interpolateHcl = d3_interpolateHcl;
+ function d3_interpolateHcl(a, b) {
+ a = d3.hcl(a);
+ b = d3.hcl(b);
+ var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al;
+ if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac;
+ if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
+ return function(t) {
+ return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + "";
+ };
+ }
+ d3.interpolateHsl = d3_interpolateHsl;
+ function d3_interpolateHsl(a, b) {
+ a = d3.hsl(a);
+ b = d3.hsl(b);
+ var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al;
+ if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as;
+ if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
+ return function(t) {
+ return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + "";
+ };
+ }
+ d3.interpolateLab = d3_interpolateLab;
+ function d3_interpolateLab(a, b) {
+ a = d3.lab(a);
+ b = d3.lab(b);
+ var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab;
+ return function(t) {
+ return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + "";
+ };
+ }
+ d3.interpolateRound = d3_interpolateRound;
+ function d3_interpolateRound(a, b) {
+ b -= a;
+ return function(t) {
+ return Math.round(a + b * t);
+ };
+ }
+ d3.transform = function(string) {
+ var g = d3_document.createElementNS(d3.ns.prefix.svg, "g");
+ return (d3.transform = function(string) {
+ if (string != null) {
+ g.setAttribute("transform", string);
+ var t = g.transform.baseVal.consolidate();
+ }
+ return new d3_transform(t ? t.matrix : d3_transformIdentity);
+ })(string);
+ };
+ function d3_transform(m) {
+ var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;
+ if (r0[0] * r1[1] < r1[0] * r0[1]) {
+ r0[0] *= -1;
+ r0[1] *= -1;
+ kx *= -1;
+ kz *= -1;
+ }
+ this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees;
+ this.translate = [ m.e, m.f ];
+ this.scale = [ kx, ky ];
+ this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0;
+ }
+ d3_transform.prototype.toString = function() {
+ return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")";
+ };
+ function d3_transformDot(a, b) {
+ return a[0] * b[0] + a[1] * b[1];
+ }
+ function d3_transformNormalize(a) {
+ var k = Math.sqrt(d3_transformDot(a, a));
+ if (k) {
+ a[0] /= k;
+ a[1] /= k;
+ }
+ return k;
+ }
+ function d3_transformCombine(a, b, k) {
+ a[0] += k * b[0];
+ a[1] += k * b[1];
+ return a;
+ }
+ var d3_transformIdentity = {
+ a: 1,
+ b: 0,
+ c: 0,
+ d: 1,
+ e: 0,
+ f: 0
+ };
+ d3.interpolateTransform = d3_interpolateTransform;
+ function d3_interpolateTransformPop(s) {
+ return s.length ? s.pop() + "," : "";
+ }
+ function d3_interpolateTranslate(ta, tb, s, q) {
+ if (ta[0] !== tb[0] || ta[1] !== tb[1]) {
+ var i = s.push("translate(", null, ",", null, ")");
+ q.push({
+ i: i - 4,
+ x: d3_interpolateNumber(ta[0], tb[0])
+ }, {
+ i: i - 2,
+ x: d3_interpolateNumber(ta[1], tb[1])
+ });
+ } else if (tb[0] || tb[1]) {
+ s.push("translate(" + tb + ")");
+ }
+ }
+ function d3_interpolateRotate(ra, rb, s, q) {
+ if (ra !== rb) {
+ if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360;
+ q.push({
+ i: s.push(d3_interpolateTransformPop(s) + "rotate(", null, ")") - 2,
+ x: d3_interpolateNumber(ra, rb)
+ });
+ } else if (rb) {
+ s.push(d3_interpolateTransformPop(s) + "rotate(" + rb + ")");
+ }
+ }
+ function d3_interpolateSkew(wa, wb, s, q) {
+ if (wa !== wb) {
+ q.push({
+ i: s.push(d3_interpolateTransformPop(s) + "skewX(", null, ")") - 2,
+ x: d3_interpolateNumber(wa, wb)
+ });
+ } else if (wb) {
+ s.push(d3_interpolateTransformPop(s) + "skewX(" + wb + ")");
+ }
+ }
+ function d3_interpolateScale(ka, kb, s, q) {
+ if (ka[0] !== kb[0] || ka[1] !== kb[1]) {
+ var i = s.push(d3_interpolateTransformPop(s) + "scale(", null, ",", null, ")");
+ q.push({
+ i: i - 4,
+ x: d3_interpolateNumber(ka[0], kb[0])
+ }, {
+ i: i - 2,
+ x: d3_interpolateNumber(ka[1], kb[1])
+ });
+ } else if (kb[0] !== 1 || kb[1] !== 1) {
+ s.push(d3_interpolateTransformPop(s) + "scale(" + kb + ")");
+ }
+ }
+ function d3_interpolateTransform(a, b) {
+ var s = [], q = [];
+ a = d3.transform(a), b = d3.transform(b);
+ d3_interpolateTranslate(a.translate, b.translate, s, q);
+ d3_interpolateRotate(a.rotate, b.rotate, s, q);
+ d3_interpolateSkew(a.skew, b.skew, s, q);
+ d3_interpolateScale(a.scale, b.scale, s, q);
+ a = b = null;
+ return function(t) {
+ var i = -1, n = q.length, o;
+ while (++i < n) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ };
+ }
+ function d3_uninterpolateNumber(a, b) {
+ b = (b -= a = +a) || 1 / b;
+ return function(x) {
+ return (x - a) / b;
+ };
+ }
+ function d3_uninterpolateClamp(a, b) {
+ b = (b -= a = +a) || 1 / b;
+ return function(x) {
+ return Math.max(0, Math.min(1, (x - a) / b));
+ };
+ }
+ d3.layout = {};
+ d3.layout.bundle = function() {
+ return function(links) {
+ var paths = [], i = -1, n = links.length;
+ while (++i < n) paths.push(d3_layout_bundlePath(links[i]));
+ return paths;
+ };
+ };
+ function d3_layout_bundlePath(link) {
+ var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ];
+ while (start !== lca) {
+ start = start.parent;
+ points.push(start);
+ }
+ var k = points.length;
+ while (end !== lca) {
+ points.splice(k, 0, end);
+ end = end.parent;
+ }
+ return points;
+ }
+ function d3_layout_bundleAncestors(node) {
+ var ancestors = [], parent = node.parent;
+ while (parent != null) {
+ ancestors.push(node);
+ node = parent;
+ parent = parent.parent;
+ }
+ ancestors.push(node);
+ return ancestors;
+ }
+ function d3_layout_bundleLeastCommonAncestor(a, b) {
+ if (a === b) return a;
+ var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null;
+ while (aNode === bNode) {
+ sharedNode = aNode;
+ aNode = aNodes.pop();
+ bNode = bNodes.pop();
+ }
+ return sharedNode;
+ }
+ d3.layout.chord = function() {
+ var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
+ function relayout() {
+ var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
+ chords = [];
+ groups = [];
+ k = 0, i = -1;
+ while (++i < n) {
+ x = 0, j = -1;
+ while (++j < n) {
+ x += matrix[i][j];
+ }
+ groupSums.push(x);
+ subgroupIndex.push(d3.range(n));
+ k += x;
+ }
+ if (sortGroups) {
+ groupIndex.sort(function(a, b) {
+ return sortGroups(groupSums[a], groupSums[b]);
+ });
+ }
+ if (sortSubgroups) {
+ subgroupIndex.forEach(function(d, i) {
+ d.sort(function(a, b) {
+ return sortSubgroups(matrix[i][a], matrix[i][b]);
+ });
+ });
+ }
+ k = (τ - padding * n) / k;
+ x = 0, i = -1;
+ while (++i < n) {
+ x0 = x, j = -1;
+ while (++j < n) {
+ var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;
+ subgroups[di + "-" + dj] = {
+ index: di,
+ subindex: dj,
+ startAngle: a0,
+ endAngle: a1,
+ value: v
+ };
+ }
+ groups[di] = {
+ index: di,
+ startAngle: x0,
+ endAngle: x,
+ value: groupSums[di]
+ };
+ x += padding;
+ }
+ i = -1;
+ while (++i < n) {
+ j = i - 1;
+ while (++j < n) {
+ var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i];
+ if (source.value || target.value) {
+ chords.push(source.value < target.value ? {
+ source: target,
+ target: source
+ } : {
+ source: source,
+ target: target
+ });
+ }
+ }
+ }
+ if (sortChords) resort();
+ }
+ function resort() {
+ chords.sort(function(a, b) {
+ return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2);
+ });
+ }
+ chord.matrix = function(x) {
+ if (!arguments.length) return matrix;
+ n = (matrix = x) && matrix.length;
+ chords = groups = null;
+ return chord;
+ };
+ chord.padding = function(x) {
+ if (!arguments.length) return padding;
+ padding = x;
+ chords = groups = null;
+ return chord;
+ };
+ chord.sortGroups = function(x) {
+ if (!arguments.length) return sortGroups;
+ sortGroups = x;
+ chords = groups = null;
+ return chord;
+ };
+ chord.sortSubgroups = function(x) {
+ if (!arguments.length) return sortSubgroups;
+ sortSubgroups = x;
+ chords = null;
+ return chord;
+ };
+ chord.sortChords = function(x) {
+ if (!arguments.length) return sortChords;
+ sortChords = x;
+ if (chords) resort();
+ return chord;
+ };
+ chord.chords = function() {
+ if (!chords) relayout();
+ return chords;
+ };
+ chord.groups = function() {
+ if (!groups) relayout();
+ return groups;
+ };
+ return chord;
+ };
+ d3.layout.force = function() {
+ var force = {}, event = d3.dispatch("start", "tick", "end"), timer, size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;
+ function repulse(node) {
+ return function(quad, x1, _, x2) {
+ if (quad.point !== node) {
+ var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy;
+ if (dw * dw / theta2 < dn) {
+ if (dn < chargeDistance2) {
+ var k = quad.charge / dn;
+ node.px -= dx * k;
+ node.py -= dy * k;
+ }
+ return true;
+ }
+ if (quad.point && dn && dn < chargeDistance2) {
+ var k = quad.pointCharge / dn;
+ node.px -= dx * k;
+ node.py -= dy * k;
+ }
+ }
+ return !quad.charge;
+ };
+ }
+ force.tick = function() {
+ if ((alpha *= .99) < .005) {
+ timer = null;
+ event.end({
+ type: "end",
+ alpha: alpha = 0
+ });
+ return true;
+ }
+ var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y;
+ for (i = 0; i < m; ++i) {
+ o = links[i];
+ s = o.source;
+ t = o.target;
+ x = t.x - s.x;
+ y = t.y - s.y;
+ if (l = x * x + y * y) {
+ l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
+ x *= l;
+ y *= l;
+ t.x -= x * (k = s.weight + t.weight ? s.weight / (s.weight + t.weight) : .5);
+ t.y -= y * k;
+ s.x += x * (k = 1 - k);
+ s.y += y * k;
+ }
+ }
+ if (k = alpha * gravity) {
+ x = size[0] / 2;
+ y = size[1] / 2;
+ i = -1;
+ if (k) while (++i < n) {
+ o = nodes[i];
+ o.x += (x - o.x) * k;
+ o.y += (y - o.y) * k;
+ }
+ }
+ if (charge) {
+ d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges);
+ i = -1;
+ while (++i < n) {
+ if (!(o = nodes[i]).fixed) {
+ q.visit(repulse(o));
+ }
+ }
+ }
+ i = -1;
+ while (++i < n) {
+ o = nodes[i];
+ if (o.fixed) {
+ o.x = o.px;
+ o.y = o.py;
+ } else {
+ o.x -= (o.px - (o.px = o.x)) * friction;
+ o.y -= (o.py - (o.py = o.y)) * friction;
+ }
+ }
+ event.tick({
+ type: "tick",
+ alpha: alpha
+ });
+ };
+ force.nodes = function(x) {
+ if (!arguments.length) return nodes;
+ nodes = x;
+ return force;
+ };
+ force.links = function(x) {
+ if (!arguments.length) return links;
+ links = x;
+ return force;
+ };
+ force.size = function(x) {
+ if (!arguments.length) return size;
+ size = x;
+ return force;
+ };
+ force.linkDistance = function(x) {
+ if (!arguments.length) return linkDistance;
+ linkDistance = typeof x === "function" ? x : +x;
+ return force;
+ };
+ force.distance = force.linkDistance;
+ force.linkStrength = function(x) {
+ if (!arguments.length) return linkStrength;
+ linkStrength = typeof x === "function" ? x : +x;
+ return force;
+ };
+ force.friction = function(x) {
+ if (!arguments.length) return friction;
+ friction = +x;
+ return force;
+ };
+ force.charge = function(x) {
+ if (!arguments.length) return charge;
+ charge = typeof x === "function" ? x : +x;
+ return force;
+ };
+ force.chargeDistance = function(x) {
+ if (!arguments.length) return Math.sqrt(chargeDistance2);
+ chargeDistance2 = x * x;
+ return force;
+ };
+ force.gravity = function(x) {
+ if (!arguments.length) return gravity;
+ gravity = +x;
+ return force;
+ };
+ force.theta = function(x) {
+ if (!arguments.length) return Math.sqrt(theta2);
+ theta2 = x * x;
+ return force;
+ };
+ force.alpha = function(x) {
+ if (!arguments.length) return alpha;
+ x = +x;
+ if (alpha) {
+ if (x > 0) {
+ alpha = x;
+ } else {
+ timer.c = null, timer.t = NaN, timer = null;
+ event.end({
+ type: "end",
+ alpha: alpha = 0
+ });
+ }
+ } else if (x > 0) {
+ event.start({
+ type: "start",
+ alpha: alpha = x
+ });
+ timer = d3_timer(force.tick);
+ }
+ return force;
+ };
+ force.start = function() {
+ var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o;
+ for (i = 0; i < n; ++i) {
+ (o = nodes[i]).index = i;
+ o.weight = 0;
+ }
+ for (i = 0; i < m; ++i) {
+ o = links[i];
+ if (typeof o.source == "number") o.source = nodes[o.source];
+ if (typeof o.target == "number") o.target = nodes[o.target];
+ ++o.source.weight;
+ ++o.target.weight;
+ }
+ for (i = 0; i < n; ++i) {
+ o = nodes[i];
+ if (isNaN(o.x)) o.x = position("x", w);
+ if (isNaN(o.y)) o.y = position("y", h);
+ if (isNaN(o.px)) o.px = o.x;
+ if (isNaN(o.py)) o.py = o.y;
+ }
+ distances = [];
+ if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance;
+ strengths = [];
+ if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength;
+ charges = [];
+ if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge;
+ function position(dimension, size) {
+ if (!neighbors) {
+ neighbors = new Array(n);
+ for (j = 0; j < n; ++j) {
+ neighbors[j] = [];
+ }
+ for (j = 0; j < m; ++j) {
+ var o = links[j];
+ neighbors[o.source.index].push(o.target);
+ neighbors[o.target.index].push(o.source);
+ }
+ }
+ var candidates = neighbors[i], j = -1, l = candidates.length, x;
+ while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x;
+ return Math.random() * size;
+ }
+ return force.resume();
+ };
+ force.resume = function() {
+ return force.alpha(.1);
+ };
+ force.stop = function() {
+ return force.alpha(0);
+ };
+ force.drag = function() {
+ if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend);
+ if (!arguments.length) return drag;
+ this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag);
+ };
+ function dragmove(d) {
+ d.px = d3.event.x, d.py = d3.event.y;
+ force.resume();
+ }
+ return d3.rebind(force, event, "on");
+ };
+ function d3_layout_forceDragstart(d) {
+ d.fixed |= 2;
+ }
+ function d3_layout_forceDragend(d) {
+ d.fixed &= ~6;
+ }
+ function d3_layout_forceMouseover(d) {
+ d.fixed |= 4;
+ d.px = d.x, d.py = d.y;
+ }
+ function d3_layout_forceMouseout(d) {
+ d.fixed &= ~4;
+ }
+ function d3_layout_forceAccumulate(quad, alpha, charges) {
+ var cx = 0, cy = 0;
+ quad.charge = 0;
+ if (!quad.leaf) {
+ var nodes = quad.nodes, n = nodes.length, i = -1, c;
+ while (++i < n) {
+ c = nodes[i];
+ if (c == null) continue;
+ d3_layout_forceAccumulate(c, alpha, charges);
+ quad.charge += c.charge;
+ cx += c.charge * c.cx;
+ cy += c.charge * c.cy;
+ }
+ }
+ if (quad.point) {
+ if (!quad.leaf) {
+ quad.point.x += Math.random() - .5;
+ quad.point.y += Math.random() - .5;
+ }
+ var k = alpha * charges[quad.point.index];
+ quad.charge += quad.pointCharge = k;
+ cx += k * quad.point.x;
+ cy += k * quad.point.y;
+ }
+ quad.cx = cx / quad.charge;
+ quad.cy = cy / quad.charge;
+ }
+ var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity;
+ d3.layout.hierarchy = function() {
+ var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
+ function hierarchy(root) {
+ var stack = [ root ], nodes = [], node;
+ root.depth = 0;
+ while ((node = stack.pop()) != null) {
+ nodes.push(node);
+ if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) {
+ var n, childs, child;
+ while (--n >= 0) {
+ stack.push(child = childs[n]);
+ child.parent = node;
+ child.depth = node.depth + 1;
+ }
+ if (value) node.value = 0;
+ node.children = childs;
+ } else {
+ if (value) node.value = +value.call(hierarchy, node, node.depth) || 0;
+ delete node.children;
+ }
+ }
+ d3_layout_hierarchyVisitAfter(root, function(node) {
+ var childs, parent;
+ if (sort && (childs = node.children)) childs.sort(sort);
+ if (value && (parent = node.parent)) parent.value += node.value;
+ });
+ return nodes;
+ }
+ hierarchy.sort = function(x) {
+ if (!arguments.length) return sort;
+ sort = x;
+ return hierarchy;
+ };
+ hierarchy.children = function(x) {
+ if (!arguments.length) return children;
+ children = x;
+ return hierarchy;
+ };
+ hierarchy.value = function(x) {
+ if (!arguments.length) return value;
+ value = x;
+ return hierarchy;
+ };
+ hierarchy.revalue = function(root) {
+ if (value) {
+ d3_layout_hierarchyVisitBefore(root, function(node) {
+ if (node.children) node.value = 0;
+ });
+ d3_layout_hierarchyVisitAfter(root, function(node) {
+ var parent;
+ if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0;
+ if (parent = node.parent) parent.value += node.value;
+ });
+ }
+ return root;
+ };
+ return hierarchy;
+ };
+ function d3_layout_hierarchyRebind(object, hierarchy) {
+ d3.rebind(object, hierarchy, "sort", "children", "value");
+ object.nodes = object;
+ object.links = d3_layout_hierarchyLinks;
+ return object;
+ }
+ function d3_layout_hierarchyVisitBefore(node, callback) {
+ var nodes = [ node ];
+ while ((node = nodes.pop()) != null) {
+ callback(node);
+ if ((children = node.children) && (n = children.length)) {
+ var n, children;
+ while (--n >= 0) nodes.push(children[n]);
+ }
+ }
+ }
+ function d3_layout_hierarchyVisitAfter(node, callback) {
+ var nodes = [ node ], nodes2 = [];
+ while ((node = nodes.pop()) != null) {
+ nodes2.push(node);
+ if ((children = node.children) && (n = children.length)) {
+ var i = -1, n, children;
+ while (++i < n) nodes.push(children[i]);
+ }
+ }
+ while ((node = nodes2.pop()) != null) {
+ callback(node);
+ }
+ }
+ function d3_layout_hierarchyChildren(d) {
+ return d.children;
+ }
+ function d3_layout_hierarchyValue(d) {
+ return d.value;
+ }
+ function d3_layout_hierarchySort(a, b) {
+ return b.value - a.value;
+ }
+ function d3_layout_hierarchyLinks(nodes) {
+ return d3.merge(nodes.map(function(parent) {
+ return (parent.children || []).map(function(child) {
+ return {
+ source: parent,
+ target: child
+ };
+ });
+ }));
+ }
+ d3.layout.partition = function() {
+ var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ];
+ function position(node, x, dx, dy) {
+ var children = node.children;
+ node.x = x;
+ node.y = node.depth * dy;
+ node.dx = dx;
+ node.dy = dy;
+ if (children && (n = children.length)) {
+ var i = -1, n, c, d;
+ dx = node.value ? dx / node.value : 0;
+ while (++i < n) {
+ position(c = children[i], x, d = c.value * dx, dy);
+ x += d;
+ }
+ }
+ }
+ function depth(node) {
+ var children = node.children, d = 0;
+ if (children && (n = children.length)) {
+ var i = -1, n;
+ while (++i < n) d = Math.max(d, depth(children[i]));
+ }
+ return 1 + d;
+ }
+ function partition(d, i) {
+ var nodes = hierarchy.call(this, d, i);
+ position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));
+ return nodes;
+ }
+ partition.size = function(x) {
+ if (!arguments.length) return size;
+ size = x;
+ return partition;
+ };
+ return d3_layout_hierarchyRebind(partition, hierarchy);
+ };
+ d3.layout.pie = function() {
+ var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ, padAngle = 0;
+ function pie(data) {
+ var n = data.length, values = data.map(function(d, i) {
+ return +value.call(pie, d, i);
+ }), a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === "function" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), sum = d3.sum(values), k = sum ? (da - n * pa) / sum : 0, index = d3.range(n), arcs = [], v;
+ if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) {
+ return values[j] - values[i];
+ } : function(i, j) {
+ return sort(data[i], data[j]);
+ });
+ index.forEach(function(i) {
+ arcs[i] = {
+ data: data[i],
+ value: v = values[i],
+ startAngle: a,
+ endAngle: a += v * k + pa,
+ padAngle: p
+ };
+ });
+ return arcs;
+ }
+ pie.value = function(_) {
+ if (!arguments.length) return value;
+ value = _;
+ return pie;
+ };
+ pie.sort = function(_) {
+ if (!arguments.length) return sort;
+ sort = _;
+ return pie;
+ };
+ pie.startAngle = function(_) {
+ if (!arguments.length) return startAngle;
+ startAngle = _;
+ return pie;
+ };
+ pie.endAngle = function(_) {
+ if (!arguments.length) return endAngle;
+ endAngle = _;
+ return pie;
+ };
+ pie.padAngle = function(_) {
+ if (!arguments.length) return padAngle;
+ padAngle = _;
+ return pie;
+ };
+ return pie;
+ };
+ var d3_layout_pieSortByValue = {};
+ d3.layout.stack = function() {
+ var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;
+ function stack(data, index) {
+ if (!(n = data.length)) return data;
+ var series = data.map(function(d, i) {
+ return values.call(stack, d, i);
+ });
+ var points = series.map(function(d) {
+ return d.map(function(v, i) {
+ return [ x.call(stack, v, i), y.call(stack, v, i) ];
+ });
+ });
+ var orders = order.call(stack, points, index);
+ series = d3.permute(series, orders);
+ points = d3.permute(points, orders);
+ var offsets = offset.call(stack, points, index);
+ var m = series[0].length, n, i, j, o;
+ for (j = 0; j < m; ++j) {
+ out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);
+ for (i = 1; i < n; ++i) {
+ out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);
+ }
+ }
+ return data;
+ }
+ stack.values = function(x) {
+ if (!arguments.length) return values;
+ values = x;
+ return stack;
+ };
+ stack.order = function(x) {
+ if (!arguments.length) return order;
+ order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault;
+ return stack;
+ };
+ stack.offset = function(x) {
+ if (!arguments.length) return offset;
+ offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero;
+ return stack;
+ };
+ stack.x = function(z) {
+ if (!arguments.length) return x;
+ x = z;
+ return stack;
+ };
+ stack.y = function(z) {
+ if (!arguments.length) return y;
+ y = z;
+ return stack;
+ };
+ stack.out = function(z) {
+ if (!arguments.length) return out;
+ out = z;
+ return stack;
+ };
+ return stack;
+ };
+ function d3_layout_stackX(d) {
+ return d.x;
+ }
+ function d3_layout_stackY(d) {
+ return d.y;
+ }
+ function d3_layout_stackOut(d, y0, y) {
+ d.y0 = y0;
+ d.y = y;
+ }
+ var d3_layout_stackOrders = d3.map({
+ "inside-out": function(data) {
+ var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) {
+ return max[a] - max[b];
+ }), top = 0, bottom = 0, tops = [], bottoms = [];
+ for (i = 0; i < n; ++i) {
+ j = index[i];
+ if (top < bottom) {
+ top += sums[j];
+ tops.push(j);
+ } else {
+ bottom += sums[j];
+ bottoms.push(j);
+ }
+ }
+ return bottoms.reverse().concat(tops);
+ },
+ reverse: function(data) {
+ return d3.range(data.length).reverse();
+ },
+ "default": d3_layout_stackOrderDefault
+ });
+ var d3_layout_stackOffsets = d3.map({
+ silhouette: function(data) {
+ var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = [];
+ for (j = 0; j < m; ++j) {
+ for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
+ if (o > max) max = o;
+ sums.push(o);
+ }
+ for (j = 0; j < m; ++j) {
+ y0[j] = (max - sums[j]) / 2;
+ }
+ return y0;
+ },
+ wiggle: function(data) {
+ var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
+ y0[0] = o = o0 = 0;
+ for (j = 1; j < m; ++j) {
+ for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];
+ for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) {
+ for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) {
+ s3 += (data[k][j][1] - data[k][j - 1][1]) / dx;
+ }
+ s2 += s3 * data[i][j][1];
+ }
+ y0[j] = o -= s1 ? s2 / s1 * dx : 0;
+ if (o < o0) o0 = o;
+ }
+ for (j = 0; j < m; ++j) y0[j] -= o0;
+ return y0;
+ },
+ expand: function(data) {
+ var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = [];
+ for (j = 0; j < m; ++j) {
+ for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
+ if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k;
+ }
+ for (j = 0; j < m; ++j) y0[j] = 0;
+ return y0;
+ },
+ zero: d3_layout_stackOffsetZero
+ });
+ function d3_layout_stackOrderDefault(data) {
+ return d3.range(data.length);
+ }
+ function d3_layout_stackOffsetZero(data) {
+ var j = -1, m = data[0].length, y0 = [];
+ while (++j < m) y0[j] = 0;
+ return y0;
+ }
+ function d3_layout_stackMaxIndex(array) {
+ var i = 1, j = 0, v = array[0][1], k, n = array.length;
+ for (;i < n; ++i) {
+ if ((k = array[i][1]) > v) {
+ j = i;
+ v = k;
+ }
+ }
+ return j;
+ }
+ function d3_layout_stackReduceSum(d) {
+ return d.reduce(d3_layout_stackSum, 0);
+ }
+ function d3_layout_stackSum(p, d) {
+ return p + d[1];
+ }
+ d3.layout.histogram = function() {
+ var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges;
+ function histogram(data, i) {
+ var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x;
+ while (++i < m) {
+ bin = bins[i] = [];
+ bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]);
+ bin.y = 0;
+ }
+ if (m > 0) {
+ i = -1;
+ while (++i < n) {
+ x = values[i];
+ if (x >= range[0] && x <= range[1]) {
+ bin = bins[d3.bisect(thresholds, x, 1, m) - 1];
+ bin.y += k;
+ bin.push(data[i]);
+ }
+ }
+ }
+ return bins;
+ }
+ histogram.value = function(x) {
+ if (!arguments.length) return valuer;
+ valuer = x;
+ return histogram;
+ };
+ histogram.range = function(x) {
+ if (!arguments.length) return ranger;
+ ranger = d3_functor(x);
+ return histogram;
+ };
+ histogram.bins = function(x) {
+ if (!arguments.length) return binner;
+ binner = typeof x === "number" ? function(range) {
+ return d3_layout_histogramBinFixed(range, x);
+ } : d3_functor(x);
+ return histogram;
+ };
+ histogram.frequency = function(x) {
+ if (!arguments.length) return frequency;
+ frequency = !!x;
+ return histogram;
+ };
+ return histogram;
+ };
+ function d3_layout_histogramBinSturges(range, values) {
+ return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1));
+ }
+ function d3_layout_histogramBinFixed(range, n) {
+ var x = -1, b = +range[0], m = (range[1] - b) / n, f = [];
+ while (++x <= n) f[x] = m * x + b;
+ return f;
+ }
+ function d3_layout_histogramRange(values) {
+ return [ d3.min(values), d3.max(values) ];
+ }
+ d3.layout.pack = function() {
+ var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;
+ function pack(d, i) {
+ var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() {
+ return radius;
+ };
+ root.x = root.y = 0;
+ d3_layout_hierarchyVisitAfter(root, function(d) {
+ d.r = +r(d.value);
+ });
+ d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
+ if (padding) {
+ var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2;
+ d3_layout_hierarchyVisitAfter(root, function(d) {
+ d.r += dr;
+ });
+ d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
+ d3_layout_hierarchyVisitAfter(root, function(d) {
+ d.r -= dr;
+ });
+ }
+ d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h));
+ return nodes;
+ }
+ pack.size = function(_) {
+ if (!arguments.length) return size;
+ size = _;
+ return pack;
+ };
+ pack.radius = function(_) {
+ if (!arguments.length) return radius;
+ radius = _ == null || typeof _ === "function" ? _ : +_;
+ return pack;
+ };
+ pack.padding = function(_) {
+ if (!arguments.length) return padding;
+ padding = +_;
+ return pack;
+ };
+ return d3_layout_hierarchyRebind(pack, hierarchy);
+ };
+ function d3_layout_packSort(a, b) {
+ return a.value - b.value;
+ }
+ function d3_layout_packInsert(a, b) {
+ var c = a._pack_next;
+ a._pack_next = b;
+ b._pack_prev = a;
+ b._pack_next = c;
+ c._pack_prev = b;
+ }
+ function d3_layout_packSplice(a, b) {
+ a._pack_next = b;
+ b._pack_prev = a;
+ }
+ function d3_layout_packIntersects(a, b) {
+ var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r;
+ return .999 * dr * dr > dx * dx + dy * dy;
+ }
+ function d3_layout_packSiblings(node) {
+ if (!(nodes = node.children) || !(n = nodes.length)) return;
+ var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n;
+ function bound(node) {
+ xMin = Math.min(node.x - node.r, xMin);
+ xMax = Math.max(node.x + node.r, xMax);
+ yMin = Math.min(node.y - node.r, yMin);
+ yMax = Math.max(node.y + node.r, yMax);
+ }
+ nodes.forEach(d3_layout_packLink);
+ a = nodes[0];
+ a.x = -a.r;
+ a.y = 0;
+ bound(a);
+ if (n > 1) {
+ b = nodes[1];
+ b.x = b.r;
+ b.y = 0;
+ bound(b);
+ if (n > 2) {
+ c = nodes[2];
+ d3_layout_packPlace(a, b, c);
+ bound(c);
+ d3_layout_packInsert(a, c);
+ a._pack_prev = c;
+ d3_layout_packInsert(c, b);
+ b = a._pack_next;
+ for (i = 3; i < n; i++) {
+ d3_layout_packPlace(a, b, c = nodes[i]);
+ var isect = 0, s1 = 1, s2 = 1;
+ for (j = b._pack_next; j !== b; j = j._pack_next, s1++) {
+ if (d3_layout_packIntersects(j, c)) {
+ isect = 1;
+ break;
+ }
+ }
+ if (isect == 1) {
+ for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
+ if (d3_layout_packIntersects(k, c)) {
+ break;
+ }
+ }
+ }
+ if (isect) {
+ if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b);
+ i--;
+ } else {
+ d3_layout_packInsert(a, c);
+ b = c;
+ bound(c);
+ }
+ }
+ }
+ }
+ var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0;
+ for (i = 0; i < n; i++) {
+ c = nodes[i];
+ c.x -= cx;
+ c.y -= cy;
+ cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y));
+ }
+ node.r = cr;
+ nodes.forEach(d3_layout_packUnlink);
+ }
+ function d3_layout_packLink(node) {
+ node._pack_next = node._pack_prev = node;
+ }
+ function d3_layout_packUnlink(node) {
+ delete node._pack_next;
+ delete node._pack_prev;
+ }
+ function d3_layout_packTransform(node, x, y, k) {
+ var children = node.children;
+ node.x = x += k * node.x;
+ node.y = y += k * node.y;
+ node.r *= k;
+ if (children) {
+ var i = -1, n = children.length;
+ while (++i < n) d3_layout_packTransform(children[i], x, y, k);
+ }
+ }
+ function d3_layout_packPlace(a, b, c) {
+ var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y;
+ if (db && (dx || dy)) {
+ var da = b.r + c.r, dc = dx * dx + dy * dy;
+ da *= da;
+ db *= db;
+ var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);
+ c.x = a.x + x * dx + y * dy;
+ c.y = a.y + x * dy - y * dx;
+ } else {
+ c.x = a.x + db;
+ c.y = a.y;
+ }
+ }
+ d3.layout.tree = function() {
+ var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null;
+ function tree(d, i) {
+ var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);
+ d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;
+ d3_layout_hierarchyVisitBefore(root1, secondWalk);
+ if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else {
+ var left = root0, right = root0, bottom = root0;
+ d3_layout_hierarchyVisitBefore(root0, function(node) {
+ if (node.x < left.x) left = node;
+ if (node.x > right.x) right = node;
+ if (node.depth > bottom.depth) bottom = node;
+ });
+ var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1);
+ d3_layout_hierarchyVisitBefore(root0, function(node) {
+ node.x = (node.x + tx) * kx;
+ node.y = node.depth * ky;
+ });
+ }
+ return nodes;
+ }
+ function wrapTree(root0) {
+ var root1 = {
+ A: null,
+ children: [ root0 ]
+ }, queue = [ root1 ], node1;
+ while ((node1 = queue.pop()) != null) {
+ for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) {
+ queue.push((children[i] = child = {
+ _: children[i],
+ parent: node1,
+ children: (child = children[i].children) && child.slice() || [],
+ A: null,
+ a: null,
+ z: 0,
+ m: 0,
+ c: 0,
+ s: 0,
+ t: null,
+ i: i
+ }).a = child);
+ }
+ }
+ return root1.children[0];
+ }
+ function firstWalk(v) {
+ var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
+ if (children.length) {
+ d3_layout_treeShift(v);
+ var midpoint = (children[0].z + children[children.length - 1].z) / 2;
+ if (w) {
+ v.z = w.z + separation(v._, w._);
+ v.m = v.z - midpoint;
+ } else {
+ v.z = midpoint;
+ }
+ } else if (w) {
+ v.z = w.z + separation(v._, w._);
+ }
+ v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
+ }
+ function secondWalk(v) {
+ v._.x = v.z + v.parent.m;
+ v.m += v.parent.m;
+ }
+ function apportion(v, w, ancestor) {
+ if (w) {
+ var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
+ while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
+ vom = d3_layout_treeLeft(vom);
+ vop = d3_layout_treeRight(vop);
+ vop.a = v;
+ shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
+ if (shift > 0) {
+ d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift);
+ sip += shift;
+ sop += shift;
+ }
+ sim += vim.m;
+ sip += vip.m;
+ som += vom.m;
+ sop += vop.m;
+ }
+ if (vim && !d3_layout_treeRight(vop)) {
+ vop.t = vim;
+ vop.m += sim - sop;
+ }
+ if (vip && !d3_layout_treeLeft(vom)) {
+ vom.t = vip;
+ vom.m += sip - som;
+ ancestor = v;
+ }
+ }
+ return ancestor;
+ }
+ function sizeNode(node) {
+ node.x *= size[0];
+ node.y = node.depth * size[1];
+ }
+ tree.separation = function(x) {
+ if (!arguments.length) return separation;
+ separation = x;
+ return tree;
+ };
+ tree.size = function(x) {
+ if (!arguments.length) return nodeSize ? null : size;
+ nodeSize = (size = x) == null ? sizeNode : null;
+ return tree;
+ };
+ tree.nodeSize = function(x) {
+ if (!arguments.length) return nodeSize ? size : null;
+ nodeSize = (size = x) == null ? null : sizeNode;
+ return tree;
+ };
+ return d3_layout_hierarchyRebind(tree, hierarchy);
+ };
+ function d3_layout_treeSeparation(a, b) {
+ return a.parent == b.parent ? 1 : 2;
+ }
+ function d3_layout_treeLeft(v) {
+ var children = v.children;
+ return children.length ? children[0] : v.t;
+ }
+ function d3_layout_treeRight(v) {
+ var children = v.children, n;
+ return (n = children.length) ? children[n - 1] : v.t;
+ }
+ function d3_layout_treeMove(wm, wp, shift) {
+ var change = shift / (wp.i - wm.i);
+ wp.c -= change;
+ wp.s += shift;
+ wm.c += change;
+ wp.z += shift;
+ wp.m += shift;
+ }
+ function d3_layout_treeShift(v) {
+ var shift = 0, change = 0, children = v.children, i = children.length, w;
+ while (--i >= 0) {
+ w = children[i];
+ w.z += shift;
+ w.m += shift;
+ shift += w.s + (change += w.c);
+ }
+ }
+ function d3_layout_treeAncestor(vim, v, ancestor) {
+ return vim.a.parent === v.parent ? vim.a : ancestor;
+ }
+ d3.layout.cluster = function() {
+ var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;
+ function cluster(d, i) {
+ var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;
+ d3_layout_hierarchyVisitAfter(root, function(node) {
+ var children = node.children;
+ if (children && children.length) {
+ node.x = d3_layout_clusterX(children);
+ node.y = d3_layout_clusterY(children);
+ } else {
+ node.x = previousNode ? x += separation(node, previousNode) : 0;
+ node.y = 0;
+ previousNode = node;
+ }
+ });
+ var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;
+ d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) {
+ node.x = (node.x - root.x) * size[0];
+ node.y = (root.y - node.y) * size[1];
+ } : function(node) {
+ node.x = (node.x - x0) / (x1 - x0) * size[0];
+ node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1];
+ });
+ return nodes;
+ }
+ cluster.separation = function(x) {
+ if (!arguments.length) return separation;
+ separation = x;
+ return cluster;
+ };
+ cluster.size = function(x) {
+ if (!arguments.length) return nodeSize ? null : size;
+ nodeSize = (size = x) == null;
+ return cluster;
+ };
+ cluster.nodeSize = function(x) {
+ if (!arguments.length) return nodeSize ? size : null;
+ nodeSize = (size = x) != null;
+ return cluster;
+ };
+ return d3_layout_hierarchyRebind(cluster, hierarchy);
+ };
+ function d3_layout_clusterY(children) {
+ return 1 + d3.max(children, function(child) {
+ return child.y;
+ });
+ }
+ function d3_layout_clusterX(children) {
+ return children.reduce(function(x, child) {
+ return x + child.x;
+ }, 0) / children.length;
+ }
+ function d3_layout_clusterLeft(node) {
+ var children = node.children;
+ return children && children.length ? d3_layout_clusterLeft(children[0]) : node;
+ }
+ function d3_layout_clusterRight(node) {
+ var children = node.children, n;
+ return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node;
+ }
+ d3.layout.treemap = function() {
+ var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5));
+ function scale(children, k) {
+ var i = -1, n = children.length, child, area;
+ while (++i < n) {
+ area = (child = children[i]).value * (k < 0 ? 0 : k);
+ child.area = isNaN(area) || area <= 0 ? 0 : area;
+ }
+ }
+ function squarify(node) {
+ var children = node.children;
+ if (children && children.length) {
+ var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n;
+ scale(remaining, rect.dx * rect.dy / node.value);
+ row.area = 0;
+ while ((n = remaining.length) > 0) {
+ row.push(child = remaining[n - 1]);
+ row.area += child.area;
+ if (mode !== "squarify" || (score = worst(row, u)) <= best) {
+ remaining.pop();
+ best = score;
+ } else {
+ row.area -= row.pop().area;
+ position(row, u, rect, false);
+ u = Math.min(rect.dx, rect.dy);
+ row.length = row.area = 0;
+ best = Infinity;
+ }
+ }
+ if (row.length) {
+ position(row, u, rect, true);
+ row.length = row.area = 0;
+ }
+ children.forEach(squarify);
+ }
+ }
+ function stickify(node) {
+ var children = node.children;
+ if (children && children.length) {
+ var rect = pad(node), remaining = children.slice(), child, row = [];
+ scale(remaining, rect.dx * rect.dy / node.value);
+ row.area = 0;
+ while (child = remaining.pop()) {
+ row.push(child);
+ row.area += child.area;
+ if (child.z != null) {
+ position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);
+ row.length = row.area = 0;
+ }
+ }
+ children.forEach(stickify);
+ }
+ }
+ function worst(row, u) {
+ var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length;
+ while (++i < n) {
+ if (!(r = row[i].area)) continue;
+ if (r < rmin) rmin = r;
+ if (r > rmax) rmax = r;
+ }
+ s *= s;
+ u *= u;
+ return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity;
+ }
+ function position(row, u, rect, flush) {
+ var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o;
+ if (u == rect.dx) {
+ if (flush || v > rect.dy) v = rect.dy;
+ while (++i < n) {
+ o = row[i];
+ o.x = x;
+ o.y = y;
+ o.dy = v;
+ x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);
+ }
+ o.z = true;
+ o.dx += rect.x + rect.dx - x;
+ rect.y += v;
+ rect.dy -= v;
+ } else {
+ if (flush || v > rect.dx) v = rect.dx;
+ while (++i < n) {
+ o = row[i];
+ o.x = x;
+ o.y = y;
+ o.dx = v;
+ y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);
+ }
+ o.z = false;
+ o.dy += rect.y + rect.dy - y;
+ rect.x += v;
+ rect.dx -= v;
+ }
+ }
+ function treemap(d) {
+ var nodes = stickies || hierarchy(d), root = nodes[0];
+ root.x = root.y = 0;
+ if (root.value) root.dx = size[0], root.dy = size[1]; else root.dx = root.dy = 0;
+ if (stickies) hierarchy.revalue(root);
+ scale([ root ], root.dx * root.dy / root.value);
+ (stickies ? stickify : squarify)(root);
+ if (sticky) stickies = nodes;
+ return nodes;
+ }
+ treemap.size = function(x) {
+ if (!arguments.length) return size;
+ size = x;
+ return treemap;
+ };
+ treemap.padding = function(x) {
+ if (!arguments.length) return padding;
+ function padFunction(node) {
+ var p = x.call(treemap, node, node.depth);
+ return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p);
+ }
+ function padConstant(node) {
+ return d3_layout_treemapPad(node, x);
+ }
+ var type;
+ pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ],
+ padConstant) : padConstant;
+ return treemap;
+ };
+ treemap.round = function(x) {
+ if (!arguments.length) return round != Number;
+ round = x ? Math.round : Number;
+ return treemap;
+ };
+ treemap.sticky = function(x) {
+ if (!arguments.length) return sticky;
+ sticky = x;
+ stickies = null;
+ return treemap;
+ };
+ treemap.ratio = function(x) {
+ if (!arguments.length) return ratio;
+ ratio = x;
+ return treemap;
+ };
+ treemap.mode = function(x) {
+ if (!arguments.length) return mode;
+ mode = x + "";
+ return treemap;
+ };
+ return d3_layout_hierarchyRebind(treemap, hierarchy);
+ };
+ function d3_layout_treemapPadNull(node) {
+ return {
+ x: node.x,
+ y: node.y,
+ dx: node.dx,
+ dy: node.dy
+ };
+ }
+ function d3_layout_treemapPad(node, padding) {
+ var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2];
+ if (dx < 0) {
+ x += dx / 2;
+ dx = 0;
+ }
+ if (dy < 0) {
+ y += dy / 2;
+ dy = 0;
+ }
+ return {
+ x: x,
+ y: y,
+ dx: dx,
+ dy: dy
+ };
+ }
+ d3.random = {
+ normal: function(µ, σ) {
+ var n = arguments.length;
+ if (n < 2) σ = 1;
+ if (n < 1) µ = 0;
+ return function() {
+ var x, y, r;
+ do {
+ x = Math.random() * 2 - 1;
+ y = Math.random() * 2 - 1;
+ r = x * x + y * y;
+ } while (!r || r > 1);
+ return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
+ };
+ },
+ logNormal: function() {
+ var random = d3.random.normal.apply(d3, arguments);
+ return function() {
+ return Math.exp(random());
+ };
+ },
+ bates: function(m) {
+ var random = d3.random.irwinHall(m);
+ return function() {
+ return random() / m;
+ };
+ },
+ irwinHall: function(m) {
+ return function() {
+ for (var s = 0, j = 0; j < m; j++) s += Math.random();
+ return s;
+ };
+ }
+ };
+ d3.scale = {};
+ function d3_scaleExtent(domain) {
+ var start = domain[0], stop = domain[domain.length - 1];
+ return start < stop ? [ start, stop ] : [ stop, start ];
+ }
+ function d3_scaleRange(scale) {
+ return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
+ }
+ function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {
+ var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]);
+ return function(x) {
+ return i(u(x));
+ };
+ }
+ function d3_scale_nice(domain, nice) {
+ var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx;
+ if (x1 < x0) {
+ dx = i0, i0 = i1, i1 = dx;
+ dx = x0, x0 = x1, x1 = dx;
+ }
+ domain[i0] = nice.floor(x0);
+ domain[i1] = nice.ceil(x1);
+ return domain;
+ }
+ function d3_scale_niceStep(step) {
+ return step ? {
+ floor: function(x) {
+ return Math.floor(x / step) * step;
+ },
+ ceil: function(x) {
+ return Math.ceil(x / step) * step;
+ }
+ } : d3_scale_niceIdentity;
+ }
+ var d3_scale_niceIdentity = {
+ floor: d3_identity,
+ ceil: d3_identity
+ };
+ function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
+ var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1;
+ if (domain[k] < domain[0]) {
+ domain = domain.slice().reverse();
+ range = range.slice().reverse();
+ }
+ while (++j <= k) {
+ u.push(uninterpolate(domain[j - 1], domain[j]));
+ i.push(interpolate(range[j - 1], range[j]));
+ }
+ return function(x) {
+ var j = d3.bisect(domain, x, 1, k) - 1;
+ return i[j](u[j](x));
+ };
+ }
+ d3.scale.linear = function() {
+ return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false);
+ };
+ function d3_scale_linear(domain, range, interpolate, clamp) {
+ var output, input;
+ function rescale() {
+ var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;
+ output = linear(domain, range, uninterpolate, interpolate);
+ input = linear(range, domain, uninterpolate, d3_interpolate);
+ return scale;
+ }
+ function scale(x) {
+ return output(x);
+ }
+ scale.invert = function(y) {
+ return input(y);
+ };
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ domain = x.map(Number);
+ return rescale();
+ };
+ scale.range = function(x) {
+ if (!arguments.length) return range;
+ range = x;
+ return rescale();
+ };
+ scale.rangeRound = function(x) {
+ return scale.range(x).interpolate(d3_interpolateRound);
+ };
+ scale.clamp = function(x) {
+ if (!arguments.length) return clamp;
+ clamp = x;
+ return rescale();
+ };
+ scale.interpolate = function(x) {
+ if (!arguments.length) return interpolate;
+ interpolate = x;
+ return rescale();
+ };
+ scale.ticks = function(m) {
+ return d3_scale_linearTicks(domain, m);
+ };
+ scale.tickFormat = function(m, format) {
+ return d3_scale_linearTickFormat(domain, m, format);
+ };
+ scale.nice = function(m) {
+ d3_scale_linearNice(domain, m);
+ return rescale();
+ };
+ scale.copy = function() {
+ return d3_scale_linear(domain, range, interpolate, clamp);
+ };
+ return rescale();
+ }
+ function d3_scale_linearRebind(scale, linear) {
+ return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp");
+ }
+ function d3_scale_linearNice(domain, m) {
+ d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
+ d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
+ return domain;
+ }
+ function d3_scale_linearTickRange(domain, m) {
+ if (m == null) m = 10;
+ var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step;
+ if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2;
+ extent[0] = Math.ceil(extent[0] / step) * step;
+ extent[1] = Math.floor(extent[1] / step) * step + step * .5;
+ extent[2] = step;
+ return extent;
+ }
+ function d3_scale_linearTicks(domain, m) {
+ return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));
+ }
+ function d3_scale_linearTickFormat(domain, m, format) {
+ var range = d3_scale_linearTickRange(domain, m);
+ if (format) {
+ var match = d3_format_re.exec(format);
+ match.shift();
+ if (match[8] === "s") {
+ var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1])));
+ if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2]));
+ match[8] = "f";
+ format = d3.format(match.join(""));
+ return function(d) {
+ return format(prefix.scale(d)) + prefix.symbol;
+ };
+ }
+ if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range);
+ format = match.join("");
+ } else {
+ format = ",." + d3_scale_linearPrecision(range[2]) + "f";
+ }
+ return d3.format(format);
+ }
+ var d3_scale_linearFormatSignificant = {
+ s: 1,
+ g: 1,
+ p: 1,
+ r: 1,
+ e: 1
+ };
+ function d3_scale_linearPrecision(value) {
+ return -Math.floor(Math.log(value) / Math.LN10 + .01);
+ }
+ function d3_scale_linearFormatPrecision(type, range) {
+ var p = d3_scale_linearPrecision(range[2]);
+ return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2;
+ }
+ d3.scale.log = function() {
+ return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]);
+ };
+ function d3_scale_log(linear, base, positive, domain) {
+ function log(x) {
+ return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);
+ }
+ function pow(x) {
+ return positive ? Math.pow(base, x) : -Math.pow(base, -x);
+ }
+ function scale(x) {
+ return linear(log(x));
+ }
+ scale.invert = function(x) {
+ return pow(linear.invert(x));
+ };
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ positive = x[0] >= 0;
+ linear.domain((domain = x.map(Number)).map(log));
+ return scale;
+ };
+ scale.base = function(_) {
+ if (!arguments.length) return base;
+ base = +_;
+ linear.domain(domain.map(log));
+ return scale;
+ };
+ scale.nice = function() {
+ var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative);
+ linear.domain(niced);
+ domain = niced.map(pow);
+ return scale;
+ };
+ scale.ticks = function() {
+ var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base;
+ if (isFinite(j - i)) {
+ if (positive) {
+ for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k);
+ ticks.push(pow(i));
+ } else {
+ ticks.push(pow(i));
+ for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k);
+ }
+ for (i = 0; ticks[i] < u; i++) {}
+ for (j = ticks.length; ticks[j - 1] > v; j--) {}
+ ticks = ticks.slice(i, j);
+ }
+ return ticks;
+ };
+ scale.tickFormat = function(n, format) {
+ if (!arguments.length) return d3_scale_logFormat;
+ if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format);
+ var k = Math.max(1, base * n / scale.ticks().length);
+ return function(d) {
+ var i = d / pow(Math.round(log(d)));
+ if (i * base < base - .5) i *= base;
+ return i <= k ? format(d) : "";
+ };
+ };
+ scale.copy = function() {
+ return d3_scale_log(linear.copy(), base, positive, domain);
+ };
+ return d3_scale_linearRebind(scale, linear);
+ }
+ var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = {
+ floor: function(x) {
+ return -Math.ceil(-x);
+ },
+ ceil: function(x) {
+ return -Math.floor(-x);
+ }
+ };
+ d3.scale.pow = function() {
+ return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]);
+ };
+ function d3_scale_pow(linear, exponent, domain) {
+ var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent);
+ function scale(x) {
+ return linear(powp(x));
+ }
+ scale.invert = function(x) {
+ return powb(linear.invert(x));
+ };
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ linear.domain((domain = x.map(Number)).map(powp));
+ return scale;
+ };
+ scale.ticks = function(m) {
+ return d3_scale_linearTicks(domain, m);
+ };
+ scale.tickFormat = function(m, format) {
+ return d3_scale_linearTickFormat(domain, m, format);
+ };
+ scale.nice = function(m) {
+ return scale.domain(d3_scale_linearNice(domain, m));
+ };
+ scale.exponent = function(x) {
+ if (!arguments.length) return exponent;
+ powp = d3_scale_powPow(exponent = x);
+ powb = d3_scale_powPow(1 / exponent);
+ linear.domain(domain.map(powp));
+ return scale;
+ };
+ scale.copy = function() {
+ return d3_scale_pow(linear.copy(), exponent, domain);
+ };
+ return d3_scale_linearRebind(scale, linear);
+ }
+ function d3_scale_powPow(e) {
+ return function(x) {
+ return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);
+ };
+ }
+ d3.scale.sqrt = function() {
+ return d3.scale.pow().exponent(.5);
+ };
+ d3.scale.ordinal = function() {
+ return d3_scale_ordinal([], {
+ t: "range",
+ a: [ [] ]
+ });
+ };
+ function d3_scale_ordinal(domain, ranger) {
+ var index, range, rangeBand;
+ function scale(x) {
+ return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];
+ }
+ function steps(start, step) {
+ return d3.range(domain.length).map(function(i) {
+ return start + step * i;
+ });
+ }
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ domain = [];
+ index = new d3_Map();
+ var i = -1, n = x.length, xi;
+ while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi));
+ return scale[ranger.t].apply(scale, ranger.a);
+ };
+ scale.range = function(x) {
+ if (!arguments.length) return range;
+ range = x;
+ rangeBand = 0;
+ ranger = {
+ t: "range",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangePoints = function(x, padding) {
+ if (arguments.length < 2) padding = 0;
+ var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2,
+ 0) : (stop - start) / (domain.length - 1 + padding);
+ range = steps(start + step * padding / 2, step);
+ rangeBand = 0;
+ ranger = {
+ t: "rangePoints",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangeRoundPoints = function(x, padding) {
+ if (arguments.length < 2) padding = 0;
+ var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2),
+ 0) : (stop - start) / (domain.length - 1 + padding) | 0;
+ range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step);
+ rangeBand = 0;
+ ranger = {
+ t: "rangeRoundPoints",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangeBands = function(x, padding, outerPadding) {
+ if (arguments.length < 2) padding = 0;
+ if (arguments.length < 3) outerPadding = padding;
+ var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding);
+ range = steps(start + step * outerPadding, step);
+ if (reverse) range.reverse();
+ rangeBand = step * (1 - padding);
+ ranger = {
+ t: "rangeBands",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangeRoundBands = function(x, padding, outerPadding) {
+ if (arguments.length < 2) padding = 0;
+ if (arguments.length < 3) outerPadding = padding;
+ var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding));
+ range = steps(start + Math.round((stop - start - (domain.length - padding) * step) / 2), step);
+ if (reverse) range.reverse();
+ rangeBand = Math.round(step * (1 - padding));
+ ranger = {
+ t: "rangeRoundBands",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangeBand = function() {
+ return rangeBand;
+ };
+ scale.rangeExtent = function() {
+ return d3_scaleExtent(ranger.a[0]);
+ };
+ scale.copy = function() {
+ return d3_scale_ordinal(domain, ranger);
+ };
+ return scale.domain(domain);
+ }
+ d3.scale.category10 = function() {
+ return d3.scale.ordinal().range(d3_category10);
+ };
+ d3.scale.category20 = function() {
+ return d3.scale.ordinal().range(d3_category20);
+ };
+ d3.scale.category20b = function() {
+ return d3.scale.ordinal().range(d3_category20b);
+ };
+ d3.scale.category20c = function() {
+ return d3.scale.ordinal().range(d3_category20c);
+ };
+ var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString);
+ var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString);
+ var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString);
+ var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString);
+ d3.scale.quantile = function() {
+ return d3_scale_quantile([], []);
+ };
+ function d3_scale_quantile(domain, range) {
+ var thresholds;
+ function rescale() {
+ var k = 0, q = range.length;
+ thresholds = [];
+ while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
+ return scale;
+ }
+ function scale(x) {
+ if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)];
+ }
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending);
+ return rescale();
+ };
+ scale.range = function(x) {
+ if (!arguments.length) return range;
+ range = x;
+ return rescale();
+ };
+ scale.quantiles = function() {
+ return thresholds;
+ };
+ scale.invertExtent = function(y) {
+ y = range.indexOf(y);
+ return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ];
+ };
+ scale.copy = function() {
+ return d3_scale_quantile(domain, range);
+ };
+ return rescale();
+ }
+ d3.scale.quantize = function() {
+ return d3_scale_quantize(0, 1, [ 0, 1 ]);
+ };
+ function d3_scale_quantize(x0, x1, range) {
+ var kx, i;
+ function scale(x) {
+ return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];
+ }
+ function rescale() {
+ kx = range.length / (x1 - x0);
+ i = range.length - 1;
+ return scale;
+ }
+ scale.domain = function(x) {
+ if (!arguments.length) return [ x0, x1 ];
+ x0 = +x[0];
+ x1 = +x[x.length - 1];
+ return rescale();
+ };
+ scale.range = function(x) {
+ if (!arguments.length) return range;
+ range = x;
+ return rescale();
+ };
+ scale.invertExtent = function(y) {
+ y = range.indexOf(y);
+ y = y < 0 ? NaN : y / kx + x0;
+ return [ y, y + 1 / kx ];
+ };
+ scale.copy = function() {
+ return d3_scale_quantize(x0, x1, range);
+ };
+ return rescale();
+ }
+ d3.scale.threshold = function() {
+ return d3_scale_threshold([ .5 ], [ 0, 1 ]);
+ };
+ function d3_scale_threshold(domain, range) {
+ function scale(x) {
+ if (x <= x) return range[d3.bisect(domain, x)];
+ }
+ scale.domain = function(_) {
+ if (!arguments.length) return domain;
+ domain = _;
+ return scale;
+ };
+ scale.range = function(_) {
+ if (!arguments.length) return range;
+ range = _;
+ return scale;
+ };
+ scale.invertExtent = function(y) {
+ y = range.indexOf(y);
+ return [ domain[y - 1], domain[y] ];
+ };
+ scale.copy = function() {
+ return d3_scale_threshold(domain, range);
+ };
+ return scale;
+ }
+ d3.scale.identity = function() {
+ return d3_scale_identity([ 0, 1 ]);
+ };
+ function d3_scale_identity(domain) {
+ function identity(x) {
+ return +x;
+ }
+ identity.invert = identity;
+ identity.domain = identity.range = function(x) {
+ if (!arguments.length) return domain;
+ domain = x.map(identity);
+ return identity;
+ };
+ identity.ticks = function(m) {
+ return d3_scale_linearTicks(domain, m);
+ };
+ identity.tickFormat = function(m, format) {
+ return d3_scale_linearTickFormat(domain, m, format);
+ };
+ identity.copy = function() {
+ return d3_scale_identity(domain);
+ };
+ return identity;
+ }
+ d3.svg = {};
+ function d3_zero() {
+ return 0;
+ }
+ d3.svg.arc = function() {
+ var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, cornerRadius = d3_zero, padRadius = d3_svg_arcAuto, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle, padAngle = d3_svg_arcPadAngle;
+ function arc() {
+ var r0 = Math.max(0, +innerRadius.apply(this, arguments)), r1 = Math.max(0, +outerRadius.apply(this, arguments)), a0 = startAngle.apply(this, arguments) - halfπ, a1 = endAngle.apply(this, arguments) - halfπ, da = Math.abs(a1 - a0), cw = a0 > a1 ? 0 : 1;
+ if (r1 < r0) rc = r1, r1 = r0, r0 = rc;
+ if (da >= τε) return circleSegment(r1, cw) + (r0 ? circleSegment(r0, 1 - cw) : "") + "Z";
+ var rc, cr, rp, ap, p0 = 0, p1 = 0, x0, y0, x1, y1, x2, y2, x3, y3, path = [];
+ if (ap = (+padAngle.apply(this, arguments) || 0) / 2) {
+ rp = padRadius === d3_svg_arcAuto ? Math.sqrt(r0 * r0 + r1 * r1) : +padRadius.apply(this, arguments);
+ if (!cw) p1 *= -1;
+ if (r1) p1 = d3_asin(rp / r1 * Math.sin(ap));
+ if (r0) p0 = d3_asin(rp / r0 * Math.sin(ap));
+ }
+ if (r1) {
+ x0 = r1 * Math.cos(a0 + p1);
+ y0 = r1 * Math.sin(a0 + p1);
+ x1 = r1 * Math.cos(a1 - p1);
+ y1 = r1 * Math.sin(a1 - p1);
+ var l1 = Math.abs(a1 - a0 - 2 * p1) <= π ? 0 : 1;
+ if (p1 && d3_svg_arcSweep(x0, y0, x1, y1) === cw ^ l1) {
+ var h1 = (a0 + a1) / 2;
+ x0 = r1 * Math.cos(h1);
+ y0 = r1 * Math.sin(h1);
+ x1 = y1 = null;
+ }
+ } else {
+ x0 = y0 = 0;
+ }
+ if (r0) {
+ x2 = r0 * Math.cos(a1 - p0);
+ y2 = r0 * Math.sin(a1 - p0);
+ x3 = r0 * Math.cos(a0 + p0);
+ y3 = r0 * Math.sin(a0 + p0);
+ var l0 = Math.abs(a0 - a1 + 2 * p0) <= π ? 0 : 1;
+ if (p0 && d3_svg_arcSweep(x2, y2, x3, y3) === 1 - cw ^ l0) {
+ var h0 = (a0 + a1) / 2;
+ x2 = r0 * Math.cos(h0);
+ y2 = r0 * Math.sin(h0);
+ x3 = y3 = null;
+ }
+ } else {
+ x2 = y2 = 0;
+ }
+ if (da > ε && (rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) {
+ cr = r0 < r1 ^ cw ? 0 : 1;
+ var rc1 = rc, rc0 = rc;
+ if (da < π) {
+ var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
+ rc0 = Math.min(rc, (r0 - lc) / (kc - 1));
+ rc1 = Math.min(rc, (r1 - lc) / (kc + 1));
+ }
+ if (x1 != null) {
+ var t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw);
+ if (rc === rc1) {
+ path.push("M", t30[0], "A", rc1, ",", rc1, " 0 0,", cr, " ", t30[1], "A", r1, ",", r1, " 0 ", 1 - cw ^ d3_svg_arcSweep(t30[1][0], t30[1][1], t12[1][0], t12[1][1]), ",", cw, " ", t12[1], "A", rc1, ",", rc1, " 0 0,", cr, " ", t12[0]);
+ } else {
+ path.push("M", t30[0], "A", rc1, ",", rc1, " 0 1,", cr, " ", t12[0]);
+ }
+ } else {
+ path.push("M", x0, ",", y0);
+ }
+ if (x3 != null) {
+ var t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw);
+ if (rc === rc0) {
+ path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t21[1], "A", r0, ",", r0, " 0 ", cw ^ d3_svg_arcSweep(t21[1][0], t21[1][1], t03[1][0], t03[1][1]), ",", 1 - cw, " ", t03[1], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
+ } else {
+ path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
+ }
+ } else {
+ path.push("L", x2, ",", y2);
+ }
+ } else {
+ path.push("M", x0, ",", y0);
+ if (x1 != null) path.push("A", r1, ",", r1, " 0 ", l1, ",", cw, " ", x1, ",", y1);
+ path.push("L", x2, ",", y2);
+ if (x3 != null) path.push("A", r0, ",", r0, " 0 ", l0, ",", 1 - cw, " ", x3, ",", y3);
+ }
+ path.push("Z");
+ return path.join("");
+ }
+ function circleSegment(r1, cw) {
+ return "M0," + r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + -r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + r1;
+ }
+ arc.innerRadius = function(v) {
+ if (!arguments.length) return innerRadius;
+ innerRadius = d3_functor(v);
+ return arc;
+ };
+ arc.outerRadius = function(v) {
+ if (!arguments.length) return outerRadius;
+ outerRadius = d3_functor(v);
+ return arc;
+ };
+ arc.cornerRadius = function(v) {
+ if (!arguments.length) return cornerRadius;
+ cornerRadius = d3_functor(v);
+ return arc;
+ };
+ arc.padRadius = function(v) {
+ if (!arguments.length) return padRadius;
+ padRadius = v == d3_svg_arcAuto ? d3_svg_arcAuto : d3_functor(v);
+ return arc;
+ };
+ arc.startAngle = function(v) {
+ if (!arguments.length) return startAngle;
+ startAngle = d3_functor(v);
+ return arc;
+ };
+ arc.endAngle = function(v) {
+ if (!arguments.length) return endAngle;
+ endAngle = d3_functor(v);
+ return arc;
+ };
+ arc.padAngle = function(v) {
+ if (!arguments.length) return padAngle;
+ padAngle = d3_functor(v);
+ return arc;
+ };
+ arc.centroid = function() {
+ var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - halfπ;
+ return [ Math.cos(a) * r, Math.sin(a) * r ];
+ };
+ return arc;
+ };
+ var d3_svg_arcAuto = "auto";
+ function d3_svg_arcInnerRadius(d) {
+ return d.innerRadius;
+ }
+ function d3_svg_arcOuterRadius(d) {
+ return d.outerRadius;
+ }
+ function d3_svg_arcStartAngle(d) {
+ return d.startAngle;
+ }
+ function d3_svg_arcEndAngle(d) {
+ return d.endAngle;
+ }
+ function d3_svg_arcPadAngle(d) {
+ return d && d.padAngle;
+ }
+ function d3_svg_arcSweep(x0, y0, x1, y1) {
+ return (x0 - x1) * y0 - (y0 - y1) * x0 > 0 ? 0 : 1;
+ }
+ function d3_svg_arcCornerTangents(p0, p1, r1, rc, cw) {
+ var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(Math.max(0, r * r * d2 - D * D)), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3;
+ if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
+ return [ [ cx0 - ox, cy0 - oy ], [ cx0 * r1 / r, cy0 * r1 / r ] ];
+ }
+ function d3_svg_line(projection) {
+ var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;
+ function line(data) {
+ var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);
+ function segment() {
+ segments.push("M", interpolate(projection(points), tension));
+ }
+ while (++i < n) {
+ if (defined.call(this, d = data[i], i)) {
+ points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);
+ } else if (points.length) {
+ segment();
+ points = [];
+ }
+ }
+ if (points.length) segment();
+ return segments.length ? segments.join("") : null;
+ }
+ line.x = function(_) {
+ if (!arguments.length) return x;
+ x = _;
+ return line;
+ };
+ line.y = function(_) {
+ if (!arguments.length) return y;
+ y = _;
+ return line;
+ };
+ line.defined = function(_) {
+ if (!arguments.length) return defined;
+ defined = _;
+ return line;
+ };
+ line.interpolate = function(_) {
+ if (!arguments.length) return interpolateKey;
+ if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
+ return line;
+ };
+ line.tension = function(_) {
+ if (!arguments.length) return tension;
+ tension = _;
+ return line;
+ };
+ return line;
+ }
+ d3.svg.line = function() {
+ return d3_svg_line(d3_identity);
+ };
+ var d3_svg_lineInterpolators = d3.map({
+ linear: d3_svg_lineLinear,
+ "linear-closed": d3_svg_lineLinearClosed,
+ step: d3_svg_lineStep,
+ "step-before": d3_svg_lineStepBefore,
+ "step-after": d3_svg_lineStepAfter,
+ basis: d3_svg_lineBasis,
+ "basis-open": d3_svg_lineBasisOpen,
+ "basis-closed": d3_svg_lineBasisClosed,
+ bundle: d3_svg_lineBundle,
+ cardinal: d3_svg_lineCardinal,
+ "cardinal-open": d3_svg_lineCardinalOpen,
+ "cardinal-closed": d3_svg_lineCardinalClosed,
+ monotone: d3_svg_lineMonotone
+ });
+ d3_svg_lineInterpolators.forEach(function(key, value) {
+ value.key = key;
+ value.closed = /-closed$/.test(key);
+ });
+ function d3_svg_lineLinear(points) {
+ return points.length > 1 ? points.join("L") : points + "Z";
+ }
+ function d3_svg_lineLinearClosed(points) {
+ return points.join("L") + "Z";
+ }
+ function d3_svg_lineStep(points) {
+ var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
+ while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]);
+ if (n > 1) path.push("H", p[0]);
+ return path.join("");
+ }
+ function d3_svg_lineStepBefore(points) {
+ var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
+ while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
+ return path.join("");
+ }
+ function d3_svg_lineStepAfter(points) {
+ var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
+ while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
+ return path.join("");
+ }
+ function d3_svg_lineCardinalOpen(points, tension) {
+ return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension));
+ }
+ function d3_svg_lineCardinalClosed(points, tension) {
+ return points.length < 3 ? d3_svg_lineLinearClosed(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
+ points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
+ }
+ function d3_svg_lineCardinal(points, tension) {
+ return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));
+ }
+ function d3_svg_lineHermite(points, tangents) {
+ if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) {
+ return d3_svg_lineLinear(points);
+ }
+ var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;
+ if (quad) {
+ path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1];
+ p0 = points[1];
+ pi = 2;
+ }
+ if (tangents.length > 1) {
+ t = tangents[1];
+ p = points[pi];
+ pi++;
+ path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
+ for (var i = 2; i < tangents.length; i++, pi++) {
+ p = points[pi];
+ t = tangents[i];
+ path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
+ }
+ }
+ if (quad) {
+ var lp = points[pi];
+ path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1];
+ }
+ return path;
+ }
+ function d3_svg_lineCardinalTangents(points, tension) {
+ var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length;
+ while (++i < n) {
+ p0 = p1;
+ p1 = p2;
+ p2 = points[i];
+ tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]);
+ }
+ return tangents;
+ }
+ function d3_svg_lineBasis(points) {
+ if (points.length < 3) return d3_svg_lineLinear(points);
+ var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
+ points.push(points[n - 1]);
+ while (++i <= n) {
+ pi = points[i];
+ px.shift();
+ px.push(pi[0]);
+ py.shift();
+ py.push(pi[1]);
+ d3_svg_lineBasisBezier(path, px, py);
+ }
+ points.pop();
+ path.push("L", pi);
+ return path.join("");
+ }
+ function d3_svg_lineBasisOpen(points) {
+ if (points.length < 4) return d3_svg_lineLinear(points);
+ var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];
+ while (++i < 3) {
+ pi = points[i];
+ px.push(pi[0]);
+ py.push(pi[1]);
+ }
+ path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));
+ --i;
+ while (++i < n) {
+ pi = points[i];
+ px.shift();
+ px.push(pi[0]);
+ py.shift();
+ py.push(pi[1]);
+ d3_svg_lineBasisBezier(path, px, py);
+ }
+ return path.join("");
+ }
+ function d3_svg_lineBasisClosed(points) {
+ var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];
+ while (++i < 4) {
+ pi = points[i % n];
+ px.push(pi[0]);
+ py.push(pi[1]);
+ }
+ path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
+ --i;
+ while (++i < m) {
+ pi = points[i % n];
+ px.shift();
+ px.push(pi[0]);
+ py.shift();
+ py.push(pi[1]);
+ d3_svg_lineBasisBezier(path, px, py);
+ }
+ return path.join("");
+ }
+ function d3_svg_lineBundle(points, tension) {
+ var n = points.length - 1;
+ if (n) {
+ var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t;
+ while (++i <= n) {
+ p = points[i];
+ t = i / n;
+ p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx);
+ p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy);
+ }
+ }
+ return d3_svg_lineBasis(points);
+ }
+ function d3_svg_lineDot4(a, b) {
+ return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
+ }
+ var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ];
+ function d3_svg_lineBasisBezier(path, x, y) {
+ path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y));
+ }
+ function d3_svg_lineSlope(p0, p1) {
+ return (p1[1] - p0[1]) / (p1[0] - p0[0]);
+ }
+ function d3_svg_lineFiniteDifferences(points) {
+ var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1);
+ while (++i < j) {
+ m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2;
+ }
+ m[i] = d;
+ return m;
+ }
+ function d3_svg_lineMonotoneTangents(points) {
+ var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;
+ while (++i < j) {
+ d = d3_svg_lineSlope(points[i], points[i + 1]);
+ if (abs(d) < ε) {
+ m[i] = m[i + 1] = 0;
+ } else {
+ a = m[i] / d;
+ b = m[i + 1] / d;
+ s = a * a + b * b;
+ if (s > 9) {
+ s = d * 3 / Math.sqrt(s);
+ m[i] = s * a;
+ m[i + 1] = s * b;
+ }
+ }
+ }
+ i = -1;
+ while (++i <= j) {
+ s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i]));
+ tangents.push([ s || 0, m[i] * s || 0 ]);
+ }
+ return tangents;
+ }
+ function d3_svg_lineMonotone(points) {
+ return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points));
+ }
+ d3.svg.line.radial = function() {
+ var line = d3_svg_line(d3_svg_lineRadial);
+ line.radius = line.x, delete line.x;
+ line.angle = line.y, delete line.y;
+ return line;
+ };
+ function d3_svg_lineRadial(points) {
+ var point, i = -1, n = points.length, r, a;
+ while (++i < n) {
+ point = points[i];
+ r = point[0];
+ a = point[1] - halfπ;
+ point[0] = r * Math.cos(a);
+ point[1] = r * Math.sin(a);
+ }
+ return points;
+ }
+ function d3_svg_area(projection) {
+ var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7;
+ function area(data) {
+ var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {
+ return x;
+ } : d3_functor(x1), fy1 = y0 === y1 ? function() {
+ return y;
+ } : d3_functor(y1), x, y;
+ function segment() {
+ segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z");
+ }
+ while (++i < n) {
+ if (defined.call(this, d = data[i], i)) {
+ points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]);
+ points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]);
+ } else if (points0.length) {
+ segment();
+ points0 = [];
+ points1 = [];
+ }
+ }
+ if (points0.length) segment();
+ return segments.length ? segments.join("") : null;
+ }
+ area.x = function(_) {
+ if (!arguments.length) return x1;
+ x0 = x1 = _;
+ return area;
+ };
+ area.x0 = function(_) {
+ if (!arguments.length) return x0;
+ x0 = _;
+ return area;
+ };
+ area.x1 = function(_) {
+ if (!arguments.length) return x1;
+ x1 = _;
+ return area;
+ };
+ area.y = function(_) {
+ if (!arguments.length) return y1;
+ y0 = y1 = _;
+ return area;
+ };
+ area.y0 = function(_) {
+ if (!arguments.length) return y0;
+ y0 = _;
+ return area;
+ };
+ area.y1 = function(_) {
+ if (!arguments.length) return y1;
+ y1 = _;
+ return area;
+ };
+ area.defined = function(_) {
+ if (!arguments.length) return defined;
+ defined = _;
+ return area;
+ };
+ area.interpolate = function(_) {
+ if (!arguments.length) return interpolateKey;
+ if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
+ interpolateReverse = interpolate.reverse || interpolate;
+ L = interpolate.closed ? "M" : "L";
+ return area;
+ };
+ area.tension = function(_) {
+ if (!arguments.length) return tension;
+ tension = _;
+ return area;
+ };
+ return area;
+ }
+ d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;
+ d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;
+ d3.svg.area = function() {
+ return d3_svg_area(d3_identity);
+ };
+ d3.svg.area.radial = function() {
+ var area = d3_svg_area(d3_svg_lineRadial);
+ area.radius = area.x, delete area.x;
+ area.innerRadius = area.x0, delete area.x0;
+ area.outerRadius = area.x1, delete area.x1;
+ area.angle = area.y, delete area.y;
+ area.startAngle = area.y0, delete area.y0;
+ area.endAngle = area.y1, delete area.y1;
+ return area;
+ };
+ d3.svg.chord = function() {
+ var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
+ function chord(d, i) {
+ var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);
+ return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z";
+ }
+ function subgroup(self, f, d, i) {
+ var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) - halfπ, a1 = endAngle.call(self, subgroup, i) - halfπ;
+ return {
+ r: r,
+ a0: a0,
+ a1: a1,
+ p0: [ r * Math.cos(a0), r * Math.sin(a0) ],
+ p1: [ r * Math.cos(a1), r * Math.sin(a1) ]
+ };
+ }
+ function equals(a, b) {
+ return a.a0 == b.a0 && a.a1 == b.a1;
+ }
+ function arc(r, p, a) {
+ return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p;
+ }
+ function curve(r0, p0, r1, p1) {
+ return "Q 0,0 " + p1;
+ }
+ chord.radius = function(v) {
+ if (!arguments.length) return radius;
+ radius = d3_functor(v);
+ return chord;
+ };
+ chord.source = function(v) {
+ if (!arguments.length) return source;
+ source = d3_functor(v);
+ return chord;
+ };
+ chord.target = function(v) {
+ if (!arguments.length) return target;
+ target = d3_functor(v);
+ return chord;
+ };
+ chord.startAngle = function(v) {
+ if (!arguments.length) return startAngle;
+ startAngle = d3_functor(v);
+ return chord;
+ };
+ chord.endAngle = function(v) {
+ if (!arguments.length) return endAngle;
+ endAngle = d3_functor(v);
+ return chord;
+ };
+ return chord;
+ };
+ function d3_svg_chordRadius(d) {
+ return d.radius;
+ }
+ d3.svg.diagonal = function() {
+ var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection;
+ function diagonal(d, i) {
+ var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, {
+ x: p0.x,
+ y: m
+ }, {
+ x: p3.x,
+ y: m
+ }, p3 ];
+ p = p.map(projection);
+ return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3];
+ }
+ diagonal.source = function(x) {
+ if (!arguments.length) return source;
+ source = d3_functor(x);
+ return diagonal;
+ };
+ diagonal.target = function(x) {
+ if (!arguments.length) return target;
+ target = d3_functor(x);
+ return diagonal;
+ };
+ diagonal.projection = function(x) {
+ if (!arguments.length) return projection;
+ projection = x;
+ return diagonal;
+ };
+ return diagonal;
+ };
+ function d3_svg_diagonalProjection(d) {
+ return [ d.x, d.y ];
+ }
+ d3.svg.diagonal.radial = function() {
+ var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection;
+ diagonal.projection = function(x) {
+ return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection;
+ };
+ return diagonal;
+ };
+ function d3_svg_diagonalRadialProjection(projection) {
+ return function() {
+ var d = projection.apply(this, arguments), r = d[0], a = d[1] - halfπ;
+ return [ r * Math.cos(a), r * Math.sin(a) ];
+ };
+ }
+ d3.svg.symbol = function() {
+ var type = d3_svg_symbolType, size = d3_svg_symbolSize;
+ function symbol(d, i) {
+ return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i));
+ }
+ symbol.type = function(x) {
+ if (!arguments.length) return type;
+ type = d3_functor(x);
+ return symbol;
+ };
+ symbol.size = function(x) {
+ if (!arguments.length) return size;
+ size = d3_functor(x);
+ return symbol;
+ };
+ return symbol;
+ };
+ function d3_svg_symbolSize() {
+ return 64;
+ }
+ function d3_svg_symbolType() {
+ return "circle";
+ }
+ function d3_svg_symbolCircle(size) {
+ var r = Math.sqrt(size / π);
+ return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z";
+ }
+ var d3_svg_symbols = d3.map({
+ circle: d3_svg_symbolCircle,
+ cross: function(size) {
+ var r = Math.sqrt(size / 5) / 2;
+ return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z";
+ },
+ diamond: function(size) {
+ var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30;
+ return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z";
+ },
+ square: function(size) {
+ var r = Math.sqrt(size) / 2;
+ return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z";
+ },
+ "triangle-down": function(size) {
+ var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
+ return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z";
+ },
+ "triangle-up": function(size) {
+ var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
+ return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z";
+ }
+ });
+ d3.svg.symbolTypes = d3_svg_symbols.keys();
+ var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians);
+ d3_selectionPrototype.transition = function(name) {
+ var id = d3_transitionInheritId || ++d3_transitionId, ns = d3_transitionNamespace(name), subgroups = [], subgroup, node, transition = d3_transitionInherit || {
+ time: Date.now(),
+ ease: d3_ease_cubicInOut,
+ delay: 0,
+ duration: 250
+ };
+ for (var j = -1, m = this.length; ++j < m; ) {
+ subgroups.push(subgroup = []);
+ for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) d3_transitionNode(node, i, ns, id, transition);
+ subgroup.push(node);
+ }
+ }
+ return d3_transition(subgroups, ns, id);
+ };
+ d3_selectionPrototype.interrupt = function(name) {
+ return this.each(name == null ? d3_selection_interrupt : d3_selection_interruptNS(d3_transitionNamespace(name)));
+ };
+ var d3_selection_interrupt = d3_selection_interruptNS(d3_transitionNamespace());
+ function d3_selection_interruptNS(ns) {
+ return function() {
+ var lock, activeId, active;
+ if ((lock = this[ns]) && (active = lock[activeId = lock.active])) {
+ active.timer.c = null;
+ active.timer.t = NaN;
+ if (--lock.count) delete lock[activeId]; else delete this[ns];
+ lock.active += .5;
+ active.event && active.event.interrupt.call(this, this.__data__, active.index);
+ }
+ };
+ }
+ function d3_transition(groups, ns, id) {
+ d3_subclass(groups, d3_transitionPrototype);
+ groups.namespace = ns;
+ groups.id = id;
+ return groups;
+ }
+ var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit;
+ d3_transitionPrototype.call = d3_selectionPrototype.call;
+ d3_transitionPrototype.empty = d3_selectionPrototype.empty;
+ d3_transitionPrototype.node = d3_selectionPrototype.node;
+ d3_transitionPrototype.size = d3_selectionPrototype.size;
+ d3.transition = function(selection, name) {
+ return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3.selection().transition(selection);
+ };
+ d3.transition.prototype = d3_transitionPrototype;
+ d3_transitionPrototype.select = function(selector) {
+ var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnode, node;
+ selector = d3_selection_selector(selector);
+ for (var j = -1, m = this.length; ++j < m; ) {
+ subgroups.push(subgroup = []);
+ for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
+ if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) {
+ if ("__data__" in node) subnode.__data__ = node.__data__;
+ d3_transitionNode(subnode, i, ns, id, node[ns][id]);
+ subgroup.push(subnode);
+ } else {
+ subgroup.push(null);
+ }
+ }
+ }
+ return d3_transition(subgroups, ns, id);
+ };
+ d3_transitionPrototype.selectAll = function(selector) {
+ var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnodes, node, subnode, transition;
+ selector = d3_selection_selectorAll(selector);
+ for (var j = -1, m = this.length; ++j < m; ) {
+ for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) {
+ transition = node[ns][id];
+ subnodes = selector.call(node, node.__data__, i, j);
+ subgroups.push(subgroup = []);
+ for (var k = -1, o = subnodes.length; ++k < o; ) {
+ if (subnode = subnodes[k]) d3_transitionNode(subnode, k, ns, id, transition);
+ subgroup.push(subnode);
+ }
+ }
+ }
+ }
+ return d3_transition(subgroups, ns, id);
+ };
+ d3_transitionPrototype.filter = function(filter) {
+ var subgroups = [], subgroup, group, node;
+ if (typeof filter !== "function") filter = d3_selection_filter(filter);
+ for (var j = 0, m = this.length; j < m; j++) {
+ subgroups.push(subgroup = []);
+ for (var group = this[j], i = 0, n = group.length; i < n; i++) {
+ if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
+ subgroup.push(node);
+ }
+ }
+ }
+ return d3_transition(subgroups, this.namespace, this.id);
+ };
+ d3_transitionPrototype.tween = function(name, tween) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 2) return this.node()[ns][id].tween.get(name);
+ return d3_selection_each(this, tween == null ? function(node) {
+ node[ns][id].tween.remove(name);
+ } : function(node) {
+ node[ns][id].tween.set(name, tween);
+ });
+ };
+ function d3_transition_tween(groups, name, value, tween) {
+ var id = groups.id, ns = groups.namespace;
+ return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) {
+ node[ns][id].tween.set(name, tween(value.call(node, node.__data__, i, j)));
+ } : (value = tween(value), function(node) {
+ node[ns][id].tween.set(name, value);
+ }));
+ }
+ d3_transitionPrototype.attr = function(nameNS, value) {
+ if (arguments.length < 2) {
+ for (value in nameNS) this.attr(value, nameNS[value]);
+ return this;
+ }
+ var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS);
+ function attrNull() {
+ this.removeAttribute(name);
+ }
+ function attrNullNS() {
+ this.removeAttributeNS(name.space, name.local);
+ }
+ function attrTween(b) {
+ return b == null ? attrNull : (b += "", function() {
+ var a = this.getAttribute(name), i;
+ return a !== b && (i = interpolate(a, b), function(t) {
+ this.setAttribute(name, i(t));
+ });
+ });
+ }
+ function attrTweenNS(b) {
+ return b == null ? attrNullNS : (b += "", function() {
+ var a = this.getAttributeNS(name.space, name.local), i;
+ return a !== b && (i = interpolate(a, b), function(t) {
+ this.setAttributeNS(name.space, name.local, i(t));
+ });
+ });
+ }
+ return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween);
+ };
+ d3_transitionPrototype.attrTween = function(nameNS, tween) {
+ var name = d3.ns.qualify(nameNS);
+ function attrTween(d, i) {
+ var f = tween.call(this, d, i, this.getAttribute(name));
+ return f && function(t) {
+ this.setAttribute(name, f(t));
+ };
+ }
+ function attrTweenNS(d, i) {
+ var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));
+ return f && function(t) {
+ this.setAttributeNS(name.space, name.local, f(t));
+ };
+ }
+ return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween);
+ };
+ d3_transitionPrototype.style = function(name, value, priority) {
+ var n = arguments.length;
+ if (n < 3) {
+ if (typeof name !== "string") {
+ if (n < 2) value = "";
+ for (priority in name) this.style(priority, name[priority], value);
+ return this;
+ }
+ priority = "";
+ }
+ function styleNull() {
+ this.style.removeProperty(name);
+ }
+ function styleString(b) {
+ return b == null ? styleNull : (b += "", function() {
+ var a = d3_window(this).getComputedStyle(this, null).getPropertyValue(name), i;
+ return a !== b && (i = d3_interpolate(a, b), function(t) {
+ this.style.setProperty(name, i(t), priority);
+ });
+ });
+ }
+ return d3_transition_tween(this, "style." + name, value, styleString);
+ };
+ d3_transitionPrototype.styleTween = function(name, tween, priority) {
+ if (arguments.length < 3) priority = "";
+ function styleTween(d, i) {
+ var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name));
+ return f && function(t) {
+ this.style.setProperty(name, f(t), priority);
+ };
+ }
+ return this.tween("style." + name, styleTween);
+ };
+ d3_transitionPrototype.text = function(value) {
+ return d3_transition_tween(this, "text", value, d3_transition_text);
+ };
+ function d3_transition_text(b) {
+ if (b == null) b = "";
+ return function() {
+ this.textContent = b;
+ };
+ }
+ d3_transitionPrototype.remove = function() {
+ var ns = this.namespace;
+ return this.each("end.transition", function() {
+ var p;
+ if (this[ns].count < 2 && (p = this.parentNode)) p.removeChild(this);
+ });
+ };
+ d3_transitionPrototype.ease = function(value) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 1) return this.node()[ns][id].ease;
+ if (typeof value !== "function") value = d3.ease.apply(d3, arguments);
+ return d3_selection_each(this, function(node) {
+ node[ns][id].ease = value;
+ });
+ };
+ d3_transitionPrototype.delay = function(value) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 1) return this.node()[ns][id].delay;
+ return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
+ node[ns][id].delay = +value.call(node, node.__data__, i, j);
+ } : (value = +value, function(node) {
+ node[ns][id].delay = value;
+ }));
+ };
+ d3_transitionPrototype.duration = function(value) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 1) return this.node()[ns][id].duration;
+ return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
+ node[ns][id].duration = Math.max(1, value.call(node, node.__data__, i, j));
+ } : (value = Math.max(1, value), function(node) {
+ node[ns][id].duration = value;
+ }));
+ };
+ d3_transitionPrototype.each = function(type, listener) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 2) {
+ var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId;
+ try {
+ d3_transitionInheritId = id;
+ d3_selection_each(this, function(node, i, j) {
+ d3_transitionInherit = node[ns][id];
+ type.call(node, node.__data__, i, j);
+ });
+ } finally {
+ d3_transitionInherit = inherit;
+ d3_transitionInheritId = inheritId;
+ }
+ } else {
+ d3_selection_each(this, function(node) {
+ var transition = node[ns][id];
+ (transition.event || (transition.event = d3.dispatch("start", "end", "interrupt"))).on(type, listener);
+ });
+ }
+ return this;
+ };
+ d3_transitionPrototype.transition = function() {
+ var id0 = this.id, id1 = ++d3_transitionId, ns = this.namespace, subgroups = [], subgroup, group, node, transition;
+ for (var j = 0, m = this.length; j < m; j++) {
+ subgroups.push(subgroup = []);
+ for (var group = this[j], i = 0, n = group.length; i < n; i++) {
+ if (node = group[i]) {
+ transition = node[ns][id0];
+ d3_transitionNode(node, i, ns, id1, {
+ time: transition.time,
+ ease: transition.ease,
+ delay: transition.delay + transition.duration,
+ duration: transition.duration
+ });
+ }
+ subgroup.push(node);
+ }
+ }
+ return d3_transition(subgroups, ns, id1);
+ };
+ function d3_transitionNamespace(name) {
+ return name == null ? "__transition__" : "__transition_" + name + "__";
+ }
+ function d3_transitionNode(node, i, ns, id, inherit) {
+ var lock = node[ns] || (node[ns] = {
+ active: 0,
+ count: 0
+ }), transition = lock[id], time, timer, duration, ease, tweens;
+ function schedule(elapsed) {
+ var delay = transition.delay;
+ timer.t = delay + time;
+ if (delay <= elapsed) return start(elapsed - delay);
+ timer.c = start;
+ }
+ function start(elapsed) {
+ var activeId = lock.active, active = lock[activeId];
+ if (active) {
+ active.timer.c = null;
+ active.timer.t = NaN;
+ --lock.count;
+ delete lock[activeId];
+ active.event && active.event.interrupt.call(node, node.__data__, active.index);
+ }
+ for (var cancelId in lock) {
+ if (+cancelId < id) {
+ var cancel = lock[cancelId];
+ cancel.timer.c = null;
+ cancel.timer.t = NaN;
+ --lock.count;
+ delete lock[cancelId];
+ }
+ }
+ timer.c = tick;
+ d3_timer(function() {
+ if (timer.c && tick(elapsed || 1)) {
+ timer.c = null;
+ timer.t = NaN;
+ }
+ return 1;
+ }, 0, time);
+ lock.active = id;
+ transition.event && transition.event.start.call(node, node.__data__, i);
+ tweens = [];
+ transition.tween.forEach(function(key, value) {
+ if (value = value.call(node, node.__data__, i)) {
+ tweens.push(value);
+ }
+ });
+ ease = transition.ease;
+ duration = transition.duration;
+ }
+ function tick(elapsed) {
+ var t = elapsed / duration, e = ease(t), n = tweens.length;
+ while (n > 0) {
+ tweens[--n].call(node, e);
+ }
+ if (t >= 1) {
+ transition.event && transition.event.end.call(node, node.__data__, i);
+ if (--lock.count) delete lock[id]; else delete node[ns];
+ return 1;
+ }
+ }
+ if (!transition) {
+ time = inherit.time;
+ timer = d3_timer(schedule, 0, time);
+ transition = lock[id] = {
+ tween: new d3_Map(),
+ time: time,
+ timer: timer,
+ delay: inherit.delay,
+ duration: inherit.duration,
+ ease: inherit.ease,
+ index: i
+ };
+ inherit = null;
+ ++lock.count;
+ }
+ }
+ d3.svg.axis = function() {
+ var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_;
+ function axis(g) {
+ g.each(function() {
+ var g = d3.select(this);
+ var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
+ var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform;
+ var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
+ d3.transition(path));
+ tickEnter.append("line");
+ tickEnter.append("text");
+ var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"), sign = orient === "top" || orient === "left" ? -1 : 1, x1, x2, y1, y2;
+ if (orient === "bottom" || orient === "top") {
+ tickTransform = d3_svg_axisX, x1 = "x", y1 = "y", x2 = "x2", y2 = "y2";
+ text.attr("dy", sign < 0 ? "0em" : ".71em").style("text-anchor", "middle");
+ pathUpdate.attr("d", "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize);
+ } else {
+ tickTransform = d3_svg_axisY, x1 = "y", y1 = "x", x2 = "y2", y2 = "x2";
+ text.attr("dy", ".32em").style("text-anchor", sign < 0 ? "end" : "start");
+ pathUpdate.attr("d", "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize);
+ }
+ lineEnter.attr(y2, sign * innerTickSize);
+ textEnter.attr(y1, sign * tickSpacing);
+ lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize);
+ textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing);
+ if (scale1.rangeBand) {
+ var x = scale1, dx = x.rangeBand() / 2;
+ scale0 = scale1 = function(d) {
+ return x(d) + dx;
+ };
+ } else if (scale0.rangeBand) {
+ scale0 = scale1;
+ } else {
+ tickExit.call(tickTransform, scale1, scale0);
+ }
+ tickEnter.call(tickTransform, scale0, scale1);
+ tickUpdate.call(tickTransform, scale1, scale1);
+ });
+ }
+ axis.scale = function(x) {
+ if (!arguments.length) return scale;
+ scale = x;
+ return axis;
+ };
+ axis.orient = function(x) {
+ if (!arguments.length) return orient;
+ orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient;
+ return axis;
+ };
+ axis.ticks = function() {
+ if (!arguments.length) return tickArguments_;
+ tickArguments_ = d3_array(arguments);
+ return axis;
+ };
+ axis.tickValues = function(x) {
+ if (!arguments.length) return tickValues;
+ tickValues = x;
+ return axis;
+ };
+ axis.tickFormat = function(x) {
+ if (!arguments.length) return tickFormat_;
+ tickFormat_ = x;
+ return axis;
+ };
+ axis.tickSize = function(x) {
+ var n = arguments.length;
+ if (!n) return innerTickSize;
+ innerTickSize = +x;
+ outerTickSize = +arguments[n - 1];
+ return axis;
+ };
+ axis.innerTickSize = function(x) {
+ if (!arguments.length) return innerTickSize;
+ innerTickSize = +x;
+ return axis;
+ };
+ axis.outerTickSize = function(x) {
+ if (!arguments.length) return outerTickSize;
+ outerTickSize = +x;
+ return axis;
+ };
+ axis.tickPadding = function(x) {
+ if (!arguments.length) return tickPadding;
+ tickPadding = +x;
+ return axis;
+ };
+ axis.tickSubdivide = function() {
+ return arguments.length && axis;
+ };
+ return axis;
+ };
+ var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = {
+ top: 1,
+ right: 1,
+ bottom: 1,
+ left: 1
+ };
+ function d3_svg_axisX(selection, x0, x1) {
+ selection.attr("transform", function(d) {
+ var v0 = x0(d);
+ return "translate(" + (isFinite(v0) ? v0 : x1(d)) + ",0)";
+ });
+ }
+ function d3_svg_axisY(selection, y0, y1) {
+ selection.attr("transform", function(d) {
+ var v0 = y0(d);
+ return "translate(0," + (isFinite(v0) ? v0 : y1(d)) + ")";
+ });
+ }
+ d3.svg.brush = function() {
+ var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0];
+ function brush(g) {
+ g.each(function() {
+ var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart);
+ var background = g.selectAll(".background").data([ 0 ]);
+ background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair");
+ g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move");
+ var resize = g.selectAll(".resize").data(resizes, d3_identity);
+ resize.exit().remove();
+ resize.enter().append("g").attr("class", function(d) {
+ return "resize " + d;
+ }).style("cursor", function(d) {
+ return d3_svg_brushCursor[d];
+ }).append("rect").attr("x", function(d) {
+ return /[ew]$/.test(d) ? -3 : null;
+ }).attr("y", function(d) {
+ return /^[ns]/.test(d) ? -3 : null;
+ }).attr("width", 6).attr("height", 6).style("visibility", "hidden");
+ resize.style("display", brush.empty() ? "none" : null);
+ var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range;
+ if (x) {
+ range = d3_scaleRange(x);
+ backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]);
+ redrawX(gUpdate);
+ }
+ if (y) {
+ range = d3_scaleRange(y);
+ backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]);
+ redrawY(gUpdate);
+ }
+ redraw(gUpdate);
+ });
+ }
+ brush.event = function(g) {
+ g.each(function() {
+ var event_ = event.of(this, arguments), extent1 = {
+ x: xExtent,
+ y: yExtent,
+ i: xExtentDomain,
+ j: yExtentDomain
+ }, extent0 = this.__chart__ || extent1;
+ this.__chart__ = extent1;
+ if (d3_transitionInheritId) {
+ d3.select(this).transition().each("start.brush", function() {
+ xExtentDomain = extent0.i;
+ yExtentDomain = extent0.j;
+ xExtent = extent0.x;
+ yExtent = extent0.y;
+ event_({
+ type: "brushstart"
+ });
+ }).tween("brush:brush", function() {
+ var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);
+ xExtentDomain = yExtentDomain = null;
+ return function(t) {
+ xExtent = extent1.x = xi(t);
+ yExtent = extent1.y = yi(t);
+ event_({
+ type: "brush",
+ mode: "resize"
+ });
+ };
+ }).each("end.brush", function() {
+ xExtentDomain = extent1.i;
+ yExtentDomain = extent1.j;
+ event_({
+ type: "brush",
+ mode: "resize"
+ });
+ event_({
+ type: "brushend"
+ });
+ });
+ } else {
+ event_({
+ type: "brushstart"
+ });
+ event_({
+ type: "brush",
+ mode: "resize"
+ });
+ event_({
+ type: "brushend"
+ });
+ }
+ });
+ };
+ function redraw(g) {
+ g.selectAll(".resize").attr("transform", function(d) {
+ return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")";
+ });
+ }
+ function redrawX(g) {
+ g.select(".extent").attr("x", xExtent[0]);
+ g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]);
+ }
+ function redrawY(g) {
+ g.select(".extent").attr("y", yExtent[0]);
+ g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]);
+ }
+ function brushstart() {
+ var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(target), center, origin = d3.mouse(target), offset;
+ var w = d3.select(d3_window(target)).on("keydown.brush", keydown).on("keyup.brush", keyup);
+ if (d3.event.changedTouches) {
+ w.on("touchmove.brush", brushmove).on("touchend.brush", brushend);
+ } else {
+ w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend);
+ }
+ g.interrupt().selectAll("*").interrupt();
+ if (dragging) {
+ origin[0] = xExtent[0] - origin[0];
+ origin[1] = yExtent[0] - origin[1];
+ } else if (resizing) {
+ var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing);
+ offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ];
+ origin[0] = xExtent[ex];
+ origin[1] = yExtent[ey];
+ } else if (d3.event.altKey) center = origin.slice();
+ g.style("pointer-events", "none").selectAll(".resize").style("display", null);
+ d3.select("body").style("cursor", eventTarget.style("cursor"));
+ event_({
+ type: "brushstart"
+ });
+ brushmove();
+ function keydown() {
+ if (d3.event.keyCode == 32) {
+ if (!dragging) {
+ center = null;
+ origin[0] -= xExtent[1];
+ origin[1] -= yExtent[1];
+ dragging = 2;
+ }
+ d3_eventPreventDefault();
+ }
+ }
+ function keyup() {
+ if (d3.event.keyCode == 32 && dragging == 2) {
+ origin[0] += xExtent[1];
+ origin[1] += yExtent[1];
+ dragging = 0;
+ d3_eventPreventDefault();
+ }
+ }
+ function brushmove() {
+ var point = d3.mouse(target), moved = false;
+ if (offset) {
+ point[0] += offset[0];
+ point[1] += offset[1];
+ }
+ if (!dragging) {
+ if (d3.event.altKey) {
+ if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ];
+ origin[0] = xExtent[+(point[0] < center[0])];
+ origin[1] = yExtent[+(point[1] < center[1])];
+ } else center = null;
+ }
+ if (resizingX && move1(point, x, 0)) {
+ redrawX(g);
+ moved = true;
+ }
+ if (resizingY && move1(point, y, 1)) {
+ redrawY(g);
+ moved = true;
+ }
+ if (moved) {
+ redraw(g);
+ event_({
+ type: "brush",
+ mode: dragging ? "move" : "resize"
+ });
+ }
+ }
+ function move1(point, scale, i) {
+ var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max;
+ if (dragging) {
+ r0 -= position;
+ r1 -= size + position;
+ }
+ min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i];
+ if (dragging) {
+ max = (min += position) + size;
+ } else {
+ if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min));
+ if (position < min) {
+ max = min;
+ min = position;
+ } else {
+ max = position;
+ }
+ }
+ if (extent[0] != min || extent[1] != max) {
+ if (i) yExtentDomain = null; else xExtentDomain = null;
+ extent[0] = min;
+ extent[1] = max;
+ return true;
+ }
+ }
+ function brushend() {
+ brushmove();
+ g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null);
+ d3.select("body").style("cursor", null);
+ w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null);
+ dragRestore();
+ event_({
+ type: "brushend"
+ });
+ }
+ }
+ brush.x = function(z) {
+ if (!arguments.length) return x;
+ x = z;
+ resizes = d3_svg_brushResizes[!x << 1 | !y];
+ return brush;
+ };
+ brush.y = function(z) {
+ if (!arguments.length) return y;
+ y = z;
+ resizes = d3_svg_brushResizes[!x << 1 | !y];
+ return brush;
+ };
+ brush.clamp = function(z) {
+ if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null;
+ if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z;
+ return brush;
+ };
+ brush.extent = function(z) {
+ var x0, x1, y0, y1, t;
+ if (!arguments.length) {
+ if (x) {
+ if (xExtentDomain) {
+ x0 = xExtentDomain[0], x1 = xExtentDomain[1];
+ } else {
+ x0 = xExtent[0], x1 = xExtent[1];
+ if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1);
+ if (x1 < x0) t = x0, x0 = x1, x1 = t;
+ }
+ }
+ if (y) {
+ if (yExtentDomain) {
+ y0 = yExtentDomain[0], y1 = yExtentDomain[1];
+ } else {
+ y0 = yExtent[0], y1 = yExtent[1];
+ if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1);
+ if (y1 < y0) t = y0, y0 = y1, y1 = t;
+ }
+ }
+ return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ];
+ }
+ if (x) {
+ x0 = z[0], x1 = z[1];
+ if (y) x0 = x0[0], x1 = x1[0];
+ xExtentDomain = [ x0, x1 ];
+ if (x.invert) x0 = x(x0), x1 = x(x1);
+ if (x1 < x0) t = x0, x0 = x1, x1 = t;
+ if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ];
+ }
+ if (y) {
+ y0 = z[0], y1 = z[1];
+ if (x) y0 = y0[1], y1 = y1[1];
+ yExtentDomain = [ y0, y1 ];
+ if (y.invert) y0 = y(y0), y1 = y(y1);
+ if (y1 < y0) t = y0, y0 = y1, y1 = t;
+ if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ];
+ }
+ return brush;
+ };
+ brush.clear = function() {
+ if (!brush.empty()) {
+ xExtent = [ 0, 0 ], yExtent = [ 0, 0 ];
+ xExtentDomain = yExtentDomain = null;
+ }
+ return brush;
+ };
+ brush.empty = function() {
+ return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1];
+ };
+ return d3.rebind(brush, event, "on");
+ };
+ var d3_svg_brushCursor = {
+ n: "ns-resize",
+ e: "ew-resize",
+ s: "ns-resize",
+ w: "ew-resize",
+ nw: "nwse-resize",
+ ne: "nesw-resize",
+ se: "nwse-resize",
+ sw: "nesw-resize"
+ };
+ var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ];
+ var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat;
+ var d3_time_formatUtc = d3_time_format.utc;
+ var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ");
+ d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso;
+ function d3_time_formatIsoNative(date) {
+ return date.toISOString();
+ }
+ d3_time_formatIsoNative.parse = function(string) {
+ var date = new Date(string);
+ return isNaN(date) ? null : date;
+ };
+ d3_time_formatIsoNative.toString = d3_time_formatIso.toString;
+ d3_time.second = d3_time_interval(function(date) {
+ return new d3_date(Math.floor(date / 1e3) * 1e3);
+ }, function(date, offset) {
+ date.setTime(date.getTime() + Math.floor(offset) * 1e3);
+ }, function(date) {
+ return date.getSeconds();
+ });
+ d3_time.seconds = d3_time.second.range;
+ d3_time.seconds.utc = d3_time.second.utc.range;
+ d3_time.minute = d3_time_interval(function(date) {
+ return new d3_date(Math.floor(date / 6e4) * 6e4);
+ }, function(date, offset) {
+ date.setTime(date.getTime() + Math.floor(offset) * 6e4);
+ }, function(date) {
+ return date.getMinutes();
+ });
+ d3_time.minutes = d3_time.minute.range;
+ d3_time.minutes.utc = d3_time.minute.utc.range;
+ d3_time.hour = d3_time_interval(function(date) {
+ var timezone = date.getTimezoneOffset() / 60;
+ return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5);
+ }, function(date, offset) {
+ date.setTime(date.getTime() + Math.floor(offset) * 36e5);
+ }, function(date) {
+ return date.getHours();
+ });
+ d3_time.hours = d3_time.hour.range;
+ d3_time.hours.utc = d3_time.hour.utc.range;
+ d3_time.month = d3_time_interval(function(date) {
+ date = d3_time.day(date);
+ date.setDate(1);
+ return date;
+ }, function(date, offset) {
+ date.setMonth(date.getMonth() + offset);
+ }, function(date) {
+ return date.getMonth();
+ });
+ d3_time.months = d3_time.month.range;
+ d3_time.months.utc = d3_time.month.utc.range;
+ function d3_time_scale(linear, methods, format) {
+ function scale(x) {
+ return linear(x);
+ }
+ scale.invert = function(x) {
+ return d3_time_scaleDate(linear.invert(x));
+ };
+ scale.domain = function(x) {
+ if (!arguments.length) return linear.domain().map(d3_time_scaleDate);
+ linear.domain(x);
+ return scale;
+ };
+ function tickMethod(extent, count) {
+ var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target);
+ return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) {
+ return d / 31536e6;
+ }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i];
+ }
+ scale.nice = function(interval, skip) {
+ var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval);
+ if (method) interval = method[0], skip = method[1];
+ function skipped(date) {
+ return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length;
+ }
+ return scale.domain(d3_scale_nice(domain, skip > 1 ? {
+ floor: function(date) {
+ while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1);
+ return date;
+ },
+ ceil: function(date) {
+ while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1);
+ return date;
+ }
+ } : interval));
+ };
+ scale.ticks = function(interval, skip) {
+ var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ {
+ range: interval
+ }, skip ];
+ if (method) interval = method[0], skip = method[1];
+ return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip);
+ };
+ scale.tickFormat = function() {
+ return format;
+ };
+ scale.copy = function() {
+ return d3_time_scale(linear.copy(), methods, format);
+ };
+ return d3_scale_linearRebind(scale, linear);
+ }
+ function d3_time_scaleDate(t) {
+ return new Date(t);
+ }
+ var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];
+ var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ];
+ var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) {
+ return d.getMilliseconds();
+ } ], [ ":%S", function(d) {
+ return d.getSeconds();
+ } ], [ "%I:%M", function(d) {
+ return d.getMinutes();
+ } ], [ "%I %p", function(d) {
+ return d.getHours();
+ } ], [ "%a %d", function(d) {
+ return d.getDay() && d.getDate() != 1;
+ } ], [ "%b %d", function(d) {
+ return d.getDate() != 1;
+ } ], [ "%B", function(d) {
+ return d.getMonth();
+ } ], [ "%Y", d3_true ] ]);
+ var d3_time_scaleMilliseconds = {
+ range: function(start, stop, step) {
+ return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate);
+ },
+ floor: d3_identity,
+ ceil: d3_identity
+ };
+ d3_time_scaleLocalMethods.year = d3_time.year;
+ d3_time.scale = function() {
+ return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat);
+ };
+ var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) {
+ return [ m[0].utc, m[1] ];
+ });
+ var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) {
+ return d.getUTCMilliseconds();
+ } ], [ ":%S", function(d) {
+ return d.getUTCSeconds();
+ } ], [ "%I:%M", function(d) {
+ return d.getUTCMinutes();
+ } ], [ "%I %p", function(d) {
+ return d.getUTCHours();
+ } ], [ "%a %d", function(d) {
+ return d.getUTCDay() && d.getUTCDate() != 1;
+ } ], [ "%b %d", function(d) {
+ return d.getUTCDate() != 1;
+ } ], [ "%B", function(d) {
+ return d.getUTCMonth();
+ } ], [ "%Y", d3_true ] ]);
+ d3_time_scaleUtcMethods.year = d3_time.year.utc;
+ d3_time.scale.utc = function() {
+ return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat);
+ };
+ d3.text = d3_xhrType(function(request) {
+ return request.responseText;
+ });
+ d3.json = function(url, callback) {
+ return d3_xhr(url, "application/json", d3_json, callback);
+ };
+ function d3_json(request) {
+ return JSON.parse(request.responseText);
+ }
+ d3.html = function(url, callback) {
+ return d3_xhr(url, "text/html", d3_html, callback);
+ };
+ function d3_html(request) {
+ var range = d3_document.createRange();
+ range.selectNode(d3_document.body);
+ return range.createContextualFragment(request.responseText);
+ }
+ d3.xml = d3_xhrType(function(request) {
+ return request.responseXML;
+ });
+ if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3;
+}(); \ No newline at end of file
diff --git a/src_js/jquery.js b/src_js/jquery.js
new file mode 100644
index 0000000..4855adc
--- /dev/null
+++ b/src_js/jquery.js
@@ -0,0 +1,11027 @@
+/*!
+ * jQuery JavaScript Library v1.12.0
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2016-01-08T19:56Z
+ */
+
+(function( global, factory ) {
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+ // For CommonJS and CommonJS-like environments where a proper `window`
+ // is present, execute the factory and get jQuery.
+ // For environments that do not have a `window` with a `document`
+ // (such as Node.js), expose a factory as module.exports.
+ // This accentuates the need for the creation of a real `window`.
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info.
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Support: Firefox 18+
+// Can't be in strict mode, several libs including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+//"use strict";
+var deletedIds = [];
+
+var document = window.document;
+
+var slice = deletedIds.slice;
+
+var concat = deletedIds.concat;
+
+var push = deletedIds.push;
+
+var indexOf = deletedIds.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var support = {};
+
+
+
+var
+ version = "1.12.0",
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+
+ // The jQuery object is actually just the init constructor 'enhanced'
+ // Need init if jQuery is called (just allow error to be thrown if not included)
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Support: Android<4.1, IE<9
+ // Make sure we trim BOM and NBSP
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn = jQuery.prototype = {
+
+ // The current version of jQuery being used
+ jquery: version,
+
+ constructor: jQuery,
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num != null ?
+
+ // Return just the one element from the set
+ ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
+
+ // Return all the elements in a clean array
+ slice.call( this );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ each: function( callback ) {
+ return jQuery.each( this, callback );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map( this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ } ) );
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor();
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: deletedIds.sort,
+ splice: deletedIds.splice
+};
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var src, copyIsArray, copy, name, options, clone,
+ target = arguments[ 0 ] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+
+ // skip the boolean and the target
+ target = arguments[ i ] || {};
+ i++;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( i === length ) {
+ target = this;
+ i--;
+ }
+
+ for ( ; i < length; i++ ) {
+
+ // Only deal with non-null/undefined values
+ if ( ( options = arguments[ i ] ) != null ) {
+
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
+ ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
+
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray( src ) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject( src ) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend( {
+
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
+
+ // Assume jQuery is ready without the ready module
+ isReady: true,
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ noop: function() {},
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type( obj ) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type( obj ) === "array";
+ },
+
+ isWindow: function( obj ) {
+ /* jshint eqeqeq: false */
+ return obj != null && obj == obj.window;
+ },
+
+ isNumeric: function( obj ) {
+
+ // parseFloat NaNs numeric-cast false positives (null|true|false|"")
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+ // subtraction forces infinities to NaN
+ // adding 1 corrects loss of precision from parseFloat (#15100)
+ var realStringObj = obj && obj.toString();
+ return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ isPlainObject: function( obj ) {
+ var key;
+
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call( obj, "constructor" ) &&
+ !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
+ return false;
+ }
+ } catch ( e ) {
+
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Support: IE<9
+ // Handle iteration over inherited properties before own properties.
+ if ( !support.ownFirst ) {
+ for ( key in obj ) {
+ return hasOwn.call( obj, key );
+ }
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call( obj ) ] || "object" :
+ typeof obj;
+ },
+
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && jQuery.trim( data ) ) {
+
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ each: function( obj, callback ) {
+ var length, i = 0;
+
+ if ( isArrayLike( obj ) ) {
+ length = obj.length;
+ for ( ; i < length; i++ ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
+ break;
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Support: Android<4.1, IE<9
+ trim: function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArrayLike( Object( arr ) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ var len;
+
+ if ( arr ) {
+ if ( indexOf ) {
+ return indexOf.call( arr, elem, i );
+ }
+
+ len = arr.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+
+ // Skip accessing in sparse arrays
+ if ( i in arr && arr[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var len = +second.length,
+ j = 0,
+ i = first.length;
+
+ while ( j < len ) {
+ first[ i++ ] = second[ j++ ];
+ }
+
+ // Support: IE<9
+ // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
+ if ( len !== len ) {
+ while ( second[ j ] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, invert ) {
+ var callbackInverse,
+ matches = [],
+ i = 0,
+ length = elems.length,
+ callbackExpect = !invert;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ callbackInverse = !callback( elems[ i ], i );
+ if ( callbackInverse !== callbackExpect ) {
+ matches.push( elems[ i ] );
+ }
+ }
+
+ return matches;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var length, value,
+ i = 0,
+ ret = [];
+
+ // Go through the array, translating each of the items to their new values
+ if ( isArrayLike( elems ) ) {
+ length = elems.length;
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var args, proxy, tmp;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ now: function() {
+ return +( new Date() );
+ },
+
+ // jQuery.support is not used in Core but other projects attach their
+ // properties to it so it needs to exist.
+ support: support
+} );
+
+// JSHint would error on this code due to the Symbol not being defined in ES5.
+// Defining this global in .jshintrc would create a danger of using the global
+// unguarded in another place, it seems safer to just disable JSHint for these
+// three lines.
+/* jshint ignore: start */
+if ( typeof Symbol === "function" ) {
+ jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ];
+}
+/* jshint ignore: end */
+
+// Populate the class2type map
+jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
+function( i, name ) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+} );
+
+function isArrayLike( obj ) {
+
+ // Support: iOS 8.2 (not reproducible in simulator)
+ // `in` check used to prevent JIT error (gh-2145)
+ // hasOwn isn't used here due to false negatives
+ // regarding Nodelist length in IE
+ var length = !!obj && "length" in obj && obj.length,
+ type = jQuery.type( obj );
+
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ return type === "array" || length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
+}
+var Sizzle =
+/*!
+ * Sizzle CSS Selector Engine v2.2.1
+ * http://sizzlejs.com/
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2015-10-17
+ */
+(function( window ) {
+
+var i,
+ support,
+ Expr,
+ getText,
+ isXML,
+ tokenize,
+ compile,
+ select,
+ outermostContext,
+ sortInput,
+ hasDuplicate,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + 1 * new Date(),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf as it's faster than native
+ // http://jsperf.com/thor-indexof-vs-for/5
+ indexOf = function( list, elem ) {
+ var i = 0,
+ len = list.length;
+ for ( ; i < len; i++ ) {
+ if ( list[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+
+ // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
+ // Operator (capture 2)
+ "*([*^$|!~]?=)" + whitespace +
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+ "*\\]",
+
+ pseudos = ":(" + identifier + ")(?:\\((" +
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+ // 1. quoted (capture 3; capture 4 or capture 5)
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+ // 2. simple (capture 6)
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+ // 3. anything else (capture 2)
+ ".*" +
+ ")\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rwhitespace = new RegExp( whitespace + "+", "g" ),
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + identifier + ")" ),
+ "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
+ "TAG": new RegExp( "^(" + identifier + "|[*])" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rsibling = /[+~]/,
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox<24
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ high < 0 ?
+ // BMP codepoint
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ },
+
+ // Used for iframes
+ // See setDocument()
+ // Removing the function wrapper causes a "Permission Denied"
+ // error in IE
+ unloadHandler = function() {
+ setDocument();
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var m, i, elem, nid, nidselect, match, groups, newSelector,
+ newContext = context && context.ownerDocument,
+
+ // nodeType defaults to 9, since context defaults to document
+ nodeType = context ? context.nodeType : 9;
+
+ results = results || [];
+
+ // Return early from calls with invalid selector or context
+ if ( typeof selector !== "string" || !selector ||
+ nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
+
+ return results;
+ }
+
+ // Try to shortcut find operations (as opposed to filters) in HTML documents
+ if ( !seed ) {
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+ context = context || document;
+
+ if ( documentIsHTML ) {
+
+ // If the selector is sufficiently simple, try using a "get*By*" DOM method
+ // (excepting DocumentFragment context, where the methods don't exist)
+ if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
+
+ // ID selector
+ if ( (m = match[1]) ) {
+
+ // Document context
+ if ( nodeType === 9 ) {
+ if ( (elem = context.getElementById( m )) ) {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+
+ // Element context
+ } else {
+
+ // Support: IE, Opera, Webkit
+ // TODO: identify versions
+ // getElementById can match elements by name instead of ID
+ if ( newContext && (elem = newContext.getElementById( m )) &&
+ contains( context, elem ) &&
+ elem.id === m ) {
+
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Type selector
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Class selector
+ } else if ( (m = match[3]) && support.getElementsByClassName &&
+ context.getElementsByClassName ) {
+
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // Take advantage of querySelectorAll
+ if ( support.qsa &&
+ !compilerCache[ selector + " " ] &&
+ (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+
+ if ( nodeType !== 1 ) {
+ newContext = context;
+ newSelector = selector;
+
+ // qSA looks outside Element context, which is not what we want
+ // Thanks to Andrew Dupont for this workaround technique
+ // Support: IE <=8
+ // Exclude object elements
+ } else if ( context.nodeName.toLowerCase() !== "object" ) {
+
+ // Capture the context ID, setting it first if necessary
+ if ( (nid = context.getAttribute( "id" )) ) {
+ nid = nid.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", (nid = expando) );
+ }
+
+ // Prefix every selector in the list
+ groups = tokenize( selector );
+ i = groups.length;
+ nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
+ while ( i-- ) {
+ groups[i] = nidselect + " " + toSelector( groups[i] );
+ }
+ newSelector = groups.join( "," );
+
+ // Expand context for sibling selectors
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
+ context;
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch ( qsaError ) {
+ } finally {
+ if ( nid === expando ) {
+ context.removeAttribute( "id" );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {function(string, object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key + " " ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = arr.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+ return context && typeof context.getElementsByTagName !== "undefined" && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var hasCompare, parent,
+ doc = node ? node.ownerDocument || node : preferredDoc;
+
+ // Return early if doc is invalid or already selected
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Update global variables
+ document = doc;
+ docElem = document.documentElement;
+ documentIsHTML = !isXML( document );
+
+ // Support: IE 9-11, Edge
+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
+ if ( (parent = document.defaultView) && parent.top !== parent ) {
+ // Support: IE 11
+ if ( parent.addEventListener ) {
+ parent.addEventListener( "unload", unloadHandler, false );
+
+ // Support: IE 9 - 10 only
+ } else if ( parent.attachEvent ) {
+ parent.attachEvent( "onunload", unloadHandler );
+ }
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties
+ // (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( document.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Support: IE<9
+ support.getElementsByClassName = rnative.test( document.getElementsByClassName );
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !document.getElementsByName || !document.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
+ var m = context.getElementById( id );
+ return m ? [ m ] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== "undefined" &&
+ elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ return context.getElementsByTagName( tag );
+
+ // DocumentFragment nodes don't have gEBTN
+ } else if ( support.qsa ) {
+ return context.querySelectorAll( tag );
+ }
+ } :
+
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
+ "<select id='" + expando + "-\r\\' msallowcapture=''>" +
+ "<option selected=''></option></select>";
+
+ // Support: IE8, Opera 11-12.16
+ // Nothing should be selected when empty strings follow ^= or $= or *=
+ // The test attribute must be unknown in Opera but "safe" for WinRT
+ // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+ if ( div.querySelectorAll("[msallowcapture^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
+ if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
+ rbuggyQSA.push("~=");
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+
+ // Support: Safari 8+, iOS 8+
+ // https://bugs.webkit.org/show_bug.cgi?id=136851
+ // In-page `selector#id sibing-combinator selector` fails
+ if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
+ rbuggyQSA.push(".#.+[+~]");
+ }
+ });
+
+ assert(function( div ) {
+ // Support: Windows 8 Native Apps
+ // The type and name attributes are restricted during .innerHTML assignment
+ var input = document.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "name", "D" );
+
+ // Support: IE8
+ // Enforce case-sensitivity of name attribute
+ if ( div.querySelectorAll("[name=d]").length ) {
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+ docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+ // Element contains another
+ // Purposefully self-exclusive
+ // As in, an element does not contain itself
+ contains = hasCompare || rnative.test( docElem.contains ) ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = hasCompare ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ // Sort on method existence if only one input has compareDocumentPosition
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if ( compare ) {
+ return compare;
+ }
+
+ // Calculate position if both inputs belong to the same document
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+ a.compareDocumentPosition( b ) :
+
+ // Otherwise we know they are disconnected
+ 1;
+
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ } :
+ function( a, b ) {
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Parentless nodes are either documents or disconnected
+ if ( !aup || !bup ) {
+ return a === document ? -1 :
+ b === document ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return document;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ !compilerCache[ expr + " " ] &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch (e) {}
+ }
+
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val !== undefined ?
+ val :
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ // Clear input after sorting to release objects
+ // See https://github.com/jquery/sizzle/pull/225
+ sortInput = null;
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ while ( (node = elem[i++]) ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (jQuery #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[6] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] ) {
+ match[2] = match[4] || match[5] || "";
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, uniqueCache, outerCache, node, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType,
+ diff = false;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ?
+ node.nodeName.toLowerCase() === name :
+ node.nodeType === 1 ) {
+
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+
+ // Seek `elem` from a previously-cached index
+
+ // ...in a gzip-friendly way
+ node = parent;
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ cache = uniqueCache[ type ] || [];
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
+ diff = nodeIndex && cache[ 2 ];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ } else {
+ // Use previously-cached element index if available
+ if ( useCache ) {
+ // ...in a gzip-friendly way
+ node = elem;
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ cache = uniqueCache[ type ] || [];
+ nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
+ diff = nodeIndex;
+ }
+
+ // xml :nth-child(...)
+ // or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ if ( diff === false ) {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ?
+ node.nodeName.toLowerCase() === name :
+ node.nodeType === 1 ) &&
+ ++diff ) {
+
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ outerCache = node[ expando ] || (node[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ node.uniqueID ] ||
+ (outerCache[ node.uniqueID ] = {});
+
+ uniqueCache[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ // Don't keep the element (issue #299)
+ input[0] = null;
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ text = text.replace( runescape, funescape );
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+ // but not by others (comment: 8; processing instruction: 7; etc.)
+ // nodeType < 6 works because attributes (2) do not appear as children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeType < 6 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+
+ // Support: IE<8
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( (tokens = []) );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+};
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var oldCache, uniqueCache, outerCache,
+ newCache = [ dirruns, doneName ];
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+
+ // Support: IE <9 only
+ // Defend against cloned attroperties (jQuery gh-1709)
+ uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
+
+ if ( (oldCache = uniqueCache[ dir ]) &&
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+ // Assign to newCache so results back-propagate to previous elements
+ return (newCache[ 2 ] = oldCache[ 2 ]);
+ } else {
+ // Reuse newcache so results back-propagate to previous elements
+ uniqueCache[ dir ] = newCache;
+
+ // A match means we're done; a fail means we have to keep checking
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ // Avoid hanging onto element (issue #299)
+ checkContext = null;
+ return ret;
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, outermost ) {
+ var elem, j, matcher,
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ setMatched = [],
+ contextBackup = outermostContext,
+ // We must always have either seed elements or outermost context
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+ len = elems.length;
+
+ if ( outermost ) {
+ outermostContext = context === document || context || outermost;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Support: IE<9, Safari
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ if ( !context && elem.ownerDocument !== document ) {
+ setDocument( elem );
+ xml = !documentIsHTML;
+ }
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context || document, xml) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // `i` is now the count of elements visited above, and adding it to `matchedCount`
+ // makes the latter nonnegative.
+ matchedCount += i;
+
+ // Apply set filters to unmatched elements
+ // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
+ // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
+ // no element matchers and no seed.
+ // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
+ // case, which will result in a "00" `matchedCount` that differs from `i` but is also
+ // numerically zero.
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !match ) {
+ match = tokenize( selector );
+ }
+ i = match.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( match[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+ // Save selector and tokenization
+ cached.selector = selector;
+ }
+ return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ * selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ * selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ compiled = typeof selector === "function" && selector,
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+ results = results || [];
+
+ // Try to minimize operations if there is only one selector in the list and no seed
+ // (the latter of which guarantees us context)
+ if ( match.length === 1 ) {
+
+ // Reduce context if the leading compound selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+
+ // Precompiled matchers will still verify ancestry, so step up a level
+ } else if ( compiled ) {
+ context = context.parentNode;
+ }
+
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function if one is not provided
+ // Provide `match` to avoid retokenization if we modified the selector above
+ ( compiled || compile( selector, match ) )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
+ );
+ return results;
+};
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome 14-35+
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "<input/>";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return elem[ name ] === true ? name.toLowerCase() :
+ (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ null;
+ }
+ });
+}
+
+return Sizzle;
+
+})( window );
+
+
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[ ":" ] = jQuery.expr.pseudos;
+jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+
+var dir = function( elem, dir, until ) {
+ var matched = [],
+ truncate = until !== undefined;
+
+ while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
+ if ( elem.nodeType === 1 ) {
+ if ( truncate && jQuery( elem ).is( until ) ) {
+ break;
+ }
+ matched.push( elem );
+ }
+ }
+ return matched;
+};
+
+
+var siblings = function( n, elem ) {
+ var matched = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ matched.push( n );
+ }
+ }
+
+ return matched;
+};
+
+
+var rneedsContext = jQuery.expr.match.needsContext;
+
+var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
+
+
+
+var risSimple = /^.[^:#\[\.,]*$/;
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ /* jshint -W018 */
+ return !!qualifier.call( elem, i, elem ) !== not;
+ } );
+
+ }
+
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ } );
+
+ }
+
+ if ( typeof qualifier === "string" ) {
+ if ( risSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+
+ return jQuery.grep( elements, function( elem ) {
+ return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not;
+ } );
+}
+
+jQuery.filter = function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 && elem.nodeType === 1 ?
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ } ) );
+};
+
+jQuery.fn.extend( {
+ find: function( selector ) {
+ var i,
+ ret = [],
+ self = this,
+ len = self.length;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter( function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ } ) );
+ }
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
+ return ret;
+ },
+ filter: function( selector ) {
+ return this.pushStack( winnow( this, selector || [], false ) );
+ },
+ not: function( selector ) {
+ return this.pushStack( winnow( this, selector || [], true ) );
+ },
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ }
+} );
+
+
+// Initialize a jQuery object
+
+
+// A central reference to the root jQuery(document)
+var rootjQuery,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ init = jQuery.fn.init = function( selector, context, root ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // init accepts an alternate rootjQuery
+ // so migrate can support jQuery.sub (gh-2101)
+ root = root || rootjQuery;
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector.charAt( 0 ) === "<" &&
+ selector.charAt( selector.length - 1 ) === ">" &&
+ selector.length >= 3 ) {
+
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && ( match[ 1 ] || !context ) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[ 1 ] ) {
+ context = context instanceof jQuery ? context[ 0 ] : context;
+
+ // scripts is true for back-compat
+ // Intentionally let the error be thrown if parseHTML is not present
+ jQuery.merge( this, jQuery.parseHTML(
+ match[ 1 ],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[ 2 ] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[ 2 ] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[ 0 ] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || root ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[ 0 ] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return typeof root.ready !== "undefined" ?
+ root.ready( selector ) :
+
+ // Execute immediately if ready is not present
+ selector( jQuery );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ };
+
+// Give the init function the jQuery prototype for later instantiation
+init.prototype = jQuery.fn;
+
+// Initialize central reference
+rootjQuery = jQuery( document );
+
+
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,
+
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.fn.extend( {
+ has: function( target ) {
+ var i,
+ targets = jQuery( target, this ),
+ len = targets.length;
+
+ return this.filter( function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( this, targets[ i ] ) ) {
+ return true;
+ }
+ }
+ } );
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ matched = [],
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( ; i < l; i++ ) {
+ for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
+
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && ( pos ?
+ pos.index( cur ) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector( cur, selectors ) ) ) {
+
+ matched.push( cur );
+ break;
+ }
+ }
+ }
+
+ return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[ 0 ], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[ 0 ] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ return this.pushStack(
+ jQuery.uniqueSort(
+ jQuery.merge( this.get(), jQuery( selector, context ) )
+ )
+ );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter( selector )
+ );
+ }
+} );
+
+function sibling( cur, dir ) {
+ do {
+ cur = cur[ dir ];
+ } while ( cur && cur.nodeType !== 1 );
+
+ return cur;
+}
+
+jQuery.each( {
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return siblings( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return siblings( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ if ( this.length > 1 ) {
+
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ ret = jQuery.uniqueSort( ret );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+ }
+
+ return this.pushStack( ret );
+ };
+} );
+var rnotwhite = ( /\S+/g );
+
+
+
+// Convert String-formatted options into Object-formatted ones
+function createOptions( options ) {
+ var object = {};
+ jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ } );
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ createOptions( options ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+
+ // Last fire value for non-forgettable lists
+ memory,
+
+ // Flag to know if list was already fired
+ fired,
+
+ // Flag to prevent firing
+ locked,
+
+ // Actual callback list
+ list = [],
+
+ // Queue of execution data for repeatable lists
+ queue = [],
+
+ // Index of currently firing callback (modified by add/remove as needed)
+ firingIndex = -1,
+
+ // Fire callbacks
+ fire = function() {
+
+ // Enforce single-firing
+ locked = options.once;
+
+ // Execute callbacks for all pending executions,
+ // respecting firingIndex overrides and runtime changes
+ fired = firing = true;
+ for ( ; queue.length; firingIndex = -1 ) {
+ memory = queue.shift();
+ while ( ++firingIndex < list.length ) {
+
+ // Run callback and check for early termination
+ if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
+ options.stopOnFalse ) {
+
+ // Jump to end and forget the data so .add doesn't re-fire
+ firingIndex = list.length;
+ memory = false;
+ }
+ }
+ }
+
+ // Forget the data if we're done with it
+ if ( !options.memory ) {
+ memory = false;
+ }
+
+ firing = false;
+
+ // Clean up if we're done firing for good
+ if ( locked ) {
+
+ // Keep an empty list if we have data for future add calls
+ if ( memory ) {
+ list = [];
+
+ // Otherwise, this object is spent
+ } else {
+ list = "";
+ }
+ }
+ },
+
+ // Actual Callbacks object
+ self = {
+
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+
+ // If we have memory from a past run, we should fire after adding
+ if ( memory && !firing ) {
+ firingIndex = list.length - 1;
+ queue.push( memory );
+ }
+
+ ( function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ if ( jQuery.isFunction( arg ) ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
+
+ // Inspect recursively
+ add( arg );
+ }
+ } );
+ } )( arguments );
+
+ if ( memory && !firing ) {
+ fire();
+ }
+ }
+ return this;
+ },
+
+ // Remove a callback from the list
+ remove: function() {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+
+ // Handle firing indexes
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ } );
+ return this;
+ },
+
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ?
+ jQuery.inArray( fn, list ) > -1 :
+ list.length > 0;
+ },
+
+ // Remove all callbacks from the list
+ empty: function() {
+ if ( list ) {
+ list = [];
+ }
+ return this;
+ },
+
+ // Disable .fire and .add
+ // Abort any current/pending executions
+ // Clear all callbacks and values
+ disable: function() {
+ locked = queue = [];
+ list = memory = "";
+ return this;
+ },
+ disabled: function() {
+ return !list;
+ },
+
+ // Disable .fire
+ // Also disable .add unless we have memory (since it would have no effect)
+ // Abort any pending executions
+ lock: function() {
+ locked = true;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ locked: function() {
+ return !!locked;
+ },
+
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( !locked ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ queue.push( args );
+ if ( !firing ) {
+ fire();
+ }
+ }
+ return this;
+ },
+
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+
+
+jQuery.extend( {
+
+ Deferred: function( func ) {
+ var tuples = [
+
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks( "memory" ) ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred( function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[ 1 ] ]( function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .progress( newDefer.notify )
+ .done( newDefer.resolve )
+ .fail( newDefer.reject );
+ } else {
+ newDefer[ tuple[ 0 ] + "With" ](
+ this === promise ? newDefer.promise() : this,
+ fn ? [ returned ] : arguments
+ );
+ }
+ } );
+ } );
+ fns = null;
+ } ).promise();
+ },
+
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[ 1 ] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add( function() {
+
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[ 0 ] ] = function() {
+ deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
+ } );
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 ||
+ ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred.
+ // If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+ if ( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+
+ } else if ( !( --remaining ) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .progress( updateFunc( i, progressContexts, progressValues ) )
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+} );
+
+
+// The deferred used on DOM ready
+var readyList;
+
+jQuery.fn.ready = function( fn ) {
+
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+};
+
+jQuery.extend( {
+
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ jQuery( document ).off( "ready" );
+ }
+ }
+} );
+
+/**
+ * Clean-up method for dom ready events
+ */
+function detach() {
+ if ( document.addEventListener ) {
+ document.removeEventListener( "DOMContentLoaded", completed );
+ window.removeEventListener( "load", completed );
+
+ } else {
+ document.detachEvent( "onreadystatechange", completed );
+ window.detachEvent( "onload", completed );
+ }
+}
+
+/**
+ * The ready event handler and self cleanup method
+ */
+function completed() {
+
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
+ if ( document.addEventListener ||
+ window.event.type === "load" ||
+ document.readyState === "complete" ) {
+
+ detach();
+ jQuery.ready();
+ }
+}
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called
+ // after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here,
+ // but it caused issues like the one
+ // discovered by ChrisS here:
+ // http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ window.setTimeout( jQuery.ready );
+
+ // Standards-based browsers support DOMContentLoaded
+ } else if ( document.addEventListener ) {
+
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed );
+
+ // If IE event model is used
+ } else {
+
+ // Ensure firing before onload, maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", completed );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", completed );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var top = false;
+
+ try {
+ top = window.frameElement == null && document.documentElement;
+ } catch ( e ) {}
+
+ if ( top && top.doScroll ) {
+ ( function doScrollCheck() {
+ if ( !jQuery.isReady ) {
+
+ try {
+
+ // Use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ top.doScroll( "left" );
+ } catch ( e ) {
+ return window.setTimeout( doScrollCheck, 50 );
+ }
+
+ // detach all dom ready events
+ detach();
+
+ // and execute any waiting functions
+ jQuery.ready();
+ }
+ } )();
+ }
+ }
+ }
+ return readyList.promise( obj );
+};
+
+// Kick off the DOM ready check even if the user does not
+jQuery.ready.promise();
+
+
+
+
+// Support: IE<9
+// Iteration over object's inherited properties before its own
+var i;
+for ( i in jQuery( support ) ) {
+ break;
+}
+support.ownFirst = i === "0";
+
+// Note: most support tests are defined in their respective modules.
+// false until the test is run
+support.inlineBlockNeedsLayout = false;
+
+// Execute ASAP in case we need to set body.style.zoom
+jQuery( function() {
+
+ // Minified: var a,b,c,d
+ var val, div, body, container;
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body || !body.style ) {
+
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ // Setup
+ div = document.createElement( "div" );
+ container = document.createElement( "div" );
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+ body.appendChild( container ).appendChild( div );
+
+ if ( typeof div.style.zoom !== "undefined" ) {
+
+ // Support: IE<8
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
+
+ support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
+ if ( val ) {
+
+ // Prevent IE 6 from affecting layout for positioned elements #11048
+ // Prevent IE from shrinking the body in IE 7 mode #12869
+ // Support: IE<8
+ body.style.zoom = 1;
+ }
+ }
+
+ body.removeChild( container );
+} );
+
+
+( function() {
+ var div = document.createElement( "div" );
+
+ // Support: IE<9
+ support.deleteExpando = true;
+ try {
+ delete div.test;
+ } catch ( e ) {
+ support.deleteExpando = false;
+ }
+
+ // Null elements to avoid leaks in IE.
+ div = null;
+} )();
+var acceptData = function( elem ) {
+ var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ],
+ nodeType = +elem.nodeType || 1;
+
+ // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
+ return nodeType !== 1 && nodeType !== 9 ?
+ false :
+
+ // Nodes accept data unless otherwise specified; rejection can be conditional
+ !noData || noData !== true && elem.getAttribute( "classid" ) === noData;
+};
+
+
+
+
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+function dataAttr( elem, key, data ) {
+
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch ( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ var name;
+ for ( name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !acceptData( elem ) ) {
+ return;
+ }
+
+ var ret, thisCache,
+ internalKey = jQuery.expando,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) &&
+ data === undefined && typeof name === "string" ) {
+ return;
+ }
+
+ if ( !id ) {
+
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+
+ // Avoid exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( typeof name === "string" ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+}
+
+function internalRemoveData( elem, name, pvt ) {
+ if ( !acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i,
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split( " " );
+ }
+ }
+ } else {
+
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
+ }
+
+ i = name.length;
+ while ( i-- ) {
+ delete thisCache[ name[ i ] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
+ return;
+ }
+ }
+
+ // Destroy the cache
+ if ( isNode ) {
+ jQuery.cleanData( [ elem ], true );
+
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+ /* jshint eqeqeq: false */
+ } else if ( support.deleteExpando || cache != cache.window ) {
+ /* jshint eqeqeq: true */
+ delete cache[ id ];
+
+ // When all else fails, undefined
+ } else {
+ cache[ id ] = undefined;
+ }
+}
+
+jQuery.extend( {
+ cache: {},
+
+ // The following elements (space-suffixed to avoid Object.prototype collisions)
+ // throw uncatchable exceptions if you attempt to set expando properties
+ noData: {
+ "applet ": true,
+ "embed ": true,
+
+ // ...but Flash objects (which have this classid) *can* handle expandos
+ "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return internalData( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ return internalRemoveData( elem, name );
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return internalData( elem, name, data, true );
+ },
+
+ _removeData: function( elem, name ) {
+ return internalRemoveData( elem, name, true );
+ }
+} );
+
+jQuery.fn.extend( {
+ data: function( key, value ) {
+ var i, name, data,
+ elem = this[ 0 ],
+ attrs = elem && elem.attributes;
+
+ // Special expections of .data basically thwart jQuery.access,
+ // so implement the relevant behavior ourselves
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = jQuery.data( elem );
+
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ i = attrs.length;
+ while ( i-- ) {
+
+ // Support: IE11+
+ // The attrs elements can be null (#14894)
+ if ( attrs[ i ] ) {
+ name = attrs[ i ].name;
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.slice( 5 ) );
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ }
+ jQuery._data( elem, "parsedAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each( function() {
+ jQuery.data( this, key );
+ } );
+ }
+
+ return arguments.length > 1 ?
+
+ // Sets one value
+ this.each( function() {
+ jQuery.data( this, key, value );
+ } ) :
+
+ // Gets one value
+ // Try to fetch any internally stored data first
+ elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
+ },
+
+ removeData: function( key ) {
+ return this.each( function() {
+ jQuery.removeData( this, key );
+ } );
+ }
+} );
+
+
+jQuery.extend( {
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray( data ) ) {
+ queue = jQuery._data( elem, type, jQuery.makeArray( data ) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // not intended for public consumption - generates a queueHooks object,
+ // or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+ empty: jQuery.Callbacks( "once memory" ).add( function() {
+ jQuery._removeData( elem, type + "queue" );
+ jQuery._removeData( elem, key );
+ } )
+ } );
+ }
+} );
+
+jQuery.fn.extend( {
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[ 0 ], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each( function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ } );
+ },
+ dequeue: function( type ) {
+ return this.each( function() {
+ jQuery.dequeue( this, type );
+ } );
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while ( i-- ) {
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+} );
+
+
+( function() {
+ var shrinkWrapBlocksVal;
+
+ support.shrinkWrapBlocks = function() {
+ if ( shrinkWrapBlocksVal != null ) {
+ return shrinkWrapBlocksVal;
+ }
+
+ // Will be changed later if needed.
+ shrinkWrapBlocksVal = false;
+
+ // Minified: var b,c,d
+ var div, body, container;
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body || !body.style ) {
+
+ // Test fired too early or in an unsupported environment, exit.
+ return;
+ }
+
+ // Setup
+ div = document.createElement( "div" );
+ container = document.createElement( "div" );
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+ body.appendChild( container ).appendChild( div );
+
+ // Support: IE6
+ // Check if elements with layout shrink-wrap their children
+ if ( typeof div.style.zoom !== "undefined" ) {
+
+ // Reset CSS: box-sizing; display; margin; border
+ div.style.cssText =
+
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
+ "box-sizing:content-box;display:block;margin:0;border:0;" +
+ "padding:1px;width:1px;zoom:1";
+ div.appendChild( document.createElement( "div" ) ).style.width = "5px";
+ shrinkWrapBlocksVal = div.offsetWidth !== 3;
+ }
+
+ body.removeChild( container );
+
+ return shrinkWrapBlocksVal;
+ };
+
+} )();
+var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
+
+var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
+
+
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+
+var isHidden = function( elem, el ) {
+
+ // isHidden might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" ||
+ !jQuery.contains( elem.ownerDocument, elem );
+ };
+
+
+
+function adjustCSS( elem, prop, valueParts, tween ) {
+ var adjusted,
+ scale = 1,
+ maxIterations = 20,
+ currentValue = tween ?
+ function() { return tween.cur(); } :
+ function() { return jQuery.css( elem, prop, "" ); },
+ initial = currentValue(),
+ unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
+ rcssNum.exec( jQuery.css( elem, prop ) );
+
+ if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
+
+ // Trust units reported by jQuery.css
+ unit = unit || initialInUnit[ 3 ];
+
+ // Make sure we update the tween properties later on
+ valueParts = valueParts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ initialInUnit = +initial || 1;
+
+ do {
+
+ // If previous iteration zeroed out, double until we get *something*.
+ // Use string for doubling so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ initialInUnit = initialInUnit / scale;
+ jQuery.style( elem, prop, initialInUnit + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // Break the loop if scale is unchanged or perfect, or if we've just had enough.
+ } while (
+ scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
+ );
+ }
+
+ if ( valueParts ) {
+ initialInUnit = +initialInUnit || +initial || 0;
+
+ // Apply relative offset (+=/-=) if specified
+ adjusted = valueParts[ 1 ] ?
+ initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
+ +valueParts[ 2 ];
+ if ( tween ) {
+ tween.unit = unit;
+ tween.start = initialInUnit;
+ tween.end = adjusted;
+ }
+ }
+ return adjusted;
+}
+
+
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ length = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ access( elems, fn, i, key[ i ], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < length; i++ ) {
+ fn(
+ elems[ i ],
+ key,
+ raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) )
+ );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[ 0 ], key ) : emptyGet;
+};
+var rcheckableType = ( /^(?:checkbox|radio)$/i );
+
+var rtagName = ( /<([\w:-]+)/ );
+
+var rscriptType = ( /^$|\/(?:java|ecma)script/i );
+
+var rleadingWhitespace = ( /^\s+/ );
+
+var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" +
+ "details|dialog|figcaption|figure|footer|header|hgroup|main|" +
+ "mark|meter|nav|output|picture|progress|section|summary|template|time|video";
+
+
+
+function createSafeFragment( document ) {
+ var list = nodeNames.split( "|" ),
+ safeFrag = document.createDocumentFragment();
+
+ if ( safeFrag.createElement ) {
+ while ( list.length ) {
+ safeFrag.createElement(
+ list.pop()
+ );
+ }
+ }
+ return safeFrag;
+}
+
+
+( function() {
+ var div = document.createElement( "div" ),
+ fragment = document.createDocumentFragment(),
+ input = document.createElement( "input" );
+
+ // Setup
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+
+ // IE strips leading whitespace when .innerHTML is used
+ support.leadingWhitespace = div.firstChild.nodeType === 3;
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ support.tbody = !div.getElementsByTagName( "tbody" ).length;
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ support.html5Clone =
+ document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ input.type = "checkbox";
+ input.checked = true;
+ fragment.appendChild( input );
+ support.appendChecked = input.checked;
+
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ // Support: IE6-IE11+
+ div.innerHTML = "<textarea>x</textarea>";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ fragment.appendChild( div );
+
+ // Support: Windows Web Apps (WWA)
+ // `name` and `type` must use .setAttribute for WWA (#14901)
+ input = document.createElement( "input" );
+ input.setAttribute( "type", "radio" );
+ input.setAttribute( "checked", "checked" );
+ input.setAttribute( "name", "t" );
+
+ div.appendChild( input );
+
+ // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
+ // old WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE<9
+ // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+
+ support.noCloneEvent = !!div.addEventListener;
+
+ // Support: IE<9
+ // Since attributes and properties are the same in IE,
+ // cleanData must set properties to undefined rather than use removeAttribute
+ div[ jQuery.expando ] = 1;
+ support.attributes = !div.getAttribute( jQuery.expando );
+} )();
+
+
+// We have to close these tags to support XHTML (#13200)
+var wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ area: [ 1, "<map>", "</map>" ],
+
+ // Support: IE8
+ param: [ 1, "<object>", "</object>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+
+ // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
+ // unless wrapped in a div with non-breaking characters in front of it.
+ _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
+};
+
+// Support: IE8-IE9
+wrapMap.optgroup = wrapMap.option;
+
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+
+function getAll( context, tag ) {
+ var elems, elem,
+ i = 0,
+ found = typeof context.getElementsByTagName !== "undefined" ?
+ context.getElementsByTagName( tag || "*" ) :
+ typeof context.querySelectorAll !== "undefined" ?
+ context.querySelectorAll( tag || "*" ) :
+ undefined;
+
+ if ( !found ) {
+ for ( found = [], elems = context.childNodes || context;
+ ( elem = elems[ i ] ) != null;
+ i++
+ ) {
+ if ( !tag || jQuery.nodeName( elem, tag ) ) {
+ found.push( elem );
+ } else {
+ jQuery.merge( found, getAll( elem, tag ) );
+ }
+ }
+ }
+
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+ jQuery.merge( [ context ], found ) :
+ found;
+}
+
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var elem,
+ i = 0;
+ for ( ; ( elem = elems[ i ] ) != null; i++ ) {
+ jQuery._data(
+ elem,
+ "globalEval",
+ !refElements || jQuery._data( refElements[ i ], "globalEval" )
+ );
+ }
+}
+
+
+var rhtml = /<|&#?\w+;/,
+ rtbody = /<tbody/i;
+
+function fixDefaultChecked( elem ) {
+ if ( rcheckableType.test( elem.type ) ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+
+function buildFragment( elems, context, scripts, selection, ignored ) {
+ var j, elem, contains,
+ tmp, tag, tbody, wrap,
+ l = elems.length,
+
+ // Ensure a safe fragment
+ safe = createSafeFragment( context ),
+
+ nodes = [],
+ i = 0;
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || safe.appendChild( context.createElement( "div" ) );
+
+ // Deserialize a standard representation
+ tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+
+ tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
+
+ // Descend through wrappers to the right content
+ j = wrap[ 0 ];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Manually add leading whitespace removed by IE
+ if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[ 0 ] ) );
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ elem = tag === "table" && !rtbody.test( elem ) ?
+ tmp.firstChild :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[ 1 ] === "<table>" && !rtbody.test( elem ) ?
+ tmp :
+ 0;
+
+ j = elem && elem.childNodes.length;
+ while ( j-- ) {
+ if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) &&
+ !tbody.childNodes.length ) {
+
+ elem.removeChild( tbody );
+ }
+ }
+ }
+
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Fix #12392 for WebKit and IE > 9
+ tmp.textContent = "";
+
+ // Fix #12392 for oldIE
+ while ( tmp.firstChild ) {
+ tmp.removeChild( tmp.firstChild );
+ }
+
+ // Remember the top-level container for proper cleanup
+ tmp = safe.lastChild;
+ }
+ }
+ }
+
+ // Fix #11356: Clear elements from fragment
+ if ( tmp ) {
+ safe.removeChild( tmp );
+ }
+
+ // Reset defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ if ( !support.appendChecked ) {
+ jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
+ }
+
+ i = 0;
+ while ( ( elem = nodes[ i++ ] ) ) {
+
+ // Skip elements already in the context collection (trac-4087)
+ if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
+ if ( ignored ) {
+ ignored.push( elem );
+ }
+
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( safe.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( ( elem = tmp[ j++ ] ) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ tmp = null;
+
+ return safe;
+}
+
+
+( function() {
+ var i, eventName,
+ div = document.createElement( "div" );
+
+ // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events)
+ for ( i in { submit: true, change: true, focusin: true } ) {
+ eventName = "on" + i;
+
+ if ( !( support[ i ] = eventName in window ) ) {
+
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+ div.setAttribute( eventName, "t" );
+ support[ i ] = div.attributes[ eventName ].expando === false;
+ }
+ }
+
+ // Null elements to avoid leaks in IE.
+ div = null;
+} )();
+
+
+var rformElems = /^(?:input|select|textarea)$/i,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+// Support: IE9
+// See #13393 for more info
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+function on( elem, types, selector, data, fn, one ) {
+ var origFn, type;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ on( elem, type, selector, data, types[ type ], one );
+ }
+ return elem;
+ }
+
+ if ( data == null && fn == null ) {
+
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return elem;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return elem.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ } );
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+ var tmp, events, t, handleObjIn,
+ special, eventHandle, handleObj,
+ handlers, type, namespaces, origType,
+ elemData = jQuery._data( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !( events = elemData.events ) ) {
+ events = elemData.events = {};
+ }
+ if ( !( eventHandle = elemData.handle ) ) {
+ eventHandle = elemData.handle = function( e ) {
+
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== "undefined" &&
+ ( !e || jQuery.event.triggered !== e.type ) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+
+ // Add elem as a property of the handle fn to prevent a memory leak
+ // with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[ t ] ) || [];
+ type = origType = tmp[ 1 ];
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend( {
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join( "." )
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !( handlers = events[ type ] ) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup ||
+ special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+ var j, handleObj, tmp,
+ origCount, t, events,
+ special, handlers, type,
+ namespaces, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+ if ( !elemData || !( events = elemData.events ) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[ t ] ) || [];
+ type = origType = tmp[ 1 ];
+ namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[ 2 ] &&
+ new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector ||
+ selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown ||
+ special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery._removeData( elem, "events" );
+ }
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ var handle, ontype, cur,
+ bubbleType, special, tmp, i,
+ eventPath = [ elem || document ],
+ type = hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf( "." ) > -1 ) {
+
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split( "." );
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf( ":" ) < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join( "." );
+ event.rnamespace = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === ( elem.ownerDocument || document ) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] &&
+ jQuery._data( cur, "handle" );
+
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && handle.apply && acceptData( cur ) ) {
+ event.result = handle.apply( cur, data );
+ if ( event.result === false ) {
+ event.preventDefault();
+ }
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if (
+ ( !special._default ||
+ special._default.apply( eventPath.pop(), data ) === false
+ ) && acceptData( elem )
+ ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ try {
+ elem[ type ]();
+ } catch ( e ) {
+
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+ }
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, j, ret, matched, handleObj,
+ handlerQueue = [],
+ args = slice.call( arguments ),
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[ 0 ] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( ( handleObj = matched.handlers[ j++ ] ) &&
+ !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or 2) have namespace(s)
+ // a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
+ handleObj.handler ).apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( ( event.result = ret ) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var i, matches, sel, handleObj,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Support (at least): Chrome, IE9
+ // Find delegate handlers
+ // Black-hole SVG <use> instance trees (#13180)
+ //
+ // Support: Firefox<=42+
+ // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
+ if ( delegateCount && cur.nodeType &&
+ ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
+
+ /* jshint eqeqeq: false */
+ for ( ; cur != this; cur = cur.parentNode || this ) {
+ /* jshint eqeqeq: true */
+
+ // Don't check non-elements (#13208)
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+
+ // Don't conflict with Object.prototype properties (#13203)
+ sel = handleObj.selector + " ";
+
+ if ( matches[ sel ] === undefined ) {
+ matches[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) > -1 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( matches[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push( { elem: cur, handlers: matches } );
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( delegateCount < handlers.length ) {
+ handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
+ }
+
+ return handlerQueue;
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop, copy,
+ type = event.type,
+ originalEvent = event,
+ fixHook = this.fixHooks[ type ];
+
+ if ( !fixHook ) {
+ this.fixHooks[ type ] = fixHook =
+ rmouseEvent.test( type ) ? this.mouseHooks :
+ rkeyEvent.test( type ) ? this.keyHooks :
+ {};
+ }
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = new jQuery.Event( originalEvent );
+
+ i = copy.length;
+ while ( i-- ) {
+ prop = copy[ i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Support: IE<9
+ // Fix target property (#1925)
+ if ( !event.target ) {
+ event.target = originalEvent.srcElement || document;
+ }
+
+ // Support: Safari 6-8+
+ // Target should not be a text node (#504, #13143)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Support: IE<9
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
+ event.metaKey = !!event.metaKey;
+
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
+ "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split( " " ),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: ( "button buttons clientX clientY fromElement offsetX offsetY " +
+ "pageX pageY screenX screenY toElement" ).split( " " ),
+ filter: function( event, original ) {
+ var body, eventDoc, doc,
+ button = original.button,
+ fromElement = original.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX +
+ ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
+ ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY +
+ ( doc && doc.scrollTop || body && body.scrollTop || 0 ) -
+ ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && fromElement ) {
+ event.relatedTarget = fromElement === event.target ?
+ original.toElement :
+ fromElement;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ special: {
+ load: {
+
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+ focus: {
+
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ try {
+ this.focus();
+ return false;
+ } catch ( e ) {
+
+ // Support: IE<9
+ // If we error on focus to hidden element (#1486, #12518),
+ // let .trigger() run the handlers
+ }
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
+ click: {
+
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
+ this.click();
+ return false;
+ }
+ },
+
+ // For cross-browser consistency, don't fire native .click() on links
+ _default: function( event ) {
+ return jQuery.nodeName( event.target, "a" );
+ }
+ },
+
+ beforeunload: {
+ postDispatch: function( event ) {
+
+ // Support: Firefox 20+
+ // Firefox doesn't alert if the returnValue field is not set.
+ if ( event.result !== undefined && event.originalEvent ) {
+ event.originalEvent.returnValue = event.result;
+ }
+ }
+ }
+ },
+
+ // Piggyback on a donor event to simulate a different one
+ simulate: function( type, elem, event ) {
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ {
+ type: type,
+ isSimulated: true
+
+ // Previously, `originalEvent: {}` was set here, so stopPropagation call
+ // would not be triggered on donor event, since in our own
+ // jQuery.event.stopPropagation function we had a check for existence of
+ // originalEvent.stopPropagation method, so, consequently it would be a noop.
+ //
+ // Guard for simulated events was moved to jQuery.event.stopPropagation function
+ // since `originalEvent` should point to the original event for the
+ // constancy with other events and for more focused logic
+ }
+ );
+
+ jQuery.event.trigger( e, null, elem );
+
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+
+ // This "if" is needed for plain objects
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle );
+ }
+ } :
+ function( elem, type, handle ) {
+ var name = "on" + type;
+
+ if ( elem.detachEvent ) {
+
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
+ // detachEvent needed property on element, by name of that event,
+ // to properly expose it to GC
+ if ( typeof elem[ name ] === "undefined" ) {
+ elem[ name ] = null;
+ }
+
+ elem.detachEvent( name, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+
+ // Allow instantiation without the 'new' keyword
+ if ( !( this instanceof jQuery.Event ) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = src.defaultPrevented ||
+ src.defaultPrevented === undefined &&
+
+ // Support: IE < 9, Android < 4.0
+ src.returnValue === false ?
+ returnTrue :
+ returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ constructor: jQuery.Event,
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse,
+
+ preventDefault: function() {
+ var e = this.originalEvent;
+
+ this.isDefaultPrevented = returnTrue;
+ if ( !e ) {
+ return;
+ }
+
+ // If preventDefault exists, run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // Support: IE
+ // Otherwise set the returnValue property of the original event to false
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ var e = this.originalEvent;
+
+ this.isPropagationStopped = returnTrue;
+
+ if ( !e || this.isSimulated ) {
+ return;
+ }
+
+ // If stopPropagation exists, run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+
+ // Support: IE
+ // Set the cancelBubble property of the original event to true
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ var e = this.originalEvent;
+
+ this.isImmediatePropagationStopped = returnTrue;
+
+ if ( e && e.stopImmediatePropagation ) {
+ e.stopImmediatePropagation();
+ }
+
+ this.stopPropagation();
+ }
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+// so that event delegation works in jQuery.
+// Do the same for pointerenter/pointerleave and pointerover/pointerout
+//
+// Support: Safari 7 only
+// Safari sends mouseenter too often; see:
+// https://code.google.com/p/chromium/issues/detail?id=470258
+// for the description of the bug (it existed in older Chrome versions as well).
+jQuery.each( {
+ mouseenter: "mouseover",
+ mouseleave: "mouseout",
+ pointerenter: "pointerover",
+ pointerleave: "pointerout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj;
+
+ // For mouseenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+} );
+
+// IE submit delegation
+if ( !support.submit ) {
+
+ jQuery.event.special.submit = {
+ setup: function() {
+
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+
+ // Node name check avoids a VML-related crash in IE (#9807)
+ var elem = e.target,
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ?
+
+ // Support: IE <=8
+ // We use jQuery.prop instead of elem.form
+ // to allow fixing the IE8 delegated submit issue (gh-2332)
+ // by 3rd party polyfills/workarounds.
+ jQuery.prop( elem, "form" ) :
+ undefined;
+
+ if ( form && !jQuery._data( form, "submit" ) ) {
+ jQuery.event.add( form, "submit._submit", function( event ) {
+ event._submitBubble = true;
+ } );
+ jQuery._data( form, "submit", true );
+ }
+ } );
+
+ // return undefined since we don't need an event listener
+ },
+
+ postDispatch: function( event ) {
+
+ // If form was submitted by the user, bubble the event up the tree
+ if ( event._submitBubble ) {
+ delete event._submitBubble;
+ if ( this.parentNode && !event.isTrigger ) {
+ jQuery.event.simulate( "submit", this.parentNode, event );
+ }
+ }
+ },
+
+ teardown: function() {
+
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+ jQuery.event.remove( this, "._submit" );
+ }
+ };
+}
+
+// IE change delegation and checkbox/radio fix
+if ( !support.change ) {
+
+ jQuery.event.special.change = {
+
+ setup: function() {
+
+ if ( rformElems.test( this.nodeName ) ) {
+
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
+ // after a propertychange. Eat the blur-change in special.change.handle.
+ // This still fires onchange a second time for check/radio after blur.
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ jQuery.event.add( this, "propertychange._change", function( event ) {
+ if ( event.originalEvent.propertyName === "checked" ) {
+ this._justChanged = true;
+ }
+ } );
+ jQuery.event.add( this, "click._change", function( event ) {
+ if ( this._justChanged && !event.isTrigger ) {
+ this._justChanged = false;
+ }
+
+ // Allow triggered, simulated change events (#11500)
+ jQuery.event.simulate( "change", this, event );
+ } );
+ }
+ return false;
+ }
+
+ // Delegated event; lazy-add a change handler on descendant inputs
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
+ var elem = e.target;
+
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) {
+ jQuery.event.add( elem, "change._change", function( event ) {
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+ jQuery.event.simulate( "change", this.parentNode, event );
+ }
+ } );
+ jQuery._data( elem, "change", true );
+ }
+ } );
+ },
+
+ handle: function( event ) {
+ var elem = event.target;
+
+ // Swallow native change events from checkbox/radio, we already triggered them above
+ if ( this !== elem || event.isSimulated || event.isTrigger ||
+ ( elem.type !== "radio" && elem.type !== "checkbox" ) ) {
+
+ return event.handleObj.handler.apply( this, arguments );
+ }
+ },
+
+ teardown: function() {
+ jQuery.event.remove( this, "._change" );
+
+ return !rformElems.test( this.nodeName );
+ }
+ };
+}
+
+// Support: Firefox
+// Firefox doesn't have focus(in | out) events
+// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
+//
+// Support: Chrome, Safari
+// focus(in | out) events fire after focus & blur events,
+// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
+// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
+if ( !support.focusin ) {
+ jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler on the document while someone wants focusin/focusout
+ var handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ var doc = this.ownerDocument || this,
+ attaches = jQuery._data( doc, fix );
+
+ if ( !attaches ) {
+ doc.addEventListener( orig, handler, true );
+ }
+ jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
+ },
+ teardown: function() {
+ var doc = this.ownerDocument || this,
+ attaches = jQuery._data( doc, fix ) - 1;
+
+ if ( !attaches ) {
+ doc.removeEventListener( orig, handler, true );
+ jQuery._removeData( doc, fix );
+ } else {
+ jQuery._data( doc, fix, attaches );
+ }
+ }
+ };
+ } );
+}
+
+jQuery.fn.extend( {
+
+ on: function( types, selector, data, fn ) {
+ return on( this, types, selector, data, fn );
+ },
+ one: function( types, selector, data, fn ) {
+ return on( this, types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ?
+ handleObj.origType + "." + handleObj.namespace :
+ handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each( function() {
+ jQuery.event.remove( this, types, fn, selector );
+ } );
+ },
+
+ trigger: function( type, data ) {
+ return this.each( function() {
+ jQuery.event.trigger( type, data, this );
+ } );
+ },
+ triggerHandler: function( type, data ) {
+ var elem = this[ 0 ];
+ if ( elem ) {
+ return jQuery.event.trigger( type, data, elem, true );
+ }
+ }
+} );
+
+
+var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
+ rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ),
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
+
+ // Support: IE 10-11, Edge 10240+
+ // In IE/Edge using regex groups here causes severe slowdowns.
+ // See https://connect.microsoft.com/IE/feedback/details/1736512/
+ rnoInnerhtml = /<script|<style|<link/i,
+
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptTypeMasked = /^true\/(.*)/,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+ safeFragment = createSafeFragment( document ),
+ fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) );
+
+// Support: IE<8
+// Manipulating tables requires a tbody
+function manipulationTarget( elem, content ) {
+ return jQuery.nodeName( elem, "table" ) &&
+ jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
+
+ elem.getElementsByTagName( "tbody" )[ 0 ] ||
+ elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
+ elem;
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+ elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type;
+ return elem;
+}
+function restoreScript( elem ) {
+ var match = rscriptTypeMasked.exec( elem.type );
+ if ( match ) {
+ elem.type = match[ 1 ];
+ } else {
+ elem.removeAttribute( "type" );
+ }
+ return elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var type, i, l,
+ oldData = jQuery._data( src ),
+ curData = jQuery._data( dest, oldData ),
+ events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+
+ // make the cloned public data object a copy from the original
+ if ( curData.data ) {
+ curData.data = jQuery.extend( {}, curData.data );
+ }
+}
+
+function fixCloneNodeIssues( src, dest ) {
+ var nodeName, e, data;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 copies events bound via attachEvent when using cloneNode.
+ if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
+ data = jQuery._data( dest );
+
+ for ( e in data.events ) {
+ jQuery.removeEvent( dest, e, data.handle );
+ }
+
+ // Event data gets referenced instead of copied if the expando gets copied too
+ dest.removeAttribute( jQuery.expando );
+ }
+
+ // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
+ if ( nodeName === "script" && dest.text !== src.text ) {
+ disableScript( dest ).text = src.text;
+ restoreScript( dest );
+
+ // IE6-10 improperly clones children of object elements using classid.
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
+ } else if ( nodeName === "object" ) {
+ if ( dest.parentNode ) {
+ dest.outerHTML = src.outerHTML;
+ }
+
+ // This path appears unavoidable for IE9. When cloning an object
+ // element in IE9, the outerHTML strategy above is not sufficient.
+ // If the src has innerHTML and the destination does not,
+ // copy the src.innerHTML into the dest.innerHTML. #10324
+ if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) {
+ dest.innerHTML = src.innerHTML;
+ }
+
+ } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
+
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+
+ dest.defaultChecked = dest.checked = src.checked;
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.defaultSelected = dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+}
+
+function domManip( collection, args, callback, ignored ) {
+
+ // Flatten any nested arrays
+ args = concat.apply( [], args );
+
+ var first, node, hasScripts,
+ scripts, doc, fragment,
+ i = 0,
+ l = collection.length,
+ iNoClone = l - 1,
+ value = args[ 0 ],
+ isFunction = jQuery.isFunction( value );
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( isFunction ||
+ ( l > 1 && typeof value === "string" &&
+ !support.checkClone && rchecked.test( value ) ) ) {
+ return collection.each( function( index ) {
+ var self = collection.eq( index );
+ if ( isFunction ) {
+ args[ 0 ] = value.call( this, index, self.html() );
+ }
+ domManip( self, args, callback, ignored );
+ } );
+ }
+
+ if ( l ) {
+ fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
+ first = fragment.firstChild;
+
+ if ( fragment.childNodes.length === 1 ) {
+ fragment = first;
+ }
+
+ // Require either new content or an interest in ignored elements to invoke the callback
+ if ( first || ignored ) {
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+ hasScripts = scripts.length;
+
+ // Use the original fragment for the last item
+ // instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ for ( ; i < l; i++ ) {
+ node = fragment;
+
+ if ( i !== iNoClone ) {
+ node = jQuery.clone( node, true, true );
+
+ // Keep references to cloned scripts for later restoration
+ if ( hasScripts ) {
+
+ // Support: Android<4.1, PhantomJS<2
+ // push.apply(_, arraylike) throws on ancient WebKit
+ jQuery.merge( scripts, getAll( node, "script" ) );
+ }
+ }
+
+ callback.call( collection[ i ], node, i );
+ }
+
+ if ( hasScripts ) {
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
+
+ // Reenable scripts
+ jQuery.map( scripts, restoreScript );
+
+ // Evaluate executable scripts on first document insertion
+ for ( i = 0; i < hasScripts; i++ ) {
+ node = scripts[ i ];
+ if ( rscriptType.test( node.type || "" ) &&
+ !jQuery._data( node, "globalEval" ) &&
+ jQuery.contains( doc, node ) ) {
+
+ if ( node.src ) {
+
+ // Optional AJAX dependency, but won't run scripts if not present
+ if ( jQuery._evalUrl ) {
+ jQuery._evalUrl( node.src );
+ }
+ } else {
+ jQuery.globalEval(
+ ( node.text || node.textContent || node.innerHTML || "" )
+ .replace( rcleanScript, "" )
+ );
+ }
+ }
+ }
+ }
+
+ // Fix #11809: Avoid leaking memory
+ fragment = first = null;
+ }
+ }
+
+ return collection;
+}
+
+function remove( elem, selector, keepData ) {
+ var node,
+ elems = selector ? jQuery.filter( selector, elem ) : elem,
+ i = 0;
+
+ for ( ; ( node = elems[ i ] ) != null; i++ ) {
+
+ if ( !keepData && node.nodeType === 1 ) {
+ jQuery.cleanData( getAll( node ) );
+ }
+
+ if ( node.parentNode ) {
+ if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
+ setGlobalEval( getAll( node, "script" ) );
+ }
+ node.parentNode.removeChild( node );
+ }
+ }
+
+ return elem;
+}
+
+jQuery.extend( {
+ htmlPrefilter: function( html ) {
+ return html.replace( rxhtmlTag, "<$1></$2>" );
+ },
+
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var destElements, node, clone, i, srcElements,
+ inPage = jQuery.contains( elem.ownerDocument, elem );
+
+ if ( support.html5Clone || jQuery.isXMLDoc( elem ) ||
+ !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
+
+ clone = elem.cloneNode( true );
+
+ // IE<=8 does not properly clone detached, unknown element nodes
+ } else {
+ fragmentDiv.innerHTML = elem.outerHTML;
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+ }
+
+ if ( ( !support.noCloneEvent || !support.noCloneChecked ) &&
+ ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) {
+
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+ destElements = getAll( clone );
+ srcElements = getAll( elem );
+
+ // Fix all IE cloning issues
+ for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) {
+
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[ i ] ) {
+ fixCloneNodeIssues( node, destElements[ i ] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ if ( deepDataAndEvents ) {
+ srcElements = srcElements || getAll( elem );
+ destElements = destElements || getAll( clone );
+
+ for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) {
+ cloneCopyEvent( node, destElements[ i ] );
+ }
+ } else {
+ cloneCopyEvent( elem, clone );
+ }
+ }
+
+ // Preserve script evaluation history
+ destElements = getAll( clone, "script" );
+ if ( destElements.length > 0 ) {
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+ }
+
+ destElements = srcElements = node = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ cleanData: function( elems, /* internal */ forceAcceptData ) {
+ var elem, type, id, data,
+ i = 0,
+ internalKey = jQuery.expando,
+ cache = jQuery.cache,
+ attributes = support.attributes,
+ special = jQuery.event.special;
+
+ for ( ; ( elem = elems[ i ] ) != null; i++ ) {
+ if ( forceAcceptData || acceptData( elem ) ) {
+
+ id = elem[ internalKey ];
+ data = id && cache[ id ];
+
+ if ( data ) {
+ if ( data.events ) {
+ for ( type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+
+ // Remove cache only if it was not already removed by jQuery.event.remove
+ if ( cache[ id ] ) {
+
+ delete cache[ id ];
+
+ // Support: IE<9
+ // IE does not allow us to delete expando properties from nodes
+ // IE creates expando attributes along with the property
+ // IE does not have a removeAttribute function on Document nodes
+ if ( !attributes && typeof elem.removeAttribute !== "undefined" ) {
+ elem.removeAttribute( internalKey );
+
+ // Webkit & Blink performance suffers when deleting properties
+ // from DOM nodes, so set to undefined instead
+ // https://code.google.com/p/chromium/issues/detail?id=378607
+ } else {
+ elem[ internalKey ] = undefined;
+ }
+
+ deletedIds.push( id );
+ }
+ }
+ }
+ }
+ }
+} );
+
+jQuery.fn.extend( {
+
+ // Keep domManip exposed until 3.0 (gh-2225)
+ domManip: domManip,
+
+ detach: function( selector ) {
+ return remove( this, selector, true );
+ },
+
+ remove: function( selector ) {
+ return remove( this, selector );
+ },
+
+ text: function( value ) {
+ return access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().append(
+ ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value )
+ );
+ }, null, value, arguments.length );
+ },
+
+ append: function() {
+ return domManip( this, arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.appendChild( elem );
+ }
+ } );
+ },
+
+ prepend: function() {
+ return domManip( this, arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.insertBefore( elem, target.firstChild );
+ }
+ } );
+ },
+
+ before: function() {
+ return domManip( this, arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this );
+ }
+ } );
+ },
+
+ after: function() {
+ return domManip( this, arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ }
+ } );
+ },
+
+ empty: function() {
+ var elem,
+ i = 0;
+
+ for ( ; ( elem = this[ i ] ) != null; i++ ) {
+
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+
+ // If this is a select, ensure that it displays empty (#12336)
+ // Support: IE<9
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
+ elem.options.length = 0;
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map( function() {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ } );
+ },
+
+ html: function( value ) {
+ return access( this, function( value ) {
+ var elem = this[ 0 ] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined ) {
+ return elem.nodeType === 1 ?
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
+ undefined;
+ }
+
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
+ ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+ !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
+
+ value = jQuery.htmlPrefilter( value );
+
+ try {
+ for ( ; i < l; i++ ) {
+
+ // Remove element nodes and prevent memory leaks
+ elem = this[ i ] || {};
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch ( e ) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function() {
+ var ignored = [];
+
+ // Make the changes, replacing each non-ignored context element with the new content
+ return domManip( this, arguments, function( elem ) {
+ var parent = this.parentNode;
+
+ if ( jQuery.inArray( this, ignored ) < 0 ) {
+ jQuery.cleanData( getAll( this ) );
+ if ( parent ) {
+ parent.replaceChild( elem, this );
+ }
+ }
+
+ // Force callback invocation
+ }, ignored );
+ }
+} );
+
+jQuery.each( {
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var elems,
+ i = 0,
+ ret = [],
+ insert = jQuery( selector ),
+ last = insert.length - 1;
+
+ for ( ; i <= last; i++ ) {
+ elems = i === last ? this : this.clone( true );
+ jQuery( insert[ i ] )[ original ]( elems );
+
+ // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
+ push.apply( ret, elems.get() );
+ }
+
+ return this.pushStack( ret );
+ };
+} );
+
+
+var iframe,
+ elemdisplay = {
+
+ // Support: Firefox
+ // We have to pre-define these values for FF (#10227)
+ HTML: "block",
+ BODY: "block"
+ };
+
+/**
+ * Retrieve the actual display of a element
+ * @param {String} name nodeName of the element
+ * @param {Object} doc Document object
+ */
+
+// Called only from within defaultDisplay
+function actualDisplay( name, doc ) {
+ var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
+
+ display = jQuery.css( elem[ 0 ], "display" );
+
+ // We don't have any data stored on the element,
+ // so use "detach" method as fast way to get rid of the element
+ elem.detach();
+
+ return display;
+}
+
+/**
+ * Try to determine the default display value of an element
+ * @param {String} nodeName
+ */
+function defaultDisplay( nodeName ) {
+ var doc = document,
+ display = elemdisplay[ nodeName ];
+
+ if ( !display ) {
+ display = actualDisplay( nodeName, doc );
+
+ // If the simple way fails, read from inside an iframe
+ if ( display === "none" || !display ) {
+
+ // Use the already-created iframe if possible
+ iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
+ .appendTo( doc.documentElement );
+
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+ doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
+
+ // Support: IE
+ doc.write();
+ doc.close();
+
+ display = actualDisplay( nodeName, doc );
+ iframe.detach();
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return display;
+}
+var rmargin = ( /^margin/ );
+
+var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
+
+var swap = function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+};
+
+
+var documentElement = document.documentElement;
+
+
+
+( function() {
+ var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal,
+ reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal,
+ container = document.createElement( "div" ),
+ div = document.createElement( "div" );
+
+ // Finish early in limited (non-browser) environments
+ if ( !div.style ) {
+ return;
+ }
+
+ div.style.cssText = "float:left;opacity:.5";
+
+ // Support: IE<9
+ // Make sure that element opacity exists (as opposed to filter)
+ support.opacity = div.style.opacity === "0.5";
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ support.cssFloat = !!div.style.cssFloat;
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ container = document.createElement( "div" );
+ container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
+ "padding:0;margin-top:1px;position:absolute";
+ div.innerHTML = "";
+ container.appendChild( div );
+
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" ||
+ div.style.WebkitBoxSizing === "";
+
+ jQuery.extend( support, {
+ reliableHiddenOffsets: function() {
+ if ( pixelPositionVal == null ) {
+ computeStyleTests();
+ }
+ return reliableHiddenOffsetsVal;
+ },
+
+ boxSizingReliable: function() {
+
+ // We're checking for pixelPositionVal here instead of boxSizingReliableVal
+ // since that compresses better and they're computed together anyway.
+ if ( pixelPositionVal == null ) {
+ computeStyleTests();
+ }
+ return boxSizingReliableVal;
+ },
+
+ pixelMarginRight: function() {
+
+ // Support: Android 4.0-4.3
+ if ( pixelPositionVal == null ) {
+ computeStyleTests();
+ }
+ return pixelMarginRightVal;
+ },
+
+ pixelPosition: function() {
+ if ( pixelPositionVal == null ) {
+ computeStyleTests();
+ }
+ return pixelPositionVal;
+ },
+
+ reliableMarginRight: function() {
+
+ // Support: Android 2.3
+ if ( pixelPositionVal == null ) {
+ computeStyleTests();
+ }
+ return reliableMarginRightVal;
+ },
+
+ reliableMarginLeft: function() {
+
+ // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
+ if ( pixelPositionVal == null ) {
+ computeStyleTests();
+ }
+ return reliableMarginLeftVal;
+ }
+ } );
+
+ function computeStyleTests() {
+ var contents, divStyle,
+ documentElement = document.documentElement;
+
+ // Setup
+ documentElement.appendChild( container );
+
+ div.style.cssText =
+
+ // Support: Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:border-box;box-sizing:border-box;" +
+ "position:relative;display:block;" +
+ "margin:auto;border:1px;padding:1px;" +
+ "top:1%;width:50%";
+
+ // Support: IE<9
+ // Assume reasonable values in the absence of getComputedStyle
+ pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false;
+ pixelMarginRightVal = reliableMarginRightVal = true;
+
+ // Check for getComputedStyle so that this code is not run in IE<9.
+ if ( window.getComputedStyle ) {
+ divStyle = window.getComputedStyle( div );
+ pixelPositionVal = ( divStyle || {} ).top !== "1%";
+ reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px";
+ boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px";
+
+ // Support: Android 4.0 - 4.3 only
+ // Some styles come back with percentage values, even though they shouldn't
+ div.style.marginRight = "50%";
+ pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px";
+
+ // Support: Android 2.3 only
+ // Div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container (#3333)
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ contents = div.appendChild( document.createElement( "div" ) );
+
+ // Reset CSS: box-sizing; display; margin; border; padding
+ contents.style.cssText = div.style.cssText =
+
+ // Support: Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
+ "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
+ contents.style.marginRight = contents.style.width = "0";
+ div.style.width = "1px";
+
+ reliableMarginRightVal =
+ !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight );
+
+ div.removeChild( contents );
+ }
+
+ // Support: IE6-8
+ // First check that getClientRects works as expected
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ div.style.display = "none";
+ reliableHiddenOffsetsVal = div.getClientRects().length === 0;
+ if ( reliableHiddenOffsetsVal ) {
+ div.style.display = "";
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
+ contents = div.getElementsByTagName( "td" );
+ contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+ if ( reliableHiddenOffsetsVal ) {
+ contents[ 0 ].style.display = "";
+ contents[ 1 ].style.display = "none";
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+ }
+ }
+
+ // Teardown
+ documentElement.removeChild( container );
+ }
+
+} )();
+
+
+var getStyles, curCSS,
+ rposition = /^(top|right|bottom|left)$/;
+
+if ( window.getComputedStyle ) {
+ getStyles = function( elem ) {
+
+ // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
+ // IE throws on elements created in popups
+ // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
+ var view = elem.ownerDocument.defaultView;
+
+ if ( !view.opener ) {
+ view = window;
+ }
+
+ return view.getComputedStyle( elem );
+ };
+
+ curCSS = function( elem, name, computed ) {
+ var width, minWidth, maxWidth, ret,
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
+
+ if ( computed ) {
+
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Chrome < 17 and Safari 5.0 uses "computed value"
+ // instead of "used value" for margin-right
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values,
+ // but width seems to be reliably pixels
+ // this is against the CSSOM draft spec:
+ // http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+ // Remember the original values
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ // Put in the new values to get a computed value out
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ // Revert the changed values
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ // Support: IE
+ // IE returns zIndex value as an integer.
+ return ret === undefined ?
+ ret :
+ ret + "";
+ };
+} else if ( documentElement.currentStyle ) {
+ getStyles = function( elem ) {
+ return elem.currentStyle;
+ };
+
+ curCSS = function( elem, name, computed ) {
+ var left, rs, rsLeft, ret,
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+ ret = computed ? computed[ name ] : undefined;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret == null && style && style[ name ] ) {
+ ret = style[ name ];
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ // but not position css attributes, as those are
+ // proportional to the parent element instead
+ // and we can't measure the parent instead because it
+ // might trigger a "stacking dolls" problem
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rs = elem.runtimeStyle;
+ rsLeft = rs && rs.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ rs.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ret;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ rs.left = rsLeft;
+ }
+ }
+
+ // Support: IE
+ // IE returns zIndex value as an integer.
+ return ret === undefined ?
+ ret :
+ ret + "" || "auto";
+ };
+}
+
+
+
+
+function addGetHookIf( conditionFn, hookFn ) {
+
+ // Define the hook, we'll check on the first run if it's really needed.
+ return {
+ get: function() {
+ if ( conditionFn() ) {
+
+ // Hook not needed (or it's not possible to use it due
+ // to missing dependency), remove it.
+ delete this.get;
+ return;
+ }
+
+ // Hook needed; redefine it so that the support test is not executed again.
+ return ( this.get = hookFn ).apply( this, arguments );
+ }
+ };
+}
+
+
+var
+
+ ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity\s*=\s*([^)]*)/i,
+
+ // swappable if display is none or starts with table except
+ // "table", "table-cell", or "table-caption"
+ // see here for display values:
+ // https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssNormalTransform = {
+ letterSpacing: "0",
+ fontWeight: "400"
+ },
+
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
+ emptyStyle = document.createElement( "div" ).style;
+
+
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( name ) {
+
+ // shortcut for names that are not vendor prefixed
+ if ( name in emptyStyle ) {
+ return name;
+ }
+
+ // check for vendor prefixed names
+ var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ),
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in emptyStyle ) {
+ return name;
+ }
+ }
+}
+
+function showHide( elements, show ) {
+ var display, elem, hidden,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+
+ values[ index ] = jQuery._data( elem, "olddisplay" );
+ display = elem.style.display;
+ if ( show ) {
+
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !values[ index ] && display === "none" ) {
+ elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( elem.style.display === "" && isHidden( elem ) ) {
+ values[ index ] =
+ jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) );
+ }
+ } else {
+ hidden = isHidden( elem );
+
+ if ( display && display !== "none" || !hidden ) {
+ jQuery._data(
+ elem,
+ "olddisplay",
+ hidden ? display : jQuery.css( elem, "display" )
+ );
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( index = 0; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+ elem.style.display = show ? values[ index ] || "" : "none";
+ }
+ }
+
+ return elements;
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+ var matches = rnumsplit.exec( value );
+ return matches ?
+
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
+
+ // If we already have the right measurement, avoid augmentation
+ 4 :
+
+ // Otherwise initialize for horizontal or vertical properties
+ name === "width" ? 1 : 0,
+
+ val = 0;
+
+ for ( ; i < 4; i += 2 ) {
+
+ // both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+ }
+
+ if ( isBorderBox ) {
+
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+ }
+
+ // at this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ } else {
+
+ // at this point, extra isn't content, so add padding
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+
+ // at this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property, which is equivalent to the border-box value
+ var valueIsBorderBox = true,
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ styles = getStyles( elem ),
+ isBorderBox = support.boxSizing &&
+ jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+ // Support: IE11 only
+ // In IE 11 fullscreen elements inside of an iframe have
+ // 100x too small dimensions (gh-1764).
+ if ( document.msFullscreenElement && window.top !== window ) {
+
+ // Support: IE11 only
+ // Running getBoundingClientRect on a disconnected node
+ // in IE throws an error.
+ if ( elem.getClientRects().length ) {
+ val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
+ }
+ }
+
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+ if ( val <= 0 || val == null ) {
+
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, styles );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test( val ) ) {
+ return val;
+ }
+
+ // we need the check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox &&
+ ( support.boxSizingReliable() || val === elem.style[ name ] );
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+ }
+
+ // use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox,
+ styles
+ )
+ ) + "px";
+}
+
+jQuery.extend( {
+
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+ }
+ }
+ }
+ },
+
+ // Don't automatically add "px" to these possibly-unitless properties
+ cssNumber: {
+ "animationIterationCount": true,
+ "columnCount": true,
+ "fillOpacity": true,
+ "flexGrow": true,
+ "flexShrink": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "order": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+
+ // normalize float css property
+ "float": support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ style = elem.style;
+
+ name = jQuery.cssProps[ origName ] ||
+ ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // Convert "+=" or "-=" to relative numbers (#7345)
+ if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
+ value = adjustCSS( elem, name, ret );
+
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that null and NaN values aren't set. See: #7116
+ if ( value == null || value !== value ) {
+ return;
+ }
+
+ // If a number was passed in, add the unit (except for certain CSS properties)
+ if ( type === "number" ) {
+ value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
+ }
+
+ // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
+ // but it would mean to define eight
+ // (for every problematic property) identical functions
+ if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
+ style[ name ] = "inherit";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !( "set" in hooks ) ||
+ ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
+
+ // Support: IE
+ // Swallow errors from 'invalid' CSS values (#5509)
+ try {
+ style[ name ] = value;
+ } catch ( e ) {}
+ }
+
+ } else {
+
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks &&
+ ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
+
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra, styles ) {
+ var num, val, hooks,
+ origName = jQuery.camelCase( name );
+
+ // Make sure that we're working with the right name
+ name = jQuery.cssProps[ origName ] ||
+ ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name, styles );
+ }
+
+ //convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
+ if ( extra === "" || extra ) {
+ num = parseFloat( val );
+ return extra === true || isFinite( num ) ? num || 0 : val;
+ }
+ return val;
+ }
+} );
+
+jQuery.each( [ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+
+ // certain elements can have dimension info if we invisibly show them
+ // however, it must have a current display style that would benefit from this
+ return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
+ elem.offsetWidth === 0 ?
+ swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ } ) :
+ getWidthOrHeight( elem, name, extra );
+ }
+ },
+
+ set: function( elem, value, extra ) {
+ var styles = extra && getStyles( elem );
+ return setPositiveNumber( elem, value, extra ?
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ support.boxSizing &&
+ jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+ styles
+ ) : 0
+ );
+ }
+ };
+} );
+
+if ( !support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+
+ // IE uses filters for opacity
+ return ropacity.test( ( computed && elem.currentStyle ?
+ elem.currentStyle.filter :
+ elem.style.filter ) || "" ) ?
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist -
+ // attempt to remove filter attribute #6652
+ // if value === "", then remove inline opacity #12685
+ if ( ( value >= 1 || value === "" ) &&
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+ style.removeAttribute ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there is no filter style applied in a css rule
+ // or unset inline opacity, we are done
+ if ( value === "" || currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
+ function( elem, computed ) {
+ if ( computed ) {
+ return swap( elem, { "display": "inline-block" },
+ curCSS, [ elem, "marginRight" ] );
+ }
+ }
+);
+
+jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
+ function( elem, computed ) {
+ if ( computed ) {
+ return (
+ parseFloat( curCSS( elem, "marginLeft" ) ) ||
+
+ // Support: IE<=11+
+ // Running getBoundingClientRect on a disconnected node in IE throws an error
+ // Support: IE8 only
+ // getClientRects() errors on disconnected elems
+ ( jQuery.contains( elem.ownerDocument, elem ) ?
+ elem.getBoundingClientRect().left -
+ swap( elem, { marginLeft: 0 }, function() {
+ return elem.getBoundingClientRect().left;
+ } ) :
+ 0
+ )
+ ) + "px";
+ }
+ }
+);
+
+// These hooks are used by animate to expand properties
+jQuery.each( {
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i = 0,
+ expanded = {},
+
+ // assumes a single number if not a string
+ parts = typeof value === "string" ? value.split( " " ) : [ value ];
+
+ for ( ; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+} );
+
+jQuery.fn.extend( {
+ css: function( name, value ) {
+ return access( this, function( elem, name, value ) {
+ var styles, len,
+ map = {},
+ i = 0;
+
+ if ( jQuery.isArray( name ) ) {
+ styles = getStyles( elem );
+ len = name.length;
+
+ for ( ; i < len; i++ ) {
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+ }
+
+ return map;
+ }
+
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ },
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state ) {
+ if ( typeof state === "boolean" ) {
+ return state ? this.show() : this.hide();
+ }
+
+ return this.each( function() {
+ if ( isHidden( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ } );
+ }
+} );
+
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || jQuery.easing._default;
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ // Use a property on the element directly when it is not a DOM element,
+ // or when there is no matching style property that exists.
+ if ( tween.elem.nodeType !== 1 ||
+ tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.nodeType === 1 &&
+ ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
+ jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Support: IE <=9
+// Panic based approach to setting things on disconnected nodes
+
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p * Math.PI ) / 2;
+ },
+ _default: "swing"
+};
+
+jQuery.fx = Tween.prototype.init;
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+
+
+
+var
+ fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rrun = /queueHooks$/;
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ window.setTimeout( function() {
+ fxNow = undefined;
+ } );
+ return ( fxNow = jQuery.now() );
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ attrs = { height: type },
+ i = 0;
+
+ // if we include width, step value is 1 to do all cssExpand values,
+ // if we don't include width, step value is 2 to skip over Left and Right
+ includeWidth = includeWidth ? 1 : 0;
+ for ( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
+
+ // we're done with this property
+ return tween;
+ }
+ }
+}
+
+function defaultPrefilter( elem, props, opts ) {
+ /* jshint validthis: true */
+ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHidden( elem ),
+ dataShow = jQuery._data( elem, "fxshow" );
+
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always( function() {
+
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always( function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ } );
+ } );
+ }
+
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ display = jQuery.css( elem, "display" );
+
+ // Test default display if display is currently "none"
+ checkDisplay = display === "none" ?
+ jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
+
+ if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
+ style.display = "inline-block";
+ } else {
+ style.zoom = 1;
+ }
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ if ( !support.shrinkWrapBlocks() ) {
+ anim.always( function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ } );
+ }
+ }
+
+ // show/hide pass
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+
+ // If there is dataShow left over from a stopped hide or show
+ // and we are going to proceed with show, we should pretend to be hidden
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
+ hidden = true;
+ } else {
+ continue;
+ }
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+
+ // Any non-fx value stops us from restoring the original display value
+ } else {
+ display = undefined;
+ }
+ }
+
+ if ( !jQuery.isEmptyObject( orig ) ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = jQuery._data( elem, "fxshow", {} );
+ }
+
+ // store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done( function() {
+ jQuery( elem ).hide();
+ } );
+ }
+ anim.done( function() {
+ var prop;
+ jQuery._removeData( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ } );
+ for ( prop in orig ) {
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
+
+ // If this is a noop like .hide().hide(), restore an overwritten display value
+ } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) {
+ style.display = display;
+ }
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = Animation.prefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ } ),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+
+ // Support: Android 2.3
+ // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ] );
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise( {
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, {
+ specialEasing: {},
+ easing: jQuery.easing._default
+ }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.notifyWith( elem, [ animation, 1, 0 ] );
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ } ),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ if ( jQuery.isFunction( result.stop ) ) {
+ jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
+ jQuery.proxy( result.stop, result );
+ }
+ return result;
+ }
+ }
+
+ jQuery.map( props, createTween, animation );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ } )
+ );
+
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+
+ tweeners: {
+ "*": [ function( prop, value ) {
+ var tween = this.createTween( prop, value );
+ adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
+ return tween;
+ } ]
+ },
+
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.match( rnotwhite );
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
+ Animation.tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilters: [ defaultPrefilter ],
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ Animation.prefilters.unshift( callback );
+ } else {
+ Animation.prefilters.push( callback );
+ }
+ }
+} );
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ?
+ jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.fn.extend( {
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+ // animate to the value specified
+ .end().animate( { opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations, or finishing resolves immediately
+ if ( empty || jQuery._data( this, "finish" ) ) {
+ anim.stop( true );
+ }
+ };
+ doAnimation.finish = doAnimation;
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each( function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this &&
+ ( type == null || timers[ index ].queue === type ) ) {
+
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ } );
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each( function() {
+ var index,
+ data = jQuery._data( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // enable finishing flag on private data
+ data.finish = true;
+
+ // empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.stop ) {
+ hooks.stop.call( this, true );
+ }
+
+ // look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // turn off finishing flag
+ delete data.finish;
+ } );
+ }
+} );
+
+jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+} );
+
+// Generate shortcuts for custom animations
+jQuery.each( {
+ slideDown: genFx( "show" ),
+ slideUp: genFx( "hide" ),
+ slideToggle: genFx( "toggle" ),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+} );
+
+jQuery.timers = [];
+jQuery.fx.tick = function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ fxNow = jQuery.now();
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+ jQuery.timers.push( timer );
+ if ( timer() ) {
+ jQuery.fx.start();
+ } else {
+ jQuery.timers.pop();
+ }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.start = function() {
+ if ( !timerId ) {
+ timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
+
+jQuery.fx.stop = function() {
+ window.clearInterval( timerId );
+ timerId = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+
+ // Default speed
+ _default: 400
+};
+
+
+// Based off of the plugin by Clint Helfers, with permission.
+// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
+jQuery.fn.delay = function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = window.setTimeout( next, time );
+ hooks.stop = function() {
+ window.clearTimeout( timeout );
+ };
+ } );
+};
+
+
+( function() {
+ var a,
+ input = document.createElement( "input" ),
+ div = document.createElement( "div" ),
+ select = document.createElement( "select" ),
+ opt = select.appendChild( document.createElement( "option" ) );
+
+ // Setup
+ div = document.createElement( "div" );
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // Support: Windows Web Apps (WWA)
+ // `type` must use .setAttribute for WWA (#14901)
+ input.setAttribute( "type", "checkbox" );
+ div.appendChild( input );
+
+ a = div.getElementsByTagName( "a" )[ 0 ];
+
+ // First batch of tests.
+ a.style.cssText = "top:1px";
+
+ // Test setAttribute on camelCase class.
+ // If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ support.getSetAttribute = div.className !== "t";
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ support.style = /top/.test( a.getAttribute( "style" ) );
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ support.hrefNormalized = a.getAttribute( "href" ) === "/a";
+
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+ support.checkOn = !!input.value;
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ support.optSelected = opt.selected;
+
+ // Tests for enctype support on a form (#6743)
+ support.enctype = !!document.createElement( "form" ).enctype;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Support: IE8 only
+ // Check if we can trust getAttribute("value")
+ input = document.createElement( "input" );
+ input.setAttribute( "value", "" );
+ support.input = input.getAttribute( "value" ) === "";
+
+ // Check if an input maintains its value after becoming a radio
+ input.value = "t";
+ input.setAttribute( "type", "radio" );
+ support.radioValue = input.value === "t";
+} )();
+
+
+var rreturn = /\r/g;
+
+jQuery.fn.extend( {
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[ 0 ];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] ||
+ jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if (
+ hooks &&
+ "get" in hooks &&
+ ( ret = hooks.get( elem, "value" ) ) !== undefined
+ ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+
+ // handle most common string cases
+ ret.replace( rreturn, "" ) :
+
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each( function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map( val, function( value ) {
+ return value == null ? "" : value + "";
+ } );
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ } );
+ }
+} );
+
+jQuery.extend( {
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+
+ // Support: IE10-11+
+ // option.text throws exceptions (#14686, #14858)
+ jQuery.trim( jQuery.text( elem ) );
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // oldIE doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+
+ // Don't return options that are disabled or in a disabled optgroup
+ ( support.optDisabled ?
+ !option.disabled :
+ option.getAttribute( "disabled" ) === null ) &&
+ ( !option.parentNode.disabled ||
+ !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+
+ if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
+
+ // Support: IE6
+ // When new option element is added to select box we need to
+ // force reflow of newly added node in order to workaround delay
+ // of initialization properties
+ try {
+ option.selected = optionSet = true;
+
+ } catch ( _ ) {
+
+ // Will be executed only in IE6
+ option.scrollHeight;
+ }
+
+ } else {
+ option.selected = false;
+ }
+ }
+
+ // Force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+
+ return options;
+ }
+ }
+ }
+} );
+
+// Radios and checkboxes getter/setter
+jQuery.each( [ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
+ }
+ }
+ };
+ if ( !support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ return elem.getAttribute( "value" ) === null ? "on" : elem.value;
+ };
+ }
+} );
+
+
+
+
+var nodeHook, boolHook,
+ attrHandle = jQuery.expr.attrHandle,
+ ruseDefault = /^(?:checked|selected)$/i,
+ getSetAttribute = support.getSetAttribute,
+ getSetInput = support.input;
+
+jQuery.fn.extend( {
+ attr: function( name, value ) {
+ return access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each( function() {
+ jQuery.removeAttr( this, name );
+ } );
+ }
+} );
+
+jQuery.extend( {
+ attr: function( elem, name, value ) {
+ var ret, hooks,
+ nType = elem.nodeType;
+
+ // Don't get/set attributes on text, comment and attribute nodes
+ if ( nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === "undefined" ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+ return;
+ }
+
+ if ( hooks && "set" in hooks &&
+ ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
+ return ret;
+ }
+
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
+ return ret;
+ }
+
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ? undefined : ret;
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !support.radioValue && value === "radio" &&
+ jQuery.nodeName( elem, "input" ) ) {
+
+ // Setting the type on a radio button after the value resets the value in IE8-9
+ // Reset value to default in case type is set after value during creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name, propName,
+ i = 0,
+ attrNames = value && value.match( rnotwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( ( name = attrNames[ i++ ] ) ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // Boolean attributes get special treatment (#10870)
+ if ( jQuery.expr.match.bool.test( name ) ) {
+
+ // Set corresponding property to false
+ if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ elem[ propName ] = false;
+
+ // Support: IE<9
+ // Also clear defaultChecked/defaultSelected (if appropriate)
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] =
+ elem[ propName ] = false;
+ }
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ } else {
+ jQuery.attr( elem, name, "" );
+ }
+
+ elem.removeAttribute( getSetAttribute ? name : propName );
+ }
+ }
+ }
+} );
+
+// Hooks for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+
+ // IE<8 needs the *property* name
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+
+ } else {
+
+ // Support: IE<9
+ // Use defaultChecked and defaultSelected for oldIE
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+ }
+ return name;
+ }
+};
+
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+ var getter = attrHandle[ name ] || jQuery.find.attr;
+
+ if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ attrHandle[ name ] = function( elem, name, isXML ) {
+ var ret, handle;
+ if ( !isXML ) {
+
+ // Avoid an infinite loop by temporarily removing this function from the getter
+ handle = attrHandle[ name ];
+ attrHandle[ name ] = ret;
+ ret = getter( elem, name, isXML ) != null ?
+ name.toLowerCase() :
+ null;
+ attrHandle[ name ] = handle;
+ }
+ return ret;
+ };
+ } else {
+ attrHandle[ name ] = function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem[ jQuery.camelCase( "default-" + name ) ] ?
+ name.toLowerCase() :
+ null;
+ }
+ };
+ }
+} );
+
+// fix oldIE attroperties
+if ( !getSetInput || !getSetAttribute ) {
+ jQuery.attrHooks.value = {
+ set: function( elem, value, name ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+
+ // Does not return so that setAttribute is also used
+ elem.defaultValue = value;
+ } else {
+
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
+ return nodeHook && nodeHook.set( elem, value, name );
+ }
+ }
+ };
+}
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = {
+ set: function( elem, value, name ) {
+
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ elem.setAttributeNode(
+ ( ret = elem.ownerDocument.createAttribute( name ) )
+ );
+ }
+
+ ret.value = value += "";
+
+ // Break association with cloned elements by also using setAttribute (#9646)
+ if ( name === "value" || value === elem.getAttribute( name ) ) {
+ return value;
+ }
+ }
+ };
+
+ // Some attributes are constructed with empty-string values when not defined
+ attrHandle.id = attrHandle.name = attrHandle.coords =
+ function( elem, name, isXML ) {
+ var ret;
+ if ( !isXML ) {
+ return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ?
+ ret.value :
+ null;
+ }
+ };
+
+ // Fixing value retrieval on a button requires this module
+ jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret = elem.getAttributeNode( name );
+ if ( ret && ret.specified ) {
+ return ret.value;
+ }
+ },
+ set: nodeHook.set
+ };
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ set: function( elem, value, name ) {
+ nodeHook.set( elem, value === "" ? false : value, name );
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each( [ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ };
+ } );
+}
+
+if ( !support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+
+ // Return undefined in the case of empty string
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
+ // .cssText, that would destroy case sensitivity in URL's, like in "background"
+ return elem.style.cssText || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = value + "" );
+ }
+ };
+}
+
+
+
+
+var rfocusable = /^(?:input|select|textarea|button|object)$/i,
+ rclickable = /^(?:a|area)$/i;
+
+jQuery.fn.extend( {
+ prop: function( name, value ) {
+ return access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each( function() {
+
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch ( e ) {}
+ } );
+ }
+} );
+
+jQuery.extend( {
+ prop: function( elem, name, value ) {
+ var ret, hooks,
+ nType = elem.nodeType;
+
+ // Don't get/set properties on text, comment and attribute nodes
+ if ( nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ if ( hooks && "set" in hooks &&
+ ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
+ return ret;
+ }
+
+ return ( elem[ name ] = value );
+ }
+
+ if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
+ return ret;
+ }
+
+ return elem[ name ];
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+
+ // elem.tabIndex doesn't always return the
+ // correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ // Use proper attribute retrieval(#12072)
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
+
+ return tabindex ?
+ parseInt( tabindex, 10 ) :
+ rfocusable.test( elem.nodeName ) ||
+ rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ -1;
+ }
+ }
+ },
+
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ }
+} );
+
+// Some attributes require a special call on IE
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !support.hrefNormalized ) {
+
+ // href/src property should get the full normalized URL (#10299/#12915)
+ jQuery.each( [ "href", "src" ], function( i, name ) {
+ jQuery.propHooks[ name ] = {
+ get: function( elem ) {
+ return elem.getAttribute( name, 4 );
+ }
+ };
+ } );
+}
+
+// Support: Safari, IE9+
+// mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ };
+}
+
+jQuery.each( [
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+} );
+
+// IE6/7 call enctype encoding
+if ( !support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+
+
+
+var rclass = /[\t\r\n\f]/g;
+
+function getClass( elem ) {
+ return jQuery.attr( elem, "class" ) || "";
+}
+
+jQuery.fn.extend( {
+ addClass: function( value ) {
+ var classes, elem, cur, curValue, clazz, j, finalValue,
+ i = 0;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each( function( j ) {
+ jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
+ } );
+ }
+
+ if ( typeof value === "string" && value ) {
+ classes = value.match( rnotwhite ) || [];
+
+ while ( ( elem = this[ i++ ] ) ) {
+ curValue = getClass( elem );
+ cur = elem.nodeType === 1 &&
+ ( " " + curValue + " " ).replace( rclass, " " );
+
+ if ( cur ) {
+ j = 0;
+ while ( ( clazz = classes[ j++ ] ) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+
+ // only assign if different to avoid unneeded rendering.
+ finalValue = jQuery.trim( cur );
+ if ( curValue !== finalValue ) {
+ jQuery.attr( elem, "class", finalValue );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, curValue, clazz, j, finalValue,
+ i = 0;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each( function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
+ } );
+ }
+
+ if ( !arguments.length ) {
+ return this.attr( "class", "" );
+ }
+
+ if ( typeof value === "string" && value ) {
+ classes = value.match( rnotwhite ) || [];
+
+ while ( ( elem = this[ i++ ] ) ) {
+ curValue = getClass( elem );
+
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 &&
+ ( " " + curValue + " " ).replace( rclass, " " );
+
+ if ( cur ) {
+ j = 0;
+ while ( ( clazz = classes[ j++ ] ) ) {
+
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+
+ // Only assign if different to avoid unneeded rendering.
+ finalValue = jQuery.trim( cur );
+ if ( curValue !== finalValue ) {
+ jQuery.attr( elem, "class", finalValue );
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each( function( i ) {
+ jQuery( this ).toggleClass(
+ value.call( this, i, getClass( this ), stateVal ),
+ stateVal
+ );
+ } );
+ }
+
+ return this.each( function() {
+ var className, i, self, classNames;
+
+ if ( type === "string" ) {
+
+ // Toggle individual class names
+ i = 0;
+ self = jQuery( this );
+ classNames = value.match( rnotwhite ) || [];
+
+ while ( ( className = classNames[ i++ ] ) ) {
+
+ // Check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( value === undefined || type === "boolean" ) {
+ className = getClass( this );
+ if ( className ) {
+
+ // store className if set
+ jQuery._data( this, "__className__", className );
+ }
+
+ // If the element has a class name or if we're passed "false",
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ jQuery.attr( this, "class",
+ className || value === false ?
+ "" :
+ jQuery._data( this, "__className__" ) || ""
+ );
+ }
+ } );
+ },
+
+ hasClass: function( selector ) {
+ var className, elem,
+ i = 0;
+
+ className = " " + selector + " ";
+ while ( ( elem = this[ i++ ] ) ) {
+ if ( elem.nodeType === 1 &&
+ ( " " + getClass( elem ) + " " ).replace( rclass, " " )
+ .indexOf( className ) > -1
+ ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+} );
+
+
+
+
+// Return jQuery for attributes-only inclusion
+
+
+jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu" ).split( " " ),
+ function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+} );
+
+jQuery.fn.extend( {
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ }
+} );
+
+
+var location = window.location;
+
+var nonce = jQuery.now();
+
+var rquery = ( /\?/ );
+
+
+
+var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
+
+jQuery.parseJSON = function( data ) {
+
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+
+ // Support: Android 2.3
+ // Workaround failure to string-cast null input
+ return window.JSON.parse( data + "" );
+ }
+
+ var requireNonComma,
+ depth = null,
+ str = jQuery.trim( data + "" );
+
+ // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
+ // after removing valid tokens
+ return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
+
+ // Force termination if we see a misplaced comma
+ if ( requireNonComma && comma ) {
+ depth = 0;
+ }
+
+ // Perform no more replacements after returning to outermost depth
+ if ( depth === 0 ) {
+ return token;
+ }
+
+ // Commas must not follow "[", "{", or ","
+ requireNonComma = open || comma;
+
+ // Determine new depth
+ // array/object open ("[" or "{"): depth += true - false (increment)
+ // array/object close ("]" or "}"): depth += false - true (decrement)
+ // other cases ("," or primitive): depth += true - true (numeric cast)
+ depth += !close - !open;
+
+ // Remove this token
+ return "";
+ } ) ) ?
+ ( Function( "return " + str ) )() :
+ jQuery.error( "Invalid JSON: " + data );
+};
+
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new window.DOMParser();
+ xml = tmp.parseFromString( data, "text/xml" );
+ } else { // IE
+ xml = new window.ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch ( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+};
+
+
+var
+ rhash = /#.*$/,
+ rts = /([?&])_=[^&]*/,
+
+ // IE leaves an \r character at EOL
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg,
+
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = "*/".concat( "*" ),
+
+ // Document location
+ ajaxLocation = location.href,
+
+ // Segment location into parts
+ ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType,
+ i = 0,
+ dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
+
+ if ( jQuery.isFunction( func ) ) {
+
+ // For each dataType in the dataTypeExpression
+ while ( ( dataType = dataTypes[ i++ ] ) ) {
+
+ // Prepend if requested
+ if ( dataType.charAt( 0 ) === "+" ) {
+ dataType = dataType.slice( 1 ) || "*";
+ ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
+
+ // Otherwise append
+ } else {
+ ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
+ }
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+ var inspected = {},
+ seekingTransport = ( structure === transports );
+
+ function inspect( dataType ) {
+ var selected;
+ inspected[ dataType ] = true;
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+ if ( typeof dataTypeOrTransport === "string" &&
+ !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+
+ options.dataTypes.unshift( dataTypeOrTransport );
+ inspect( dataTypeOrTransport );
+ return false;
+ } else if ( seekingTransport ) {
+ return !( selected = dataTypeOrTransport );
+ }
+ } );
+ return selected;
+ }
+
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var deep, key,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+
+ return target;
+}
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+ var firstDataType, ct, finalDataType, type,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while ( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return {
+ state: "parsererror",
+ error: conv ? e : "No conversion from " + prev + " to " + current
+ };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+
+jQuery.extend( {
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /\bxml\b/,
+ html: /\bhtml/,
+ json: /\bjson\b/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var
+
+ // Cross-domain detection vars
+ parts,
+
+ // Loop variable
+ i,
+
+ // URL without anti-cache param
+ cacheURL,
+
+ // Response headers as string
+ responseHeadersString,
+
+ // timeout handle
+ timeoutTimer,
+
+ // To know if global events are to be dispatched
+ fireGlobals,
+
+ transport,
+
+ // Response headers
+ responseHeaders,
+
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+
+ // Callbacks context
+ callbackContext = s.context || s,
+
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context &&
+ ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks( "once memory" ),
+
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+
+ // The jqXHR state
+ state = 0,
+
+ // Default abort message
+ strAbort = "canceled",
+
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
+ responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" )
+ .replace( rhash, "" )
+ .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
+ fireGlobals = jQuery.event && s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger( "ajaxStart" );
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
+
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + nonce++ ) :
+
+ // Otherwise add one to the end
+ cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
+ }
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
+ s.accepts[ s.dataTypes[ 0 ] ] +
+ ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend &&
+ ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+
+ // If request was aborted inside ajaxSend, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = window.setTimeout( function() {
+ jqXHR.abort( "timeout" );
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ window.clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader( "Last-Modified" );
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader( "etag" );
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger( "ajaxStop" );
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+} );
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ // The url can be an options object (which then must have .url)
+ return jQuery.ajax( jQuery.extend( {
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ }, jQuery.isPlainObject( url ) && url ) );
+ };
+} );
+
+
+jQuery._evalUrl = function( url ) {
+ return jQuery.ajax( {
+ url: url,
+
+ // Make this explicit, since user can override this through ajaxSetup (#11264)
+ type: "GET",
+ dataType: "script",
+ cache: true,
+ async: false,
+ global: false,
+ "throws": true
+ } );
+};
+
+
+jQuery.fn.extend( {
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each( function( i ) {
+ jQuery( this ).wrapAll( html.call( this, i ) );
+ } );
+ }
+
+ if ( this[ 0 ] ) {
+
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
+
+ if ( this[ 0 ].parentNode ) {
+ wrap.insertBefore( this[ 0 ] );
+ }
+
+ wrap.map( function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ } ).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each( function( i ) {
+ jQuery( this ).wrapInner( html.call( this, i ) );
+ } );
+ }
+
+ return this.each( function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ } );
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each( function( i ) {
+ jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
+ } );
+ },
+
+ unwrap: function() {
+ return this.parent().each( function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ } ).end();
+ }
+} );
+
+
+function getDisplay( elem ) {
+ return elem.style && elem.style.display || jQuery.css( elem, "display" );
+}
+
+function filterHidden( elem ) {
+ while ( elem && elem.nodeType === 1 ) {
+ if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) {
+ return true;
+ }
+ elem = elem.parentNode;
+ }
+ return false;
+}
+
+jQuery.expr.filters.hidden = function( elem ) {
+
+ // Support: Opera <= 12.12
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
+ return support.reliableHiddenOffsets() ?
+ ( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 &&
+ !elem.getClientRects().length ) :
+ filterHidden( elem );
+};
+
+jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+};
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
+
+ if ( jQuery.isArray( obj ) ) {
+
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+
+ // Item is non-scalar (array or object), encode its numeric index.
+ buildParams(
+ prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
+ v,
+ traditional,
+ add
+ );
+ }
+ } );
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// Serialize an array of form elements or a set of
+// key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, value ) {
+
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ } );
+
+ } else {
+
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+};
+
+jQuery.fn.extend( {
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map( function() {
+
+ // Can add propHook for "elements" to filter or add form elements
+ var elements = jQuery.prop( this, "elements" );
+ return elements ? jQuery.makeArray( elements ) : this;
+ } )
+ .filter( function() {
+ var type = this.type;
+
+ // Use .is(":disabled") so that fieldset[disabled] works
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+ ( this.checked || !rcheckableType.test( type ) );
+ } )
+ .map( function( i, elem ) {
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val ) {
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ } ) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ } ).get();
+ }
+} );
+
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
+
+ // Support: IE6-IE8
+ function() {
+
+ // XHR cannot access local files, always use ActiveX for that case
+ if ( this.isLocal ) {
+ return createActiveXHR();
+ }
+
+ // Support: IE 9-11
+ // IE seems to error on cross-domain PATCH requests when ActiveX XHR
+ // is used. In IE 9+ always use the native XHR.
+ // Note: this condition won't catch Edge as it doesn't define
+ // document.documentMode but it also doesn't support ActiveX so it won't
+ // reach this code.
+ if ( document.documentMode > 8 ) {
+ return createStandardXHR();
+ }
+
+ // Support: IE<9
+ // oldIE XHR does not support non-RFC2616 methods (#13240)
+ // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
+ // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
+ // Although this check for six methods instead of eight
+ // since IE also does not support "trace" and "connect"
+ return /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
+ createStandardXHR() || createActiveXHR();
+ } :
+
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+var xhrId = 0,
+ xhrCallbacks = {},
+ xhrSupported = jQuery.ajaxSettings.xhr();
+
+// Support: IE<10
+// Open requests must be manually aborted on unload (#5280)
+// See https://support.microsoft.com/kb/2856746 for more info
+if ( window.attachEvent ) {
+ window.attachEvent( "onunload", function() {
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( undefined, true );
+ }
+ } );
+}
+
+// Determine support properties
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+xhrSupported = support.ajax = !!xhrSupported;
+
+// Create transport if the browser can provide an xhr
+if ( xhrSupported ) {
+
+ jQuery.ajaxTransport( function( options ) {
+
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !options.crossDomain || support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+ var i,
+ xhr = options.xhr(),
+ id = ++xhrId;
+
+ // Open the socket
+ xhr.open(
+ options.type,
+ options.url,
+ options.async,
+ options.username,
+ options.password
+ );
+
+ // Apply custom fields if provided
+ if ( options.xhrFields ) {
+ for ( i in options.xhrFields ) {
+ xhr[ i ] = options.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( options.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( options.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
+ headers[ "X-Requested-With" ] = "XMLHttpRequest";
+ }
+
+ // Set headers
+ for ( i in headers ) {
+
+ // Support: IE<9
+ // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
+ // request header to a null-value.
+ //
+ // To keep consistent with other XHR implementations, cast the value
+ // to string and ignore `undefined`.
+ if ( headers[ i ] !== undefined ) {
+ xhr.setRequestHeader( i, headers[ i ] + "" );
+ }
+ }
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( options.hasContent && options.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+ var status, statusText, responses;
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+
+ // Clean up
+ delete xhrCallbacks[ id ];
+ callback = undefined;
+ xhr.onreadystatechange = jQuery.noop;
+
+ // Abort manually if needed
+ if ( isAbort ) {
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ responses = {};
+ status = xhr.status;
+
+ // Support: IE<10
+ // Accessing binary-data responseText throws an exception
+ // (#11426)
+ if ( typeof xhr.responseText === "string" ) {
+ responses.text = xhr.responseText;
+ }
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch ( e ) {
+
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && options.isLocal && !options.crossDomain ) {
+ status = responses.text ? 200 : 404;
+
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, xhr.getAllResponseHeaders() );
+ }
+ };
+
+ // Do send the request
+ // `xhr.send` may raise an exception, but it will be
+ // handled in jQuery.ajax (so no try/catch here)
+ if ( !options.async ) {
+
+ // If we're in sync mode we fire the callback
+ callback();
+ } else if ( xhr.readyState === 4 ) {
+
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ window.setTimeout( callback );
+ } else {
+
+ // Register the callback, but delay it in case `xhr.send` throws
+ // Add to the list of active xhr callbacks
+ xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback( undefined, true );
+ }
+ }
+ };
+ }
+ } );
+}
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch ( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch ( e ) {}
+}
+
+
+
+
+// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
+jQuery.ajaxPrefilter( function( s ) {
+ if ( s.crossDomain ) {
+ s.contents.script = false;
+ }
+} );
+
+// Install script dataType
+jQuery.ajaxSetup( {
+ accepts: {
+ script: "text/javascript, application/javascript, " +
+ "application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /\b(?:java|ecma)script\b/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+} );
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+} );
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function( s ) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || jQuery( "head" )[ 0 ] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement( "script" );
+
+ script.async = true;
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( script.parentNode ) {
+ script.parentNode.removeChild( script );
+ }
+
+ // Dereference the script
+ script = null;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( undefined, true );
+ }
+ }
+ };
+ }
+} );
+
+
+
+
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup( {
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+} );
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" &&
+ ( s.contentType || "" )
+ .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
+ rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters[ "script json" ] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always( function() {
+
+ // If previous value didn't exist - remove it
+ if ( overwritten === undefined ) {
+ jQuery( window ).removeProp( callbackName );
+
+ // Otherwise restore preexisting value
+ } else {
+ window[ callbackName ] = overwritten;
+ }
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ } );
+
+ // Delegate to script
+ return "script";
+ }
+} );
+
+
+
+
+// Support: Safari 8+
+// In Safari 8 documents created via document.implementation.createHTMLDocument
+// collapse sibling forms: the second one becomes a child of the first one.
+// Because of that, this security measure has to be disabled in Safari 8.
+// https://bugs.webkit.org/show_bug.cgi?id=137337
+support.createHTMLDocument = ( function() {
+ if ( !document.implementation.createHTMLDocument ) {
+ return false;
+ }
+ var doc = document.implementation.createHTMLDocument( "" );
+ doc.body.innerHTML = "<form></form><form></form>";
+ return doc.body.childNodes.length === 2;
+} )();
+
+
+// data: string of html
+// context (optional): If specified, the fragment will be created in this context,
+// defaults to document
+// keepScripts (optional): If true, will include scripts passed in the html string
+jQuery.parseHTML = function( data, context, keepScripts ) {
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+
+ // document.implementation stops scripts or inline event handlers from
+ // being executed immediately
+ context = context || ( support.createHTMLDocument ?
+ document.implementation.createHTMLDocument( "" ) :
+ document );
+
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[ 1 ] ) ];
+ }
+
+ parsed = buildFragment( [ data ], context, scripts );
+
+ if ( scripts && scripts.length ) {
+ jQuery( scripts ).remove();
+ }
+
+ return jQuery.merge( [], parsed.childNodes );
+};
+
+
+// Keep a copy of the old load method
+var _load = jQuery.fn.load;
+
+/**
+ * Load a url into a page
+ */
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
+
+ var selector, type, response,
+ self = this,
+ off = url.indexOf( " " );
+
+ if ( off > -1 ) {
+ selector = jQuery.trim( url.slice( off, url.length ) );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // If we have elements to modify, make the request
+ if ( self.length > 0 ) {
+ jQuery.ajax( {
+ url: url,
+
+ // If "type" variable is undefined, then "GET" method will be used.
+ // Make value of this field explicit since
+ // user can override it through ajaxSetup method
+ type: type || "GET",
+ dataType: "html",
+ data: params
+ } ).done( function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ self.html( selector ?
+
+ // If a selector was specified, locate the right elements in a dummy div
+ // Exclude scripts to avoid IE 'Permission Denied' errors
+ jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ // If the request succeeds, this function gets "data", "status", "jqXHR"
+ // but they are ignored because response was set above.
+ // If it fails, this function gets "jqXHR", "status", "error"
+ } ).always( callback && function( jqXHR, status ) {
+ self.each( function() {
+ callback.apply( self, response || [ jqXHR.responseText, status, jqXHR ] );
+ } );
+ } );
+ }
+
+ return this;
+};
+
+
+
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [
+ "ajaxStart",
+ "ajaxStop",
+ "ajaxComplete",
+ "ajaxError",
+ "ajaxSuccess",
+ "ajaxSend"
+], function( i, type ) {
+ jQuery.fn[ type ] = function( fn ) {
+ return this.on( type, fn );
+ };
+} );
+
+
+
+
+jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep( jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ } ).length;
+};
+
+
+
+
+
+/**
+ * Gets a window from an element
+ */
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+jQuery.offset = {
+ setOffset: function( elem, options, i ) {
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
+ position = jQuery.css( elem, "position" ),
+ curElem = jQuery( elem ),
+ props = {};
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ curOffset = curElem.offset();
+ curCSSTop = jQuery.css( elem, "top" );
+ curCSSLeft = jQuery.css( elem, "left" );
+ calculatePosition = ( position === "absolute" || position === "fixed" ) &&
+ jQuery.inArray( "auto", [ curCSSTop, curCSSLeft ] ) > -1;
+
+ // need to be able to calculate position if either top or left
+ // is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+
+ // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
+ options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+jQuery.fn.extend( {
+ offset: function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each( function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ } );
+ }
+
+ var docElem, win,
+ box = { top: 0, left: 0 },
+ elem = this[ 0 ],
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return;
+ }
+
+ docElem = doc.documentElement;
+
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
+
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== "undefined" ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ return {
+ top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
+ left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+ };
+ },
+
+ position: function() {
+ if ( !this[ 0 ] ) {
+ return;
+ }
+
+ var offsetParent, offset,
+ parentOffset = { top: 0, left: 0 },
+ elem = this[ 0 ];
+
+ // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
+ // because it is its only offset parent
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
+
+ // we assume that getBoundingClientRect is available when computed position is fixed
+ offset = elem.getBoundingClientRect();
+ } else {
+
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent();
+
+ // Get correct offsets
+ offset = this.offset();
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+ parentOffset = offsetParent.offset();
+ }
+
+ // Add offsetParent borders
+ // Subtract offsetParent scroll positions
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ) -
+ offsetParent.scrollTop();
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ) -
+ offsetParent.scrollLeft();
+ }
+
+ // Subtract parent offsets and element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ return {
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
+ };
+ },
+
+ offsetParent: function() {
+ return this.map( function() {
+ var offsetParent = this.offsetParent;
+
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) &&
+ jQuery.css( offsetParent, "position" ) === "static" ) ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent || documentElement;
+ } );
+ }
+} );
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
+ var top = /Y/.test( prop );
+
+ jQuery.fn[ method ] = function( val ) {
+ return access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? ( prop in win ) ? win[ prop ] :
+ win.document.documentElement[ method ] :
+ elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : jQuery( win ).scrollLeft(),
+ top ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+} );
+
+// Support: Safari<7-8+, Chrome<37-44+
+// Add the top/left cssHooks using jQuery.fn.position
+// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+// getComputedStyle returns percent when specified for top/left/bottom/right
+// rather than make the css module depend on the offset module, we just check for it here
+jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
+ function( elem, computed ) {
+ if ( computed ) {
+ computed = curCSS( elem, prop );
+
+ // if curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( computed ) ?
+ jQuery( elem ).position()[ prop ] + "px" :
+ computed;
+ }
+ }
+ );
+} );
+
+
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
+ function( defaultExtra, funcName ) {
+
+ // margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
+ // whichever is greatest
+ // unfortunately, this causes bug #3838 in IE6/8 only,
+ // but there is currently no good, small way to fix it.
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ } );
+} );
+
+
+jQuery.fn.extend( {
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length === 1 ?
+ this.off( selector, "**" ) :
+ this.off( types, selector || "**", fn );
+ }
+} );
+
+// The number of elements contained in the matched element set
+jQuery.fn.size = function() {
+ return this.length;
+};
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+
+
+
+// Register as a named AMD module, since jQuery can be concatenated with other
+// files that may use define, but not via a proper concatenation script that
+// understands anonymous AMD modules. A named AMD is safest and most robust
+// way to register. Lowercase jquery is used because AMD module names are
+// derived from file names, and jQuery is normally delivered in a lowercase
+// file name. Do this after creating the global so that if an AMD module wants
+// to call noConflict to hide this version of jQuery, it will work.
+
+// Note that for maximum portability, libraries that are not jQuery should
+// declare themselves as anonymous modules, and avoid setting a global if an
+// AMD loader is present. jQuery is a special case. For more information, see
+// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
+
+if ( typeof define === "function" && define.amd ) {
+ define( "jquery", [], function() {
+ return jQuery;
+ } );
+}
+
+
+
+var
+
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$;
+
+jQuery.noConflict = function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+};
+
+// Expose jQuery and $ identifiers, even in
+// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
+// and CommonJS for browser emulators (#13566)
+if ( !noGlobal ) {
+ window.jQuery = window.$ = jQuery;
+}
+
+return jQuery;
+}));
diff --git a/src_js/moment.js b/src_js/moment.js
new file mode 100644
index 0000000..c003e95
--- /dev/null
+++ b/src_js/moment.js
@@ -0,0 +1,3606 @@
+//! moment.js
+//! version : 2.11.1
+//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+//! license : MIT
+//! momentjs.com
+
+;(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ global.moment = factory()
+}(this, function () { 'use strict';
+
+ var hookCallback;
+
+ function utils_hooks__hooks () {
+ return hookCallback.apply(null, arguments);
+ }
+
+ // This is done to register the method called with moment()
+ // without creating circular dependencies.
+ function setHookCallback (callback) {
+ hookCallback = callback;
+ }
+
+ function isArray(input) {
+ return Object.prototype.toString.call(input) === '[object Array]';
+ }
+
+ function isDate(input) {
+ return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]';
+ }
+
+ function map(arr, fn) {
+ var res = [], i;
+ for (i = 0; i < arr.length; ++i) {
+ res.push(fn(arr[i], i));
+ }
+ return res;
+ }
+
+ function hasOwnProp(a, b) {
+ return Object.prototype.hasOwnProperty.call(a, b);
+ }
+
+ function extend(a, b) {
+ for (var i in b) {
+ if (hasOwnProp(b, i)) {
+ a[i] = b[i];
+ }
+ }
+
+ if (hasOwnProp(b, 'toString')) {
+ a.toString = b.toString;
+ }
+
+ if (hasOwnProp(b, 'valueOf')) {
+ a.valueOf = b.valueOf;
+ }
+
+ return a;
+ }
+
+ function create_utc__createUTC (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, true).utc();
+ }
+
+ function defaultParsingFlags() {
+ // We need to deep clone this object.
+ return {
+ empty : false,
+ unusedTokens : [],
+ unusedInput : [],
+ overflow : -2,
+ charsLeftOver : 0,
+ nullInput : false,
+ invalidMonth : null,
+ invalidFormat : false,
+ userInvalidated : false,
+ iso : false
+ };
+ }
+
+ function getParsingFlags(m) {
+ if (m._pf == null) {
+ m._pf = defaultParsingFlags();
+ }
+ return m._pf;
+ }
+
+ function valid__isValid(m) {
+ if (m._isValid == null) {
+ var flags = getParsingFlags(m);
+ m._isValid = !isNaN(m._d.getTime()) &&
+ flags.overflow < 0 &&
+ !flags.empty &&
+ !flags.invalidMonth &&
+ !flags.invalidWeekday &&
+ !flags.nullInput &&
+ !flags.invalidFormat &&
+ !flags.userInvalidated;
+
+ if (m._strict) {
+ m._isValid = m._isValid &&
+ flags.charsLeftOver === 0 &&
+ flags.unusedTokens.length === 0 &&
+ flags.bigHour === undefined;
+ }
+ }
+ return m._isValid;
+ }
+
+ function valid__createInvalid (flags) {
+ var m = create_utc__createUTC(NaN);
+ if (flags != null) {
+ extend(getParsingFlags(m), flags);
+ }
+ else {
+ getParsingFlags(m).userInvalidated = true;
+ }
+
+ return m;
+ }
+
+ function isUndefined(input) {
+ return input === void 0;
+ }
+
+ // Plugins that add properties should also add the key here (null value),
+ // so we can properly clone ourselves.
+ var momentProperties = utils_hooks__hooks.momentProperties = [];
+
+ function copyConfig(to, from) {
+ var i, prop, val;
+
+ if (!isUndefined(from._isAMomentObject)) {
+ to._isAMomentObject = from._isAMomentObject;
+ }
+ if (!isUndefined(from._i)) {
+ to._i = from._i;
+ }
+ if (!isUndefined(from._f)) {
+ to._f = from._f;
+ }
+ if (!isUndefined(from._l)) {
+ to._l = from._l;
+ }
+ if (!isUndefined(from._strict)) {
+ to._strict = from._strict;
+ }
+ if (!isUndefined(from._tzm)) {
+ to._tzm = from._tzm;
+ }
+ if (!isUndefined(from._isUTC)) {
+ to._isUTC = from._isUTC;
+ }
+ if (!isUndefined(from._offset)) {
+ to._offset = from._offset;
+ }
+ if (!isUndefined(from._pf)) {
+ to._pf = getParsingFlags(from);
+ }
+ if (!isUndefined(from._locale)) {
+ to._locale = from._locale;
+ }
+
+ if (momentProperties.length > 0) {
+ for (i in momentProperties) {
+ prop = momentProperties[i];
+ val = from[prop];
+ if (!isUndefined(val)) {
+ to[prop] = val;
+ }
+ }
+ }
+
+ return to;
+ }
+
+ var updateInProgress = false;
+
+ // Moment prototype object
+ function Moment(config) {
+ copyConfig(this, config);
+ this._d = new Date(config._d != null ? config._d.getTime() : NaN);
+ // Prevent infinite loop in case updateOffset creates new moment
+ // objects.
+ if (updateInProgress === false) {
+ updateInProgress = true;
+ utils_hooks__hooks.updateOffset(this);
+ updateInProgress = false;
+ }
+ }
+
+ function isMoment (obj) {
+ return obj instanceof Moment || (obj != null && obj._isAMomentObject != null);
+ }
+
+ function absFloor (number) {
+ if (number < 0) {
+ return Math.ceil(number);
+ } else {
+ return Math.floor(number);
+ }
+ }
+
+ function toInt(argumentForCoercion) {
+ var coercedNumber = +argumentForCoercion,
+ value = 0;
+
+ if (coercedNumber !== 0 && isFinite(coercedNumber)) {
+ value = absFloor(coercedNumber);
+ }
+
+ return value;
+ }
+
+ // compare two arrays, return the number of differences
+ function compareArrays(array1, array2, dontConvert) {
+ var len = Math.min(array1.length, array2.length),
+ lengthDiff = Math.abs(array1.length - array2.length),
+ diffs = 0,
+ i;
+ for (i = 0; i < len; i++) {
+ if ((dontConvert && array1[i] !== array2[i]) ||
+ (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
+ diffs++;
+ }
+ }
+ return diffs + lengthDiff;
+ }
+
+ function Locale() {
+ }
+
+ // internal storage for locale config files
+ var locales = {};
+ var globalLocale;
+
+ function normalizeLocale(key) {
+ return key ? key.toLowerCase().replace('_', '-') : key;
+ }
+
+ // pick the locale from the array
+ // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
+ // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
+ function chooseLocale(names) {
+ var i = 0, j, next, locale, split;
+
+ while (i < names.length) {
+ split = normalizeLocale(names[i]).split('-');
+ j = split.length;
+ next = normalizeLocale(names[i + 1]);
+ next = next ? next.split('-') : null;
+ while (j > 0) {
+ locale = loadLocale(split.slice(0, j).join('-'));
+ if (locale) {
+ return locale;
+ }
+ if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
+ //the next array item is better than a shallower substring of this one
+ break;
+ }
+ j--;
+ }
+ i++;
+ }
+ return null;
+ }
+
+ function loadLocale(name) {
+ var oldLocale = null;
+ // TODO: Find a better way to register and load all the locales in Node
+ if (!locales[name] && (typeof module !== 'undefined') &&
+ module && module.exports) {
+ try {
+ oldLocale = globalLocale._abbr;
+ require('./locale/' + name);
+ // because defineLocale currently also sets the global locale, we
+ // want to undo that for lazy loaded locales
+ locale_locales__getSetGlobalLocale(oldLocale);
+ } catch (e) { }
+ }
+ return locales[name];
+ }
+
+ // This function will load locale and then set the global locale. If
+ // no arguments are passed in, it will simply return the current global
+ // locale key.
+ function locale_locales__getSetGlobalLocale (key, values) {
+ var data;
+ if (key) {
+ if (isUndefined(values)) {
+ data = locale_locales__getLocale(key);
+ }
+ else {
+ data = defineLocale(key, values);
+ }
+
+ if (data) {
+ // moment.duration._locale = moment._locale = data;
+ globalLocale = data;
+ }
+ }
+
+ return globalLocale._abbr;
+ }
+
+ function defineLocale (name, values) {
+ if (values !== null) {
+ values.abbr = name;
+ locales[name] = locales[name] || new Locale();
+ locales[name].set(values);
+
+ // backwards compat for now: also set the locale
+ locale_locales__getSetGlobalLocale(name);
+
+ return locales[name];
+ } else {
+ // useful for testing
+ delete locales[name];
+ return null;
+ }
+ }
+
+ // returns locale data
+ function locale_locales__getLocale (key) {
+ var locale;
+
+ if (key && key._locale && key._locale._abbr) {
+ key = key._locale._abbr;
+ }
+
+ if (!key) {
+ return globalLocale;
+ }
+
+ if (!isArray(key)) {
+ //short-circuit everything else
+ locale = loadLocale(key);
+ if (locale) {
+ return locale;
+ }
+ key = [key];
+ }
+
+ return chooseLocale(key);
+ }
+
+ var aliases = {};
+
+ function addUnitAlias (unit, shorthand) {
+ var lowerCase = unit.toLowerCase();
+ aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
+ }
+
+ function normalizeUnits(units) {
+ return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined;
+ }
+
+ function normalizeObjectUnits(inputObject) {
+ var normalizedInput = {},
+ normalizedProp,
+ prop;
+
+ for (prop in inputObject) {
+ if (hasOwnProp(inputObject, prop)) {
+ normalizedProp = normalizeUnits(prop);
+ if (normalizedProp) {
+ normalizedInput[normalizedProp] = inputObject[prop];
+ }
+ }
+ }
+
+ return normalizedInput;
+ }
+
+ function isFunction(input) {
+ return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]';
+ }
+
+ function makeGetSet (unit, keepTime) {
+ return function (value) {
+ if (value != null) {
+ get_set__set(this, unit, value);
+ utils_hooks__hooks.updateOffset(this, keepTime);
+ return this;
+ } else {
+ return get_set__get(this, unit);
+ }
+ };
+ }
+
+ function get_set__get (mom, unit) {
+ return mom.isValid() ?
+ mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN;
+ }
+
+ function get_set__set (mom, unit, value) {
+ if (mom.isValid()) {
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
+ }
+ }
+
+ // MOMENTS
+
+ function getSet (units, value) {
+ var unit;
+ if (typeof units === 'object') {
+ for (unit in units) {
+ this.set(unit, units[unit]);
+ }
+ } else {
+ units = normalizeUnits(units);
+ if (isFunction(this[units])) {
+ return this[units](value);
+ }
+ }
+ return this;
+ }
+
+ function zeroFill(number, targetLength, forceSign) {
+ var absNumber = '' + Math.abs(number),
+ zerosToFill = targetLength - absNumber.length,
+ sign = number >= 0;
+ return (sign ? (forceSign ? '+' : '') : '-') +
+ Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
+ }
+
+ var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
+
+ var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
+
+ var formatFunctions = {};
+
+ var formatTokenFunctions = {};
+
+ // token: 'M'
+ // padded: ['MM', 2]
+ // ordinal: 'Mo'
+ // callback: function () { this.month() + 1 }
+ function addFormatToken (token, padded, ordinal, callback) {
+ var func = callback;
+ if (typeof callback === 'string') {
+ func = function () {
+ return this[callback]();
+ };
+ }
+ if (token) {
+ formatTokenFunctions[token] = func;
+ }
+ if (padded) {
+ formatTokenFunctions[padded[0]] = function () {
+ return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
+ };
+ }
+ if (ordinal) {
+ formatTokenFunctions[ordinal] = function () {
+ return this.localeData().ordinal(func.apply(this, arguments), token);
+ };
+ }
+ }
+
+ function removeFormattingTokens(input) {
+ if (input.match(/\[[\s\S]/)) {
+ return input.replace(/^\[|\]$/g, '');
+ }
+ return input.replace(/\\/g, '');
+ }
+
+ function makeFormatFunction(format) {
+ var array = format.match(formattingTokens), i, length;
+
+ for (i = 0, length = array.length; i < length; i++) {
+ if (formatTokenFunctions[array[i]]) {
+ array[i] = formatTokenFunctions[array[i]];
+ } else {
+ array[i] = removeFormattingTokens(array[i]);
+ }
+ }
+
+ return function (mom) {
+ var output = '';
+ for (i = 0; i < length; i++) {
+ output += array[i] instanceof Function ? array[i].call(mom, format) : array[i];
+ }
+ return output;
+ };
+ }
+
+ // format date using native date object
+ function formatMoment(m, format) {
+ if (!m.isValid()) {
+ return m.localeData().invalidDate();
+ }
+
+ format = expandFormat(format, m.localeData());
+ formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
+
+ return formatFunctions[format](m);
+ }
+
+ function expandFormat(format, locale) {
+ var i = 5;
+
+ function replaceLongDateFormatTokens(input) {
+ return locale.longDateFormat(input) || input;
+ }
+
+ localFormattingTokens.lastIndex = 0;
+ while (i >= 0 && localFormattingTokens.test(format)) {
+ format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
+ localFormattingTokens.lastIndex = 0;
+ i -= 1;
+ }
+
+ return format;
+ }
+
+ var match1 = /\d/; // 0 - 9
+ var match2 = /\d\d/; // 00 - 99
+ var match3 = /\d{3}/; // 000 - 999
+ var match4 = /\d{4}/; // 0000 - 9999
+ var match6 = /[+-]?\d{6}/; // -999999 - 999999
+ var match1to2 = /\d\d?/; // 0 - 99
+ var match3to4 = /\d\d\d\d?/; // 999 - 9999
+ var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999
+ var match1to3 = /\d{1,3}/; // 0 - 999
+ var match1to4 = /\d{1,4}/; // 0 - 9999
+ var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999
+
+ var matchUnsigned = /\d+/; // 0 - inf
+ var matchSigned = /[+-]?\d+/; // -inf - inf
+
+ var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z
+ var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z
+
+ var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123
+
+ // any word (or two) characters or numbers including two/three word month in arabic.
+ // includes scottish gaelic two word and hyphenated months
+ var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i;
+
+
+ var regexes = {};
+
+ function addRegexToken (token, regex, strictRegex) {
+ regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) {
+ return (isStrict && strictRegex) ? strictRegex : regex;
+ };
+ }
+
+ function getParseRegexForToken (token, config) {
+ if (!hasOwnProp(regexes, token)) {
+ return new RegExp(unescapeFormat(token));
+ }
+
+ return regexes[token](config._strict, config._locale);
+ }
+
+ // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
+ function unescapeFormat(s) {
+ return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) {
+ return p1 || p2 || p3 || p4;
+ }));
+ }
+
+ function regexEscape(s) {
+ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
+ }
+
+ var tokens = {};
+
+ function addParseToken (token, callback) {
+ var i, func = callback;
+ if (typeof token === 'string') {
+ token = [token];
+ }
+ if (typeof callback === 'number') {
+ func = function (input, array) {
+ array[callback] = toInt(input);
+ };
+ }
+ for (i = 0; i < token.length; i++) {
+ tokens[token[i]] = func;
+ }
+ }
+
+ function addWeekParseToken (token, callback) {
+ addParseToken(token, function (input, array, config, token) {
+ config._w = config._w || {};
+ callback(input, config._w, config, token);
+ });
+ }
+
+ function addTimeToArrayFromToken(token, input, config) {
+ if (input != null && hasOwnProp(tokens, token)) {
+ tokens[token](input, config._a, config, token);
+ }
+ }
+
+ var YEAR = 0;
+ var MONTH = 1;
+ var DATE = 2;
+ var HOUR = 3;
+ var MINUTE = 4;
+ var SECOND = 5;
+ var MILLISECOND = 6;
+ var WEEK = 7;
+ var WEEKDAY = 8;
+
+ function daysInMonth(year, month) {
+ return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();
+ }
+
+ // FORMATTING
+
+ addFormatToken('M', ['MM', 2], 'Mo', function () {
+ return this.month() + 1;
+ });
+
+ addFormatToken('MMM', 0, 0, function (format) {
+ return this.localeData().monthsShort(this, format);
+ });
+
+ addFormatToken('MMMM', 0, 0, function (format) {
+ return this.localeData().months(this, format);
+ });
+
+ // ALIASES
+
+ addUnitAlias('month', 'M');
+
+ // PARSING
+
+ addRegexToken('M', match1to2);
+ addRegexToken('MM', match1to2, match2);
+ addRegexToken('MMM', function (isStrict, locale) {
+ return locale.monthsShortRegex(isStrict);
+ });
+ addRegexToken('MMMM', function (isStrict, locale) {
+ return locale.monthsRegex(isStrict);
+ });
+
+ addParseToken(['M', 'MM'], function (input, array) {
+ array[MONTH] = toInt(input) - 1;
+ });
+
+ addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
+ var month = config._locale.monthsParse(input, token, config._strict);
+ // if we didn't find a month name, mark the date as invalid.
+ if (month != null) {
+ array[MONTH] = month;
+ } else {
+ getParsingFlags(config).invalidMonth = input;
+ }
+ });
+
+ // LOCALES
+
+ var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/;
+ var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
+ function localeMonths (m, format) {
+ return isArray(this._months) ? this._months[m.month()] :
+ this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
+ }
+
+ var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
+ function localeMonthsShort (m, format) {
+ return isArray(this._monthsShort) ? this._monthsShort[m.month()] :
+ this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()];
+ }
+
+ function localeMonthsParse (monthName, format, strict) {
+ var i, mom, regex;
+
+ if (!this._monthsParse) {
+ this._monthsParse = [];
+ this._longMonthsParse = [];
+ this._shortMonthsParse = [];
+ }
+
+ for (i = 0; i < 12; i++) {
+ // make the regex if we don't have it already
+ mom = create_utc__createUTC([2000, i]);
+ if (strict && !this._longMonthsParse[i]) {
+ this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i');
+ this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i');
+ }
+ if (!strict && !this._monthsParse[i]) {
+ regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
+ this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) {
+ return i;
+ } else if (!strict && this._monthsParse[i].test(monthName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function setMonth (mom, value) {
+ var dayOfMonth;
+
+ if (!mom.isValid()) {
+ // No op
+ return mom;
+ }
+
+ // TODO: Move this out of here!
+ if (typeof value === 'string') {
+ value = mom.localeData().monthsParse(value);
+ // TODO: Another silent failure?
+ if (typeof value !== 'number') {
+ return mom;
+ }
+ }
+
+ dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
+ mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
+ return mom;
+ }
+
+ function getSetMonth (value) {
+ if (value != null) {
+ setMonth(this, value);
+ utils_hooks__hooks.updateOffset(this, true);
+ return this;
+ } else {
+ return get_set__get(this, 'Month');
+ }
+ }
+
+ function getDaysInMonth () {
+ return daysInMonth(this.year(), this.month());
+ }
+
+ var defaultMonthsShortRegex = matchWord;
+ function monthsShortRegex (isStrict) {
+ if (this._monthsParseExact) {
+ if (!hasOwnProp(this, '_monthsRegex')) {
+ computeMonthsParse.call(this);
+ }
+ if (isStrict) {
+ return this._monthsShortStrictRegex;
+ } else {
+ return this._monthsShortRegex;
+ }
+ } else {
+ return this._monthsShortStrictRegex && isStrict ?
+ this._monthsShortStrictRegex : this._monthsShortRegex;
+ }
+ }
+
+ var defaultMonthsRegex = matchWord;
+ function monthsRegex (isStrict) {
+ if (this._monthsParseExact) {
+ if (!hasOwnProp(this, '_monthsRegex')) {
+ computeMonthsParse.call(this);
+ }
+ if (isStrict) {
+ return this._monthsStrictRegex;
+ } else {
+ return this._monthsRegex;
+ }
+ } else {
+ return this._monthsStrictRegex && isStrict ?
+ this._monthsStrictRegex : this._monthsRegex;
+ }
+ }
+
+ function computeMonthsParse () {
+ function cmpLenRev(a, b) {
+ return b.length - a.length;
+ }
+
+ var shortPieces = [], longPieces = [], mixedPieces = [],
+ i, mom;
+ for (i = 0; i < 12; i++) {
+ // make the regex if we don't have it already
+ mom = create_utc__createUTC([2000, i]);
+ shortPieces.push(this.monthsShort(mom, ''));
+ longPieces.push(this.months(mom, ''));
+ mixedPieces.push(this.months(mom, ''));
+ mixedPieces.push(this.monthsShort(mom, ''));
+ }
+ // Sorting makes sure if one month (or abbr) is a prefix of another it
+ // will match the longer piece.
+ shortPieces.sort(cmpLenRev);
+ longPieces.sort(cmpLenRev);
+ mixedPieces.sort(cmpLenRev);
+ for (i = 0; i < 12; i++) {
+ shortPieces[i] = regexEscape(shortPieces[i]);
+ longPieces[i] = regexEscape(longPieces[i]);
+ mixedPieces[i] = regexEscape(mixedPieces[i]);
+ }
+
+ this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
+ this._monthsShortRegex = this._monthsRegex;
+ this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')$', 'i');
+ this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')$', 'i');
+ }
+
+ function checkOverflow (m) {
+ var overflow;
+ var a = m._a;
+
+ if (a && getParsingFlags(m).overflow === -2) {
+ overflow =
+ a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
+ a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
+ a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
+ a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
+ a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
+ a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
+ -1;
+
+ if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
+ overflow = DATE;
+ }
+ if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
+ overflow = WEEK;
+ }
+ if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
+ overflow = WEEKDAY;
+ }
+
+ getParsingFlags(m).overflow = overflow;
+ }
+
+ return m;
+ }
+
+ function warn(msg) {
+ if (utils_hooks__hooks.suppressDeprecationWarnings === false &&
+ (typeof console !== 'undefined') && console.warn) {
+ console.warn('Deprecation warning: ' + msg);
+ }
+ }
+
+ function deprecate(msg, fn) {
+ var firstTime = true;
+
+ return extend(function () {
+ if (firstTime) {
+ warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack);
+ firstTime = false;
+ }
+ return fn.apply(this, arguments);
+ }, fn);
+ }
+
+ var deprecations = {};
+
+ function deprecateSimple(name, msg) {
+ if (!deprecations[name]) {
+ warn(msg);
+ deprecations[name] = true;
+ }
+ }
+
+ utils_hooks__hooks.suppressDeprecationWarnings = false;
+
+ // iso 8601 regex
+ // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
+ var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
+ var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/;
+
+ var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
+
+ var isoDates = [
+ ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
+ ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
+ ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
+ ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
+ ['YYYY-DDD', /\d{4}-\d{3}/],
+ ['YYYY-MM', /\d{4}-\d\d/, false],
+ ['YYYYYYMMDD', /[+-]\d{10}/],
+ ['YYYYMMDD', /\d{8}/],
+ // YYYYMM is NOT allowed by the standard
+ ['GGGG[W]WWE', /\d{4}W\d{3}/],
+ ['GGGG[W]WW', /\d{4}W\d{2}/, false],
+ ['YYYYDDD', /\d{7}/]
+ ];
+
+ // iso time formats and regexes
+ var isoTimes = [
+ ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
+ ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
+ ['HH:mm:ss', /\d\d:\d\d:\d\d/],
+ ['HH:mm', /\d\d:\d\d/],
+ ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
+ ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
+ ['HHmmss', /\d\d\d\d\d\d/],
+ ['HHmm', /\d\d\d\d/],
+ ['HH', /\d\d/]
+ ];
+
+ var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
+
+ // date from iso format
+ function configFromISO(config) {
+ var i, l,
+ string = config._i,
+ match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
+ allowTime, dateFormat, timeFormat, tzFormat;
+
+ if (match) {
+ getParsingFlags(config).iso = true;
+
+ for (i = 0, l = isoDates.length; i < l; i++) {
+ if (isoDates[i][1].exec(match[1])) {
+ dateFormat = isoDates[i][0];
+ allowTime = isoDates[i][2] !== false;
+ break;
+ }
+ }
+ if (dateFormat == null) {
+ config._isValid = false;
+ return;
+ }
+ if (match[3]) {
+ for (i = 0, l = isoTimes.length; i < l; i++) {
+ if (isoTimes[i][1].exec(match[3])) {
+ // match[2] should be 'T' or space
+ timeFormat = (match[2] || ' ') + isoTimes[i][0];
+ break;
+ }
+ }
+ if (timeFormat == null) {
+ config._isValid = false;
+ return;
+ }
+ }
+ if (!allowTime && timeFormat != null) {
+ config._isValid = false;
+ return;
+ }
+ if (match[4]) {
+ if (tzRegex.exec(match[4])) {
+ tzFormat = 'Z';
+ } else {
+ config._isValid = false;
+ return;
+ }
+ }
+ config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
+ configFromStringAndFormat(config);
+ } else {
+ config._isValid = false;
+ }
+ }
+
+ // date from iso format or fallback
+ function configFromString(config) {
+ var matched = aspNetJsonRegex.exec(config._i);
+
+ if (matched !== null) {
+ config._d = new Date(+matched[1]);
+ return;
+ }
+
+ configFromISO(config);
+ if (config._isValid === false) {
+ delete config._isValid;
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ utils_hooks__hooks.createFromInputFallback = deprecate(
+ 'moment construction falls back to js Date. This is ' +
+ 'discouraged and will be removed in upcoming major ' +
+ 'release. Please refer to ' +
+ 'https://github.com/moment/moment/issues/1407 for more info.',
+ function (config) {
+ config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
+ }
+ );
+
+ function createDate (y, m, d, h, M, s, ms) {
+ //can't just apply() to create a date:
+ //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply
+ var date = new Date(y, m, d, h, M, s, ms);
+
+ //the date constructor remaps years 0-99 to 1900-1999
+ if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
+ date.setFullYear(y);
+ }
+ return date;
+ }
+
+ function createUTCDate (y) {
+ var date = new Date(Date.UTC.apply(null, arguments));
+
+ //the Date.UTC function remaps years 0-99 to 1900-1999
+ if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
+ date.setUTCFullYear(y);
+ }
+ return date;
+ }
+
+ // FORMATTING
+
+ addFormatToken('Y', 0, 0, function () {
+ var y = this.year();
+ return y <= 9999 ? '' + y : '+' + y;
+ });
+
+ addFormatToken(0, ['YY', 2], 0, function () {
+ return this.year() % 100;
+ });
+
+ addFormatToken(0, ['YYYY', 4], 0, 'year');
+ addFormatToken(0, ['YYYYY', 5], 0, 'year');
+ addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
+
+ // ALIASES
+
+ addUnitAlias('year', 'y');
+
+ // PARSING
+
+ addRegexToken('Y', matchSigned);
+ addRegexToken('YY', match1to2, match2);
+ addRegexToken('YYYY', match1to4, match4);
+ addRegexToken('YYYYY', match1to6, match6);
+ addRegexToken('YYYYYY', match1to6, match6);
+
+ addParseToken(['YYYYY', 'YYYYYY'], YEAR);
+ addParseToken('YYYY', function (input, array) {
+ array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input);
+ });
+ addParseToken('YY', function (input, array) {
+ array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+ addParseToken('Y', function (input, array) {
+ array[YEAR] = parseInt(input, 10);
+ });
+
+ // HELPERS
+
+ function daysInYear(year) {
+ return isLeapYear(year) ? 366 : 365;
+ }
+
+ function isLeapYear(year) {
+ return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
+ }
+
+ // HOOKS
+
+ utils_hooks__hooks.parseTwoDigitYear = function (input) {
+ return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
+ };
+
+ // MOMENTS
+
+ var getSetYear = makeGetSet('FullYear', false);
+
+ function getIsLeapYear () {
+ return isLeapYear(this.year());
+ }
+
+ // start-of-first-week - start-of-year
+ function firstWeekOffset(year, dow, doy) {
+ var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
+ fwd = 7 + dow - doy,
+ // first-week day local weekday -- which local weekday is fwd
+ fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
+
+ return -fwdlw + fwd - 1;
+ }
+
+ //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
+ function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
+ var localWeekday = (7 + weekday - dow) % 7,
+ weekOffset = firstWeekOffset(year, dow, doy),
+ dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
+ resYear, resDayOfYear;
+
+ if (dayOfYear <= 0) {
+ resYear = year - 1;
+ resDayOfYear = daysInYear(resYear) + dayOfYear;
+ } else if (dayOfYear > daysInYear(year)) {
+ resYear = year + 1;
+ resDayOfYear = dayOfYear - daysInYear(year);
+ } else {
+ resYear = year;
+ resDayOfYear = dayOfYear;
+ }
+
+ return {
+ year: resYear,
+ dayOfYear: resDayOfYear
+ };
+ }
+
+ function weekOfYear(mom, dow, doy) {
+ var weekOffset = firstWeekOffset(mom.year(), dow, doy),
+ week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
+ resWeek, resYear;
+
+ if (week < 1) {
+ resYear = mom.year() - 1;
+ resWeek = week + weeksInYear(resYear, dow, doy);
+ } else if (week > weeksInYear(mom.year(), dow, doy)) {
+ resWeek = week - weeksInYear(mom.year(), dow, doy);
+ resYear = mom.year() + 1;
+ } else {
+ resYear = mom.year();
+ resWeek = week;
+ }
+
+ return {
+ week: resWeek,
+ year: resYear
+ };
+ }
+
+ function weeksInYear(year, dow, doy) {
+ var weekOffset = firstWeekOffset(year, dow, doy),
+ weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
+ return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
+ }
+
+ // Pick the first defined of two or three arguments.
+ function defaults(a, b, c) {
+ if (a != null) {
+ return a;
+ }
+ if (b != null) {
+ return b;
+ }
+ return c;
+ }
+
+ function currentDateArray(config) {
+ // hooks is actually the exported moment object
+ var nowValue = new Date(utils_hooks__hooks.now());
+ if (config._useUTC) {
+ return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
+ }
+ return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
+ }
+
+ // convert an array to a date.
+ // the array should mirror the parameters below
+ // note: all values past the year are optional and will default to the lowest possible value.
+ // [year, month, day , hour, minute, second, millisecond]
+ function configFromArray (config) {
+ var i, date, input = [], currentDate, yearToUse;
+
+ if (config._d) {
+ return;
+ }
+
+ currentDate = currentDateArray(config);
+
+ //compute day of the year from weeks and weekdays
+ if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
+ dayOfYearFromWeekInfo(config);
+ }
+
+ //if the day of the year is set, figure out what it is
+ if (config._dayOfYear) {
+ yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
+
+ if (config._dayOfYear > daysInYear(yearToUse)) {
+ getParsingFlags(config)._overflowDayOfYear = true;
+ }
+
+ date = createUTCDate(yearToUse, 0, config._dayOfYear);
+ config._a[MONTH] = date.getUTCMonth();
+ config._a[DATE] = date.getUTCDate();
+ }
+
+ // Default to current date.
+ // * if no year, month, day of month are given, default to today
+ // * if day of month is given, default month and year
+ // * if month is given, default only year
+ // * if year is given, don't default anything
+ for (i = 0; i < 3 && config._a[i] == null; ++i) {
+ config._a[i] = input[i] = currentDate[i];
+ }
+
+ // Zero out whatever was not defaulted, including time
+ for (; i < 7; i++) {
+ config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
+ }
+
+ // Check for 24:00:00.000
+ if (config._a[HOUR] === 24 &&
+ config._a[MINUTE] === 0 &&
+ config._a[SECOND] === 0 &&
+ config._a[MILLISECOND] === 0) {
+ config._nextDay = true;
+ config._a[HOUR] = 0;
+ }
+
+ config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
+ // Apply timezone offset from input. The actual utcOffset can be changed
+ // with parseZone.
+ if (config._tzm != null) {
+ config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
+ }
+
+ if (config._nextDay) {
+ config._a[HOUR] = 24;
+ }
+ }
+
+ function dayOfYearFromWeekInfo(config) {
+ var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
+
+ w = config._w;
+ if (w.GG != null || w.W != null || w.E != null) {
+ dow = 1;
+ doy = 4;
+
+ // TODO: We need to take the current isoWeekYear, but that depends on
+ // how we interpret now (local, utc, fixed offset). So create
+ // a now version of current config (take local/utc/offset flags, and
+ // create now).
+ weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year);
+ week = defaults(w.W, 1);
+ weekday = defaults(w.E, 1);
+ if (weekday < 1 || weekday > 7) {
+ weekdayOverflow = true;
+ }
+ } else {
+ dow = config._locale._week.dow;
+ doy = config._locale._week.doy;
+
+ weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year);
+ week = defaults(w.w, 1);
+
+ if (w.d != null) {
+ // weekday -- low day numbers are considered next week
+ weekday = w.d;
+ if (weekday < 0 || weekday > 6) {
+ weekdayOverflow = true;
+ }
+ } else if (w.e != null) {
+ // local weekday -- counting starts from begining of week
+ weekday = w.e + dow;
+ if (w.e < 0 || w.e > 6) {
+ weekdayOverflow = true;
+ }
+ } else {
+ // default to begining of week
+ weekday = dow;
+ }
+ }
+ if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
+ getParsingFlags(config)._overflowWeeks = true;
+ } else if (weekdayOverflow != null) {
+ getParsingFlags(config)._overflowWeekday = true;
+ } else {
+ temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
+ config._a[YEAR] = temp.year;
+ config._dayOfYear = temp.dayOfYear;
+ }
+ }
+
+ // constant that refers to the ISO standard
+ utils_hooks__hooks.ISO_8601 = function () {};
+
+ // date from string and format string
+ function configFromStringAndFormat(config) {
+ // TODO: Move this to another part of the creation flow to prevent circular deps
+ if (config._f === utils_hooks__hooks.ISO_8601) {
+ configFromISO(config);
+ return;
+ }
+
+ config._a = [];
+ getParsingFlags(config).empty = true;
+
+ // This array is used to make a Date, either with `new Date` or `Date.UTC`
+ var string = '' + config._i,
+ i, parsedInput, tokens, token, skipped,
+ stringLength = string.length,
+ totalParsedInputLength = 0;
+
+ tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
+
+ for (i = 0; i < tokens.length; i++) {
+ token = tokens[i];
+ parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
+ // console.log('token', token, 'parsedInput', parsedInput,
+ // 'regex', getParseRegexForToken(token, config));
+ if (parsedInput) {
+ skipped = string.substr(0, string.indexOf(parsedInput));
+ if (skipped.length > 0) {
+ getParsingFlags(config).unusedInput.push(skipped);
+ }
+ string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
+ totalParsedInputLength += parsedInput.length;
+ }
+ // don't parse if it's not a known token
+ if (formatTokenFunctions[token]) {
+ if (parsedInput) {
+ getParsingFlags(config).empty = false;
+ }
+ else {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ addTimeToArrayFromToken(token, parsedInput, config);
+ }
+ else if (config._strict && !parsedInput) {
+ getParsingFlags(config).unusedTokens.push(token);
+ }
+ }
+
+ // add remaining unparsed input length to the string
+ getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength;
+ if (string.length > 0) {
+ getParsingFlags(config).unusedInput.push(string);
+ }
+
+ // clear _12h flag if hour is <= 12
+ if (getParsingFlags(config).bigHour === true &&
+ config._a[HOUR] <= 12 &&
+ config._a[HOUR] > 0) {
+ getParsingFlags(config).bigHour = undefined;
+ }
+ // handle meridiem
+ config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
+
+ configFromArray(config);
+ checkOverflow(config);
+ }
+
+
+ function meridiemFixWrap (locale, hour, meridiem) {
+ var isPm;
+
+ if (meridiem == null) {
+ // nothing to do
+ return hour;
+ }
+ if (locale.meridiemHour != null) {
+ return locale.meridiemHour(hour, meridiem);
+ } else if (locale.isPM != null) {
+ // Fallback
+ isPm = locale.isPM(meridiem);
+ if (isPm && hour < 12) {
+ hour += 12;
+ }
+ if (!isPm && hour === 12) {
+ hour = 0;
+ }
+ return hour;
+ } else {
+ // this is not supposed to happen
+ return hour;
+ }
+ }
+
+ // date from string and array of format strings
+ function configFromStringAndArray(config) {
+ var tempConfig,
+ bestMoment,
+
+ scoreToBeat,
+ i,
+ currentScore;
+
+ if (config._f.length === 0) {
+ getParsingFlags(config).invalidFormat = true;
+ config._d = new Date(NaN);
+ return;
+ }
+
+ for (i = 0; i < config._f.length; i++) {
+ currentScore = 0;
+ tempConfig = copyConfig({}, config);
+ if (config._useUTC != null) {
+ tempConfig._useUTC = config._useUTC;
+ }
+ tempConfig._f = config._f[i];
+ configFromStringAndFormat(tempConfig);
+
+ if (!valid__isValid(tempConfig)) {
+ continue;
+ }
+
+ // if there is any input that was not parsed add a penalty for that format
+ currentScore += getParsingFlags(tempConfig).charsLeftOver;
+
+ //or tokens
+ currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
+
+ getParsingFlags(tempConfig).score = currentScore;
+
+ if (scoreToBeat == null || currentScore < scoreToBeat) {
+ scoreToBeat = currentScore;
+ bestMoment = tempConfig;
+ }
+ }
+
+ extend(config, bestMoment || tempConfig);
+ }
+
+ function configFromObject(config) {
+ if (config._d) {
+ return;
+ }
+
+ var i = normalizeObjectUnits(config._i);
+ config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) {
+ return obj && parseInt(obj, 10);
+ });
+
+ configFromArray(config);
+ }
+
+ function createFromConfig (config) {
+ var res = new Moment(checkOverflow(prepareConfig(config)));
+ if (res._nextDay) {
+ // Adding is smart enough around DST
+ res.add(1, 'd');
+ res._nextDay = undefined;
+ }
+
+ return res;
+ }
+
+ function prepareConfig (config) {
+ var input = config._i,
+ format = config._f;
+
+ config._locale = config._locale || locale_locales__getLocale(config._l);
+
+ if (input === null || (format === undefined && input === '')) {
+ return valid__createInvalid({nullInput: true});
+ }
+
+ if (typeof input === 'string') {
+ config._i = input = config._locale.preparse(input);
+ }
+
+ if (isMoment(input)) {
+ return new Moment(checkOverflow(input));
+ } else if (isArray(format)) {
+ configFromStringAndArray(config);
+ } else if (format) {
+ configFromStringAndFormat(config);
+ } else if (isDate(input)) {
+ config._d = input;
+ } else {
+ configFromInput(config);
+ }
+
+ if (!valid__isValid(config)) {
+ config._d = null;
+ }
+
+ return config;
+ }
+
+ function configFromInput(config) {
+ var input = config._i;
+ if (input === undefined) {
+ config._d = new Date(utils_hooks__hooks.now());
+ } else if (isDate(input)) {
+ config._d = new Date(+input);
+ } else if (typeof input === 'string') {
+ configFromString(config);
+ } else if (isArray(input)) {
+ config._a = map(input.slice(0), function (obj) {
+ return parseInt(obj, 10);
+ });
+ configFromArray(config);
+ } else if (typeof(input) === 'object') {
+ configFromObject(config);
+ } else if (typeof(input) === 'number') {
+ // from milliseconds
+ config._d = new Date(input);
+ } else {
+ utils_hooks__hooks.createFromInputFallback(config);
+ }
+ }
+
+ function createLocalOrUTC (input, format, locale, strict, isUTC) {
+ var c = {};
+
+ if (typeof(locale) === 'boolean') {
+ strict = locale;
+ locale = undefined;
+ }
+ // object construction must be done this way.
+ // https://github.com/moment/moment/issues/1423
+ c._isAMomentObject = true;
+ c._useUTC = c._isUTC = isUTC;
+ c._l = locale;
+ c._i = input;
+ c._f = format;
+ c._strict = strict;
+
+ return createFromConfig(c);
+ }
+
+ function local__createLocal (input, format, locale, strict) {
+ return createLocalOrUTC(input, format, locale, strict, false);
+ }
+
+ var prototypeMin = deprecate(
+ 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ if (this.isValid() && other.isValid()) {
+ return other < this ? this : other;
+ } else {
+ return valid__createInvalid();
+ }
+ }
+ );
+
+ var prototypeMax = deprecate(
+ 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548',
+ function () {
+ var other = local__createLocal.apply(null, arguments);
+ if (this.isValid() && other.isValid()) {
+ return other > this ? this : other;
+ } else {
+ return valid__createInvalid();
+ }
+ }
+ );
+
+ // Pick a moment m from moments so that m[fn](other) is true for all
+ // other. This relies on the function fn to be transitive.
+ //
+ // moments should either be an array of moment objects or an array, whose
+ // first element is an array of moment objects.
+ function pickBy(fn, moments) {
+ var res, i;
+ if (moments.length === 1 && isArray(moments[0])) {
+ moments = moments[0];
+ }
+ if (!moments.length) {
+ return local__createLocal();
+ }
+ res = moments[0];
+ for (i = 1; i < moments.length; ++i) {
+ if (!moments[i].isValid() || moments[i][fn](res)) {
+ res = moments[i];
+ }
+ }
+ return res;
+ }
+
+ // TODO: Use [].sort instead?
+ function min () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isBefore', args);
+ }
+
+ function max () {
+ var args = [].slice.call(arguments, 0);
+
+ return pickBy('isAfter', args);
+ }
+
+ var now = function () {
+ return Date.now ? Date.now() : +(new Date());
+ };
+
+ function Duration (duration) {
+ var normalizedInput = normalizeObjectUnits(duration),
+ years = normalizedInput.year || 0,
+ quarters = normalizedInput.quarter || 0,
+ months = normalizedInput.month || 0,
+ weeks = normalizedInput.week || 0,
+ days = normalizedInput.day || 0,
+ hours = normalizedInput.hour || 0,
+ minutes = normalizedInput.minute || 0,
+ seconds = normalizedInput.second || 0,
+ milliseconds = normalizedInput.millisecond || 0;
+
+ // representation for dateAddRemove
+ this._milliseconds = +milliseconds +
+ seconds * 1e3 + // 1000
+ minutes * 6e4 + // 1000 * 60
+ hours * 36e5; // 1000 * 60 * 60
+ // Because of dateAddRemove treats 24 hours as different from a
+ // day when working around DST, we need to store them separately
+ this._days = +days +
+ weeks * 7;
+ // It is impossible translate months into days without knowing
+ // which months you are are talking about, so we have to store
+ // it separately.
+ this._months = +months +
+ quarters * 3 +
+ years * 12;
+
+ this._data = {};
+
+ this._locale = locale_locales__getLocale();
+
+ this._bubble();
+ }
+
+ function isDuration (obj) {
+ return obj instanceof Duration;
+ }
+
+ // FORMATTING
+
+ function offset (token, separator) {
+ addFormatToken(token, 0, 0, function () {
+ var offset = this.utcOffset();
+ var sign = '+';
+ if (offset < 0) {
+ offset = -offset;
+ sign = '-';
+ }
+ return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
+ });
+ }
+
+ offset('Z', ':');
+ offset('ZZ', '');
+
+ // PARSING
+
+ addRegexToken('Z', matchShortOffset);
+ addRegexToken('ZZ', matchShortOffset);
+ addParseToken(['Z', 'ZZ'], function (input, array, config) {
+ config._useUTC = true;
+ config._tzm = offsetFromString(matchShortOffset, input);
+ });
+
+ // HELPERS
+
+ // timezone chunker
+ // '+10:00' > ['10', '00']
+ // '-1530' > ['-15', '30']
+ var chunkOffset = /([\+\-]|\d\d)/gi;
+
+ function offsetFromString(matcher, string) {
+ var matches = ((string || '').match(matcher) || []);
+ var chunk = matches[matches.length - 1] || [];
+ var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
+ var minutes = +(parts[1] * 60) + toInt(parts[2]);
+
+ return parts[0] === '+' ? minutes : -minutes;
+ }
+
+ // Return a moment from input, that is local/utc/zone equivalent to model.
+ function cloneWithOffset(input, model) {
+ var res, diff;
+ if (model._isUTC) {
+ res = model.clone();
+ diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res);
+ // Use low-level api, because this fn is low-level api.
+ res._d.setTime(+res._d + diff);
+ utils_hooks__hooks.updateOffset(res, false);
+ return res;
+ } else {
+ return local__createLocal(input).local();
+ }
+ }
+
+ function getDateOffset (m) {
+ // On Firefox.24 Date#getTimezoneOffset returns a floating point.
+ // https://github.com/moment/moment/pull/1871
+ return -Math.round(m._d.getTimezoneOffset() / 15) * 15;
+ }
+
+ // HOOKS
+
+ // This function will be called whenever a moment is mutated.
+ // It is intended to keep the offset in sync with the timezone.
+ utils_hooks__hooks.updateOffset = function () {};
+
+ // MOMENTS
+
+ // keepLocalTime = true means only change the timezone, without
+ // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
+ // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
+ // +0200, so we adjust the time as needed, to be valid.
+ //
+ // Keeping the time actually adds/subtracts (one hour)
+ // from the actual represented time. That is why we call updateOffset
+ // a second time. In case it wants us to change the offset again
+ // _changeInProgress == true case, then we have to adjust, because
+ // there is no such time in the given timezone.
+ function getSetOffset (input, keepLocalTime) {
+ var offset = this._offset || 0,
+ localAdjust;
+ if (!this.isValid()) {
+ return input != null ? this : NaN;
+ }
+ if (input != null) {
+ if (typeof input === 'string') {
+ input = offsetFromString(matchShortOffset, input);
+ } else if (Math.abs(input) < 16) {
+ input = input * 60;
+ }
+ if (!this._isUTC && keepLocalTime) {
+ localAdjust = getDateOffset(this);
+ }
+ this._offset = input;
+ this._isUTC = true;
+ if (localAdjust != null) {
+ this.add(localAdjust, 'm');
+ }
+ if (offset !== input) {
+ if (!keepLocalTime || this._changeInProgress) {
+ add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false);
+ } else if (!this._changeInProgress) {
+ this._changeInProgress = true;
+ utils_hooks__hooks.updateOffset(this, true);
+ this._changeInProgress = null;
+ }
+ }
+ return this;
+ } else {
+ return this._isUTC ? offset : getDateOffset(this);
+ }
+ }
+
+ function getSetZone (input, keepLocalTime) {
+ if (input != null) {
+ if (typeof input !== 'string') {
+ input = -input;
+ }
+
+ this.utcOffset(input, keepLocalTime);
+
+ return this;
+ } else {
+ return -this.utcOffset();
+ }
+ }
+
+ function setOffsetToUTC (keepLocalTime) {
+ return this.utcOffset(0, keepLocalTime);
+ }
+
+ function setOffsetToLocal (keepLocalTime) {
+ if (this._isUTC) {
+ this.utcOffset(0, keepLocalTime);
+ this._isUTC = false;
+
+ if (keepLocalTime) {
+ this.subtract(getDateOffset(this), 'm');
+ }
+ }
+ return this;
+ }
+
+ function setOffsetToParsedOffset () {
+ if (this._tzm) {
+ this.utcOffset(this._tzm);
+ } else if (typeof this._i === 'string') {
+ this.utcOffset(offsetFromString(matchOffset, this._i));
+ }
+ return this;
+ }
+
+ function hasAlignedHourOffset (input) {
+ if (!this.isValid()) {
+ return false;
+ }
+ input = input ? local__createLocal(input).utcOffset() : 0;
+
+ return (this.utcOffset() - input) % 60 === 0;
+ }
+
+ function isDaylightSavingTime () {
+ return (
+ this.utcOffset() > this.clone().month(0).utcOffset() ||
+ this.utcOffset() > this.clone().month(5).utcOffset()
+ );
+ }
+
+ function isDaylightSavingTimeShifted () {
+ if (!isUndefined(this._isDSTShifted)) {
+ return this._isDSTShifted;
+ }
+
+ var c = {};
+
+ copyConfig(c, this);
+ c = prepareConfig(c);
+
+ if (c._a) {
+ var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a);
+ this._isDSTShifted = this.isValid() &&
+ compareArrays(c._a, other.toArray()) > 0;
+ } else {
+ this._isDSTShifted = false;
+ }
+
+ return this._isDSTShifted;
+ }
+
+ function isLocal () {
+ return this.isValid() ? !this._isUTC : false;
+ }
+
+ function isUtcOffset () {
+ return this.isValid() ? this._isUTC : false;
+ }
+
+ function isUtc () {
+ return this.isValid() ? this._isUTC && this._offset === 0 : false;
+ }
+
+ // ASP.NET json date format regex
+ var aspNetRegex = /(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/;
+
+ // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
+ // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
+ var isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;
+
+ function create__createDuration (input, key) {
+ var duration = input,
+ // matching against regexp is expensive, do it on demand
+ match = null,
+ sign,
+ ret,
+ diffRes;
+
+ if (isDuration(input)) {
+ duration = {
+ ms : input._milliseconds,
+ d : input._days,
+ M : input._months
+ };
+ } else if (typeof input === 'number') {
+ duration = {};
+ if (key) {
+ duration[key] = input;
+ } else {
+ duration.milliseconds = input;
+ }
+ } else if (!!(match = aspNetRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : 0,
+ d : toInt(match[DATE]) * sign,
+ h : toInt(match[HOUR]) * sign,
+ m : toInt(match[MINUTE]) * sign,
+ s : toInt(match[SECOND]) * sign,
+ ms : toInt(match[MILLISECOND]) * sign
+ };
+ } else if (!!(match = isoRegex.exec(input))) {
+ sign = (match[1] === '-') ? -1 : 1;
+ duration = {
+ y : parseIso(match[2], sign),
+ M : parseIso(match[3], sign),
+ d : parseIso(match[4], sign),
+ h : parseIso(match[5], sign),
+ m : parseIso(match[6], sign),
+ s : parseIso(match[7], sign),
+ w : parseIso(match[8], sign)
+ };
+ } else if (duration == null) {// checks for null or undefined
+ duration = {};
+ } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) {
+ diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to));
+
+ duration = {};
+ duration.ms = diffRes.milliseconds;
+ duration.M = diffRes.months;
+ }
+
+ ret = new Duration(duration);
+
+ if (isDuration(input) && hasOwnProp(input, '_locale')) {
+ ret._locale = input._locale;
+ }
+
+ return ret;
+ }
+
+ create__createDuration.fn = Duration.prototype;
+
+ function parseIso (inp, sign) {
+ // We'd normally use ~~inp for this, but unfortunately it also
+ // converts floats to ints.
+ // inp may be undefined, so careful calling replace on it.
+ var res = inp && parseFloat(inp.replace(',', '.'));
+ // apply sign while we're at it
+ return (isNaN(res) ? 0 : res) * sign;
+ }
+
+ function positiveMomentsDifference(base, other) {
+ var res = {milliseconds: 0, months: 0};
+
+ res.months = other.month() - base.month() +
+ (other.year() - base.year()) * 12;
+ if (base.clone().add(res.months, 'M').isAfter(other)) {
+ --res.months;
+ }
+
+ res.milliseconds = +other - +(base.clone().add(res.months, 'M'));
+
+ return res;
+ }
+
+ function momentsDifference(base, other) {
+ var res;
+ if (!(base.isValid() && other.isValid())) {
+ return {milliseconds: 0, months: 0};
+ }
+
+ other = cloneWithOffset(other, base);
+ if (base.isBefore(other)) {
+ res = positiveMomentsDifference(base, other);
+ } else {
+ res = positiveMomentsDifference(other, base);
+ res.milliseconds = -res.milliseconds;
+ res.months = -res.months;
+ }
+
+ return res;
+ }
+
+ // TODO: remove 'name' arg after deprecation is removed
+ function createAdder(direction, name) {
+ return function (val, period) {
+ var dur, tmp;
+ //invert the arguments, but complain about it
+ if (period !== null && !isNaN(+period)) {
+ deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).');
+ tmp = val; val = period; period = tmp;
+ }
+
+ val = typeof val === 'string' ? +val : val;
+ dur = create__createDuration(val, period);
+ add_subtract__addSubtract(this, dur, direction);
+ return this;
+ };
+ }
+
+ function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) {
+ var milliseconds = duration._milliseconds,
+ days = duration._days,
+ months = duration._months;
+
+ if (!mom.isValid()) {
+ // No op
+ return;
+ }
+
+ updateOffset = updateOffset == null ? true : updateOffset;
+
+ if (milliseconds) {
+ mom._d.setTime(+mom._d + milliseconds * isAdding);
+ }
+ if (days) {
+ get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding);
+ }
+ if (months) {
+ setMonth(mom, get_set__get(mom, 'Month') + months * isAdding);
+ }
+ if (updateOffset) {
+ utils_hooks__hooks.updateOffset(mom, days || months);
+ }
+ }
+
+ var add_subtract__add = createAdder(1, 'add');
+ var add_subtract__subtract = createAdder(-1, 'subtract');
+
+ function moment_calendar__calendar (time, formats) {
+ // We want to compare the start of today, vs this.
+ // Getting start-of-today depends on whether we're local/utc/offset or not.
+ var now = time || local__createLocal(),
+ sod = cloneWithOffset(now, this).startOf('day'),
+ diff = this.diff(sod, 'days', true),
+ format = diff < -6 ? 'sameElse' :
+ diff < -1 ? 'lastWeek' :
+ diff < 0 ? 'lastDay' :
+ diff < 1 ? 'sameDay' :
+ diff < 2 ? 'nextDay' :
+ diff < 7 ? 'nextWeek' : 'sameElse';
+
+ var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]);
+
+ return this.format(output || this.localeData().calendar(format, this, local__createLocal(now)));
+ }
+
+ function clone () {
+ return new Moment(this);
+ }
+
+ function isAfter (input, units) {
+ var localInput = isMoment(input) ? input : local__createLocal(input);
+ if (!(this.isValid() && localInput.isValid())) {
+ return false;
+ }
+ units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
+ if (units === 'millisecond') {
+ return +this > +localInput;
+ } else {
+ return +localInput < +this.clone().startOf(units);
+ }
+ }
+
+ function isBefore (input, units) {
+ var localInput = isMoment(input) ? input : local__createLocal(input);
+ if (!(this.isValid() && localInput.isValid())) {
+ return false;
+ }
+ units = normalizeUnits(!isUndefined(units) ? units : 'millisecond');
+ if (units === 'millisecond') {
+ return +this < +localInput;
+ } else {
+ return +this.clone().endOf(units) < +localInput;
+ }
+ }
+
+ function isBetween (from, to, units) {
+ return this.isAfter(from, units) && this.isBefore(to, units);
+ }
+
+ function isSame (input, units) {
+ var localInput = isMoment(input) ? input : local__createLocal(input),
+ inputMs;
+ if (!(this.isValid() && localInput.isValid())) {
+ return false;
+ }
+ units = normalizeUnits(units || 'millisecond');
+ if (units === 'millisecond') {
+ return +this === +localInput;
+ } else {
+ inputMs = +localInput;
+ return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units));
+ }
+ }
+
+ function isSameOrAfter (input, units) {
+ return this.isSame(input, units) || this.isAfter(input,units);
+ }
+
+ function isSameOrBefore (input, units) {
+ return this.isSame(input, units) || this.isBefore(input,units);
+ }
+
+ function diff (input, units, asFloat) {
+ var that,
+ zoneDelta,
+ delta, output;
+
+ if (!this.isValid()) {
+ return NaN;
+ }
+
+ that = cloneWithOffset(input, this);
+
+ if (!that.isValid()) {
+ return NaN;
+ }
+
+ zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
+
+ units = normalizeUnits(units);
+
+ if (units === 'year' || units === 'month' || units === 'quarter') {
+ output = monthDiff(this, that);
+ if (units === 'quarter') {
+ output = output / 3;
+ } else if (units === 'year') {
+ output = output / 12;
+ }
+ } else {
+ delta = this - that;
+ output = units === 'second' ? delta / 1e3 : // 1000
+ units === 'minute' ? delta / 6e4 : // 1000 * 60
+ units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60
+ units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst
+ units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst
+ delta;
+ }
+ return asFloat ? output : absFloor(output);
+ }
+
+ function monthDiff (a, b) {
+ // difference in months
+ var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()),
+ // b is in (anchor - 1 month, anchor + 1 month)
+ anchor = a.clone().add(wholeMonthDiff, 'months'),
+ anchor2, adjust;
+
+ if (b - anchor < 0) {
+ anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor - anchor2);
+ } else {
+ anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
+ // linear across the month
+ adjust = (b - anchor) / (anchor2 - anchor);
+ }
+
+ return -(wholeMonthDiff + adjust);
+ }
+
+ utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
+
+ function toString () {
+ return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
+ }
+
+ function moment_format__toISOString () {
+ var m = this.clone().utc();
+ if (0 < m.year() && m.year() <= 9999) {
+ if (isFunction(Date.prototype.toISOString)) {
+ // native implementation is ~50x faster, use it when we can
+ return this.toDate().toISOString();
+ } else {
+ return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ } else {
+ return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]');
+ }
+ }
+
+ function format (inputString) {
+ var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat);
+ return this.localeData().postformat(output);
+ }
+
+ function from (time, withoutSuffix) {
+ if (this.isValid() &&
+ ((isMoment(time) && time.isValid()) ||
+ local__createLocal(time).isValid())) {
+ return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix);
+ } else {
+ return this.localeData().invalidDate();
+ }
+ }
+
+ function fromNow (withoutSuffix) {
+ return this.from(local__createLocal(), withoutSuffix);
+ }
+
+ function to (time, withoutSuffix) {
+ if (this.isValid() &&
+ ((isMoment(time) && time.isValid()) ||
+ local__createLocal(time).isValid())) {
+ return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix);
+ } else {
+ return this.localeData().invalidDate();
+ }
+ }
+
+ function toNow (withoutSuffix) {
+ return this.to(local__createLocal(), withoutSuffix);
+ }
+
+ // If passed a locale key, it will set the locale for this
+ // instance. Otherwise, it will return the locale configuration
+ // variables for this instance.
+ function locale (key) {
+ var newLocaleData;
+
+ if (key === undefined) {
+ return this._locale._abbr;
+ } else {
+ newLocaleData = locale_locales__getLocale(key);
+ if (newLocaleData != null) {
+ this._locale = newLocaleData;
+ }
+ return this;
+ }
+ }
+
+ var lang = deprecate(
+ 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
+ function (key) {
+ if (key === undefined) {
+ return this.localeData();
+ } else {
+ return this.locale(key);
+ }
+ }
+ );
+
+ function localeData () {
+ return this._locale;
+ }
+
+ function startOf (units) {
+ units = normalizeUnits(units);
+ // the following switch intentionally omits break keywords
+ // to utilize falling through the cases.
+ switch (units) {
+ case 'year':
+ this.month(0);
+ /* falls through */
+ case 'quarter':
+ case 'month':
+ this.date(1);
+ /* falls through */
+ case 'week':
+ case 'isoWeek':
+ case 'day':
+ this.hours(0);
+ /* falls through */
+ case 'hour':
+ this.minutes(0);
+ /* falls through */
+ case 'minute':
+ this.seconds(0);
+ /* falls through */
+ case 'second':
+ this.milliseconds(0);
+ }
+
+ // weeks are a special case
+ if (units === 'week') {
+ this.weekday(0);
+ }
+ if (units === 'isoWeek') {
+ this.isoWeekday(1);
+ }
+
+ // quarters are also special
+ if (units === 'quarter') {
+ this.month(Math.floor(this.month() / 3) * 3);
+ }
+
+ return this;
+ }
+
+ function endOf (units) {
+ units = normalizeUnits(units);
+ if (units === undefined || units === 'millisecond') {
+ return this;
+ }
+ return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms');
+ }
+
+ function to_type__valueOf () {
+ return +this._d - ((this._offset || 0) * 60000);
+ }
+
+ function unix () {
+ return Math.floor(+this / 1000);
+ }
+
+ function toDate () {
+ return this._offset ? new Date(+this) : this._d;
+ }
+
+ function toArray () {
+ var m = this;
+ return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()];
+ }
+
+ function toObject () {
+ var m = this;
+ return {
+ years: m.year(),
+ months: m.month(),
+ date: m.date(),
+ hours: m.hours(),
+ minutes: m.minutes(),
+ seconds: m.seconds(),
+ milliseconds: m.milliseconds()
+ };
+ }
+
+ function toJSON () {
+ // JSON.stringify(new Date(NaN)) === 'null'
+ return this.isValid() ? this.toISOString() : 'null';
+ }
+
+ function moment_valid__isValid () {
+ return valid__isValid(this);
+ }
+
+ function parsingFlags () {
+ return extend({}, getParsingFlags(this));
+ }
+
+ function invalidAt () {
+ return getParsingFlags(this).overflow;
+ }
+
+ function creationData() {
+ return {
+ input: this._i,
+ format: this._f,
+ locale: this._locale,
+ isUTC: this._isUTC,
+ strict: this._strict
+ };
+ }
+
+ // FORMATTING
+
+ addFormatToken(0, ['gg', 2], 0, function () {
+ return this.weekYear() % 100;
+ });
+
+ addFormatToken(0, ['GG', 2], 0, function () {
+ return this.isoWeekYear() % 100;
+ });
+
+ function addWeekYearFormatToken (token, getter) {
+ addFormatToken(0, [token, token.length], 0, getter);
+ }
+
+ addWeekYearFormatToken('gggg', 'weekYear');
+ addWeekYearFormatToken('ggggg', 'weekYear');
+ addWeekYearFormatToken('GGGG', 'isoWeekYear');
+ addWeekYearFormatToken('GGGGG', 'isoWeekYear');
+
+ // ALIASES
+
+ addUnitAlias('weekYear', 'gg');
+ addUnitAlias('isoWeekYear', 'GG');
+
+ // PARSING
+
+ addRegexToken('G', matchSigned);
+ addRegexToken('g', matchSigned);
+ addRegexToken('GG', match1to2, match2);
+ addRegexToken('gg', match1to2, match2);
+ addRegexToken('GGGG', match1to4, match4);
+ addRegexToken('gggg', match1to4, match4);
+ addRegexToken('GGGGG', match1to6, match6);
+ addRegexToken('ggggg', match1to6, match6);
+
+ addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) {
+ week[token.substr(0, 2)] = toInt(input);
+ });
+
+ addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
+ week[token] = utils_hooks__hooks.parseTwoDigitYear(input);
+ });
+
+ // MOMENTS
+
+ function getSetWeekYear (input) {
+ return getSetWeekYearHelper.call(this,
+ input,
+ this.week(),
+ this.weekday(),
+ this.localeData()._week.dow,
+ this.localeData()._week.doy);
+ }
+
+ function getSetISOWeekYear (input) {
+ return getSetWeekYearHelper.call(this,
+ input, this.isoWeek(), this.isoWeekday(), 1, 4);
+ }
+
+ function getISOWeeksInYear () {
+ return weeksInYear(this.year(), 1, 4);
+ }
+
+ function getWeeksInYear () {
+ var weekInfo = this.localeData()._week;
+ return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
+ }
+
+ function getSetWeekYearHelper(input, week, weekday, dow, doy) {
+ var weeksTarget;
+ if (input == null) {
+ return weekOfYear(this, dow, doy).year;
+ } else {
+ weeksTarget = weeksInYear(input, dow, doy);
+ if (week > weeksTarget) {
+ week = weeksTarget;
+ }
+ return setWeekAll.call(this, input, week, weekday, dow, doy);
+ }
+ }
+
+ function setWeekAll(weekYear, week, weekday, dow, doy) {
+ var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
+ date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
+
+ // console.log("got", weekYear, week, weekday, "set", date.toISOString());
+ this.year(date.getUTCFullYear());
+ this.month(date.getUTCMonth());
+ this.date(date.getUTCDate());
+ return this;
+ }
+
+ // FORMATTING
+
+ addFormatToken('Q', 0, 'Qo', 'quarter');
+
+ // ALIASES
+
+ addUnitAlias('quarter', 'Q');
+
+ // PARSING
+
+ addRegexToken('Q', match1);
+ addParseToken('Q', function (input, array) {
+ array[MONTH] = (toInt(input) - 1) * 3;
+ });
+
+ // MOMENTS
+
+ function getSetQuarter (input) {
+ return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
+ }
+
+ // FORMATTING
+
+ addFormatToken('w', ['ww', 2], 'wo', 'week');
+ addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
+
+ // ALIASES
+
+ addUnitAlias('week', 'w');
+ addUnitAlias('isoWeek', 'W');
+
+ // PARSING
+
+ addRegexToken('w', match1to2);
+ addRegexToken('ww', match1to2, match2);
+ addRegexToken('W', match1to2);
+ addRegexToken('WW', match1to2, match2);
+
+ addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) {
+ week[token.substr(0, 1)] = toInt(input);
+ });
+
+ // HELPERS
+
+ // LOCALES
+
+ function localeWeek (mom) {
+ return weekOfYear(mom, this._week.dow, this._week.doy).week;
+ }
+
+ var defaultLocaleWeek = {
+ dow : 0, // Sunday is the first day of the week.
+ doy : 6 // The week that contains Jan 1st is the first week of the year.
+ };
+
+ function localeFirstDayOfWeek () {
+ return this._week.dow;
+ }
+
+ function localeFirstDayOfYear () {
+ return this._week.doy;
+ }
+
+ // MOMENTS
+
+ function getSetWeek (input) {
+ var week = this.localeData().week(this);
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ function getSetISOWeek (input) {
+ var week = weekOfYear(this, 1, 4).week;
+ return input == null ? week : this.add((input - week) * 7, 'd');
+ }
+
+ // FORMATTING
+
+ addFormatToken('D', ['DD', 2], 'Do', 'date');
+
+ // ALIASES
+
+ addUnitAlias('date', 'D');
+
+ // PARSING
+
+ addRegexToken('D', match1to2);
+ addRegexToken('DD', match1to2, match2);
+ addRegexToken('Do', function (isStrict, locale) {
+ return isStrict ? locale._ordinalParse : locale._ordinalParseLenient;
+ });
+
+ addParseToken(['D', 'DD'], DATE);
+ addParseToken('Do', function (input, array) {
+ array[DATE] = toInt(input.match(match1to2)[0], 10);
+ });
+
+ // MOMENTS
+
+ var getSetDayOfMonth = makeGetSet('Date', true);
+
+ // FORMATTING
+
+ addFormatToken('d', 0, 'do', 'day');
+
+ addFormatToken('dd', 0, 0, function (format) {
+ return this.localeData().weekdaysMin(this, format);
+ });
+
+ addFormatToken('ddd', 0, 0, function (format) {
+ return this.localeData().weekdaysShort(this, format);
+ });
+
+ addFormatToken('dddd', 0, 0, function (format) {
+ return this.localeData().weekdays(this, format);
+ });
+
+ addFormatToken('e', 0, 0, 'weekday');
+ addFormatToken('E', 0, 0, 'isoWeekday');
+
+ // ALIASES
+
+ addUnitAlias('day', 'd');
+ addUnitAlias('weekday', 'e');
+ addUnitAlias('isoWeekday', 'E');
+
+ // PARSING
+
+ addRegexToken('d', match1to2);
+ addRegexToken('e', match1to2);
+ addRegexToken('E', match1to2);
+ addRegexToken('dd', matchWord);
+ addRegexToken('ddd', matchWord);
+ addRegexToken('dddd', matchWord);
+
+ addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
+ var weekday = config._locale.weekdaysParse(input, token, config._strict);
+ // if we didn't get a weekday name, mark the date as invalid
+ if (weekday != null) {
+ week.d = weekday;
+ } else {
+ getParsingFlags(config).invalidWeekday = input;
+ }
+ });
+
+ addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
+ week[token] = toInt(input);
+ });
+
+ // HELPERS
+
+ function parseWeekday(input, locale) {
+ if (typeof input !== 'string') {
+ return input;
+ }
+
+ if (!isNaN(input)) {
+ return parseInt(input, 10);
+ }
+
+ input = locale.weekdaysParse(input);
+ if (typeof input === 'number') {
+ return input;
+ }
+
+ return null;
+ }
+
+ // LOCALES
+
+ var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
+ function localeWeekdays (m, format) {
+ return isArray(this._weekdays) ? this._weekdays[m.day()] :
+ this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()];
+ }
+
+ var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
+ function localeWeekdaysShort (m) {
+ return this._weekdaysShort[m.day()];
+ }
+
+ var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
+ function localeWeekdaysMin (m) {
+ return this._weekdaysMin[m.day()];
+ }
+
+ function localeWeekdaysParse (weekdayName, format, strict) {
+ var i, mom, regex;
+
+ if (!this._weekdaysParse) {
+ this._weekdaysParse = [];
+ this._minWeekdaysParse = [];
+ this._shortWeekdaysParse = [];
+ this._fullWeekdaysParse = [];
+ }
+
+ for (i = 0; i < 7; i++) {
+ // make the regex if we don't have it already
+
+ mom = local__createLocal([2000, 1]).day(i);
+ if (strict && !this._fullWeekdaysParse[i]) {
+ this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i');
+ this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i');
+ this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i');
+ }
+ if (!this._weekdaysParse[i]) {
+ regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, '');
+ this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
+ }
+ // test the regex
+ if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
+ return i;
+ } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
+ return i;
+ } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
+ return i;
+ } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
+ return i;
+ }
+ }
+ }
+
+ // MOMENTS
+
+ function getSetDayOfWeek (input) {
+ if (!this.isValid()) {
+ return input != null ? this : NaN;
+ }
+ var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
+ if (input != null) {
+ input = parseWeekday(input, this.localeData());
+ return this.add(input - day, 'd');
+ } else {
+ return day;
+ }
+ }
+
+ function getSetLocaleDayOfWeek (input) {
+ if (!this.isValid()) {
+ return input != null ? this : NaN;
+ }
+ var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
+ return input == null ? weekday : this.add(input - weekday, 'd');
+ }
+
+ function getSetISODayOfWeek (input) {
+ if (!this.isValid()) {
+ return input != null ? this : NaN;
+ }
+ // behaves the same as moment#day except
+ // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
+ // as a setter, sunday should belong to the previous week.
+ return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7);
+ }
+
+ // FORMATTING
+
+ addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
+
+ // ALIASES
+
+ addUnitAlias('dayOfYear', 'DDD');
+
+ // PARSING
+
+ addRegexToken('DDD', match1to3);
+ addRegexToken('DDDD', match3);
+ addParseToken(['DDD', 'DDDD'], function (input, array, config) {
+ config._dayOfYear = toInt(input);
+ });
+
+ // HELPERS
+
+ // MOMENTS
+
+ function getSetDayOfYear (input) {
+ var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1;
+ return input == null ? dayOfYear : this.add((input - dayOfYear), 'd');
+ }
+
+ // FORMATTING
+
+ function hFormat() {
+ return this.hours() % 12 || 12;
+ }
+
+ addFormatToken('H', ['HH', 2], 0, 'hour');
+ addFormatToken('h', ['hh', 2], 0, hFormat);
+
+ addFormatToken('hmm', 0, 0, function () {
+ return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
+ });
+
+ addFormatToken('hmmss', 0, 0, function () {
+ return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) +
+ zeroFill(this.seconds(), 2);
+ });
+
+ addFormatToken('Hmm', 0, 0, function () {
+ return '' + this.hours() + zeroFill(this.minutes(), 2);
+ });
+
+ addFormatToken('Hmmss', 0, 0, function () {
+ return '' + this.hours() + zeroFill(this.minutes(), 2) +
+ zeroFill(this.seconds(), 2);
+ });
+
+ function meridiem (token, lowercase) {
+ addFormatToken(token, 0, 0, function () {
+ return this.localeData().meridiem(this.hours(), this.minutes(), lowercase);
+ });
+ }
+
+ meridiem('a', true);
+ meridiem('A', false);
+
+ // ALIASES
+
+ addUnitAlias('hour', 'h');
+
+ // PARSING
+
+ function matchMeridiem (isStrict, locale) {
+ return locale._meridiemParse;
+ }
+
+ addRegexToken('a', matchMeridiem);
+ addRegexToken('A', matchMeridiem);
+ addRegexToken('H', match1to2);
+ addRegexToken('h', match1to2);
+ addRegexToken('HH', match1to2, match2);
+ addRegexToken('hh', match1to2, match2);
+
+ addRegexToken('hmm', match3to4);
+ addRegexToken('hmmss', match5to6);
+ addRegexToken('Hmm', match3to4);
+ addRegexToken('Hmmss', match5to6);
+
+ addParseToken(['H', 'HH'], HOUR);
+ addParseToken(['a', 'A'], function (input, array, config) {
+ config._isPm = config._locale.isPM(input);
+ config._meridiem = input;
+ });
+ addParseToken(['h', 'hh'], function (input, array, config) {
+ array[HOUR] = toInt(input);
+ getParsingFlags(config).bigHour = true;
+ });
+ addParseToken('hmm', function (input, array, config) {
+ var pos = input.length - 2;
+ array[HOUR] = toInt(input.substr(0, pos));
+ array[MINUTE] = toInt(input.substr(pos));
+ getParsingFlags(config).bigHour = true;
+ });
+ addParseToken('hmmss', function (input, array, config) {
+ var pos1 = input.length - 4;
+ var pos2 = input.length - 2;
+ array[HOUR] = toInt(input.substr(0, pos1));
+ array[MINUTE] = toInt(input.substr(pos1, 2));
+ array[SECOND] = toInt(input.substr(pos2));
+ getParsingFlags(config).bigHour = true;
+ });
+ addParseToken('Hmm', function (input, array, config) {
+ var pos = input.length - 2;
+ array[HOUR] = toInt(input.substr(0, pos));
+ array[MINUTE] = toInt(input.substr(pos));
+ });
+ addParseToken('Hmmss', function (input, array, config) {
+ var pos1 = input.length - 4;
+ var pos2 = input.length - 2;
+ array[HOUR] = toInt(input.substr(0, pos1));
+ array[MINUTE] = toInt(input.substr(pos1, 2));
+ array[SECOND] = toInt(input.substr(pos2));
+ });
+
+ // LOCALES
+
+ function localeIsPM (input) {
+ // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
+ // Using charAt should be more compatible.
+ return ((input + '').toLowerCase().charAt(0) === 'p');
+ }
+
+ var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
+ function localeMeridiem (hours, minutes, isLower) {
+ if (hours > 11) {
+ return isLower ? 'pm' : 'PM';
+ } else {
+ return isLower ? 'am' : 'AM';
+ }
+ }
+
+
+ // MOMENTS
+
+ // Setting the hour should keep the time, because the user explicitly
+ // specified which hour he wants. So trying to maintain the same hour (in
+ // a new timezone) makes sense. Adding/subtracting hours does not follow
+ // this rule.
+ var getSetHour = makeGetSet('Hours', true);
+
+ // FORMATTING
+
+ addFormatToken('m', ['mm', 2], 0, 'minute');
+
+ // ALIASES
+
+ addUnitAlias('minute', 'm');
+
+ // PARSING
+
+ addRegexToken('m', match1to2);
+ addRegexToken('mm', match1to2, match2);
+ addParseToken(['m', 'mm'], MINUTE);
+
+ // MOMENTS
+
+ var getSetMinute = makeGetSet('Minutes', false);
+
+ // FORMATTING
+
+ addFormatToken('s', ['ss', 2], 0, 'second');
+
+ // ALIASES
+
+ addUnitAlias('second', 's');
+
+ // PARSING
+
+ addRegexToken('s', match1to2);
+ addRegexToken('ss', match1to2, match2);
+ addParseToken(['s', 'ss'], SECOND);
+
+ // MOMENTS
+
+ var getSetSecond = makeGetSet('Seconds', false);
+
+ // FORMATTING
+
+ addFormatToken('S', 0, 0, function () {
+ return ~~(this.millisecond() / 100);
+ });
+
+ addFormatToken(0, ['SS', 2], 0, function () {
+ return ~~(this.millisecond() / 10);
+ });
+
+ addFormatToken(0, ['SSS', 3], 0, 'millisecond');
+ addFormatToken(0, ['SSSS', 4], 0, function () {
+ return this.millisecond() * 10;
+ });
+ addFormatToken(0, ['SSSSS', 5], 0, function () {
+ return this.millisecond() * 100;
+ });
+ addFormatToken(0, ['SSSSSS', 6], 0, function () {
+ return this.millisecond() * 1000;
+ });
+ addFormatToken(0, ['SSSSSSS', 7], 0, function () {
+ return this.millisecond() * 10000;
+ });
+ addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
+ return this.millisecond() * 100000;
+ });
+ addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
+ return this.millisecond() * 1000000;
+ });
+
+
+ // ALIASES
+
+ addUnitAlias('millisecond', 'ms');
+
+ // PARSING
+
+ addRegexToken('S', match1to3, match1);
+ addRegexToken('SS', match1to3, match2);
+ addRegexToken('SSS', match1to3, match3);
+
+ var token;
+ for (token = 'SSSS'; token.length <= 9; token += 'S') {
+ addRegexToken(token, matchUnsigned);
+ }
+
+ function parseMs(input, array) {
+ array[MILLISECOND] = toInt(('0.' + input) * 1000);
+ }
+
+ for (token = 'S'; token.length <= 9; token += 'S') {
+ addParseToken(token, parseMs);
+ }
+ // MOMENTS
+
+ var getSetMillisecond = makeGetSet('Milliseconds', false);
+
+ // FORMATTING
+
+ addFormatToken('z', 0, 0, 'zoneAbbr');
+ addFormatToken('zz', 0, 0, 'zoneName');
+
+ // MOMENTS
+
+ function getZoneAbbr () {
+ return this._isUTC ? 'UTC' : '';
+ }
+
+ function getZoneName () {
+ return this._isUTC ? 'Coordinated Universal Time' : '';
+ }
+
+ var momentPrototype__proto = Moment.prototype;
+
+ momentPrototype__proto.add = add_subtract__add;
+ momentPrototype__proto.calendar = moment_calendar__calendar;
+ momentPrototype__proto.clone = clone;
+ momentPrototype__proto.diff = diff;
+ momentPrototype__proto.endOf = endOf;
+ momentPrototype__proto.format = format;
+ momentPrototype__proto.from = from;
+ momentPrototype__proto.fromNow = fromNow;
+ momentPrototype__proto.to = to;
+ momentPrototype__proto.toNow = toNow;
+ momentPrototype__proto.get = getSet;
+ momentPrototype__proto.invalidAt = invalidAt;
+ momentPrototype__proto.isAfter = isAfter;
+ momentPrototype__proto.isBefore = isBefore;
+ momentPrototype__proto.isBetween = isBetween;
+ momentPrototype__proto.isSame = isSame;
+ momentPrototype__proto.isSameOrAfter = isSameOrAfter;
+ momentPrototype__proto.isSameOrBefore = isSameOrBefore;
+ momentPrototype__proto.isValid = moment_valid__isValid;
+ momentPrototype__proto.lang = lang;
+ momentPrototype__proto.locale = locale;
+ momentPrototype__proto.localeData = localeData;
+ momentPrototype__proto.max = prototypeMax;
+ momentPrototype__proto.min = prototypeMin;
+ momentPrototype__proto.parsingFlags = parsingFlags;
+ momentPrototype__proto.set = getSet;
+ momentPrototype__proto.startOf = startOf;
+ momentPrototype__proto.subtract = add_subtract__subtract;
+ momentPrototype__proto.toArray = toArray;
+ momentPrototype__proto.toObject = toObject;
+ momentPrototype__proto.toDate = toDate;
+ momentPrototype__proto.toISOString = moment_format__toISOString;
+ momentPrototype__proto.toJSON = toJSON;
+ momentPrototype__proto.toString = toString;
+ momentPrototype__proto.unix = unix;
+ momentPrototype__proto.valueOf = to_type__valueOf;
+ momentPrototype__proto.creationData = creationData;
+
+ // Year
+ momentPrototype__proto.year = getSetYear;
+ momentPrototype__proto.isLeapYear = getIsLeapYear;
+
+ // Week Year
+ momentPrototype__proto.weekYear = getSetWeekYear;
+ momentPrototype__proto.isoWeekYear = getSetISOWeekYear;
+
+ // Quarter
+ momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter;
+
+ // Month
+ momentPrototype__proto.month = getSetMonth;
+ momentPrototype__proto.daysInMonth = getDaysInMonth;
+
+ // Week
+ momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek;
+ momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek;
+ momentPrototype__proto.weeksInYear = getWeeksInYear;
+ momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear;
+
+ // Day
+ momentPrototype__proto.date = getSetDayOfMonth;
+ momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek;
+ momentPrototype__proto.weekday = getSetLocaleDayOfWeek;
+ momentPrototype__proto.isoWeekday = getSetISODayOfWeek;
+ momentPrototype__proto.dayOfYear = getSetDayOfYear;
+
+ // Hour
+ momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour;
+
+ // Minute
+ momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute;
+
+ // Second
+ momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond;
+
+ // Millisecond
+ momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond;
+
+ // Offset
+ momentPrototype__proto.utcOffset = getSetOffset;
+ momentPrototype__proto.utc = setOffsetToUTC;
+ momentPrototype__proto.local = setOffsetToLocal;
+ momentPrototype__proto.parseZone = setOffsetToParsedOffset;
+ momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset;
+ momentPrototype__proto.isDST = isDaylightSavingTime;
+ momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted;
+ momentPrototype__proto.isLocal = isLocal;
+ momentPrototype__proto.isUtcOffset = isUtcOffset;
+ momentPrototype__proto.isUtc = isUtc;
+ momentPrototype__proto.isUTC = isUtc;
+
+ // Timezone
+ momentPrototype__proto.zoneAbbr = getZoneAbbr;
+ momentPrototype__proto.zoneName = getZoneName;
+
+ // Deprecations
+ momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth);
+ momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth);
+ momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear);
+ momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone);
+
+ var momentPrototype = momentPrototype__proto;
+
+ function moment__createUnix (input) {
+ return local__createLocal(input * 1000);
+ }
+
+ function moment__createInZone () {
+ return local__createLocal.apply(null, arguments).parseZone();
+ }
+
+ var defaultCalendar = {
+ sameDay : '[Today at] LT',
+ nextDay : '[Tomorrow at] LT',
+ nextWeek : 'dddd [at] LT',
+ lastDay : '[Yesterday at] LT',
+ lastWeek : '[Last] dddd [at] LT',
+ sameElse : 'L'
+ };
+
+ function locale_calendar__calendar (key, mom, now) {
+ var output = this._calendar[key];
+ return isFunction(output) ? output.call(mom, now) : output;
+ }
+
+ var defaultLongDateFormat = {
+ LTS : 'h:mm:ss A',
+ LT : 'h:mm A',
+ L : 'MM/DD/YYYY',
+ LL : 'MMMM D, YYYY',
+ LLL : 'MMMM D, YYYY h:mm A',
+ LLLL : 'dddd, MMMM D, YYYY h:mm A'
+ };
+
+ function longDateFormat (key) {
+ var format = this._longDateFormat[key],
+ formatUpper = this._longDateFormat[key.toUpperCase()];
+
+ if (format || !formatUpper) {
+ return format;
+ }
+
+ this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) {
+ return val.slice(1);
+ });
+
+ return this._longDateFormat[key];
+ }
+
+ var defaultInvalidDate = 'Invalid date';
+
+ function invalidDate () {
+ return this._invalidDate;
+ }
+
+ var defaultOrdinal = '%d';
+ var defaultOrdinalParse = /\d{1,2}/;
+
+ function ordinal (number) {
+ return this._ordinal.replace('%d', number);
+ }
+
+ function preParsePostFormat (string) {
+ return string;
+ }
+
+ var defaultRelativeTime = {
+ future : 'in %s',
+ past : '%s ago',
+ s : 'a few seconds',
+ m : 'a minute',
+ mm : '%d minutes',
+ h : 'an hour',
+ hh : '%d hours',
+ d : 'a day',
+ dd : '%d days',
+ M : 'a month',
+ MM : '%d months',
+ y : 'a year',
+ yy : '%d years'
+ };
+
+ function relative__relativeTime (number, withoutSuffix, string, isFuture) {
+ var output = this._relativeTime[string];
+ return (isFunction(output)) ?
+ output(number, withoutSuffix, string, isFuture) :
+ output.replace(/%d/i, number);
+ }
+
+ function pastFuture (diff, output) {
+ var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
+ return isFunction(format) ? format(output) : format.replace(/%s/i, output);
+ }
+
+ function locale_set__set (config) {
+ var prop, i;
+ for (i in config) {
+ prop = config[i];
+ if (isFunction(prop)) {
+ this[i] = prop;
+ } else {
+ this['_' + i] = prop;
+ }
+ }
+ // Lenient ordinal parsing accepts just a number in addition to
+ // number + (possibly) stuff coming from _ordinalParseLenient.
+ this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source);
+ }
+
+ var prototype__proto = Locale.prototype;
+
+ prototype__proto._calendar = defaultCalendar;
+ prototype__proto.calendar = locale_calendar__calendar;
+ prototype__proto._longDateFormat = defaultLongDateFormat;
+ prototype__proto.longDateFormat = longDateFormat;
+ prototype__proto._invalidDate = defaultInvalidDate;
+ prototype__proto.invalidDate = invalidDate;
+ prototype__proto._ordinal = defaultOrdinal;
+ prototype__proto.ordinal = ordinal;
+ prototype__proto._ordinalParse = defaultOrdinalParse;
+ prototype__proto.preparse = preParsePostFormat;
+ prototype__proto.postformat = preParsePostFormat;
+ prototype__proto._relativeTime = defaultRelativeTime;
+ prototype__proto.relativeTime = relative__relativeTime;
+ prototype__proto.pastFuture = pastFuture;
+ prototype__proto.set = locale_set__set;
+
+ // Month
+ prototype__proto.months = localeMonths;
+ prototype__proto._months = defaultLocaleMonths;
+ prototype__proto.monthsShort = localeMonthsShort;
+ prototype__proto._monthsShort = defaultLocaleMonthsShort;
+ prototype__proto.monthsParse = localeMonthsParse;
+ prototype__proto._monthsRegex = defaultMonthsRegex;
+ prototype__proto.monthsRegex = monthsRegex;
+ prototype__proto._monthsShortRegex = defaultMonthsShortRegex;
+ prototype__proto.monthsShortRegex = monthsShortRegex;
+
+ // Week
+ prototype__proto.week = localeWeek;
+ prototype__proto._week = defaultLocaleWeek;
+ prototype__proto.firstDayOfYear = localeFirstDayOfYear;
+ prototype__proto.firstDayOfWeek = localeFirstDayOfWeek;
+
+ // Day of Week
+ prototype__proto.weekdays = localeWeekdays;
+ prototype__proto._weekdays = defaultLocaleWeekdays;
+ prototype__proto.weekdaysMin = localeWeekdaysMin;
+ prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin;
+ prototype__proto.weekdaysShort = localeWeekdaysShort;
+ prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort;
+ prototype__proto.weekdaysParse = localeWeekdaysParse;
+
+ // Hours
+ prototype__proto.isPM = localeIsPM;
+ prototype__proto._meridiemParse = defaultLocaleMeridiemParse;
+ prototype__proto.meridiem = localeMeridiem;
+
+ function lists__get (format, index, field, setter) {
+ var locale = locale_locales__getLocale();
+ var utc = create_utc__createUTC().set(setter, index);
+ return locale[field](utc, format);
+ }
+
+ function list (format, index, field, count, setter) {
+ if (typeof format === 'number') {
+ index = format;
+ format = undefined;
+ }
+
+ format = format || '';
+
+ if (index != null) {
+ return lists__get(format, index, field, setter);
+ }
+
+ var i;
+ var out = [];
+ for (i = 0; i < count; i++) {
+ out[i] = lists__get(format, i, field, setter);
+ }
+ return out;
+ }
+
+ function lists__listMonths (format, index) {
+ return list(format, index, 'months', 12, 'month');
+ }
+
+ function lists__listMonthsShort (format, index) {
+ return list(format, index, 'monthsShort', 12, 'month');
+ }
+
+ function lists__listWeekdays (format, index) {
+ return list(format, index, 'weekdays', 7, 'day');
+ }
+
+ function lists__listWeekdaysShort (format, index) {
+ return list(format, index, 'weekdaysShort', 7, 'day');
+ }
+
+ function lists__listWeekdaysMin (format, index) {
+ return list(format, index, 'weekdaysMin', 7, 'day');
+ }
+
+ locale_locales__getSetGlobalLocale('en', {
+ ordinalParse: /\d{1,2}(th|st|nd|rd)/,
+ ordinal : function (number) {
+ var b = number % 10,
+ output = (toInt(number % 100 / 10) === 1) ? 'th' :
+ (b === 1) ? 'st' :
+ (b === 2) ? 'nd' :
+ (b === 3) ? 'rd' : 'th';
+ return number + output;
+ }
+ });
+
+ // Side effect imports
+ utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale);
+ utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale);
+
+ var mathAbs = Math.abs;
+
+ function duration_abs__abs () {
+ var data = this._data;
+
+ this._milliseconds = mathAbs(this._milliseconds);
+ this._days = mathAbs(this._days);
+ this._months = mathAbs(this._months);
+
+ data.milliseconds = mathAbs(data.milliseconds);
+ data.seconds = mathAbs(data.seconds);
+ data.minutes = mathAbs(data.minutes);
+ data.hours = mathAbs(data.hours);
+ data.months = mathAbs(data.months);
+ data.years = mathAbs(data.years);
+
+ return this;
+ }
+
+ function duration_add_subtract__addSubtract (duration, input, value, direction) {
+ var other = create__createDuration(input, value);
+
+ duration._milliseconds += direction * other._milliseconds;
+ duration._days += direction * other._days;
+ duration._months += direction * other._months;
+
+ return duration._bubble();
+ }
+
+ // supports only 2.0-style add(1, 's') or add(duration)
+ function duration_add_subtract__add (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, 1);
+ }
+
+ // supports only 2.0-style subtract(1, 's') or subtract(duration)
+ function duration_add_subtract__subtract (input, value) {
+ return duration_add_subtract__addSubtract(this, input, value, -1);
+ }
+
+ function absCeil (number) {
+ if (number < 0) {
+ return Math.floor(number);
+ } else {
+ return Math.ceil(number);
+ }
+ }
+
+ function bubble () {
+ var milliseconds = this._milliseconds;
+ var days = this._days;
+ var months = this._months;
+ var data = this._data;
+ var seconds, minutes, hours, years, monthsFromDays;
+
+ // if we have a mix of positive and negative values, bubble down first
+ // check: https://github.com/moment/moment/issues/2166
+ if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
+ (milliseconds <= 0 && days <= 0 && months <= 0))) {
+ milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
+ days = 0;
+ months = 0;
+ }
+
+ // The following code bubbles up values, see the tests for
+ // examples of what that means.
+ data.milliseconds = milliseconds % 1000;
+
+ seconds = absFloor(milliseconds / 1000);
+ data.seconds = seconds % 60;
+
+ minutes = absFloor(seconds / 60);
+ data.minutes = minutes % 60;
+
+ hours = absFloor(minutes / 60);
+ data.hours = hours % 24;
+
+ days += absFloor(hours / 24);
+
+ // convert days to months
+ monthsFromDays = absFloor(daysToMonths(days));
+ months += monthsFromDays;
+ days -= absCeil(monthsToDays(monthsFromDays));
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+ data.days = days;
+ data.months = months;
+ data.years = years;
+
+ return this;
+ }
+
+ function daysToMonths (days) {
+ // 400 years have 146097 days (taking into account leap year rules)
+ // 400 years have 12 months === 4800
+ return days * 4800 / 146097;
+ }
+
+ function monthsToDays (months) {
+ // the reverse of daysToMonths
+ return months * 146097 / 4800;
+ }
+
+ function as (units) {
+ var days;
+ var months;
+ var milliseconds = this._milliseconds;
+
+ units = normalizeUnits(units);
+
+ if (units === 'month' || units === 'year') {
+ days = this._days + milliseconds / 864e5;
+ months = this._months + daysToMonths(days);
+ return units === 'month' ? months : months / 12;
+ } else {
+ // handle milliseconds separately because of floating point math errors (issue #1867)
+ days = this._days + Math.round(monthsToDays(this._months));
+ switch (units) {
+ case 'week' : return days / 7 + milliseconds / 6048e5;
+ case 'day' : return days + milliseconds / 864e5;
+ case 'hour' : return days * 24 + milliseconds / 36e5;
+ case 'minute' : return days * 1440 + milliseconds / 6e4;
+ case 'second' : return days * 86400 + milliseconds / 1000;
+ // Math.floor prevents floating point math errors here
+ case 'millisecond': return Math.floor(days * 864e5) + milliseconds;
+ default: throw new Error('Unknown unit ' + units);
+ }
+ }
+ }
+
+ // TODO: Use this.as('ms')?
+ function duration_as__valueOf () {
+ return (
+ this._milliseconds +
+ this._days * 864e5 +
+ (this._months % 12) * 2592e6 +
+ toInt(this._months / 12) * 31536e6
+ );
+ }
+
+ function makeAs (alias) {
+ return function () {
+ return this.as(alias);
+ };
+ }
+
+ var asMilliseconds = makeAs('ms');
+ var asSeconds = makeAs('s');
+ var asMinutes = makeAs('m');
+ var asHours = makeAs('h');
+ var asDays = makeAs('d');
+ var asWeeks = makeAs('w');
+ var asMonths = makeAs('M');
+ var asYears = makeAs('y');
+
+ function duration_get__get (units) {
+ units = normalizeUnits(units);
+ return this[units + 's']();
+ }
+
+ function makeGetter(name) {
+ return function () {
+ return this._data[name];
+ };
+ }
+
+ var milliseconds = makeGetter('milliseconds');
+ var seconds = makeGetter('seconds');
+ var minutes = makeGetter('minutes');
+ var hours = makeGetter('hours');
+ var days = makeGetter('days');
+ var months = makeGetter('months');
+ var years = makeGetter('years');
+
+ function weeks () {
+ return absFloor(this.days() / 7);
+ }
+
+ var round = Math.round;
+ var thresholds = {
+ s: 45, // seconds to minute
+ m: 45, // minutes to hour
+ h: 22, // hours to day
+ d: 26, // days to month
+ M: 11 // months to year
+ };
+
+ // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
+ function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
+ return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
+ }
+
+ function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) {
+ var duration = create__createDuration(posNegDuration).abs();
+ var seconds = round(duration.as('s'));
+ var minutes = round(duration.as('m'));
+ var hours = round(duration.as('h'));
+ var days = round(duration.as('d'));
+ var months = round(duration.as('M'));
+ var years = round(duration.as('y'));
+
+ var a = seconds < thresholds.s && ['s', seconds] ||
+ minutes <= 1 && ['m'] ||
+ minutes < thresholds.m && ['mm', minutes] ||
+ hours <= 1 && ['h'] ||
+ hours < thresholds.h && ['hh', hours] ||
+ days <= 1 && ['d'] ||
+ days < thresholds.d && ['dd', days] ||
+ months <= 1 && ['M'] ||
+ months < thresholds.M && ['MM', months] ||
+ years <= 1 && ['y'] || ['yy', years];
+
+ a[2] = withoutSuffix;
+ a[3] = +posNegDuration > 0;
+ a[4] = locale;
+ return substituteTimeAgo.apply(null, a);
+ }
+
+ // This function allows you to set a threshold for relative time strings
+ function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) {
+ if (thresholds[threshold] === undefined) {
+ return false;
+ }
+ if (limit === undefined) {
+ return thresholds[threshold];
+ }
+ thresholds[threshold] = limit;
+ return true;
+ }
+
+ function humanize (withSuffix) {
+ var locale = this.localeData();
+ var output = duration_humanize__relativeTime(this, !withSuffix, locale);
+
+ if (withSuffix) {
+ output = locale.pastFuture(+this, output);
+ }
+
+ return locale.postformat(output);
+ }
+
+ var iso_string__abs = Math.abs;
+
+ function iso_string__toISOString() {
+ // for ISO strings we do not use the normal bubbling rules:
+ // * milliseconds bubble up until they become hours
+ // * days do not bubble at all
+ // * months bubble up until they become years
+ // This is because there is no context-free conversion between hours and days
+ // (think of clock changes)
+ // and also not between days and months (28-31 days per month)
+ var seconds = iso_string__abs(this._milliseconds) / 1000;
+ var days = iso_string__abs(this._days);
+ var months = iso_string__abs(this._months);
+ var minutes, hours, years;
+
+ // 3600 seconds -> 60 minutes -> 1 hour
+ minutes = absFloor(seconds / 60);
+ hours = absFloor(minutes / 60);
+ seconds %= 60;
+ minutes %= 60;
+
+ // 12 months -> 1 year
+ years = absFloor(months / 12);
+ months %= 12;
+
+
+ // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
+ var Y = years;
+ var M = months;
+ var D = days;
+ var h = hours;
+ var m = minutes;
+ var s = seconds;
+ var total = this.asSeconds();
+
+ if (!total) {
+ // this is the same as C#'s (Noda) and python (isodate)...
+ // but not other JS (goog.date)
+ return 'P0D';
+ }
+
+ return (total < 0 ? '-' : '') +
+ 'P' +
+ (Y ? Y + 'Y' : '') +
+ (M ? M + 'M' : '') +
+ (D ? D + 'D' : '') +
+ ((h || m || s) ? 'T' : '') +
+ (h ? h + 'H' : '') +
+ (m ? m + 'M' : '') +
+ (s ? s + 'S' : '');
+ }
+
+ var duration_prototype__proto = Duration.prototype;
+
+ duration_prototype__proto.abs = duration_abs__abs;
+ duration_prototype__proto.add = duration_add_subtract__add;
+ duration_prototype__proto.subtract = duration_add_subtract__subtract;
+ duration_prototype__proto.as = as;
+ duration_prototype__proto.asMilliseconds = asMilliseconds;
+ duration_prototype__proto.asSeconds = asSeconds;
+ duration_prototype__proto.asMinutes = asMinutes;
+ duration_prototype__proto.asHours = asHours;
+ duration_prototype__proto.asDays = asDays;
+ duration_prototype__proto.asWeeks = asWeeks;
+ duration_prototype__proto.asMonths = asMonths;
+ duration_prototype__proto.asYears = asYears;
+ duration_prototype__proto.valueOf = duration_as__valueOf;
+ duration_prototype__proto._bubble = bubble;
+ duration_prototype__proto.get = duration_get__get;
+ duration_prototype__proto.milliseconds = milliseconds;
+ duration_prototype__proto.seconds = seconds;
+ duration_prototype__proto.minutes = minutes;
+ duration_prototype__proto.hours = hours;
+ duration_prototype__proto.days = days;
+ duration_prototype__proto.weeks = weeks;
+ duration_prototype__proto.months = months;
+ duration_prototype__proto.years = years;
+ duration_prototype__proto.humanize = humanize;
+ duration_prototype__proto.toISOString = iso_string__toISOString;
+ duration_prototype__proto.toString = iso_string__toISOString;
+ duration_prototype__proto.toJSON = iso_string__toISOString;
+ duration_prototype__proto.locale = locale;
+ duration_prototype__proto.localeData = localeData;
+
+ // Deprecations
+ duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString);
+ duration_prototype__proto.lang = lang;
+
+ // Side effect imports
+
+ // FORMATTING
+
+ addFormatToken('X', 0, 0, 'unix');
+ addFormatToken('x', 0, 0, 'valueOf');
+
+ // PARSING
+
+ addRegexToken('x', matchSigned);
+ addRegexToken('X', matchTimestamp);
+ addParseToken('X', function (input, array, config) {
+ config._d = new Date(parseFloat(input, 10) * 1000);
+ });
+ addParseToken('x', function (input, array, config) {
+ config._d = new Date(toInt(input));
+ });
+
+ // Side effect imports
+
+
+ utils_hooks__hooks.version = '2.11.1';
+
+ setHookCallback(local__createLocal);
+
+ utils_hooks__hooks.fn = momentPrototype;
+ utils_hooks__hooks.min = min;
+ utils_hooks__hooks.max = max;
+ utils_hooks__hooks.now = now;
+ utils_hooks__hooks.utc = create_utc__createUTC;
+ utils_hooks__hooks.unix = moment__createUnix;
+ utils_hooks__hooks.months = lists__listMonths;
+ utils_hooks__hooks.isDate = isDate;
+ utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale;
+ utils_hooks__hooks.invalid = valid__createInvalid;
+ utils_hooks__hooks.duration = create__createDuration;
+ utils_hooks__hooks.isMoment = isMoment;
+ utils_hooks__hooks.weekdays = lists__listWeekdays;
+ utils_hooks__hooks.parseZone = moment__createInZone;
+ utils_hooks__hooks.localeData = locale_locales__getLocale;
+ utils_hooks__hooks.isDuration = isDuration;
+ utils_hooks__hooks.monthsShort = lists__listMonthsShort;
+ utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin;
+ utils_hooks__hooks.defineLocale = defineLocale;
+ utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort;
+ utils_hooks__hooks.normalizeUnits = normalizeUnits;
+ utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold;
+ utils_hooks__hooks.prototype = momentPrototype;
+
+ var _moment = utils_hooks__hooks;
+
+ return _moment;
+
+})); \ No newline at end of file
diff --git a/src_js/rickshaw.js b/src_js/rickshaw.js
new file mode 100644
index 0000000..c2d5519
--- /dev/null
+++ b/src_js/rickshaw.js
@@ -0,0 +1,4068 @@
+(function (root, factory) {
+ if (typeof define === 'function' && define.amd) {
+ define(['d3'], function (d3) {
+ return (root.Rickshaw = factory(d3));
+ });
+ } else if (typeof exports === 'object') {
+ module.exports = factory(require('d3'));
+ } else {
+ root.Rickshaw = factory(d3);
+ }
+}(this, function (d3) {
+/* jshint -W079 */
+
+var Rickshaw = {
+
+ namespace: function(namespace, obj) {
+
+ var parts = namespace.split('.');
+
+ var parent = Rickshaw;
+
+ for(var i = 1, length = parts.length; i < length; i++) {
+ var currentPart = parts[i];
+ parent[currentPart] = parent[currentPart] || {};
+ parent = parent[currentPart];
+ }
+ return parent;
+ },
+
+ keys: function(obj) {
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ return keys;
+ },
+
+ extend: function(destination, source) {
+
+ for (var property in source) {
+ destination[property] = source[property];
+ }
+ return destination;
+ },
+
+ clone: function(obj) {
+ return JSON.parse(JSON.stringify(obj));
+ }
+};
+/* Adapted from https://github.com/Jakobo/PTClass */
+
+/*
+Copyright (c) 2005-2010 Sam Stephenson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+/* Based on Alex Arnell's inheritance implementation. */
+/** section: Language
+ * class Class
+ *
+ * Manages Prototype's class-based OOP system.
+ *
+ * Refer to Prototype's web site for a [tutorial on classes and
+ * inheritance](http://prototypejs.org/learn/class-inheritance).
+**/
+(function(globalContext) {
+/* ------------------------------------ */
+/* Import from object.js */
+/* ------------------------------------ */
+var _toString = Object.prototype.toString,
+ NULL_TYPE = 'Null',
+ UNDEFINED_TYPE = 'Undefined',
+ BOOLEAN_TYPE = 'Boolean',
+ NUMBER_TYPE = 'Number',
+ STRING_TYPE = 'String',
+ OBJECT_TYPE = 'Object',
+ FUNCTION_CLASS = '[object Function]';
+function isFunction(object) {
+ return _toString.call(object) === FUNCTION_CLASS;
+}
+function extend(destination, source) {
+ for (var property in source) if (source.hasOwnProperty(property)) // modify protect primitive slaughter
+ destination[property] = source[property];
+ return destination;
+}
+function keys(object) {
+ if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); }
+ var results = [];
+ for (var property in object) {
+ if (object.hasOwnProperty(property)) {
+ results.push(property);
+ }
+ }
+ return results;
+}
+function Type(o) {
+ switch(o) {
+ case null: return NULL_TYPE;
+ case (void 0): return UNDEFINED_TYPE;
+ }
+ var type = typeof o;
+ switch(type) {
+ case 'boolean': return BOOLEAN_TYPE;
+ case 'number': return NUMBER_TYPE;
+ case 'string': return STRING_TYPE;
+ }
+ return OBJECT_TYPE;
+}
+function isUndefined(object) {
+ return typeof object === "undefined";
+}
+/* ------------------------------------ */
+/* Import from Function.js */
+/* ------------------------------------ */
+var slice = Array.prototype.slice;
+function argumentNames(fn) {
+ var names = fn.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
+ .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
+ .replace(/\s+/g, '').split(',');
+ return names.length == 1 && !names[0] ? [] : names;
+}
+function wrap(fn, wrapper) {
+ var __method = fn;
+ return function() {
+ var a = update([bind(__method, this)], arguments);
+ return wrapper.apply(this, a);
+ }
+}
+function update(array, args) {
+ var arrayLength = array.length, length = args.length;
+ while (length--) array[arrayLength + length] = args[length];
+ return array;
+}
+function merge(array, args) {
+ array = slice.call(array, 0);
+ return update(array, args);
+}
+function bind(fn, context) {
+ if (arguments.length < 2 && isUndefined(arguments[0])) return this;
+ var __method = fn, args = slice.call(arguments, 2);
+ return function() {
+ var a = merge(args, arguments);
+ return __method.apply(context, a);
+ }
+}
+
+/* ------------------------------------ */
+/* Import from Prototype.js */
+/* ------------------------------------ */
+var emptyFunction = function(){};
+
+var Class = (function() {
+
+ // Some versions of JScript fail to enumerate over properties, names of which
+ // correspond to non-enumerable properties in the prototype chain
+ var IS_DONTENUM_BUGGY = (function(){
+ for (var p in { toString: 1 }) {
+ // check actual property name, so that it works with augmented Object.prototype
+ if (p === 'toString') return false;
+ }
+ return true;
+ })();
+
+ function subclass() {};
+ function create() {
+ var parent = null, properties = [].slice.apply(arguments);
+ if (isFunction(properties[0]))
+ parent = properties.shift();
+
+ function klass() {
+ this.initialize.apply(this, arguments);
+ }
+
+ extend(klass, Class.Methods);
+ klass.superclass = parent;
+ klass.subclasses = [];
+
+ if (parent) {
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ try { parent.subclasses.push(klass) } catch(e) {}
+ }
+
+ for (var i = 0, length = properties.length; i < length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = emptyFunction;
+
+ klass.prototype.constructor = klass;
+ return klass;
+ }
+
+ function addMethods(source) {
+ var ancestor = this.superclass && this.superclass.prototype,
+ properties = keys(source);
+
+ // IE6 doesn't enumerate `toString` and `valueOf` (among other built-in `Object.prototype`) properties,
+ // Force copy if they're not Object.prototype ones.
+ // Do not copy other Object.prototype.* for performance reasons
+ if (IS_DONTENUM_BUGGY) {
+ if (source.toString != Object.prototype.toString)
+ properties.push("toString");
+ if (source.valueOf != Object.prototype.valueOf)
+ properties.push("valueOf");
+ }
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && isFunction(value) &&
+ argumentNames(value)[0] == "$super") {
+ var method = value;
+ value = wrap((function(m) {
+ return function() { return ancestor[m].apply(this, arguments); };
+ })(property), method);
+
+ value.valueOf = bind(method.valueOf, method);
+ value.toString = bind(method.toString, method);
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ }
+
+ return {
+ create: create,
+ Methods: {
+ addMethods: addMethods
+ }
+ };
+})();
+
+if (globalContext.exports) {
+ globalContext.exports.Class = Class;
+}
+else {
+ globalContext.Class = Class;
+}
+})(Rickshaw);
+Rickshaw.namespace('Rickshaw.Compat.ClassList');
+
+Rickshaw.Compat.ClassList = function() {
+
+ /* adapted from http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
+
+ if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
+
+ (function (view) {
+
+ "use strict";
+
+ var
+ classListProp = "classList"
+ , protoProp = "prototype"
+ , elemCtrProto = (view.HTMLElement || view.Element)[protoProp]
+ , objCtr = Object
+ , strTrim = String[protoProp].trim || function () {
+ return this.replace(/^\s+|\s+$/g, "");
+ }
+ , arrIndexOf = Array[protoProp].indexOf || function (item) {
+ var
+ i = 0
+ , len = this.length
+ ;
+ for (; i < len; i++) {
+ if (i in this && this[i] === item) {
+ return i;
+ }
+ }
+ return -1;
+ }
+ // Vendors: please allow content code to instantiate DOMExceptions
+ , DOMEx = function (type, message) {
+ this.name = type;
+ this.code = DOMException[type];
+ this.message = message;
+ }
+ , checkTokenAndGetIndex = function (classList, token) {
+ if (token === "") {
+ throw new DOMEx(
+ "SYNTAX_ERR"
+ , "An invalid or illegal string was specified"
+ );
+ }
+ if (/\s/.test(token)) {
+ throw new DOMEx(
+ "INVALID_CHARACTER_ERR"
+ , "String contains an invalid character"
+ );
+ }
+ return arrIndexOf.call(classList, token);
+ }
+ , ClassList = function (elem) {
+ var
+ trimmedClasses = strTrim.call(elem.className)
+ , classes = trimmedClasses ? trimmedClasses.split(/\s+/) : []
+ , i = 0
+ , len = classes.length
+ ;
+ for (; i < len; i++) {
+ this.push(classes[i]);
+ }
+ this._updateClassName = function () {
+ elem.className = this.toString();
+ };
+ }
+ , classListProto = ClassList[protoProp] = []
+ , classListGetter = function () {
+ return new ClassList(this);
+ }
+ ;
+ // Most DOMException implementations don't allow calling DOMException's toString()
+ // on non-DOMExceptions. Error's toString() is sufficient here.
+ DOMEx[protoProp] = Error[protoProp];
+ classListProto.item = function (i) {
+ return this[i] || null;
+ };
+ classListProto.contains = function (token) {
+ token += "";
+ return checkTokenAndGetIndex(this, token) !== -1;
+ };
+ classListProto.add = function (token) {
+ token += "";
+ if (checkTokenAndGetIndex(this, token) === -1) {
+ this.push(token);
+ this._updateClassName();
+ }
+ };
+ classListProto.remove = function (token) {
+ token += "";
+ var index = checkTokenAndGetIndex(this, token);
+ if (index !== -1) {
+ this.splice(index, 1);
+ this._updateClassName();
+ }
+ };
+ classListProto.toggle = function (token) {
+ token += "";
+ if (checkTokenAndGetIndex(this, token) === -1) {
+ this.add(token);
+ } else {
+ this.remove(token);
+ }
+ };
+ classListProto.toString = function () {
+ return this.join(" ");
+ };
+
+ if (objCtr.defineProperty) {
+ var classListPropDesc = {
+ get: classListGetter
+ , enumerable: true
+ , configurable: true
+ };
+ try {
+ objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
+ } catch (ex) { // IE 8 doesn't support enumerable:true
+ if (ex.number === -0x7FF5EC54) {
+ classListPropDesc.enumerable = false;
+ objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
+ }
+ }
+ } else if (objCtr[protoProp].__defineGetter__) {
+ elemCtrProto.__defineGetter__(classListProp, classListGetter);
+ }
+
+ }(window));
+
+ }
+};
+
+if ( (typeof RICKSHAW_NO_COMPAT !== "undefined" && !RICKSHAW_NO_COMPAT) || typeof RICKSHAW_NO_COMPAT === "undefined") {
+ new Rickshaw.Compat.ClassList();
+}
+Rickshaw.namespace('Rickshaw.Graph');
+
+Rickshaw.Graph = function(args) {
+
+ var self = this;
+
+ this.initialize = function(args) {
+
+ if (!args.element) throw "Rickshaw.Graph needs a reference to an element";
+ if (args.element.nodeType !== 1) throw "Rickshaw.Graph element was defined but not an HTML element";
+
+ this.element = args.element;
+ this.series = args.series;
+ this.window = {};
+
+ this.updateCallbacks = [];
+ this.configureCallbacks = [];
+
+ this.defaults = {
+ interpolation: 'cardinal',
+ offset: 'zero',
+ min: undefined,
+ max: undefined,
+ preserve: false,
+ xScale: undefined,
+ yScale: undefined,
+ stack: true
+ };
+
+ this._loadRenderers();
+ this.configure(args);
+ this.validateSeries(args.series);
+
+ this.series.active = function() { return self.series.filter( function(s) { return !s.disabled } ) };
+ this.setSize({ width: args.width, height: args.height });
+ this.element.classList.add('rickshaw_graph');
+
+ this.vis = d3.select(this.element)
+ .append("svg:svg")
+ .attr('width', this.width)
+ .attr('height', this.height);
+
+ this.discoverRange();
+ };
+
+ this._loadRenderers = function() {
+
+ for (var name in Rickshaw.Graph.Renderer) {
+ if (!name || !Rickshaw.Graph.Renderer.hasOwnProperty(name)) continue;
+ var r = Rickshaw.Graph.Renderer[name];
+ if (!r || !r.prototype || !r.prototype.render) continue;
+ self.registerRenderer(new r( { graph: self } ));
+ }
+ };
+
+ this.validateSeries = function(series) {
+
+ if (!Array.isArray(series) && !(series instanceof Rickshaw.Series)) {
+ var seriesSignature = Object.prototype.toString.apply(series);
+ throw "series is not an array: " + seriesSignature;
+ }
+
+ var pointsCount;
+
+ series.forEach( function(s) {
+
+ if (!(s instanceof Object)) {
+ throw "series element is not an object: " + s;
+ }
+ if (!(s.data)) {
+ throw "series has no data: " + JSON.stringify(s);
+ }
+ if (!Array.isArray(s.data)) {
+ throw "series data is not an array: " + JSON.stringify(s.data);
+ }
+
+ if (s.data.length > 0) {
+ var x = s.data[0].x;
+ var y = s.data[0].y;
+
+ if (typeof x != 'number' || ( typeof y != 'number' && y !== null ) ) {
+ throw "x and y properties of points should be numbers instead of " +
+ (typeof x) + " and " + (typeof y);
+ }
+ }
+
+ if (s.data.length >= 3) {
+ // probe to sanity check sort order
+ if (s.data[2].x < s.data[1].x || s.data[1].x < s.data[0].x || s.data[s.data.length - 1].x < s.data[0].x) {
+ throw "series data needs to be sorted on x values for series name: " + s.name;
+ }
+ }
+
+ }, this );
+ };
+
+ this.dataDomain = function() {
+
+ var data = this.series.map( function(s) { return s.data } );
+
+ var min = d3.min( data.map( function(d) { return d[0].x } ) );
+ var max = d3.max( data.map( function(d) { return d[d.length - 1].x } ) );
+
+ return [min, max];
+ };
+
+ this.discoverRange = function() {
+
+ var domain = this.renderer.domain();
+
+ // this.*Scale is coming from the configuration dictionary
+ // which may be referenced by the Graph creator, or shared
+ // with other Graphs. We need to ensure we copy the scale
+ // so that our mutations do not change the object given to us.
+ // Hence the .copy()
+ this.x = (this.xScale || d3.scale.linear()).copy().domain(domain.x).range([0, this.width]);
+ this.y = (this.yScale || d3.scale.linear()).copy().domain(domain.y).range([this.height, 0]);
+
+ this.x.magnitude = d3.scale.linear()
+ .domain([domain.x[0] - domain.x[0], domain.x[1] - domain.x[0]])
+ .range([0, this.width]);
+
+ this.y.magnitude = d3.scale.linear()
+ .domain([domain.y[0] - domain.y[0], domain.y[1] - domain.y[0]])
+ .range([0, this.height]);
+ };
+
+ this.render = function() {
+
+ var stackedData = this.stackData();
+ this.discoverRange();
+
+ this.renderer.render();
+
+ this.updateCallbacks.forEach( function(callback) {
+ callback();
+ } );
+
+ };
+
+ this.update = this.render;
+
+ this.stackData = function() {
+
+ var data = this.series.active()
+ .map( function(d) { return d.data } )
+ .map( function(d) { return d.filter( function(d) { return this._slice(d) }, this ) }, this);
+
+ var preserve = this.preserve;
+ if (!preserve) {
+ this.series.forEach( function(series) {
+ if (series.scale) {
+ // data must be preserved when a scale is used
+ preserve = true;
+ }
+ } );
+ }
+
+ data = preserve ? Rickshaw.clone(data) : data;
+
+ this.series.active().forEach( function(series, index) {
+ if (series.scale) {
+ // apply scale to each series
+ var seriesData = data[index];
+ if(seriesData) {
+ seriesData.forEach( function(d) {
+ d.y = series.scale(d.y);
+ } );
+ }
+ }
+ } );
+
+ this.stackData.hooks.data.forEach( function(entry) {
+ data = entry.f.apply(self, [data]);
+ } );
+
+ var stackedData;
+
+ if (!this.renderer.unstack) {
+
+ this._validateStackable();
+
+ var layout = d3.layout.stack();
+ layout.offset( self.offset );
+ stackedData = layout(data);
+ }
+
+ stackedData = stackedData || data;
+
+ if (this.renderer.unstack) {
+ stackedData.forEach( function(seriesData) {
+ seriesData.forEach( function(d) {
+ d.y0 = d.y0 === undefined ? 0 : d.y0;
+ } );
+ } );
+ }
+
+ this.stackData.hooks.after.forEach( function(entry) {
+ stackedData = entry.f.apply(self, [data]);
+ } );
+
+ var i = 0;
+ this.series.forEach( function(series) {
+ if (series.disabled) return;
+ series.stack = stackedData[i++];
+ } );
+
+ this.stackedData = stackedData;
+ return stackedData;
+ };
+
+ this._validateStackable = function() {
+
+ var series = this.series;
+ var pointsCount;
+
+ series.forEach( function(s) {
+
+ pointsCount = pointsCount || s.data.length;
+
+ if (pointsCount && s.data.length != pointsCount) {
+ throw "stacked series cannot have differing numbers of points: " +
+ pointsCount + " vs " + s.data.length + "; see Rickshaw.Series.fill()";
+ }
+
+ }, this );
+ };
+
+ this.stackData.hooks = { data: [], after: [] };
+
+ this._slice = function(d) {
+
+ if (this.window.xMin || this.window.xMax) {
+
+ var isInRange = true;
+
+ if (this.window.xMin && d.x < this.window.xMin) isInRange = false;
+ if (this.window.xMax && d.x > this.window.xMax) isInRange = false;
+
+ return isInRange;
+ }
+
+ return true;
+ };
+
+ this.onUpdate = function(callback) {
+ this.updateCallbacks.push(callback);
+ };
+
+ this.onConfigure = function(callback) {
+ this.configureCallbacks.push(callback);
+ };
+
+ this.registerRenderer = function(renderer) {
+ this._renderers = this._renderers || {};
+ this._renderers[renderer.name] = renderer;
+ };
+
+ this.configure = function(args) {
+
+ this.config = this.config || {};
+
+ if (args.width || args.height) {
+ this.setSize(args);
+ }
+
+ Rickshaw.keys(this.defaults).forEach( function(k) {
+ this.config[k] = k in args ? args[k]
+ : k in this ? this[k]
+ : this.defaults[k];
+ }, this );
+
+ Rickshaw.keys(this.config).forEach( function(k) {
+ this[k] = this.config[k];
+ }, this );
+
+ if ('stack' in args) args.unstack = !args.stack;
+
+ var renderer = args.renderer || (this.renderer && this.renderer.name) || 'stack';
+ this.setRenderer(renderer, args);
+
+ this.configureCallbacks.forEach( function(callback) {
+ callback(args);
+ } );
+ };
+
+ this.setRenderer = function(r, args) {
+ if (typeof r == 'function') {
+ this.renderer = new r( { graph: self } );
+ this.registerRenderer(this.renderer);
+ } else {
+ if (!this._renderers[r]) {
+ throw "couldn't find renderer " + r;
+ }
+ this.renderer = this._renderers[r];
+ }
+
+ if (typeof args == 'object') {
+ this.renderer.configure(args);
+ }
+ };
+
+ this.setSize = function(args) {
+
+ args = args || {};
+
+ if (typeof window !== undefined) {
+ var style = window.getComputedStyle(this.element, null);
+ var elementWidth = parseInt(style.getPropertyValue('width'), 10);
+ var elementHeight = parseInt(style.getPropertyValue('height'), 10);
+ }
+
+ this.width = args.width || elementWidth || 400;
+ this.height = args.height || elementHeight || 250;
+
+ this.vis && this.vis
+ .attr('width', this.width)
+ .attr('height', this.height);
+ };
+
+ this.initialize(args);
+};
+Rickshaw.namespace('Rickshaw.Fixtures.Color');
+
+Rickshaw.Fixtures.Color = function() {
+
+ this.schemes = {};
+
+ this.schemes.spectrum14 = [
+ '#ecb796',
+ '#dc8f70',
+ '#b2a470',
+ '#92875a',
+ '#716c49',
+ '#d2ed82',
+ '#bbe468',
+ '#a1d05d',
+ '#e7cbe6',
+ '#d8aad6',
+ '#a888c2',
+ '#9dc2d3',
+ '#649eb9',
+ '#387aa3'
+ ].reverse();
+
+ this.schemes.spectrum2000 = [
+ '#57306f',
+ '#514c76',
+ '#646583',
+ '#738394',
+ '#6b9c7d',
+ '#84b665',
+ '#a7ca50',
+ '#bfe746',
+ '#e2f528',
+ '#fff726',
+ '#ecdd00',
+ '#d4b11d',
+ '#de8800',
+ '#de4800',
+ '#c91515',
+ '#9a0000',
+ '#7b0429',
+ '#580839',
+ '#31082b'
+ ];
+
+ this.schemes.spectrum2001 = [
+ '#2f243f',
+ '#3c2c55',
+ '#4a3768',
+ '#565270',
+ '#6b6b7c',
+ '#72957f',
+ '#86ad6e',
+ '#a1bc5e',
+ '#b8d954',
+ '#d3e04e',
+ '#ccad2a',
+ '#cc8412',
+ '#c1521d',
+ '#ad3821',
+ '#8a1010',
+ '#681717',
+ '#531e1e',
+ '#3d1818',
+ '#320a1b'
+ ];
+
+ this.schemes.classic9 = [
+ '#423d4f',
+ '#4a6860',
+ '#848f39',
+ '#a2b73c',
+ '#ddcb53',
+ '#c5a32f',
+ '#7d5836',
+ '#963b20',
+ '#7c2626',
+ '#491d37',
+ '#2f254a'
+ ].reverse();
+
+ this.schemes.httpStatus = {
+ 503: '#ea5029',
+ 502: '#d23f14',
+ 500: '#bf3613',
+ 410: '#efacea',
+ 409: '#e291dc',
+ 403: '#f457e8',
+ 408: '#e121d2',
+ 401: '#b92dae',
+ 405: '#f47ceb',
+ 404: '#a82a9f',
+ 400: '#b263c6',
+ 301: '#6fa024',
+ 302: '#87c32b',
+ 307: '#a0d84c',
+ 304: '#28b55c',
+ 200: '#1a4f74',
+ 206: '#27839f',
+ 201: '#52adc9',
+ 202: '#7c979f',
+ 203: '#a5b8bd',
+ 204: '#c1cdd1'
+ };
+
+ this.schemes.colorwheel = [
+ '#b5b6a9',
+ '#858772',
+ '#785f43',
+ '#96557e',
+ '#4682b4',
+ '#65b9ac',
+ '#73c03a',
+ '#cb513a'
+ ].reverse();
+
+ this.schemes.cool = [
+ '#5e9d2f',
+ '#73c03a',
+ '#4682b4',
+ '#7bc3b8',
+ '#a9884e',
+ '#c1b266',
+ '#a47493',
+ '#c09fb5'
+ ];
+
+ this.schemes.munin = [
+ '#00cc00',
+ '#0066b3',
+ '#ff8000',
+ '#ffcc00',
+ '#330099',
+ '#990099',
+ '#ccff00',
+ '#ff0000',
+ '#808080',
+ '#008f00',
+ '#00487d',
+ '#b35a00',
+ '#b38f00',
+ '#6b006b',
+ '#8fb300',
+ '#b30000',
+ '#bebebe',
+ '#80ff80',
+ '#80c9ff',
+ '#ffc080',
+ '#ffe680',
+ '#aa80ff',
+ '#ee00cc',
+ '#ff8080',
+ '#666600',
+ '#ffbfff',
+ '#00ffcc',
+ '#cc6699',
+ '#999900'
+ ];
+};
+Rickshaw.namespace('Rickshaw.Fixtures.RandomData');
+
+Rickshaw.Fixtures.RandomData = function(timeInterval) {
+
+ var addData;
+ timeInterval = timeInterval || 1;
+
+ var lastRandomValue = 200;
+
+ var timeBase = Math.floor(new Date().getTime() / 1000);
+
+ this.addData = function(data) {
+
+ var randomValue = Math.random() * 100 + 15 + lastRandomValue;
+ var index = data[0].length;
+
+ var counter = 1;
+
+ data.forEach( function(series) {
+ var randomVariance = Math.random() * 20;
+ var v = randomValue / 25 + counter++ +
+ (Math.cos((index * counter * 11) / 960) + 2) * 15 +
+ (Math.cos(index / 7) + 2) * 7 +
+ (Math.cos(index / 17) + 2) * 1;
+
+ series.push( { x: (index * timeInterval) + timeBase, y: v + randomVariance } );
+ } );
+
+ lastRandomValue = randomValue * 0.85;
+ };
+
+ this.removeData = function(data) {
+ data.forEach( function(series) {
+ series.shift();
+ } );
+ timeBase += timeInterval;
+ };
+};
+
+Rickshaw.namespace('Rickshaw.Fixtures.Time');
+
+Rickshaw.Fixtures.Time = function() {
+
+ var self = this;
+
+ this.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+
+ this.units = [
+ {
+ name: 'decade',
+ seconds: 86400 * 365.25 * 10,
+ formatter: function(d) { return (parseInt(d.getUTCFullYear() / 10, 10) * 10) }
+ }, {
+ name: 'year',
+ seconds: 86400 * 365.25,
+ formatter: function(d) { return d.getUTCFullYear() }
+ }, {
+ name: 'month',
+ seconds: 86400 * 30.5,
+ formatter: function(d) { return self.months[d.getUTCMonth()] }
+ }, {
+ name: 'week',
+ seconds: 86400 * 7,
+ formatter: function(d) { return self.formatDate(d) }
+ }, {
+ name: 'day',
+ seconds: 86400,
+ formatter: function(d) { return d.getUTCDate() }
+ }, {
+ name: '6 hour',
+ seconds: 3600 * 6,
+ formatter: function(d) { return self.formatTime(d) }
+ }, {
+ name: 'hour',
+ seconds: 3600,
+ formatter: function(d) { return self.formatTime(d) }
+ }, {
+ name: '15 minute',
+ seconds: 60 * 15,
+ formatter: function(d) { return self.formatTime(d) }
+ }, {
+ name: 'minute',
+ seconds: 60,
+ formatter: function(d) { return d.getUTCMinutes() }
+ }, {
+ name: '15 second',
+ seconds: 15,
+ formatter: function(d) { return d.getUTCSeconds() + 's' }
+ }, {
+ name: 'second',
+ seconds: 1,
+ formatter: function(d) { return d.getUTCSeconds() + 's' }
+ }, {
+ name: 'decisecond',
+ seconds: 1/10,
+ formatter: function(d) { return d.getUTCMilliseconds() + 'ms' }
+ }, {
+ name: 'centisecond',
+ seconds: 1/100,
+ formatter: function(d) { return d.getUTCMilliseconds() + 'ms' }
+ }
+ ];
+
+ this.unit = function(unitName) {
+ return this.units.filter( function(unit) { return unitName == unit.name } ).shift();
+ };
+
+ this.formatDate = function(d) {
+ return d3.time.format('%b %e')(d);
+ };
+
+ this.formatTime = function(d) {
+ return d.toUTCString().match(/(\d+:\d+):/)[1];
+ };
+
+ this.ceil = function(time, unit) {
+
+ var date, floor, year;
+
+ if (unit.name == 'month') {
+
+ date = new Date(time * 1000);
+
+ floor = Date.UTC(date.getUTCFullYear(), date.getUTCMonth()) / 1000;
+ if (floor == time) return time;
+
+ year = date.getUTCFullYear();
+ var month = date.getUTCMonth();
+
+ if (month == 11) {
+ month = 0;
+ year = year + 1;
+ } else {
+ month += 1;
+ }
+
+ return Date.UTC(year, month) / 1000;
+ }
+
+ if (unit.name == 'year') {
+
+ date = new Date(time * 1000);
+
+ floor = Date.UTC(date.getUTCFullYear(), 0) / 1000;
+ if (floor == time) return time;
+
+ year = date.getUTCFullYear() + 1;
+
+ return Date.UTC(year, 0) / 1000;
+ }
+
+ return Math.ceil(time / unit.seconds) * unit.seconds;
+ };
+};
+Rickshaw.namespace('Rickshaw.Fixtures.Time.Local');
+
+Rickshaw.Fixtures.Time.Local = function() {
+
+ var self = this;
+
+ this.months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
+
+ this.units = [
+ {
+ name: 'decade',
+ seconds: 86400 * 365.25 * 10,
+ formatter: function(d) { return (parseInt(d.getFullYear() / 10, 10) * 10) }
+ }, {
+ name: 'year',
+ seconds: 86400 * 365.25,
+ formatter: function(d) { return d.getFullYear() }
+ }, {
+ name: 'month',
+ seconds: 86400 * 30.5,
+ formatter: function(d) { return self.months[d.getMonth()] }
+ }, {
+ name: 'week',
+ seconds: 86400 * 7,
+ formatter: function(d) { return self.formatDate(d) }
+ }, {
+ name: 'day',
+ seconds: 86400,
+ formatter: function(d) { return d.getDate() }
+ }, {
+ name: '6 hour',
+ seconds: 3600 * 6,
+ formatter: function(d) { return self.formatTime(d) }
+ }, {
+ name: 'hour',
+ seconds: 3600,
+ formatter: function(d) { return self.formatTime(d) }
+ }, {
+ name: '15 minute',
+ seconds: 60 * 15,
+ formatter: function(d) { return self.formatTime(d) }
+ }, {
+ name: 'minute',
+ seconds: 60,
+ formatter: function(d) { return d.getMinutes() }
+ }, {
+ name: '15 second',
+ seconds: 15,
+ formatter: function(d) { return d.getSeconds() + 's' }
+ }, {
+ name: 'second',
+ seconds: 1,
+ formatter: function(d) { return d.getSeconds() + 's' }
+ }, {
+ name: 'decisecond',
+ seconds: 1/10,
+ formatter: function(d) { return d.getMilliseconds() + 'ms' }
+ }, {
+ name: 'centisecond',
+ seconds: 1/100,
+ formatter: function(d) { return d.getMilliseconds() + 'ms' }
+ }
+ ];
+
+ this.unit = function(unitName) {
+ return this.units.filter( function(unit) { return unitName == unit.name } ).shift();
+ };
+
+ this.formatDate = function(d) {
+ return d3.time.format('%b %e')(d);
+ };
+
+ this.formatTime = function(d) {
+ return d.toString().match(/(\d+:\d+):/)[1];
+ };
+
+ this.ceil = function(time, unit) {
+
+ var date, floor, year;
+
+ if (unit.name == 'day') {
+
+ var nearFuture = new Date((time + unit.seconds - 1) * 1000);
+
+ var rounded = new Date(0);
+ rounded.setMilliseconds(0);
+ rounded.setSeconds(0);
+ rounded.setMinutes(0);
+ rounded.setHours(0);
+ rounded.setDate(nearFuture.getDate());
+ rounded.setMonth(nearFuture.getMonth());
+ rounded.setFullYear(nearFuture.getFullYear());
+
+ return rounded.getTime() / 1000;
+ }
+
+ if (unit.name == 'month') {
+
+ date = new Date(time * 1000);
+
+ floor = new Date(date.getFullYear(), date.getMonth()).getTime() / 1000;
+ if (floor == time) return time;
+
+ year = date.getFullYear();
+ var month = date.getMonth();
+
+ if (month == 11) {
+ month = 0;
+ year = year + 1;
+ } else {
+ month += 1;
+ }
+
+ return new Date(year, month).getTime() / 1000;
+ }
+
+ if (unit.name == 'year') {
+
+ date = new Date(time * 1000);
+
+ floor = new Date(date.getUTCFullYear(), 0).getTime() / 1000;
+ if (floor == time) return time;
+
+ year = date.getFullYear() + 1;
+
+ return new Date(year, 0).getTime() / 1000;
+ }
+
+ return Math.ceil(time / unit.seconds) * unit.seconds;
+ };
+};
+Rickshaw.namespace('Rickshaw.Fixtures.Number');
+
+Rickshaw.Fixtures.Number.formatKMBT = function(y) {
+ var abs_y = Math.abs(y);
+ if (abs_y >= 1000000000000) { return y / 1000000000000 + "T" }
+ else if (abs_y >= 1000000000) { return y / 1000000000 + "B" }
+ else if (abs_y >= 1000000) { return y / 1000000 + "M" }
+ else if (abs_y >= 1000) { return y / 1000 + "K" }
+ else if (abs_y < 1 && y > 0) { return y.toFixed(2) }
+ else if (abs_y === 0) { return '' }
+ else { return y }
+};
+
+Rickshaw.Fixtures.Number.formatBase1024KMGTP = function(y) {
+ var abs_y = Math.abs(y);
+ if (abs_y >= 1125899906842624) { return y / 1125899906842624 + "P" }
+ else if (abs_y >= 1099511627776){ return y / 1099511627776 + "T" }
+ else if (abs_y >= 1073741824) { return y / 1073741824 + "G" }
+ else if (abs_y >= 1048576) { return y / 1048576 + "M" }
+ else if (abs_y >= 1024) { return y / 1024 + "K" }
+ else if (abs_y < 1 && y > 0) { return y.toFixed(2) }
+ else if (abs_y === 0) { return '' }
+ else { return y }
+};
+Rickshaw.namespace("Rickshaw.Color.Palette");
+
+Rickshaw.Color.Palette = function(args) {
+
+ var color = new Rickshaw.Fixtures.Color();
+
+ args = args || {};
+ this.schemes = {};
+
+ this.scheme = color.schemes[args.scheme] || args.scheme || color.schemes.colorwheel;
+ this.runningIndex = 0;
+ this.generatorIndex = 0;
+
+ if (args.interpolatedStopCount) {
+ var schemeCount = this.scheme.length - 1;
+ var i, j, scheme = [];
+ for (i = 0; i < schemeCount; i++) {
+ scheme.push(this.scheme[i]);
+ var generator = d3.interpolateHsl(this.scheme[i], this.scheme[i + 1]);
+ for (j = 1; j < args.interpolatedStopCount; j++) {
+ scheme.push(generator((1 / args.interpolatedStopCount) * j));
+ }
+ }
+ scheme.push(this.scheme[this.scheme.length - 1]);
+ this.scheme = scheme;
+ }
+ this.rotateCount = this.scheme.length;
+
+ this.color = function(key) {
+ return this.scheme[key] || this.scheme[this.runningIndex++] || this.interpolateColor() || '#808080';
+ };
+
+ this.interpolateColor = function() {
+ if (!Array.isArray(this.scheme)) return;
+ var color;
+ if (this.generatorIndex == this.rotateCount * 2 - 1) {
+ color = d3.interpolateHsl(this.scheme[this.generatorIndex], this.scheme[0])(0.5);
+ this.generatorIndex = 0;
+ this.rotateCount *= 2;
+ } else {
+ color = d3.interpolateHsl(this.scheme[this.generatorIndex], this.scheme[this.generatorIndex + 1])(0.5);
+ this.generatorIndex++;
+ }
+ this.scheme.push(color);
+ return color;
+ };
+
+};
+Rickshaw.namespace('Rickshaw.Graph.Ajax');
+
+Rickshaw.Graph.Ajax = Rickshaw.Class.create( {
+
+ initialize: function(args) {
+
+ this.dataURL = args.dataURL;
+
+ this.onData = args.onData || function(d) { return d };
+ this.onComplete = args.onComplete || function() {};
+ this.onError = args.onError || function() {};
+
+ this.args = args; // pass through to Rickshaw.Graph
+
+ this.request();
+ },
+
+ request: function() {
+
+ jQuery.ajax( {
+ url: this.dataURL,
+ dataType: 'json',
+ success: this.success.bind(this),
+ error: this.error.bind(this)
+ } );
+ },
+
+ error: function() {
+
+ console.log("error loading dataURL: " + this.dataURL);
+ this.onError(this);
+ },
+
+ success: function(data, status) {
+
+ data = this.onData(data);
+ this.args.series = this._splice({ data: data, series: this.args.series });
+
+ this.graph = this.graph || new Rickshaw.Graph(this.args);
+ this.graph.render();
+
+ this.onComplete(this);
+ },
+
+ _splice: function(args) {
+
+ var data = args.data;
+ var series = args.series;
+
+ if (!args.series) return data;
+
+ series.forEach( function(s) {
+
+ var seriesKey = s.key || s.name;
+ if (!seriesKey) throw "series needs a key or a name";
+
+ data.forEach( function(d) {
+
+ var dataKey = d.key || d.name;
+ if (!dataKey) throw "data needs a key or a name";
+
+ if (seriesKey == dataKey) {
+ var properties = ['color', 'name', 'data'];
+ properties.forEach( function(p) {
+ if (d[p]) s[p] = d[p];
+ } );
+ }
+ } );
+ } );
+
+ return series;
+ }
+} );
+
+Rickshaw.namespace('Rickshaw.Graph.Annotate');
+
+Rickshaw.Graph.Annotate = function(args) {
+
+ var graph = this.graph = args.graph;
+ this.elements = { timeline: args.element };
+
+ var self = this;
+
+ this.data = {};
+
+ this.elements.timeline.classList.add('rickshaw_annotation_timeline');
+
+ this.add = function(time, content, end_time) {
+ self.data[time] = self.data[time] || {'boxes': []};
+ self.data[time].boxes.push({content: content, end: end_time});
+ };
+
+ this.update = function() {
+
+ Rickshaw.keys(self.data).forEach( function(time) {
+
+ var annotation = self.data[time];
+ var left = self.graph.x(time);
+
+ if (left < 0 || left > self.graph.x.range()[1]) {
+ if (annotation.element) {
+ annotation.line.classList.add('offscreen');
+ annotation.element.style.display = 'none';
+ }
+
+ annotation.boxes.forEach( function(box) {
+ if ( box.rangeElement ) box.rangeElement.classList.add('offscreen');
+ });
+
+ return;
+ }
+
+ if (!annotation.element) {
+ var element = annotation.element = document.createElement('div');
+ element.classList.add('annotation');
+ this.elements.timeline.appendChild(element);
+ element.addEventListener('click', function(e) {
+ element.classList.toggle('active');
+ annotation.line.classList.toggle('active');
+ annotation.boxes.forEach( function(box) {
+ if ( box.rangeElement ) box.rangeElement.classList.toggle('active');
+ });
+ }, false);
+
+ }
+
+ annotation.element.style.left = left + 'px';
+ annotation.element.style.display = 'block';
+
+ annotation.boxes.forEach( function(box) {
+
+
+ var element = box.element;
+
+ if (!element) {
+ element = box.element = document.createElement('div');
+ element.classList.add('content');
+ element.innerHTML = box.content;
+ annotation.element.appendChild(element);
+
+ annotation.line = document.createElement('div');
+ annotation.line.classList.add('annotation_line');
+ self.graph.element.appendChild(annotation.line);
+
+ if ( box.end ) {
+ box.rangeElement = document.createElement('div');
+ box.rangeElement.classList.add('annotation_range');
+ self.graph.element.appendChild(box.rangeElement);
+ }
+
+ }
+
+ if ( box.end ) {
+
+ var annotationRangeStart = left;
+ var annotationRangeEnd = Math.min( self.graph.x(box.end), self.graph.x.range()[1] );
+
+ // annotation makes more sense at end
+ if ( annotationRangeStart > annotationRangeEnd ) {
+ annotationRangeEnd = left;
+ annotationRangeStart = Math.max( self.graph.x(box.end), self.graph.x.range()[0] );
+ }
+
+ var annotationRangeWidth = annotationRangeEnd - annotationRangeStart;
+
+ box.rangeElement.style.left = annotationRangeStart + 'px';
+ box.rangeElement.style.width = annotationRangeWidth + 'px';
+
+ box.rangeElement.classList.remove('offscreen');
+ }
+
+ annotation.line.classList.remove('offscreen');
+ annotation.line.style.left = left + 'px';
+ } );
+ }, this );
+ };
+
+ this.graph.onUpdate( function() { self.update() } );
+};
+Rickshaw.namespace('Rickshaw.Graph.Axis.Time');
+
+Rickshaw.Graph.Axis.Time = function(args) {
+
+ var self = this;
+
+ this.graph = args.graph;
+ this.elements = [];
+ this.ticksTreatment = args.ticksTreatment || 'plain';
+ this.fixedTimeUnit = args.timeUnit;
+
+ var time = args.timeFixture || new Rickshaw.Fixtures.Time();
+
+ this.appropriateTimeUnit = function() {
+
+ var unit;
+ var units = time.units;
+
+ var domain = this.graph.x.domain();
+ var rangeSeconds = domain[1] - domain[0];
+
+ units.forEach( function(u) {
+ if (Math.floor(rangeSeconds / u.seconds) >= 2) {
+ unit = unit || u;
+ }
+ } );
+
+ return (unit || time.units[time.units.length - 1]);
+ };
+
+ this.tickOffsets = function() {
+
+ var domain = this.graph.x.domain();
+
+ var unit = this.fixedTimeUnit || this.appropriateTimeUnit();
+ var count = Math.ceil((domain[1] - domain[0]) / unit.seconds);
+
+ var runningTick = domain[0];
+
+ var offsets = [];
+
+ for (var i = 0; i < count; i++) {
+
+ var tickValue = time.ceil(runningTick, unit);
+ runningTick = tickValue + unit.seconds / 2;
+
+ offsets.push( { value: tickValue, unit: unit } );
+ }
+
+ return offsets;
+ };
+
+ this.render = function() {
+
+ this.elements.forEach( function(e) {
+ e.parentNode.removeChild(e);
+ } );
+
+ this.elements = [];
+
+ var offsets = this.tickOffsets();
+
+ offsets.forEach( function(o) {
+
+ if (self.graph.x(o.value) > self.graph.x.range()[1]) return;
+
+ var element = document.createElement('div');
+ element.style.left = self.graph.x(o.value) + 'px';
+ element.classList.add('x_tick');
+ element.classList.add(self.ticksTreatment);
+
+ var title = document.createElement('div');
+ title.classList.add('title');
+ title.innerHTML = o.unit.formatter(new Date(o.value * 1000));
+ element.appendChild(title);
+
+ self.graph.element.appendChild(element);
+ self.elements.push(element);
+
+ } );
+ };
+
+ this.graph.onUpdate( function() { self.render() } );
+};
+
+Rickshaw.namespace('Rickshaw.Graph.Axis.X');
+
+Rickshaw.Graph.Axis.X = function(args) {
+
+ var self = this;
+ var berthRate = 0.10;
+
+ this.initialize = function(args) {
+
+ this.graph = args.graph;
+ this.orientation = args.orientation || 'top';
+
+ this.pixelsPerTick = args.pixelsPerTick || 75;
+ if (args.ticks) this.staticTicks = args.ticks;
+ if (args.tickValues) this.tickValues = args.tickValues;
+
+ this.tickSize = args.tickSize || 4;
+ this.ticksTreatment = args.ticksTreatment || 'plain';
+
+ if (args.element) {
+
+ this.element = args.element;
+ this._discoverSize(args.element, args);
+
+ this.vis = d3.select(args.element)
+ .append("svg:svg")
+ .attr('height', this.height)
+ .attr('width', this.width)
+ .attr('class', 'rickshaw_graph x_axis_d3');
+
+ this.element = this.vis[0][0];
+ this.element.style.position = 'relative';
+
+ this.setSize({ width: args.width, height: args.height });
+
+ } else {
+ this.vis = this.graph.vis;
+ }
+
+ this.graph.onUpdate( function() { self.render() } );
+ };
+
+ this.setSize = function(args) {
+
+ args = args || {};
+ if (!this.element) return;
+
+ this._discoverSize(this.element.parentNode, args);
+
+ this.vis
+ .attr('height', this.height)
+ .attr('width', this.width * (1 + berthRate));
+
+ var berth = Math.floor(this.width * berthRate / 2);
+ this.element.style.left = -1 * berth + 'px';
+ };
+
+ this.render = function() {
+
+ if (this._renderWidth !== undefined && this.graph.width !== this._renderWidth) this.setSize({ auto: true });
+
+ var axis = d3.svg.axis().scale(this.graph.x).orient(this.orientation);
+ axis.tickFormat( args.tickFormat || function(x) { return x } );
+ if (this.tickValues) axis.tickValues(this.tickValues);
+
+ this.ticks = this.staticTicks || Math.floor(this.graph.width / this.pixelsPerTick);
+
+ var berth = Math.floor(this.width * berthRate / 2) || 0;
+ var transform;
+
+ if (this.orientation == 'top') {
+ var yOffset = this.height || this.graph.height;
+ transform = 'translate(' + berth + ',' + yOffset + ')';
+ } else {
+ transform = 'translate(' + berth + ', 0)';
+ }
+
+ if (this.element) {
+ this.vis.selectAll('*').remove();
+ }
+
+ this.vis
+ .append("svg:g")
+ .attr("class", ["x_ticks_d3", this.ticksTreatment].join(" "))
+ .attr("transform", transform)
+ .call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));
+
+ var gridSize = (this.orientation == 'bottom' ? 1 : -1) * this.graph.height;
+
+ this.graph.vis
+ .append("svg:g")
+ .attr("class", "x_grid_d3")
+ .call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize))
+ .selectAll('text')
+ .each(function() { this.parentNode.setAttribute('data-x-value', this.textContent) });
+
+ this._renderHeight = this.graph.height;
+ };
+
+ this._discoverSize = function(element, args) {
+
+ if (typeof window !== 'undefined') {
+
+ var style = window.getComputedStyle(element, null);
+ var elementHeight = parseInt(style.getPropertyValue('height'), 10);
+
+ if (!args.auto) {
+ var elementWidth = parseInt(style.getPropertyValue('width'), 10);
+ }
+ }
+
+ this.width = (args.width || elementWidth || this.graph.width) * (1 + berthRate);
+ this.height = args.height || elementHeight || 40;
+ };
+
+ this.initialize(args);
+};
+
+Rickshaw.namespace('Rickshaw.Graph.Axis.Y');
+
+Rickshaw.Graph.Axis.Y = Rickshaw.Class.create( {
+
+ initialize: function(args) {
+
+ this.graph = args.graph;
+ this.orientation = args.orientation || 'right';
+
+ this.pixelsPerTick = args.pixelsPerTick || 75;
+ if (args.ticks) this.staticTicks = args.ticks;
+ if (args.tickValues) this.tickValues = args.tickValues;
+
+ this.tickSize = args.tickSize || 4;
+ this.ticksTreatment = args.ticksTreatment || 'plain';
+
+ this.tickFormat = args.tickFormat || function(y) { return y };
+
+ this.berthRate = 0.10;
+
+ if (args.element) {
+
+ this.element = args.element;
+ this.vis = d3.select(args.element)
+ .append("svg:svg")
+ .attr('class', 'rickshaw_graph y_axis');
+
+ this.element = this.vis[0][0];
+ this.element.style.position = 'relative';
+
+ this.setSize({ width: args.width, height: args.height });
+
+ } else {
+ this.vis = this.graph.vis;
+ }
+
+ var self = this;
+ this.graph.onUpdate( function() { self.render() } );
+ },
+
+ setSize: function(args) {
+
+ args = args || {};
+
+ if (!this.element) return;
+
+ if (typeof window !== 'undefined') {
+
+ var style = window.getComputedStyle(this.element.parentNode, null);
+ var elementWidth = parseInt(style.getPropertyValue('width'), 10);
+
+ if (!args.auto) {
+ var elementHeight = parseInt(style.getPropertyValue('height'), 10);
+ }
+ }
+
+ this.width = args.width || elementWidth || this.graph.width * this.berthRate;
+ this.height = args.height || elementHeight || this.graph.height;
+
+ this.vis
+ .attr('width', this.width)
+ .attr('height', this.height * (1 + this.berthRate));
+
+ var berth = this.height * this.berthRate;
+
+ if (this.orientation == 'left') {
+ this.element.style.top = -1 * berth + 'px';
+ }
+ },
+
+ render: function() {
+
+ if (this._renderHeight !== undefined && this.graph.height !== this._renderHeight) this.setSize({ auto: true });
+
+ this.ticks = this.staticTicks || Math.floor(this.graph.height / this.pixelsPerTick);
+
+ var axis = this._drawAxis(this.graph.y);
+
+ this._drawGrid(axis);
+
+ this._renderHeight = this.graph.height;
+ },
+
+ _drawAxis: function(scale) {
+ var axis = d3.svg.axis().scale(scale).orient(this.orientation);
+ axis.tickFormat(this.tickFormat);
+ if (this.tickValues) axis.tickValues(this.tickValues);
+
+ if (this.orientation == 'left') {
+ var berth = this.height * this.berthRate;
+ var transform = 'translate(' + this.width + ', ' + berth + ')';
+ }
+
+ if (this.element) {
+ this.vis.selectAll('*').remove();
+ }
+
+ this.vis
+ .append("svg:g")
+ .attr("class", ["y_ticks", this.ticksTreatment].join(" "))
+ .attr("transform", transform)
+ .call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));
+
+ return axis;
+ },
+
+ _drawGrid: function(axis) {
+ var gridSize = (this.orientation == 'right' ? 1 : -1) * this.graph.width;
+
+ this.graph.vis
+ .append("svg:g")
+ .attr("class", "y_grid")
+ .call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize))
+ .selectAll('text')
+ .each(function() { this.parentNode.setAttribute('data-y-value', this.textContent) });
+ }
+} );
+Rickshaw.namespace('Rickshaw.Graph.Axis.Y.Scaled');
+
+Rickshaw.Graph.Axis.Y.Scaled = Rickshaw.Class.create( Rickshaw.Graph.Axis.Y, {
+
+ initialize: function($super, args) {
+
+ if (typeof(args.scale) === 'undefined') {
+ throw new Error('Scaled requires scale');
+ }
+
+ this.scale = args.scale;
+
+ if (typeof(args.grid) === 'undefined') {
+ this.grid = true;
+ } else {
+ this.grid = args.grid;
+ }
+
+ $super(args);
+
+ },
+
+ _drawAxis: function($super, scale) {
+ // Adjust scale's domain to compensate for adjustments to the
+ // renderer's domain (e.g. padding).
+ var domain = this.scale.domain();
+ var renderDomain = this.graph.renderer.domain().y;
+
+ var extents = [
+ Math.min.apply(Math, domain),
+ Math.max.apply(Math, domain)];
+
+ // A mapping from the ideal render domain [0, 1] to the extent
+ // of the original scale's domain. This is used to calculate
+ // the extents of the adjusted domain.
+ var extentMap = d3.scale.linear().domain([0, 1]).range(extents);
+
+ var adjExtents = [
+ extentMap(renderDomain[0]),
+ extentMap(renderDomain[1])];
+
+ // A mapping from the original domain to the adjusted domain.
+ var adjustment = d3.scale.linear().domain(extents).range(adjExtents);
+
+ // Make a copy of the custom scale, apply the adjusted domain, and
+ // copy the range to match the graph's scale.
+ var adjustedScale = this.scale.copy()
+ .domain(domain.map(adjustment))
+ .range(scale.range());
+
+ return $super(adjustedScale);
+ },
+
+ _drawGrid: function($super, axis) {
+ if (this.grid) {
+ // only draw the axis if the grid option is true
+ $super(axis);
+ }
+ }
+} );
+Rickshaw.namespace('Rickshaw.Graph.Behavior.Series.Highlight');
+
+Rickshaw.Graph.Behavior.Series.Highlight = function(args) {
+
+ this.graph = args.graph;
+ this.legend = args.legend;
+
+ var self = this;
+
+ var colorSafe = {};
+ var activeLine = null;
+
+ var disabledColor = args.disabledColor || function(seriesColor) {
+ return d3.interpolateRgb(seriesColor, d3.rgb('#d8d8d8'))(0.8).toString();
+ };
+
+ this.addHighlightEvents = function (l) {
+
+ l.element.addEventListener( 'mouseover', function(e) {
+
+ if (activeLine) return;
+ else activeLine = l;
+
+ self.legend.lines.forEach( function(line) {
+
+ if (l === line) {
+
+ // if we're not in a stacked renderer bring active line to the top
+ if (self.graph.renderer.unstack && (line.series.renderer ? line.series.renderer.unstack : true)) {
+
+ var seriesIndex = self.graph.series.indexOf(line.series);
+ line.originalIndex = seriesIndex;
+
+ var series = self.graph.series.splice(seriesIndex, 1)[0];
+ self.graph.series.push(series);
+ }
+ return;
+ }
+
+ colorSafe[line.series.name] = colorSafe[line.series.name] || line.series.color;
+ line.series.color = disabledColor(line.series.color);
+
+ } );
+
+ self.graph.update();
+
+ }, false );
+
+ l.element.addEventListener( 'mouseout', function(e) {
+
+ if (!activeLine) return;
+ else activeLine = null;
+
+ self.legend.lines.forEach( function(line) {
+
+ // return reordered series to its original place
+ if (l === line && line.hasOwnProperty('originalIndex')) {
+
+ var series = self.graph.series.pop();
+ self.graph.series.splice(line.originalIndex, 0, series);
+ delete line.originalIndex;
+ }
+
+ if (colorSafe[line.series.name]) {
+ line.series.color = colorSafe[line.series.name];
+ }
+ } );
+
+ self.graph.update();
+
+ }, false );
+ };
+
+ if (this.legend) {
+ this.legend.lines.forEach( function(l) {
+ self.addHighlightEvents(l);
+ } );
+ }
+
+};
+Rickshaw.namespace('Rickshaw.Graph.Behavior.Series.Order');
+
+Rickshaw.Graph.Behavior.Series.Order = function(args) {
+
+ this.graph = args.graph;
+ this.legend = args.legend;
+
+ var self = this;
+
+ if (typeof window.jQuery == 'undefined') {
+ throw "couldn't find jQuery at window.jQuery";
+ }
+
+ if (typeof window.jQuery.ui == 'undefined') {
+ throw "couldn't find jQuery UI at window.jQuery.ui";
+ }
+
+ jQuery(function() {
+ jQuery(self.legend.list).sortable( {
+ containment: 'parent',
+ tolerance: 'pointer',
+ update: function( event, ui ) {
+ var series = [];
+ jQuery(self.legend.list).find('li').each( function(index, item) {
+ if (!item.series) return;
+ series.push(item.series);
+ } );
+
+ for (var i = self.graph.series.length - 1; i >= 0; i--) {
+ self.graph.series[i] = series.shift();
+ }
+
+ self.graph.update();
+ }
+ } );
+ jQuery(self.legend.list).disableSelection();
+ });
+
+ //hack to make jquery-ui sortable behave
+ this.graph.onUpdate( function() {
+ var h = window.getComputedStyle(self.legend.element).height;
+ self.legend.element.style.height = h;
+ } );
+};
+Rickshaw.namespace('Rickshaw.Graph.Behavior.Series.Toggle');
+
+Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
+
+ this.graph = args.graph;
+ this.legend = args.legend;
+
+ var self = this;
+
+ this.addAnchor = function(line) {
+
+ var anchor = document.createElement('a');
+ anchor.innerHTML = '&#10004;';
+ anchor.classList.add('action');
+ line.element.insertBefore(anchor, line.element.firstChild);
+
+ anchor.onclick = function(e) {
+ if (line.series.disabled) {
+ line.series.enable();
+ line.element.classList.remove('disabled');
+ } else {
+ if (this.graph.series.filter(function(s) { return !s.disabled }).length <= 1) return;
+ line.series.disable();
+ line.element.classList.add('disabled');
+ }
+
+ self.graph.update();
+
+ }.bind(this);
+
+ var label = line.element.getElementsByTagName('span')[0];
+ label.onclick = function(e){
+
+ var disableAllOtherLines = line.series.disabled;
+ if ( ! disableAllOtherLines ) {
+ for ( var i = 0; i < self.legend.lines.length; i++ ) {
+ var l = self.legend.lines[i];
+ if ( line.series === l.series ) {
+ // noop
+ } else if ( l.series.disabled ) {
+ // noop
+ } else {
+ disableAllOtherLines = true;
+ break;
+ }
+ }
+ }
+
+ // show all or none
+ if ( disableAllOtherLines ) {
+
+ // these must happen first or else we try ( and probably fail ) to make a no line graph
+ line.series.enable();
+ line.element.classList.remove('disabled');
+
+ self.legend.lines.forEach(function(l){
+ if ( line.series === l.series ) {
+ // noop
+ } else {
+ l.series.disable();
+ l.element.classList.add('disabled');
+ }
+ });
+
+ } else {
+
+ self.legend.lines.forEach(function(l){
+ l.series.enable();
+ l.element.classList.remove('disabled');
+ });
+
+ }
+
+ self.graph.update();
+
+ };
+
+ };
+
+ if (this.legend) {
+
+ var $ = jQuery;
+ if (typeof $ != 'undefined' && $(this.legend.list).sortable) {
+
+ $(this.legend.list).sortable( {
+ start: function(event, ui) {
+ ui.item.bind('no.onclick',
+ function(event) {
+ event.preventDefault();
+ }
+ );
+ },
+ stop: function(event, ui) {
+ setTimeout(function(){
+ ui.item.unbind('no.onclick');
+ }, 250);
+ }
+ });
+ }
+
+ this.legend.lines.forEach( function(l) {
+ self.addAnchor(l);
+ } );
+ }
+
+ this._addBehavior = function() {
+
+ this.graph.series.forEach( function(s) {
+
+ s.disable = function() {
+
+ if (self.graph.series.length <= 1) {
+ throw('only one series left');
+ }
+
+ s.disabled = true;
+ };
+
+ s.enable = function() {
+ s.disabled = false;
+ };
+ } );
+ };
+ this._addBehavior();
+
+ this.updateBehaviour = function () { this._addBehavior() };
+
+};
+Rickshaw.namespace('Rickshaw.Graph.HoverDetail');
+
+Rickshaw.Graph.HoverDetail = Rickshaw.Class.create({
+
+ initialize: function(args) {
+
+ var graph = this.graph = args.graph;
+
+ this.xFormatter = args.xFormatter || function(x) {
+ return new Date( x * 1000 ).toUTCString();
+ };
+
+ this.yFormatter = args.yFormatter || function(y) {
+ return y === null ? y : y.toFixed(2);
+ };
+
+ var element = this.element = document.createElement('div');
+ element.className = 'detail';
+
+ this.visible = true;
+ graph.element.appendChild(element);
+
+ this.lastEvent = null;
+ this._addListeners();
+
+ this.onShow = args.onShow;
+ this.onHide = args.onHide;
+ this.onRender = args.onRender;
+
+ this.formatter = args.formatter || this.formatter;
+
+ },
+
+ formatter: function(series, x, y, formattedX, formattedY, d) {
+ return series.name + ':&nbsp;' + formattedY;
+ },
+
+ update: function(e) {
+
+ e = e || this.lastEvent;
+ if (!e) return;
+ this.lastEvent = e;
+
+ if (!e.target.nodeName.match(/^(path|svg|rect|circle)$/)) return;
+
+ var graph = this.graph;
+
+ var eventX = e.offsetX || e.layerX;
+ var eventY = e.offsetY || e.layerY;
+
+ var j = 0;
+ var points = [];
+ var nearestPoint;
+
+ this.graph.series.active().forEach( function(series) {
+
+ var data = this.graph.stackedData[j++];
+
+ if (!data.length)
+ return;
+
+ var domainX = graph.x.invert(eventX);
+
+ var domainIndexScale = d3.scale.linear()
+ .domain([data[0].x, data.slice(-1)[0].x])
+ .range([0, data.length - 1]);
+
+ var approximateIndex = Math.round(domainIndexScale(domainX));
+ if (approximateIndex == data.length - 1) approximateIndex--;
+
+ var dataIndex = Math.min(approximateIndex || 0, data.length - 1);
+
+ for (var i = approximateIndex; i < data.length - 1;) {
+
+ if (!data[i] || !data[i + 1]) break;
+
+ if (data[i].x <= domainX && data[i + 1].x > domainX) {
+ dataIndex = Math.abs(domainX - data[i].x) < Math.abs(domainX - data[i + 1].x) ? i : i + 1;
+ break;
+ }
+
+ if (data[i + 1].x <= domainX) { i++ } else { i-- }
+ }
+
+ if (dataIndex < 0) dataIndex = 0;
+ var value = data[dataIndex];
+
+ var distance = Math.sqrt(
+ Math.pow(Math.abs(graph.x(value.x) - eventX), 2) +
+ Math.pow(Math.abs(graph.y(value.y + value.y0) - eventY), 2)
+ );
+
+ var xFormatter = series.xFormatter || this.xFormatter;
+ var yFormatter = series.yFormatter || this.yFormatter;
+
+ var point = {
+ formattedXValue: xFormatter(value.x),
+ formattedYValue: yFormatter(series.scale ? series.scale.invert(value.y) : value.y),
+ series: series,
+ value: value,
+ distance: distance,
+ order: j,
+ name: series.name
+ };
+
+ if (!nearestPoint || distance < nearestPoint.distance) {
+ nearestPoint = point;
+ }
+
+ points.push(point);
+
+ }, this );
+
+ if (!nearestPoint)
+ return;
+
+ nearestPoint.active = true;
+
+ var domainX = nearestPoint.value.x;
+ var formattedXValue = nearestPoint.formattedXValue;
+
+ this.element.innerHTML = '';
+ this.element.style.left = graph.x(domainX) + 'px';
+
+ this.visible && this.render( {
+ points: points,
+ detail: points, // for backwards compatibility
+ mouseX: eventX,
+ mouseY: eventY,
+ formattedXValue: formattedXValue,
+ domainX: domainX
+ } );
+ },
+
+ hide: function() {
+ this.visible = false;
+ this.element.classList.add('inactive');
+
+ if (typeof this.onHide == 'function') {
+ this.onHide();
+ }
+ },
+
+ show: function() {
+ this.visible = true;
+ this.element.classList.remove('inactive');
+
+ if (typeof this.onShow == 'function') {
+ this.onShow();
+ }
+ },
+
+ render: function(args) {
+
+ var graph = this.graph;
+ var points = args.points;
+ var point = points.filter( function(p) { return p.active } ).shift();
+
+ if (point.value.y === null) return;
+
+ var formattedXValue = point.formattedXValue;
+ var formattedYValue = point.formattedYValue;
+
+ this.element.innerHTML = '';
+ this.element.style.left = graph.x(point.value.x) + 'px';
+
+ var xLabel = document.createElement('div');
+
+ xLabel.className = 'x_label';
+ xLabel.innerHTML = formattedXValue;
+ this.element.appendChild(xLabel);
+
+ var item = document.createElement('div');
+
+ item.className = 'item';
+
+ // invert the scale if this series displays using a scale
+ var series = point.series;
+ var actualY = series.scale ? series.scale.invert(point.value.y) : point.value.y;
+
+ item.innerHTML = this.formatter(series, point.value.x, actualY, formattedXValue, formattedYValue, point);
+ item.style.top = this.graph.y(point.value.y0 + point.value.y) + 'px';
+
+ this.element.appendChild(item);
+
+ var dot = document.createElement('div');
+
+ dot.className = 'dot';
+ dot.style.top = item.style.top;
+ dot.style.borderColor = series.color;
+
+ this.element.appendChild(dot);
+
+ if (point.active) {
+ item.classList.add('active');
+ dot.classList.add('active');
+ }
+
+ // Assume left alignment until the element has been displayed and
+ // bounding box calculations are possible.
+ var alignables = [xLabel, item];
+ alignables.forEach(function(el) {
+ el.classList.add('left');
+ });
+
+ this.show();
+
+ // If left-alignment results in any error, try right-alignment.
+ var leftAlignError = this._calcLayoutError(alignables);
+ if (leftAlignError > 0) {
+ alignables.forEach(function(el) {
+ el.classList.remove('left');
+ el.classList.add('right');
+ });
+
+ // If right-alignment is worse than left alignment, switch back.
+ var rightAlignError = this._calcLayoutError(alignables);
+ if (rightAlignError > leftAlignError) {
+ alignables.forEach(function(el) {
+ el.classList.remove('right');
+ el.classList.add('left');
+ });
+ }
+ }
+
+ if (typeof this.onRender == 'function') {
+ this.onRender(args);
+ }
+ },
+
+ _calcLayoutError: function(alignables) {
+ // Layout error is calculated as the number of linear pixels by which
+ // an alignable extends past the left or right edge of the parent.
+ var parentRect = this.element.parentNode.getBoundingClientRect();
+
+ var error = 0;
+ var alignRight = alignables.forEach(function(el) {
+ var rect = el.getBoundingClientRect();
+ if (!rect.width) {
+ return;
+ }
+
+ if (rect.right > parentRect.right) {
+ error += rect.right - parentRect.right;
+ }
+
+ if (rect.left < parentRect.left) {
+ error += parentRect.left - rect.left;
+ }
+ });
+ return error;
+ },
+
+ _addListeners: function() {
+
+ this.graph.element.addEventListener(
+ 'mousemove',
+ function(e) {
+ this.visible = true;
+ this.update(e);
+ }.bind(this),
+ false
+ );
+
+ this.graph.onUpdate( function() { this.update() }.bind(this) );
+
+ this.graph.element.addEventListener(
+ 'mouseout',
+ function(e) {
+ if (e.relatedTarget && !(e.relatedTarget.compareDocumentPosition(this.graph.element) & Node.DOCUMENT_POSITION_CONTAINS)) {
+ this.hide();
+ }
+ }.bind(this),
+ false
+ );
+ }
+});
+Rickshaw.namespace('Rickshaw.Graph.JSONP');
+
+Rickshaw.Graph.JSONP = Rickshaw.Class.create( Rickshaw.Graph.Ajax, {
+
+ request: function() {
+
+ jQuery.ajax( {
+ url: this.dataURL,
+ dataType: 'jsonp',
+ success: this.success.bind(this),
+ error: this.error.bind(this)
+ } );
+ }
+} );
+Rickshaw.namespace('Rickshaw.Graph.Legend');
+
+Rickshaw.Graph.Legend = Rickshaw.Class.create( {
+
+ className: 'rickshaw_legend',
+
+ initialize: function(args) {
+ this.element = args.element;
+ this.graph = args.graph;
+ this.naturalOrder = args.naturalOrder;
+
+ this.element.classList.add(this.className);
+
+ this.list = document.createElement('ul');
+ this.element.appendChild(this.list);
+
+ this.render();
+
+ // we could bind this.render.bind(this) here
+ // but triggering the re-render would lose the added
+ // behavior of the series toggle
+ this.graph.onUpdate( function() {} );
+ },
+
+ render: function() {
+ var self = this;
+
+ while ( this.list.firstChild ) {
+ this.list.removeChild( this.list.firstChild );
+ }
+ this.lines = [];
+
+ var series = this.graph.series
+ .map( function(s) { return s } );
+
+ if (!this.naturalOrder) {
+ series = series.reverse();
+ }
+
+ series.forEach( function(s) {
+ self.addLine(s);
+ } );
+
+
+ },
+
+ addLine: function (series) {
+ var line = document.createElement('li');
+ line.className = 'line';
+ if (series.disabled) {
+ line.className += ' disabled';
+ }
+ if (series.className) {
+ d3.select(line).classed(series.className, true);
+ }
+ var swatch = document.createElement('div');
+ swatch.className = 'swatch';
+ swatch.style.backgroundColor = series.color;
+
+ line.appendChild(swatch);
+
+ var label = document.createElement('span');
+ label.className = 'label';
+ label.innerHTML = series.name;
+
+ line.appendChild(label);
+ this.list.appendChild(line);
+
+ line.series = series;
+
+ if (series.noLegend) {
+ line.style.display = 'none';
+ }
+
+ var _line = { element: line, series: series };
+ if (this.shelving) {
+ this.shelving.addAnchor(_line);
+ this.shelving.updateBehaviour();
+ }
+ if (this.highlighter) {
+ this.highlighter.addHighlightEvents(_line);
+ }
+ this.lines.push(_line);
+ return line;
+ }
+} );
+
+Rickshaw.namespace('Rickshaw.Graph.RangeSlider');
+
+Rickshaw.Graph.RangeSlider = Rickshaw.Class.create({
+
+ initialize: function(args) {
+
+ var element = this.element = args.element;
+ var graph = this.graph = args.graph;
+
+ this.slideCallbacks = [];
+
+ this.build();
+
+ graph.onUpdate( function() { this.update() }.bind(this) );
+ },
+
+ build: function() {
+
+ var element = this.element;
+ var graph = this.graph;
+ var $ = jQuery;
+
+ var domain = graph.dataDomain();
+ var self = this;
+
+ $( function() {
+ $(element).slider( {
+ range: true,
+ min: domain[0],
+ max: domain[1],
+ values: [
+ domain[0],
+ domain[1]
+ ],
+ slide: function( event, ui ) {
+
+ if (ui.values[1] <= ui.values[0]) return;
+
+ graph.window.xMin = ui.values[0];
+ graph.window.xMax = ui.values[1];
+ graph.update();
+
+ var domain = graph.dataDomain();
+
+ // if we're at an extreme, stick there
+ if (domain[0] == ui.values[0]) {
+ graph.window.xMin = undefined;
+ }
+
+ if (domain[1] == ui.values[1]) {
+ graph.window.xMax = undefined;
+ }
+
+ self.slideCallbacks.forEach(function(callback) {
+ callback(graph, graph.window.xMin, graph.window.xMax);
+ });
+ }
+ } );
+ } );
+
+ $(element)[0].style.width = graph.width + 'px';
+
+ },
+
+ update: function() {
+
+ var element = this.element;
+ var graph = this.graph;
+ var $ = jQuery;
+
+ var values = $(element).slider('option', 'values');
+
+ var domain = graph.dataDomain();
+
+ $(element).slider('option', 'min', domain[0]);
+ $(element).slider('option', 'max', domain[1]);
+
+ if (graph.window.xMin == null) {
+ values[0] = domain[0];
+ }
+ if (graph.window.xMax == null) {
+ values[1] = domain[1];
+ }
+
+ $(element).slider('option', 'values', values);
+ },
+
+ onSlide: function(callback) {
+ this.slideCallbacks.push(callback);
+ }
+});
+
+Rickshaw.namespace('Rickshaw.Graph.RangeSlider.Preview');
+
+Rickshaw.Graph.RangeSlider.Preview = Rickshaw.Class.create({
+
+ initialize: function(args) {
+
+ if (!args.element) throw "Rickshaw.Graph.RangeSlider.Preview needs a reference to an element";
+ if (!args.graph && !args.graphs) throw "Rickshaw.Graph.RangeSlider.Preview needs a reference to an graph or an array of graphs";
+
+ this.element = args.element;
+ this.element.style.position = 'relative';
+
+ this.graphs = args.graph ? [ args.graph ] : args.graphs;
+
+ this.defaults = {
+ height: 75,
+ width: 400,
+ gripperColor: undefined,
+ frameTopThickness: 3,
+ frameHandleThickness: 10,
+ frameColor: "#d4d4d4",
+ frameOpacity: 1,
+ minimumFrameWidth: 0,
+ heightRatio: 0.2
+ };
+
+ this.heightRatio = args.heightRatio || this.defaults.heightRatio;
+ this.defaults.gripperColor = d3.rgb(this.defaults.frameColor).darker().toString();
+
+ this.configureCallbacks = [];
+ this.slideCallbacks = [];
+
+ this.previews = [];
+
+ if (!args.width) this.widthFromGraph = true;
+ if (!args.height) this.heightFromGraph = true;
+
+ if (this.widthFromGraph || this.heightFromGraph) {
+ this.graphs[0].onConfigure(function () {
+ this.configure(args); this.render();
+ }.bind(this));
+ }
+
+ args.width = args.width || this.graphs[0].width || this.defaults.width;
+ args.height = args.height || this.graphs[0].height * this.heightRatio || this.defaults.height;
+
+ this.configure(args);
+ this.render();
+ },
+
+ onSlide: function(callback) {
+ this.slideCallbacks.push(callback);
+ },
+
+ onConfigure: function(callback) {
+ this.configureCallbacks.push(callback);
+ },
+
+ configure: function(args) {
+
+ this.config = this.config || {};
+
+ this.configureCallbacks.forEach(function(callback) {
+ callback(args);
+ });
+
+ Rickshaw.keys(this.defaults).forEach(function(k) {
+ this.config[k] = k in args ? args[k]
+ : k in this.config ? this.config[k]
+ : this.defaults[k];
+ }, this);
+
+ if ('width' in args || 'height' in args) {
+
+ if (this.widthFromGraph) {
+ this.config.width = this.graphs[0].width;
+ }
+
+ if (this.heightFromGraph) {
+ this.config.height = this.graphs[0].height * this.heightRatio;
+ this.previewHeight = this.config.height;
+ }
+
+ this.previews.forEach(function(preview) {
+
+ var height = this.previewHeight / this.graphs.length - this.config.frameTopThickness * 2;
+ var width = this.config.width - this.config.frameHandleThickness * 2;
+ preview.setSize({ width: width, height: height });
+
+ if (this.svg) {
+ var svgHeight = height + this.config.frameHandleThickness * 2;
+ var svgWidth = width + this.config.frameHandleThickness * 2;
+ this.svg.style("width", svgWidth + "px");
+ this.svg.style("height", svgHeight + "px");
+ }
+ }, this);
+ }
+ },
+
+ render: function() {
+
+ var self = this;
+
+ this.svg = d3.select(this.element)
+ .selectAll("svg.rickshaw_range_slider_preview")
+ .data([null]);
+
+ this.previewHeight = this.config.height - (this.config.frameTopThickness * 2);
+ this.previewWidth = this.config.width - (this.config.frameHandleThickness * 2);
+
+ this.currentFrame = [0, this.previewWidth];
+
+ var buildGraph = function(parent, index) {
+
+ var graphArgs = Rickshaw.extend({}, parent.config);
+ var height = self.previewHeight / self.graphs.length;
+ var renderer = parent.renderer.name;
+
+ Rickshaw.extend(graphArgs, {
+ element: this.appendChild(document.createElement("div")),
+ height: height,
+ width: self.previewWidth,
+ series: parent.series,
+ renderer: renderer
+ });
+
+ var graph = new Rickshaw.Graph(graphArgs);
+ self.previews.push(graph);
+
+ parent.onUpdate(function() { graph.render(); self.render() });
+
+ parent.onConfigure(function(args) {
+ // don't propagate height
+ delete args.height;
+ args.width = args.width - self.config.frameHandleThickness * 2;
+ graph.configure(args);
+ graph.render();
+ });
+
+ graph.render();
+ };
+
+ var graphContainer = d3.select(this.element)
+ .selectAll("div.rickshaw_range_slider_preview_container")
+ .data(this.graphs);
+
+ var translateCommand = "translate(" +
+ this.config.frameHandleThickness + "px, " +
+ this.config.frameTopThickness + "px)";
+
+ graphContainer.enter()
+ .append("div")
+ .classed("rickshaw_range_slider_preview_container", true)
+ .style("-webkit-transform", translateCommand)
+ .style("-moz-transform", translateCommand)
+ .style("-ms-transform", translateCommand)
+ .style("transform", translateCommand)
+ .each(buildGraph);
+
+ graphContainer.exit()
+ .remove();
+
+ // Use the first graph as the "master" for the frame state
+ var masterGraph = this.graphs[0];
+
+ var domainScale = d3.scale.linear()
+ .domain([0, this.previewWidth])
+ .range(masterGraph.dataDomain());
+
+ var currentWindow = [masterGraph.window.xMin, masterGraph.window.xMax];
+
+ this.currentFrame[0] = currentWindow[0] === undefined ?
+ 0 : Math.round(domainScale.invert(currentWindow[0]));
+
+ if (this.currentFrame[0] < 0) this.currentFrame[0] = 0;
+
+ this.currentFrame[1] = currentWindow[1] === undefined ?
+ this.previewWidth : domainScale.invert(currentWindow[1]);
+
+ if (this.currentFrame[1] - this.currentFrame[0] < self.config.minimumFrameWidth) {
+ this.currentFrame[1] = (this.currentFrame[0] || 0) + self.config.minimumFrameWidth;
+ }
+
+ this.svg.enter()
+ .append("svg")
+ .classed("rickshaw_range_slider_preview", true)
+ .style("height", this.config.height + "px")
+ .style("width", this.config.width + "px")
+ .style("position", "absolute")
+ .style("top", 0);
+
+ this._renderDimming();
+ this._renderFrame();
+ this._renderGrippers();
+ this._renderHandles();
+ this._renderMiddle();
+
+ this._registerMouseEvents();
+ },
+
+ _renderDimming: function() {
+
+ var element = this.svg
+ .selectAll("path.dimming")
+ .data([null]);
+
+ element.enter()
+ .append("path")
+ .attr("fill", "white")
+ .attr("fill-opacity", "0.7")
+ .attr("fill-rule", "evenodd")
+ .classed("dimming", true);
+
+ var path = "";
+ path += " M " + this.config.frameHandleThickness + " " + this.config.frameTopThickness;
+ path += " h " + this.previewWidth;
+ path += " v " + this.previewHeight;
+ path += " h " + -this.previewWidth;
+ path += " z ";
+ path += " M " + Math.max(this.currentFrame[0], this.config.frameHandleThickness) + " " + this.config.frameTopThickness;
+ path += " H " + Math.min(this.currentFrame[1] + this.config.frameHandleThickness * 2, this.previewWidth + this.config.frameHandleThickness);
+ path += " v " + this.previewHeight;
+ path += " H " + Math.max(this.currentFrame[0], this.config.frameHandleThickness);
+ path += " z";
+
+ element.attr("d", path);
+ },
+
+ _renderFrame: function() {
+
+ var element = this.svg
+ .selectAll("path.frame")
+ .data([null]);
+
+ element.enter()
+ .append("path")
+ .attr("stroke", "white")
+ .attr("stroke-width", "1px")
+ .attr("stroke-linejoin", "round")
+ .attr("fill", this.config.frameColor)
+ .attr("fill-opacity", this.config.frameOpacity)
+ .attr("fill-rule", "evenodd")
+ .classed("frame", true);
+
+ var path = "";
+ path += " M " + this.currentFrame[0] + " 0";
+ path += " H " + (this.currentFrame[1] + (this.config.frameHandleThickness * 2));
+ path += " V " + this.config.height;
+ path += " H " + (this.currentFrame[0]);
+ path += " z";
+ path += " M " + (this.currentFrame[0] + this.config.frameHandleThickness) + " " + this.config.frameTopThickness;
+ path += " H " + (this.currentFrame[1] + this.config.frameHandleThickness);
+ path += " v " + this.previewHeight;
+ path += " H " + (this.currentFrame[0] + this.config.frameHandleThickness);
+ path += " z";
+
+ element.attr("d", path);
+ },
+
+ _renderGrippers: function() {
+
+ var gripper = this.svg.selectAll("path.gripper")
+ .data([null]);
+
+ gripper.enter()
+ .append("path")
+ .attr("stroke", this.config.gripperColor)
+ .classed("gripper", true);
+
+ var path = "";
+
+ [0.4, 0.6].forEach(function(spacing) {
+ path += " M " + Math.round((this.currentFrame[0] + (this.config.frameHandleThickness * spacing))) + " " + Math.round(this.config.height * 0.3);
+ path += " V " + Math.round(this.config.height * 0.7);
+ path += " M " + Math.round((this.currentFrame[1] + (this.config.frameHandleThickness * (1 + spacing)))) + " " + Math.round(this.config.height * 0.3);
+ path += " V " + Math.round(this.config.height * 0.7);
+ }.bind(this));
+
+ gripper.attr("d", path);
+ },
+
+ _renderHandles: function() {
+
+ var leftHandle = this.svg.selectAll("rect.left_handle")
+ .data([null]);
+
+ leftHandle.enter()
+ .append("rect")
+ .attr('width', this.config.frameHandleThickness)
+ .style("cursor", "ew-resize")
+ .style("fill-opacity", "0")
+ .classed("left_handle", true);
+
+ leftHandle
+ .attr('x', this.currentFrame[0])
+ .attr('height', this.config.height);
+
+ var rightHandle = this.svg.selectAll("rect.right_handle")
+ .data([null]);
+
+ rightHandle.enter()
+ .append("rect")
+ .attr('width', this.config.frameHandleThickness)
+ .style("cursor", "ew-resize")
+ .style("fill-opacity", "0")
+ .classed("right_handle", true);
+
+ rightHandle
+ .attr('x', this.currentFrame[1] + this.config.frameHandleThickness)
+ .attr('height', this.config.height);
+ },
+
+ _renderMiddle: function() {
+
+ var middleHandle = this.svg.selectAll("rect.middle_handle")
+ .data([null]);
+
+ middleHandle.enter()
+ .append("rect")
+ .style("cursor", "move")
+ .style("fill-opacity", "0")
+ .classed("middle_handle", true);
+
+ middleHandle
+ .attr('width', Math.max(0, this.currentFrame[1] - this.currentFrame[0]))
+ .attr('x', this.currentFrame[0] + this.config.frameHandleThickness)
+ .attr('height', this.config.height);
+ },
+
+ _registerMouseEvents: function() {
+
+ var element = d3.select(this.element);
+
+ var drag = {
+ target: null,
+ start: null,
+ stop: null,
+ left: false,
+ right: false,
+ rigid: false
+ };
+
+ var self = this;
+
+ function onMousemove(datum, index) {
+
+ drag.stop = self._getClientXFromEvent(d3.event, drag);
+ var distanceTraveled = drag.stop - drag.start;
+ var frameAfterDrag = self.frameBeforeDrag.slice(0);
+ var minimumFrameWidth = self.config.minimumFrameWidth;
+
+ if (drag.rigid) {
+ minimumFrameWidth = self.frameBeforeDrag[1] - self.frameBeforeDrag[0];
+ }
+ if (drag.left) {
+ frameAfterDrag[0] = Math.max(frameAfterDrag[0] + distanceTraveled, 0);
+ }
+ if (drag.right) {
+ frameAfterDrag[1] = Math.min(frameAfterDrag[1] + distanceTraveled, self.previewWidth);
+ }
+
+ var currentFrameWidth = frameAfterDrag[1] - frameAfterDrag[0];
+
+ if (currentFrameWidth <= minimumFrameWidth) {
+
+ if (drag.left) {
+ frameAfterDrag[0] = frameAfterDrag[1] - minimumFrameWidth;
+ }
+ if (drag.right) {
+ frameAfterDrag[1] = frameAfterDrag[0] + minimumFrameWidth;
+ }
+ if (frameAfterDrag[0] <= 0) {
+ frameAfterDrag[1] -= frameAfterDrag[0];
+ frameAfterDrag[0] = 0;
+ }
+ if (frameAfterDrag[1] >= self.previewWidth) {
+ frameAfterDrag[0] -= (frameAfterDrag[1] - self.previewWidth);
+ frameAfterDrag[1] = self.previewWidth;
+ }
+ }
+
+ self.graphs.forEach(function(graph) {
+
+ var domainScale = d3.scale.linear()
+ .interpolate(d3.interpolateNumber)
+ .domain([0, self.previewWidth])
+ .range(graph.dataDomain());
+
+ var windowAfterDrag = [
+ domainScale(frameAfterDrag[0]),
+ domainScale(frameAfterDrag[1])
+ ];
+
+ self.slideCallbacks.forEach(function(callback) {
+ callback(graph, windowAfterDrag[0], windowAfterDrag[1]);
+ });
+
+ if (frameAfterDrag[0] === 0) {
+ windowAfterDrag[0] = undefined;
+ }
+ if (frameAfterDrag[1] === self.previewWidth) {
+ windowAfterDrag[1] = undefined;
+ }
+ graph.window.xMin = windowAfterDrag[0];
+ graph.window.xMax = windowAfterDrag[1];
+
+ graph.update();
+ });
+ }
+
+ function onMousedown() {
+ drag.target = d3.event.target;
+ drag.start = self._getClientXFromEvent(d3.event, drag);
+ self.frameBeforeDrag = self.currentFrame.slice();
+ d3.event.preventDefault ? d3.event.preventDefault() : d3.event.returnValue = false;
+ d3.select(document).on("mousemove.rickshaw_range_slider_preview", onMousemove);
+ d3.select(document).on("mouseup.rickshaw_range_slider_preview", onMouseup);
+ d3.select(document).on("touchmove.rickshaw_range_slider_preview", onMousemove);
+ d3.select(document).on("touchend.rickshaw_range_slider_preview", onMouseup);
+ d3.select(document).on("touchcancel.rickshaw_range_slider_preview", onMouseup);
+ }
+
+ function onMousedownLeftHandle(datum, index) {
+ drag.left = true;
+ onMousedown();
+ }
+
+ function onMousedownRightHandle(datum, index) {
+ drag.right = true;
+ onMousedown();
+ }
+
+ function onMousedownMiddleHandle(datum, index) {
+ drag.left = true;
+ drag.right = true;
+ drag.rigid = true;
+ onMousedown();
+ }
+
+ function onMouseup(datum, index) {
+ d3.select(document).on("mousemove.rickshaw_range_slider_preview", null);
+ d3.select(document).on("mouseup.rickshaw_range_slider_preview", null);
+ d3.select(document).on("touchmove.rickshaw_range_slider_preview", null);
+ d3.select(document).on("touchend.rickshaw_range_slider_preview", null);
+ d3.select(document).on("touchcancel.rickshaw_range_slider_preview", null);
+ delete self.frameBeforeDrag;
+ drag.left = false;
+ drag.right = false;
+ drag.rigid = false;
+ }
+
+ element.select("rect.left_handle").on("mousedown", onMousedownLeftHandle);
+ element.select("rect.right_handle").on("mousedown", onMousedownRightHandle);
+ element.select("rect.middle_handle").on("mousedown", onMousedownMiddleHandle);
+ element.select("rect.left_handle").on("touchstart", onMousedownLeftHandle);
+ element.select("rect.right_handle").on("touchstart", onMousedownRightHandle);
+ element.select("rect.middle_handle").on("touchstart", onMousedownMiddleHandle);
+ },
+
+ _getClientXFromEvent: function(event, drag) {
+
+ switch (event.type) {
+ case 'touchstart':
+ case 'touchmove':
+ var touchList = event.changedTouches;
+ var touch = null;
+ for (var touchIndex = 0; touchIndex < touchList.length; touchIndex++) {
+ if (touchList[touchIndex].target === drag.target) {
+ touch = touchList[touchIndex];
+ break;
+ }
+ }
+ return touch !== null ? touch.clientX : undefined;
+
+ default:
+ return event.clientX;
+ }
+ }
+});
+
+Rickshaw.namespace("Rickshaw.Graph.Renderer");
+
+Rickshaw.Graph.Renderer = Rickshaw.Class.create( {
+
+ initialize: function(args) {
+ this.graph = args.graph;
+ this.tension = args.tension || this.tension;
+ this.configure(args);
+ },
+
+ seriesPathFactory: function() {
+ //implement in subclass
+ },
+
+ seriesStrokeFactory: function() {
+ // implement in subclass
+ },
+
+ defaults: function() {
+ return {
+ tension: 0.8,
+ strokeWidth: 2,
+ unstack: true,
+ padding: { top: 0.01, right: 0, bottom: 0.01, left: 0 },
+ stroke: false,
+ fill: false
+ };
+ },
+
+ domain: function(data) {
+ // Requires that at least one series contains some data
+ var stackedData = data || this.graph.stackedData || this.graph.stackData();
+
+ var xMin = +Infinity;
+ var xMax = -Infinity;
+
+ var yMin = +Infinity;
+ var yMax = -Infinity;
+
+ stackedData.forEach( function(series) {
+
+ series.forEach( function(d) {
+
+ if (d.y == null) return;
+
+ var y = d.y + d.y0;
+
+ if (y < yMin) yMin = y;
+ if (y > yMax) yMax = y;
+ } );
+
+ if (!series.length) return;
+
+ if (series[0].x < xMin) xMin = series[0].x;
+ if (series[series.length - 1].x > xMax) xMax = series[series.length - 1].x;
+ } );
+
+ xMin -= (xMax - xMin) * this.padding.left;
+ xMax += (xMax - xMin) * this.padding.right;
+
+ yMin = this.graph.min === 'auto' ? yMin : this.graph.min || 0;
+ yMax = this.graph.max === undefined ? yMax : this.graph.max;
+
+ if (this.graph.min === 'auto' || yMin < 0) {
+ yMin -= (yMax - yMin) * this.padding.bottom;
+ }
+
+ if (this.graph.max === undefined) {
+ yMax += (yMax - yMin) * this.padding.top;
+ }
+
+ return { x: [xMin, xMax], y: [yMin, yMax] };
+ },
+
+ render: function(args) {
+
+ args = args || {};
+
+ var graph = this.graph;
+ var series = args.series || graph.series;
+
+ var vis = args.vis || graph.vis;
+ vis.selectAll('*').remove();
+
+ var data = series
+ .filter(function(s) { return !s.disabled })
+ .map(function(s) { return s.stack });
+
+ var pathNodes = vis.selectAll("path.path")
+ .data(data)
+ .enter().append("svg:path")
+ .classed('path', true)
+ .attr("d", this.seriesPathFactory());
+
+ if (this.stroke) {
+ var strokeNodes = vis.selectAll('path.stroke')
+ .data(data)
+ .enter().append("svg:path")
+ .classed('stroke', true)
+ .attr("d", this.seriesStrokeFactory());
+ }
+
+ var i = 0;
+ series.forEach( function(series) {
+ if (series.disabled) return;
+ series.path = pathNodes[0][i];
+ if (this.stroke) series.stroke = strokeNodes[0][i];
+ this._styleSeries(series);
+ i++;
+ }, this );
+
+ },
+
+ _styleSeries: function(series) {
+
+ var fill = this.fill ? series.color : 'none';
+ var stroke = this.stroke ? series.color : 'none';
+
+ series.path.setAttribute('fill', fill);
+ series.path.setAttribute('stroke', stroke);
+ series.path.setAttribute('stroke-width', this.strokeWidth);
+
+ if (series.className) {
+ d3.select(series.path).classed(series.className, true);
+ }
+ if (series.className && this.stroke) {
+ d3.select(series.stroke).classed(series.className, true);
+ }
+ },
+
+ configure: function(args) {
+
+ args = args || {};
+
+ Rickshaw.keys(this.defaults()).forEach( function(key) {
+
+ if (!args.hasOwnProperty(key)) {
+ this[key] = this[key] || this.graph[key] || this.defaults()[key];
+ return;
+ }
+
+ if (typeof this.defaults()[key] == 'object') {
+
+ Rickshaw.keys(this.defaults()[key]).forEach( function(k) {
+
+ this[key][k] =
+ args[key][k] !== undefined ? args[key][k] :
+ this[key][k] !== undefined ? this[key][k] :
+ this.defaults()[key][k];
+ }, this );
+
+ } else {
+ this[key] =
+ args[key] !== undefined ? args[key] :
+ this[key] !== undefined ? this[key] :
+ this.graph[key] !== undefined ? this.graph[key] :
+ this.defaults()[key];
+ }
+
+ }, this );
+ },
+
+ setStrokeWidth: function(strokeWidth) {
+ if (strokeWidth !== undefined) {
+ this.strokeWidth = strokeWidth;
+ }
+ },
+
+ setTension: function(tension) {
+ if (tension !== undefined) {
+ this.tension = tension;
+ }
+ }
+} );
+
+Rickshaw.namespace('Rickshaw.Graph.Renderer.Line');
+
+Rickshaw.Graph.Renderer.Line = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
+
+ name: 'line',
+
+ defaults: function($super) {
+
+ return Rickshaw.extend( $super(), {
+ unstack: true,
+ fill: false,
+ stroke: true
+ } );
+ },
+
+ seriesPathFactory: function() {
+
+ var graph = this.graph;
+
+ var factory = d3.svg.line()
+ .x( function(d) { return graph.x(d.x) } )
+ .y( function(d) { return graph.y(d.y) } )
+ .interpolate(this.graph.interpolation).tension(this.tension);
+
+ factory.defined && factory.defined( function(d) { return d.y !== null } );
+ return factory;
+ }
+} );
+
+Rickshaw.namespace('Rickshaw.Graph.Renderer.Stack');
+
+Rickshaw.Graph.Renderer.Stack = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
+
+ name: 'stack',
+
+ defaults: function($super) {
+
+ return Rickshaw.extend( $super(), {
+ fill: true,
+ stroke: false,
+ unstack: false
+ } );
+ },
+
+ seriesPathFactory: function() {
+
+ var graph = this.graph;
+
+ var factory = d3.svg.area()
+ .x( function(d) { return graph.x(d.x) } )
+ .y0( function(d) { return graph.y(d.y0) } )
+ .y1( function(d) { return graph.y(d.y + d.y0) } )
+ .interpolate(this.graph.interpolation).tension(this.tension);
+
+ factory.defined && factory.defined( function(d) { return d.y !== null } );
+ return factory;
+ }
+} );
+
+Rickshaw.namespace('Rickshaw.Graph.Renderer.Bar');
+
+Rickshaw.Graph.Renderer.Bar = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
+
+ name: 'bar',
+
+ defaults: function($super) {
+
+ var defaults = Rickshaw.extend( $super(), {
+ gapSize: 0.05,
+ unstack: false
+ } );
+
+ delete defaults.tension;
+ return defaults;
+ },
+
+ initialize: function($super, args) {
+ args = args || {};
+ this.gapSize = args.gapSize || this.gapSize;
+ $super(args);
+ },
+
+ domain: function($super) {
+
+ var domain = $super();
+
+ var frequentInterval = this._frequentInterval(this.graph.stackedData.slice(-1).shift());
+ domain.x[1] += Number(frequentInterval.magnitude);
+
+ return domain;
+ },
+
+ barWidth: function(series) {
+
+ var frequentInterval = this._frequentInterval(series.stack);
+ var barWidth = this.graph.x.magnitude(frequentInterval.magnitude) * (1 - this.gapSize);
+
+ return barWidth;
+ },
+
+ render: function(args) {
+
+ args = args || {};
+
+ var graph = this.graph;
+ var series = args.series || graph.series;
+
+ var vis = args.vis || graph.vis;
+ vis.selectAll('*').remove();
+
+ var barWidth = this.barWidth(series.active()[0]);
+ var barXOffset = 0;
+
+ var activeSeriesCount = series.filter( function(s) { return !s.disabled; } ).length;
+ var seriesBarWidth = this.unstack ? barWidth / activeSeriesCount : barWidth;
+
+ var transform = function(d) {
+ // add a matrix transform for negative values
+ var matrix = [ 1, 0, 0, (d.y < 0 ? -1 : 1), 0, (d.y < 0 ? graph.y.magnitude(Math.abs(d.y)) * 2 : 0) ];
+ return "matrix(" + matrix.join(',') + ")";
+ };
+
+ series.forEach( function(series) {
+
+ if (series.disabled) return;
+
+ var barWidth = this.barWidth(series);
+
+ var nodes = vis.selectAll("path")
+ .data(series.stack.filter( function(d) { return d.y !== null } ))
+ .enter().append("svg:rect")
+ .attr("x", function(d) { return graph.x(d.x) + barXOffset })
+ .attr("y", function(d) { return (graph.y(d.y0 + Math.abs(d.y))) * (d.y < 0 ? -1 : 1 ) })
+ .attr("width", seriesBarWidth)
+ .attr("height", function(d) { return graph.y.magnitude(Math.abs(d.y)) })
+ .attr("transform", transform);
+
+ Array.prototype.forEach.call(nodes[0], function(n) {
+ n.setAttribute('fill', series.color);
+ } );
+
+ if (this.unstack) barXOffset += seriesBarWidth;
+
+ }, this );
+ },
+
+ _frequentInterval: function(data) {
+
+ var intervalCounts = {};
+
+ for (var i = 0; i < data.length - 1; i++) {
+ var interval = data[i + 1].x - data[i].x;
+ intervalCounts[interval] = intervalCounts[interval] || 0;
+ intervalCounts[interval]++;
+ }
+
+ var frequentInterval = { count: 0, magnitude: 1 };
+
+ Rickshaw.keys(intervalCounts).forEach( function(i) {
+ if (frequentInterval.count < intervalCounts[i]) {
+ frequentInterval = {
+ count: intervalCounts[i],
+ magnitude: i
+ };
+ }
+ } );
+
+ return frequentInterval;
+ }
+} );
+
+Rickshaw.namespace('Rickshaw.Graph.Renderer.Area');
+
+Rickshaw.Graph.Renderer.Area = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
+
+ name: 'area',
+
+ defaults: function($super) {
+
+ return Rickshaw.extend( $super(), {
+ unstack: false,
+ fill: false,
+ stroke: false
+ } );
+ },
+
+ seriesPathFactory: function() {
+
+ var graph = this.graph;
+
+ var factory = d3.svg.area()
+ .x( function(d) { return graph.x(d.x) } )
+ .y0( function(d) { return graph.y(d.y0) } )
+ .y1( function(d) { return graph.y(d.y + d.y0) } )
+ .interpolate(graph.interpolation).tension(this.tension);
+
+ factory.defined && factory.defined( function(d) { return d.y !== null } );
+ return factory;
+ },
+
+ seriesStrokeFactory: function() {
+
+ var graph = this.graph;
+
+ var factory = d3.svg.line()
+ .x( function(d) { return graph.x(d.x) } )
+ .y( function(d) { return graph.y(d.y + d.y0) } )
+ .interpolate(graph.interpolation).tension(this.tension);
+
+ factory.defined && factory.defined( function(d) { return d.y !== null } );
+ return factory;
+ },
+
+ render: function(args) {
+
+ args = args || {};
+
+ var graph = this.graph;
+ var series = args.series || graph.series;
+
+ var vis = args.vis || graph.vis;
+ vis.selectAll('*').remove();
+
+ // insert or stacked areas so strokes lay on top of areas
+ var method = this.unstack ? 'append' : 'insert';
+
+ var data = series
+ .filter(function(s) { return !s.disabled })
+ .map(function(s) { return s.stack });
+
+ var nodes = vis.selectAll("path")
+ .data(data)
+ .enter()[method]("svg:g", 'g');
+
+ nodes.append("svg:path")
+ .attr("d", this.seriesPathFactory())
+ .attr("class", 'area');
+
+ if (this.stroke) {
+ nodes.append("svg:path")
+ .attr("d", this.seriesStrokeFactory())
+ .attr("class", 'line');
+ }
+
+ var i = 0;
+ series.forEach( function(series) {
+ if (series.disabled) return;
+ series.path = nodes[0][i++];
+ this._styleSeries(series);
+ }, this );
+ },
+
+ _styleSeries: function(series) {
+
+ if (!series.path) return;
+
+ d3.select(series.path).select('.area')
+ .attr('fill', series.color);
+
+ if (this.stroke) {
+ d3.select(series.path).select('.line')
+ .attr('fill', 'none')
+ .attr('stroke', series.stroke || d3.interpolateRgb(series.color, 'black')(0.125))
+ .attr('stroke-width', this.strokeWidth);
+ }
+
+ if (series.className) {
+ series.path.setAttribute('class', series.className);
+ }
+ }
+} );
+
+Rickshaw.namespace('Rickshaw.Graph.Renderer.ScatterPlot');
+
+Rickshaw.Graph.Renderer.ScatterPlot = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
+
+ name: 'scatterplot',
+
+ defaults: function($super) {
+
+ return Rickshaw.extend( $super(), {
+ unstack: true,
+ fill: true,
+ stroke: false,
+ padding:{ top: 0.01, right: 0.01, bottom: 0.01, left: 0.01 },
+ dotSize: 4
+ } );
+ },
+
+ initialize: function($super, args) {
+ $super(args);
+ },
+
+ render: function(args) {
+
+ args = args || {};
+
+ var graph = this.graph;
+
+ var series = args.series || graph.series;
+ var vis = args.vis || graph.vis;
+
+ var dotSize = this.dotSize;
+
+ vis.selectAll('*').remove();
+
+ series.forEach( function(series) {
+
+ if (series.disabled) return;
+
+ var nodes = vis.selectAll("path")
+ .data(series.stack.filter( function(d) { return d.y !== null } ))
+ .enter().append("svg:circle")
+ .attr("cx", function(d) { return graph.x(d.x) })
+ .attr("cy", function(d) { return graph.y(d.y) })
+ .attr("r", function(d) { return ("r" in d) ? d.r : dotSize});
+ if (series.className) {
+ nodes.classed(series.className, true);
+ }
+
+ Array.prototype.forEach.call(nodes[0], function(n) {
+ n.setAttribute('fill', series.color);
+ } );
+
+ }, this );
+ }
+} );
+Rickshaw.namespace('Rickshaw.Graph.Renderer.Multi');
+
+Rickshaw.Graph.Renderer.Multi = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
+
+ name: 'multi',
+
+ initialize: function($super, args) {
+
+ $super(args);
+ },
+
+ defaults: function($super) {
+
+ return Rickshaw.extend( $super(), {
+ unstack: true,
+ fill: false,
+ stroke: true
+ } );
+ },
+
+ configure: function($super, args) {
+
+ args = args || {};
+ this.config = args;
+ $super(args);
+ },
+
+ domain: function($super) {
+
+ this.graph.stackData();
+
+ var domains = [];
+
+ var groups = this._groups();
+ this._stack(groups);
+
+ groups.forEach( function(group) {
+
+ var data = group.series
+ .filter( function(s) { return !s.disabled } )
+ .map( function(s) { return s.stack });
+
+ if (!data.length) return;
+
+ var domain = null;
+ if (group.renderer && group.renderer.domain) {
+ domain = group.renderer.domain(data);
+ }
+ else {
+ domain = $super(data);
+ }
+ domains.push(domain);
+ });
+
+ var xMin = d3.min(domains.map( function(d) { return d.x[0] } ));
+ var xMax = d3.max(domains.map( function(d) { return d.x[1] } ));
+ var yMin = d3.min(domains.map( function(d) { return d.y[0] } ));
+ var yMax = d3.max(domains.map( function(d) { return d.y[1] } ));
+
+ return { x: [xMin, xMax], y: [yMin, yMax] };
+ },
+
+ _groups: function() {
+
+ var graph = this.graph;
+
+ var renderGroups = {};
+
+ graph.series.forEach( function(series) {
+
+ if (series.disabled) return;
+
+ if (!renderGroups[series.renderer]) {
+
+ var ns = "http://www.w3.org/2000/svg";
+ var vis = document.createElementNS(ns, 'g');
+
+ graph.vis[0][0].appendChild(vis);
+
+ var renderer = graph._renderers[series.renderer];
+
+ var config = {};
+
+ var defaults = [ this.defaults(), renderer.defaults(), this.config, this.graph ];
+ defaults.forEach(function(d) { Rickshaw.extend(config, d) });
+
+ renderer.configure(config);
+
+ renderGroups[series.renderer] = {
+ renderer: renderer,
+ series: [],
+ vis: d3.select(vis)
+ };
+ }
+
+ renderGroups[series.renderer].series.push(series);
+
+ }, this);
+
+ var groups = [];
+
+ Object.keys(renderGroups).forEach( function(key) {
+ var group = renderGroups[key];
+ groups.push(group);
+ });
+
+ return groups;
+ },
+
+ _stack: function(groups) {
+
+ groups.forEach( function(group) {
+
+ var series = group.series
+ .filter( function(series) { return !series.disabled } );
+
+ var data = series
+ .map( function(series) { return series.stack } );
+
+ if (!group.renderer.unstack) {
+
+ var layout = d3.layout.stack();
+ var stackedData = Rickshaw.clone(layout(data));
+
+ series.forEach( function(series, index) {
+ series._stack = Rickshaw.clone(stackedData[index]);
+ });
+ }
+
+ }, this );
+
+ return groups;
+
+ },
+
+ render: function() {
+
+ this.graph.series.forEach( function(series) {
+ if (!series.renderer) {
+ throw new Error("Each series needs a renderer for graph 'multi' renderer");
+ }
+ });
+
+ this.graph.vis.selectAll('*').remove();
+
+ var groups = this._groups();
+ groups = this._stack(groups);
+
+ groups.forEach( function(group) {
+
+ var series = group.series
+ .filter( function(series) { return !series.disabled } );
+
+ series.active = function() { return series };
+
+ group.renderer.render({ series: series, vis: group.vis });
+ series.forEach(function(s) { s.stack = s._stack || s.stack || s.data; });
+ });
+ }
+
+} );
+Rickshaw.namespace('Rickshaw.Graph.Renderer.LinePlot');
+
+Rickshaw.Graph.Renderer.LinePlot = Rickshaw.Class.create( Rickshaw.Graph.Renderer, {
+
+ name: 'lineplot',
+
+ defaults: function($super) {
+
+ return Rickshaw.extend( $super(), {
+ unstack: true,
+ fill: false,
+ stroke: true,
+ padding:{ top: 0.01, right: 0.01, bottom: 0.01, left: 0.01 },
+ dotSize: 3,
+ strokeWidth: 2
+ } );
+ },
+
+ seriesPathFactory: function() {
+
+ var graph = this.graph;
+
+ var factory = d3.svg.line()
+ .x( function(d) { return graph.x(d.x) } )
+ .y( function(d) { return graph.y(d.y) } )
+ .interpolate(this.graph.interpolation).tension(this.tension);
+
+ factory.defined && factory.defined( function(d) { return d.y !== null } );
+ return factory;
+ },
+
+ render: function(args) {
+
+ args = args || {};
+
+ var graph = this.graph;
+
+ var series = args.series || graph.series;
+ var vis = args.vis || graph.vis;
+
+ var dotSize = this.dotSize;
+
+ vis.selectAll('*').remove();
+
+ var data = series
+ .filter(function(s) { return !s.disabled })
+ .map(function(s) { return s.stack });
+
+ var nodes = vis.selectAll("path")
+ .data(data)
+ .enter().append("svg:path")
+ .attr("d", this.seriesPathFactory());
+
+ var i = 0;
+ series.forEach(function(series) {
+ if (series.disabled) return;
+ series.path = nodes[0][i++];
+ this._styleSeries(series);
+ }, this);
+
+ series.forEach(function(series) {
+
+ if (series.disabled) return;
+
+ var nodes = vis.selectAll("x")
+ .data(series.stack.filter( function(d) { return d.y !== null } ))
+ .enter().append("svg:circle")
+ .attr("cx", function(d) { return graph.x(d.x) })
+ .attr("cy", function(d) { return graph.y(d.y) })
+ .attr("r", function(d) { return ("r" in d) ? d.r : dotSize});
+
+ Array.prototype.forEach.call(nodes[0], function(n) {
+ if (!n) return;
+ n.setAttribute('data-color', series.color);
+ n.setAttribute('fill', 'white');
+ n.setAttribute('stroke', series.color);
+ n.setAttribute('stroke-width', this.strokeWidth);
+
+ }.bind(this));
+
+ }, this);
+ }
+} );
+
+Rickshaw.namespace('Rickshaw.Graph.Smoother');
+
+Rickshaw.Graph.Smoother = Rickshaw.Class.create({
+
+ initialize: function(args) {
+
+ this.graph = args.graph;
+ this.element = args.element;
+ this.aggregationScale = 1;
+
+ this.build();
+
+ this.graph.stackData.hooks.data.push( {
+ name: 'smoother',
+ orderPosition: 50,
+ f: this.transformer.bind(this)
+ } );
+ },
+
+ build: function() {
+
+ var self = this;
+ var $ = jQuery;
+
+ if (this.element) {
+ $( function() {
+ $(self.element).slider( {
+ min: 1,
+ max: 100,
+ slide: function( event, ui ) {
+ self.setScale(ui.value);
+ }
+ } );
+ } );
+ }
+ },
+
+ setScale: function(scale) {
+
+ if (scale < 1) {
+ throw "scale out of range: " + scale;
+ }
+
+ this.aggregationScale = scale;
+ this.graph.update();
+ },
+
+ transformer: function(data) {
+
+ if (this.aggregationScale == 1) return data;
+
+ var aggregatedData = [];
+
+ data.forEach( function(seriesData) {
+
+ var aggregatedSeriesData = [];
+
+ while (seriesData.length) {
+
+ var avgX = 0, avgY = 0;
+ var slice = seriesData.splice(0, this.aggregationScale);
+
+ slice.forEach( function(d) {
+ avgX += d.x / slice.length;
+ avgY += d.y / slice.length;
+ } );
+
+ aggregatedSeriesData.push( { x: avgX, y: avgY } );
+ }
+
+ aggregatedData.push(aggregatedSeriesData);
+
+ }.bind(this) );
+
+ return aggregatedData;
+ }
+});
+
+Rickshaw.namespace('Rickshaw.Graph.Socketio');
+
+Rickshaw.Graph.Socketio = Rickshaw.Class.create( Rickshaw.Graph.Ajax, {
+ request: function() {
+ var socket = io.connect(this.dataURL);
+ var self = this;
+ socket.on('rickshaw', function (data) {
+ self.success(data);
+ });
+ }
+} );
+Rickshaw.namespace('Rickshaw.Series');
+
+Rickshaw.Series = Rickshaw.Class.create( Array, {
+
+ initialize: function (data, palette, options) {
+
+ options = options || {};
+
+ this.palette = new Rickshaw.Color.Palette(palette);
+
+ this.timeBase = typeof(options.timeBase) === 'undefined' ?
+ Math.floor(new Date().getTime() / 1000) :
+ options.timeBase;
+
+ var timeInterval = typeof(options.timeInterval) == 'undefined' ?
+ 1000 :
+ options.timeInterval;
+
+ this.setTimeInterval(timeInterval);
+
+ if (data && (typeof(data) == "object") && Array.isArray(data)) {
+ data.forEach( function(item) { this.addItem(item) }, this );
+ }
+ },
+
+ addItem: function(item) {
+
+ if (typeof(item.name) === 'undefined') {
+ throw('addItem() needs a name');
+ }
+
+ item.color = (item.color || this.palette.color(item.name));
+ item.data = (item.data || []);
+
+ // backfill, if necessary
+ if ((item.data.length === 0) && this.length && (this.getIndex() > 0)) {
+ this[0].data.forEach( function(plot) {
+ item.data.push({ x: plot.x, y: 0 });
+ } );
+ } else if (item.data.length === 0) {
+ item.data.push({ x: this.timeBase - (this.timeInterval || 0), y: 0 });
+ }
+
+ this.push(item);
+
+ if (this.legend) {
+ this.legend.addLine(this.itemByName(item.name));
+ }
+ },
+
+ addData: function(data, x) {
+
+ var index = this.getIndex();
+
+ Rickshaw.keys(data).forEach( function(name) {
+ if (! this.itemByName(name)) {
+ this.addItem({ name: name });
+ }
+ }, this );
+
+ this.forEach( function(item) {
+ item.data.push({
+ x: x || (index * this.timeInterval || 1) + this.timeBase,
+ y: (data[item.name] || 0)
+ });
+ }, this );
+ },
+
+ getIndex: function () {
+ return (this[0] && this[0].data && this[0].data.length) ? this[0].data.length : 0;
+ },
+
+ itemByName: function(name) {
+
+ for (var i = 0; i < this.length; i++) {
+ if (this[i].name == name)
+ return this[i];
+ }
+ },
+
+ setTimeInterval: function(iv) {
+ this.timeInterval = iv / 1000;
+ },
+
+ setTimeBase: function (t) {
+ this.timeBase = t;
+ },
+
+ dump: function() {
+
+ var data = {
+ timeBase: this.timeBase,
+ timeInterval: this.timeInterval,
+ items: []
+ };
+
+ this.forEach( function(item) {
+
+ var newItem = {
+ color: item.color,
+ name: item.name,
+ data: []
+ };
+
+ item.data.forEach( function(plot) {
+ newItem.data.push({ x: plot.x, y: plot.y });
+ } );
+
+ data.items.push(newItem);
+ } );
+
+ return data;
+ },
+
+ load: function(data) {
+
+ if (data.timeInterval) {
+ this.timeInterval = data.timeInterval;
+ }
+
+ if (data.timeBase) {
+ this.timeBase = data.timeBase;
+ }
+
+ if (data.items) {
+ data.items.forEach( function(item) {
+ this.push(item);
+ if (this.legend) {
+ this.legend.addLine(this.itemByName(item.name));
+ }
+
+ }, this );
+ }
+ }
+} );
+
+Rickshaw.Series.zeroFill = function(series) {
+ Rickshaw.Series.fill(series, 0);
+};
+
+Rickshaw.Series.fill = function(series, fill) {
+
+ var x;
+ var i = 0;
+
+ var data = series.map( function(s) { return s.data } );
+
+ while ( i < Math.max.apply(null, data.map( function(d) { return d.length } )) ) {
+
+ x = Math.min.apply( null,
+ data
+ .filter(function(d) { return d[i] })
+ .map(function(d) { return d[i].x })
+ );
+
+ data.forEach( function(d) {
+ if (!d[i] || d[i].x != x) {
+ d.splice(i, 0, { x: x, y: fill });
+ }
+ } );
+
+ i++;
+ }
+};
+
+Rickshaw.namespace('Rickshaw.Series.FixedDuration');
+
+Rickshaw.Series.FixedDuration = Rickshaw.Class.create(Rickshaw.Series, {
+
+ initialize: function (data, palette, options) {
+
+ options = options || {};
+
+ if (typeof(options.timeInterval) === 'undefined') {
+ throw new Error('FixedDuration series requires timeInterval');
+ }
+
+ if (typeof(options.maxDataPoints) === 'undefined') {
+ throw new Error('FixedDuration series requires maxDataPoints');
+ }
+
+ this.palette = new Rickshaw.Color.Palette(palette);
+ this.timeBase = typeof(options.timeBase) === 'undefined' ? Math.floor(new Date().getTime() / 1000) : options.timeBase;
+ this.setTimeInterval(options.timeInterval);
+
+ if (this[0] && this[0].data && this[0].data.length) {
+ this.currentSize = this[0].data.length;
+ this.currentIndex = this[0].data.length;
+ } else {
+ this.currentSize = 0;
+ this.currentIndex = 0;
+ }
+
+ this.maxDataPoints = options.maxDataPoints;
+
+
+ if (data && (typeof(data) == "object") && Array.isArray(data)) {
+ data.forEach( function (item) { this.addItem(item) }, this );
+ this.currentSize += 1;
+ this.currentIndex += 1;
+ }
+
+ // reset timeBase for zero-filled values if needed
+ this.timeBase -= (this.maxDataPoints - this.currentSize) * this.timeInterval;
+
+ // zero-fill up to maxDataPoints size if we don't have that much data yet
+ if ((typeof(this.maxDataPoints) !== 'undefined') && (this.currentSize < this.maxDataPoints)) {
+ for (var i = this.maxDataPoints - this.currentSize - 1; i > 1; i--) {
+ this.currentSize += 1;
+ this.currentIndex += 1;
+ this.forEach( function (item) {
+ item.data.unshift({ x: ((i-1) * this.timeInterval || 1) + this.timeBase, y: 0, i: i });
+ }, this );
+ }
+ }
+ },
+
+ addData: function($super, data, x) {
+
+ $super(data, x);
+
+ this.currentSize += 1;
+ this.currentIndex += 1;
+
+ if (this.maxDataPoints !== undefined) {
+ while (this.currentSize > this.maxDataPoints) {
+ this.dropData();
+ }
+ }
+ },
+
+ dropData: function() {
+
+ this.forEach(function(item) {
+ item.data.splice(0, 1);
+ } );
+
+ this.currentSize -= 1;
+ },
+
+ getIndex: function () {
+ return this.currentIndex;
+ }
+} );
+
+ return Rickshaw;
+}));
diff --git a/sstuff.hh b/sstuff.hh
new file mode 100644
index 0000000..5b14e23
--- /dev/null
+++ b/sstuff.hh
@@ -0,0 +1,390 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <string>
+#include <sstream>
+#include <iostream>
+#include "iputils.hh"
+#include <errno.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+#include <sys/select.h>
+#include <fcntl.h>
+#include <stdexcept>
+
+#include <boost/utility.hpp>
+#include <csignal>
+#include "namespaces.hh"
+
+
+typedef int ProtocolType; //!< Supported protocol types
+
+//! Representation of a Socket and many of the Berkeley functions available
+class Socket : public boost::noncopyable
+{
+public:
+ Socket(int fd): d_socket(fd)
+ {
+ }
+
+ //! Construct a socket of specified address family and socket type.
+ Socket(int af, int st, ProtocolType pt=0)
+ {
+ if((d_socket=socket(af, st, pt))<0)
+ throw NetworkError(stringerror());
+ setCloseOnExec(d_socket);
+ }
+
+ Socket(Socket&& rhs): d_buffer(std::move(rhs.d_buffer)), d_socket(rhs.d_socket)
+ {
+ rhs.d_socket = -1;
+ }
+
+ Socket& operator=(Socket&& rhs)
+ {
+ if (d_socket != -1) {
+ close(d_socket);
+ }
+ d_socket = rhs.d_socket;
+ rhs.d_socket = -1;
+ d_buffer = std::move(rhs.d_buffer);
+ return *this;
+ }
+
+ ~Socket()
+ {
+ try {
+ if (d_socket != -1) {
+ closesocket(d_socket);
+ }
+ }
+ catch(const PDNSException& e) {
+ }
+ }
+
+ //! If the socket is capable of doing so, this function will wait for a connection
+ std::unique_ptr<Socket> accept()
+ {
+ struct sockaddr_in remote;
+ socklen_t remlen=sizeof(remote);
+ memset(&remote, 0, sizeof(remote));
+ int s=::accept(d_socket, reinterpret_cast<sockaddr *>(&remote), &remlen);
+ if(s<0) {
+ if(errno==EAGAIN)
+ return nullptr;
+
+ throw NetworkError("Accepting a connection: "+stringerror());
+ }
+
+ return std::make_unique<Socket>(s);
+ }
+
+ //! Get remote address
+ bool getRemote(ComboAddress &remote) {
+ socklen_t remotelen=sizeof(remote);
+ return (getpeername(d_socket, reinterpret_cast<struct sockaddr *>(&remote), &remotelen) >= 0);
+ }
+
+ //! Check remote address against netmaskgroup ng
+ bool acl(const NetmaskGroup &ng)
+ {
+ ComboAddress remote;
+ if (getRemote(remote))
+ return ng.match(remote);
+
+ return false;
+ }
+
+ //! Set the socket to non-blocking
+ void setNonBlocking()
+ {
+ ::setNonBlocking(d_socket);
+ }
+
+ //! Set the socket to blocking
+ void setBlocking()
+ {
+ ::setBlocking(d_socket);
+ }
+
+ void setReuseAddr()
+ {
+ try {
+ ::setReuseAddr(d_socket);
+ } catch (const PDNSException &e) {
+ throw NetworkError(e.reason);
+ }
+ }
+
+ void setFastOpenConnect()
+ {
+#ifdef TCP_FASTOPEN_CONNECT
+ int on = 1;
+ if (setsockopt(d_socket, IPPROTO_TCP, TCP_FASTOPEN_CONNECT, &on, sizeof(on)) < 0) {
+ throw NetworkError("While setting TCP_FASTOPEN_CONNECT: " + stringerror());
+ }
+#else
+ throw NetworkError("While setting TCP_FASTOPEN_CONNECT: not compiled in");
+#endif
+ }
+
+ //! Bind the socket to a specified endpoint
+ void bind(const ComboAddress &local, bool reuseaddr=true)
+ {
+ int tmp=1;
+ if(reuseaddr && setsockopt(d_socket, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&tmp), sizeof tmp)<0)
+ throw NetworkError("Setsockopt failed: "+stringerror());
+
+ if(::bind(d_socket, reinterpret_cast<const struct sockaddr *>(&local), local.getSocklen())<0)
+ throw NetworkError("While binding: "+stringerror());
+ }
+
+ //! Connect the socket to a specified endpoint
+ void connect(const ComboAddress &ep, int timeout=0)
+ {
+ SConnectWithTimeout(d_socket, ep, timeval{timeout,0});
+ }
+
+
+ //! For datagram sockets, receive a datagram and learn where it came from
+ /** For datagram sockets, receive a datagram and learn where it came from
+ \param dgram Will be filled with the datagram
+ \param ep Will be filled with the origin of the datagram */
+ void recvFrom(string &dgram, ComboAddress &ep)
+ {
+ socklen_t remlen = sizeof(ep);
+ ssize_t bytes;
+ d_buffer.resize(s_buflen);
+ if((bytes=recvfrom(d_socket, &d_buffer[0], s_buflen, 0, reinterpret_cast<sockaddr *>(&ep) , &remlen)) <0)
+ throw NetworkError("After recvfrom: "+stringerror());
+
+ dgram.assign(d_buffer, 0, static_cast<size_t>(bytes));
+ }
+
+ bool recvFromAsync(string &dgram, ComboAddress &ep)
+ {
+ struct sockaddr_in remote;
+ socklen_t remlen = sizeof(remote);
+ ssize_t bytes;
+ d_buffer.resize(s_buflen);
+ if((bytes=recvfrom(d_socket, &d_buffer[0], s_buflen, 0, reinterpret_cast<sockaddr *>(&remote), &remlen))<0) {
+ if(errno!=EAGAIN) {
+ throw NetworkError("After async recvfrom: "+stringerror());
+ }
+ else {
+ return false;
+ }
+ }
+ dgram.assign(d_buffer, 0, static_cast<size_t>(bytes));
+ return true;
+ }
+
+
+ //! For datagram sockets, send a datagram to a destination
+ void sendTo(const char* msg, size_t len, const ComboAddress &ep)
+ {
+ if(sendto(d_socket, msg, len, 0, reinterpret_cast<const sockaddr *>(&ep), ep.getSocklen())<0)
+ throw NetworkError("After sendto: "+stringerror());
+ }
+
+ //! For connected datagram sockets, send a datagram
+ void send(const std::string& msg)
+ {
+ if(::send(d_socket, msg.c_str(), msg.size(), 0)<0)
+ throw NetworkError("After send: "+stringerror());
+ }
+
+
+ /** For datagram sockets, send a datagram to a destination
+ \param dgram The datagram
+ \param ep The intended destination of the datagram */
+ void sendTo(const string &dgram, const ComboAddress &ep)
+ {
+ sendTo(dgram.c_str(), dgram.length(), ep);
+ }
+
+
+ //! Write this data to the socket, taking care that all bytes are written out
+ void writen(const string &data)
+ {
+ if(data.empty())
+ return;
+
+ size_t toWrite=data.length();
+ ssize_t res;
+ const char *ptr=data.c_str();
+
+ do {
+ res=::send(d_socket, ptr, toWrite, 0);
+ if(res<0)
+ throw NetworkError("Writing to a socket: "+stringerror());
+ if(!res)
+ throw NetworkError("EOF on socket");
+ toWrite -= static_cast<size_t>(res);
+ ptr += static_cast<size_t>(res);
+ } while(toWrite);
+
+ }
+
+ //! tries to write toWrite bytes from ptr to the socket
+ /** tries to write toWrite bytes from ptr to the socket, but does not make sure they al get written out
+ \param ptr Location to write from
+ \param toWrite number of bytes to try
+ */
+ size_t tryWrite(const char *ptr, size_t toWrite)
+ {
+ ssize_t res;
+ res=::send(d_socket,ptr,toWrite,0);
+ if(res==0)
+ throw NetworkError("EOF on writing to a socket");
+
+ if(res>0)
+ return res;
+
+ if(errno==EAGAIN)
+ return 0;
+
+ throw NetworkError("Writing to a socket: "+stringerror());
+ }
+
+ //! Writes toWrite bytes from ptr to the socket
+ /** Writes toWrite bytes from ptr to the socket. Returns how many bytes were written */
+ size_t write(const char *ptr, size_t toWrite)
+ {
+ ssize_t res;
+ res=::send(d_socket,ptr,toWrite,0);
+ if(res<0) {
+ throw NetworkError("Writing to a socket: "+stringerror());
+ }
+ return res;
+ }
+
+ void writenWithTimeout(const void *buffer, size_t n, int timeout)
+ {
+ size_t bytes=n;
+ const char *ptr = reinterpret_cast<const char*>(buffer);
+ ssize_t ret;
+ while(bytes) {
+ ret=::write(d_socket, ptr, bytes);
+ if(ret < 0) {
+ if(errno == EAGAIN) {
+ ret=waitForRWData(d_socket, false, timeout, 0);
+ if(ret < 0)
+ throw NetworkError("Waiting for data write");
+ if(!ret)
+ throw NetworkError("Timeout writing data");
+ continue;
+ }
+ else
+ throw NetworkError("Writing data: "+stringerror());
+ }
+ if(!ret) {
+ throw NetworkError("Did not fulfill TCP write due to EOF");
+ }
+
+ ptr += static_cast<size_t>(ret);
+ bytes -= static_cast<size_t>(ret);
+ }
+ }
+
+ //! reads one character from the socket
+ int getChar()
+ {
+ char c;
+
+ ssize_t res=::recv(d_socket,&c,1,0);
+ if(res)
+ return c;
+ return -1;
+ }
+
+ void getline(string &data)
+ {
+ data="";
+ int c;
+ while((c=getChar())!=-1) {
+ data+=(char)c;
+ if(c=='\n')
+ break;
+ }
+ }
+
+ //! Reads a block of data from the socket to a string
+ void read(string &data)
+ {
+ d_buffer.resize(s_buflen);
+ ssize_t res=::recv(d_socket, &d_buffer[0], s_buflen, 0);
+ if(res<0)
+ throw NetworkError("Reading from a socket: "+stringerror());
+ data.assign(d_buffer, 0, static_cast<size_t>(res));
+ }
+
+ //! Reads a block of data from the socket to a block of memory
+ size_t read(char *buffer, size_t bytes)
+ {
+ ssize_t res=::recv(d_socket, buffer, bytes, 0);
+ if(res<0)
+ throw NetworkError("Reading from a socket: "+stringerror());
+ return static_cast<size_t>(res);
+ }
+
+ ssize_t readWithTimeout(char* buffer, size_t n, int timeout)
+ {
+ int err = waitForRWData(d_socket, true, timeout, 0);
+
+ if(err == 0)
+ throw NetworkError("timeout reading");
+ if(err < 0)
+ throw NetworkError("nonblocking read failed: "+stringerror());
+
+ return read(buffer, n);
+ }
+
+ //! Sets the socket to listen with a default listen backlog of 10 pending connections
+ void listen(unsigned int length=10)
+ {
+ if(::listen(d_socket,length)<0)
+ throw NetworkError("Setting socket to listen: "+stringerror());
+ }
+
+ //! Returns the internal file descriptor of the socket
+ int getHandle() const
+ {
+ return d_socket;
+ }
+
+ int releaseHandle()
+ {
+ int ret = d_socket;
+ d_socket = -1;
+ return ret;
+ }
+
+private:
+ static const size_t s_buflen{4096};
+ std::string d_buffer;
+ int d_socket;
+};
diff --git a/stat_t.hh b/stat_t.hh
new file mode 100644
index 0000000..d318c98
--- /dev/null
+++ b/stat_t.hh
@@ -0,0 +1,79 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <atomic>
+
+#define CPU_LEVEL1_DCACHE_LINESIZE 64 // Until we know better via configure/getconf
+
+namespace pdns {
+ template <typename T>
+ class stat_t_trait {
+ public:
+ typedef T base_t;
+ typedef std::atomic<base_t> atomic_t;
+
+ stat_t_trait() : stat_t_trait(base_t(0)) {
+ }
+ stat_t_trait(const base_t x) {
+ new(&counter) atomic_t(x);
+ }
+ ~stat_t_trait() {
+ reinterpret_cast<atomic_t *>(&counter)->~atomic_t();
+ }
+ stat_t_trait(const stat_t_trait&) = delete;
+ base_t operator++(int) {
+ return (*reinterpret_cast<atomic_t *>(&counter))++;
+ }
+ base_t operator++() {
+ return ++(*reinterpret_cast<atomic_t *>(&counter));
+ }
+ base_t operator--(int) {
+ return (*reinterpret_cast<atomic_t *>(&counter))--;
+ }
+ base_t operator--() {
+ return --(*reinterpret_cast<atomic_t *>(&counter));
+ }
+ base_t operator+=(const stat_t_trait& v) {
+ return *reinterpret_cast<atomic_t *>(&counter) += *reinterpret_cast<const atomic_t *>(&v.counter);
+ }
+ base_t operator-=(const stat_t_trait& v) {
+ return *reinterpret_cast<atomic_t *>(&counter) -= *reinterpret_cast<const atomic_t *>(&v.counter);
+ }
+ base_t load() const {
+ return reinterpret_cast<const atomic_t *>(&counter)->load();
+ }
+ void store(base_t v) {
+ reinterpret_cast<atomic_t *>(&counter)->store(v);
+ }
+ operator base_t() const {
+ return reinterpret_cast<const atomic_t *>(&counter)->load();
+ }
+
+ private:
+ typename std::aligned_storage<sizeof(base_t), CPU_LEVEL1_DCACHE_LINESIZE>::type counter;
+ };
+
+ typedef stat_t_trait<uint64_t> stat_t;
+ typedef stat_t_trait<uint32_t> stat32_t;
+ typedef stat_t_trait<uint16_t> stat16_t;
+}
diff --git a/statnode.cc b/statnode.cc
new file mode 100644
index 0000000..e4c8f9e
--- /dev/null
+++ b/statnode.cc
@@ -0,0 +1,127 @@
+#include "statnode.hh"
+
+StatNode::Stat StatNode::print(unsigned int depth, Stat newstat, bool silent) const
+{
+ if(!silent) {
+ cout<<string(depth, ' ');
+ cout<<name<<": "<<endl;
+ }
+ Stat childstat;
+ childstat.queries += s.queries;
+ childstat.noerrors += s.noerrors;
+ childstat.nxdomains += s.nxdomains;
+ childstat.servfails += s.servfails;
+ childstat.drops += s.drops;
+ childstat.bytes += s.bytes;
+
+ if(children.size()>1024 && !silent) {
+ cout<<string(depth, ' ')<<name<<": too many to print"<<endl;
+ }
+ for(const children_t::value_type& child : children) {
+ childstat=child.second.print(depth+8, childstat, silent || children.size()>1024);
+ }
+ if(!silent || children.size()>1)
+ cout<<string(depth, ' ')<<childstat.queries<<" queries, " <<
+ childstat.noerrors<<" noerrors, "<<
+ childstat.nxdomains<<" nxdomains, "<<
+ childstat.servfails<<" servfails, "<<
+ childstat.drops<<" drops, "<<
+ childstat.bytes<<" bytes"<<endl;
+
+ newstat+=childstat;
+
+ return newstat;
+}
+
+
+void StatNode::visit(visitor_t visitor, Stat &newstat, unsigned int depth) const
+{
+ Stat childstat(s);
+
+ for (const auto& child : children) {
+ child.second.visit(visitor, childstat, depth+8);
+ }
+
+ visitor(this, s, childstat);
+
+ newstat += childstat;
+}
+
+
+void StatNode::submit(const DNSName& domain, int rcode, unsigned int bytes, boost::optional<const ComboAddress&> remote)
+{
+ // cerr<<"FIRST submit called on '"<<domain<<"'"<<endl;
+ std::vector<string> tmp = domain.getRawLabels();
+ if (tmp.empty()) {
+ return;
+ }
+
+ auto last = tmp.end() - 1;
+ children[*last].submit(last, tmp.begin(), "", rcode, bytes, remote, 1);
+}
+
+/* www.powerdns.com. ->
+ . <- fullnames
+ com.
+ powerdns.com
+ www.powerdns.com.
+*/
+
+void StatNode::submit(std::vector<string>::const_iterator end, std::vector<string>::const_iterator begin, const std::string& domain, int rcode, unsigned int bytes, boost::optional<const ComboAddress&> remote, unsigned int count)
+{
+ // cerr<<"Submit called for domain='"<<domain<<"': ";
+ // for(const std::string& n : labels)
+ // cerr<<n<<".";
+ // cerr<<endl;
+ if (name.empty()) {
+
+ name=*end;
+ // cerr<<"Set short name to '"<<name<<"'"<<endl;
+ }
+ else {
+ // cerr<<"Short name was already set to '"<<name<<"'"<<endl;
+ }
+
+ if (end == begin) {
+ if (fullname.empty()) {
+ size_t needed = name.size() + 1 + domain.size();
+ if (fullname.capacity() < needed) {
+ fullname.reserve(needed);
+ }
+ fullname = name;
+ fullname.append(".");
+ fullname.append(domain);
+ labelsCount = count;
+ }
+ // cerr<<"Hit the end, set our fullname to '"<<fullname<<"'"<<endl<<endl;
+ s.queries++;
+ s.bytes += bytes;
+ if(rcode<0)
+ s.drops++;
+ else if(rcode==0)
+ s.noerrors++;
+ else if(rcode==2)
+ s.servfails++;
+ else if(rcode==3)
+ s.nxdomains++;
+
+ if (remote) {
+ s.remotes[*remote]++;
+ }
+ }
+ else {
+ if (fullname.empty()) {
+ size_t needed = name.size() + 1 + domain.size();
+ if (fullname.capacity() < needed) {
+ fullname.reserve(needed);
+ }
+ fullname = name;
+ fullname.append(".");
+ fullname.append(domain);
+ labelsCount = count;
+ }
+ // cerr<<"Not yet end, set our fullname to '"<<fullname<<"', recursing"<<endl;
+ --end;
+ children[*end].submit(end, begin, fullname, rcode, bytes, remote, count+1);
+ }
+}
diff --git a/statnode.hh b/statnode.hh
new file mode 100644
index 0000000..586fe98
--- /dev/null
+++ b/statnode.hh
@@ -0,0 +1,74 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include "dnsname.hh"
+#include <map>
+#include "iputils.hh"
+
+class StatNode
+{
+public:
+
+ struct Stat
+ {
+ Stat(): queries(0), noerrors(0), nxdomains(0), servfails(0), drops(0), bytes(0)
+ {
+ }
+ uint64_t queries, noerrors, nxdomains, servfails, drops, bytes;
+
+ Stat& operator+=(const Stat& rhs) {
+ queries+=rhs.queries;
+ noerrors+=rhs.noerrors;
+ nxdomains+=rhs.nxdomains;
+ servfails+=rhs.servfails;
+ drops+=rhs.drops;
+ bytes+=rhs.bytes;
+
+ for(const remotes_t::value_type& rem : rhs.remotes) {
+ remotes[rem.first]+=rem.second;
+ }
+ return *this;
+ }
+ typedef std::map<ComboAddress,int,ComboAddress::addressOnlyLessThan> remotes_t;
+ remotes_t remotes;
+ };
+
+ Stat s;
+ std::string name;
+ std::string fullname;
+ uint8_t labelsCount{0};
+
+ void submit(const DNSName& domain, int rcode, unsigned int bytes, boost::optional<const ComboAddress&> remote);
+
+ Stat print(unsigned int depth=0, Stat newstat=Stat(), bool silent=false) const;
+ typedef boost::function<void(const StatNode*, const Stat& selfstat, const Stat& childstat)> visitor_t;
+ void visit(visitor_t visitor, Stat& newstat, unsigned int depth=0) const;
+ bool empty() const
+ {
+ return children.empty() && s.remotes.empty();
+ }
+ typedef std::map<std::string,StatNode, CIStringCompare> children_t;
+ children_t children;
+
+private:
+ void submit(std::vector<string>::const_iterator end, std::vector<string>::const_iterator begin, const std::string& domain, int rcode, unsigned int bytes, boost::optional<const ComboAddress&> remote, unsigned int count);
+};
diff --git a/svc-records.cc b/svc-records.cc
new file mode 100644
index 0000000..0f610de
--- /dev/null
+++ b/svc-records.cc
@@ -0,0 +1,186 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include "svc-records.hh"
+#include "misc.hh"
+#include "base64.hh"
+
+const std::map<std::string, SvcParam::SvcParamKey> SvcParam::SvcParams = {
+ {"mandatory", SvcParam::SvcParamKey::mandatory},
+ {"alpn", SvcParam::SvcParamKey::alpn},
+ {"no-default-alpn", SvcParam::SvcParamKey::no_default_alpn},
+ {"port", SvcParam::SvcParamKey::port},
+ {"ipv4hint", SvcParam::SvcParamKey::ipv4hint},
+ {"ech", SvcParam::SvcParamKey::ech},
+ {"ipv6hint", SvcParam::SvcParamKey::ipv6hint}
+};
+
+SvcParam::SvcParamKey SvcParam::keyFromString(const std::string& k) {
+ bool ignored;
+ return SvcParam::keyFromString(k, ignored);
+}
+
+SvcParam::SvcParamKey SvcParam::keyFromString(const std::string& k, bool &generic) {
+ auto it = SvcParams.find(k);
+ if (it != SvcParams.end()) {
+ generic = false;
+ return it->second;
+ }
+ if (k.substr(0, 3) == "key") {
+ try {
+ generic = true;
+ return SvcParam::SvcParamKey(pdns_stou(k.substr(3)));
+ }
+ catch (...) {
+ }
+ }
+ throw std::invalid_argument("SvcParam '" + k + "'is not recognized or in keyNNNN format");
+}
+
+std::string SvcParam::keyToString(const SvcParam::SvcParamKey& k) {
+ auto ret = std::find_if(SvcParams.begin(), SvcParams.end(), [&](const std::pair<std::string, SvcParam::SvcParamKey>& e) { return e.second == k; });
+ if (ret != SvcParams.end()) {
+ return ret->first;
+ }
+ return "key" + std::to_string(k);
+}
+
+SvcParam::SvcParam(const SvcParamKey &key) {
+ d_key = key;
+ if (d_key != SvcParamKey::no_default_alpn) {
+ throw std::invalid_argument("can not create non-empty SvcParam for key '" + keyToString(key) + "'");
+ }
+}
+
+SvcParam::SvcParam(const SvcParamKey &key, const std::string &value) {
+ d_key = key;
+ if (d_key != SvcParamKey::ech && d_key < 7) {
+ throw std::invalid_argument("can not create SvcParam for " + keyToString(key) + " with a string value");
+ }
+ if (d_key == SvcParamKey::ech) {
+ std::string d;
+ // TODO check Base64 decode
+ d_ech = value;
+ return;
+ }
+ d_value = value;
+}
+
+SvcParam::SvcParam(const SvcParamKey &key, std::vector<std::string> &&value) {
+ d_key = key;
+ if (d_key != SvcParamKey::alpn) {
+ throw std::invalid_argument("can not create SvcParam for " + keyToString(key) + " with a string-set value");
+ }
+ if (d_key == SvcParamKey::alpn) {
+ d_alpn = std::move(value);
+ }
+}
+
+SvcParam::SvcParam(const SvcParamKey &key, std::set<std::string> &&value) {
+ d_key = key;
+ if (d_key != SvcParamKey::mandatory) {
+ throw std::invalid_argument("can not create SvcParam for " + keyToString(key) + " with a string-set value");
+ }
+ if (d_key == SvcParamKey::mandatory) {
+ for (auto const &v: value) {
+ d_mandatory.insert(keyFromString(v));
+ }
+ }
+}
+
+SvcParam::SvcParam(const SvcParamKey &key, std::set<SvcParam::SvcParamKey> &&value) {
+ d_key = key;
+ if (d_key != SvcParamKey::mandatory) {
+ throw std::invalid_argument("can not create SvcParam for " + keyToString(key) + " with a SvcParamKey-set value");
+ }
+ d_mandatory = std::move(value);
+}
+
+SvcParam::SvcParam(const SvcParamKey &key, std::vector<ComboAddress> &&value) {
+ d_key = key;
+ if (d_key != SvcParamKey::ipv6hint && d_key != SvcParamKey::ipv4hint) {
+ throw std::invalid_argument("can not create SvcParam for " + keyToString(key) + " with an IP address value");
+ }
+ for (auto const &addr : value) {
+ if (d_key == SvcParam::ipv6hint && !addr.isIPv6()) {
+ throw std::invalid_argument("non-IPv6 address ('" + addr.toString() + "') passed for " + keyToString(key));
+ }
+ if (d_key == SvcParam::ipv4hint && !addr.isIPv4()) {
+ throw std::invalid_argument("non-IPv4 address ('" + addr.toString() + "') passed for " + keyToString(key));
+ }
+ }
+ d_ipHints = std::move(value);
+}
+
+SvcParam::SvcParam(const SvcParamKey &key, const uint16_t value) {
+ d_key = key;
+ if (d_key != SvcParamKey::port) {
+ throw std::invalid_argument("can not create SvcParam for " + keyToString(key) + " with an port value");
+ }
+ d_port = value;
+}
+
+//! This ensures an std::set<SvcParam> will be sorted by key (section 2.2 mandates this for wire format)
+bool SvcParam::operator<(const SvcParam& other) const {
+ return this->d_key < other.getKey();
+}
+
+const std::vector<ComboAddress>& SvcParam::getIPHints() const {
+ if (d_key != SvcParamKey::ipv6hint && d_key != SvcParamKey::ipv4hint) {
+ throw std::invalid_argument("getIPHints called for non-IP address key '" + keyToString(d_key) + "'");
+ }
+ return d_ipHints;
+}
+
+uint16_t SvcParam::getPort() const {
+ if (d_key != SvcParam::port) {
+ throw std::invalid_argument("getPort called for non-port key '" + keyToString(d_key) + "'");
+ }
+ return d_port;
+}
+
+const std::vector<std::string>& SvcParam::getALPN() const {
+ if (d_key != SvcParam::alpn) {
+ throw std::invalid_argument("getALPN called for non-alpn key '" + keyToString(d_key) + "'");
+ }
+ return d_alpn;
+}
+
+const std::set<SvcParam::SvcParamKey>& SvcParam::getMandatory() const {
+ if (d_key != SvcParam::mandatory) {
+ throw std::invalid_argument("getMandatory called for non-mandatory key '" + keyToString(d_key) + "'");
+ }
+ return d_mandatory;
+}
+
+const std::string& SvcParam::getECH() const {
+ if (d_key != SvcParam::ech) {
+ throw std::invalid_argument("getECH called for non-ech key '" + keyToString(d_key) + "'");
+ }
+ return d_ech;
+}
+
+const std::string& SvcParam::getValue() const {
+ if (d_key < 7) {
+ throw std::invalid_argument("getValue called for non-single value key '" + keyToString(d_key) + "'");
+ }
+ return d_value;
+}
diff --git a/svc-records.hh b/svc-records.hh
new file mode 100644
index 0000000..19de2b9
--- /dev/null
+++ b/svc-records.hh
@@ -0,0 +1,108 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <string>
+#include <map>
+#include <set>
+#include "iputils.hh"
+
+class SvcParam {
+ public:
+ enum SvcParamKey: uint16_t {
+ // TODO link to IANA registry
+ /* When adding new values, you *must* update SvcParam::SvcParam(const std::string &key, const std::string &value)
+ * in svc-record.cc with the new numbers
+ */
+ mandatory = 0,
+ alpn = 1,
+ no_default_alpn = 2,
+ port = 3,
+ ipv4hint = 4,
+ ech = 5,
+ ipv6hint = 6
+ };
+
+ //! empty Param, unusable
+ SvcParam() = delete;
+
+ //! To create a value-less SvcParam (like no-default-alpn)
+ SvcParam(const SvcParamKey &key);
+
+ //! To create a "generic" SvcParam (for keyNNNNN and ech)
+ SvcParam(const SvcParamKey &key, const std::string &value);
+
+ //! To create a multi-value SvcParam (like mandatory)
+ SvcParam(const SvcParamKey &key, std::set<std::string> &&value);
+
+ //! To create a multi-value SvcParam (like alpn)
+ SvcParam(const SvcParamKey &key, std::vector<std::string> &&value);
+
+ //! To create a multi-value SvcParam with key values (like mandatory)
+ SvcParam(const SvcParamKey &key, std::set<SvcParamKey> &&value);
+
+ //! To create and ipv{4,6}hists SvcParam
+ SvcParam(const SvcParamKey &key, std::vector<ComboAddress> &&value);
+
+ //! To create a port SvcParam
+ SvcParam(const SvcParamKey &key, const uint16_t value);
+
+ //! Returns the SvcParamKey based on the input
+ static SvcParamKey keyFromString(const std::string &k);
+
+ //! Returns the SvcParamKey based on the input, generic is true when the format was 'keyNNNN'
+ static SvcParamKey keyFromString(const std::string &k, bool &generic);
+
+ //! Returns the string value of the SvcParamKey
+ static std::string keyToString(const SvcParamKey &k);
+
+ bool operator< (const SvcParam &other) const;
+
+ SvcParamKey getKey() const {
+ return d_key;
+ }
+
+ uint16_t getPort() const;
+ const std::vector<ComboAddress>& getIPHints() const;
+ const std::vector<std::string>& getALPN() const;
+ const std::set<SvcParamKey>& getMandatory() const;
+ const std::string& getECH() const;
+ const std::string& getValue() const;
+
+ bool getAutoHint() const { return d_autohint; };
+ void setAutoHint(const bool value) { d_autohint = value; };
+
+ private:
+ SvcParamKey d_key;
+ std::string d_value; // For keyNNNNN vals
+
+ std::vector<std::string> d_alpn; // For ALPN
+ std::set<SvcParamKey> d_mandatory; // For mandatory
+ std::vector<ComboAddress> d_ipHints; // For ipv{6,4}hints
+ std::string d_ech; // For Encrypted Client Hello
+ uint16_t d_port{0}; // For port
+
+ // Set to true if we encountered an "auto" field in hints
+ // Can only be true when we read SVCParams from text
+ bool d_autohint{false};
+
+ static const std::map<std::string, SvcParamKey> SvcParams;
+};
diff --git a/tcpiohandler-mplexer.hh b/tcpiohandler-mplexer.hh
new file mode 100644
index 0000000..d62ba78
--- /dev/null
+++ b/tcpiohandler-mplexer.hh
@@ -0,0 +1,209 @@
+
+#pragma once
+
+#include "mplexer.hh"
+#include "tcpiohandler.hh"
+
+#if 0
+#define DEBUGLOG_ENABLED
+#define DEBUGLOG(x) cerr<<x<<endl;
+#else
+#define DEBUGLOG(x)
+#endif
+
+class IOStateHandler
+{
+public:
+ IOStateHandler(FDMultiplexer& mplexer, const int fd): d_mplexer(mplexer), d_fd(fd)
+ {
+ }
+
+ IOStateHandler(FDMultiplexer& mplexer): d_mplexer(mplexer), d_fd(-1)
+ {
+ }
+
+ ~IOStateHandler()
+ {
+ /* be careful that this won't save us if the callback is still registered to the multiplexer,
+ because in that case the shared pointer count will never reach zero so this destructor won't
+ be called */
+ try {
+ reset();
+ }
+ catch (const FDMultiplexerException& e) {
+ /* that should not happen, but an exception raised from a destructor would be bad so better
+ safe than sorry */
+ }
+ }
+
+ bool isWaitingForRead() const
+ {
+ return d_isWaitingForRead;
+ }
+
+ bool isWaitingForWrite() const
+ {
+ return d_isWaitingForWrite;
+ }
+
+ void setSocket(int fd)
+ {
+ if (d_fd != -1) {
+ throw std::runtime_error("Trying to set the socket descriptor on an already initialized IOStateHandler");
+ }
+ d_fd = fd;
+ }
+
+ void reset()
+ {
+ update(IOState::Done);
+ }
+
+ std::string getState() const
+ {
+ std::string result("--");
+ result.reserve(2);
+ if (isWaitingForRead()) {
+ result.at(0) = 'R';
+ }
+ if (isWaitingForWrite()) {
+ result.at(1) = 'W';
+ }
+ return result;
+ }
+
+ void add(IOState iostate, FDMultiplexer::callbackfunc_t callback, FDMultiplexer::funcparam_t callbackData, boost::optional<struct timeval> ttd)
+ {
+ DEBUGLOG("in "<<__PRETTY_FUNCTION__<<" for fd "<<d_fd<<", last state was "<<getState()<<", adding "<<(int)iostate);
+ if (iostate == IOState::NeedRead) {
+ if (isWaitingForRead()) {
+ if (ttd) {
+ /* let's update the TTD ! */
+ d_mplexer.setReadTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */0);
+ }
+ return;
+ }
+
+ d_mplexer.addReadFD(d_fd, callback, callbackData, ttd ? &*ttd : nullptr);
+ DEBUGLOG(__PRETTY_FUNCTION__<<": add read FD "<<d_fd);
+ d_isWaitingForRead = true;
+ }
+ else if (iostate == IOState::NeedWrite) {
+ if (isWaitingForWrite()) {
+ if (ttd) {
+ /* let's update the TTD ! */
+ d_mplexer.setWriteTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */0);
+ }
+ return;
+ }
+
+ d_mplexer.addWriteFD(d_fd, callback, callbackData, ttd ? &*ttd : nullptr);
+ DEBUGLOG(__PRETTY_FUNCTION__<<": add write FD "<<d_fd);
+ d_isWaitingForWrite = true;
+ }
+ }
+
+ void update(IOState iostate, FDMultiplexer::callbackfunc_t callback = FDMultiplexer::callbackfunc_t(), FDMultiplexer::funcparam_t callbackData = boost::any(), boost::optional<struct timeval> ttd = boost::none)
+ {
+ DEBUGLOG("in "<<__PRETTY_FUNCTION__<<" for fd "<<d_fd<<", last state was "<<getState()<<" , new state is "<<(int)iostate);
+ if (isWaitingForRead() && iostate == IOState::Done) {
+ DEBUGLOG(__PRETTY_FUNCTION__<<": remove read FD "<<d_fd);
+ d_mplexer.removeReadFD(d_fd);
+ d_isWaitingForRead = false;
+ }
+ if (isWaitingForWrite() && iostate == IOState::Done) {
+ DEBUGLOG(__PRETTY_FUNCTION__<<": remove write FD "<<d_fd);
+ d_mplexer.removeWriteFD(d_fd);
+ d_isWaitingForWrite = false;
+ }
+
+ if (iostate == IOState::NeedRead) {
+ if (isWaitingForRead()) {
+ if (ttd) {
+ /* let's update the TTD ! */
+ d_mplexer.setReadTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */0);
+ }
+ return;
+ }
+
+ if (isWaitingForWrite()) {
+ d_isWaitingForWrite = false;
+ d_mplexer.alterFDToRead(d_fd, callback, callbackData, ttd ? &*ttd : nullptr);
+ DEBUGLOG(__PRETTY_FUNCTION__<<": alter from write to read FD "<<d_fd);
+ }
+ else {
+ d_mplexer.addReadFD(d_fd, callback, callbackData, ttd ? &*ttd : nullptr);
+ DEBUGLOG(__PRETTY_FUNCTION__<<": add read FD "<<d_fd);
+ }
+
+ d_isWaitingForRead = true;
+ }
+ else if (iostate == IOState::NeedWrite) {
+ if (isWaitingForWrite()) {
+ if (ttd) {
+ /* let's update the TTD ! */
+ d_mplexer.setWriteTTD(d_fd, *ttd, /* we pass 0 here because we already have a TTD */0);
+ }
+ return;
+ }
+
+ if (isWaitingForRead()) {
+ d_isWaitingForRead = false;
+ d_mplexer.alterFDToWrite(d_fd, callback, callbackData, ttd ? &*ttd : nullptr);
+ DEBUGLOG(__PRETTY_FUNCTION__<<": alter from read to write FD "<<d_fd);
+ }
+ else {
+ d_mplexer.addWriteFD(d_fd, callback, callbackData, ttd ? &*ttd : nullptr);
+ DEBUGLOG(__PRETTY_FUNCTION__<<": add write FD "<<d_fd);
+ }
+
+ d_isWaitingForWrite = true;
+ }
+ else if (iostate == IOState::Done) {
+ DEBUGLOG(__PRETTY_FUNCTION__<<": done");
+ }
+ }
+
+private:
+ FDMultiplexer& d_mplexer;
+ int d_fd;
+ bool d_isWaitingForRead{false};
+ bool d_isWaitingForWrite{false};
+};
+
+class IOStateGuard
+{
+public:
+ /* this class is using RAII to make sure we don't forget to release an IOStateHandler
+ from the IO multiplexer in case of exception / error handling */
+ IOStateGuard(std::unique_ptr<IOStateHandler>& handler): d_handler(handler), d_enabled(true)
+ {
+ }
+
+ ~IOStateGuard()
+ {
+ /* if we are still owning the state when we go out of scope,
+ let's reset the state so it's not registered to the IO multiplexer anymore
+ and its reference count goes to zero */
+ if (d_enabled && d_handler) {
+ DEBUGLOG("IOStateGuard destroyed while holding a state, let's reset it");
+ try {
+ d_handler->reset();
+ }
+ catch (const FDMultiplexerException& e) {
+ /* that should not happen, but an exception raised from a destructor would be bad so better
+ safe than sorry */
+ }
+ d_enabled = false;
+ }
+ }
+
+ void release()
+ {
+ d_enabled = false;
+ }
+
+private:
+ std::unique_ptr<IOStateHandler>& d_handler;
+ bool d_enabled;
+};
diff --git a/tcpiohandler.cc b/tcpiohandler.cc
new file mode 100644
index 0000000..3ee2172
--- /dev/null
+++ b/tcpiohandler.cc
@@ -0,0 +1,1775 @@
+
+#include "config.h"
+#include "dolog.hh"
+#include "iputils.hh"
+#include "lock.hh"
+#include "tcpiohandler.hh"
+
+const bool TCPIOHandler::s_disableConnectForUnitTests = false;
+
+#ifdef HAVE_LIBSODIUM
+#include <sodium.h>
+#endif /* HAVE_LIBSODIUM */
+
+#ifdef HAVE_DNS_OVER_TLS
+#ifdef HAVE_LIBSSL
+
+#include <openssl/conf.h>
+#include <openssl/err.h>
+#include <openssl/rand.h>
+#include <openssl/ssl.h>
+#include <openssl/x509v3.h>
+
+#include "libssl.hh"
+
+
+class OpenSSLFrontendContext
+{
+public:
+ OpenSSLFrontendContext(const ComboAddress& addr, const TLSConfig& tlsConfig): d_ticketKeys(tlsConfig.d_numberOfTicketsKeys)
+ {
+ registerOpenSSLUser();
+
+ d_tlsCtx = libssl_init_server_context(tlsConfig, d_ocspResponses);
+ if (!d_tlsCtx) {
+ ERR_print_errors_fp(stderr);
+ throw std::runtime_error("Error creating TLS context on " + addr.toStringWithPort());
+ }
+ }
+
+ void cleanup()
+ {
+ d_tlsCtx.reset();
+
+ unregisterOpenSSLUser();
+ }
+
+ OpenSSLTLSTicketKeysRing d_ticketKeys;
+ std::map<int, std::string> d_ocspResponses;
+ std::unique_ptr<SSL_CTX, void(*)(SSL_CTX*)> d_tlsCtx{nullptr, SSL_CTX_free};
+ std::unique_ptr<FILE, int(*)(FILE*)> d_keyLogFile{nullptr, fclose};
+};
+
+class OpenSSLSession : public TLSSession
+{
+public:
+ OpenSSLSession(std::unique_ptr<SSL_SESSION, void(*)(SSL_SESSION*)>&& sess): d_sess(std::move(sess))
+ {
+ }
+
+ virtual ~OpenSSLSession()
+ {
+ }
+
+ std::unique_ptr<SSL_SESSION, void(*)(SSL_SESSION*)> getNative()
+ {
+ return std::move(d_sess);
+ }
+
+private:
+ std::unique_ptr<SSL_SESSION, void(*)(SSL_SESSION*)> d_sess;
+};
+
+class OpenSSLTLSConnection: public TLSConnection
+{
+public:
+ /* server side connection */
+ OpenSSLTLSConnection(int socket, const struct timeval& timeout, std::shared_ptr<OpenSSLFrontendContext> feContext): d_feContext(feContext), d_conn(std::unique_ptr<SSL, void(*)(SSL*)>(SSL_new(d_feContext->d_tlsCtx.get()), SSL_free)), d_timeout(timeout)
+ {
+ d_socket = socket;
+
+ if (!s_initTLSConnIndex.test_and_set()) {
+ /* not initialized yet */
+ s_tlsConnIndex = SSL_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr);
+ if (s_tlsConnIndex == -1) {
+ throw std::runtime_error("Error getting an index for TLS connection data");
+ }
+ }
+
+ if (!d_conn) {
+ vinfolog("Error creating TLS object");
+ if (g_verbose) {
+ ERR_print_errors_fp(stderr);
+ }
+ throw std::runtime_error("Error creating TLS object");
+ }
+
+ if (!SSL_set_fd(d_conn.get(), d_socket)) {
+ throw std::runtime_error("Error assigning socket");
+ }
+
+ SSL_set_ex_data(d_conn.get(), s_tlsConnIndex, this);
+ }
+
+ /* client-side connection */
+ OpenSSLTLSConnection(const std::string& hostname, int socket, const struct timeval& timeout, std::shared_ptr<SSL_CTX>& tlsCtx): d_tlsCtx(tlsCtx), d_conn(std::unique_ptr<SSL, void(*)(SSL*)>(SSL_new(tlsCtx.get()), SSL_free)), d_hostname(hostname), d_timeout(timeout)
+ {
+ d_socket = socket;
+
+ if (!s_initTLSConnIndex.test_and_set()) {
+ /* not initialized yet */
+ s_tlsConnIndex = SSL_get_ex_new_index(0, nullptr, nullptr, nullptr, nullptr);
+ if (s_tlsConnIndex == -1) {
+ throw std::runtime_error("Error getting an index for TLS connection data");
+ }
+ }
+
+ if (!d_conn) {
+ vinfolog("Error creating TLS object");
+ if (g_verbose) {
+ ERR_print_errors_fp(stderr);
+ }
+ throw std::runtime_error("Error creating TLS object");
+ }
+
+ if (!SSL_set_fd(d_conn.get(), d_socket)) {
+ throw std::runtime_error("Error assigning socket");
+ }
+
+ /* set outgoing Server Name Indication */
+ if (!d_hostname.empty() && SSL_set_tlsext_host_name(d_conn.get(), d_hostname.c_str()) != 1) {
+ throw std::runtime_error("Error setting TLS SNI to " + d_hostname);
+ }
+
+#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) && HAVE_SSL_SET_HOSTFLAGS // grrr libressl
+ SSL_set_hostflags(d_conn.get(), X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
+ if (SSL_set1_host(d_conn.get(), d_hostname.c_str()) != 1) {
+ throw std::runtime_error("Error setting TLS hostname for certificate validation");
+ }
+#elif (OPENSSL_VERSION_NUMBER >= 0x10002000L)
+ X509_VERIFY_PARAM *param = SSL_get0_param(d_conn.get());
+ /* Enable automatic hostname checks */
+ X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
+ if (X509_VERIFY_PARAM_set1_host(param, d_hostname.c_str(), d_hostname.size()) != 1) {
+ throw std::runtime_error("Error setting TLS hostname for certificate validation");
+ }
+#else
+ /* no hostname validation for you, see https://wiki.openssl.org/index.php/Hostname_validation */
+#endif
+ SSL_set_ex_data(d_conn.get(), s_tlsConnIndex, this);
+ }
+
+ IOState convertIORequestToIOState(int res) const
+ {
+ int error = SSL_get_error(d_conn.get(), res);
+ if (error == SSL_ERROR_WANT_READ) {
+ return IOState::NeedRead;
+ }
+ else if (error == SSL_ERROR_WANT_WRITE) {
+ return IOState::NeedWrite;
+ }
+ else if (error == SSL_ERROR_SYSCALL) {
+ if (errno == 0) {
+ throw std::runtime_error("TLS connection closed by remote end");
+ }
+ else {
+ throw std::runtime_error("Syscall error while processing TLS connection: " + std::string(strerror(errno)));
+ }
+ }
+ else if (error == SSL_ERROR_ZERO_RETURN) {
+ throw std::runtime_error("TLS connection closed by remote end");
+ }
+ else {
+ if (g_verbose) {
+ throw std::runtime_error("Error while processing TLS connection: (" + std::to_string(error) + ") " + libssl_get_error_string());
+ } else {
+ throw std::runtime_error("Error while processing TLS connection: " + std::to_string(error));
+ }
+ }
+ }
+
+ void handleIORequest(int res, const struct timeval& timeout)
+ {
+ auto state = convertIORequestToIOState(res);
+ if (state == IOState::NeedRead) {
+ res = waitForData(d_socket, timeout.tv_sec, timeout.tv_usec);
+ if (res == 0) {
+ throw std::runtime_error("Timeout while reading from TLS connection");
+ }
+ else if (res < 0) {
+ throw std::runtime_error("Error waiting to read from TLS connection");
+ }
+ }
+ else if (state == IOState::NeedWrite) {
+ res = waitForRWData(d_socket, false, timeout.tv_sec, timeout.tv_usec);
+ if (res == 0) {
+ throw std::runtime_error("Timeout while writing to TLS connection");
+ }
+ else if (res < 0) {
+ throw std::runtime_error("Error waiting to write to TLS connection");
+ }
+ }
+ }
+
+ IOState tryConnect(bool fastOpen, const ComboAddress& remote) override
+ {
+ /* sorry */
+ (void) fastOpen;
+ (void) remote;
+
+ int res = SSL_connect(d_conn.get());
+ if (res == 1) {
+ return IOState::Done;
+ }
+ else if (res < 0) {
+ return convertIORequestToIOState(res);
+ }
+
+ throw std::runtime_error("Error establishing a TLS connection");
+ }
+
+ void connect(bool fastOpen, const ComboAddress& remote, const struct timeval &timeout) override
+ {
+ /* sorry */
+ (void) fastOpen;
+ (void) remote;
+
+ struct timeval start{0,0};
+ struct timeval remainingTime = timeout;
+ if (timeout.tv_sec != 0 || timeout.tv_usec != 0) {
+ gettimeofday(&start, nullptr);
+ }
+
+ int res = 0;
+ do {
+ res = SSL_connect(d_conn.get());
+ if (res < 0) {
+ handleIORequest(res, remainingTime);
+ }
+
+ if (timeout.tv_sec != 0 || timeout.tv_usec != 0) {
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ struct timeval elapsed = now - start;
+ if (now < start || remainingTime < elapsed) {
+ throw runtime_error("Timeout while establishing TLS connection");
+ }
+ start = now;
+ remainingTime = remainingTime - elapsed;
+ }
+ }
+ while (res != 1);
+ }
+
+ IOState tryHandshake() override
+ {
+ if (!d_feContext) {
+ /* In client mode, the handshake is initiated by the call to SSL_connect()
+ done from connect()/tryConnect().
+ In blocking mode it does not return before the handshake has been finished,
+ and in non-blocking mode calling SSL_connect() once is enough for SSL_write()
+ and SSL_read() to transparently continue to negotiate the connection after that
+ (equivalent to doing SSL_set_connect_state() plus trying to write).
+ */
+ return IOState::Done;
+ }
+
+ /* As explained above in the client-mode block, we only need to call SSL_accept() once
+ for SSL_write() and SSL_read() to transparently continue to negotiate the connection after that.
+ It is equivalent to calling SSL_set_accept_state() plus trying to read.
+ */
+ int res = SSL_accept(d_conn.get());
+ if (res == 1) {
+ return IOState::Done;
+ }
+ else if (res < 0) {
+ return convertIORequestToIOState(res);
+ }
+
+ throw std::runtime_error("Error accepting TLS connection");
+ }
+
+ void doHandshake() override
+ {
+ if (!d_feContext) {
+ /* we are a client, nothing to do, see the non-blocking version */
+ return;
+ }
+
+ int res = 0;
+ do {
+ res = SSL_accept(d_conn.get());
+ if (res < 0) {
+ handleIORequest(res, d_timeout);
+ }
+ }
+ while (res < 0);
+
+ if (res != 1) {
+ throw std::runtime_error("Error accepting TLS connection");
+ }
+ }
+
+ IOState tryWrite(const PacketBuffer& buffer, size_t& pos, size_t toWrite) override
+ {
+ do {
+ int res = SSL_write(d_conn.get(), reinterpret_cast<const char *>(&buffer.at(pos)), static_cast<int>(toWrite - pos));
+ if (res <= 0) {
+ return convertIORequestToIOState(res);
+ }
+ else {
+ pos += static_cast<size_t>(res);
+ }
+ }
+ while (pos < toWrite);
+ return IOState::Done;
+ }
+
+ IOState tryRead(PacketBuffer& buffer, size_t& pos, size_t toRead, bool allowIncomplete) override
+ {
+ do {
+ int res = SSL_read(d_conn.get(), reinterpret_cast<char *>(&buffer.at(pos)), static_cast<int>(toRead - pos));
+ if (res <= 0) {
+ return convertIORequestToIOState(res);
+ }
+ else {
+ pos += static_cast<size_t>(res);
+ if (allowIncomplete) {
+ break;
+ }
+ }
+ }
+ while (pos < toRead);
+ return IOState::Done;
+ }
+
+ size_t read(void* buffer, size_t bufferSize, const struct timeval& readTimeout, const struct timeval& totalTimeout, bool allowIncomplete) override
+ {
+ size_t got = 0;
+ struct timeval start = {0, 0};
+ struct timeval remainingTime = totalTimeout;
+ if (totalTimeout.tv_sec != 0 || totalTimeout.tv_usec != 0) {
+ gettimeofday(&start, nullptr);
+ }
+
+ do {
+ int res = SSL_read(d_conn.get(), (reinterpret_cast<char *>(buffer) + got), static_cast<int>(bufferSize - got));
+ if (res <= 0) {
+ handleIORequest(res, readTimeout);
+ }
+ else {
+ got += static_cast<size_t>(res);
+ if (allowIncomplete) {
+ break;
+ }
+ }
+
+ if (totalTimeout.tv_sec != 0 || totalTimeout.tv_usec != 0) {
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ struct timeval elapsed = now - start;
+ if (now < start || remainingTime < elapsed) {
+ throw runtime_error("Timeout while reading data");
+ }
+ start = now;
+ remainingTime = remainingTime - elapsed;
+ }
+ }
+ while (got < bufferSize);
+
+ return got;
+ }
+
+ size_t write(const void* buffer, size_t bufferSize, const struct timeval& writeTimeout) override
+ {
+ size_t got = 0;
+ do {
+ int res = SSL_write(d_conn.get(), (reinterpret_cast<const char *>(buffer) + got), static_cast<int>(bufferSize - got));
+ if (res <= 0) {
+ handleIORequest(res, writeTimeout);
+ }
+ else {
+ got += static_cast<size_t>(res);
+ }
+ }
+ while (got < bufferSize);
+
+ return got;
+ }
+
+ bool hasBufferedData() const override
+ {
+ if (d_conn) {
+ return SSL_pending(d_conn.get()) > 0;
+ }
+
+ return false;
+ }
+
+ bool isUsable() const override
+ {
+ if (!d_conn) {
+ return false;
+ }
+
+ char buf;
+ int res = SSL_peek(d_conn.get(), &buf, sizeof(buf));
+ if (res > 0) {
+ return true;
+ }
+ try {
+ convertIORequestToIOState(res);
+ return true;
+ }
+ catch (...) {
+ return false;
+ }
+
+ return false;
+ }
+
+ void close() override
+ {
+ if (d_conn) {
+ SSL_shutdown(d_conn.get());
+ }
+ }
+
+ std::string getServerNameIndication() const override
+ {
+ if (d_conn) {
+ const char* value = SSL_get_servername(d_conn.get(), TLSEXT_NAMETYPE_host_name);
+ if (value) {
+ return std::string(value);
+ }
+ }
+ return std::string();
+ }
+
+ std::vector<uint8_t> getNextProtocol() const override
+ {
+ std::vector<uint8_t> result;
+ if (!d_conn) {
+ return result;
+ }
+
+ const unsigned char* alpn = nullptr;
+ unsigned int alpnLen = 0;
+#ifdef HAVE_SSL_GET0_NEXT_PROTO_NEGOTIATED
+ SSL_get0_next_proto_negotiated(d_conn.get(), &alpn, &alpnLen);
+#endif
+#ifdef HAVE_SSL_GET0_ALPN_SELECTED
+ if (alpn == nullptr) {
+ SSL_get0_alpn_selected(d_conn.get(), &alpn, &alpnLen);
+ }
+#endif
+ if (alpn != nullptr && alpnLen > 0) {
+ result.insert(result.end(), alpn, alpn + alpnLen);
+ }
+ return result;
+ }
+
+ LibsslTLSVersion getTLSVersion() const override
+ {
+ auto proto = SSL_version(d_conn.get());
+ switch (proto) {
+ case TLS1_VERSION:
+ return LibsslTLSVersion::TLS10;
+ case TLS1_1_VERSION:
+ return LibsslTLSVersion::TLS11;
+ case TLS1_2_VERSION:
+ return LibsslTLSVersion::TLS12;
+#ifdef TLS1_3_VERSION
+ case TLS1_3_VERSION:
+ return LibsslTLSVersion::TLS13;
+#endif /* TLS1_3_VERSION */
+ default:
+ return LibsslTLSVersion::Unknown;
+ }
+ }
+
+ bool hasSessionBeenResumed() const override
+ {
+ if (d_conn) {
+ return SSL_session_reused(d_conn.get()) != 0;
+ }
+ return false;
+ }
+
+ std::vector<std::unique_ptr<TLSSession>> getSessions() override
+ {
+ return std::move(d_tlsSessions);
+ }
+
+ void setSession(std::unique_ptr<TLSSession>& session) override
+ {
+ auto sess = dynamic_cast<OpenSSLSession*>(session.get());
+ if (!sess) {
+ throw std::runtime_error("Unable to convert OpenSSL session");
+ }
+
+ auto native = sess->getNative();
+ auto ret = SSL_set_session(d_conn.get(), native.get());
+ if (ret != 1) {
+ throw std::runtime_error("Error setting up session: " + libssl_get_error_string());
+ }
+ session.reset();
+ }
+
+ void addNewTicket(SSL_SESSION* session)
+ {
+ d_tlsSessions.push_back(std::make_unique<OpenSSLSession>(std::unique_ptr<SSL_SESSION, void (*)(SSL_SESSION*)>(session, SSL_SESSION_free)));
+ }
+
+ static int s_tlsConnIndex;
+
+private:
+ static std::atomic_flag s_initTLSConnIndex;
+
+ std::vector<std::unique_ptr<TLSSession>> d_tlsSessions;
+ /* server context */
+ std::shared_ptr<OpenSSLFrontendContext> d_feContext;
+ /* client context */
+ std::shared_ptr<SSL_CTX> d_tlsCtx;
+ std::unique_ptr<SSL, void(*)(SSL*)> d_conn;
+ std::string d_hostname;
+ struct timeval d_timeout;
+};
+
+std::atomic_flag OpenSSLTLSConnection::s_initTLSConnIndex = ATOMIC_FLAG_INIT;
+int OpenSSLTLSConnection::s_tlsConnIndex = -1;
+
+class OpenSSLTLSIOCtx: public TLSCtx
+{
+public:
+ /* server side context */
+ OpenSSLTLSIOCtx(TLSFrontend& fe): d_feContext(std::make_shared<OpenSSLFrontendContext>(fe.d_addr, fe.d_tlsConfig))
+ {
+ d_ticketsKeyRotationDelay = fe.d_tlsConfig.d_ticketsKeyRotationDelay;
+
+ if (fe.d_tlsConfig.d_enableTickets && fe.d_tlsConfig.d_numberOfTicketsKeys > 0) {
+ /* use our own ticket keys handler so we can rotate them */
+ SSL_CTX_set_tlsext_ticket_key_cb(d_feContext->d_tlsCtx.get(), &OpenSSLTLSIOCtx::ticketKeyCb);
+ libssl_set_ticket_key_callback_data(d_feContext->d_tlsCtx.get(), d_feContext.get());
+ }
+
+ if (!d_feContext->d_ocspResponses.empty()) {
+ SSL_CTX_set_tlsext_status_cb(d_feContext->d_tlsCtx.get(), &OpenSSLTLSIOCtx::ocspStaplingCb);
+ SSL_CTX_set_tlsext_status_arg(d_feContext->d_tlsCtx.get(), &d_feContext->d_ocspResponses);
+ }
+
+ libssl_set_error_counters_callback(d_feContext->d_tlsCtx, &fe.d_tlsCounters);
+
+ if (!fe.d_tlsConfig.d_keyLogFile.empty()) {
+ d_feContext->d_keyLogFile = libssl_set_key_log_file(d_feContext->d_tlsCtx, fe.d_tlsConfig.d_keyLogFile);
+ }
+
+ try {
+ if (fe.d_tlsConfig.d_ticketKeyFile.empty()) {
+ handleTicketsKeyRotation(time(nullptr));
+ }
+ else {
+ OpenSSLTLSIOCtx::loadTicketsKeys(fe.d_tlsConfig.d_ticketKeyFile);
+ }
+ }
+ catch (const std::exception& e) {
+ throw;
+ }
+ }
+
+ /* client side context */
+ OpenSSLTLSIOCtx(const TLSContextParameters& params)
+ {
+ int sslOptions =
+ SSL_OP_NO_SSLv2 |
+ SSL_OP_NO_SSLv3 |
+ SSL_OP_NO_COMPRESSION |
+ SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION |
+ SSL_OP_SINGLE_DH_USE |
+ SSL_OP_SINGLE_ECDH_USE |
+ SSL_OP_CIPHER_SERVER_PREFERENCE;
+ if (!params.d_enableRenegotiation) {
+#ifdef SSL_OP_NO_RENEGOTIATION
+ sslOptions |= SSL_OP_NO_RENEGOTIATION;
+#elif defined(SSL_OP_NO_CLIENT_RENEGOTIATION)
+ sslOptions |= SSL_OP_NO_CLIENT_RENEGOTIATION;
+#endif
+ }
+
+ registerOpenSSLUser();
+
+#ifdef HAVE_TLS_CLIENT_METHOD
+ d_tlsCtx = std::shared_ptr<SSL_CTX>(SSL_CTX_new(TLS_client_method()), SSL_CTX_free);
+#else
+ d_tlsCtx = std::shared_ptr<SSL_CTX>(SSL_CTX_new(SSLv23_client_method()), SSL_CTX_free);
+#endif
+ if (!d_tlsCtx) {
+ ERR_print_errors_fp(stderr);
+ throw std::runtime_error("Error creating TLS context");
+ }
+
+ SSL_CTX_set_options(d_tlsCtx.get(), sslOptions);
+#if defined(SSL_CTX_set_ecdh_auto)
+ SSL_CTX_set_ecdh_auto(d_tlsCtx.get(), 1);
+#endif
+
+ if (!params.d_ciphers.empty()) {
+ if (SSL_CTX_set_cipher_list(d_tlsCtx.get(), params.d_ciphers.c_str()) != 1) {
+ ERR_print_errors_fp(stderr);
+ throw std::runtime_error("Error setting the cipher list to '" + params.d_ciphers + "' for the TLS context");
+ }
+ }
+#ifdef HAVE_SSL_CTX_SET_CIPHERSUITES
+ if (!params.d_ciphers13.empty()) {
+ if (SSL_CTX_set_ciphersuites(d_tlsCtx.get(), params.d_ciphers13.c_str()) != 1) {
+ ERR_print_errors_fp(stderr);
+ throw std::runtime_error("Error setting the TLS 1.3 cipher list to '" + params.d_ciphers13 + "' for the TLS context");
+ }
+ }
+#endif /* HAVE_SSL_CTX_SET_CIPHERSUITES */
+
+ if (params.d_validateCertificates) {
+ if (params.d_caStore.empty()) {
+ if (SSL_CTX_set_default_verify_paths(d_tlsCtx.get()) != 1) {
+ throw std::runtime_error("Error adding the system's default trusted CAs");
+ }
+ } else {
+ if (SSL_CTX_load_verify_locations(d_tlsCtx.get(), params.d_caStore.c_str(), nullptr) != 1) {
+ throw std::runtime_error("Error adding the trusted CAs file " + params.d_caStore);
+ }
+ }
+
+ SSL_CTX_set_verify(d_tlsCtx.get(), SSL_VERIFY_PEER, nullptr);
+#if (OPENSSL_VERSION_NUMBER < 0x10002000L)
+ warnlog("TLS hostname validation requested but not supported for OpenSSL < 1.0.2");
+#endif
+ }
+
+ /* we need to set SSL_SESS_CACHE_CLIENT for the "new ticket" callback (below) to be called,
+ but we don't want OpenSSL to cache the session itself so we set SSL_SESS_CACHE_NO_INTERNAL_STORE as well */
+ SSL_CTX_set_session_cache_mode(d_tlsCtx.get(), SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_NO_INTERNAL_STORE);
+ SSL_CTX_sess_set_new_cb(d_tlsCtx.get(), &OpenSSLTLSIOCtx::newTicketFromServerCb);
+
+#ifdef SSL_MODE_RELEASE_BUFFERS
+ if (params.d_releaseBuffers) {
+ SSL_CTX_set_mode(d_tlsCtx.get(), SSL_MODE_RELEASE_BUFFERS);
+ }
+#endif
+ }
+
+ ~OpenSSLTLSIOCtx() override
+ {
+ d_tlsCtx.reset();
+ unregisterOpenSSLUser();
+ }
+
+ static int ticketKeyCb(SSL *s, unsigned char keyName[TLS_TICKETS_KEY_NAME_SIZE], unsigned char *iv, EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx, int enc)
+ {
+ OpenSSLFrontendContext* ctx = reinterpret_cast<OpenSSLFrontendContext*>(libssl_get_ticket_key_callback_data(s));
+ if (ctx == nullptr) {
+ return -1;
+ }
+
+ int ret = libssl_ticket_key_callback(s, ctx->d_ticketKeys, keyName, iv, ectx, hctx, enc);
+ if (enc == 0) {
+ if (ret == 0 || ret == 2) {
+ OpenSSLTLSConnection* conn = reinterpret_cast<OpenSSLTLSConnection*>(SSL_get_ex_data(s, OpenSSLTLSConnection::s_tlsConnIndex));
+ if (conn) {
+ if (ret == 0) {
+ conn->setUnknownTicketKey();
+ }
+ else if (ret == 2) {
+ conn->setResumedFromInactiveTicketKey();
+ }
+ }
+ }
+ }
+
+ return ret;
+ }
+
+ static int ocspStaplingCb(SSL* ssl, void* arg)
+ {
+ if (ssl == nullptr || arg == nullptr) {
+ return SSL_TLSEXT_ERR_NOACK;
+ }
+ const auto ocspMap = reinterpret_cast<std::map<int, std::string>*>(arg);
+ return libssl_ocsp_stapling_callback(ssl, *ocspMap);
+ }
+
+ static int newTicketFromServerCb(SSL* ssl, SSL_SESSION* session)
+ {
+ OpenSSLTLSConnection* conn = reinterpret_cast<OpenSSLTLSConnection*>(SSL_get_ex_data(ssl, OpenSSLTLSConnection::s_tlsConnIndex));
+ if (session == nullptr || conn == nullptr) {
+ return 0;
+ }
+
+ conn->addNewTicket(session);
+ return 1;
+ }
+
+ std::unique_ptr<TLSConnection> getConnection(int socket, const struct timeval& timeout, time_t now) override
+ {
+ handleTicketsKeyRotation(now);
+
+ return std::make_unique<OpenSSLTLSConnection>(socket, timeout, d_feContext);
+ }
+
+ std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, int socket, const struct timeval& timeout) override
+ {
+ return std::make_unique<OpenSSLTLSConnection>(host, socket, timeout, d_tlsCtx);
+ }
+
+ void rotateTicketsKey(time_t now) override
+ {
+ d_feContext->d_ticketKeys.rotateTicketsKey(now);
+
+ if (d_ticketsKeyRotationDelay > 0) {
+ d_ticketsKeyNextRotation = now + d_ticketsKeyRotationDelay;
+ }
+ }
+
+ void loadTicketsKeys(const std::string& keyFile) override final
+ {
+ d_feContext->d_ticketKeys.loadTicketsKeys(keyFile);
+
+ if (d_ticketsKeyRotationDelay > 0) {
+ d_ticketsKeyNextRotation = time(nullptr) + d_ticketsKeyRotationDelay;
+ }
+ }
+
+ size_t getTicketsKeysCount() override
+ {
+ return d_feContext->d_ticketKeys.getKeysCount();
+ }
+
+ std::string getName() const override
+ {
+ return "openssl";
+ }
+
+ bool setALPNProtos(const std::vector<std::vector<uint8_t>>& protos) override
+ {
+ if (d_feContext && d_feContext->d_tlsCtx) {
+ d_alpnProtos = protos;
+ libssl_set_alpn_select_callback(d_feContext->d_tlsCtx.get(), alpnServerSelectCallback, this);
+ return true;
+ }
+ if (d_tlsCtx) {
+ return libssl_set_alpn_protos(d_tlsCtx.get(), protos);
+ }
+ return false;
+ }
+
+ bool setNextProtocolSelectCallback(bool(*cb)(unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen)) override
+ {
+ d_nextProtocolSelectCallback = cb;
+ libssl_set_npn_select_callback(d_tlsCtx.get(), npnSelectCallback, this);
+ return true;
+ }
+
+private:
+ /* called in a client context, if the client advertised more than one ALPN values and the server returned more than one as well, to select the one to use. */
+ static int npnSelectCallback(SSL* s, unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen, void* arg)
+ {
+ if (!arg) {
+ return SSL_TLSEXT_ERR_ALERT_WARNING;
+ }
+ OpenSSLTLSIOCtx* obj = reinterpret_cast<OpenSSLTLSIOCtx*>(arg);
+ if (obj->d_nextProtocolSelectCallback) {
+ return (*obj->d_nextProtocolSelectCallback)(out, outlen, in, inlen) ? SSL_TLSEXT_ERR_OK : SSL_TLSEXT_ERR_ALERT_WARNING;
+ }
+
+ return SSL_TLSEXT_ERR_OK;
+ }
+
+ static int alpnServerSelectCallback(SSL*, const unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen, void* arg)
+ {
+ if (!arg) {
+ return SSL_TLSEXT_ERR_ALERT_WARNING;
+ }
+ OpenSSLTLSIOCtx* obj = reinterpret_cast<OpenSSLTLSIOCtx*>(arg);
+
+ size_t pos = 0;
+ while (pos < inlen) {
+ size_t protoLen = in[pos];
+ pos++;
+ if (protoLen > (inlen - pos)) {
+ /* something is very wrong */
+ return SSL_TLSEXT_ERR_ALERT_WARNING;
+ }
+
+ for (const auto& tentative : obj->d_alpnProtos) {
+ if (tentative.size() == protoLen && memcmp(in + pos, tentative.data(), tentative.size()) == 0) {
+ *out = in + pos;
+ *outlen = protoLen;
+ return SSL_TLSEXT_ERR_OK;
+ }
+ }
+ pos += protoLen;
+ }
+
+ return SSL_TLSEXT_ERR_NOACK;
+ }
+
+ std::vector<std::vector<uint8_t>> d_alpnProtos; // store the supported ALPN protocols, so that the server can select based on what the client sent
+ std::shared_ptr<OpenSSLFrontendContext> d_feContext{nullptr};
+ std::shared_ptr<SSL_CTX> d_tlsCtx{nullptr}; // client context, on a server-side the context is stored in d_feContext->d_tlsCtx
+ bool (*d_nextProtocolSelectCallback)(unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen){nullptr};
+};
+
+#endif /* HAVE_LIBSSL */
+
+#ifdef HAVE_GNUTLS
+#include <gnutls/gnutls.h>
+#include <gnutls/x509.h>
+
+static void safe_memory_lock(void* data, size_t size)
+{
+#ifdef HAVE_LIBSODIUM
+ sodium_mlock(data, size);
+#endif
+}
+
+static void safe_memory_release(void* data, size_t size)
+{
+#ifdef HAVE_LIBSODIUM
+ sodium_munlock(data, size);
+#elif defined(HAVE_EXPLICIT_BZERO)
+ explicit_bzero(data, size);
+#elif defined(HAVE_EXPLICIT_MEMSET)
+ explicit_memset(data, 0, size);
+#elif defined(HAVE_GNUTLS_MEMSET)
+ gnutls_memset(data, 0, size);
+#else
+ /* shamelessly taken from Dovecot's src/lib/safe-memset.c */
+ volatile unsigned int volatile_zero_idx = 0;
+ volatile unsigned char *p = reinterpret_cast<volatile unsigned char *>(data);
+
+ if (size == 0)
+ return;
+
+ do {
+ memset(data, 0, size);
+ } while (p[volatile_zero_idx] != 0);
+#endif
+}
+
+class GnuTLSTicketsKey
+{
+public:
+ GnuTLSTicketsKey()
+ {
+ if (gnutls_session_ticket_key_generate(&d_key) != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error generating tickets key for TLS context");
+ }
+
+ safe_memory_lock(d_key.data, d_key.size);
+ }
+
+ GnuTLSTicketsKey(const std::string& keyFile)
+ {
+ /* to be sure we are loading the correct amount of data, which
+ may change between versions, let's generate a correct key first */
+ if (gnutls_session_ticket_key_generate(&d_key) != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error generating tickets key (before parsing key file) for TLS context");
+ }
+
+ safe_memory_lock(d_key.data, d_key.size);
+
+ try {
+ ifstream file(keyFile);
+ file.read(reinterpret_cast<char*>(d_key.data), d_key.size);
+
+ if (file.fail()) {
+ file.close();
+ throw std::runtime_error("Invalid GnuTLS tickets key file " + keyFile);
+ }
+
+ file.close();
+ }
+ catch (const std::exception& e) {
+ safe_memory_release(d_key.data, d_key.size);
+ gnutls_free(d_key.data);
+ d_key.data = nullptr;
+ throw;
+ }
+ }
+
+ ~GnuTLSTicketsKey()
+ {
+ if (d_key.data != nullptr && d_key.size > 0) {
+ safe_memory_release(d_key.data, d_key.size);
+ }
+ gnutls_free(d_key.data);
+ d_key.data = nullptr;
+ }
+ const gnutls_datum_t& getKey() const
+ {
+ return d_key;
+ }
+
+private:
+ gnutls_datum_t d_key{nullptr, 0};
+};
+
+class GnuTLSSession : public TLSSession
+{
+public:
+ GnuTLSSession(gnutls_datum_t& sess): d_sess(sess)
+ {
+ sess.data = nullptr;
+ sess.size = 0;
+ }
+
+ virtual ~GnuTLSSession()
+ {
+ if (d_sess.data != nullptr && d_sess.size > 0) {
+ safe_memory_release(d_sess.data, d_sess.size);
+ }
+ gnutls_free(d_sess.data);
+ d_sess.data = nullptr;
+ }
+
+ const gnutls_datum_t& getNative()
+ {
+ return d_sess;
+ }
+
+private:
+ gnutls_datum_t d_sess{nullptr, 0};
+};
+
+class GnuTLSConnection: public TLSConnection
+{
+public:
+ /* server side connection */
+ GnuTLSConnection(int socket, const struct timeval& timeout, std::shared_ptr<gnutls_certificate_credentials_st>& creds, const gnutls_priority_t priorityCache, std::shared_ptr<GnuTLSTicketsKey>& ticketsKey, bool enableTickets): d_creds(creds), d_ticketsKey(ticketsKey), d_conn(std::unique_ptr<gnutls_session_int, void(*)(gnutls_session_t)>(nullptr, gnutls_deinit))
+ {
+ unsigned int sslOptions = GNUTLS_SERVER | GNUTLS_NONBLOCK;
+#ifdef GNUTLS_NO_SIGNAL
+ sslOptions |= GNUTLS_NO_SIGNAL;
+#endif
+
+ d_socket = socket;
+
+ gnutls_session_t conn;
+ if (gnutls_init(&conn, sslOptions) != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error creating TLS connection");
+ }
+
+ d_conn = std::unique_ptr<gnutls_session_int, void(*)(gnutls_session_t)>(conn, gnutls_deinit);
+ conn = nullptr;
+
+ if (gnutls_credentials_set(d_conn.get(), GNUTLS_CRD_CERTIFICATE, d_creds.get()) != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting certificate and key to TLS connection");
+ }
+
+ if (gnutls_priority_set(d_conn.get(), priorityCache) != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting ciphers to TLS connection");
+ }
+
+ if (enableTickets && d_ticketsKey) {
+ const gnutls_datum_t& key = d_ticketsKey->getKey();
+ if (gnutls_session_ticket_enable_server(d_conn.get(), &key) != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting the tickets key to TLS connection");
+ }
+ }
+
+ gnutls_transport_set_int(d_conn.get(), d_socket);
+
+ /* timeouts are in milliseconds */
+ gnutls_handshake_set_timeout(d_conn.get(), timeout.tv_sec * 1000 + timeout.tv_usec / 1000);
+ gnutls_record_set_timeout(d_conn.get(), timeout.tv_sec * 1000 + timeout.tv_usec / 1000);
+ }
+
+ /* client-side connection */
+ GnuTLSConnection(const std::string& host, int socket, const struct timeval& timeout, std::shared_ptr<gnutls_certificate_credentials_st>& creds, const gnutls_priority_t priorityCache, bool validateCerts): d_creds(creds), d_conn(std::unique_ptr<gnutls_session_int, void(*)(gnutls_session_t)>(nullptr, gnutls_deinit)), d_host(host), d_client(true)
+ {
+ unsigned int sslOptions = GNUTLS_CLIENT | GNUTLS_NONBLOCK;
+#ifdef GNUTLS_NO_SIGNAL
+ sslOptions |= GNUTLS_NO_SIGNAL;
+#endif
+
+ d_socket = socket;
+
+ gnutls_session_t conn;
+ if (gnutls_init(&conn, sslOptions) != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error creating TLS connection");
+ }
+
+ d_conn = std::unique_ptr<gnutls_session_int, void(*)(gnutls_session_t)>(conn, gnutls_deinit);
+ conn = nullptr;
+
+ int rc = gnutls_credentials_set(d_conn.get(), GNUTLS_CRD_CERTIFICATE, d_creds.get());
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting certificate and key to TLS connection: " + std::string(gnutls_strerror(rc)));
+ }
+
+ rc = gnutls_priority_set(d_conn.get(), priorityCache);
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting ciphers to TLS connection: " + std::string(gnutls_strerror(rc)));
+ }
+
+ gnutls_transport_set_int(d_conn.get(), d_socket);
+
+ /* timeouts are in milliseconds */
+ gnutls_handshake_set_timeout(d_conn.get(), timeout.tv_sec * 1000 + timeout.tv_usec / 1000);
+ gnutls_record_set_timeout(d_conn.get(), timeout.tv_sec * 1000 + timeout.tv_usec / 1000);
+
+#if HAVE_GNUTLS_SESSION_SET_VERIFY_CERT
+ if (validateCerts && !d_host.empty()) {
+ gnutls_session_set_verify_cert(d_conn.get(), d_host.c_str(), GNUTLS_VERIFY_ALLOW_UNSORTED_CHAIN);
+ rc = gnutls_server_name_set(d_conn.get(), GNUTLS_NAME_DNS, d_host.c_str(), d_host.size());
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting the SNI value to '" + d_host + "' on TLS connection: " + std::string(gnutls_strerror(rc)));
+ }
+ }
+#else
+ /* no hostname validation for you */
+#endif
+
+ /* allow access to our data in the callbacks */
+ gnutls_session_set_ptr(d_conn.get(), this);
+ gnutls_handshake_set_hook_function(d_conn.get(), GNUTLS_HANDSHAKE_NEW_SESSION_TICKET, GNUTLS_HOOK_POST, newTicketFromServerCb);
+ }
+
+ /* The callback prototype changed in 3.4.0. */
+#if GNUTLS_VERSION_NUMBER >= 0x030400
+ static int newTicketFromServerCb(gnutls_session_t session, unsigned int htype, unsigned post, unsigned int incoming, const gnutls_datum_t* msg)
+#else
+ static int newTicketFromServerCb(gnutls_session_t session, unsigned int htype, unsigned post, unsigned int incoming)
+#endif /* GNUTLS_VERSION_NUMBER >= 0x030400 */
+ {
+ if (htype != GNUTLS_HANDSHAKE_NEW_SESSION_TICKET || post != GNUTLS_HOOK_POST || session == nullptr) {
+ return 0;
+ }
+
+ GnuTLSConnection* conn = reinterpret_cast<GnuTLSConnection*>(gnutls_session_get_ptr(session));
+ if (conn == nullptr) {
+ return 0;
+ }
+
+ gnutls_datum_t sess{nullptr, 0};
+ auto ret = gnutls_session_get_data2(session, &sess);
+ /* GnuTLS returns a 'fake' ticket of 4 bytes set to zero when there is no ticket available */
+ if (ret != GNUTLS_E_SUCCESS || sess.size <= 4) {
+ throw std::runtime_error("Error getting GnuTLSSession: " + std::string(gnutls_strerror(ret)));
+ }
+ conn->d_tlsSessions.push_back(std::make_unique<GnuTLSSession>(sess));
+ return 0;
+ }
+
+ IOState tryConnect(bool fastOpen, const ComboAddress& remote) override
+ {
+ int ret = 0;
+
+ if (fastOpen) {
+#ifdef HAVE_GNUTLS_TRANSPORT_SET_FASTOPEN
+ gnutls_transport_set_fastopen(d_conn.get(), d_socket, const_cast<struct sockaddr*>(reinterpret_cast<const struct sockaddr*>(&remote)), remote.getSocklen(), 0);
+#endif
+ }
+
+ do {
+ ret = gnutls_handshake(d_conn.get());
+ if (ret == GNUTLS_E_SUCCESS) {
+ d_handshakeDone = true;
+ return IOState::Done;
+ }
+ else if (ret == GNUTLS_E_AGAIN) {
+ int direction = gnutls_record_get_direction(d_conn.get());
+ return direction == 0 ? IOState::NeedRead : IOState::NeedWrite;
+ }
+ else if (gnutls_error_is_fatal(ret) || ret == GNUTLS_E_WARNING_ALERT_RECEIVED) {
+ throw std::runtime_error("Error establishing a new connection: " + std::string(gnutls_strerror(ret)));
+ }
+ } while (ret == GNUTLS_E_INTERRUPTED);
+
+ throw std::runtime_error("Error establishing a new connection: " + std::string(gnutls_strerror(ret)));
+ }
+
+ void connect(bool fastOpen, const ComboAddress& remote, const struct timeval& timeout) override
+ {
+ struct timeval start = {0, 0};
+ struct timeval remainingTime = timeout;
+ if (timeout.tv_sec != 0 || timeout.tv_usec != 0) {
+ gettimeofday(&start, nullptr);
+ }
+
+ IOState state;
+ do {
+ state = tryConnect(fastOpen, remote);
+ if (state == IOState::Done) {
+ return;
+ }
+ else if (state == IOState::NeedRead) {
+ int result = waitForData(d_socket, remainingTime.tv_sec, remainingTime.tv_usec);
+ if (result <= 0) {
+ throw std::runtime_error("Error reading from TLS connection: " + std::to_string(result));
+ }
+ }
+ else if (state == IOState::NeedWrite) {
+ int result = waitForRWData(d_socket, false, remainingTime.tv_sec, remainingTime.tv_usec);
+ if (result <= 0) {
+ throw std::runtime_error("Error reading from TLS connection: " + std::to_string(result));
+ }
+ }
+
+ if (timeout.tv_sec != 0 || timeout.tv_usec != 0) {
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ struct timeval elapsed = now - start;
+ if (now < start || remainingTime < elapsed) {
+ throw runtime_error("Timeout while establishing TLS connection");
+ }
+ start = now;
+ remainingTime = remainingTime - elapsed;
+ }
+ }
+ while (state != IOState::Done);
+ }
+
+ void doHandshake() override
+ {
+ int ret = 0;
+ do {
+ ret = gnutls_handshake(d_conn.get());
+ if (gnutls_error_is_fatal(ret) || ret == GNUTLS_E_WARNING_ALERT_RECEIVED) {
+ if (d_client) {
+ throw std::runtime_error("Error establishing a new connection: " + std::string(gnutls_strerror(ret)));
+ }
+ else {
+ throw std::runtime_error("Error accepting a new connection: " + std::string(gnutls_strerror(ret)));
+ }
+ }
+ }
+ while (ret != GNUTLS_E_SUCCESS && ret == GNUTLS_E_INTERRUPTED);
+
+ d_handshakeDone = true;
+ }
+
+ IOState tryHandshake() override
+ {
+ int ret = 0;
+
+ do {
+ ret = gnutls_handshake(d_conn.get());
+ if (ret == GNUTLS_E_SUCCESS) {
+ d_handshakeDone = true;
+ return IOState::Done;
+ }
+ else if (ret == GNUTLS_E_AGAIN) {
+ int direction = gnutls_record_get_direction(d_conn.get());
+ return direction == 0 ? IOState::NeedRead : IOState::NeedWrite;
+ }
+ else if (gnutls_error_is_fatal(ret) || ret == GNUTLS_E_WARNING_ALERT_RECEIVED) {
+ if (d_client) {
+ std::string error;
+#if HAVE_GNUTLS_SESSION_GET_VERIFY_CERT_STATUS
+ if (ret == GNUTLS_E_CERTIFICATE_VERIFICATION_ERROR) {
+ gnutls_datum_t out;
+ if (gnutls_certificate_verification_status_print(gnutls_session_get_verify_cert_status(d_conn.get()), gnutls_certificate_type_get(d_conn.get()), &out, 0) == 0) {
+ error = " (" + std::string(reinterpret_cast<const char*>(out.data)) + ")";
+ gnutls_free(out.data);
+ }
+ }
+#endif /* HAVE_GNUTLS_SESSION_GET_VERIFY_CERT_STATUS */
+ throw std::runtime_error("Error accepting a new connection: " + std::string(gnutls_strerror(ret)) + error);
+ }
+ else {
+ throw std::runtime_error("Error establishing a new connection: " + std::string(gnutls_strerror(ret)));
+ }
+ }
+ } while (ret == GNUTLS_E_INTERRUPTED);
+
+ if (d_client) {
+ throw std::runtime_error("Error establishinging a new connection: " + std::string(gnutls_strerror(ret)));
+ }
+ else {
+ throw std::runtime_error("Error accepting a new connection: " + std::string(gnutls_strerror(ret)));
+ }
+ }
+
+ IOState tryWrite(const PacketBuffer& buffer, size_t& pos, size_t toWrite) override
+ {
+ if (!d_handshakeDone) {
+ /* As opposed to OpenSSL, GnuTLS will not transparently finish the handshake for us,
+ we need to keep calling gnutls_handshake() until the handshake has been finished. */
+ auto state = tryHandshake();
+ if (state != IOState::Done) {
+ return state;
+ }
+ }
+
+ do {
+ ssize_t res = gnutls_record_send(d_conn.get(), reinterpret_cast<const char *>(&buffer.at(pos)), toWrite - pos);
+ if (res == 0) {
+ throw std::runtime_error("Error writing to TLS connection");
+ }
+ else if (res > 0) {
+ pos += static_cast<size_t>(res);
+ }
+ else if (res < 0) {
+ if (gnutls_error_is_fatal(res)) {
+ throw std::runtime_error("Fatal error writing to TLS connection: " + std::string(gnutls_strerror(res)));
+ }
+ else if (res == GNUTLS_E_AGAIN) {
+ return IOState::NeedWrite;
+ }
+ warnlog("Warning, non-fatal error while writing to TLS connection: %s", gnutls_strerror(res));
+ }
+ }
+ while (pos < toWrite);
+ return IOState::Done;
+ }
+
+ IOState tryRead(PacketBuffer& buffer, size_t& pos, size_t toRead, bool allowIncomplete) override
+ {
+ if (!d_handshakeDone) {
+ /* As opposed to OpenSSL, GnuTLS will not transparently finish the handshake for us,
+ we need to keep calling gnutls_handshake() until the handshake has been finished. */
+ auto state = tryHandshake();
+ if (state != IOState::Done) {
+ return state;
+ }
+ }
+
+ do {
+ ssize_t res = gnutls_record_recv(d_conn.get(), reinterpret_cast<char *>(&buffer.at(pos)), toRead - pos);
+ if (res == 0) {
+ throw std::runtime_error("EOF while reading from TLS connection");
+ }
+ else if (res > 0) {
+ pos += static_cast<size_t>(res);
+ if (allowIncomplete) {
+ break;
+ }
+ }
+ else if (res < 0) {
+ if (gnutls_error_is_fatal(res)) {
+ throw std::runtime_error("Fatal error reading from TLS connection: " + std::string(gnutls_strerror(res)));
+ }
+ else if (res == GNUTLS_E_AGAIN) {
+ return IOState::NeedRead;
+ }
+ warnlog("Warning, non-fatal error while writing to TLS connection: %s", gnutls_strerror(res));
+ }
+ }
+ while (pos < toRead);
+ return IOState::Done;
+ }
+
+ size_t read(void* buffer, size_t bufferSize, const struct timeval& readTimeout, const struct timeval& totalTimeout, bool allowIncomplete) override
+ {
+ size_t got = 0;
+ struct timeval start{0,0};
+ struct timeval remainingTime = totalTimeout;
+ if (totalTimeout.tv_sec != 0 || totalTimeout.tv_usec != 0) {
+ gettimeofday(&start, nullptr);
+ }
+
+ do {
+ ssize_t res = gnutls_record_recv(d_conn.get(), (reinterpret_cast<char *>(buffer) + got), bufferSize - got);
+ if (res == 0) {
+ throw std::runtime_error("EOF while reading from TLS connection");
+ }
+ else if (res > 0) {
+ got += static_cast<size_t>(res);
+ if (allowIncomplete) {
+ break;
+ }
+ }
+ else if (res < 0) {
+ if (gnutls_error_is_fatal(res)) {
+ throw std::runtime_error("Fatal error reading from TLS connection: " + std::string(gnutls_strerror(res)));
+ }
+ else if (res == GNUTLS_E_AGAIN) {
+ int result = waitForData(d_socket, readTimeout.tv_sec, readTimeout.tv_usec);
+ if (result <= 0) {
+ throw std::runtime_error("Error while waiting to read from TLS connection: " + std::to_string(result));
+ }
+ }
+ else {
+ vinfolog("Non-fatal error while reading from TLS connection: %s", gnutls_strerror(res));
+ }
+ }
+
+ if (totalTimeout.tv_sec != 0 || totalTimeout.tv_usec != 0) {
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ struct timeval elapsed = now - start;
+ if (now < start || remainingTime < elapsed) {
+ throw runtime_error("Timeout while reading data");
+ }
+ start = now;
+ remainingTime = remainingTime - elapsed;
+ }
+ }
+ while (got < bufferSize);
+
+ return got;
+ }
+
+ size_t write(const void* buffer, size_t bufferSize, const struct timeval& writeTimeout) override
+ {
+ size_t got = 0;
+
+ do {
+ ssize_t res = gnutls_record_send(d_conn.get(), (reinterpret_cast<const char *>(buffer) + got), bufferSize - got);
+ if (res == 0) {
+ throw std::runtime_error("Error writing to TLS connection");
+ }
+ else if (res > 0) {
+ got += static_cast<size_t>(res);
+ }
+ else if (res < 0) {
+ if (gnutls_error_is_fatal(res)) {
+ throw std::runtime_error("Fatal error writing to TLS connection: " + std::string(gnutls_strerror(res)));
+ }
+ else if (res == GNUTLS_E_AGAIN) {
+ int result = waitForRWData(d_socket, false, writeTimeout.tv_sec, writeTimeout.tv_usec);
+ if (result <= 0) {
+ throw std::runtime_error("Error waiting to write to TLS connection: " + std::to_string(result));
+ }
+ }
+ else {
+ vinfolog("Non-fatal error while writing to TLS connection: %s", gnutls_strerror(res));
+ }
+ }
+ }
+ while (got < bufferSize);
+
+ return got;
+ }
+
+ bool hasBufferedData() const override
+ {
+ if (d_conn) {
+ return gnutls_record_check_pending(d_conn.get()) > 0;
+ }
+
+ return false;
+ }
+
+ bool isUsable() const override
+ {
+ if (!d_conn) {
+ return false;
+ }
+
+ /* as far as I can tell we can't peek so we cannot do better */
+ return isTCPSocketUsable(d_socket);
+ }
+
+ std::string getServerNameIndication() const override
+ {
+ if (d_conn) {
+ unsigned int type;
+ size_t name_len = 256;
+ std::string sni;
+ sni.resize(name_len);
+
+ int res = gnutls_server_name_get(d_conn.get(), const_cast<char*>(sni.c_str()), &name_len, &type, 0);
+ if (res == GNUTLS_E_SUCCESS) {
+ sni.resize(name_len);
+ return sni;
+ }
+ }
+ return std::string();
+ }
+
+ std::vector<uint8_t> getNextProtocol() const override
+ {
+ std::vector<uint8_t> result;
+ if (!d_conn) {
+ return result;
+ }
+ gnutls_datum_t next;
+ if (gnutls_alpn_get_selected_protocol(d_conn.get(), &next) != GNUTLS_E_SUCCESS) {
+ return result;
+ }
+ result.insert(result.end(), next.data, next.data + next.size);
+ return result;
+ }
+
+ LibsslTLSVersion getTLSVersion() const override
+ {
+ auto proto = gnutls_protocol_get_version(d_conn.get());
+ switch (proto) {
+ case GNUTLS_TLS1_0:
+ return LibsslTLSVersion::TLS10;
+ case GNUTLS_TLS1_1:
+ return LibsslTLSVersion::TLS11;
+ case GNUTLS_TLS1_2:
+ return LibsslTLSVersion::TLS12;
+#if GNUTLS_VERSION_NUMBER >= 0x030603
+ case GNUTLS_TLS1_3:
+ return LibsslTLSVersion::TLS13;
+#endif /* GNUTLS_VERSION_NUMBER >= 0x030603 */
+ default:
+ return LibsslTLSVersion::Unknown;
+ }
+ }
+
+ bool hasSessionBeenResumed() const override
+ {
+ if (d_conn) {
+ return gnutls_session_is_resumed(d_conn.get()) != 0;
+ }
+ return false;
+ }
+
+ std::vector<std::unique_ptr<TLSSession>> getSessions() override
+ {
+ return std::move(d_tlsSessions);
+ }
+
+ void setSession(std::unique_ptr<TLSSession>& session) override
+ {
+ auto sess = dynamic_cast<GnuTLSSession*>(session.get());
+ if (!sess) {
+ throw std::runtime_error("Unable to convert GnuTLS session");
+ }
+
+ auto native = sess->getNative();
+ auto ret = gnutls_session_set_data(d_conn.get(), native.data, native.size);
+ if (ret != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting up GnuTLS session: " + std::string(gnutls_strerror(ret)));
+ }
+ session.reset();
+ }
+
+ void close() override
+ {
+ if (d_conn) {
+ gnutls_bye(d_conn.get(), GNUTLS_SHUT_RDWR);
+ }
+ }
+
+ bool setALPNProtos(const std::vector<std::vector<uint8_t>>& protos)
+ {
+ std::vector<gnutls_datum_t> values;
+ values.reserve(protos.size());
+ for (const auto& proto : protos) {
+ gnutls_datum_t value;
+ value.data = const_cast<uint8_t*>(proto.data());
+ value.size = proto.size();
+ values.push_back(value);
+ }
+ unsigned int flags = 0;
+#if GNUTLS_VERSION_NUMBER >= 0x030500
+ flags |= GNUTLS_ALPN_MANDATORY;
+#elif defined(GNUTLS_ALPN_MAND)
+ flags |= GNUTLS_ALPN_MAND;
+#endif
+ return gnutls_alpn_set_protocols(d_conn.get(), values.data(), values.size(), flags);
+ }
+
+private:
+ std::shared_ptr<gnutls_certificate_credentials_st> d_creds;
+ std::shared_ptr<GnuTLSTicketsKey> d_ticketsKey;
+ std::unique_ptr<gnutls_session_int, void(*)(gnutls_session_t)> d_conn;
+ std::vector<std::unique_ptr<TLSSession>> d_tlsSessions;
+ std::string d_host;
+ bool d_client{false};
+ bool d_handshakeDone{false};
+};
+
+class GnuTLSIOCtx: public TLSCtx
+{
+public:
+ /* server side context */
+ GnuTLSIOCtx(TLSFrontend& fe): d_enableTickets(fe.d_tlsConfig.d_enableTickets)
+ {
+ int rc = 0;
+ d_ticketsKeyRotationDelay = fe.d_tlsConfig.d_ticketsKeyRotationDelay;
+
+ gnutls_certificate_credentials_t creds;
+ rc = gnutls_certificate_allocate_credentials(&creds);
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error allocating credentials for TLS context on " + fe.d_addr.toStringWithPort() + ": " + gnutls_strerror(rc));
+ }
+
+ d_creds = std::shared_ptr<gnutls_certificate_credentials_st>(creds, gnutls_certificate_free_credentials);
+ creds = nullptr;
+
+ for (const auto& pair : fe.d_tlsConfig.d_certKeyPairs) {
+ rc = gnutls_certificate_set_x509_key_file(d_creds.get(), pair.first.c_str(), pair.second.c_str(), GNUTLS_X509_FMT_PEM);
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error loading certificate ('" + pair.first + "') and key ('" + pair.second + "') for TLS context on " + fe.d_addr.toStringWithPort() + ": " + gnutls_strerror(rc));
+ }
+ }
+
+ size_t count = 0;
+ for (const auto& file : fe.d_tlsConfig.d_ocspFiles) {
+ rc = gnutls_certificate_set_ocsp_status_request_file(d_creds.get(), file.c_str(), count);
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error loading OCSP response from file '" + file + "' for certificate ('" + fe.d_tlsConfig.d_certKeyPairs.at(count).first + "') and key ('" + fe.d_tlsConfig.d_certKeyPairs.at(count).second + "') for TLS context on " + fe.d_addr.toStringWithPort() + ": " + gnutls_strerror(rc));
+ }
+ ++count;
+ }
+
+#if GNUTLS_VERSION_NUMBER >= 0x030600
+ rc = gnutls_certificate_set_known_dh_params(d_creds.get(), GNUTLS_SEC_PARAM_HIGH);
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting DH params for TLS context on " + fe.d_addr.toStringWithPort() + ": " + gnutls_strerror(rc));
+ }
+#endif
+
+ rc = gnutls_priority_init(&d_priorityCache, fe.d_tlsConfig.d_ciphers.empty() ? "NORMAL" : fe.d_tlsConfig.d_ciphers.c_str(), nullptr);
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting up TLS cipher preferences to '" + fe.d_tlsConfig.d_ciphers + "' (" + gnutls_strerror(rc) + ") on " + fe.d_addr.toStringWithPort());
+ }
+
+ try {
+ if (fe.d_tlsConfig.d_ticketKeyFile.empty()) {
+ handleTicketsKeyRotation(time(nullptr));
+ }
+ else {
+ GnuTLSIOCtx::loadTicketsKeys(fe.d_tlsConfig.d_ticketKeyFile);
+ }
+ }
+ catch(const std::runtime_error& e) {
+ throw std::runtime_error("Error generating tickets key for TLS context on " + fe.d_addr.toStringWithPort() + ": " + e.what());
+ }
+ }
+
+ /* client side context */
+ GnuTLSIOCtx(const TLSContextParameters& params): d_contextParameters(std::make_unique<TLSContextParameters>(params)), d_enableTickets(true), d_validateCerts(params.d_validateCertificates)
+ {
+ int rc = 0;
+
+ gnutls_certificate_credentials_t creds;
+ rc = gnutls_certificate_allocate_credentials(&creds);
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error allocating credentials for TLS context: " + std::string(gnutls_strerror(rc)));
+ }
+
+ d_creds = std::shared_ptr<gnutls_certificate_credentials_st>(creds, gnutls_certificate_free_credentials);
+ creds = nullptr;
+
+ if (params.d_validateCertificates) {
+ if (params.d_caStore.empty()) {
+#if GNUTLS_VERSION_NUMBER >= 0x030700 && GNUTLS_VERSION_NUMBER < 0x030703
+ /* see https://gitlab.com/gnutls/gnutls/-/issues/1277 */
+ std::cerr<<"Warning: GnuTLS 3.7.0 - 3.7.2 have a memory leak when validating server certificates in some configurations (PKCS11 support enabled, and a default PKCS11 trust store), please consider upgrading GnuTLS, using the OpenSSL provider for outgoing connections, or explicitly setting a CA store"<<std::endl;
+#endif /* GNUTLS_VERSION_NUMBER >= 0x030700 && GNUTLS_VERSION_NUMBER < 0x030703 */
+ rc = gnutls_certificate_set_x509_system_trust(d_creds.get());
+ if (rc < 0) {
+ throw std::runtime_error("Error adding the system's default trusted CAs: " + std::string(gnutls_strerror(rc)));
+ }
+ }
+ else {
+ rc = gnutls_certificate_set_x509_trust_file(d_creds.get(), params.d_caStore.c_str(), GNUTLS_X509_FMT_PEM);
+ if (rc < 0) {
+ throw std::runtime_error("Error adding '" + params.d_caStore + "' to the trusted CAs: " + std::string(gnutls_strerror(rc)));
+ }
+ }
+ }
+
+ rc = gnutls_priority_init(&d_priorityCache, params.d_ciphers.empty() ? "NORMAL" : params.d_ciphers.c_str(), nullptr);
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error setting up TLS cipher preferences to 'NORMAL' (" + std::string(gnutls_strerror(rc)) + ")");
+ }
+ }
+
+ virtual ~GnuTLSIOCtx() override
+ {
+ d_creds.reset();
+
+ if (d_priorityCache) {
+ gnutls_priority_deinit(d_priorityCache);
+ }
+ }
+
+ std::unique_ptr<TLSConnection> getConnection(int socket, const struct timeval& timeout, time_t now) override
+ {
+ handleTicketsKeyRotation(now);
+
+ std::shared_ptr<GnuTLSTicketsKey> ticketsKey;
+ {
+ ticketsKey = *(d_ticketsKey.read_lock());
+ }
+
+ auto connection = std::make_unique<GnuTLSConnection>(socket, timeout, d_creds, d_priorityCache, ticketsKey, d_enableTickets);
+ if (!d_protos.empty()) {
+ connection->setALPNProtos(d_protos);
+ }
+ return connection;
+ }
+
+ static std::shared_ptr<gnutls_certificate_credentials_st> getPerThreadCredentials(bool validate, const std::string& caStore)
+ {
+ static thread_local std::map<std::pair<bool, std::string>, std::shared_ptr<gnutls_certificate_credentials_st>> t_credentials;
+ auto& entry = t_credentials[{validate, caStore}];
+ if (!entry) {
+ gnutls_certificate_credentials_t creds;
+ int rc = gnutls_certificate_allocate_credentials(&creds);
+ if (rc != GNUTLS_E_SUCCESS) {
+ throw std::runtime_error("Error allocating credentials for TLS context: " + std::string(gnutls_strerror(rc)));
+ }
+
+ entry = std::shared_ptr<gnutls_certificate_credentials_st>(creds, gnutls_certificate_free_credentials);
+ creds = nullptr;
+
+ if (validate) {
+ if (caStore.empty()) {
+ rc = gnutls_certificate_set_x509_system_trust(entry.get());
+ if (rc < 0) {
+ throw std::runtime_error("Error adding the system's default trusted CAs: " + std::string(gnutls_strerror(rc)));
+ }
+ }
+ else {
+ rc = gnutls_certificate_set_x509_trust_file(entry.get(), caStore.c_str(), GNUTLS_X509_FMT_PEM);
+ if (rc < 0) {
+ throw std::runtime_error("Error adding '" + caStore + "' to the trusted CAs: " + std::string(gnutls_strerror(rc)));
+ }
+ }
+ }
+ }
+ return entry;
+ }
+
+ std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, int socket, const struct timeval& timeout) override
+ {
+ auto creds = getPerThreadCredentials(d_contextParameters->d_validateCertificates, d_contextParameters->d_caStore);
+ auto connection = std::make_unique<GnuTLSConnection>(host, socket, timeout, creds, d_priorityCache, d_validateCerts);
+ if (!d_protos.empty()) {
+ connection->setALPNProtos(d_protos);
+ }
+ return connection;
+ }
+
+ void rotateTicketsKey(time_t now) override
+ {
+ if (!d_enableTickets) {
+ return;
+ }
+
+ auto newKey = std::make_shared<GnuTLSTicketsKey>();
+
+ {
+ *(d_ticketsKey.write_lock()) = newKey;
+ }
+
+ if (d_ticketsKeyRotationDelay > 0) {
+ d_ticketsKeyNextRotation = now + d_ticketsKeyRotationDelay;
+ }
+ }
+
+ void loadTicketsKeys(const std::string& file) override final
+ {
+ if (!d_enableTickets) {
+ return;
+ }
+
+ auto newKey = std::make_shared<GnuTLSTicketsKey>(file);
+ {
+ *(d_ticketsKey.write_lock()) = newKey;
+ }
+
+ if (d_ticketsKeyRotationDelay > 0) {
+ d_ticketsKeyNextRotation = time(nullptr) + d_ticketsKeyRotationDelay;
+ }
+ }
+
+ size_t getTicketsKeysCount() override
+ {
+ return *(d_ticketsKey.read_lock()) != nullptr ? 1 : 0;
+ }
+
+ std::string getName() const override
+ {
+ return "gnutls";
+ }
+
+ bool setALPNProtos(const std::vector<std::vector<uint8_t>>& protos) override
+ {
+#ifdef HAVE_GNUTLS_ALPN_SET_PROTOCOLS
+ d_protos = protos;
+ return true;
+#else
+ return false;
+#endif
+ }
+
+private:
+ /* client context parameters */
+ std::unique_ptr<TLSContextParameters> d_contextParameters{nullptr};
+ std::shared_ptr<gnutls_certificate_credentials_st> d_creds;
+ std::vector<std::vector<uint8_t>> d_protos;
+ gnutls_priority_t d_priorityCache{nullptr};
+ SharedLockGuarded<std::shared_ptr<GnuTLSTicketsKey>> d_ticketsKey{nullptr};
+ bool d_enableTickets{true};
+ bool d_validateCerts{true};
+};
+
+#endif /* HAVE_GNUTLS */
+
+#endif /* HAVE_DNS_OVER_TLS */
+
+bool setupDoTProtocolNegotiation(std::shared_ptr<TLSCtx>& ctx)
+{
+ if (ctx == nullptr) {
+ return false;
+ }
+ /* we want to set the ALPN to dot (RFC7858), if only to mitigate the ALPACA attack */
+ const std::vector<std::vector<uint8_t>> dotAlpns = {{'d', 'o', 't'}};
+ ctx->setALPNProtos(dotAlpns);
+ return true;
+}
+
+bool TLSFrontend::setupTLS()
+{
+#ifdef HAVE_DNS_OVER_TLS
+ std::shared_ptr<TLSCtx> newCtx{nullptr};
+ /* get the "best" available provider */
+ if (!d_provider.empty()) {
+#ifdef HAVE_GNUTLS
+ if (d_provider == "gnutls") {
+ newCtx = std::make_shared<GnuTLSIOCtx>(*this);
+ setupDoTProtocolNegotiation(newCtx);
+ std::atomic_store_explicit(&d_ctx, newCtx, std::memory_order_release);
+ return true;
+ }
+#endif /* HAVE_GNUTLS */
+#ifdef HAVE_LIBSSL
+ if (d_provider == "openssl") {
+ newCtx = std::make_shared<OpenSSLTLSIOCtx>(*this);
+ setupDoTProtocolNegotiation(newCtx);
+ std::atomic_store_explicit(&d_ctx, newCtx, std::memory_order_release);
+ return true;
+ }
+#endif /* HAVE_LIBSSL */
+ }
+#ifdef HAVE_LIBSSL
+ newCtx = std::make_shared<OpenSSLTLSIOCtx>(*this);
+#else /* HAVE_LIBSSL */
+#ifdef HAVE_GNUTLS
+ newCtx = std::make_shared<GnuTLSIOCtx>(*this);
+#endif /* HAVE_GNUTLS */
+#endif /* HAVE_LIBSSL */
+
+ setupDoTProtocolNegotiation(newCtx);
+ std::atomic_store_explicit(&d_ctx, newCtx, std::memory_order_release);
+#endif /* HAVE_DNS_OVER_TLS */
+ return true;
+}
+
+std::shared_ptr<TLSCtx> getTLSContext(const TLSContextParameters& params)
+{
+#ifdef HAVE_DNS_OVER_TLS
+ /* get the "best" available provider */
+ if (!params.d_provider.empty()) {
+#ifdef HAVE_GNUTLS
+ if (params.d_provider == "gnutls") {
+ return std::make_shared<GnuTLSIOCtx>(params);
+ }
+#endif /* HAVE_GNUTLS */
+#ifdef HAVE_LIBSSL
+ if (params.d_provider == "openssl") {
+ return std::make_shared<OpenSSLTLSIOCtx>(params);
+ }
+#endif /* HAVE_LIBSSL */
+ }
+#ifdef HAVE_GNUTLS
+ return std::make_shared<GnuTLSIOCtx>(params);
+#else /* HAVE_GNUTLS */
+#ifdef HAVE_LIBSSL
+ return std::make_shared<OpenSSLTLSIOCtx>(params);
+#endif /* HAVE_LIBSSL */
+#endif /* HAVE_GNUTLS */
+
+#endif /* HAVE_DNS_OVER_TLS */
+ return nullptr;
+}
diff --git a/tcpiohandler.hh b/tcpiohandler.hh
new file mode 100644
index 0000000..5b23e00
--- /dev/null
+++ b/tcpiohandler.hh
@@ -0,0 +1,573 @@
+
+#pragma once
+#include <memory>
+/* needed for proper TCP_FASTOPEN_CONNECT detection */
+#include <netinet/tcp.h>
+
+#include "iputils.hh"
+#include "libssl.hh"
+#include "misc.hh"
+#include "noinitvector.hh"
+
+enum class IOState : uint8_t { Done, NeedRead, NeedWrite };
+
+class TLSSession
+{
+public:
+ virtual ~TLSSession()
+ {
+ }
+};
+
+class TLSConnection
+{
+public:
+ virtual ~TLSConnection() { }
+ virtual void doHandshake() = 0;
+ virtual IOState tryConnect(bool fastOpen, const ComboAddress& remote) = 0;
+ virtual void connect(bool fastOpen, const ComboAddress& remote, const struct timeval& timeout) = 0;
+ virtual IOState tryHandshake() = 0;
+ virtual size_t read(void* buffer, size_t bufferSize, const struct timeval& readTimeout, const struct timeval& totalTimeout={0,0}, bool allowIncomplete=false) = 0;
+ virtual size_t write(const void* buffer, size_t bufferSize, const struct timeval& writeTimeout) = 0;
+ virtual IOState tryWrite(const PacketBuffer& buffer, size_t& pos, size_t toWrite) = 0;
+ virtual IOState tryRead(PacketBuffer& buffer, size_t& pos, size_t toRead, bool allowIncomplete=false) = 0;
+ virtual bool hasBufferedData() const = 0;
+ virtual std::string getServerNameIndication() const = 0;
+ virtual std::vector<uint8_t> getNextProtocol() const = 0;
+ virtual LibsslTLSVersion getTLSVersion() const = 0;
+ virtual bool hasSessionBeenResumed() const = 0;
+ virtual std::vector<std::unique_ptr<TLSSession>> getSessions() = 0;
+ virtual void setSession(std::unique_ptr<TLSSession>& session) = 0;
+ virtual bool isUsable() const = 0;
+ virtual void close() = 0;
+
+ void setUnknownTicketKey()
+ {
+ d_unknownTicketKey = true;
+ }
+
+ bool getUnknownTicketKey() const
+ {
+ return d_unknownTicketKey;
+ }
+
+ void setResumedFromInactiveTicketKey()
+ {
+ d_resumedFromInactiveTicketKey = true;
+ }
+
+ bool getResumedFromInactiveTicketKey() const
+ {
+ return d_resumedFromInactiveTicketKey;
+ }
+
+protected:
+ int d_socket{-1};
+ bool d_unknownTicketKey{false};
+ bool d_resumedFromInactiveTicketKey{false};
+};
+
+class TLSCtx
+{
+public:
+ TLSCtx()
+ {
+ d_rotatingTicketsKey.clear();
+ }
+ virtual ~TLSCtx() {}
+ virtual std::unique_ptr<TLSConnection> getConnection(int socket, const struct timeval& timeout, time_t now) = 0;
+ virtual std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, int socket, const struct timeval& timeout) = 0;
+ virtual void rotateTicketsKey(time_t now) = 0;
+ virtual void loadTicketsKeys(const std::string& file)
+ {
+ throw std::runtime_error("This TLS backend does not have the capability to load a tickets key from a file");
+ }
+
+ void handleTicketsKeyRotation(time_t now)
+ {
+ if (d_ticketsKeyRotationDelay != 0 && now > d_ticketsKeyNextRotation) {
+ if (d_rotatingTicketsKey.test_and_set()) {
+ /* someone is already rotating */
+ return;
+ }
+ try {
+ rotateTicketsKey(now);
+ d_rotatingTicketsKey.clear();
+ }
+ catch(const std::runtime_error& e) {
+ d_rotatingTicketsKey.clear();
+ throw std::runtime_error(std::string("Error generating a new tickets key for TLS context:") + e.what());
+ }
+ catch(...) {
+ d_rotatingTicketsKey.clear();
+ throw;
+ }
+ }
+ }
+
+ time_t getNextTicketsKeyRotation() const
+ {
+ return d_ticketsKeyNextRotation;
+ }
+
+ virtual size_t getTicketsKeysCount() = 0;
+ virtual std::string getName() const = 0;
+
+ /* set the advertised ALPN protocols, in client or server context */
+ virtual bool setALPNProtos(const std::vector<std::vector<uint8_t>>& protos)
+ {
+ return false;
+ }
+
+ /* called in a client context, if the client advertised more than one ALPN values and the server returned more than one as well, to select the one to use. */
+ virtual bool setNextProtocolSelectCallback(bool(*)(unsigned char** out, unsigned char* outlen, const unsigned char* in, unsigned int inlen))
+ {
+ return false;
+ }
+
+protected:
+ std::atomic_flag d_rotatingTicketsKey;
+ std::atomic<time_t> d_ticketsKeyNextRotation{0};
+ time_t d_ticketsKeyRotationDelay{0};
+};
+
+class TLSFrontend
+{
+public:
+ TLSFrontend()
+ {
+ }
+
+ TLSFrontend(std::shared_ptr<TLSCtx> ctx): d_ctx(std::move(ctx))
+ {
+ }
+
+ bool setupTLS();
+
+ void rotateTicketsKey(time_t now)
+ {
+ if (d_ctx != nullptr) {
+ d_ctx->rotateTicketsKey(now);
+ }
+ }
+
+ void loadTicketsKeys(const std::string& file)
+ {
+ if (d_ctx != nullptr) {
+ d_ctx->loadTicketsKeys(file);
+ }
+ }
+
+ std::shared_ptr<TLSCtx> getContext()
+ {
+ return std::atomic_load_explicit(&d_ctx, std::memory_order_acquire);
+ }
+
+ void cleanup()
+ {
+ d_ctx.reset();
+ }
+
+ size_t getTicketsKeysCount()
+ {
+ if (d_ctx != nullptr) {
+ return d_ctx->getTicketsKeysCount();
+ }
+
+ return 0;
+ }
+
+ static std::string timeToString(time_t rotationTime)
+ {
+ char buf[20];
+ struct tm date_tm;
+
+ localtime_r(&rotationTime, &date_tm);
+ strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &date_tm);
+
+ return std::string(buf);
+ }
+
+ time_t getTicketsKeyRotationDelay() const
+ {
+ return d_tlsConfig.d_ticketsKeyRotationDelay;
+ }
+
+ std::string getNextTicketsKeyRotation() const
+ {
+ std::string res;
+
+ if (d_ctx != nullptr) {
+ res = timeToString(d_ctx->getNextTicketsKeyRotation());
+ }
+
+ return res;
+ }
+
+ std::string getRequestedProvider() const
+ {
+ return d_provider;
+ }
+
+ std::string getEffectiveProvider() const
+ {
+ if (d_ctx) {
+ return d_ctx->getName();
+ }
+ return "";
+ }
+
+ TLSConfig d_tlsConfig;
+ TLSErrorCounters d_tlsCounters;
+ ComboAddress d_addr;
+ std::string d_provider;
+
+protected:
+ std::shared_ptr<TLSCtx> d_ctx{nullptr};
+};
+
+class TCPIOHandler
+{
+public:
+ enum class Type : uint8_t { Client, Server };
+
+ TCPIOHandler(const std::string& host, int socket, const struct timeval& timeout, std::shared_ptr<TLSCtx> ctx, time_t now): d_socket(socket)
+ {
+ if (ctx) {
+ d_conn = ctx->getClientConnection(host, d_socket, timeout);
+ }
+ }
+
+ TCPIOHandler(int socket, const struct timeval& timeout, std::shared_ptr<TLSCtx> ctx, time_t now): d_socket(socket)
+ {
+ if (ctx) {
+ d_conn = ctx->getConnection(d_socket, timeout, now);
+ }
+ }
+
+ ~TCPIOHandler()
+ {
+ close();
+ }
+
+ void close()
+ {
+ if (d_conn) {
+ d_conn->close();
+ d_conn.reset();
+ }
+
+ if (d_socket != -1) {
+ shutdown(d_socket, SHUT_RDWR);
+ ::close(d_socket);
+ d_socket = -1;
+ }
+ }
+
+ int getDescriptor() const
+ {
+ return d_socket;
+ }
+
+ IOState tryConnect(bool fastOpen, const ComboAddress& remote)
+ {
+ d_remote = remote;
+
+#ifdef TCP_FASTOPEN_CONNECT /* Linux >= 4.11 */
+ if (fastOpen) {
+ int value = 1;
+ int res = setsockopt(d_socket, IPPROTO_TCP, TCP_FASTOPEN_CONNECT, &value, sizeof(value));
+ if (res == 0) {
+ fastOpen = false;
+ }
+ }
+#endif /* TCP_FASTOPEN_CONNECT */
+
+#ifdef MSG_FASTOPEN
+ if (!d_conn && fastOpen) {
+ d_fastOpen = true;
+ }
+ else {
+ if (!s_disableConnectForUnitTests) {
+ SConnectWithTimeout(d_socket, remote, /* no timeout, we will handle it ourselves */ timeval{0,0});
+ }
+ }
+#else
+ if (!s_disableConnectForUnitTests) {
+ SConnectWithTimeout(d_socket, remote, /* no timeout, we will handle it ourselves */ timeval{0,0});
+ }
+#endif /* MSG_FASTOPEN */
+
+ if (d_conn) {
+ return d_conn->tryConnect(fastOpen, remote);
+ }
+
+ return IOState::Done;
+ }
+
+ void connect(bool fastOpen, const ComboAddress& remote, const struct timeval& timeout)
+ {
+ d_remote = remote;
+
+#ifdef TCP_FASTOPEN_CONNECT /* Linux >= 4.11 */
+ if (fastOpen) {
+ int value = 1;
+ int res = setsockopt(d_socket, IPPROTO_TCP, TCP_FASTOPEN_CONNECT, &value, sizeof(value));
+ if (res == 0) {
+ fastOpen = false;
+ }
+ }
+#endif /* TCP_FASTOPEN_CONNECT */
+
+#ifdef MSG_FASTOPEN
+ if (!d_conn && fastOpen) {
+ d_fastOpen = true;
+ }
+ else {
+ if (!s_disableConnectForUnitTests) {
+ SConnectWithTimeout(d_socket, remote, timeout);
+ }
+ }
+#else
+ if (!s_disableConnectForUnitTests) {
+ SConnectWithTimeout(d_socket, remote, timeout);
+ }
+#endif /* MSG_FASTOPEN */
+
+ if (d_conn) {
+ d_conn->connect(fastOpen, remote, timeout);
+ }
+ }
+
+ IOState tryHandshake()
+ {
+ if (d_conn) {
+ return d_conn->tryHandshake();
+ }
+ return IOState::Done;
+ }
+
+ size_t read(void* buffer, size_t bufferSize, const struct timeval& readTimeout, const struct timeval& totalTimeout = {0,0}, bool allowIncomplete=false)
+ {
+ if (d_conn) {
+ return d_conn->read(buffer, bufferSize, readTimeout, totalTimeout, allowIncomplete);
+ } else {
+ return readn2WithTimeout(d_socket, buffer, bufferSize, readTimeout, totalTimeout, allowIncomplete);
+ }
+ }
+
+ /* Tries to read exactly toRead - pos bytes into the buffer, starting at position pos.
+ Updates pos everytime a successful read occurs,
+ throws an std::runtime_error in case of IO error,
+ return Done when toRead bytes have been read, needRead or needWrite if the IO operation
+ would block.
+ */
+ IOState tryRead(PacketBuffer& buffer, size_t& pos, size_t toRead, bool allowIncomplete=false)
+ {
+ if (buffer.size() < toRead || pos >= toRead) {
+ throw std::out_of_range("Calling tryRead() with a too small buffer (" + std::to_string(buffer.size()) + ") for a read of " + std::to_string(toRead - pos) + " bytes starting at " + std::to_string(pos));
+ }
+
+ if (d_conn) {
+ return d_conn->tryRead(buffer, pos, toRead, allowIncomplete);
+ }
+
+ do {
+ ssize_t res = ::read(d_socket, reinterpret_cast<char*>(&buffer.at(pos)), toRead - pos);
+ if (res == 0) {
+ throw runtime_error("EOF while reading message");
+ }
+ if (res < 0) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOTCONN) {
+ return IOState::NeedRead;
+ }
+ else {
+ throw std::runtime_error("Error while reading message: " + stringerror());
+ }
+ }
+
+ pos += static_cast<size_t>(res);
+ if (allowIncomplete) {
+ break;
+ }
+ }
+ while (pos < toRead);
+
+ return IOState::Done;
+ }
+
+ /* Tries to write exactly toWrite - pos bytes from the buffer, starting at position pos.
+ Updates pos everytime a successful write occurs,
+ throws an std::runtime_error in case of IO error,
+ return Done when toWrite bytes have been written, needRead or needWrite if the IO operation
+ would block.
+ */
+ IOState tryWrite(const PacketBuffer& buffer, size_t& pos, size_t toWrite)
+ {
+ if (buffer.size() < toWrite || pos >= toWrite) {
+ throw std::out_of_range("Calling tryWrite() with a too small buffer (" + std::to_string(buffer.size()) + ") for a write of " + std::to_string(toWrite - pos) + " bytes starting at " + std::to_string(pos));
+ }
+ if (d_conn) {
+ return d_conn->tryWrite(buffer, pos, toWrite);
+ }
+
+#ifdef MSG_FASTOPEN
+ if (d_fastOpen) {
+ int socketFlags = MSG_FASTOPEN;
+ size_t sent = sendMsgWithOptions(d_socket, reinterpret_cast<const char *>(&buffer.at(pos)), toWrite - pos, &d_remote, nullptr, 0, socketFlags);
+ if (sent > 0) {
+ d_fastOpen = false;
+ pos += sent;
+ }
+
+ if (pos < toWrite) {
+ return IOState::NeedWrite;
+ }
+
+ return IOState::Done;
+ }
+#endif /* MSG_FASTOPEN */
+
+ do {
+ ssize_t res = ::write(d_socket, reinterpret_cast<const char*>(&buffer.at(pos)), toWrite - pos);
+
+ if (res == 0) {
+ throw runtime_error("EOF while sending message");
+ }
+ if (res < 0) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK || errno == ENOTCONN) {
+ return IOState::NeedWrite;
+ }
+ else {
+ throw std::runtime_error("Error while writing message: " + stringerror());
+ }
+ }
+
+ pos += static_cast<size_t>(res);
+ }
+ while (pos < toWrite);
+
+ return IOState::Done;
+ }
+
+ size_t write(const void* buffer, size_t bufferSize, const struct timeval& writeTimeout)
+ {
+ if (d_conn) {
+ return d_conn->write(buffer, bufferSize, writeTimeout);
+ }
+
+#ifdef MSG_FASTOPEN
+ if (d_fastOpen) {
+ int socketFlags = MSG_FASTOPEN;
+ size_t sent = sendMsgWithOptions(d_socket, reinterpret_cast<const char *>(buffer), bufferSize, &d_remote, nullptr, 0, socketFlags);
+ if (sent > 0) {
+ d_fastOpen = false;
+ }
+
+ return sent;
+ }
+#endif /* MSG_FASTOPEN */
+
+ return writen2WithTimeout(d_socket, buffer, bufferSize, writeTimeout);
+ }
+
+ bool hasBufferedData() const
+ {
+ if (d_conn) {
+ return d_conn->hasBufferedData();
+ }
+ return false;
+ }
+
+ std::string getServerNameIndication() const
+ {
+ if (d_conn) {
+ return d_conn->getServerNameIndication();
+ }
+ return std::string();
+ }
+
+ std::vector<uint8_t> getNextProtocol() const
+ {
+ if (d_conn) {
+ return d_conn->getNextProtocol();
+ }
+ return std::vector<uint8_t>();
+ }
+
+ LibsslTLSVersion getTLSVersion() const
+ {
+ if (d_conn) {
+ return d_conn->getTLSVersion();
+ }
+ return LibsslTLSVersion::Unknown;
+ }
+
+ bool isTLS() const
+ {
+ return d_conn != nullptr;
+ }
+
+ bool hasTLSSessionBeenResumed() const
+ {
+ return d_conn && d_conn->hasSessionBeenResumed();
+ }
+
+ bool getResumedFromInactiveTicketKey() const
+ {
+ return d_conn && d_conn->getResumedFromInactiveTicketKey();
+ }
+
+ bool getUnknownTicketKey() const
+ {
+ return d_conn && d_conn->getUnknownTicketKey();
+ }
+
+ void setTLSSession(std::unique_ptr<TLSSession>& session)
+ {
+ if (d_conn != nullptr) {
+ d_conn->setSession(session);
+ }
+ }
+
+ std::vector<std::unique_ptr<TLSSession>> getTLSSessions()
+ {
+ if (!d_conn) {
+ throw std::runtime_error("Trying to get TLS sessions from a non-TLS handler");
+ }
+
+ return d_conn->getSessions();
+ }
+
+ bool isUsable() const
+ {
+ if (!d_conn) {
+ return isTCPSocketUsable(d_socket);
+ }
+ return d_conn->isUsable();
+ }
+
+ const static bool s_disableConnectForUnitTests;
+
+private:
+ std::unique_ptr<TLSConnection> d_conn{nullptr};
+ ComboAddress d_remote;
+ int d_socket{-1};
+#ifdef MSG_FASTOPEN
+ bool d_fastOpen{false};
+#endif
+};
+
+struct TLSContextParameters
+{
+ std::string d_provider;
+ std::string d_ciphers;
+ std::string d_ciphers13;
+ std::string d_caStore;
+ bool d_validateCertificates{true};
+ bool d_releaseBuffers{true};
+ bool d_enableRenegotiation{false};
+};
+
+std::shared_ptr<TLSCtx> getTLSContext(const TLSContextParameters& params);
+bool setupDoTProtocolNegotiation(std::shared_ptr<TLSCtx>& ctx);
diff --git a/test-base64_cc.cc b/test-base64_cc.cc
new file mode 100644
index 0000000..2f694b1
--- /dev/null
+++ b/test-base64_cc.cc
@@ -0,0 +1,77 @@
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <boost/test/unit_test.hpp>
+#include <boost/assign/std/map.hpp>
+
+#include "base64.hh"
+
+using namespace boost;
+
+BOOST_AUTO_TEST_SUITE(test_base64_cc)
+
+BOOST_AUTO_TEST_CASE(test_Base64_Roundtrip) {
+ std::string before("Some Random String"), after;
+ std::string encoded = Base64Encode(before);
+ B64Decode(encoded, after);
+ BOOST_CHECK_EQUAL(before, after);
+}
+
+/* for a in $(seq 1 32);
+ do
+ plain=$(pwgen -1 -s $a)
+ echo \(\"$plain\",\"$(echo -n $plain | openssl enc -base64)\"\) ;
+ done
+*/
+
+BOOST_AUTO_TEST_CASE(test_Base64_Encode) {
+ typedef std::map<std::string, std::string> cases_t;
+ cases_t cases;
+ assign::insert(cases)
+ ("", "")
+ ("z","eg==")
+ ("x4","eDQ=")
+ ("J07","SjA3")
+ ("kl8F","a2w4Rg==")
+ ("2NUx9","Mk5VeDk=")
+ ("hwXQ8C","aHdYUThD")
+ ("V7ZHmlG","VjdaSG1sRw==")
+ ("FuNFLSd5","RnVORkxTZDU=")
+ ("YVGwy3Vbi","WVZHd3kzVmJp")
+ ("6ueW4V3oLG","NnVlVzRWM29MRw==")
+ ("d5zR7AWIBIQ","ZDV6UjdBV0lCSVE=")
+ ("WJjZ6xgpRMCD","V0pqWjZ4Z3BSTUNE")
+ ("e8I52L0vC9Kfq","ZThJNTJMMHZDOUtmcQ==")
+ ("ufxMi8EZgTDja8","dWZ4TWk4RVpnVERqYTg=")
+ ("MiNPxzxUkNXCFg1","TWlOUHh6eFVrTlhDRmcx")
+ ("abqIPosEky85gFVM","YWJxSVBvc0VreTg1Z0ZWTQ==")
+ ("Qccuox8igoyRKEeTo","UWNjdW94OGlnb3lSS0VlVG8=")
+ ("wbaw6g6WWo4iiYXosV","d2JhdzZnNldXbzRpaVlYb3NW")
+ ("ZIfJZIA3Kd0a6iIr0vc","WklmSlpJQTNLZDBhNmlJcjB2Yw==")
+ ("SUhE1RK7xrRfvYOiaPMQ","U1VoRTFSSzd4clJmdllPaWFQTVE=")
+ ("ZAWsEeB4bcTUzTr828VTd","WkFXc0VlQjRiY1RVelRyODI4VlRk")
+ ("xc9rpu0F5ztR7r3jElr2BS","eGM5cnB1MEY1enRSN3IzakVscjJCUw==")
+ ("xvEWPkZjqVjIZwsL5WhijES","eHZFV1BrWmpxVmpJWndzTDVXaGlqRVM=")
+ ("yy4yAmcBKCNF3hWriWbDnKmF","eXk0eUFtY0JLQ05GM2hXcmlXYkRuS21G")
+ ("9wKEMpl8OlFvnD10wwhoK7BjY","OXdLRU1wbDhPbEZ2bkQxMHd3aG9LN0JqWQ==")
+ ("SB6yLm39pDVIUiQ5g73BvyRzBs","U0I2eUxtMzlwRFZJVWlRNWc3M0J2eVJ6QnM=")
+ ("Acu4kk1puF98lIzd1b9bt8ha7Er","QWN1NGtrMXB1Rjk4bEl6ZDFiOWJ0OGhhN0Vy")
+ ("P4X6efItE6cn03ksLTvniqMQlel3","UDRYNmVmSXRFNmNuMDNrc0xUdm5pcU1RbGVsMw==")
+ ("RnQSvhIOz3ywuHCoSotJGKjBdCVbx","Um5RU3ZoSU96M3l3dUhDb1NvdEpHS2pCZENWYng=")
+ ("ykybXtN0lelsLSzyzd4DTP3sYp8YGu","eWt5Ylh0TjBsZWxzTFN6eXpkNERUUDNzWXA4WUd1")
+ ("eSHBt7Xx5F7A4HFtabXEzDLD01bnSiG","ZVNIQnQ3WHg1RjdBNEhGdGFiWEV6RExEMDFiblNpRw==")
+ ("dq4KydZjmcoQQ45VYBP2EDR8FqKaMul0","ZHE0S3lkWmptY29RUTQ1VllCUDJFRFI4RnFLYU11bDA=");
+
+ for(const cases_t::value_type& val : cases) {
+ std::string encoded = Base64Encode(val.first), decoded;
+ BOOST_CHECK_EQUAL(encoded, val.second);
+ decoded.clear();
+ B64Decode(val.second, decoded);
+ BOOST_CHECK_EQUAL(decoded, val.first);
+ }
+}
+
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-connectionmanagement_hh.cc b/test-connectionmanagement_hh.cc
new file mode 100644
index 0000000..34432f2
--- /dev/null
+++ b/test-connectionmanagement_hh.cc
@@ -0,0 +1,93 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "connection-management.hh"
+
+BOOST_AUTO_TEST_SUITE(connectionmanagement_hh)
+
+BOOST_AUTO_TEST_CASE(test_ConnectionManagementEnabled) {
+ size_t maxConns = 10;
+
+ ConcurrentConnectionManager manager(maxConns);
+
+ for (size_t idx = 0; idx < maxConns; idx++) {
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+ }
+
+ /* we are full */
+ BOOST_CHECK_EQUAL(manager.registerConnection(), false);
+
+ manager.releaseConnection();
+ /* we can register one additional connection now that we released one */
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+ /* but not two */
+ BOOST_CHECK_EQUAL(manager.registerConnection(), false);
+
+ /* raise the number of slots */
+ maxConns = 12;
+ manager.setMaxConcurrentConnections(maxConns);
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+ BOOST_CHECK_EQUAL(manager.registerConnection(), false);
+
+ /* release everything */
+ for (size_t idx = 0; idx < maxConns; idx++) {
+ manager.releaseConnection();
+ }
+
+ /* decrease the number of slots */
+ maxConns = 2;
+ manager.setMaxConcurrentConnections(maxConns);
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+ BOOST_CHECK_EQUAL(manager.registerConnection(), false);
+
+ /* decrease the number of slots with some connections still registered */
+ maxConns = 1;
+ manager.setMaxConcurrentConnections(maxConns);
+
+ BOOST_CHECK_EQUAL(manager.registerConnection(), false);
+ for (size_t idx = 0; idx < 2; idx++) {
+ manager.releaseConnection();
+ }
+
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+ BOOST_CHECK_EQUAL(manager.registerConnection(), false);
+}
+
+BOOST_AUTO_TEST_CASE(test_ConnectionManagementDisabledThenEnabled) {
+ /* 0 means no limit */
+ size_t maxConns = 0;
+ ConcurrentConnectionManager manager(maxConns);
+
+ for (size_t idx = 0; idx < 10; idx++) {
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+ }
+
+ /* set a limit to 5 connections */
+ maxConns = 5;
+ manager.setMaxConcurrentConnections(maxConns);
+ /* we can no longer register new sessions */
+ BOOST_CHECK_EQUAL(manager.registerConnection(), false);
+
+ /* release all of them */
+ for (size_t idx = 0; idx < 10; idx++) {
+ manager.releaseConnection();
+ }
+
+ /* register as many as we now can */
+ for (size_t idx = 0; idx < maxConns; idx++) {
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+ }
+
+ BOOST_CHECK_EQUAL(manager.registerConnection(), false);
+
+ manager.releaseConnection();
+
+ BOOST_CHECK_EQUAL(manager.registerConnection(), true);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-credentials_cc.cc b/test-credentials_cc.cc
new file mode 100644
index 0000000..89bd6e4
--- /dev/null
+++ b/test-credentials_cc.cc
@@ -0,0 +1,117 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/algorithm/string.hpp>
+#include <boost/test/unit_test.hpp>
+
+#include "config.h"
+#include "credentials.hh"
+
+BOOST_AUTO_TEST_SUITE(credentials_cc)
+
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+BOOST_AUTO_TEST_CASE(test_CredentialsUtils)
+{
+ const std::string plaintext("test");
+ /* generated with hashPassword("test") */
+ const std::string sampleHash("$scrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI=");
+
+ auto hashed = hashPassword(plaintext);
+ BOOST_CHECK(!hashed.empty());
+
+ BOOST_CHECK(verifyPassword(hashed, plaintext));
+ BOOST_CHECK(verifyPassword(sampleHash, plaintext));
+
+ BOOST_CHECK(!verifyPassword(hashed, "not test"));
+ BOOST_CHECK(!verifyPassword(sampleHash, "not test"));
+
+ BOOST_CHECK(isPasswordHashed(hashed));
+ BOOST_CHECK(isPasswordHashed(sampleHash));
+ BOOST_CHECK(!isPasswordHashed(plaintext));
+
+ {
+ // hash password with custom parameters
+ auto customParams = hashPassword(plaintext, 512, 2, 16);
+ // check that the output is OK
+ BOOST_CHECK(boost::starts_with(customParams, "$scrypt$ln=9,p=2,r=16$"));
+ // check that we can verify the password
+ BOOST_CHECK(verifyPassword(customParams, plaintext));
+ }
+
+ // empty
+ BOOST_CHECK(!isPasswordHashed(""));
+ // missing leading $
+ BOOST_CHECK(!isPasswordHashed("scrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI="));
+ // unknown algo
+ BOOST_CHECK(!isPasswordHashed("$tcrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI="));
+ // missing parameters
+ BOOST_CHECK(!isPasswordHashed("$scrypt$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI="));
+ // empty parameters
+ BOOST_CHECK(!isPasswordHashed("$scrypt$$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI="));
+ // missing r
+ BOOST_CHECK(!isPasswordHashed("$scrypt$ln=10,p=1$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI="));
+ // salt is too short
+ BOOST_CHECK(!isPasswordHashed("$scrypt$ln=10,p=1,r=8$dGVzdA==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI="));
+ // hash is too short
+ BOOST_CHECK(!isPasswordHashed("$scrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$c2hvcnQ="));
+ // missing salt
+ BOOST_CHECK(!isPasswordHashed("$scrypt$ln=10,p=1,r=8$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI="));
+ // missing $ between the salt and hash
+ BOOST_CHECK(!isPasswordHashed("$scrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI="));
+ // no hash
+ BOOST_CHECK(!isPasswordHashed("$scrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$"));
+ // hash is too long
+ BOOST_CHECK(!isPasswordHashed("$scrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$dGhpcyBpcyBhIHZlcnkgbG9uZyBoYXNoLCBtdWNoIG11Y2ggbG9uZ2VyIHRoYW4gdGhlIG9uZXMgd2UgYXJlIGdlbmVyYXRpbmc="));
+
+ // empty r
+ BOOST_CHECK_THROW(verifyPassword("$scrypt$ln=10,p=1,r=$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI=", plaintext), std::runtime_error);
+ // too many parameters
+ BOOST_CHECK_THROW(verifyPassword("$scrypt$ln=10,p=1,r=8,t=1$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI=", plaintext), std::runtime_error);
+ // invalid ln
+ BOOST_CHECK_THROW(verifyPassword("$scrypt$ln=A,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI=", plaintext), std::runtime_error);
+ // invalid p
+ BOOST_CHECK_THROW(verifyPassword("$scrypt$ln=10,p=p,r=8$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI=", plaintext), std::runtime_error);
+ // work factor is too large
+ BOOST_CHECK_THROW(verifyPassword("$scrypt$ln=16,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI=", plaintext), std::runtime_error);
+ // salt is too long
+ BOOST_CHECK_THROW(verifyPassword("$scrypt$ln=10,p=1,r=8$dGhpcyBpcyBhIHZlcnkgbG9uZyBzYWx0$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI=", plaintext), std::runtime_error);
+ // invalid b64 salt
+ BOOST_CHECK_THROW(verifyPassword("$scrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI=", plaintext), std::runtime_error);
+ // invalid b64 hash
+ BOOST_CHECK_THROW(verifyPassword("$scrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJd", plaintext), std::runtime_error);
+}
+#endif
+
+BOOST_AUTO_TEST_CASE(test_CredentialsHolder)
+{
+ const std::string plaintext("test");
+
+ auto holder = CredentialsHolder(std::string(plaintext), false);
+
+ BOOST_CHECK(holder.matches(plaintext));
+ BOOST_CHECK(!holder.matches("not test"));
+ BOOST_CHECK(!holder.wasHashed());
+ BOOST_CHECK(!holder.isHashed());
+
+#ifdef HAVE_EVP_PKEY_CTX_SET1_SCRYPT_SALT
+ BOOST_CHECK(CredentialsHolder::isHashingAvailable());
+ const std::string sampleHash("$scrypt$ln=10,p=1,r=8$1GZ10YdmSGtTmKK9jTH85Q==$JHeICW1mUCnTC+nnULDr7QFQ3kRrZ7u12djruJdrPhI=");
+
+ auto fromHashedHolder = CredentialsHolder(std::string(sampleHash), true);
+ BOOST_CHECK(fromHashedHolder.wasHashed());
+ BOOST_CHECK(fromHashedHolder.isHashed());
+ BOOST_CHECK(fromHashedHolder.matches(plaintext));
+ BOOST_CHECK(!fromHashedHolder.matches("not test"));
+
+ auto fromPlaintextHolder = CredentialsHolder(std::string(plaintext), true);
+ BOOST_CHECK(!fromPlaintextHolder.wasHashed());
+ BOOST_CHECK(fromPlaintextHolder.isHashed());
+ BOOST_CHECK(fromPlaintextHolder.matches(plaintext));
+ BOOST_CHECK(!fromPlaintextHolder.matches("not test"));
+#else
+ BOOST_CHECK(!CredentialsHolder::isHashingAvailable());
+#endif
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-delaypipe_hh.cc b/test-delaypipe_hh.cc
new file mode 100644
index 0000000..9e678ee
--- /dev/null
+++ b/test-delaypipe_hh.cc
@@ -0,0 +1,80 @@
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <boost/test/unit_test.hpp>
+#include "delaypipe.hh"
+
+BOOST_AUTO_TEST_SUITE(test_delaypipe_hh);
+
+BOOST_AUTO_TEST_CASE(test_object_pipe) {
+ ObjectPipe<int> op;
+ for(int n=0; n < 100; ++n)
+ op.write(n);
+
+ int i;
+ for(int n=0; n < 100; ++n) {
+ int res=op.readTimeout(&i, -1);
+ BOOST_CHECK_EQUAL(res, 1);
+ BOOST_CHECK_EQUAL(n, i);
+ }
+
+ op.close();
+ BOOST_CHECK_EQUAL(op.readTimeout(&i, 1), 0);
+
+};
+
+std::atomic<int> done = 0;
+BOOST_AUTO_TEST_CASE(test_delay_pipe_small) {
+ done = 0;
+ struct Work
+ {
+ int i;
+ void operator()()
+ {
+ ++done;
+ }
+ };
+ DelayPipe<Work> dp;
+ int n;
+ for(n=0; n < 5; ++n) {
+ Work w{n};
+ dp.submit(w, 500);
+ }
+ BOOST_CHECK_EQUAL(done, 0);
+
+ for(; n < 10; ++n) {
+ Work w{n};
+ dp.submit(w, 1200);
+ }
+ sleep(1);
+ BOOST_CHECK_EQUAL(done, 5);
+ sleep(1);
+ BOOST_CHECK_EQUAL(done, n);
+
+};
+
+BOOST_AUTO_TEST_CASE(test_delay_pipe_big) {
+ done=0;
+ struct Work
+ {
+ int i;
+ void operator()()
+ {
+ ++done;
+ }
+ };
+ DelayPipe<Work> dp;
+ int n;
+ for(n=0; n < 1000000; ++n) {
+ Work w{n};
+ dp.submit(w, 100);
+ }
+
+ sleep(1);
+ BOOST_CHECK_EQUAL(done, n);
+};
+
+
+BOOST_AUTO_TEST_SUITE_END();
diff --git a/test-dnscrypt_cc.cc b/test-dnscrypt_cc.cc
new file mode 100644
index 0000000..8d834ca
--- /dev/null
+++ b/test-dnscrypt_cc.cc
@@ -0,0 +1,298 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "dnscrypt.hh"
+#include "dnsname.hh"
+#include "dnsparser.hh"
+#include "dnswriter.hh"
+#include <unistd.h>
+
+bool g_verbose{false};
+bool g_syslog{true};
+
+BOOST_AUTO_TEST_SUITE(test_dnscrypt_cc)
+
+#ifdef HAVE_DNSCRYPT
+
+// plaintext query for cert
+BOOST_AUTO_TEST_CASE(DNSCryptPlaintextQuery) {
+ DNSCryptPrivateKey resolverPrivateKey;
+ DNSCryptCert resolverCert;
+ unsigned char providerPublicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+ unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE];
+ time_t now = time(nullptr);
+ DNSCryptContext::generateProviderKeys(providerPublicKey, providerPrivateKey);
+ DNSCryptContext::generateCertificate(1, now, now + (24 * 60 * 3600), DNSCryptExchangeVersion::VERSION1, providerPrivateKey, resolverPrivateKey, resolverCert);
+ auto ctx = std::make_shared<DNSCryptContext>("2.name", resolverCert, resolverPrivateKey);
+
+ DNSName name("2.name.");
+ PacketBuffer plainQuery;
+ GenericDNSPacketWriter<PacketBuffer> pw(plainQuery, name, QType::TXT, QClass::IN, 0);
+ pw.getHeader()->rd = 0;
+
+ std::shared_ptr<DNSCryptQuery> query = std::make_shared<DNSCryptQuery>(ctx);
+ query->parsePacket(plainQuery, false, now);
+
+ BOOST_CHECK_EQUAL(query->isValid(), true);
+ BOOST_CHECK_EQUAL(query->isEncrypted(), false);
+
+ PacketBuffer response;
+
+ query->getCertificateResponse(now, response);
+
+ MOADNSParser mdp(false, (char*) response.data(), response.size());
+
+ BOOST_CHECK_EQUAL(mdp.d_header.qdcount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.ancount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.nscount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.arcount, 0U);
+
+ BOOST_CHECK_EQUAL(mdp.d_qname.toString(), "2.name.");
+ BOOST_CHECK(mdp.d_qclass == QClass::IN);
+ BOOST_CHECK(mdp.d_qtype == QType::TXT);
+}
+
+// invalid plaintext query (A)
+BOOST_AUTO_TEST_CASE(DNSCryptPlaintextQueryInvalidA) {
+ DNSCryptPrivateKey resolverPrivateKey;
+ DNSCryptCert resolverCert;
+ unsigned char providerPublicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+ unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE];
+ time_t now = time(nullptr);
+ DNSCryptContext::generateProviderKeys(providerPublicKey, providerPrivateKey);
+ DNSCryptContext::generateCertificate(1, now, now + (24 * 60 * 3600), DNSCryptExchangeVersion::VERSION1, providerPrivateKey, resolverPrivateKey, resolverCert);
+ auto ctx = std::make_shared<DNSCryptContext>("2.name", resolverCert, resolverPrivateKey);
+
+ DNSName name("2.name.");
+
+ PacketBuffer plainQuery;
+ GenericDNSPacketWriter<PacketBuffer> pw(plainQuery, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 0;
+
+ std::shared_ptr<DNSCryptQuery> query = std::make_shared<DNSCryptQuery>(ctx);
+ query->parsePacket(plainQuery, false, now);
+
+ BOOST_CHECK_EQUAL(query->isValid(), false);
+}
+
+// invalid plaintext query (wrong provider name)
+BOOST_AUTO_TEST_CASE(DNSCryptPlaintextQueryInvalidProviderName) {
+ DNSCryptPrivateKey resolverPrivateKey;
+ DNSCryptCert resolverCert;
+ unsigned char providerPublicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+ unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE];
+ time_t now = time(nullptr);
+ DNSCryptContext::generateProviderKeys(providerPublicKey, providerPrivateKey);
+ DNSCryptContext::generateCertificate(1, now, now + (24 * 60 * 3600), DNSCryptExchangeVersion::VERSION1, providerPrivateKey, resolverPrivateKey, resolverCert);
+ auto ctx = std::make_shared<DNSCryptContext>("2.name", resolverCert, resolverPrivateKey);
+
+ DNSName name("2.WRONG.name.");
+
+ PacketBuffer plainQuery;
+ GenericDNSPacketWriter<PacketBuffer> pw(plainQuery, name, QType::TXT, QClass::IN, 0);
+ pw.getHeader()->rd = 0;
+
+ std::shared_ptr<DNSCryptQuery> query = std::make_shared<DNSCryptQuery>(ctx);
+ query->parsePacket(plainQuery, false, now);
+
+ BOOST_CHECK_EQUAL(query->isValid(), false);
+}
+
+// valid encrypted query
+BOOST_AUTO_TEST_CASE(DNSCryptEncryptedQueryValid) {
+ DNSCryptPrivateKey resolverPrivateKey;
+ DNSCryptCert resolverCert;
+ unsigned char providerPublicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+ unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE];
+ time_t now = time(nullptr);
+ DNSCryptContext::generateProviderKeys(providerPublicKey, providerPrivateKey);
+ DNSCryptContext::generateCertificate(1, now, now + (24 * 60 * 3600), DNSCryptExchangeVersion::VERSION1, providerPrivateKey, resolverPrivateKey, resolverCert);
+ auto ctx = std::make_shared<DNSCryptContext>("2.name", resolverCert, resolverPrivateKey);
+
+ DNSCryptPrivateKey clientPrivateKey;
+ unsigned char clientPublicKey[DNSCRYPT_PUBLIC_KEY_SIZE];
+
+ DNSCryptContext::generateResolverKeyPair(clientPrivateKey, clientPublicKey);
+
+ unsigned char clientNonce[DNSCRYPT_NONCE_SIZE / 2] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A, 0x0B };
+
+ DNSName name("www.powerdns.com.");
+ PacketBuffer plainQuery;
+ GenericDNSPacketWriter<PacketBuffer> pw(plainQuery, name, QType::AAAA, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+
+ size_t initialSize = plainQuery.size();
+ int res = ctx->encryptQuery(plainQuery, 4096, clientPublicKey, clientPrivateKey, clientNonce, false, std::make_shared<DNSCryptCert>(resolverCert));
+
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK(plainQuery.size() > initialSize);
+
+ std::shared_ptr<DNSCryptQuery> query = std::make_shared<DNSCryptQuery>(ctx);
+
+ query->parsePacket(plainQuery, false, now);
+
+ BOOST_CHECK_EQUAL(query->isValid(), true);
+ BOOST_CHECK_EQUAL(query->isEncrypted(), true);
+
+ MOADNSParser mdp(true, (char*) plainQuery.data(), plainQuery.size());
+
+ BOOST_CHECK_EQUAL(mdp.d_header.qdcount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.ancount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.nscount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.arcount, 0U);
+
+ BOOST_CHECK_EQUAL(mdp.d_qname, name);
+ BOOST_CHECK(mdp.d_qclass == QClass::IN);
+ BOOST_CHECK(mdp.d_qtype == QType::AAAA);
+}
+
+// valid encrypted query with not enough room
+BOOST_AUTO_TEST_CASE(DNSCryptEncryptedQueryValidButShort) {
+ DNSCryptPrivateKey resolverPrivateKey;
+ DNSCryptCert resolverCert;
+ unsigned char providerPublicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+ unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE];
+ time_t now = time(nullptr);
+ DNSCryptContext::generateProviderKeys(providerPublicKey, providerPrivateKey);
+ DNSCryptContext::generateCertificate(1, now, now + (24 * 60 * 3600), DNSCryptExchangeVersion::VERSION1, providerPrivateKey, resolverPrivateKey, resolverCert);
+ auto ctx = std::make_shared<DNSCryptContext>("2.name", resolverCert, resolverPrivateKey);
+
+ DNSCryptPrivateKey clientPrivateKey;
+ unsigned char clientPublicKey[DNSCRYPT_PUBLIC_KEY_SIZE];
+
+ DNSCryptContext::generateResolverKeyPair(clientPrivateKey, clientPublicKey);
+
+ unsigned char clientNonce[DNSCRYPT_NONCE_SIZE / 2] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A, 0x0B };
+
+ DNSName name("www.powerdns.com.");
+ PacketBuffer plainQuery;
+ GenericDNSPacketWriter<PacketBuffer> pw(plainQuery, name, QType::AAAA, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+
+ int res = ctx->encryptQuery(plainQuery, /* not enough room */ plainQuery.size(), clientPublicKey, clientPrivateKey, clientNonce, false, std::make_shared<DNSCryptCert>(resolverCert));
+ BOOST_CHECK_EQUAL(res, ENOBUFS);
+}
+
+// valid encrypted query with old key
+BOOST_AUTO_TEST_CASE(DNSCryptEncryptedQueryValidWithOldKey) {
+ DNSCryptPrivateKey resolverPrivateKey;
+ DNSCryptCert resolverCert;
+ unsigned char providerPublicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+ unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE];
+ time_t now = time(nullptr);
+ DNSCryptContext::generateProviderKeys(providerPublicKey, providerPrivateKey);
+ DNSCryptContext::generateCertificate(1, now, now + (24 * 60 * 3600), DNSCryptExchangeVersion::VERSION1, providerPrivateKey, resolverPrivateKey, resolverCert);
+ auto ctx = std::make_shared<DNSCryptContext>("2.name", resolverCert, resolverPrivateKey);
+
+ DNSCryptPrivateKey clientPrivateKey;
+ unsigned char clientPublicKey[DNSCRYPT_PUBLIC_KEY_SIZE];
+
+ DNSCryptContext::generateResolverKeyPair(clientPrivateKey, clientPublicKey);
+
+ unsigned char clientNonce[DNSCRYPT_NONCE_SIZE / 2] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A, 0x0B };
+
+ DNSName name("www.powerdns.com.");
+ PacketBuffer plainQuery;
+ GenericDNSPacketWriter<PacketBuffer> pw(plainQuery, name, QType::AAAA, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+
+ size_t initialSize = plainQuery.size();
+ int res = ctx->encryptQuery(plainQuery, 4096, clientPublicKey, clientPrivateKey, clientNonce, false, std::make_shared<DNSCryptCert>(resolverCert));
+
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK(plainQuery.size() > initialSize);
+
+ DNSCryptCert newResolverCert;
+ DNSCryptContext::generateCertificate(2, now, now + (24 * 60 * 3600), DNSCryptExchangeVersion::VERSION1, providerPrivateKey, resolverPrivateKey, newResolverCert);
+ ctx->addNewCertificate(newResolverCert, resolverPrivateKey);
+ ctx->markInactive(resolverCert.getSerial());
+
+ std::shared_ptr<DNSCryptQuery> query = std::make_shared<DNSCryptQuery>(ctx);
+
+ query->parsePacket(plainQuery, false, now);
+
+ BOOST_CHECK_EQUAL(query->isValid(), true);
+ BOOST_CHECK_EQUAL(query->isEncrypted(), true);
+
+ MOADNSParser mdp(true, (char*) plainQuery.data(), plainQuery.size());
+
+ BOOST_CHECK_EQUAL(mdp.d_header.qdcount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.ancount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.nscount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.arcount, 0U);
+
+ BOOST_CHECK_EQUAL(mdp.d_qname, name);
+ BOOST_CHECK(mdp.d_qclass == QClass::IN);
+ BOOST_CHECK(mdp.d_qtype == QType::AAAA);
+}
+
+// valid encrypted query with wrong key
+BOOST_AUTO_TEST_CASE(DNSCryptEncryptedQueryInvalidWithWrongKey) {
+ DNSCryptPrivateKey resolverPrivateKey;
+ DNSCryptCert resolverCert;
+ unsigned char providerPublicKey[DNSCRYPT_PROVIDER_PUBLIC_KEY_SIZE];
+ unsigned char providerPrivateKey[DNSCRYPT_PROVIDER_PRIVATE_KEY_SIZE];
+ time_t now = time(nullptr);
+ DNSCryptContext::generateProviderKeys(providerPublicKey, providerPrivateKey);
+ DNSCryptContext::generateCertificate(1, now, now + (24 * 60 * 3600), DNSCryptExchangeVersion::VERSION1, providerPrivateKey, resolverPrivateKey, resolverCert);
+ auto ctx = std::make_shared<DNSCryptContext>("2.name", resolverCert, resolverPrivateKey);
+
+ DNSCryptPrivateKey clientPrivateKey;
+ unsigned char clientPublicKey[DNSCRYPT_PUBLIC_KEY_SIZE];
+
+ DNSCryptContext::generateResolverKeyPair(clientPrivateKey, clientPublicKey);
+
+ unsigned char clientNonce[DNSCRYPT_NONCE_SIZE / 2] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A, 0x0B };
+
+ DNSName name("www.powerdns.com.");
+ PacketBuffer plainQuery;
+ GenericDNSPacketWriter<PacketBuffer> pw(plainQuery, name, QType::AAAA, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+
+ size_t initialSize = plainQuery.size();
+ int res = ctx->encryptQuery(plainQuery, 4096, clientPublicKey, clientPrivateKey, clientNonce, false, std::make_shared<DNSCryptCert>(resolverCert));
+
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK(plainQuery.size() > initialSize);
+
+ DNSCryptCert newResolverCert;
+ DNSCryptContext::generateCertificate(2, now, now + (24 * 60 * 3600), DNSCryptExchangeVersion::VERSION1, providerPrivateKey, resolverPrivateKey, newResolverCert);
+ ctx->addNewCertificate(newResolverCert, resolverPrivateKey);
+ ctx->markInactive(resolverCert.getSerial());
+ ctx->removeInactiveCertificate(resolverCert.getSerial());
+
+ /* we have removed the old certificate, we can't decrypt this query */
+
+ std::shared_ptr<DNSCryptQuery> query = std::make_shared<DNSCryptQuery>(ctx);
+
+ query->parsePacket(plainQuery, false, now);
+
+ BOOST_CHECK_EQUAL(query->isValid(), false);
+}
+
+#endif
+
+BOOST_AUTO_TEST_SUITE_END();
diff --git a/test-dnsdist-connections-cache.cc b/test-dnsdist-connections-cache.cc
new file mode 100644
index 0000000..a59163b
--- /dev/null
+++ b/test-dnsdist-connections-cache.cc
@@ -0,0 +1,234 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "dnsdist-tcp-downstream.hh"
+
+class MockupConnection
+{
+public:
+ MockupConnection(const std::shared_ptr<DownstreamState>& ds, std::unique_ptr<FDMultiplexer>&, const struct timeval&, std::string&&) :
+ d_ds(ds)
+ {
+ }
+
+ bool canBeReused() const
+ {
+ return d_reusable;
+ }
+
+ bool isUsable() const
+ {
+ return d_usable;
+ }
+
+ bool willBeReusable(bool) const
+ {
+ return d_reusable;
+ }
+
+ void setReused()
+ {
+ }
+
+ struct timeval getLastDataReceivedTime() const
+ {
+ return d_lastDataReceivedTime;
+ }
+
+ bool isIdle() const
+ {
+ return d_idle;
+ }
+
+ void stopIO()
+ {
+ }
+
+ std::shared_ptr<DownstreamState> getDS() const
+ {
+ return d_ds;
+ }
+
+ std::shared_ptr<DownstreamState> d_ds;
+ struct timeval d_lastDataReceivedTime
+ {
+ 0, 0
+ };
+ bool d_reusable{true};
+ bool d_usable{true};
+ bool d_idle{false};
+};
+
+BOOST_AUTO_TEST_SUITE(test_dnsdist_connections_cache)
+
+BOOST_AUTO_TEST_CASE(test_ConnectionsCache)
+{
+ DownstreamConnectionsManager<MockupConnection> manager;
+ const size_t maxIdleConnPerDownstream = 5;
+ const uint16_t cleanupInterval = 1;
+ const uint16_t maxIdleTime = 5;
+ manager.setMaxIdleConnectionsPerDownstream(maxIdleConnPerDownstream);
+ manager.setCleanupInterval(cleanupInterval);
+ manager.setMaxIdleTime(maxIdleTime);
+
+ auto mplexer = std::unique_ptr<FDMultiplexer>(FDMultiplexer::getMultiplexerSilent());
+ auto downstream1 = std::make_shared<DownstreamState>(ComboAddress("192.0.2.1"));
+ auto downstream2 = std::make_shared<DownstreamState>(ComboAddress("192.0.2.2"));
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto conn = manager.getConnectionToDownstream(mplexer, downstream1, now, std::string());
+ BOOST_REQUIRE(conn != nullptr);
+ BOOST_CHECK_EQUAL(manager.count(), 1U);
+ BOOST_CHECK_EQUAL(manager.getActiveCount(), 1U);
+ BOOST_CHECK_EQUAL(manager.getIdleCount(), 0U);
+
+ /* since the connection can be reused, we should get the same one */
+ {
+ auto conn1 = manager.getConnectionToDownstream(mplexer, downstream1, now, std::string());
+ BOOST_CHECK(conn.get() == conn1.get());
+ BOOST_CHECK_EQUAL(manager.count(), 1U);
+ BOOST_CHECK_EQUAL(manager.getActiveCount(), 1U);
+ }
+
+ /* if we mark it non-usable, we should get a new one */
+ conn->d_usable = false;
+ auto conn2 = manager.getConnectionToDownstream(mplexer, downstream1, now, std::string());
+ BOOST_CHECK(conn.get() != conn2.get());
+ BOOST_CHECK_EQUAL(manager.count(), 2U);
+ BOOST_CHECK_EQUAL(manager.getActiveCount(), 2U);
+
+ /* since the second connection can be reused, we should get it */
+ {
+ auto conn3 = manager.getConnectionToDownstream(mplexer, downstream1, now, std::string());
+ BOOST_CHECK(conn3.get() == conn2.get());
+ BOOST_CHECK_EQUAL(manager.count(), 2U);
+ BOOST_CHECK_EQUAL(manager.getActiveCount(), 2U);
+ }
+
+ /* different downstream so different connection */
+ auto differentConn = manager.getConnectionToDownstream(mplexer, downstream2, now, std::string());
+ BOOST_REQUIRE(differentConn != nullptr);
+ BOOST_CHECK(differentConn.get() != conn.get());
+ BOOST_CHECK(differentConn.get() != conn2.get());
+ BOOST_CHECK_EQUAL(manager.count(), 3U);
+ BOOST_CHECK_EQUAL(manager.getActiveCount(), 3U);
+ {
+ /* but we should be able to reuse it */
+ auto sameConn = manager.getConnectionToDownstream(mplexer, downstream2, now, std::string());
+ BOOST_CHECK(sameConn.get() == differentConn.get());
+ BOOST_CHECK_EQUAL(manager.count(), 3U);
+ BOOST_CHECK_EQUAL(manager.getActiveCount(), 3U);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += cleanupInterval + 1;
+
+ /* mark the second connection as no longer usable */
+ conn2->d_usable = false;
+ /* first one as well but still fresh so it will not get checked */
+ conn->d_usable = true;
+ conn->d_lastDataReceivedTime = later;
+ /* third one is usable but idle for too long */
+ differentConn->d_idle = true;
+ differentConn->d_lastDataReceivedTime = later;
+ differentConn->d_lastDataReceivedTime.tv_sec -= (maxIdleTime + 1);
+
+ /* we should not do an actual cleanup attempt since the last cleanup was done recently */
+ manager.cleanupClosedConnections(now);
+ BOOST_CHECK_EQUAL(manager.count(), 3U);
+
+ manager.cleanupClosedConnections(later);
+ BOOST_CHECK_EQUAL(manager.count(), 1U);
+
+ /* mark the remaining conn as non-usable, to get new ones */
+ conn->d_usable = false;
+ conn->d_lastDataReceivedTime.tv_sec = 0;
+
+ std::vector<std::shared_ptr<MockupConnection>> conns = {conn};
+ while (conns.size() < maxIdleConnPerDownstream) {
+ auto newConn = manager.getConnectionToDownstream(mplexer, downstream1, now, std::string());
+ newConn->d_usable = false;
+ conns.push_back(newConn);
+ BOOST_CHECK_EQUAL(manager.count(), conns.size());
+ }
+
+ /* if we add a new one, the oldest should NOT get expunged because they are all active ones! */
+ auto newConn = manager.getConnectionToDownstream(mplexer, downstream1, now, std::string());
+ BOOST_CHECK_GT(manager.count(), maxIdleConnPerDownstream);
+
+ {
+ /* mark all connections as not usable anymore */
+ for (auto& c : conns) {
+ c->d_usable = false;
+ }
+
+ /* except the last one */
+ newConn->d_usable = true;
+
+ BOOST_CHECK_EQUAL(manager.count(), conns.size() + 1);
+ later.tv_sec += cleanupInterval + 1;
+ manager.cleanupClosedConnections(later);
+ BOOST_CHECK_EQUAL(manager.count(), 1U);
+ }
+
+ conns.clear();
+ auto cleared = manager.clear();
+ BOOST_CHECK_EQUAL(cleared, 1U);
+
+ /* add 10 actives connections */
+ while (conns.size() < 10) {
+ newConn = manager.getConnectionToDownstream(mplexer, downstream1, now, std::string());
+ newConn->d_usable = false;
+ conns.push_back(newConn);
+ BOOST_CHECK_EQUAL(manager.count(), conns.size());
+ BOOST_CHECK_EQUAL(manager.getActiveCount(), conns.size());
+ }
+ /* now we mark them as idle */
+ for (auto& c : conns) {
+ /* use a different shared_ptr to make sure that the comparison is done on the actual raw pointer */
+ auto shared = c;
+ shared->d_idle = true;
+ BOOST_CHECK(manager.moveToIdle(shared));
+ }
+ BOOST_CHECK_EQUAL(manager.count(), maxIdleConnPerDownstream);
+ BOOST_CHECK_EQUAL(manager.getActiveCount(), 0U);
+ BOOST_CHECK_EQUAL(manager.getIdleCount(), maxIdleConnPerDownstream);
+
+ {
+ /* if we ask for a connection, one of these should become active and no longer idle */
+ /* but first we need to mark them as usable again */
+ for (const auto& c : conns) {
+ c->d_usable = true;
+ }
+ auto got = manager.getConnectionToDownstream(mplexer, downstream1, now, std::string());
+ BOOST_CHECK_EQUAL(manager.count(), maxIdleConnPerDownstream);
+ BOOST_CHECK_EQUAL(manager.getActiveCount(), 1U);
+ BOOST_CHECK_EQUAL(manager.getIdleCount(), maxIdleConnPerDownstream - 1U);
+ }
+}
+
+BOOST_AUTO_TEST_SUITE_END();
diff --git a/test-dnsdist_cc.cc b/test-dnsdist_cc.cc
new file mode 100644
index 0000000..8bf0e99
--- /dev/null
+++ b/test-dnsdist_cc.cc
@@ -0,0 +1,2083 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+#include <unistd.h>
+
+#include "dnsdist.hh"
+#include "dnsdist-ecs.hh"
+#include "dnsdist-xpf.hh"
+
+#include "dolog.hh"
+#include "dnsname.hh"
+#include "dnsparser.hh"
+#include "dnswriter.hh"
+#include "ednsoptions.hh"
+#include "ednscookies.hh"
+#include "ednssubnet.hh"
+
+BOOST_AUTO_TEST_SUITE(test_dnsdist_cc)
+
+static const uint16_t ECSSourcePrefixV4 = 24;
+static const uint16_t ECSSourcePrefixV6 = 56;
+
+static void validateQuery(const PacketBuffer& packet, bool hasEdns=true, bool hasXPF=false, uint16_t additionals=0, uint16_t answers=0, uint16_t authorities=0)
+{
+ MOADNSParser mdp(true, reinterpret_cast<const char*>(packet.data()), packet.size());
+
+ BOOST_CHECK_EQUAL(mdp.d_qname.toString(), "www.powerdns.com.");
+
+ BOOST_CHECK_EQUAL(mdp.d_header.qdcount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.ancount, answers);
+ BOOST_CHECK_EQUAL(mdp.d_header.nscount, authorities);
+ uint16_t expectedARCount = additionals + (hasEdns ? 1U : 0U) + (hasXPF ? 1U : 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.arcount, expectedARCount);
+}
+
+static void validateECS(const PacketBuffer& packet, const ComboAddress& expected)
+{
+ ComboAddress rem("::1");
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ uint16_t qclass;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, &qclass, &consumed);
+ DNSQuestion dq(&qname, qtype, qclass, nullptr, &rem, const_cast<PacketBuffer&>(packet), dnsdist::Protocol::DoUDP, nullptr);
+ BOOST_CHECK(parseEDNSOptions(dq));
+ BOOST_REQUIRE(dq.ednsOptions != nullptr);
+ BOOST_CHECK_EQUAL(dq.ednsOptions->size(), 1U);
+ const auto& ecsOption = dq.ednsOptions->find(EDNSOptionCode::ECS);
+ BOOST_REQUIRE(ecsOption != dq.ednsOptions->cend());
+
+ string expectedOption;
+ generateECSOption(expected, expectedOption, expected.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+ /* we need to skip the option code and length, which are not included */
+ BOOST_REQUIRE_EQUAL(ecsOption->second.values.size(), 1U);
+ BOOST_CHECK_EQUAL(expectedOption.substr(EDNS_OPTION_CODE_SIZE + EDNS_OPTION_LENGTH_SIZE), std::string(ecsOption->second.values.at(0).content, ecsOption->second.values.at(0).size));
+}
+
+static void validateResponse(const PacketBuffer& packet, bool hasEdns, uint8_t additionalCount=0)
+{
+ MOADNSParser mdp(false, reinterpret_cast<const char*>(packet.data()), packet.size());
+
+ BOOST_CHECK_EQUAL(mdp.d_qname.toString(), "www.powerdns.com.");
+
+ BOOST_CHECK_EQUAL(mdp.d_header.qr, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.qdcount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.ancount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.nscount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.arcount, (hasEdns ? 1U : 0U) + additionalCount);
+}
+
+BOOST_AUTO_TEST_CASE(test_addXPF)
+{
+ static const uint16_t xpfOptionCode = 65422;
+
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+ ComboAddress remote;
+ DNSName name("www.powerdns.com.");
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ PacketBuffer queryWithXPF;
+
+ {
+ PacketBuffer packet = query;
+
+ /* large enough packet */
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ DNSQuestion dq(&qname, qtype, QClass::IN, &remote, &remote, packet, dnsdist::Protocol::DoUDP, &queryTime);
+
+ BOOST_CHECK(addXPF(dq, xpfOptionCode));
+ BOOST_CHECK(packet.size() > query.size());
+ validateQuery(packet, false, true);
+ queryWithXPF = packet;
+ }
+
+ {
+ PacketBuffer packet = query;
+
+ /* packet is already too large for the 4096 limit over UDP */
+ packet.resize(4096);
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ DNSQuestion dq(&qname, qtype, QClass::IN, &remote, &remote, packet, dnsdist::Protocol::DoUDP, &queryTime);
+
+ BOOST_REQUIRE(!addXPF(dq, xpfOptionCode));
+ BOOST_CHECK_EQUAL(packet.size(), 4096U);
+ packet.resize(query.size());
+ validateQuery(packet, false, false);
+ }
+
+ {
+ PacketBuffer packet = query;
+
+ /* packet with trailing data (overriding it) */
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ DNSQuestion dq(&qname, qtype, QClass::IN, &remote, &remote, packet, dnsdist::Protocol::DoUDP, &queryTime);
+
+ /* add trailing data */
+ const size_t trailingDataSize = 10;
+ /* Making sure we have enough room to allow for fake trailing data */
+ packet.resize(packet.size() + trailingDataSize);
+ for (size_t idx = 0; idx < trailingDataSize; idx++) {
+ packet.push_back('A');
+ }
+
+ BOOST_CHECK(addXPF(dq, xpfOptionCode));
+ BOOST_CHECK_EQUAL(packet.size(), queryWithXPF.size());
+ BOOST_CHECK_EQUAL(memcmp(queryWithXPF.data(), packet.data(), queryWithXPF.size()), 0);
+ validateQuery(packet, false, true);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(addECSWithoutEDNS)
+{
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.0.2.1");
+ DNSName name("www.powerdns.com.");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ uint16_t len = query.size();
+
+ /* large enough packet */
+ PacketBuffer packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, false, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, true);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet);
+ validateECS(packet, remote);
+ PacketBuffer queryWithEDNS = packet;
+
+ /* not large enough packet */
+ packet = query;
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(packet, packet.size(), consumed, ednsAdded, ecsAdded, false, newECSOption));
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ packet.resize(query.size());
+ validateQuery(packet, false);
+
+ /* packet with trailing data (overriding it) */
+ packet = query;
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ /* add trailing data */
+ const size_t trailingDataSize = 10;
+ /* Making sure we have enough room to allow for fake trailing data */
+ packet.resize(packet.size() + trailingDataSize);
+ for (size_t idx = 0; idx < trailingDataSize; idx++) {
+ packet[len + idx] = 'A';
+ }
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, false, newECSOption));
+ BOOST_REQUIRE_EQUAL(packet.size(), queryWithEDNS.size());
+ BOOST_CHECK_EQUAL(memcmp(queryWithEDNS.data(), packet.data(), queryWithEDNS.size()), 0);
+ BOOST_CHECK_EQUAL(ednsAdded, true);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet);
+}
+
+BOOST_AUTO_TEST_CASE(addECSWithoutEDNSButWithAnswer)
+{
+ /* this might happen for NOTIFY queries where, according to rfc1996:
+ "If ANCOUNT>0, then the answer section represents an
+ unsecure hint at the new RRset for this <QNAME,QCLASS,QTYPE>".
+ */
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.0.2.1");
+ DNSName name("www.powerdns.com.");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.startRecord(name, QType::A, 60, QClass::IN, DNSResourceRecord::ANSWER, false);
+ pw.xfrIP(remote.sin4.sin_addr.s_addr);
+ pw.commit();
+ uint16_t len = query.size();
+
+ /* large enough packet */
+ PacketBuffer packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, false, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, true);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet, true, false, 0, 1);
+ validateECS(packet, remote);
+ PacketBuffer queryWithEDNS = packet;
+
+ /* not large enough packet */
+ packet = query;
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(packet, packet.size(), consumed, ednsAdded, ecsAdded, false, newECSOption));
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ packet.resize(query.size());
+ validateQuery(packet, false, false, 0, 1);
+
+ /* packet with trailing data (overriding it) */
+ packet = query;
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ /* add trailing data */
+ const size_t trailingDataSize = 10;
+ /* Making sure we have enough room to allow for fake trailing data */
+ packet.resize(packet.size() + trailingDataSize);
+ for (size_t idx = 0; idx < trailingDataSize; idx++) {
+ packet[len + idx] = 'A';
+ }
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, false, newECSOption));
+ BOOST_REQUIRE_EQUAL(packet.size(), queryWithEDNS.size());
+ BOOST_CHECK_EQUAL(memcmp(queryWithEDNS.data(), packet.data(), queryWithEDNS.size()), 0);
+ BOOST_CHECK_EQUAL(ednsAdded, true);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet, true, false, 0, 1);
+}
+
+BOOST_AUTO_TEST_CASE(addECSWithoutEDNSAlreadyParsed)
+{
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.0.2.1");
+ DNSName name("www.powerdns.com.");
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ uint16_t qclass;
+ DNSName qname(reinterpret_cast<const char *>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, &qclass, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ BOOST_CHECK(qclass == QClass::IN);
+
+ DNSQuestion dq(&qname, qtype, qclass, nullptr, &remote, packet, dnsdist::Protocol::DoUDP, nullptr);
+ /* Parse the options before handling ECS, simulating a Lua rule asking for EDNS Options */
+ BOOST_CHECK(!parseEDNSOptions(dq));
+
+ /* And now we add our own ECS */
+ BOOST_CHECK(handleEDNSClientSubnet(dq, ednsAdded, ecsAdded));
+ BOOST_CHECK_GT(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, true);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet);
+ validateECS(packet, remote);
+
+ /* trailing data */
+ packet = query;
+ packet.resize(2048);
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, &qclass, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ BOOST_CHECK(qclass == QClass::IN);
+ DNSQuestion dq2(&qname, qtype, qclass, nullptr, &remote, packet, dnsdist::Protocol::DoUDP, nullptr);
+
+ BOOST_CHECK(handleEDNSClientSubnet(dq2, ednsAdded, ecsAdded));
+ BOOST_CHECK_GT(packet.size(), query.size());
+ BOOST_CHECK_LT(packet.size(), 2048U);
+ BOOST_CHECK_EQUAL(ednsAdded, true);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet);
+ validateECS(packet, remote);
+}
+
+BOOST_AUTO_TEST_CASE(addECSWithEDNSNoECS) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote;
+ DNSName name("www.powerdns.com.");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.addOpt(512, 0, 0);
+ pw.commit();
+
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, false, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet);
+ validateECS(packet, remote);
+
+ /* not large enough packet */
+ consumed = 0;
+ ednsAdded = false;
+ ecsAdded = false;
+ packet = query;
+
+ qname = DNSName(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(packet, packet.size(), consumed, ednsAdded, ecsAdded, false, newECSOption));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet);
+}
+
+BOOST_AUTO_TEST_CASE(addECSWithEDNSNoECSAlreadyParsed) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("2001:DB8::1");
+ DNSName name("www.powerdns.com.");
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.addOpt(512, 0, 0);
+ pw.commit();
+
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ uint16_t qclass;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, &qclass, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ BOOST_CHECK(qclass == QClass::IN);
+
+ DNSQuestion dq(&qname, qtype, qclass, nullptr, &remote, packet, dnsdist::Protocol::DoUDP, nullptr);
+ /* Parse the options before handling ECS, simulating a Lua rule asking for EDNS Options */
+ BOOST_CHECK(parseEDNSOptions(dq));
+
+ /* And now we add our own ECS */
+ BOOST_CHECK(handleEDNSClientSubnet(dq, ednsAdded, ecsAdded));
+ BOOST_CHECK_GT(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet);
+ validateECS(packet, remote);
+
+ /* trailing data */
+ packet = query;
+ packet.resize(2048);
+ consumed = 0;
+ ednsAdded = false;
+ ecsAdded = false;
+ qname = DNSName(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ BOOST_CHECK(qclass == QClass::IN);
+ DNSQuestion dq2(&qname, qtype, qclass, nullptr, &remote, packet, dnsdist::Protocol::DoUDP, nullptr);
+
+ BOOST_CHECK(handleEDNSClientSubnet(dq2, ednsAdded, ecsAdded));
+ BOOST_CHECK_GT(packet.size(), query.size());
+ BOOST_CHECK_LT(packet.size(), 2048U);
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet);
+ validateECS(packet, remote);
+}
+
+BOOST_AUTO_TEST_CASE(replaceECSWithSameSize) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV4);
+ string origECSOption = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOption);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet);
+ validateECS(packet, remote);
+}
+
+BOOST_AUTO_TEST_CASE(replaceECSWithSameSizeAlreadyParsed) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV4);
+ string origECSOption = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOption);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ uint16_t qclass;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, &qclass, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ BOOST_CHECK(qclass == QClass::IN);
+
+ DNSQuestion dq(&qname, qtype, qclass, nullptr, &remote, packet, dnsdist::Protocol::DoUDP, nullptr);
+ dq.ecsOverride = true;
+
+ /* Parse the options before handling ECS, simulating a Lua rule asking for EDNS Options */
+ BOOST_CHECK(parseEDNSOptions(dq));
+
+ /* And now we add our own ECS */
+ BOOST_CHECK(handleEDNSClientSubnet(dq, ednsAdded, ecsAdded));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet);
+ validateECS(packet, remote);
+}
+
+BOOST_AUTO_TEST_CASE(replaceECSWithSmaller) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, 32);
+ string origECSOption = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOption);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK(packet.size() < query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet);
+ validateECS(packet, remote);
+}
+
+BOOST_AUTO_TEST_CASE(replaceECSWithLarger) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ EDNSSubnetOpts ecsOpts;
+ // smaller (less specific so less bits) option
+ static_assert(8 < ECSSourcePrefixV4, "The ECS scope should be smaller");
+ ecsOpts.source = Netmask(origRemote, 8);
+ string origECSOption = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOption);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet);
+ validateECS(packet, remote);
+
+ /* not large enough packet */
+ packet = query;
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(packet, packet.size(), consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet);
+}
+
+BOOST_AUTO_TEST_CASE(replaceECSFollowedByTSIG) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, 8);
+ string origECSOption = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOption);
+ pw.addOpt(512, 0, 0, opts);
+ pw.startRecord(DNSName("tsigname."), QType::TSIG, 0, QClass::ANY, DNSResourceRecord::ADDITIONAL, false);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false, 1);
+ validateECS(packet, remote);
+
+ /* not large enough packet */
+ packet = query;
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(packet, packet.size(), consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false, 1);
+}
+
+BOOST_AUTO_TEST_CASE(replaceECSAfterAN) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.startRecord(DNSName("powerdns.com."), QType::A, 0, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.commit();
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, 8);
+ string origECSOption = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOption);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false, 0, 1, 0);
+ validateECS(packet, remote);
+
+ /* not large enough packet */
+ packet = query;
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(packet, packet.size(), consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false, 0, 1, 0);
+}
+
+BOOST_AUTO_TEST_CASE(replaceECSAfterAuth) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.startRecord(DNSName("powerdns.com."), QType::A, 0, QClass::IN, DNSResourceRecord::AUTHORITY, true);
+ pw.commit();
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, 8);
+ string origECSOption = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOption);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false, 0, 0, 1);
+ validateECS(packet, remote);
+
+ /* not large enough packet */
+ packet = query;
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(packet, packet.size(), consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false, 0, 0, 1);
+}
+
+BOOST_AUTO_TEST_CASE(replaceECSBetweenTwoRecords) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, 8);
+ string origECSOption = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOption);
+ pw.startRecord(DNSName("additional"), QType::A, 0, QClass::IN, DNSResourceRecord::ADDITIONAL, false);
+ pw.xfr32BitInt(0x01020304);
+ pw.addOpt(512, 0, 0, opts);
+ pw.startRecord(DNSName("tsigname."), QType::TSIG, 0, QClass::ANY, DNSResourceRecord::ADDITIONAL, false);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false, 2);
+ validateECS(packet, remote);
+
+ /* not large enough packet */
+ packet = query;
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(packet, packet.size(), consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false, 2);
+}
+
+BOOST_AUTO_TEST_CASE(insertECSInEDNSBetweenTwoRecords) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.startRecord(DNSName("additional"), QType::A, 0, QClass::IN, DNSResourceRecord::ADDITIONAL, false);
+ pw.xfr32BitInt(0x01020304);
+ pw.addOpt(512, 0, 0);
+ pw.startRecord(DNSName("tsigname."), QType::TSIG, 0, QClass::ANY, DNSResourceRecord::ADDITIONAL, false);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ validateQuery(packet, true, false, 2);
+ validateECS(packet, remote);
+
+ /* not large enough packet */
+ packet = query;
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(query, packet.size(), consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false, 2);
+}
+
+BOOST_AUTO_TEST_CASE(insertECSAfterTSIG) {
+ bool ednsAdded = false;
+ bool ecsAdded = false;
+ ComboAddress remote("192.168.1.25");
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+ string newECSOption;
+ generateECSOption(remote, newECSOption, remote.sin4.sin_family == AF_INET ? ECSSourcePrefixV4 : ECSSourcePrefixV6);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.startRecord(DNSName("tsigname."), QType::TSIG, 0, QClass::ANY, DNSResourceRecord::ADDITIONAL, false);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(handleEDNSClientSubnet(packet, 4096, consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK(packet.size() > query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, true);
+ BOOST_CHECK_EQUAL(ecsAdded, true);
+ /* the MOADNSParser does not allow anything except XPF after a TSIG */
+ BOOST_CHECK_THROW(validateQuery(packet, true, false, 1), MOADNSException);
+ validateECS(packet, remote);
+
+ /* not large enough packet */
+ packet = query;
+
+ ednsAdded = false;
+ ecsAdded = false;
+ consumed = 0;
+ qname = DNSName(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ BOOST_CHECK(!handleEDNSClientSubnet(packet, packet.size(), consumed, ednsAdded, ecsAdded, true, newECSOption));
+ BOOST_CHECK_EQUAL(packet.size(), query.size());
+ BOOST_CHECK_EQUAL(ednsAdded, false);
+ BOOST_CHECK_EQUAL(ecsAdded, false);
+ validateQuery(packet, true, false);
+}
+
+
+BOOST_AUTO_TEST_CASE(removeEDNSWhenFirst) {
+ DNSName name("www.powerdns.com.");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.addOpt(512, 0, 0);
+ pw.commit();
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ PacketBuffer newResponse;
+ int res = rewriteResponseWithoutEDNS(response, newResponse);
+ BOOST_CHECK_EQUAL(res, 0);
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) newResponse.data(), newResponse.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ size_t const ednsOptRRSize = sizeof(struct dnsrecordheader) + 1 /* root in OPT RR */;
+ BOOST_CHECK_EQUAL(newResponse.size(), response.size() - ednsOptRRSize);
+
+ validateResponse(newResponse, false, 1);
+}
+
+BOOST_AUTO_TEST_CASE(removeEDNSWhenIntermediary) {
+ DNSName name("www.powerdns.com.");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.startRecord(DNSName("other.powerdns.com."), QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+ pw.addOpt(512, 0, 0);
+ pw.commit();
+ pw.startRecord(DNSName("yetanother.powerdns.com."), QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ PacketBuffer newResponse;
+ int res = rewriteResponseWithoutEDNS(response, newResponse);
+ BOOST_CHECK_EQUAL(res, 0);
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) newResponse.data(), newResponse.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ size_t const ednsOptRRSize = sizeof(struct dnsrecordheader) + 1 /* root in OPT RR */;
+ BOOST_CHECK_EQUAL(newResponse.size(), response.size() - ednsOptRRSize);
+
+ validateResponse(newResponse, false, 2);
+}
+
+BOOST_AUTO_TEST_CASE(removeEDNSWhenLast) {
+ DNSName name("www.powerdns.com.");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+ pw.startRecord(DNSName("other.powerdns.com."), QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+ pw.addOpt(512, 0, 0);
+ pw.commit();
+
+ PacketBuffer newResponse;
+ int res = rewriteResponseWithoutEDNS(response, newResponse);
+
+ BOOST_CHECK_EQUAL(res, 0);
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) newResponse.data(), newResponse.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+ size_t const ednsOptRRSize = sizeof(struct dnsrecordheader) + 1 /* root in OPT RR */;
+ BOOST_CHECK_EQUAL(newResponse.size(), response.size() - ednsOptRRSize);
+
+ validateResponse(newResponse, false, 1);
+}
+
+BOOST_AUTO_TEST_CASE(removeECSWhenOnlyOption) {
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV4);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ uint16_t optStart;
+ size_t optLen = 0;
+ bool last = false;
+
+ int res = locateEDNSOptRR(response, &optStart, &optLen, &last);
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(last, true);
+
+ size_t responseLen = response.size();
+ size_t existingOptLen = optLen;
+ BOOST_CHECK(existingOptLen < responseLen);
+ res = removeEDNSOptionFromOPT(reinterpret_cast<char *>(response.data()) + optStart, &optLen, EDNSOptionCode::ECS);
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(optLen, existingOptLen - (origECSOptionStr.size() + 4));
+ responseLen -= (existingOptLen - optLen);
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) response.data(), responseLen, sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ validateResponse(response, true, 1);
+}
+
+BOOST_AUTO_TEST_CASE(removeECSWhenFirstOption) {
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV6);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ EDNSCookiesOpt cookiesOpt("deadbeefdeadbeef");
+ string cookiesOptionStr = cookiesOpt.makeOptString();
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ uint16_t optStart;
+ size_t optLen = 0;
+ bool last = false;
+
+ int res = locateEDNSOptRR(response, &optStart, &optLen, &last);
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(last, true);
+
+ size_t responseLen = response.size();
+ size_t existingOptLen = optLen;
+ BOOST_CHECK(existingOptLen < responseLen);
+ res = removeEDNSOptionFromOPT(reinterpret_cast<char *>(response.data()) + optStart, &optLen, EDNSOptionCode::ECS);
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(optLen, existingOptLen - (origECSOptionStr.size() + 4));
+ responseLen -= (existingOptLen - optLen);
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) response.data(), responseLen, sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ validateResponse(response, true, 1);
+}
+
+BOOST_AUTO_TEST_CASE(removeECSWhenIntermediaryOption) {
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV4);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+
+ EDNSCookiesOpt cookiesOpt("deadbeefdeadbeef");
+ string cookiesOptionStr1 = cookiesOpt.makeOptString();
+ string cookiesOptionStr2 = cookiesOpt.makeOptString();
+
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr1);
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr2);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ uint16_t optStart;
+ size_t optLen = 0;
+ bool last = false;
+
+ int res = locateEDNSOptRR(response, &optStart, &optLen, &last);
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(last, true);
+
+ size_t responseLen = response.size();
+ size_t existingOptLen = optLen;
+ BOOST_CHECK(existingOptLen < responseLen);
+ res = removeEDNSOptionFromOPT(reinterpret_cast<char *>(response.data()) + optStart, &optLen, EDNSOptionCode::ECS);
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(optLen, existingOptLen - (origECSOptionStr.size() + 4));
+ responseLen -= (existingOptLen - optLen);
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) response.data(), responseLen, sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ validateResponse(response, true, 1);
+}
+
+BOOST_AUTO_TEST_CASE(removeECSWhenLastOption) {
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ EDNSCookiesOpt cookiesOpt("deadbeefdeadbeef");
+ string cookiesOptionStr = cookiesOpt.makeOptString();
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV4);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ uint16_t optStart;
+ size_t optLen = 0;
+ bool last = false;
+
+ int res = locateEDNSOptRR(response, &optStart, &optLen, &last);
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(last, true);
+
+ size_t responseLen = response.size();
+ size_t existingOptLen = optLen;
+ BOOST_CHECK(existingOptLen < responseLen);
+ res = removeEDNSOptionFromOPT(reinterpret_cast<char *>(response.data()) + optStart, &optLen, EDNSOptionCode::ECS);
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(optLen, existingOptLen - (origECSOptionStr.size() + 4));
+ responseLen -= (existingOptLen - optLen);
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) response.data(), responseLen, sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ validateResponse(response, true, 1);
+}
+
+BOOST_AUTO_TEST_CASE(rewritingWithoutECSWhenOnlyOption) {
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV4);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ PacketBuffer newResponse;
+ int res = rewriteResponseWithoutEDNSOption(response, EDNSOptionCode::ECS, newResponse);
+ BOOST_CHECK_EQUAL(res, 0);
+
+ BOOST_CHECK_EQUAL(newResponse.size(), response.size() - (origECSOptionStr.size() + 4));
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) newResponse.data(), newResponse.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ validateResponse(newResponse, true, 1);
+}
+
+BOOST_AUTO_TEST_CASE(rewritingWithoutECSWhenFirstOption) {
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV4);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ EDNSCookiesOpt cookiesOpt("deadbeefdeadbeef");
+ string cookiesOptionStr = cookiesOpt.makeOptString();
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ PacketBuffer newResponse;
+ int res = rewriteResponseWithoutEDNSOption(response, EDNSOptionCode::ECS, newResponse);
+ BOOST_CHECK_EQUAL(res, 0);
+
+ BOOST_CHECK_EQUAL(newResponse.size(), response.size() - (origECSOptionStr.size() + 4));
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) newResponse.data(), newResponse.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ validateResponse(newResponse, true, 1);
+}
+
+BOOST_AUTO_TEST_CASE(rewritingWithoutECSWhenIntermediaryOption) {
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV4);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ EDNSCookiesOpt cookiesOpt("deadbeefdeadbeef");
+ string cookiesOptionStr1 = cookiesOpt.makeOptString();
+ string cookiesOptionStr2 = cookiesOpt.makeOptString();
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr1);
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr2);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ PacketBuffer newResponse;
+ int res = rewriteResponseWithoutEDNSOption(response, EDNSOptionCode::ECS, newResponse);
+ BOOST_CHECK_EQUAL(res, 0);
+
+ BOOST_CHECK_EQUAL(newResponse.size(), response.size() - (origECSOptionStr.size() + 4));
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) newResponse.data(), newResponse.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ validateResponse(newResponse, true, 1);
+}
+
+BOOST_AUTO_TEST_CASE(rewritingWithoutECSWhenLastOption) {
+ DNSName name("www.powerdns.com.");
+ ComboAddress origRemote("127.0.0.1");
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pw(response, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->qr = 1;
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER, true);
+ pw.xfr32BitInt(0x01020304);
+
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(origRemote, ECSSourcePrefixV4);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ EDNSCookiesOpt cookiesOpt("deadbeefdeadbeef");
+ string cookiesOptionStr = cookiesOpt.makeOptString();
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ pw.startRecord(name, QType::A, 3600, QClass::IN, DNSResourceRecord::ADDITIONAL, true);
+ pw.xfr32BitInt(0x01020304);
+ pw.commit();
+
+ PacketBuffer newResponse;
+ int res = rewriteResponseWithoutEDNSOption(response, EDNSOptionCode::ECS, newResponse);
+ BOOST_CHECK_EQUAL(res, 0);
+
+ BOOST_CHECK_EQUAL(newResponse.size(), response.size() - (origECSOptionStr.size() + 4));
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname((const char*) newResponse.data(), newResponse.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ BOOST_CHECK_EQUAL(qname, name);
+ BOOST_CHECK(qtype == QType::A);
+
+ validateResponse(newResponse, true, 1);
+}
+
+static DNSQuestion getDNSQuestion(const DNSName& qname, const uint16_t qtype, const uint16_t qclass, const ComboAddress& lc, const ComboAddress& rem, const struct timespec& realTime, PacketBuffer& query)
+{
+ return DNSQuestion(&qname, qtype, qclass, &lc, &rem, query, dnsdist::Protocol::DoUDP, &realTime);
+}
+
+static DNSQuestion turnIntoResponse(const DNSName& qname, const uint16_t qtype, const uint16_t qclass, const ComboAddress& lc, const ComboAddress& rem, const struct timespec& queryRealTime, PacketBuffer& query, bool resizeBuffer=true)
+{
+ if (resizeBuffer) {
+ query.resize(4096);
+ }
+
+ auto dq = getDNSQuestion(qname, qtype, qclass, lc, rem, queryRealTime, query);
+
+ BOOST_CHECK(addEDNSToQueryTurnedResponse(dq));
+
+ return dq;
+}
+
+static int getZ(const DNSName& qname, const uint16_t qtype, const uint16_t qclass, PacketBuffer& query)
+{
+ ComboAddress lc("127.0.0.1");
+ ComboAddress rem("127.0.0.1");
+ struct timespec queryRealTime;
+ gettime(&queryRealTime, true);
+ DNSQuestion dq = getDNSQuestion(qname, qtype, qclass, lc, rem, queryRealTime, query);
+
+ return getEDNSZ(dq);
+}
+
+BOOST_AUTO_TEST_CASE(test_getEDNSZ) {
+
+ uint16_t z;
+ uint16_t udpPayloadSize;
+ DNSName qname("www.powerdns.com.");
+ uint16_t qtype = QType::A;
+ uint16_t qclass = QClass::IN;
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(ComboAddress("127.0.0.1"), ECSSourcePrefixV4);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ EDNSCookiesOpt cookiesOpt("deadbeefdeadbeef");
+ string cookiesOptionStr = cookiesOpt.makeOptString();
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+
+ {
+ /* no EDNS */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.commit();
+
+ BOOST_CHECK_EQUAL(getZ(qname, qtype, qclass, query), 0);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(query.data()), query.size(), &udpPayloadSize, &z), false);
+ BOOST_CHECK_EQUAL(z, 0);
+ BOOST_CHECK_EQUAL(udpPayloadSize, 0);
+ }
+
+ {
+ /* truncated EDNS */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, EDNS_HEADER_FLAG_DO);
+ pw.commit();
+
+ query.resize(query.size() - (/* RDLEN */ sizeof(uint16_t) + /* last byte of TTL / Z */ 1));
+ BOOST_CHECK_EQUAL(getZ(qname, qtype, qclass, query), 0);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(query.data()), query.size(), &udpPayloadSize, &z), false);
+ BOOST_CHECK_EQUAL(z, 0);
+ BOOST_CHECK_EQUAL(udpPayloadSize, 0);
+ }
+
+ {
+ /* valid EDNS, no options, DO not set */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, 0);
+ pw.commit();
+
+ BOOST_CHECK_EQUAL(getZ(qname, qtype, qclass, query), 0);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(query.data()), query.size(), &udpPayloadSize, &z), true);
+ BOOST_CHECK_EQUAL(z, 0);
+ BOOST_CHECK_EQUAL(udpPayloadSize, 512);
+ }
+
+ {
+ /* valid EDNS, no options, DO set */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, EDNS_HEADER_FLAG_DO);
+ pw.commit();
+
+ BOOST_CHECK_EQUAL(getZ(qname, qtype, qclass, query), EDNS_HEADER_FLAG_DO);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(query.data()), query.size(), &udpPayloadSize, &z), true);
+ BOOST_CHECK_EQUAL(z, EDNS_HEADER_FLAG_DO);
+ BOOST_CHECK_EQUAL(udpPayloadSize, 512);
+ }
+
+ {
+ /* valid EDNS, options, DO not set */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ BOOST_CHECK_EQUAL(getZ(qname, qtype, qclass, query), 0);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(query.data()), query.size(), &udpPayloadSize, &z), true);
+ BOOST_CHECK_EQUAL(z, 0);
+ BOOST_CHECK_EQUAL(udpPayloadSize, 512);
+ }
+
+ {
+ /* valid EDNS, options, DO set */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, EDNS_HEADER_FLAG_DO, opts);
+ pw.commit();
+
+ BOOST_CHECK_EQUAL(getZ(qname, qtype, qclass, query), EDNS_HEADER_FLAG_DO);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(query.data()), query.size(), &udpPayloadSize, &z), true);
+ BOOST_CHECK_EQUAL(z, EDNS_HEADER_FLAG_DO);
+ BOOST_CHECK_EQUAL(udpPayloadSize, 512);
+ }
+
+}
+
+BOOST_AUTO_TEST_CASE(test_addEDNSToQueryTurnedResponse) {
+
+ uint16_t z;
+ uint16_t udpPayloadSize;
+ DNSName qname("www.powerdns.com.");
+ uint16_t qtype = QType::A;
+ uint16_t qclass = QClass::IN;
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(ComboAddress("127.0.0.1"), ECSSourcePrefixV4);
+ string origECSOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ EDNSCookiesOpt cookiesOpt("deadbeefdeadbeef");
+ string cookiesOptionStr = cookiesOpt.makeOptString();
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ opts.emplace_back(EDNSOptionCode::ECS, origECSOptionStr);
+ ComboAddress lc("127.0.0.1");
+ ComboAddress rem("127.0.0.1");
+ struct timespec queryRealTime;
+ gettime(&queryRealTime, true);
+
+ {
+ /* no EDNS */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.getHeader()->qr = 1;
+ pw.getHeader()->rcode = RCode::NXDomain;
+ pw.commit();
+
+ auto dq = turnIntoResponse(qname, qtype, qclass, lc, rem, queryRealTime, query);
+ BOOST_CHECK_EQUAL(getEDNSZ(dq), 0);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(dq.getData().data()), dq.getData().size(), &udpPayloadSize, &z), false);
+ BOOST_CHECK_EQUAL(z, 0);
+ BOOST_CHECK_EQUAL(udpPayloadSize, 0);
+ }
+
+ {
+ /* truncated EDNS */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, EDNS_HEADER_FLAG_DO);
+ pw.commit();
+
+ query.resize(query.size() - (/* RDLEN */ sizeof(uint16_t) + /* last byte of TTL / Z */ 1));
+ auto dq = turnIntoResponse(qname, qtype, qclass, lc, rem, queryRealTime, query, false);
+ BOOST_CHECK_EQUAL(getEDNSZ(dq), 0);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(dq.getData().data()), dq.getData().size(), &udpPayloadSize, &z), false);
+ BOOST_CHECK_EQUAL(z, 0);
+ BOOST_CHECK_EQUAL(udpPayloadSize, 0);
+ }
+
+ {
+ /* valid EDNS, no options, DO not set */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, 0);
+ pw.commit();
+
+ auto dq = turnIntoResponse(qname, qtype, qclass, lc, rem, queryRealTime, query);
+ BOOST_CHECK_EQUAL(getEDNSZ(dq), 0);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(dq.getData().data()), dq.getData().size(), &udpPayloadSize, &z), true);
+ BOOST_CHECK_EQUAL(z, 0);
+ BOOST_CHECK_EQUAL(udpPayloadSize, g_PayloadSizeSelfGenAnswers);
+ }
+
+ {
+ /* valid EDNS, no options, DO set */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, EDNS_HEADER_FLAG_DO);
+ pw.commit();
+
+ auto dq = turnIntoResponse(qname, qtype, qclass, lc, rem, queryRealTime, query);
+ BOOST_CHECK_EQUAL(getEDNSZ(dq), EDNS_HEADER_FLAG_DO);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(dq.getData().data()), dq.getData().size(), &udpPayloadSize, &z), true);
+ BOOST_CHECK_EQUAL(z, EDNS_HEADER_FLAG_DO);
+ BOOST_CHECK_EQUAL(udpPayloadSize, g_PayloadSizeSelfGenAnswers);
+ }
+
+ {
+ /* valid EDNS, options, DO not set */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ auto dq = turnIntoResponse(qname, qtype, qclass, lc, rem, queryRealTime, query);
+ BOOST_CHECK_EQUAL(getEDNSZ(dq), 0);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(dq.getData().data()), dq.getData().size(), &udpPayloadSize, &z), true);
+ BOOST_CHECK_EQUAL(z, 0);
+ BOOST_CHECK_EQUAL(udpPayloadSize, g_PayloadSizeSelfGenAnswers);
+ }
+
+ {
+ /* valid EDNS, options, DO set */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, EDNS_HEADER_FLAG_DO, opts);
+ pw.commit();
+
+ auto dq = turnIntoResponse(qname, qtype, qclass, lc, rem, queryRealTime, query);
+ BOOST_CHECK_EQUAL(getEDNSZ(dq), EDNS_HEADER_FLAG_DO);
+ BOOST_CHECK_EQUAL(getEDNSUDPPayloadSizeAndZ(reinterpret_cast<const char*>(dq.getData().data()), dq.getData().size(), &udpPayloadSize, &z), true);
+ BOOST_CHECK_EQUAL(z, EDNS_HEADER_FLAG_DO);
+ BOOST_CHECK_EQUAL(udpPayloadSize, g_PayloadSizeSelfGenAnswers);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_getEDNSOptionsStart) {
+ const DNSName qname("www.powerdns.com.");
+ const uint16_t qtype = QType::A;
+ const uint16_t qclass = QClass::IN;
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(ComboAddress("127.0.0.1"), ECSSourcePrefixV4);
+ const string ecsOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, ecsOptionStr);
+ const ComboAddress lc("127.0.0.1");
+ const ComboAddress rem("127.0.0.1");
+ uint16_t optRDPosition;
+ size_t remaining;
+
+ const size_t optRDExpectedOffset = sizeof(dnsheader) + qname.wirelength() + DNS_TYPE_SIZE + DNS_CLASS_SIZE + /* root */ 1 + DNS_TYPE_SIZE + DNS_CLASS_SIZE + DNS_TTL_SIZE;
+
+ {
+ /* no EDNS */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.getHeader()->qr = 1;
+ pw.getHeader()->rcode = RCode::NXDomain;
+ pw.commit();
+
+ int res = getEDNSOptionsStart(query, qname.wirelength(), &optRDPosition, &remaining);
+
+ BOOST_CHECK_EQUAL(res, ENOENT);
+
+ /* truncated packet (should not matter) */
+ query.resize(query.size() - 1);
+ res = getEDNSOptionsStart(query, qname.wirelength(), &optRDPosition, &remaining);
+
+ BOOST_CHECK_EQUAL(res, ENOENT);
+ }
+
+ {
+ /* valid EDNS, no options */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, 0);
+ pw.commit();
+
+ int res = getEDNSOptionsStart(query, qname.wirelength(), &optRDPosition, &remaining);
+
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(optRDPosition, optRDExpectedOffset);
+ BOOST_CHECK_EQUAL(remaining, query.size() - optRDExpectedOffset);
+
+ /* truncated packet */
+ query.resize(query.size() - 1);
+
+ res = getEDNSOptionsStart(query, qname.wirelength(), &optRDPosition, &remaining);
+ BOOST_CHECK_EQUAL(res, ENOENT);
+ }
+
+ {
+ /* valid EDNS, options */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ int res = getEDNSOptionsStart(query, qname.wirelength(), &optRDPosition, &remaining);
+
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(optRDPosition, optRDExpectedOffset);
+ BOOST_CHECK_EQUAL(remaining, query.size() - optRDExpectedOffset);
+
+ /* truncated options (should not matter for this test) */
+ query.resize(query.size() - 1);
+ res = getEDNSOptionsStart(query, qname.wirelength(), &optRDPosition, &remaining);
+ BOOST_CHECK_EQUAL(res, 0);
+ BOOST_CHECK_EQUAL(optRDPosition, optRDExpectedOffset);
+ BOOST_CHECK_EQUAL(remaining, query.size() - optRDExpectedOffset);
+ }
+
+}
+
+BOOST_AUTO_TEST_CASE(test_isEDNSOptionInOpt) {
+
+ auto locateEDNSOption = [](const PacketBuffer& query, uint16_t code, size_t* optContentStart, uint16_t* optContentLen) {
+ uint16_t optStart;
+ size_t optLen;
+ bool last = false;
+ int res = locateEDNSOptRR(query, &optStart, &optLen, &last);
+ if (res != 0) {
+ // no EDNS OPT RR
+ return false;
+ }
+
+ if (optLen < optRecordMinimumSize) {
+ return false;
+ }
+
+ if (optStart < query.size() && query.at(optStart) != 0) {
+ // OPT RR Name != '.'
+ return false;
+ }
+
+ return isEDNSOptionInOpt(query, optStart, optLen, code, optContentStart, optContentLen);
+ };
+
+ const DNSName qname("www.powerdns.com.");
+ const uint16_t qtype = QType::A;
+ const uint16_t qclass = QClass::IN;
+ EDNSSubnetOpts ecsOpts;
+ ecsOpts.source = Netmask(ComboAddress("127.0.0.1"), ECSSourcePrefixV4);
+ const string ecsOptionStr = makeEDNSSubnetOptsString(ecsOpts);
+ const size_t sizeOfECSContent = ecsOptionStr.size();
+ const size_t sizeOfECSOption = /* option code */ 2 + /* option length */ 2 + sizeOfECSContent;
+ EDNSCookiesOpt cookiesOpt("deadbeefdeadbeef");
+ string cookiesOptionStr = cookiesOpt.makeOptString();
+ const size_t sizeOfCookieOption = /* option code */ 2 + /* option length */ 2 + cookiesOpt.size();
+ /*
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ opts.emplace_back(EDNSOptionCode::ECS, ecsOptionStr);
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ */
+ const ComboAddress lc("127.0.0.1");
+ const ComboAddress rem("127.0.0.1");
+ size_t optContentStart{std::numeric_limits<size_t>::max()};
+ uint16_t optContentLen{0};
+
+ const size_t optRDExpectedOffset = sizeof(dnsheader) + qname.wirelength() + DNS_TYPE_SIZE + DNS_CLASS_SIZE + /* root */ 1 + DNS_TYPE_SIZE + DNS_CLASS_SIZE + DNS_TTL_SIZE;
+
+ {
+ /* no EDNS */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.getHeader()->qr = 1;
+ pw.getHeader()->rcode = RCode::NXDomain;
+ pw.commit();
+
+ bool found = locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen);
+ BOOST_CHECK_EQUAL(found, false);
+
+ /* truncated packet (should not matter here) */
+ query.resize(query.size() - 1);
+ found = locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen);
+ BOOST_CHECK_EQUAL(found, false);
+ }
+
+ {
+ /* valid EDNS, no options */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ pw.addOpt(512, 0, 0);
+ pw.commit();
+
+ bool found = locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen);
+ BOOST_CHECK_EQUAL(found, false);
+
+ /* truncated packet */
+ query.resize(query.size() - 1);
+ BOOST_CHECK_THROW(locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen), std::out_of_range);
+ }
+
+ {
+ /* valid EDNS, two cookie options but no ECS */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ bool found = locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen);
+ BOOST_CHECK_EQUAL(found, false);
+
+ /* truncated packet */
+ query.resize(query.size() - 1);
+ BOOST_CHECK_THROW(locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen), std::range_error);
+ }
+
+ {
+ /* valid EDNS, two ECS */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, ecsOptionStr);
+ opts.emplace_back(EDNSOptionCode::ECS, ecsOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ bool found = locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen);
+ BOOST_CHECK_EQUAL(found, true);
+ if (found == true) {
+ BOOST_CHECK_EQUAL(optContentStart, optRDExpectedOffset + sizeof(uint16_t) /* RD len */ + /* option code */ 2 + /* option length */ 2);
+ BOOST_CHECK_EQUAL(optContentLen, sizeOfECSContent);
+ }
+
+ /* truncated packet */
+ query.resize(query.size() - 1);
+ BOOST_CHECK_THROW(locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen), std::range_error);
+ }
+
+ {
+ /* valid EDNS, one ECS between two cookies */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ opts.emplace_back(EDNSOptionCode::ECS, ecsOptionStr);
+ opts.emplace_back(EDNSOptionCode::COOKIE, cookiesOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ bool found = locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen);
+ BOOST_CHECK_EQUAL(found, true);
+ if (found == true) {
+ BOOST_CHECK_EQUAL(optContentStart, optRDExpectedOffset + sizeof(uint16_t) /* RD len */ + sizeOfCookieOption + /* option code */ 2 + /* option length */ 2);
+ BOOST_CHECK_EQUAL(optContentLen, sizeOfECSContent);
+ }
+
+ /* truncated packet */
+ query.resize(query.size() - 1);
+ BOOST_CHECK_THROW(locateEDNSOption(query, EDNSOptionCode::ECS, &optContentStart, &optContentLen), std::range_error);
+ }
+
+ {
+ /* valid EDNS, one 65002 after an ECS */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, qname, qtype, qclass, 0);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t opts;
+ opts.emplace_back(EDNSOptionCode::ECS, ecsOptionStr);
+ opts.emplace_back(65535, cookiesOptionStr);
+ pw.addOpt(512, 0, 0, opts);
+ pw.commit();
+
+ bool found = locateEDNSOption(query, 65535, &optContentStart, &optContentLen);
+ BOOST_CHECK_EQUAL(found, true);
+ if (found == true) {
+ BOOST_CHECK_EQUAL(optContentStart, optRDExpectedOffset + sizeof(uint16_t) /* RD len */ + sizeOfECSOption + /* option code */ 2 + /* option length */ 2);
+ BOOST_CHECK_EQUAL(optContentLen, cookiesOptionStr.size());
+ }
+
+ /* truncated packet */
+ query.resize(query.size() - 1);
+ BOOST_CHECK_THROW(locateEDNSOption(query, 65002, &optContentStart, &optContentLen), std::range_error);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_setNegativeAndAdditionalSOA) {
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+ ComboAddress remote;
+ DNSName name("www.powerdns.com.");
+
+ PacketBuffer query;
+ PacketBuffer queryWithEDNS;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ GenericDNSPacketWriter<PacketBuffer> pwEDNS(queryWithEDNS, name, QType::A, QClass::IN, 0);
+ pwEDNS.getHeader()->rd = 1;
+ pwEDNS.addOpt(1232, 0, 0);
+ pwEDNS.commit();
+
+ /* test NXD */
+ {
+ /* no incoming EDNS */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ DNSQuestion dq(&qname, qtype, QClass::IN, &remote, &remote, packet, dnsdist::Protocol::DoUDP, &queryTime);
+
+ BOOST_CHECK(setNegativeAndAdditionalSOA(dq, true, DNSName("zone."), 42, DNSName("mname."), DNSName("rname."), 1, 2, 3, 4 , 5));
+ BOOST_CHECK(packet.size() > query.size());
+ MOADNSParser mdp(true, reinterpret_cast<const char*>(packet.data()), packet.size());
+
+ BOOST_CHECK_EQUAL(mdp.d_qname.toString(), "www.powerdns.com.");
+ BOOST_CHECK_EQUAL(mdp.d_header.rcode, RCode::NXDomain);
+ BOOST_CHECK_EQUAL(mdp.d_header.qdcount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.ancount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.nscount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.arcount, 1U);
+ BOOST_REQUIRE_EQUAL(mdp.d_answers.size(), 1U);
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_type, static_cast<uint16_t>(QType::SOA));
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_class, QClass::IN);
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_name, DNSName("zone."));
+ }
+ {
+ /* now with incoming EDNS */
+ auto packet = queryWithEDNS;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ DNSQuestion dq(&qname, qtype, QClass::IN, &remote, &remote, packet, dnsdist::Protocol::DoUDP, &queryTime);
+
+ BOOST_CHECK(setNegativeAndAdditionalSOA(dq, true, DNSName("zone."), 42, DNSName("mname."), DNSName("rname."), 1, 2, 3, 4 , 5));
+ BOOST_CHECK(packet.size() > queryWithEDNS.size());
+ MOADNSParser mdp(true, reinterpret_cast<const char*>(packet.data()), packet.size());
+
+ BOOST_CHECK_EQUAL(mdp.d_qname.toString(), "www.powerdns.com.");
+ BOOST_CHECK_EQUAL(mdp.d_header.rcode, RCode::NXDomain);
+ BOOST_CHECK_EQUAL(mdp.d_header.qdcount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.ancount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.nscount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.arcount, 2U);
+ BOOST_REQUIRE_EQUAL(mdp.d_answers.size(), 2U);
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_type, static_cast<uint16_t>(QType::SOA));
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_class, QClass::IN);
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_name, DNSName("zone."));
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(1).first.d_type, static_cast<uint16_t>(QType::OPT));
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(1).first.d_name, g_rootdnsname);
+ }
+
+ /* test No Data */
+ {
+ /* no incoming EDNS */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ DNSQuestion dq(&qname, qtype, QClass::IN, &remote, &remote, packet, dnsdist::Protocol::DoUDP, &queryTime);
+
+ BOOST_CHECK(setNegativeAndAdditionalSOA(dq, false, DNSName("zone."), 42, DNSName("mname."), DNSName("rname."), 1, 2, 3, 4 , 5));
+ BOOST_CHECK(packet.size() > query.size());
+ MOADNSParser mdp(true, reinterpret_cast<const char*>(packet.data()), packet.size());
+
+ BOOST_CHECK_EQUAL(mdp.d_qname.toString(), "www.powerdns.com.");
+ BOOST_CHECK_EQUAL(mdp.d_header.rcode, RCode::NoError);
+ BOOST_CHECK_EQUAL(mdp.d_header.qdcount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.ancount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.nscount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.arcount, 1U);
+ BOOST_REQUIRE_EQUAL(mdp.d_answers.size(), 1U);
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_type, static_cast<uint16_t>(QType::SOA));
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_class, QClass::IN);
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_name, DNSName("zone."));
+ }
+ {
+ /* now with incoming EDNS */
+ auto packet = queryWithEDNS;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, nullptr, &consumed);
+ DNSQuestion dq(&qname, qtype, QClass::IN, &remote, &remote, packet, dnsdist::Protocol::DoUDP, &queryTime);
+
+ BOOST_CHECK(setNegativeAndAdditionalSOA(dq, false, DNSName("zone."), 42, DNSName("mname."), DNSName("rname."), 1, 2, 3, 4 , 5));
+ BOOST_CHECK(packet.size() > queryWithEDNS.size());
+ MOADNSParser mdp(true, reinterpret_cast<const char*>(packet.data()), packet.size());
+
+ BOOST_CHECK_EQUAL(mdp.d_qname.toString(), "www.powerdns.com.");
+ BOOST_CHECK_EQUAL(mdp.d_header.rcode, RCode::NoError);
+ BOOST_CHECK_EQUAL(mdp.d_header.qdcount, 1U);
+ BOOST_CHECK_EQUAL(mdp.d_header.ancount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.nscount, 0U);
+ BOOST_CHECK_EQUAL(mdp.d_header.arcount, 2U);
+ BOOST_REQUIRE_EQUAL(mdp.d_answers.size(), 2U);
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_type, static_cast<uint16_t>(QType::SOA));
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_class, QClass::IN);
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(0).first.d_name, DNSName("zone."));
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(1).first.d_type, static_cast<uint16_t>(QType::OPT));
+ BOOST_CHECK_EQUAL(mdp.d_answers.at(1).first.d_name, g_rootdnsname);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(getEDNSOptionsWithoutEDNS) {
+ const ComboAddress remote("192.168.1.25");
+ const DNSName name("www.powerdns.com.");
+ const ComboAddress origRemote("127.0.0.1");
+ const ComboAddress v4("192.0.2.1");
+
+ {
+ /* no EDNS and no other additional record */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ uint16_t qclass;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, &qclass, &consumed);
+ DNSQuestion dq(&qname, qtype, qclass, nullptr, &remote, packet, dnsdist::Protocol::DoUDP, nullptr);
+
+ BOOST_CHECK(!parseEDNSOptions(dq));
+ }
+
+ {
+ /* nothing in additional (so no EDNS) but a record in ANSWER */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.startRecord(name, QType::A, 60, QClass::IN, DNSResourceRecord::ANSWER);
+ pw.xfrIP(v4.sin4.sin_addr.s_addr);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ uint16_t qclass;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, &qclass, &consumed);
+ DNSQuestion dq(&qname, qtype, qclass, nullptr, &remote, packet, dnsdist::Protocol::DoUDP, nullptr);
+
+ BOOST_CHECK(!parseEDNSOptions(dq));
+ }
+
+ {
+ /* nothing in additional (so no EDNS) but a record in AUTHORITY */
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pw(query, name, QType::A, QClass::IN, 0);
+ pw.getHeader()->rd = 1;
+ pw.startRecord(name, QType::A, 60, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pw.xfrIP(v4.sin4.sin_addr.s_addr);
+ pw.commit();
+
+ /* large enough packet */
+ auto packet = query;
+
+ unsigned int consumed = 0;
+ uint16_t qtype;
+ uint16_t qclass;
+ DNSName qname(reinterpret_cast<const char*>(packet.data()), packet.size(), sizeof(dnsheader), false, &qtype, &qclass, &consumed);
+ DNSQuestion dq(&qname, qtype, qclass, nullptr, &remote, packet, dnsdist::Protocol::DoUDP, nullptr);
+
+ BOOST_CHECK(!parseEDNSOptions(dq));
+ }
+}
+
+BOOST_AUTO_TEST_SUITE_END();
diff --git a/test-dnsdistdynblocks_hh.cc b/test-dnsdistdynblocks_hh.cc
new file mode 100644
index 0000000..2e6a34e
--- /dev/null
+++ b/test-dnsdistdynblocks_hh.cc
@@ -0,0 +1,1482 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "dnsdist.hh"
+#include "dnsdist-dynblocks.hh"
+#include "dnsdist-rings.hh"
+
+Rings g_rings;
+shared_ptr<BPFFilter> g_defaultBPFFilter{nullptr};
+
+BOOST_AUTO_TEST_SUITE(dnsdistdynblocks_hh)
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_QueryRate) {
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1");
+ ComboAddress requestor2("192.0.2.2");
+ ComboAddress backend("192.0.2.42");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+ unsigned int responseTime = 0;
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+
+ /* block above 50 qps for numberOfSeconds seconds, no warning */
+ dbrg.setQueryRate(50, 0, numberOfSeconds, reason, blockDuration, action);
+
+ {
+ /* insert 45 qps from a given client in the last 10s
+ this should not trigger the rule */
+ size_t numberOfQueries = 45 * numberOfSeconds;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ /* we do not care about the response during that test, but we want to make sure
+ these do not interfere with the computation */
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), numberOfQueries);
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+
+ {
+ /* insert just above 50 qps from a given client in the last 10s
+ this should trigger the rule this time */
+ size_t numberOfQueries = (50 * numberOfSeconds) + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+ {
+ /* clear the rings and dynamic blocks */
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ /* Insert 100 qps from a given client in the last 10s
+ this should trigger the rule */
+ size_t numberOfQueries = 100;
+
+ for (size_t timeIdx = 0; timeIdx < numberOfSeconds; timeIdx++) {
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ struct timespec when = now;
+ when.tv_sec -= (9 - timeIdx);
+ g_rings.insertQuery(when, requestor1, qname, qtype, size, dh, protocol);
+ g_rings.insertResponse(when, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries * numberOfSeconds);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+
+ /* now we clean up the dynamic blocks, simulating an admin removing the block */
+ g_dynblockNMG.setState(emptyNMG);
+ /* we apply the rules again, but as if we were 20s in the future.
+ Since we have a time windows of 10s nothing should be added,
+ regardless of the number of queries
+ */
+ struct timespec later = now;
+ later.tv_sec += 20;
+ dbrg.apply(later);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+
+ /* just in case */
+ g_dynblockNMG.setState(emptyNMG);
+
+ /* we apply the rules again, this tile as if we were 5s in the future.
+ Since we have a time windows of 10s, and 100 qps over 5s then 0 qps over 5s
+ is more than 50qps over 10s, the block should be added
+ */
+ later = now;
+ later.tv_sec += 5;
+ dbrg.apply(later);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+
+ /* clean up */
+ g_dynblockNMG.setState(emptyNMG);
+
+ /* we apply the rules again, this tile as if we were 6s in the future.
+ Since we have a time windows of 10s, and 100 qps over 4s then 0 qps over 6s
+ is LESS than 50qps over 10s, the block should NOT be added
+ */
+ later = now;
+ later.tv_sec += 6;
+ dbrg.apply(later);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_QueryRate_RangeV6) {
+ /* Check that we correctly group IPv6 addresses from the same /64 subnet into the same
+ dynamic block entry, if instructed to do so */
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("2001:db8::1");
+ ComboAddress backend("2001:0db8:ffff:ffff:ffff:ffff:ffff:ffff");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+ unsigned int responseTime = 0;
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+ dbrg.setMasks(32, 64, 0);
+
+ /* block above 50 qps for numberOfSeconds seconds, no warning */
+ dbrg.setQueryRate(50, 0, numberOfSeconds, reason, blockDuration, action);
+
+ {
+ /* insert 45 qps from a given client in the last 10s
+ this should not trigger the rule */
+ size_t numberOfQueries = 45 * numberOfSeconds;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ /* we do not care about the response during that test, but we want to make sure
+ these do not interfere with the computation */
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), numberOfQueries);
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(requestor1, 128, 16)) == nullptr);
+ }
+
+ {
+ /* insert just above 50 qps from several clients in the same /64 IPv6 range in the last 10s,
+ this should trigger the rule this time */
+ size_t numberOfQueries = (50 * numberOfSeconds) + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ ComboAddress requestor("2001:db8::" + std::to_string(idx));
+ g_rings.insertQuery(now, requestor, qname, qtype, size, dh, protocol);
+ g_rings.insertResponse(now, requestor, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+
+ {
+ /* beginning of the range should be blocked */
+ const auto& block = g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(requestor1, 128, 16))->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+ {
+ /* end of the range should be blocked as well */
+ ComboAddress end("2001:0db8:0000:0000:ffff:ffff:ffff:ffff");
+ const auto& block = g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(end, 128, 16))->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+ {
+ /* outside of the range should NOT */
+ ComboAddress out("2001:0db8:0000:0001::0");
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(out, 128, 16)) == nullptr);
+ }
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_QueryRate_V4Ports) {
+ /* Check that we correctly split IPv4 addresses based on port ranges, when instructed to do so */
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1:42");
+ ComboAddress backend("192.0.2.254");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ unsigned int responseTime = 0;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+ /* split v4 by ports using a /2 (0 - 16383, 16384 - 32767, 32768 - 49151, 49152 - 65535) */
+ dbrg.setMasks(32, 128, 2);
+
+ /* block above 50 qps for numberOfSeconds seconds, no warning */
+ dbrg.setQueryRate(50, 0, numberOfSeconds, reason, blockDuration, action);
+
+ {
+ /* insert 45 qps from a given client in the last 10s
+ this should not trigger the rule */
+ size_t numberOfQueries = 45 * numberOfSeconds;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ /* we do not care about the response during that test, but we want to make sure
+ these do not interfere with the computation */
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), numberOfQueries);
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(requestor1, 128, 16)) == nullptr);
+ }
+
+ {
+ /* insert just above 50 qps from several clients in the same IPv4 port range in the last 10s,
+ this should trigger the rule this time */
+ size_t numberOfQueries = (50 * numberOfSeconds) + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ ComboAddress requestor("192.0.2.1:" + std::to_string(idx));
+ g_rings.insertQuery(now, requestor, qname, qtype, size, dh, protocol);
+ g_rings.insertResponse(now, requestor, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+
+ {
+ /* beginning of the port range should be blocked */
+ const auto& block = g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(ComboAddress("192.0.2.1:0"), 32, 16))->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+ {
+ /* end of the range should be blocked as well */
+ const auto& block = g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(ComboAddress("192.0.2.1:16383"), 32, 16))->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+ {
+ /* outside of the range should not */
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(ComboAddress("192.0.2.1:16384"), 32, 16)) == nullptr);
+ }
+
+ /* we (again) insert just above 50 qps from several clients the same IPv4 port range, this should update the block which will
+ check by looking at the blocked counter */
+ {
+ auto block = g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(ComboAddress("192.0.2.1:0"), 32, 16));
+ BOOST_REQUIRE(block != nullptr);
+ BOOST_CHECK_EQUAL(block->second.blocks, 0U);
+ block->second.blocks = 42U;
+ }
+
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ ComboAddress requestor("192.0.2.1:" + std::to_string(idx));
+ g_rings.insertQuery(now, requestor, qname, qtype, size, dh, protocol);
+ g_rings.insertResponse(now, requestor, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ {
+ /* previous address/port should still be blocked */
+ auto block = g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(ComboAddress("192.0.2.1:0"), 32, 16));
+ BOOST_REQUIRE(block != nullptr);
+ BOOST_CHECK_EQUAL(block->second.blocks, 42U);
+ }
+
+ /* but not a different one */
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(AddressAndPortRange(ComboAddress("192.0.2.1:16384"), 32, 16)) == nullptr);
+
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_QueryRate_responses) {
+ /* check that the responses are not accounted as queries when a
+ rcode rate rule is defined (sounds very specific but actually happened) */
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1");
+ ComboAddress requestor2("192.0.2.2");
+ ComboAddress backend("192.0.2.42");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+ unsigned int responseTime = 0;
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ /* 100k entries, one shard */
+ g_rings.setCapacity(1000000, 1);
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+
+ /* 100k entries, one shard */
+ g_rings.setCapacity(1000000, 1);
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+
+ /* block above 50 qps for numberOfSeconds seconds, no warning */
+ dbrg.setQueryRate(50, 0, numberOfSeconds, reason, blockDuration, action);
+ dbrg.setRCodeRate(RCode::ServFail, 50, 40, 5, "Exceeded ServFail rate", 60, DNSAction::Action::Drop);
+
+ {
+ /* insert 45 qps (including responses) from a given client for the last 100s
+ this should not trigger the rule */
+ size_t numberOfQueries = 45;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t timeIdx = 0; timeIdx < 100; timeIdx++) {
+ struct timespec when = now;
+ when.tv_sec -= (99 - timeIdx);
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(when, requestor1, qname, qtype, size, dh, protocol);
+ /* we do not care about the response during that test, but we want to make sure
+ these do not interfere with the computation */
+ g_rings.insertResponse(when, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), numberOfQueries * 100);
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries * 100);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_QTypeRate) {
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1");
+ ComboAddress requestor2("192.0.2.2");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+
+ /* block above 50 qps for numberOfSeconds seconds, no warning */
+ dbrg.setQTypeRate(QType::AAAA, 50, 0, numberOfSeconds, reason, blockDuration, action);
+
+ {
+ /* insert 45 qps from a given client in the last 10s
+ this should not trigger the rule */
+ size_t numberOfQueries = 45 * numberOfSeconds;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+
+ {
+ /* insert just above 50 qps from a given client in the last 10s
+ but for the wrong QType */
+ size_t numberOfQueries = 50 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, QType::A, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+
+ {
+ // insert just above 50 qps from a given client in the last 10s
+ // this should trigger the rule this time
+ size_t numberOfQueries = 50 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_RCodeRate) {
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1");
+ ComboAddress requestor2("192.0.2.2");
+ ComboAddress backend("192.0.2.42");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+ unsigned int responseTime = 100 * 1000; /* 100ms */
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+ const uint16_t rcode = RCode::ServFail;
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+
+ /* block above 50 ServFail/s for numberOfSeconds seconds, no warning */
+ dbrg.setRCodeRate(rcode, 50, 0, numberOfSeconds, reason, blockDuration, action);
+
+ {
+ /* insert 45 ServFail/s from a given client in the last 10s
+ this should not trigger the rule */
+ size_t numberOfResponses = 45 * numberOfSeconds;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ dh.rcode = rcode;
+ for (size_t idx = 0; idx < numberOfResponses; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), numberOfResponses);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+
+ {
+ /* insert just above 50 FormErr/s from a given client in the last 10s */
+ size_t numberOfResponses = 50 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ dh.rcode = RCode::FormErr;
+ for (size_t idx = 0; idx < numberOfResponses; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), numberOfResponses);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+
+ {
+ /* insert just above 50 ServFail/s from a given client in the last 10s
+ this should trigger the rule this time */
+ size_t numberOfResponses = 50 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ dh.rcode = rcode;
+ for (size_t idx = 0; idx < numberOfResponses; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), numberOfResponses);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_RCodeRatio) {
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1");
+ ComboAddress requestor2("192.0.2.2");
+ ComboAddress backend("192.0.2.42");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+ unsigned int responseTime = 100 * 1000; /* 100ms */
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ time_t numberOfSeconds = 10;
+ unsigned int blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query ratio";
+ const uint16_t rcode = RCode::ServFail;
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+
+ /* block above 0.2 ServFail/Total ratio over numberOfSeconds seconds, no warning, minimum number of queries should be at least 51 */
+ dbrg.setRCodeRatio(rcode, 0.2, 0, numberOfSeconds, reason, blockDuration, action, 51);
+
+ {
+ /* insert 20 ServFail and 80 NoErrors from a given client in the last 10s
+ this should not trigger the rule */
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ dh.rcode = rcode;
+ for (size_t idx = 0; idx < 20; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ dh.rcode = RCode::NoError;
+ for (size_t idx = 0; idx < 80; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 100U);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+
+ {
+ /* insert just 50 FormErrs and nothing else, from a given client in the last 10s */
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ dh.rcode = RCode::FormErr;
+ for (size_t idx = 0; idx < 50; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 50U);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+
+ {
+ /* insert 21 ServFails and 79 NoErrors from a given client in the last 10s
+ this should trigger the rule this time */
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ dh.rcode = rcode;
+ for (size_t idx = 0; idx < 21; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ dh.rcode = RCode::NoError;
+ for (size_t idx = 0; idx < 79; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 100U);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_REQUIRE(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(block.until.tv_sec, now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+ {
+ /* insert 11 ServFails and 39 NoErrors from a given client in the last 10s
+ this should NOT trigger the rule since we don't have more than 50 queries */
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ dh.rcode = rcode;
+ for (size_t idx = 0; idx < 11; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ dh.rcode = RCode::NoError;
+ for (size_t idx = 0; idx < 39; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 50U);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_ResponseByteRate) {
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1");
+ ComboAddress requestor2("192.0.2.2");
+ ComboAddress backend("192.0.2.42");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 100;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+ unsigned int responseTime = 100 * 1000; /* 100ms */
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+ const uint16_t rcode = RCode::NoError;
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+
+ /* block above 10kB/s for numberOfSeconds seconds, no warning */
+ dbrg.setResponseByteRate(10000, 0, numberOfSeconds, reason, blockDuration, action);
+
+ {
+ /* insert 99 answers of 100 bytes per second from a given client in the last 10s
+ this should not trigger the rule */
+ size_t numberOfResponses = 99 * numberOfSeconds;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ dh.rcode = rcode;
+ for (size_t idx = 0; idx < numberOfResponses; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), numberOfResponses);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+
+ {
+ /* insert just above 100 answers of 100 bytes per second from a given client in the last 10s */
+ size_t numberOfResponses = 100 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ dh.rcode = rcode;
+ for (size_t idx = 0; idx < numberOfResponses; idx++) {
+ g_rings.insertResponse(now, requestor1, qname, qtype, responseTime, size, dh, backend, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfResponseEntries(), numberOfResponses);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_Warning) {
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1");
+ ComboAddress requestor2("192.0.2.2");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+
+ /* warn above 20 qps for numberOfSeconds seconds, block above 50 qps */
+ dbrg.setQueryRate(50, 20, numberOfSeconds, reason, blockDuration, action);
+
+ {
+ /* insert 20 qps from a given client in the last 10s
+ this should not trigger the rule */
+ size_t numberOfQueries = 20 * numberOfSeconds;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) == nullptr);
+ }
+
+ {
+ /* insert just above 20 qps from a given client in the last 10s
+ this should trigger the warning rule this time */
+ size_t numberOfQueries = 20 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+
+ {
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == DNSAction::Action::NoOp);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, true);
+ /* let's increment the number of blocks so we can check that the counter
+ is preserved when the block is upgraded to a non-warning one */
+ block.blocks++;
+ }
+
+ /* now inserts 50 qps for the same duration, we should reach the blocking threshold */
+ numberOfQueries = 50 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+
+ {
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ /* this should have been preserved */
+ BOOST_CHECK_EQUAL(block.blocks, 1U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ block.blocks++;
+ }
+
+ /* 30s later, with the same amount of qps the duration of the block
+ should be increased. */
+ now.tv_sec += 30;
+ numberOfQueries = 50 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+
+ {
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ /* should have been updated */
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ /* this should have been preserved */
+ BOOST_CHECK_EQUAL(block.blocks, 2U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+ }
+
+ {
+ /* insert directly just above 50 qps from a given client in the last 10s
+ this should trigger the blocking rule right away this time */
+ size_t numberOfQueries = 50 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+
+ {
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesGroup_Ranges) {
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1");
+ ComboAddress requestor2("192.0.2.42");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+ /* include 192.0.2.0 -> 192.0.2.63 */
+ dbrg.includeRange(Netmask("192.0.2.0/26"));
+ /* but exclude 192.0.2.42 only */
+ dbrg.excludeRange(Netmask("192.0.2.42/32"));
+
+ /* block above 50 qps for numberOfSeconds seconds, no warning */
+ dbrg.setQueryRate(50, 0, numberOfSeconds, reason, blockDuration, action);
+
+ {
+ /* insert just above 50 qps from the two clients in the last 10s
+ this should trigger the rule for the first one but not the second one */
+ size_t numberOfQueries = 50 * numberOfSeconds + 1;
+ g_rings.clear();
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), 0U);
+ g_dynblockNMG.setState(emptyNMG);
+
+ for (size_t idx = 0; idx < numberOfQueries; idx++) {
+ g_rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ g_rings.insertQuery(now, requestor2, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(g_rings.getNumberOfQueryEntries(), numberOfQueries * 2);
+
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1U);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor1) != nullptr);
+ BOOST_CHECK(g_dynblockNMG.getLocal()->lookup(requestor2) == nullptr);
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor1)->second;
+ BOOST_CHECK_EQUAL(block.reason, reason);
+ BOOST_CHECK_EQUAL(static_cast<size_t>(block.until.tv_sec), now.tv_sec + blockDuration);
+ BOOST_CHECK(block.domain.empty());
+ BOOST_CHECK(block.action == action);
+ BOOST_CHECK_EQUAL(block.blocks, 0U);
+ BOOST_CHECK_EQUAL(block.warning, false);
+ }
+
+}
+
+BOOST_AUTO_TEST_CASE(test_DynBlockRulesMetricsCache_GetTopN) {
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+ struct timespec now;
+ gettime(&now);
+ NetmaskTree<DynBlock, AddressAndPortRange> emptyNMG;
+ SuffixMatchTree<DynBlock> emptySMT;
+
+ size_t numberOfSeconds = 10;
+ size_t blockDuration = 60;
+ const auto action = DNSAction::Action::Drop;
+ const std::string reason = "Exceeded query rate";
+
+ /* 10M entries, only one shard */
+ g_rings.setCapacity(10000000, 1);
+
+ {
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+ g_rings.clear();
+ g_dynblockNMG.setState(emptyNMG);
+
+ /* block above 0 qps for numberOfSeconds seconds, no warning */
+ dbrg.setQueryRate(0, 0, numberOfSeconds, reason, blockDuration, action);
+
+ /* insert one fake query from 255 clients:
+ */
+ for (size_t idx = 0; idx < 256; idx++) {
+ const ComboAddress requestor("192.0.2." + std::to_string(idx));
+ g_rings.insertQuery(now, requestor, qname, qtype, size, dh, protocol);
+ }
+
+ /* we apply the rules, all clients should be blocked */
+ dbrg.apply(now);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 256U);
+
+ for (size_t idx = 0; idx < 256; idx++) {
+ const ComboAddress requestor("192.0.2." + std::to_string(idx));
+ const auto& block = g_dynblockNMG.getLocal()->lookup(requestor)->second;
+ /* simulate that:
+ - .1 does 1 query
+ ...
+ - .255 does 255 queries
+ */
+ block.blocks = idx;
+ }
+
+ /* now we ask for the top 20 offenders for each reason */
+ StopWatch sw;
+ sw.start();
+ auto top = DynBlockMaintenance::getTopNetmasks(20);
+ BOOST_REQUIRE_EQUAL(top.size(), 1U);
+ auto offenders = top.at(reason);
+ BOOST_REQUIRE_EQUAL(offenders.size(), 20U);
+ auto it = offenders.begin();
+ for (size_t idx = 236; idx < 256; idx++) {
+ BOOST_CHECK_EQUAL(it->first.toString(), Netmask(ComboAddress("192.0.2." + std::to_string(idx))).toString());
+ BOOST_CHECK_EQUAL(it->second, idx);
+ ++it;
+ }
+
+ struct timespec expired = now;
+ expired.tv_sec += blockDuration + 1;
+ DynBlockMaintenance::purgeExpired(expired);
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ }
+
+ {
+ /* === reset everything for SMT === */
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+ g_rings.clear();
+ g_dynblockNMG.setState(emptyNMG);
+ g_dynblockSMT.setState(emptySMT);
+
+ dbrg.setSuffixMatchRule(numberOfSeconds, reason, blockDuration, action, [](const StatNode& node, const StatNode::Stat& self, const StatNode::Stat& children) {
+ if (self.queries > 0) {
+ return std::tuple<bool, boost::optional<std::string>>(true, boost::none);
+ }
+ return std::tuple<bool, boost::optional<std::string>>(false, boost::none);
+ });
+
+ /* insert one fake response for 255 DNS names */
+ const ComboAddress requestor("192.0.2.1");
+ for (size_t idx = 0; idx < 256; idx++) {
+ g_rings.insertResponse(now, requestor, DNSName(std::to_string(idx)) + qname, qtype, 1000 /*usec*/, size, dh, requestor /* backend, technically, but we don't care */, outgoingProtocol);
+ }
+
+ /* we apply the rules, all suffixes should be blocked */
+ dbrg.apply(now);
+
+ for (size_t idx = 0; idx < 256; idx++) {
+ const DNSName name(DNSName(std::to_string(idx)) + qname);
+ const auto* block = g_dynblockSMT.getLocal()->lookup(name);
+ BOOST_REQUIRE(block != nullptr);
+ /* simulate that:
+ - 1.rings.powerdns.com. got 1 query
+ ...
+ - 255. does 255 queries
+ */
+ block->blocks = idx;
+ }
+
+ /* now we ask for the top 20 offenders for each reason */
+ StopWatch sw;
+ sw.start();
+ auto top = DynBlockMaintenance::getTopSuffixes(20);
+ BOOST_REQUIRE_EQUAL(top.size(), 1U);
+ auto suffixes = top.at(reason);
+ BOOST_REQUIRE_EQUAL(suffixes.size(), 20U);
+ auto it = suffixes.begin();
+ for (size_t idx = 236; idx < 256; idx++) {
+ BOOST_CHECK_EQUAL(it->first, (DNSName(std::to_string(idx)) + qname));
+ BOOST_CHECK_EQUAL(it->second, idx);
+ ++it;
+ }
+
+ struct timespec expired = now;
+ expired.tv_sec += blockDuration + 1;
+ DynBlockMaintenance::purgeExpired(expired);
+ BOOST_CHECK(g_dynblockSMT.getLocal()->getNodes().empty());
+ }
+
+ {
+ /* === reset everything for SMT, this time we will check that we can override the 'reason' via the visitor function === */
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+ g_rings.clear();
+ g_dynblockNMG.setState(emptyNMG);
+ g_dynblockSMT.setState(emptySMT);
+
+ dbrg.setSuffixMatchRule(numberOfSeconds, reason, blockDuration, action, [](const StatNode& node, const StatNode::Stat& self, const StatNode::Stat& children) {
+ if (self.queries > 0) {
+ return std::tuple<bool, boost::optional<std::string>>(true, "blocked for a different reason");
+ }
+ return std::tuple<bool, boost::optional<std::string>>(false, boost::none);
+ });
+
+ /* insert one fake response for 255 DNS names */
+ const ComboAddress requestor("192.0.2.1");
+ for (size_t idx = 0; idx < 256; idx++) {
+ g_rings.insertResponse(now, requestor, DNSName(std::to_string(idx)) + qname, qtype, 1000 /*usec*/, size, dh, requestor /* backend, technically, but we don't care */, dnsdist::Protocol::DoUDP);
+ }
+
+ /* we apply the rules, all suffixes should be blocked */
+ dbrg.apply(now);
+
+ for (size_t idx = 0; idx < 256; idx++) {
+ const DNSName name(DNSName(std::to_string(idx)) + qname);
+ const auto* block = g_dynblockSMT.getLocal()->lookup(name);
+ BOOST_REQUIRE(block != nullptr);
+ /* simulate that:
+ - 1.rings.powerdns.com. got 1 query
+ ...
+ - 255. does 255 queries
+ */
+ block->blocks = idx;
+ }
+
+ /* now we ask for the top 20 offenders for each reason */
+ StopWatch sw;
+ sw.start();
+ auto top = DynBlockMaintenance::getTopSuffixes(20);
+ BOOST_REQUIRE_EQUAL(top.size(), 1U);
+ auto suffixes = top.at("blocked for a different reason");
+ BOOST_REQUIRE_EQUAL(suffixes.size(), 20U);
+ auto it = suffixes.begin();
+ for (size_t idx = 236; idx < 256; idx++) {
+ BOOST_CHECK_EQUAL(it->first, (DNSName(std::to_string(idx)) + qname));
+ BOOST_CHECK_EQUAL(it->second, idx);
+ ++it;
+ }
+
+ struct timespec expired = now;
+ expired.tv_sec += blockDuration + 1;
+ DynBlockMaintenance::purgeExpired(expired);
+ BOOST_CHECK(g_dynblockSMT.getLocal()->getNodes().empty());
+ }
+
+#ifdef BENCH_DYNBLOCKS
+ {
+ /* now insert 1M names */
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+ g_rings.clear();
+ g_dynblockNMG.setState(emptyNMG);
+ g_dynblockSMT.setState(emptySMT);
+
+ dbrg.setSuffixMatchRule(numberOfSeconds, reason, blockDuration, action, [](const StatNode& node, const StatNode::Stat& self, const StatNode::Stat& children) {
+ if (self.queries > 0) {
+ return std::tuple<bool, boost::optional<std::string>>(true, boost::none);
+ }
+ return std::tuple<bool, boost::optional<std::string>>(false, boost::none);
+ });
+
+ bool done = false;
+ const ComboAddress requestor("192.0.2.1");
+ for (size_t idxB = 0; !done && idxB < 256; idxB++) {
+ for (size_t idxC = 0; !done && idxC < 256; idxC++) {
+ for (size_t idxD = 0; !done && idxD < 256; idxD++) {
+ const DNSName victim(std::to_string(idxB) + "." + std::to_string(idxC) + "." + std::to_string(idxD) + qname.toString());
+ g_rings.insertResponse(now, requestor, victim, qtype, 1000 /*usec*/, size, dh, requestor /* backend, technically, but we don't care */, outgoingProtocol);
+ if (g_rings.getNumberOfQueryEntries() == 1000000) {
+ done = true;
+ break;
+ }
+ }
+ }
+ }
+
+ /* we apply the rules, all suffixes should be blocked */
+ StopWatch sw;
+ sw.start();
+ dbrg.apply(now);
+ cerr<<"added 1000000 entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+
+ sw.start();
+ auto top = DynBlockMaintenance::getTopSuffixes(20);
+ cerr<<"scanned 1000000 entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+ BOOST_CHECK_EQUAL(top.at(reason).size(), 20U);
+ BOOST_CHECK_EQUAL(top.size(), 1U);
+
+ struct timespec expired = now;
+ expired.tv_sec += blockDuration + 1;
+ sw.start();
+ DynBlockMaintenance::purgeExpired(expired);
+ cerr<<"removed 1000000 entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+ BOOST_CHECK_EQUAL(g_dynblockSMT.getLocal()->getNodes().size(), 0U);
+ }
+#endif
+
+#ifdef BENCH_DYNBLOCKS
+ {
+ /* now insert 1M clients */
+ DynBlockRulesGroup dbrg;
+ dbrg.setQuiet(true);
+ g_rings.clear();
+ g_dynblockNMG.setState(emptyNMG);
+ g_dynblockSMT.setState(emptySMT);
+ dbrg.setQueryRate(0, 0, numberOfSeconds, reason, blockDuration, action);
+
+ bool done = false;
+ for (size_t idxB = 0; !done && idxB < 256; idxB++) {
+ for (size_t idxC = 0; !done && idxC < 256; idxC++) {
+ for (size_t idxD = 0; !done && idxD < 256; idxD++) {
+ const ComboAddress requestor("192." + std::to_string(idxB) + "." + std::to_string(idxC) + "." + std::to_string(idxD));
+ g_rings.insertQuery(now, requestor, qname, qtype, size, dh, protocol);
+ if (g_rings.getNumberOfQueryEntries() == 1000000) {
+ done = true;
+ break;
+ }
+ }
+ }
+ }
+
+ /* we apply the rules, all clients should be blocked */
+ StopWatch sw;
+ sw.start();
+ dbrg.apply(now);
+ cerr<<"added "<<g_dynblockNMG.getLocal()->size()<<" entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 1000000U);
+
+ sw.start();
+ auto top = DynBlockMaintenance::getTopNetmasks(20);
+ cerr<<"scanned "<<g_dynblockNMG.getLocal()->size()<<" entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+
+ struct timespec expired = now;
+ expired.tv_sec += blockDuration + 1;
+ sw.start();
+ DynBlockMaintenance::purgeExpired(expired);
+ cerr<<"removed 1000000 entries in "<<std::to_string(sw.udiff()/1024)<<"ms"<<endl;
+ BOOST_CHECK_EQUAL(g_dynblockNMG.getLocal()->size(), 0U);
+ }
+#endif
+}
+
+BOOST_AUTO_TEST_CASE(test_NetmaskTree) {
+ NetmaskTree<int, AddressAndPortRange> nmt;
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ nmt.insert(AddressAndPortRange(ComboAddress("130.161.252.0"), 24, 0)).second = 0;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+ nmt.insert(AddressAndPortRange(ComboAddress("130.161.0.0"), 16, 0)).second = 1;
+ BOOST_CHECK_EQUAL(nmt.size(), 2U);
+ nmt.insert(AddressAndPortRange(ComboAddress("130.0.0.0"), 8, 0)).second = 2;
+ BOOST_CHECK_EQUAL(nmt.size(), 3U);
+
+ BOOST_CHECK(nmt.lookup(ComboAddress("213.244.168.210")) == nullptr);
+ auto found = nmt.lookup(ComboAddress("130.161.252.29"));
+ BOOST_REQUIRE(found);
+ BOOST_CHECK_EQUAL(found->second, 0);
+ found = nmt.lookup(ComboAddress("130.161.180.1"));
+ BOOST_CHECK(found);
+ BOOST_CHECK_EQUAL(found->second, 1);
+
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("130.255.255.255"))->second, 2);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("130.161.252.255"))->second, 0);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("130.161.253.255"))->second, 1);
+ BOOST_CHECK_EQUAL(nmt.lookup(AddressAndPortRange(ComboAddress("130.255.255.255"), 32, 16))->second, 2);
+ BOOST_CHECK_EQUAL(nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.255"), 32, 16))->second, 0);
+ BOOST_CHECK_EQUAL(nmt.lookup(AddressAndPortRange(ComboAddress("130.161.253.255"), 32, 16))->second, 1);
+
+ found = nmt.lookup(ComboAddress("130.145.180.1"));
+ BOOST_CHECK(found);
+ BOOST_CHECK_EQUAL(found->second, 2);
+
+ nmt.insert(AddressAndPortRange(ComboAddress("0.0.0.0"), 0, 0)).second = 3;
+ BOOST_CHECK_EQUAL(nmt.size(), 4U);
+ nmt.insert(AddressAndPortRange(ComboAddress("0.0.0.0"), 7, 0)).second = 4;
+ BOOST_CHECK_EQUAL(nmt.size(), 5U);
+ nmt.insert(AddressAndPortRange(ComboAddress("0.0.0.0"), 15, 0)).second = 5;
+ BOOST_CHECK_EQUAL(nmt.size(), 6U);
+ BOOST_CHECK_EQUAL(nmt.lookup(AddressAndPortRange(ComboAddress("0.0.0.0"), 0, 0))->second, 3);
+ BOOST_CHECK_EQUAL(nmt.lookup(AddressAndPortRange(ComboAddress("0.0.0.0"), 7, 0))->second, 4);
+ BOOST_CHECK_EQUAL(nmt.lookup(AddressAndPortRange(ComboAddress("0.0.0.0"), 15, 0))->second, 5);
+ BOOST_CHECK_EQUAL(nmt.lookup(AddressAndPortRange(ComboAddress("0.0.0.0"), 32, 0))->second, 5);
+
+ nmt.clear();
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ BOOST_CHECK(!nmt.lookup(ComboAddress("130.161.180.1")));
+
+ nmt.insert(AddressAndPortRange(ComboAddress("::1"), 128, 0)).second = 1;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+ nmt.insert(AddressAndPortRange(ComboAddress("::"), 0, 0)).second = 0;
+ BOOST_CHECK_EQUAL(nmt.size(), 2U);
+ nmt.insert(AddressAndPortRange(ComboAddress("fe80::"), 16, 0)).second = 2;
+ BOOST_CHECK_EQUAL(nmt.size(), 3U);
+ BOOST_CHECK(nmt.lookup(ComboAddress("130.161.253.255")) == nullptr);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("::2"))->second, 0);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("::ffff"))->second, 0);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("::1"))->second, 1);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("fe80::1"))->second, 2);
+}
+
+BOOST_AUTO_TEST_CASE(test_NetmaskTreePort) {
+ {
+ /* exact port matching */
+ NetmaskTree<int, AddressAndPortRange> nmt;
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ nmt.insert(AddressAndPortRange(ComboAddress("130.161.252.42:65534"), 32, 16)).second = 0;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("213.244.168.210"), 32, 16)) == nullptr);
+
+ auto found = nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:65534"), 32, 16));
+ BOOST_CHECK(found != nullptr);
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:65533"), 32, 16)) == nullptr);
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:65535"), 32, 16)) == nullptr);
+ }
+
+ {
+ /* /15 port matching */
+ NetmaskTree<int, AddressAndPortRange> nmt;
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ nmt.insert(AddressAndPortRange(ComboAddress("130.161.252.42:0"), 32, 15)).second = 0;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("213.244.168.210"), 32, 16)) == nullptr);
+
+ auto found = nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:0"), 32, 16));
+ BOOST_CHECK(found != nullptr);
+
+ found = nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:1"), 32, 16));
+ BOOST_CHECK(found != nullptr);
+
+ /* everything else should be a miss */
+ for (size_t idx = 2; idx <= 65535; idx++) {
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:" + std::to_string(idx)), 32, 16)) == nullptr);
+ }
+
+ nmt.clear();
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ nmt.insert(AddressAndPortRange(ComboAddress("130.161.252.42:65535"), 32, 15)).second = 0;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("213.244.168.210"), 32, 16)) == nullptr);
+
+ /* everything else should be a miss */
+ for (size_t idx = 0; idx <= 65533; idx++) {
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:" + std::to_string(idx)), 32, 16)) == nullptr);
+ }
+ found = nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:65534"), 32, 16));
+ BOOST_CHECK(found != nullptr);
+ found = nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:65535"), 32, 16));
+ BOOST_CHECK(found != nullptr);
+ }
+
+ {
+ /* /1 port matching */
+ NetmaskTree<int, AddressAndPortRange> nmt;
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ nmt.insert(AddressAndPortRange(ComboAddress("130.161.252.42:0"), 32, 1)).second = 0;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("213.244.168.210"), 32, 16)) == nullptr);
+
+ for (size_t idx = 0; idx <= 32767; idx++) {
+ auto found = nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:" + std::to_string(idx)), 32, 16));
+ BOOST_CHECK(found != nullptr);
+ }
+
+ /* everything else should be a miss */
+ for (size_t idx = 32768; idx <= 65535; idx++) {
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("130.161.252.42:" + std::to_string(idx)), 32, 16)) == nullptr);
+ }
+ }
+
+ {
+ /* Check that the port matching does not apply to IPv6, where it does not make sense */
+
+ /* /1 port matching */
+ NetmaskTree<int, AddressAndPortRange> nmt;
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ nmt.insert(AddressAndPortRange(ComboAddress("[2001:db8::1]:0"), 128, 1)).second = 0;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+
+ /* different IP, no match */
+ BOOST_CHECK(nmt.lookup(AddressAndPortRange(ComboAddress("[2001:db8::2]:0"), 128, 16)) == nullptr);
+
+ /* all ports should match */
+ for (size_t idx = 1; idx <= 65535; idx++) {
+ auto found = nmt.lookup(AddressAndPortRange(ComboAddress("[2001:db8::1]:" + std::to_string(idx)), 128, 16));
+ BOOST_CHECK(found != nullptr);
+ }
+ }
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-dnsdistkvs_cc.cc b/test-dnsdistkvs_cc.cc
new file mode 100644
index 0000000..cc21b1f
--- /dev/null
+++ b/test-dnsdistkvs_cc.cc
@@ -0,0 +1,443 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "dnsdist-kvs.hh"
+
+#if defined(HAVE_LMDB) || defined(HAVE_CDB)
+static const ComboAddress v4ToMask("203.0.113.255");
+static const ComboAddress v6ToMask("2001:db8:ff:ff:ff:ff:ff:ff");
+
+static void doKVSChecks(std::unique_ptr<KeyValueStore>& kvs, const ComboAddress& lc, const ComboAddress& rem, const DNSQuestion& dq, const DNSName& plaintextDomain)
+{
+ /* source IP */
+ {
+ auto lookupKey = make_unique<KeyValueLookupKeySourceIP>(32, 128, false);
+ std::string value;
+ /* local address is not in the db, remote is */
+ BOOST_CHECK_EQUAL(kvs->getValue(std::string(reinterpret_cast<const char*>(&lc.sin4.sin_addr.s_addr), sizeof(lc.sin4.sin_addr.s_addr)), value), false);
+ BOOST_CHECK_EQUAL(kvs->keyExists(std::string(reinterpret_cast<const char*>(&lc.sin4.sin_addr.s_addr), sizeof(lc.sin4.sin_addr.s_addr))), false);
+ BOOST_CHECK(kvs->keyExists(std::string(reinterpret_cast<const char*>(&dq.remote->sin4.sin_addr.s_addr), sizeof(dq.remote->sin4.sin_addr.s_addr))));
+
+ auto keys = lookupKey->getKeys(dq);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the remote addr");
+ }
+ }
+
+ /* masked source IP */
+ {
+ auto lookupKey = make_unique<KeyValueLookupKeySourceIP>(25, 65, false);
+
+ auto keys = lookupKey->getKeys(v4ToMask);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ std::string value;
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the masked v4 addr");
+ }
+
+ keys = lookupKey->getKeys(v6ToMask);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ std::string value;
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the masked v6 addr");
+ }
+ }
+
+ /* source IP + port */
+ {
+ auto lookupKey = make_unique<KeyValueLookupKeySourceIP>(32, 128, true);
+ std::string value;
+ BOOST_CHECK(kvs->keyExists(std::string(reinterpret_cast<const char*>(&rem.sin4.sin_addr.s_addr), sizeof(rem.sin4.sin_addr.s_addr)) + std::string(reinterpret_cast<const char*>(&rem.sin4.sin_port), sizeof(rem.sin4.sin_port))));
+
+ auto keys = lookupKey->getKeys(dq);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the remote addr + port");
+ }
+ }
+
+ const DNSName subdomain = DNSName("sub") + *dq.qname;
+ const DNSName notPDNS("not-powerdns.com.");
+
+ /* qname match, in wire format */
+ {
+ std::string value;
+ auto lookupKey = make_unique<KeyValueLookupKeyQName>(true);
+ auto keys = lookupKey->getKeys(dq);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the qname");
+ }
+
+ /* other domain, should not match */
+ keys = lookupKey->getKeys(notPDNS);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+
+ /* subdomain, should not match */
+ keys = lookupKey->getKeys(subdomain);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+
+ /* this domain was inserted in plaintext, the wire format lookup should not match */
+ keys = lookupKey->getKeys(plaintextDomain);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+ }
+
+ /* qname match, in plain text */
+ {
+ std::string value;
+ auto lookupKey = make_unique<KeyValueLookupKeyQName>(false);
+ auto keys = lookupKey->getKeys(dq);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+
+ /* other domain, should not match */
+ keys = lookupKey->getKeys(notPDNS);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+
+ /* subdomain, should not match */
+ keys = lookupKey->getKeys(subdomain);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+
+ /* this domain was inserted in plaintext, so it should match */
+ keys = lookupKey->getKeys(plaintextDomain);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the plaintext domain");
+ }
+ }
+
+ /* suffix match in wire format */
+ {
+ auto lookupKey = make_unique<KeyValueLookupKeySuffix>(0, true);
+ auto keys = lookupKey->getKeys(dq);
+ BOOST_CHECK_EQUAL(keys.size(), dq.qname->countLabels());
+ BOOST_REQUIRE(!keys.empty());
+ BOOST_CHECK_EQUAL(keys.at(0), dq.qname->toDNSStringLC());
+ std::string value;
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(0), value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the qname");
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(1), value), false);
+
+ /* other domain, should not match */
+ keys = lookupKey->getKeys(notPDNS);
+ BOOST_CHECK_EQUAL(keys.size(), notPDNS.countLabels());
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+
+ /* subdomain, the second key should match */
+ keys = lookupKey->getKeys(subdomain);
+ BOOST_REQUIRE_EQUAL(keys.size(), subdomain.countLabels());
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(0), value), false);
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(1), value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the qname");
+
+ /* this domain was inserted in plaintext, the wire format lookup should not match */
+ keys = lookupKey->getKeys(plaintextDomain);
+ BOOST_CHECK_EQUAL(keys.size(), plaintextDomain.countLabels());
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+ }
+
+ /* suffix match in plain text */
+ {
+ auto lookupKey = make_unique<KeyValueLookupKeySuffix>(0, false);
+ auto keys = lookupKey->getKeys(dq);
+ BOOST_CHECK_EQUAL(keys.size(), dq.qname->countLabels());
+ BOOST_REQUIRE(!keys.empty());
+ BOOST_CHECK_EQUAL(keys.at(0), dq.qname->toStringRootDot());
+ std::string value;
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(0), value), false);
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(1), value), false);
+
+ /* other domain, should not match */
+ keys = lookupKey->getKeys(notPDNS);
+ BOOST_CHECK_EQUAL(keys.size(), notPDNS.countLabels());
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+
+ /* subdomain, should not match in plain text */
+ keys = lookupKey->getKeys(subdomain);
+ BOOST_REQUIRE_EQUAL(keys.size(), subdomain.countLabels());
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(kvs->getValue(key, value), false);
+ }
+
+ /* this domain was inserted in plaintext, it should match */
+ keys = lookupKey->getKeys(plaintextDomain);
+ BOOST_REQUIRE_EQUAL(keys.size(), plaintextDomain.countLabels());
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(0), value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the plaintext domain");
+ }
+
+ /* suffix match in wire format, we require at least 2 labels */
+ {
+ auto lookupKey = make_unique<KeyValueLookupKeySuffix>(2, true);
+ auto keys = lookupKey->getKeys(dq);
+ BOOST_CHECK_EQUAL(keys.size(), 1U);
+ BOOST_REQUIRE(!keys.empty());
+ BOOST_CHECK_EQUAL(keys.at(0), dq.qname->toDNSStringLC());
+ std::string value;
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(0), value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the qname");
+ value.clear();
+
+ /* subdomain */
+ keys = lookupKey->getKeys(subdomain);
+ BOOST_REQUIRE_EQUAL(keys.size(), 2U);
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(0), value), false);
+ BOOST_CHECK_EQUAL(kvs->getValue(keys.at(1), value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value for the qname");
+ }
+}
+
+#if defined(HAVE_LMDB)
+static void doKVSRangeChecks(std::unique_ptr<KeyValueStore>& kvs)
+{
+ {
+ /* do a range-based lookup */
+ const ComboAddress first("2001:0db8:0000:0000:0000:0000:0000:0000");
+ const ComboAddress inside("2001:0db8:7fff:ffff:ffff:ffff:ffff:ffff");
+ const ComboAddress last("2001:0db8:ffff:ffff:ffff:ffff:ffff:ffff");
+ const ComboAddress notInRange1("2001:0db7:ffff:ffff:ffff:ffff:ffff:ffff");
+ const ComboAddress notInRange2("2001:0db9:0000:0000:0000:0000:0000:0000");
+ const std::string expectedValue = std::string(reinterpret_cast<const char*>(&first.sin6.sin6_addr.s6_addr), sizeof(first.sin6.sin6_addr.s6_addr)) + std::string("any other data");
+
+ auto check = [expectedValue, &kvs](const ComboAddress& key, bool shouldBeFound) {
+ // cerr<<"Checking "<<key.toString()<<", should "<<(shouldBeFound ? "" : "NOT ")<<"be found"<<endl;
+ auto lookupKey = std::string(reinterpret_cast<const char*>(&key.sin6.sin6_addr.s6_addr), sizeof(key.sin6.sin6_addr.s6_addr));
+ std::string value;
+ BOOST_CHECK_EQUAL(kvs->getRangeValue(lookupKey, value), shouldBeFound);
+ if (shouldBeFound) {
+ BOOST_CHECK_EQUAL(value, expectedValue);
+ }
+ };
+
+ check(first, true);
+ check(last, true);
+ check(inside, true);
+ check(notInRange1, false);
+ check(notInRange2, false);
+ }
+
+ {
+ const ComboAddress first("192.0.2.1:0");
+ const ComboAddress inside("192.0.2.1:42");
+ const ComboAddress last("192.0.2.1:16383");
+ const ComboAddress notInRange1("192.0.2.0:65535");
+ const ComboAddress notInRange2("192.0.2.1:16384");
+ const std::string expectedValue = std::string(reinterpret_cast<const char*>(&first.sin4.sin_addr.s_addr), sizeof(first.sin4.sin_addr.s_addr)) + std::string(reinterpret_cast<const char*>(&first.sin4.sin_port), sizeof(first.sin4.sin_port)) + std::string("any other data");
+
+ auto check = [expectedValue, &kvs](const ComboAddress& key, bool shouldBeFound) {
+ // cerr<<"Checking "<<key.toStringWithPort()<<", should "<<(shouldBeFound ? "" : "NOT ")<<"be found"<<endl;
+ auto lookupKey = std::string(reinterpret_cast<const char*>(&key.sin4.sin_addr.s_addr), sizeof(key.sin4.sin_addr.s_addr)) + std::string(reinterpret_cast<const char*>(&key.sin4.sin_port), sizeof(key.sin4.sin_port));
+ std::string value;
+ BOOST_CHECK_EQUAL(kvs->getRangeValue(lookupKey, value), shouldBeFound);
+ if (shouldBeFound) {
+ BOOST_CHECK_EQUAL(value, expectedValue);
+ }
+ };
+
+ check(first, true);
+ check(last, true);
+ check(inside, true);
+ check(notInRange1, false);
+ check(notInRange2, false);
+ }
+
+}
+#endif // defined(HAVE_LMDB)
+
+#endif // defined(HAVE_LMDB) || defined(HAVE_CDB)
+
+BOOST_AUTO_TEST_SUITE(dnsdistkvs_cc)
+
+#ifdef HAVE_LMDB
+BOOST_AUTO_TEST_CASE(test_LMDB) {
+
+ DNSName qname("powerdns.com.");
+ DNSName plaintextDomain("powerdns.org.");
+ uint16_t qtype = QType::A;
+ uint16_t qclass = QClass::IN;
+ ComboAddress lc("192.0.2.1:53");
+ ComboAddress rem("192.0.2.128:42");
+ PacketBuffer packet(sizeof(dnsheader));
+ auto proto = dnsdist::Protocol::DoUDP;
+ struct timespec queryRealTime;
+ gettime(&queryRealTime, true);
+ struct timespec expiredTime;
+ /* the internal QPS limiter does not use the real time */
+ gettime(&expiredTime);
+
+ DNSQuestion dq(&qname, qtype, qclass, &lc, &rem, packet, proto, &queryRealTime);
+ ComboAddress v4Masked(v4ToMask);
+ ComboAddress v6Masked(v6ToMask);
+ v4Masked.truncate(25);
+ v6Masked.truncate(65);
+
+ const ComboAddress firstRangeAddr6("2001:0db8:0000:0000:0000:0000:0000:0000");
+ const ComboAddress lastRangeAddr6("2001:0db8:ffff:ffff:ffff:ffff:ffff:ffff");
+ const ComboAddress firstRangeAddr4("192.0.2.1:0");
+ const ComboAddress lastRangeAddr4("192.0.2.1:16383");
+
+ const string dbPath("/tmp/test_lmdb.XXXXXX");
+ {
+ MDBEnv env(dbPath.c_str(), MDB_NOSUBDIR, 0600);
+ auto transaction = env.getRWTransaction();
+ auto dbi = transaction->openDB("db-name", MDB_CREATE);
+ transaction->put(dbi, MDBInVal(std::string(reinterpret_cast<const char*>(&rem.sin4.sin_addr.s_addr), sizeof(rem.sin4.sin_addr.s_addr))), MDBInVal("this is the value for the remote addr"));
+ transaction->put(dbi, MDBInVal(std::string(reinterpret_cast<const char*>(&rem.sin4.sin_addr.s_addr), sizeof(rem.sin4.sin_addr.s_addr)) + std::string(reinterpret_cast<const char*>(&rem.sin4.sin_port), sizeof(rem.sin4.sin_port))), MDBInVal("this is the value for the remote addr + port"));
+ transaction->put(dbi, MDBInVal(std::string(reinterpret_cast<const char*>(&v4Masked.sin4.sin_addr.s_addr), sizeof(v4Masked.sin4.sin_addr.s_addr))), MDBInVal("this is the value for the masked v4 addr"));
+ transaction->put(dbi, MDBInVal(std::string(reinterpret_cast<const char*>(&v6Masked.sin6.sin6_addr.s6_addr), sizeof(v6Masked.sin6.sin6_addr.s6_addr))), MDBInVal("this is the value for the masked v6 addr"));
+ transaction->put(dbi, MDBInVal(qname.toDNSStringLC()), MDBInVal("this is the value for the qname"));
+ transaction->put(dbi, MDBInVal(plaintextDomain.toStringRootDot()), MDBInVal("this is the value for the plaintext domain"));
+
+ transaction->commit();
+ }
+
+ {
+ MDBEnv env(dbPath.c_str(), MDB_NOSUBDIR, 0600);
+ auto transaction = env.getRWTransaction();
+ auto dbi = transaction->openDB("range-db-name", MDB_CREATE);
+ /* range-based lookups */
+ std::string value = std::string(reinterpret_cast<const char*>(&firstRangeAddr6.sin6.sin6_addr.s6_addr), sizeof(firstRangeAddr6.sin6.sin6_addr.s6_addr)) + std::string("any other data");
+ transaction->put(dbi, MDBInVal(std::string(reinterpret_cast<const char*>(&lastRangeAddr6.sin6.sin6_addr.s6_addr), sizeof(lastRangeAddr6.sin6.sin6_addr.s6_addr))), MDBInVal(value));
+
+ value = std::string(reinterpret_cast<const char*>(&firstRangeAddr4.sin4.sin_addr.s_addr), sizeof(firstRangeAddr4.sin4.sin_addr.s_addr)) + std::string(reinterpret_cast<const char*>(&firstRangeAddr4.sin4.sin_port), sizeof(firstRangeAddr4.sin4.sin_port)) + std::string("any other data");
+ transaction->put(dbi, MDBInVal(std::string(reinterpret_cast<const char*>(&lastRangeAddr4.sin4.sin_addr.s_addr), sizeof(lastRangeAddr4.sin4.sin_addr.s_addr)) + std::string(reinterpret_cast<const char*>(&lastRangeAddr4.sin4.sin_port), sizeof(lastRangeAddr4.sin4.sin_port))), MDBInVal(value));
+
+ transaction->commit();
+ }
+
+ std::unique_ptr<KeyValueStore> lmdb = std::make_unique<LMDBKVStore>(dbPath, "db-name");
+ doKVSChecks(lmdb, lc, rem, dq, plaintextDomain);
+ lmdb.reset();
+
+ lmdb = std::make_unique<LMDBKVStore>(dbPath, "range-db-name");
+ doKVSRangeChecks(lmdb);
+ /*
+ std::string value;
+ DTime dt;
+ dt.set();
+ for (size_t idx = 0; idx < 10000000; idx++) {
+ auto keys = lookupKey->getKeys(dq);
+ for (const auto& key : keys) {
+ value.clear();
+ BOOST_CHECK_EQUAL(lmdb->getValue(key, value), true);
+ BOOST_CHECK_EQUAL(value, "this is the value of the tag");
+ }
+ }
+ cerr<<dt.udiff()/1000/1000<<endl;
+ */
+}
+#endif /* HAVE_LMDB */
+
+#ifdef HAVE_CDB
+BOOST_AUTO_TEST_CASE(test_CDB) {
+
+ DNSName qname("powerdns.com.");
+ DNSName plaintextDomain("powerdns.org.");
+ uint16_t qtype = QType::A;
+ uint16_t qclass = QClass::IN;
+ ComboAddress lc("192.0.2.1:53");
+ ComboAddress rem("192.0.2.128:42");
+ PacketBuffer packet(sizeof(dnsheader));
+ auto proto = dnsdist::Protocol::DoUDP;
+ struct timespec queryRealTime;
+ gettime(&queryRealTime, true);
+ struct timespec expiredTime;
+ /* the internal QPS limiter does not use the real time */
+ gettime(&expiredTime);
+
+ DNSQuestion dq(&qname, qtype, qclass, &lc, &rem, packet, proto, &queryRealTime);
+ ComboAddress v4Masked(v4ToMask);
+ ComboAddress v6Masked(v6ToMask);
+ v4Masked.truncate(25);
+ v6Masked.truncate(65);
+
+ char db[] = "/tmp/test_cdb.XXXXXX";
+ {
+ int fd = mkstemp(db);
+ BOOST_REQUIRE(fd >= 0);
+ CDBWriter writer(fd);
+ BOOST_REQUIRE(writer.addEntry(std::string(reinterpret_cast<const char*>(&rem.sin4.sin_addr.s_addr), sizeof(rem.sin4.sin_addr.s_addr)), "this is the value for the remote addr"));
+ BOOST_REQUIRE(writer.addEntry(std::string(reinterpret_cast<const char*>(&rem.sin4.sin_addr.s_addr), sizeof(rem.sin4.sin_addr.s_addr)) + std::string(reinterpret_cast<const char*>(&rem.sin4.sin_port), sizeof(rem.sin4.sin_port)), "this is the value for the remote addr + port"));
+ BOOST_REQUIRE(writer.addEntry(std::string(reinterpret_cast<const char*>(&v4Masked.sin4.sin_addr.s_addr), sizeof(v4Masked.sin4.sin_addr.s_addr)), "this is the value for the masked v4 addr"));
+ BOOST_REQUIRE(writer.addEntry(std::string(reinterpret_cast<const char*>(&v6Masked.sin6.sin6_addr.s6_addr), sizeof(v6Masked.sin6.sin6_addr.s6_addr)), "this is the value for the masked v6 addr"));
+ BOOST_REQUIRE(writer.addEntry(qname.toDNSStringLC(), "this is the value for the qname"));
+ BOOST_REQUIRE(writer.addEntry(plaintextDomain.toStringRootDot(), "this is the value for the plaintext domain"));
+ writer.close();
+ }
+
+ std::unique_ptr<KeyValueStore> cdb = std::make_unique<CDBKVStore>(db, 0);
+ doKVSChecks(cdb, lc, rem, dq, plaintextDomain);
+
+ /*
+ std::string value;
+ DTime dt;
+ dt.set();
+ auto lookupKey = make_unique<KeyValueLookupKeySourceIP>();
+ for (size_t idx = 0; idx < 100000000; idx++) {
+ auto keys = lookupKey->getKeys(dq);
+ for (const auto& key : keys) {
+ if (!cdb->getValue(key, value)) {
+ cerr<<"key not found"<<endl;
+ break;
+ }
+ if (value != "this is the value for the remote addr") {
+ cerr<<"invalid value found"<<endl;
+ break;
+ }
+ }
+ }
+ cerr<<dt.udiff()/1000/1000<<endl;
+ */
+}
+#endif /* HAVE_CDB */
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-dnsdistlbpolicies_cc.cc b/test-dnsdistlbpolicies_cc.cc
new file mode 100644
index 0000000..d1f5080
--- /dev/null
+++ b/test-dnsdistlbpolicies_cc.cc
@@ -0,0 +1,847 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "dnsdist.hh"
+#include "dnsdist-lua.hh"
+#include "dnsdist-lua-ffi.hh"
+#include "dolog.hh"
+
+uint16_t g_maxOutstanding{std::numeric_limits<uint16_t>::max()};
+
+#include "ext/luawrapper/include/LuaContext.hpp"
+LockGuarded<LuaContext> g_lua{LuaContext()};
+
+bool g_snmpEnabled{false};
+bool g_snmpTrapsEnabled{false};
+DNSDistSNMPAgent* g_snmpAgent{nullptr};
+
+#if BENCH_POLICIES
+bool g_verbose{true};
+bool g_syslog{true};
+#include "dnsdist-rings.hh"
+Rings g_rings;
+GlobalStateHolder<NetmaskTree<DynBlock>> g_dynblockNMG;
+GlobalStateHolder<SuffixMatchTree<DynBlock>> g_dynblockSMT;
+#endif /* BENCH_POLICIES */
+
+GlobalStateHolder<pools_t> g_pools;
+std::vector<std::unique_ptr<ClientState>> g_frontends;
+
+/* add stub implementations, we don't want to include the corresponding object files
+ and their dependencies */
+
+#ifdef HAVE_DNS_OVER_HTTPS
+std::unordered_map<std::string, std::string> DOHUnit::getHTTPHeaders() const
+{
+ return {};
+}
+
+std::string DOHUnit::getHTTPPath() const
+{
+ return "";
+}
+
+std::string DOHUnit::getHTTPHost() const
+{
+ return "";
+}
+
+std::string DOHUnit::getHTTPScheme() const
+{
+ return "";
+}
+
+std::string DOHUnit::getHTTPQueryString() const
+{
+ return "";
+}
+
+void DOHUnit::setHTTPResponse(uint16_t statusCode, PacketBuffer&& body_, const std::string& contentType_)
+{
+}
+#endif /* HAVE_DNS_OVER_HTTPS */
+
+std::string DNSQuestion::getTrailingData() const
+{
+ return "";
+}
+
+bool DNSQuestion::setTrailingData(const std::string& tail)
+{
+ return false;
+}
+
+bool DNSDistSNMPAgent::sendDNSTrap(const DNSQuestion& dq, const std::string& reason)
+{
+ return false;
+}
+
+void setLuaNoSideEffect()
+{
+}
+
+DNSAction::Action SpoofAction::operator()(DNSQuestion* dq, std::string* ruleresult) const
+{
+ return DNSAction::Action::None;
+}
+
+string g_outputBuffer;
+
+static DNSQuestion getDQ(const DNSName* providedName = nullptr)
+{
+ static const DNSName qname("powerdns.com.");
+ static const ComboAddress lc("127.0.0.1:53");
+ static const ComboAddress rem("192.0.2.1:42");
+ static struct timespec queryRealTime;
+ static PacketBuffer packet(sizeof(dnsheader));
+
+ uint16_t qtype = QType::A;
+ uint16_t qclass = QClass::IN;
+ auto proto = dnsdist::Protocol::DoUDP;
+ gettime(&queryRealTime, true);
+
+ DNSQuestion dq(providedName ? providedName : &qname, qtype, qclass, &lc, &rem, packet, proto, &queryRealTime);
+ return dq;
+}
+
+static void benchPolicy(const ServerPolicy& pol)
+{
+#if BENCH_POLICIES
+ bool existingVerboseValue = g_verbose;
+ g_verbose = false;
+
+ std::vector<DNSName> names;
+ names.reserve(1000);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ names.push_back(DNSName("powerdns-" + std::to_string(idx) + ".com."));
+ }
+ ServerPolicy::NumberedServerVector servers;
+ for (size_t idx = 1; idx <= 10; idx++) {
+ servers.push_back({ idx, std::make_shared<DownstreamState>(ComboAddress("192.0.2." + std::to_string(idx) + ":53")) });
+ servers.at(idx - 1).second->setUp();
+ /* we need to have a weight of at least 1000 to get an optimal repartition with the consistent hashing algo */
+ servers.at(idx - 1).second->setWeight(1000);
+ /* make sure that the hashes have been computed */
+ servers.at(idx - 1).second->hash();
+ }
+
+ StopWatch sw;
+ sw.start();
+ for (size_t idx = 0; idx < 1000; idx++) {
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ }
+ }
+ cerr<<pol.name<<" took "<<std::to_string(sw.udiff())<<" us for "<<names.size()<<endl;
+
+ g_verbose = existingVerboseValue;
+#endif /* BENCH_POLICIES */
+}
+
+static void resetLuaContext()
+{
+ /* we need to reset this before cleaning the Lua state because the server policy might holds
+ a reference to a Lua function (Lua policies) */
+ g_policy.setState(ServerPolicy("leastOutstanding", leastOutstanding, false));
+ *(g_lua.lock()) = LuaContext();
+}
+
+BOOST_AUTO_TEST_SUITE(dnsdistlbpolicies)
+
+BOOST_AUTO_TEST_CASE(test_firstAvailable) {
+ auto dq = getDQ();
+
+ ServerPolicy pol{"firstAvailable", firstAvailable, false};
+ ServerPolicy::NumberedServerVector servers;
+ servers.push_back({ 1, std::make_shared<DownstreamState>(ComboAddress("192.0.2.1:53")) });
+
+ /* servers start as 'down' */
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_CHECK(server == nullptr);
+
+ /* mark the server as 'up' */
+ servers.at(0).second->setUp();
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_CHECK(server != nullptr);
+
+ /* add a second server, we should still get the first one */
+ servers.push_back({ 2, std::make_shared<DownstreamState>(ComboAddress("192.0.2.2:53")) });
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(0).second);
+
+ /* mark the first server as 'down', second as 'up' */
+ servers.at(0).second->setDown();
+ servers.at(1).second->setUp();
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(1).second);
+
+ benchPolicy(pol);
+}
+
+BOOST_AUTO_TEST_CASE(test_firstAvailableWithOrderAndQPS) {
+ auto dq = getDQ();
+ size_t qpsLimit = 10;
+
+ ServerPolicy pol{"firstAvailable", firstAvailable, false};
+ ServerPolicy::NumberedServerVector servers;
+ servers.push_back({ 1, std::make_shared<DownstreamState>(ComboAddress("192.0.2.1:53")) });
+ servers.push_back({ 2, std::make_shared<DownstreamState>(ComboAddress("192.0.2.2:53")) });
+ /* Second server has a higher order, so most queries should be routed to the first (remember that
+ we need to keep them ordered!).
+ However the first server has a QPS limit at 10 qps, so any query above that should be routed
+ to the second server. */
+ servers.at(0).second->order = 1;
+ servers.at(1).second->order = 2;
+ servers.at(0).second->qps = QPSLimiter(qpsLimit, qpsLimit);
+ /* mark the servers as 'up' */
+ servers.at(0).second->setUp();
+ servers.at(1).second->setUp();
+
+ /* the first queries under the QPS limit should be
+ sent to the first server */
+ for (size_t idx = 0; idx < qpsLimit; idx++) {
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(0).second);
+ server->incQueriesCount();
+ }
+
+ /* then to the second server */
+ for (size_t idx = 0; idx < 100; idx++) {
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(1).second);
+ server->incQueriesCount();
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_roundRobin) {
+ auto dq = getDQ();
+
+ ServerPolicy pol{"roundrobin", roundrobin, false};
+ ServerPolicy::NumberedServerVector servers;
+
+ /* selecting a server on an empty server list */
+ g_roundrobinFailOnNoServer = false;
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_CHECK(server == nullptr);
+
+ servers.push_back({ 1, std::make_shared<DownstreamState>(ComboAddress("192.0.2.1:53")) });
+
+ /* servers start as 'down' but the RR policy returns a server unless g_roundrobinFailOnNoServer is set */
+ g_roundrobinFailOnNoServer = true;
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_CHECK(server == nullptr);
+ g_roundrobinFailOnNoServer = false;
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_CHECK(server != nullptr);
+
+ /* mark the server as 'up' */
+ servers.at(0).second->setUp();
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_CHECK(server != nullptr);
+
+ /* add a second server, we should get the first one then the second one */
+ servers.push_back({ 2, std::make_shared<DownstreamState>(ComboAddress("192.0.2.2:53")) });
+ servers.at(1).second->setUp();
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(0).second);
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(1).second);
+
+ /* mark the first server as 'down', second as 'up' */
+ servers.at(0).second->setDown();
+ servers.at(1).second->setUp();
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(1).second);
+
+ std::map<std::shared_ptr<DownstreamState>, uint64_t> serversMap;
+ /* mark all servers 'up' */
+ for (auto& s : servers) {
+ s.second->setUp();
+ serversMap[s.second] = 0;
+ }
+
+ for (size_t idx = 0; idx < 1000; idx++) {
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+ uint64_t total = 0;
+ for (const auto& entry : serversMap) {
+ BOOST_CHECK_EQUAL(entry.second, 1000 / servers.size());
+ total += entry.second;
+ }
+ BOOST_CHECK_EQUAL(total, 1000U);
+
+ benchPolicy(pol);
+}
+
+BOOST_AUTO_TEST_CASE(test_leastOutstanding) {
+ auto dq = getDQ();
+
+ ServerPolicy pol{"leastOutstanding", leastOutstanding, false};
+ ServerPolicy::NumberedServerVector servers;
+ servers.push_back({ 1, std::make_shared<DownstreamState>(ComboAddress("192.0.2.1:53")) });
+
+ /* servers start as 'down' */
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_CHECK(server == nullptr);
+
+ /* mark the server as 'up' */
+ servers.at(0).second->setUp();
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_CHECK(server != nullptr);
+
+ /* add a second server, we should still get the first one */
+ servers.push_back({ 2, std::make_shared<DownstreamState>(ComboAddress("192.0.2.2:53")) });
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(0).second);
+
+ /* mark the first server as 'down', second as 'up' */
+ servers.at(0).second->setDown();
+ servers.at(1).second->setUp();
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(1).second);
+
+ /* mark both servers as 'up', increase the outstanding count of the first one */
+ servers.at(0).second->setUp();
+ servers.at(0).second->outstanding = 42;
+ servers.at(1).second->setUp();
+ server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(server != nullptr);
+ BOOST_CHECK(server == servers.at(1).second);
+
+ benchPolicy(pol);
+}
+
+BOOST_AUTO_TEST_CASE(test_wrandom) {
+ auto dq = getDQ();
+
+ ServerPolicy pol{"wrandom", wrandom, false};
+ ServerPolicy::NumberedServerVector servers;
+ std::map<std::shared_ptr<DownstreamState>, uint64_t> serversMap;
+ for (size_t idx = 1; idx <= 10; idx++) {
+ servers.push_back({ idx, std::make_shared<DownstreamState>(ComboAddress("192.0.2." + std::to_string(idx) + ":53")) });
+ serversMap[servers.at(idx - 1).second] = 0;
+ servers.at(idx - 1).second->setUp();
+ }
+
+ benchPolicy(pol);
+
+ for (size_t idx = 0; idx < 1000; idx++) {
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+ uint64_t total = 0;
+ for (const auto& entry : serversMap) {
+ BOOST_CHECK_GT(entry.second, 0U);
+ BOOST_CHECK_GT(entry.second, (1000 / servers.size() / 2));
+ BOOST_CHECK_LT(entry.second, (1000 / servers.size() * 2));
+ total += entry.second;
+ }
+ BOOST_CHECK_EQUAL(total, 1000U);
+
+ /* reset */
+ for (auto& entry : serversMap) {
+ entry.second = 0;
+ BOOST_CHECK_EQUAL(entry.first->weight, 1);
+ }
+
+ /* reset */
+ for (auto& entry : serversMap) {
+ entry.second = 0;
+ BOOST_CHECK_EQUAL(entry.first->weight, 1);
+ }
+ /* change the weight of the last server to 100, default is 1 */
+ servers.at(servers.size()-1).second->weight = 100;
+
+ for (size_t idx = 0; idx < 1000; idx++) {
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ total = 0;
+ uint64_t totalW = 0;
+ for (const auto& entry : serversMap) {
+ total += entry.second;
+ totalW += entry.first->weight;
+ }
+ BOOST_CHECK_EQUAL(total, 1000U);
+ auto last = servers.at(servers.size()-1).second;
+ const auto got = serversMap[last];
+ float expected = (1000 * 1.0 * last->weight) / totalW;
+ BOOST_CHECK_GT(got, expected / 2);
+ BOOST_CHECK_LT(got, expected * 2);
+}
+
+BOOST_AUTO_TEST_CASE(test_whashed) {
+ std::vector<DNSName> names;
+ names.reserve(1000);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ names.push_back(DNSName("powerdns-" + std::to_string(idx) + ".com."));
+ }
+
+ ServerPolicy pol{"whashed", whashed, false};
+ ServerPolicy::NumberedServerVector servers;
+ std::map<std::shared_ptr<DownstreamState>, uint64_t> serversMap;
+ for (size_t idx = 1; idx <= 10; idx++) {
+ servers.push_back({ idx, std::make_shared<DownstreamState>(ComboAddress("192.0.2." + std::to_string(idx) + ":53")) });
+ serversMap[servers.at(idx - 1).second] = 0;
+ servers.at(idx - 1).second->setUp();
+ }
+
+ benchPolicy(pol);
+
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ uint64_t total = 0;
+ for (const auto& entry : serversMap) {
+ BOOST_CHECK_GT(entry.second, 0U);
+ BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
+ BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
+ total += entry.second;
+ }
+ BOOST_CHECK_EQUAL(total, names.size());
+
+ /* reset */
+ for (auto& entry : serversMap) {
+ entry.second = 0;
+ BOOST_CHECK_EQUAL(entry.first->weight, 1);
+ }
+
+ /* request 1000 times the same name, we should go to the same server every time */
+ {
+ auto dq = getDQ(&names.at(0));
+ auto server = pol.getSelectedBackend(servers, dq);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ BOOST_CHECK(pol.getSelectedBackend(servers, dq) == server);
+ }
+ }
+
+ /* reset */
+ for (auto& entry : serversMap) {
+ entry.second = 0;
+ BOOST_CHECK_EQUAL(entry.first->weight, 1);
+ }
+ /* change the weight of the last server to 100, default is 1 */
+ servers.at(servers.size()-1).second->setWeight(100);
+
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ total = 0;
+ uint64_t totalW = 0;
+ for (const auto& entry : serversMap) {
+ total += entry.second;
+ totalW += entry.first->weight;
+ }
+ BOOST_CHECK_EQUAL(total, names.size());
+ auto last = servers.at(servers.size()-1).second;
+ const auto got = serversMap[last];
+ float expected = (names.size() * 1.0 * last->weight) / totalW;
+ BOOST_CHECK_GT(got, expected / 2);
+ BOOST_CHECK_LT(got, expected * 2);
+}
+
+BOOST_AUTO_TEST_CASE(test_chashed) {
+ bool existingVerboseValue = g_verbose;
+ g_verbose = false;
+
+ std::vector<DNSName> names;
+ names.reserve(1000);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ names.push_back(DNSName("powerdns-" + std::to_string(idx) + ".com."));
+ }
+
+ ServerPolicy pol{"chashed", chashed, false};
+ ServerPolicy::NumberedServerVector servers;
+ std::map<std::shared_ptr<DownstreamState>, uint64_t> serversMap;
+ for (size_t idx = 1; idx <= 10; idx++) {
+ servers.push_back({ idx, std::make_shared<DownstreamState>(ComboAddress("192.0.2." + std::to_string(idx) + ":53")) });
+ serversMap[servers.at(idx - 1).second] = 0;
+ servers.at(idx - 1).second->setUp();
+ /* we need to have a weight of at least 1000 to get an optimal repartition with the consistent hashing algo */
+ servers.at(idx - 1).second->setWeight(1000);
+ /* make sure that the hashes have been computed */
+ servers.at(idx - 1).second->hash();
+ }
+
+ benchPolicy(pol);
+
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ uint64_t total = 0;
+ for (const auto& entry : serversMap) {
+ BOOST_CHECK_GT(entry.second, 0U);
+ BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
+ BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
+ total += entry.second;
+ }
+ BOOST_CHECK_EQUAL(total, names.size());
+
+ /* reset */
+ for (auto& entry : serversMap) {
+ entry.second = 0;
+ BOOST_CHECK_EQUAL(entry.first->weight, 1000);
+ }
+
+ /* request 1000 times the same name, we should go to the same server every time */
+ {
+ auto dq = getDQ(&names.at(0));
+ auto server = pol.getSelectedBackend(servers, dq);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ BOOST_CHECK(pol.getSelectedBackend(servers, dq) == server);
+ }
+ }
+
+ /* reset */
+ for (auto& entry : serversMap) {
+ entry.second = 0;
+ BOOST_CHECK_EQUAL(entry.first->weight, 1000);
+ }
+ /* change the weight of the last server to 100000, others stay at 1000 */
+ servers.at(servers.size()-1).second->setWeight(100000);
+
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ total = 0;
+ uint64_t totalW = 0;
+ for (const auto& entry : serversMap) {
+ total += entry.second;
+ totalW += entry.first->weight;
+ }
+ BOOST_CHECK_EQUAL(total, names.size());
+ auto last = servers.at(servers.size()-1).second;
+ const auto got = serversMap[last];
+ float expected = (names.size() * 1.0 * last->weight) / totalW;
+ BOOST_CHECK_GT(got, expected / 2);
+ BOOST_CHECK_LT(got, expected * 2);
+
+ g_verbose = existingVerboseValue;
+}
+
+BOOST_AUTO_TEST_CASE(test_lua) {
+ std::vector<DNSName> names;
+ names.reserve(1000);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ names.push_back(DNSName("powerdns-" + std::to_string(idx) + ".com."));
+ }
+
+ static const std::string policySetupStr = R"foo(
+ local counter = 0
+ function luaroundrobin(servers, dq)
+ counter = counter + 1
+ return servers[1 + (counter % #servers)]
+ end
+
+ setServerPolicyLua("luaroundrobin", luaroundrobin)
+ )foo";
+ resetLuaContext();
+ g_lua.lock()->writeFunction("setServerPolicyLua", [](string name, ServerPolicy::policyfunc_t policy) {
+ g_policy.setState(ServerPolicy{name, policy, true});
+ });
+ g_lua.lock()->executeCode(policySetupStr);
+
+ {
+ ServerPolicy pol = g_policy.getCopy();
+ ServerPolicy::NumberedServerVector servers;
+ std::map<std::shared_ptr<DownstreamState>, uint64_t> serversMap;
+ for (size_t idx = 1; idx <= 10; idx++) {
+ servers.push_back({ idx, std::make_shared<DownstreamState>(ComboAddress("192.0.2." + std::to_string(idx) + ":53")) });
+ serversMap[servers.at(idx - 1).second] = 0;
+ servers.at(idx - 1).second->setUp();
+ }
+ BOOST_REQUIRE_EQUAL(servers.size(), 10U);
+
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ uint64_t total = 0;
+ for (const auto& entry : serversMap) {
+ BOOST_CHECK_GT(entry.second, 0U);
+ BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
+ BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
+ total += entry.second;
+ }
+ BOOST_CHECK_EQUAL(total, names.size());
+
+ benchPolicy(pol);
+ }
+ resetLuaContext();
+}
+
+#ifdef LUAJIT_VERSION
+
+BOOST_AUTO_TEST_CASE(test_lua_ffi_rr) {
+ std::vector<DNSName> names;
+ names.reserve(1000);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ names.push_back(DNSName("powerdns-" + std::to_string(idx) + ".com."));
+ }
+
+ static const std::string policySetupStr = R"foo(
+ local ffi = require("ffi")
+ local C = ffi.C
+ local counter = 0
+ function ffilb(servers_list, dq)
+ local serversCount = tonumber(C.dnsdist_ffi_servers_list_get_count(servers_list))
+ counter = counter + 1
+ return counter % serversCount
+ end
+
+ setServerPolicyLuaFFI("FFI round-robin", ffilb)
+ )foo";
+ resetLuaContext();
+ g_lua.lock()->executeCode(getLuaFFIWrappers());
+ g_lua.lock()->writeFunction("setServerPolicyLuaFFI", [](string name, ServerPolicy::ffipolicyfunc_t policy) {
+ g_policy.setState(ServerPolicy(name, policy));
+ });
+ g_lua.lock()->executeCode(policySetupStr);
+
+ {
+ ServerPolicy pol = g_policy.getCopy();
+ ServerPolicy::NumberedServerVector servers;
+ std::map<std::shared_ptr<DownstreamState>, uint64_t> serversMap;
+ for (size_t idx = 1; idx <= 10; idx++) {
+ servers.push_back({ idx, std::make_shared<DownstreamState>(ComboAddress("192.0.2." + std::to_string(idx) + ":53")) });
+ serversMap[servers.at(idx - 1).second] = 0;
+ servers.at(idx - 1).second->setUp();
+ }
+ BOOST_REQUIRE_EQUAL(servers.size(), 10U);
+
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ uint64_t total = 0;
+ for (const auto& entry : serversMap) {
+ BOOST_CHECK_GT(entry.second, 0U);
+ BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
+ BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
+ total += entry.second;
+ }
+ BOOST_CHECK_EQUAL(total, names.size());
+
+ benchPolicy(pol);
+ }
+ resetLuaContext();
+}
+
+BOOST_AUTO_TEST_CASE(test_lua_ffi_hashed) {
+ std::vector<DNSName> names;
+ names.reserve(1000);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ names.push_back(DNSName("powerdns-" + std::to_string(idx) + ".com."));
+ }
+
+ static const std::string policySetupStr = R"foo(
+ local ffi = require("ffi")
+ local C = ffi.C
+ function ffilb(servers_list, dq)
+ local serversCount = tonumber(C.dnsdist_ffi_servers_list_get_count(servers_list))
+ local hash = tonumber(C.dnsdist_ffi_dnsquestion_get_qname_hash(dq, 0))
+ return hash % serversCount
+ end
+
+ setServerPolicyLuaFFI("FFI hashed", ffilb)
+ )foo";
+ resetLuaContext();
+ g_lua.lock()->executeCode(getLuaFFIWrappers());
+ g_lua.lock()->writeFunction("setServerPolicyLuaFFI", [](string name, ServerPolicy::ffipolicyfunc_t policy) {
+ g_policy.setState(ServerPolicy(name, policy));
+ });
+ g_lua.lock()->executeCode(policySetupStr);
+
+ {
+ ServerPolicy pol = g_policy.getCopy();
+ ServerPolicy::NumberedServerVector servers;
+ std::map<std::shared_ptr<DownstreamState>, uint64_t> serversMap;
+ for (size_t idx = 1; idx <= 10; idx++) {
+ servers.push_back({ idx, std::make_shared<DownstreamState>(ComboAddress("192.0.2." + std::to_string(idx) + ":53")) });
+ serversMap[servers.at(idx - 1).second] = 0;
+ servers.at(idx - 1).second->setUp();
+ }
+ BOOST_REQUIRE_EQUAL(servers.size(), 10U);
+
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ uint64_t total = 0;
+ for (const auto& entry : serversMap) {
+ BOOST_CHECK_GT(entry.second, 0U);
+ BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
+ BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
+ total += entry.second;
+ }
+ BOOST_CHECK_EQUAL(total, names.size());
+
+ benchPolicy(pol);
+ }
+ resetLuaContext();
+}
+
+BOOST_AUTO_TEST_CASE(test_lua_ffi_whashed) {
+ std::vector<DNSName> names;
+ names.reserve(1000);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ names.push_back(DNSName("powerdns-" + std::to_string(idx) + ".com."));
+ }
+
+ static const std::string policySetupStr = R"foo(
+ local ffi = require("ffi")
+ local C = ffi.C
+ function ffilb(servers_list, dq)
+ return tonumber(C.dnsdist_ffi_servers_list_whashed(servers_list, dq, C.dnsdist_ffi_dnsquestion_get_qname_hash(dq, 0)))
+ end
+
+ setServerPolicyLuaFFI("FFI whashed", ffilb)
+ )foo";
+ resetLuaContext();
+ g_lua.lock()->executeCode(getLuaFFIWrappers());
+ g_lua.lock()->writeFunction("setServerPolicyLuaFFI", [](string name, ServerPolicy::ffipolicyfunc_t policy) {
+ g_policy.setState(ServerPolicy(name, policy));
+ });
+ g_lua.lock()->executeCode(policySetupStr);
+
+ {
+ ServerPolicy pol = g_policy.getCopy();
+ ServerPolicy::NumberedServerVector servers;
+ std::map<std::shared_ptr<DownstreamState>, uint64_t> serversMap;
+ for (size_t idx = 1; idx <= 10; idx++) {
+ servers.push_back({ idx, std::make_shared<DownstreamState>(ComboAddress("192.0.2." + std::to_string(idx) + ":53")) });
+ serversMap[servers.at(idx - 1).second] = 0;
+ servers.at(idx - 1).second->setUp();
+ }
+ BOOST_REQUIRE_EQUAL(servers.size(), 10U);
+
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ uint64_t total = 0;
+ for (const auto& entry : serversMap) {
+ BOOST_CHECK_GT(entry.second, 0U);
+ BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
+ BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
+ total += entry.second;
+ }
+ BOOST_CHECK_EQUAL(total, names.size());
+
+ benchPolicy(pol);
+ }
+ resetLuaContext();
+}
+
+BOOST_AUTO_TEST_CASE(test_lua_ffi_chashed) {
+ bool existingVerboseValue = g_verbose;
+ g_verbose = false;
+
+ std::vector<DNSName> names;
+ names.reserve(1000);
+ for (size_t idx = 0; idx < 1000; idx++) {
+ names.push_back(DNSName("powerdns-" + std::to_string(idx) + ".com."));
+ }
+
+ static const std::string policySetupStr = R"foo(
+ local ffi = require("ffi")
+ local C = ffi.C
+ function ffilb(servers_list, dq)
+ return tonumber(C.dnsdist_ffi_servers_list_chashed(servers_list, dq, C.dnsdist_ffi_dnsquestion_get_qname_hash(dq, 0)))
+ end
+
+ setServerPolicyLuaFFI("FFI chashed", ffilb)
+ )foo";
+ resetLuaContext();
+ g_lua.lock()->executeCode(getLuaFFIWrappers());
+ g_lua.lock()->writeFunction("setServerPolicyLuaFFI", [](string name, ServerPolicy::ffipolicyfunc_t policy) {
+ g_policy.setState(ServerPolicy(name, policy));
+ });
+ g_lua.lock()->executeCode(policySetupStr);
+
+ {
+ ServerPolicy pol = g_policy.getCopy();
+ ServerPolicy::NumberedServerVector servers;
+ std::map<std::shared_ptr<DownstreamState>, uint64_t> serversMap;
+ for (size_t idx = 1; idx <= 10; idx++) {
+ servers.push_back({ idx, std::make_shared<DownstreamState>(ComboAddress("192.0.2." + std::to_string(idx) + ":53")) });
+ serversMap[servers.at(idx - 1).second] = 0;
+ servers.at(idx - 1).second->setUp();
+ /* we need to have a weight of at least 1000 to get an optimal repartition with the consistent hashing algo */
+ servers.at(idx - 1).second->setWeight(1000);
+ /* make sure that the hashes have been computed */
+ servers.at(idx - 1).second->hash();
+ }
+ BOOST_REQUIRE_EQUAL(servers.size(), 10U);
+
+ for (const auto& name : names) {
+ auto dq = getDQ(&name);
+ auto server = pol.getSelectedBackend(servers, dq);
+ BOOST_REQUIRE(serversMap.count(server) == 1);
+ ++serversMap[server];
+ }
+
+ uint64_t total = 0;
+ for (const auto& entry : serversMap) {
+ BOOST_CHECK_GT(entry.second, 0U);
+ BOOST_CHECK_GT(entry.second, (names.size() / servers.size() / 2));
+ BOOST_CHECK_LT(entry.second, (names.size() / servers.size() * 2));
+ total += entry.second;
+ }
+ BOOST_CHECK_EQUAL(total, names.size());
+
+ benchPolicy(pol);
+ }
+ g_verbose = existingVerboseValue;
+ resetLuaContext();
+}
+
+#endif /* LUAJIT_VERSION */
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-dnsdistnghttp2_cc.cc b/test-dnsdistnghttp2_cc.cc
new file mode 100644
index 0000000..edea2c8
--- /dev/null
+++ b/test-dnsdistnghttp2_cc.cc
@@ -0,0 +1,1986 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "dnswriter.hh"
+#include "dnsdist.hh"
+#include "dnsdist-proxy-protocol.hh"
+#include "dnsdist-rings.hh"
+#include "dnsdist-nghttp2.hh"
+#include "sstuff.hh"
+
+#ifdef HAVE_NGHTTP2
+#include <nghttp2/nghttp2.h>
+
+BOOST_AUTO_TEST_SUITE(test_dnsdistnghttp2_cc)
+
+struct ExpectedStep
+{
+public:
+ enum class ExpectedRequest
+ {
+ handshakeClient,
+ readFromClient,
+ writeToClient,
+ closeClient,
+ connectToBackend,
+ readFromBackend,
+ writeToBackend,
+ closeBackend
+ };
+
+ ExpectedStep(ExpectedRequest r, IOState n, size_t b = 0, std::function<void(int descriptor)> fn = nullptr) :
+ cb(fn), request(r), nextState(n), bytes(b)
+ {
+ }
+
+ std::function<void(int descriptor)> cb{nullptr};
+ ExpectedRequest request;
+ IOState nextState;
+ size_t bytes{0};
+};
+
+struct ExpectedData
+{
+ PacketBuffer d_query;
+ PacketBuffer d_response;
+};
+
+static std::deque<ExpectedStep> s_steps;
+static std::map<uint16_t, ExpectedData> s_responses;
+
+std::ostream& operator<<(std::ostream& os, const ExpectedStep::ExpectedRequest d);
+
+std::ostream& operator<<(std::ostream& os, const ExpectedStep::ExpectedRequest d)
+{
+ static const std::vector<std::string> requests = {"handshake with client", "read from client", "write to client", "close connection to client", "connect to the backend", "read from the backend", "write to the backend", "close connection to backend"};
+ os << requests.at(static_cast<size_t>(d));
+ return os;
+}
+
+class DOHConnection
+{
+public:
+ DOHConnection(bool needProxyProtocol) :
+ d_session(std::unique_ptr<nghttp2_session, void (*)(nghttp2_session*)>(nullptr, nghttp2_session_del)), d_needProxyProtocol(needProxyProtocol)
+ {
+ nghttp2_session_callbacks* cbs = nullptr;
+ nghttp2_session_callbacks_new(&cbs);
+ std::unique_ptr<nghttp2_session_callbacks, void (*)(nghttp2_session_callbacks*)> callbacks(cbs, nghttp2_session_callbacks_del);
+ cbs = nullptr;
+ nghttp2_session_callbacks_set_send_callback(callbacks.get(), send_callback);
+ nghttp2_session_callbacks_set_on_frame_recv_callback(callbacks.get(), on_frame_recv_callback);
+ nghttp2_session_callbacks_set_on_data_chunk_recv_callback(callbacks.get(), on_data_chunk_recv_callback);
+ nghttp2_session_callbacks_set_on_stream_close_callback(callbacks.get(), on_stream_close_callback);
+ nghttp2_session* sess = nullptr;
+ nghttp2_session_server_new(&sess, callbacks.get(), this);
+ d_session = std::unique_ptr<nghttp2_session, void (*)(nghttp2_session*)>(sess, nghttp2_session_del);
+
+ nghttp2_settings_entry iv[1] = {
+ {NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, 100}};
+ nghttp2_submit_settings(d_session.get(), NGHTTP2_FLAG_NONE, iv, sizeof(iv) / sizeof(*iv));
+ }
+
+ PacketBuffer d_serverOutBuffer;
+ PacketBuffer d_proxyProtocolBuffer;
+ std::map<uint32_t, PacketBuffer> d_queries;
+ std::map<uint32_t, PacketBuffer> d_responses;
+ std::unique_ptr<nghttp2_session, void (*)(nghttp2_session*)> d_session;
+ /* used to replace the stream ID in outgoing frames. Ugly but the library does not let us
+ test weird cases without that */
+ std::map<uint32_t, uint32_t> d_idMapping;
+ bool d_needProxyProtocol;
+
+ size_t submitIncoming(const PacketBuffer& data, size_t pos, size_t toWrite)
+ {
+ size_t consumed = 0;
+ if (d_needProxyProtocol) {
+ do {
+ auto bytesRemaining = isProxyHeaderComplete(d_proxyProtocolBuffer);
+ if (bytesRemaining < 0) {
+ size_t toConsume = toWrite > static_cast<size_t>(-bytesRemaining) ? static_cast<size_t>(-bytesRemaining) : toWrite;
+ d_proxyProtocolBuffer.insert(d_proxyProtocolBuffer.end(), data.begin() + pos, data.begin() + pos + toConsume);
+ pos += toConsume;
+ toWrite -= toConsume;
+ consumed += toConsume;
+
+ bytesRemaining = isProxyHeaderComplete(d_proxyProtocolBuffer);
+ if (bytesRemaining > 0) {
+ d_needProxyProtocol = false;
+ }
+ else if (bytesRemaining == 0) {
+ throw("Fatal error while parsing proxy protocol payload");
+ }
+ }
+ else if (bytesRemaining == 0) {
+ throw("Fatal error while parsing proxy protocol payload");
+ }
+
+ if (toWrite == 0) {
+ return consumed;
+ }
+ } while (d_needProxyProtocol && toWrite > 0);
+ }
+
+ ssize_t readlen = nghttp2_session_mem_recv(d_session.get(), &data.at(pos), toWrite);
+ if (readlen < 0) {
+ throw("Fatal error while submitting: " + std::string(nghttp2_strerror(static_cast<int>(readlen))));
+ }
+
+ /* just in case, see if we have anything to send */
+ int rv = nghttp2_session_send(d_session.get());
+ if (rv != 0) {
+ throw("Fatal error while sending: " + std::string(nghttp2_strerror(rv)));
+ }
+
+ return readlen;
+ }
+
+ void submitResponse(uint32_t streamId, PacketBuffer& data)
+ {
+ const nghttp2_nv hdrs[] = {{(uint8_t*)":status", (uint8_t*)"200", sizeof(":status") - 1, sizeof("200") - 1, NGHTTP2_NV_FLAG_NONE}};
+ nghttp2_data_provider dataProvider;
+ dataProvider.source.ptr = &data;
+ dataProvider.read_callback = [](nghttp2_session* session, int32_t stream_id, uint8_t* buf, size_t length, uint32_t* data_flags, nghttp2_data_source* source, void* user_data) -> ssize_t {
+ auto buffer = reinterpret_cast<PacketBuffer*>(source->ptr);
+ size_t toCopy = 0;
+ if (buffer->size() > 0) {
+ toCopy = length > buffer->size() ? buffer->size() : length;
+ memcpy(buf, &buffer->at(0), toCopy);
+ buffer->erase(buffer->begin(), buffer->begin() + toCopy);
+ }
+
+ if (buffer->size() == 0) {
+ *data_flags |= NGHTTP2_DATA_FLAG_EOF;
+ }
+ // cerr<<"submitting response data of size "<<toCopy<<" for stream "<<stream_id<<endl;
+ return toCopy;
+ };
+
+ int rv = nghttp2_submit_response(d_session.get(), streamId, hdrs, sizeof(hdrs) / sizeof(*hdrs), &dataProvider);
+ // cerr<<"Submitting response for stream ID "<<streamId<<": "<<rv<<endl;
+ BOOST_CHECK_EQUAL(rv, 0);
+ /* just in case, see if we have anything to send */
+ rv = nghttp2_session_send(d_session.get());
+ BOOST_CHECK_EQUAL(rv, 0);
+ }
+
+ void submitError(uint32_t streamId, uint16_t status, const std::string& msg)
+ {
+ const std::string statusStr = std::to_string(status);
+ const nghttp2_nv hdrs[] = {{(uint8_t*)":status", (uint8_t*)statusStr.c_str(), sizeof(":status") - 1, statusStr.size(), NGHTTP2_NV_FLAG_NONE}};
+
+ int rv = nghttp2_submit_response(d_session.get(), streamId, hdrs, sizeof(hdrs) / sizeof(*hdrs), nullptr);
+ BOOST_CHECK_EQUAL(rv, 0);
+ /* just in case, see if we have anything to send */
+ rv = nghttp2_session_send(d_session.get());
+ BOOST_CHECK_EQUAL(rv, 0);
+ }
+
+ void submitGoAway()
+ {
+ int rv = nghttp2_submit_goaway(d_session.get(), NGHTTP2_FLAG_NONE, 0, NGHTTP2_INTERNAL_ERROR, nullptr, 0);
+ BOOST_CHECK_EQUAL(rv, 0);
+ /* just in case, see if we have anything to send */
+ rv = nghttp2_session_send(d_session.get());
+ BOOST_CHECK_EQUAL(rv, 0);
+ }
+
+private:
+ static ssize_t send_callback(nghttp2_session* session, const uint8_t* data, size_t length, int flags, void* user_data)
+ {
+ DOHConnection* conn = reinterpret_cast<DOHConnection*>(user_data);
+ // cerr<<"inserting "<<length<<" bytes into the server output buffer of size "<<conn->d_serverOutBuffer.size()<<endl;
+ if (!conn->d_idMapping.empty() && length > 9) {
+ /* frame type == DATA */
+ if (data[3] == NGHTTP2_DATA) {
+ uint32_t streamId = 0;
+ memcpy(&streamId, &data[5], sizeof(streamId));
+ const auto it = conn->d_idMapping.find(ntohl(streamId));
+ if (it != conn->d_idMapping.end()) {
+ streamId = htonl(it->second);
+ std::vector<uint8_t> editedData(length);
+ std::copy(data, data + length, editedData.begin());
+ memcpy(&editedData.at(5), &streamId, sizeof(streamId));
+ conn->d_serverOutBuffer.insert(conn->d_serverOutBuffer.end(), editedData.data(), editedData.data() + length);
+ return static_cast<ssize_t>(editedData.size());
+ }
+ }
+ }
+
+ conn->d_serverOutBuffer.insert(conn->d_serverOutBuffer.end(), data, data + length);
+ return static_cast<ssize_t>(length);
+ }
+
+ static int on_frame_recv_callback(nghttp2_session* session, const nghttp2_frame* frame, void* user_data)
+ {
+ DOHConnection* conn = reinterpret_cast<DOHConnection*>(user_data);
+ // cerr<<"Frame type is "<<std::to_string(frame->hd.type)<<endl;
+ if ((frame->hd.type == NGHTTP2_HEADERS || frame->hd.type == NGHTTP2_DATA) && frame->hd.flags & NGHTTP2_FLAG_END_STREAM) {
+#if 0
+ auto stream_data = nghttp2_session_get_stream_user_data(session, frame->hd.stream_id);
+ /* For DATA and HEADERS frame, this callback may be called after on_stream_close_callback. Check that stream still alive. */
+ if (stream_data == nullptr) {
+ cerr<<"unable to find stream data!"<<endl;
+ return 0;
+ }
+#endif
+
+ auto& query = conn->d_queries.at(frame->hd.stream_id);
+ BOOST_REQUIRE_GT(query.size(), sizeof(dnsheader));
+ auto dh = reinterpret_cast<const dnsheader*>(query.data());
+ uint16_t id = ntohs(dh->id);
+ // cerr<<"got query ID "<<id<<endl;
+
+ const auto& expected = s_responses.at(id);
+ BOOST_REQUIRE_EQUAL(expected.d_query.size(), query.size());
+ for (size_t idx = 0; idx < query.size(); idx++) {
+ if (expected.d_query.at(idx) != query.at(idx)) {
+ cerr << "Mismatch at offset " << idx << ", expected " << std::to_string(query.at(idx)) << " got " << std::to_string(expected.d_query.at(idx)) << endl;
+ BOOST_CHECK(false);
+ }
+ }
+
+ DNSName qname(reinterpret_cast<const char*>(query.data()), query.size(), sizeof(dnsheader), false);
+ if (qname == DNSName("goaway.powerdns.com.")) {
+ conn->submitGoAway();
+ }
+ else if (qname == DNSName("500.powerdns.com.") && (id % 2) == 0) {
+ /* we return a 500 on the first query only */
+ conn->submitError(frame->hd.stream_id, 500, "Server failure");
+ }
+ else if (qname == DNSName("wrong-stream-id.powerdns.com.") && (id % 2) == 0) {
+ /* we return a wrong stremad ID on the first query only */
+ BOOST_CHECK_EQUAL(frame->hd.stream_id, 1);
+ conn->d_responses[frame->hd.stream_id] = expected.d_response;
+ /* use an invalid stream ID! */
+ conn->d_idMapping[frame->hd.stream_id] = frame->hd.stream_id + 4;
+ conn->submitResponse(frame->hd.stream_id, conn->d_responses.at(frame->hd.stream_id));
+ }
+ else {
+ conn->d_responses[frame->hd.stream_id] = expected.d_response;
+ conn->submitResponse(frame->hd.stream_id, conn->d_responses.at(frame->hd.stream_id));
+ }
+ conn->d_queries.erase(frame->hd.stream_id);
+ }
+
+ return 0;
+ }
+
+ static int on_data_chunk_recv_callback(nghttp2_session* session, uint8_t flags, int32_t stream_id, const uint8_t* data, size_t len, void* user_data)
+ {
+ DOHConnection* conn = reinterpret_cast<DOHConnection*>(user_data);
+ auto& query = conn->d_queries[stream_id];
+ query.insert(query.end(), data, data + len);
+ return 0;
+ }
+
+ static int on_stream_close_callback(nghttp2_session* session, int32_t stream_id, uint32_t error_code, void* user_data)
+ {
+ if (error_code == 0) {
+ return 0;
+ }
+
+ return 0;
+ }
+};
+
+static std::map<int, std::unique_ptr<DOHConnection>> s_connectionBuffers;
+
+class MockupTLSConnection : public TLSConnection
+{
+public:
+ MockupTLSConnection(int descriptor, bool client = false, bool needProxyProtocol = false) :
+ d_descriptor(descriptor), d_client(client)
+ {
+ s_connectionBuffers[d_descriptor] = std::make_unique<DOHConnection>(needProxyProtocol);
+ }
+
+ ~MockupTLSConnection() {}
+
+ IOState tryHandshake() override
+ {
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, ExpectedStep::ExpectedRequest::handshakeClient);
+
+ return step.nextState;
+ }
+
+ IOState tryWrite(const PacketBuffer& buffer, size_t& pos, size_t toWrite) override
+ {
+ auto& conn = s_connectionBuffers.at(d_descriptor);
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, !d_client ? ExpectedStep::ExpectedRequest::writeToClient : ExpectedStep::ExpectedRequest::writeToBackend);
+
+ if (step.bytes == 0) {
+ if (step.nextState == IOState::NeedWrite) {
+ return step.nextState;
+ }
+ throw std::runtime_error("Remote host closed the connection");
+ }
+
+ toWrite -= pos;
+ BOOST_REQUIRE_GE(buffer.size(), pos + toWrite);
+
+ if (step.bytes < toWrite) {
+ toWrite = step.bytes;
+ }
+
+ conn->submitIncoming(buffer, pos, toWrite);
+ pos += toWrite;
+
+ return step.nextState;
+ }
+
+ IOState tryRead(PacketBuffer& buffer, size_t& pos, size_t toRead, bool allowIncomplete = false) override
+ {
+ auto& conn = s_connectionBuffers.at(d_descriptor);
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, !d_client ? ExpectedStep::ExpectedRequest::readFromClient : ExpectedStep::ExpectedRequest::readFromBackend);
+
+ if (step.bytes == 0) {
+ if (step.nextState == IOState::NeedRead) {
+ return step.nextState;
+ }
+ throw std::runtime_error("Remote host closed the connection");
+ }
+
+ auto& externalBuffer = conn->d_serverOutBuffer;
+ toRead -= pos;
+
+ if (step.bytes < toRead) {
+ toRead = step.bytes;
+ }
+ if (allowIncomplete) {
+ if (toRead > externalBuffer.size()) {
+ toRead = externalBuffer.size();
+ }
+ }
+ else {
+ BOOST_REQUIRE_GE(externalBuffer.size(), toRead);
+ }
+
+ BOOST_REQUIRE_GE(buffer.size(), toRead);
+
+ std::copy(externalBuffer.begin(), externalBuffer.begin() + toRead, buffer.begin() + pos);
+ pos += toRead;
+ externalBuffer.erase(externalBuffer.begin(), externalBuffer.begin() + toRead);
+
+ return step.nextState;
+ }
+
+ IOState tryConnect(bool fastOpen, const ComboAddress& remote) override
+ {
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, ExpectedStep::ExpectedRequest::connectToBackend);
+
+ return step.nextState;
+ }
+
+ void close() override
+ {
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, !d_client ? ExpectedStep::ExpectedRequest::closeClient : ExpectedStep::ExpectedRequest::closeBackend);
+ }
+
+ bool hasBufferedData() const override
+ {
+ return false;
+ }
+
+ bool isUsable() const override
+ {
+ return true;
+ }
+
+ std::string getServerNameIndication() const override
+ {
+ return "";
+ }
+
+ std::vector<uint8_t> getNextProtocol() const override
+ {
+ return std::vector<uint8_t>();
+ }
+
+ LibsslTLSVersion getTLSVersion() const override
+ {
+ return LibsslTLSVersion::TLS13;
+ }
+
+ bool hasSessionBeenResumed() const override
+ {
+ return false;
+ }
+
+ std::vector<std::unique_ptr<TLSSession>> getSessions() override
+ {
+ return {};
+ }
+
+ void setSession(std::unique_ptr<TLSSession>& session) override
+ {
+ }
+
+ /* unused in that context, don't bother */
+ void doHandshake() override
+ {
+ }
+
+ void connect(bool fastOpen, const ComboAddress& remote, const struct timeval& timeout) override
+ {
+ }
+
+ size_t read(void* buffer, size_t bufferSize, const struct timeval& readTimeout, const struct timeval& totalTimeout = {0, 0}, bool allowIncomplete = false) override
+ {
+ return 0;
+ }
+
+ size_t write(const void* buffer, size_t bufferSize, const struct timeval& writeTimeout) override
+ {
+ return 0;
+ }
+
+private:
+ ExpectedStep getStep() const
+ {
+ BOOST_REQUIRE(!s_steps.empty());
+ auto step = s_steps.front();
+ s_steps.pop_front();
+
+ if (step.cb) {
+ step.cb(d_descriptor);
+ }
+
+ return step;
+ }
+
+ const int d_descriptor;
+ bool d_client{false};
+};
+
+class MockupTLSCtx : public TLSCtx
+{
+public:
+ ~MockupTLSCtx()
+ {
+ }
+
+ std::unique_ptr<TLSConnection> getConnection(int socket, const struct timeval& timeout, time_t now) override
+ {
+ return std::make_unique<MockupTLSConnection>(socket);
+ }
+
+ std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, int socket, const struct timeval& timeout) override
+ {
+ return std::make_unique<MockupTLSConnection>(socket, true, d_needProxyProtocol);
+ }
+
+ void rotateTicketsKey(time_t now) override
+ {
+ }
+
+ size_t getTicketsKeysCount() override
+ {
+ return 0;
+ }
+
+ std::string getName() const override
+ {
+ return "Mockup TLS";
+ }
+
+ bool d_needProxyProtocol{false};
+};
+
+class MockupFDMultiplexer : public FDMultiplexer
+{
+public:
+ MockupFDMultiplexer()
+ {
+ }
+
+ ~MockupFDMultiplexer()
+ {
+ }
+
+ int run(struct timeval* tv, int timeout = 500) override
+ {
+ int ret = 0;
+
+ gettimeofday(tv, nullptr); // MANDATORY
+
+ /* 'ready' might be altered by a callback while we are iterating */
+ const auto readyFDs = ready;
+ for (const auto fd : readyFDs) {
+ {
+ const auto& it = d_readCallbacks.find(fd);
+
+ if (it != d_readCallbacks.end()) {
+ it->d_callback(it->d_fd, it->d_parameter);
+ }
+ }
+
+ {
+ const auto& it = d_writeCallbacks.find(fd);
+
+ if (it != d_writeCallbacks.end()) {
+ it->d_callback(it->d_fd, it->d_parameter);
+ }
+ }
+ }
+
+ return ret;
+ }
+
+ void getAvailableFDs(std::vector<int>& fds, int timeout) override
+ {
+ }
+
+ void addFD(int fd, FDMultiplexer::EventKind kind) override
+ {
+ }
+
+ void removeFD(int fd, FDMultiplexer::EventKind) override
+ {
+ }
+
+ string getName() const override
+ {
+ return "mockup";
+ }
+
+ void setReady(int fd)
+ {
+ ready.insert(fd);
+ }
+
+ void setNotReady(int fd)
+ {
+ ready.erase(fd);
+ }
+
+private:
+ std::set<int> ready;
+};
+
+class MockupQuerySender : public TCPQuerySender
+{
+public:
+ bool active() const override
+ {
+ return true;
+ }
+
+ const ClientState* getClientState() const override
+ {
+ return nullptr;
+ }
+
+ void handleResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ if (d_customHandler) {
+ d_customHandler(d_id, now, std::move(response));
+ return;
+ }
+
+ BOOST_REQUIRE_GT(response.d_buffer.size(), sizeof(dnsheader));
+ auto dh = reinterpret_cast<const dnsheader*>(response.d_buffer.data());
+ uint16_t id = ntohs(dh->id);
+
+ BOOST_REQUIRE_EQUAL(id, d_id);
+ const auto& expected = s_responses.at(id);
+ BOOST_REQUIRE_EQUAL(expected.d_response.size(), response.d_buffer.size());
+ for (size_t idx = 0; idx < response.d_buffer.size(); idx++) {
+ if (expected.d_response.at(idx) != response.d_buffer.at(idx)) {
+ cerr << "Mismatch at offset " << idx << ", expected " << std::to_string(response.d_buffer.at(idx)) << " got " << std::to_string(expected.d_response.at(idx)) << endl;
+ BOOST_CHECK(false);
+ }
+ }
+
+ if (expected.d_response != response.d_buffer) {
+ BOOST_REQUIRE(false);
+ }
+ d_valid = true;
+ }
+
+ void handleXFRResponse(const struct timeval& now, TCPResponse&& response) override
+ {
+ }
+
+ void notifyIOError(IDState&& query, const struct timeval& now) override
+ {
+ d_error = true;
+ }
+
+ std::function<void(uint16_t id, const struct timeval& now, TCPResponse&& response)> d_customHandler;
+ uint16_t d_id{0};
+ bool d_valid{false};
+ bool d_error{false};
+};
+
+static bool isIPv6Supported()
+{
+ try {
+ ComboAddress addr("[2001:db8:53::1]:53");
+ auto socket = std::make_unique<Socket>(addr.sin4.sin_family, SOCK_STREAM, 0);
+ socket->setNonBlocking();
+ int res = SConnectWithTimeout(socket->getHandle(), addr, timeval{0, 0});
+ if (res == 0 || res == EINPROGRESS) {
+ return true;
+ }
+ return false;
+ }
+ catch (const std::exception& e) {
+ return false;
+ }
+}
+
+static ComboAddress getBackendAddress(const std::string& lastDigit, uint16_t port)
+{
+ static const bool useV6 = isIPv6Supported();
+
+ if (useV6) {
+ return ComboAddress("2001:db8:53::" + lastDigit, port);
+ }
+
+ return ComboAddress("192.0.2." + lastDigit, port);
+}
+
+static std::unique_ptr<FDMultiplexer> s_mplexer;
+
+struct TestFixture
+{
+ TestFixture()
+ {
+ s_steps.clear();
+ s_responses.clear();
+ s_mplexer = std::make_unique<MockupFDMultiplexer>();
+ }
+ ~TestFixture()
+ {
+ clearH2Connections();
+ s_steps.clear();
+ s_responses.clear();
+ s_mplexer.reset();
+ }
+};
+
+BOOST_FIXTURE_TEST_CASE(test_SingleQuery, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ size_t counter = 1;
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and response from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as NOT ready anymore */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setNotReady(desc);
+ }},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ s_connectionBuffers.at(desc)->submitGoAway();
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ auto sliced = std::shared_ptr<TCPQuerySender>(sender);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(internalQuery), false);
+ BOOST_CHECK_EQUAL(result, true);
+
+ while (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0) {
+ s_mplexer->run(&now);
+ }
+ BOOST_CHECK_EQUAL(sender->d_valid, true);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_ConcurrentQueries, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ s_connectionBuffers.at(desc)->submitGoAway();
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0) {
+ s_mplexer->run(&now);
+ }
+
+ for (auto& query : queries) {
+ BOOST_CHECK_EQUAL(query.first->d_valid, true);
+ }
+}
+
+BOOST_FIXTURE_TEST_CASE(test_ConnectionReuse, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ bool firstQueryDone = false;
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [&firstQueryDone](int desc) {
+ firstQueryDone = true;
+ }},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ }},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* later the backend sends a go away frame */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ s_connectionBuffers.at(desc)->submitGoAway();
+ }},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ {
+ auto& query = queries.at(0);
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+
+ while (!firstQueryDone && (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0)) {
+ s_mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(query.first->d_valid, true);
+ BOOST_CHECK_EQUAL(firstQueryDone, true);
+ }
+
+ {
+ auto& query = queries.at(1);
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+
+ while (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0) {
+ s_mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(query.first->d_valid, true);
+ }
+}
+
+BOOST_FIXTURE_TEST_CASE(test_InvalidDNSAnswer, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ size_t counter = 1;
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ /* TRUNCATE the answer */
+ response.resize(11);
+ s_responses[counter] = {query, response};
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ sender->d_customHandler = [](uint16_t id, const struct timeval&, TCPResponse&& resp) {
+ BOOST_CHECK_EQUAL(resp.d_buffer.size(), 11U);
+ /* simulate an exception, since DoH and UDP frontends will process the query right away,
+ while TCP and DoT will first pass it back to the TCP worker thread */
+ throw std::runtime_error("Invalid response");
+ };
+ InternalQuery internalQuery(std::move(query), IDState());
+
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and response from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* try to read, the backend says to go away */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ s_connectionBuffers.at(desc)->submitGoAway();
+ }},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ auto sliced = std::shared_ptr<TCPQuerySender>(sender);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(internalQuery), false);
+ BOOST_CHECK_EQUAL(result, true);
+
+ while (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0) {
+ s_mplexer->run(&now);
+ }
+ BOOST_CHECK_EQUAL(sender->d_valid, false);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_TimeoutWhileWriting, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ bool timeout = false;
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, std::numeric_limits<size_t>::max(), [&timeout](int desc) {
+ timeout = true;
+ }},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (!timeout && (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0)) {
+ s_mplexer->run(&now);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += backend->tcpSendTimeout + 1;
+
+ auto expiredConns = handleH2Timeouts(*s_mplexer, later);
+ BOOST_CHECK_EQUAL(expiredConns, 1U);
+
+ for (auto& query : queries) {
+ BOOST_CHECK_EQUAL(query.first->d_valid, false);
+ BOOST_CHECK_EQUAL(query.first->d_error, true);
+ }
+
+ BOOST_CHECK_EQUAL(clearH2Connections(), 0U);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_TimeoutWhileReading, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ bool timeout = false;
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [&timeout](int desc) {
+ /* set the timeout flag now, since the timeout occurs while waiting for the descriptor to become readable */
+ timeout = true;
+ }},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (!timeout && (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0)) {
+ s_mplexer->run(&now);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += backend->tcpRecvTimeout + 1;
+
+ auto expiredConns = handleH2Timeouts(*s_mplexer, later);
+ BOOST_CHECK_EQUAL(expiredConns, 1U);
+
+ for (auto& query : queries) {
+ BOOST_CHECK_EQUAL(query.first->d_valid, false);
+ BOOST_CHECK_EQUAL(query.first->d_error, true);
+ }
+ BOOST_CHECK_EQUAL(clearH2Connections(), 0U);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_ShortWrite, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ bool done = false;
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 2, [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* settings (second attempt) + headers + data + headers (second query) + data */
+ {
+ ExpectedStep::ExpectedRequest::writeToBackend,
+ IOState::Done,
+ std::numeric_limits<size_t>::max(),
+ },
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [&done](int desc) {
+ /* mark backend as not ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setNotReady(desc);
+ done = true;
+ }},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (!done && (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0)) {
+ s_mplexer->run(&now);
+ }
+
+ for (auto& query : queries) {
+ BOOST_CHECK_EQUAL(query.first->d_valid, true);
+ }
+
+ BOOST_CHECK_EQUAL(clearH2Connections(), 1U);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_ShortRead, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ bool done = false;
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 4},
+ /* read settings, headers and responses (second attempt) */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [&done](int desc) {
+ /* mark backend as not ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setNotReady(desc);
+ done = true;
+ }},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (!done && (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0)) {
+ s_mplexer->run(&now);
+ }
+
+ for (auto& query : queries) {
+ BOOST_CHECK_EQUAL(query.first->d_valid, true);
+ }
+
+ BOOST_CHECK_EQUAL(clearH2Connections(), 1U);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_ConnectionClosedWhileReading, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0) {
+ s_mplexer->run(&now);
+ }
+
+ for (auto& query : queries) {
+ BOOST_CHECK_EQUAL(query.first->d_valid, false);
+ BOOST_CHECK_EQUAL(query.first->d_error, true);
+ }
+
+ BOOST_CHECK_EQUAL(clearH2Connections(), 0U);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_ConnectionClosedWhileWriting, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ bool done = false;
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers, connection is closed by the backend */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and response from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [&done](int desc) {
+ /* mark backend as not ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setNotReady(desc);
+ done = true;
+ }},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (!done && (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0)) {
+ s_mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(queries.at(0).first->d_valid, false);
+ BOOST_CHECK_EQUAL(queries.at(0).first->d_error, true);
+ BOOST_CHECK_EQUAL(queries.at(1).first->d_valid, true);
+ BOOST_CHECK_EQUAL(queries.at(1).first->d_error, false);
+
+ BOOST_CHECK_EQUAL(clearH2Connections(), 1U);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_GoAwayFromServer, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+ /* set the number of reconnection attempts to a low value to not waste time */
+ backend->d_retries = 1;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("goaway.powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read GO AWAY from the server (1) */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* close the first connection. It happens now because the new connection was set up first, then that one destroyed */
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ /* read GO AWAY from the server (1) */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0) {
+ s_mplexer->run(&now);
+ }
+
+ for (auto& query : queries) {
+ BOOST_CHECK_EQUAL(query.first->d_valid, false);
+ BOOST_CHECK_EQUAL(query.first->d_error, true);
+ }
+
+ BOOST_CHECK_EQUAL(clearH2Connections(), 0U);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_HTTP500FromServer, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("500.powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ bool done = false;
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [&done](int desc) {
+ /* mark backend as not ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setNotReady(desc);
+ done = true;
+ }},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (!done && (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0)) {
+ s_mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(queries.at(0).first->d_valid, false);
+ BOOST_CHECK_EQUAL(queries.at(0).first->d_error, true);
+ BOOST_CHECK_EQUAL(queries.at(1).first->d_valid, true);
+ BOOST_CHECK_EQUAL(queries.at(1).first->d_error, false);
+
+ BOOST_CHECK_EQUAL(clearH2Connections(), 1U);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_WrongStreamID, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("wrong-stream-id.powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ InternalQuery internalQuery(std::move(query), IDState());
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ bool timeout = false;
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* read ends up as a time out since nghttp2 filters the frame with the wrong stream ID */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&timeout](int desc) {
+ /* set the timeout flag now, since the timeout occurs while waiting for the descriptor to become readable */
+ timeout = true;
+ }},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (!timeout && (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0)) {
+ s_mplexer->run(&now);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += backend->tcpRecvTimeout + 1;
+
+ auto expiredConns = handleH2Timeouts(*s_mplexer, later);
+ BOOST_CHECK_EQUAL(expiredConns, 1U);
+
+ BOOST_CHECK_EQUAL(queries.at(0).first->d_valid, false);
+ BOOST_CHECK_EQUAL(queries.at(0).first->d_error, true);
+ BOOST_CHECK_EQUAL(queries.at(1).first->d_valid, false);
+ BOOST_CHECK_EQUAL(queries.at(1).first->d_error, true);
+
+ BOOST_CHECK_EQUAL(clearH2Connections(), 0U);
+}
+
+BOOST_FIXTURE_TEST_CASE(test_ProxyProtocol, TestFixture)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ tlsCtx->d_needProxyProtocol = true;
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ backend->d_tlsSubjectName = "backend.powerdns.com";
+ backend->d_dohPath = "/dns-query";
+ backend->d_addXForwardedHeaders = true;
+ backend->useProxyProtocol = true;
+
+ size_t numberOfQueries = 2;
+ std::vector<std::pair<std::shared_ptr<MockupQuerySender>, InternalQuery>> queries;
+ for (size_t counter = 0; counter < numberOfQueries; counter++) {
+ DNSName name("powerdns.com.");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ s_responses[counter] = {query, response};
+
+ auto sender = std::make_shared<MockupQuerySender>();
+ sender->d_id = counter;
+ std::string payload = makeProxyHeader(counter % 2, local, local, {});
+ InternalQuery internalQuery(std::move(query), IDState());
+ internalQuery.d_proxyProtocolPayload = std::move(payload);
+ queries.push_back({std::move(sender), std::move(internalQuery)});
+ }
+
+ s_steps = {
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* proxy protocol data + opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ {ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done},
+ /* proxy protocol data + opening */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* headers */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* data */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max(), [](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(s_mplexer.get())->setReady(desc);
+ }},
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ /* read settings, headers and responses from the server */
+ {ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ /* acknowledge settings */
+ {ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, std::numeric_limits<size_t>::max()},
+ {ExpectedStep::ExpectedRequest::closeBackend, IOState::Done},
+ };
+
+ for (auto& query : queries) {
+ auto sliced = std::static_pointer_cast<TCPQuerySender>(query.first);
+ bool result = sendH2Query(backend, s_mplexer, sliced, std::move(query.second), false);
+ BOOST_CHECK_EQUAL(result, true);
+ }
+
+ while (s_mplexer->getWatchedFDCount(false) != 0 || s_mplexer->getWatchedFDCount(true) != 0) {
+ s_mplexer->run(&now);
+ }
+
+ for (auto& query : queries) {
+ BOOST_CHECK_EQUAL(query.first->d_valid, true);
+ }
+
+ BOOST_CHECK_EQUAL(clearH2Connections(), 0U);
+}
+
+BOOST_AUTO_TEST_SUITE_END();
+#endif /* HAVE_NGHTTP2 */
diff --git a/test-dnsdistpacketcache_cc.cc b/test-dnsdistpacketcache_cc.cc
new file mode 100644
index 0000000..4be01c2
--- /dev/null
+++ b/test-dnsdistpacketcache_cc.cc
@@ -0,0 +1,725 @@
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "ednscookies.hh"
+#include "ednsoptions.hh"
+#include "ednssubnet.hh"
+#include "dnsdist.hh"
+#include "iputils.hh"
+#include "dnswriter.hh"
+#include "dnsdist-cache.hh"
+#include "gettime.hh"
+#include "packetcache.hh"
+
+BOOST_AUTO_TEST_SUITE(test_dnsdistpacketcache_cc)
+
+static bool receivedOverUDP = true;
+
+BOOST_AUTO_TEST_CASE(test_PacketCacheSimple) {
+ const size_t maxEntries = 150000;
+ DNSDistPacketCache PC(maxEntries, 86400, 1);
+ BOOST_CHECK_EQUAL(PC.getSize(), 0U);
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+
+ size_t counter=0;
+ size_t skipped=0;
+ ComboAddress remote;
+ bool dnssecOK = false;
+ const time_t now = time(nullptr);
+ try {
+ for (counter = 0; counter < 100000; ++counter) {
+ DNSName a=DNSName(std::to_string(counter))+DNSName(" hello");
+ BOOST_CHECK_EQUAL(DNSName(a.toString()), a);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, a, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, a, QType::A, QClass::IN, 0);
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = pwQ.getHeader()->id;
+ pwR.startRecord(a, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnet, dnssecOK, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+
+ PC.insert(key, subnet, *(getFlagsFromDNSHeader(dq.getHeader())), dnssecOK, a, QType::A, QClass::IN, response, receivedOverUDP, 0, boost::none);
+
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP, 0, true);
+ if (found == true) {
+ BOOST_CHECK_EQUAL(dq.getData().size(), response.size());
+ int match = memcmp(dq.getData().data(), response.data(), dq.getData().size());
+ BOOST_CHECK_EQUAL(match, 0);
+ BOOST_CHECK(!subnet);
+ }
+ else {
+ skipped++;
+ }
+ }
+
+ BOOST_CHECK_EQUAL(skipped, PC.getInsertCollisions());
+ BOOST_CHECK_EQUAL(PC.getSize(), counter - skipped);
+
+ size_t deleted=0;
+ size_t delcounter=0;
+ for (delcounter=0; delcounter < counter/1000; ++delcounter) {
+ DNSName a=DNSName(std::to_string(delcounter))+DNSName(" hello");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, a, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnet, dnssecOK, receivedOverUDP);
+ if (found == true) {
+ auto removed = PC.expungeByName(a);
+ BOOST_CHECK_EQUAL(removed, 1U);
+ deleted += removed;
+ }
+ }
+ BOOST_CHECK_EQUAL(PC.getSize(), counter - skipped - deleted);
+
+ size_t matches=0;
+ size_t expected=counter-skipped-deleted;
+ for (; delcounter < counter; ++delcounter) {
+ DNSName a(DNSName(std::to_string(delcounter))+DNSName(" hello"));
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, a, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ if (PC.get(dq, pwQ.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP)) {
+ matches++;
+ }
+ }
+
+ /* in the unlikely event that the test took so long that the entries did expire.. */
+ auto expired = PC.purgeExpired(0, now);
+ BOOST_CHECK_EQUAL(matches + expired, expected);
+
+ auto remaining = PC.getSize();
+ auto removed = PC.expungeByName(DNSName(" hello"), QType::ANY, true);
+ BOOST_CHECK_EQUAL(PC.getSize(), 0U);
+ BOOST_CHECK_EQUAL(removed, remaining);
+
+ /* nothing to remove */
+ BOOST_CHECK_EQUAL(PC.purgeExpired(0, now), 0U);
+ }
+ catch (const PDNSException& e) {
+ cerr<<"Had error: "<<e.reason<<endl;
+ throw;
+ }
+}
+
+
+BOOST_AUTO_TEST_CASE(test_PacketCacheSharded) {
+ const size_t maxEntries = 150000;
+ const size_t numberOfShards = 10;
+ DNSDistPacketCache PC(maxEntries, 86400, 1, 60, 3600, 60, false, numberOfShards);
+ BOOST_CHECK_EQUAL(PC.getSize(), 0U);
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+
+ size_t counter = 0;
+ size_t skipped = 0;
+ ComboAddress remote;
+ bool dnssecOK = false;
+ const time_t now = time(nullptr);
+
+ try {
+ for (counter = 0; counter < 100000; ++counter) {
+ DNSName a(std::to_string(counter) + ".powerdns.com.");
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, a, QType::AAAA, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, a, QType::AAAA, QClass::IN, 0);
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = pwQ.getHeader()->id;
+ pwR.startRecord(a, QType::AAAA, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ ComboAddress v6("2001:db8::1");
+ pwR.xfrIP6(std::string(reinterpret_cast<const char*>(v6.sin6.sin6_addr.s6_addr), 16));
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::AAAA, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnet, dnssecOK, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+
+ PC.insert(key, subnet, *(getFlagsFromDNSHeader(dq.getHeader())), dnssecOK, a, QType::AAAA, QClass::IN, response, receivedOverUDP, 0, boost::none);
+
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP, 0, true);
+ if (found == true) {
+ BOOST_CHECK_EQUAL(dq.getData().size(), response.size());
+ int match = memcmp(dq.getData().data(), response.data(), dq.getData().size());
+ BOOST_CHECK_EQUAL(match, 0);
+ BOOST_CHECK(!subnet);
+ }
+ else {
+ skipped++;
+ }
+ }
+
+ BOOST_CHECK_EQUAL(skipped, PC.getInsertCollisions());
+ BOOST_CHECK_EQUAL(PC.getSize(), counter - skipped);
+
+ size_t matches = 0;
+ for (counter = 0; counter < 100000; ++counter) {
+ DNSName a(std::to_string(counter) + ".powerdns.com.");
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, a, QType::AAAA, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::AAAA, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ if (PC.get(dq, pwQ.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP)) {
+ matches++;
+ }
+ }
+
+ BOOST_CHECK_EQUAL(matches, counter - skipped);
+
+ auto remaining = PC.getSize();
+
+ /* no entry should have expired */
+ auto expired = PC.purgeExpired(0, now);
+ BOOST_CHECK_EQUAL(expired, 0U);
+
+ /* but after the TTL .. let's ask for at most 1k entries */
+ auto removed = PC.purgeExpired(1000, now + 7200 + 3600);
+ BOOST_CHECK_EQUAL(removed, remaining - 1000U);
+ BOOST_CHECK_EQUAL(PC.getSize(), 1000U);
+
+ /* now remove everything */
+ removed = PC.purgeExpired(0, now + 7200 + 3600);
+ BOOST_CHECK_EQUAL(removed, 1000U);
+ BOOST_CHECK_EQUAL(PC.getSize(), 0U);
+
+ /* nothing to remove */
+ BOOST_CHECK_EQUAL(PC.purgeExpired(0, now), 0U);
+ }
+ catch (const PDNSException& e) {
+ cerr<<"Had error: "<<e.reason<<endl;
+ throw;
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_PacketCacheTCP) {
+ const size_t maxEntries = 150000;
+ DNSDistPacketCache PC(maxEntries, 86400, 1);
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+
+ ComboAddress remote;
+ bool dnssecOK = false;
+ try {
+ DNSName a = DNSName("tcp");
+ BOOST_CHECK_EQUAL(DNSName(a.toString()), a);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, a, QType::AAAA, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, a, QType::AAAA, QClass::IN, 0);
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = pwQ.getHeader()->id;
+ pwR.startRecord(a, QType::AAAA, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ ComboAddress v6("2001:db8::1");
+ pwR.xfrIP6(std::string(reinterpret_cast<const char*>(v6.sin6.sin6_addr.s6_addr), 16));
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ {
+ /* UDP */
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnet, dnssecOK, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+
+ PC.insert(key, subnet, *(getFlagsFromDNSHeader(dq.getHeader())), dnssecOK, a, QType::A, QClass::IN, response, receivedOverUDP, RCode::NoError, boost::none);
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP, 0, true);
+ BOOST_CHECK_EQUAL(found, true);
+ BOOST_CHECK(!subnet);
+ }
+
+ {
+ /* same but over TCP */
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoTCP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnet, dnssecOK, !receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+
+ PC.insert(key, subnet, *(getFlagsFromDNSHeader(dq.getHeader())), dnssecOK, a, QType::A, QClass::IN, response, !receivedOverUDP, RCode::NoError, boost::none);
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, !receivedOverUDP, 0, true);
+ BOOST_CHECK_EQUAL(found, true);
+ BOOST_CHECK(!subnet);
+ }
+ }
+ catch(PDNSException& e) {
+ cerr<<"Had error: "<<e.reason<<endl;
+ throw;
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_PacketCacheServFailTTL) {
+ const size_t maxEntries = 150000;
+ DNSDistPacketCache PC(maxEntries, 86400, 1);
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+
+ ComboAddress remote;
+ bool dnssecOK = false;
+ try {
+ DNSName a = DNSName("servfail");
+ BOOST_CHECK_EQUAL(DNSName(a.toString()), a);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, a, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, a, QType::A, QClass::IN, 0);
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 0;
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rcode = RCode::ServFail;
+ pwR.getHeader()->id = pwQ.getHeader()->id;
+ pwR.commit();
+
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnet, dnssecOK, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+
+ // Insert with failure-TTL of 0 (-> should not enter cache).
+ PC.insert(key, subnet, *(getFlagsFromDNSHeader(dq.getHeader())), dnssecOK, a, QType::A, QClass::IN, response, receivedOverUDP, RCode::ServFail, boost::optional<uint32_t>(0));
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP, 0, true);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+
+ // Insert with failure-TTL non-zero (-> should enter cache).
+ PC.insert(key, subnet, *(getFlagsFromDNSHeader(dq.getHeader())), dnssecOK, a, QType::A, QClass::IN, response, receivedOverUDP, RCode::ServFail, boost::optional<uint32_t>(300));
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP, 0, true);
+ BOOST_CHECK_EQUAL(found, true);
+ BOOST_CHECK(!subnet);
+ }
+ catch(PDNSException& e) {
+ cerr<<"Had error: "<<e.reason<<endl;
+ throw;
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_PacketCacheNoDataTTL) {
+ const size_t maxEntries = 150000;
+ DNSDistPacketCache PC(maxEntries, /* maxTTL */ 86400, /* minTTL */ 1, /* tempFailureTTL */ 60, /* maxNegativeTTL */ 1);
+
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+
+ ComboAddress remote;
+ bool dnssecOK = false;
+ try {
+ DNSName name("nodata");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 0;
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rcode = RCode::NoError;
+ pwR.getHeader()->id = pwQ.getHeader()->id;
+ pwR.commit();
+ pwR.startRecord(name, QType::SOA, 86400, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.commit();
+ pwR.addOpt(4096, 0, 0);
+ pwR.commit();
+
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&name, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnet, dnssecOK, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+
+ PC.insert(key, subnet, *(getFlagsFromDNSHeader(dq.getHeader())), dnssecOK, name, QType::A, QClass::IN, response, receivedOverUDP, RCode::NoError, boost::none);
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP, 0, true);
+ BOOST_CHECK_EQUAL(found, true);
+ BOOST_CHECK(!subnet);
+
+ sleep(2);
+ /* it should have expired by now */
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP, 0, true);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+ }
+ catch(const PDNSException& e) {
+ cerr<<"Had error: "<<e.reason<<endl;
+ throw;
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_PacketCacheNXDomainTTL) {
+ const size_t maxEntries = 150000;
+ DNSDistPacketCache PC(maxEntries, /* maxTTL */ 86400, /* minTTL */ 1, /* tempFailureTTL */ 60, /* maxNegativeTTL */ 1);
+
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+
+ ComboAddress remote;
+ bool dnssecOK = false;
+ try {
+ DNSName name("nxdomain");
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, name, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 0;
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rcode = RCode::NXDomain;
+ pwR.getHeader()->id = pwQ.getHeader()->id;
+ pwR.commit();
+ pwR.startRecord(name, QType::SOA, 86400, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.commit();
+ pwR.addOpt(4096, 0, 0);
+ pwR.commit();
+
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&name, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnet, dnssecOK, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+
+ PC.insert(key, subnet, *(getFlagsFromDNSHeader(dq.getHeader())), dnssecOK, name, QType::A, QClass::IN, response, receivedOverUDP, RCode::NXDomain, boost::none);
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP, 0, true);
+ BOOST_CHECK_EQUAL(found, true);
+ BOOST_CHECK(!subnet);
+
+ sleep(2);
+ /* it should have expired by now */
+ found = PC.get(dq, pwR.getHeader()->id, &key, subnet, dnssecOK, receivedOverUDP, 0, true);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK(!subnet);
+ }
+ catch(const PDNSException& e) {
+ cerr<<"Had error: "<<e.reason<<endl;
+ throw;
+ }
+}
+
+static DNSDistPacketCache g_PC(500000);
+
+static void threadMangler(unsigned int offset)
+{
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+ try {
+ ComboAddress remote;
+ bool dnssecOK = false;
+ for(unsigned int counter=0; counter < 100000; ++counter) {
+ DNSName a=DNSName("hello ")+DNSName(std::to_string(counter+offset));
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, a, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, a, QType::A, QClass::IN, 0);
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = pwQ.getHeader()->id;
+ pwR.startRecord(a, QType::A, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ g_PC.get(dq, 0, &key, subnet, dnssecOK, receivedOverUDP);
+
+ g_PC.insert(key, subnet, *(getFlagsFromDNSHeader(dq.getHeader())), dnssecOK, a, QType::A, QClass::IN, response, receivedOverUDP, 0, boost::none);
+ }
+ }
+ catch(PDNSException& e) {
+ cerr<<"Had error: "<<e.reason<<endl;
+ throw;
+ }
+}
+
+AtomicCounter g_missing;
+
+static void threadReader(unsigned int offset)
+{
+ bool dnssecOK = false;
+ struct timespec queryTime;
+ gettime(&queryTime); // does not have to be accurate ("realTime") in tests
+ try
+ {
+ ComboAddress remote;
+ for(unsigned int counter=0; counter < 100000; ++counter) {
+ DNSName a=DNSName("hello ")+DNSName(std::to_string(counter+offset));
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, a, QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ uint32_t key = 0;
+ boost::optional<Netmask> subnet;
+ DNSQuestion dq(&a, QType::A, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = g_PC.get(dq, 0, &key, subnet, dnssecOK, receivedOverUDP);
+ if (!found) {
+ g_missing++;
+ }
+ }
+ }
+ catch(PDNSException& e) {
+ cerr<<"Had error in threadReader: "<<e.reason<<endl;
+ throw;
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_PacketCacheThreaded) {
+ try {
+ std::vector<std::thread> threads;
+ for (int i = 0; i < 4; ++i) {
+ threads.push_back(std::thread(threadMangler, i*1000000UL));
+ }
+
+ for (auto& t : threads) {
+ t.join();
+ }
+
+ threads.clear();
+
+ BOOST_CHECK_EQUAL(g_PC.getSize() + g_PC.getDeferredInserts() + g_PC.getInsertCollisions(), 400000U);
+ BOOST_CHECK_SMALL(1.0*g_PC.getInsertCollisions(), 10000.0);
+
+ for (int i = 0; i < 4; ++i) {
+ threads.push_back(std::thread(threadReader, i*1000000UL));
+ }
+
+ for (auto& t : threads) {
+ t.join();
+ }
+
+ BOOST_CHECK((g_PC.getDeferredInserts() + g_PC.getDeferredLookups() + g_PC.getInsertCollisions()) >= g_missing);
+ }
+ catch(PDNSException& e) {
+ cerr<<"Had error: "<<e.reason<<endl;
+ throw;
+ }
+
+}
+
+BOOST_AUTO_TEST_CASE(test_PCCollision) {
+ const size_t maxEntries = 150000;
+ DNSDistPacketCache PC(maxEntries, 86400, 1, 60, 3600, 60, false, 1, true, true);
+ BOOST_CHECK_EQUAL(PC.getSize(), 0U);
+
+ DNSName qname("www.powerdns.com.");
+ uint16_t qtype = QType::AAAA;
+ uint16_t qid = 0x42;
+ uint32_t key;
+ uint32_t secondKey;
+ boost::optional<Netmask> subnetOut;
+ bool dnssecOK = false;
+
+ /* lookup for a query with a first ECS value,
+ insert a corresponding response */
+ {
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, qname, qtype, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = qid;
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t ednsOptions;
+ EDNSSubnetOpts opt;
+ opt.source = Netmask("10.0.59.220/32");
+ ednsOptions.emplace_back(EDNSOptionCode::ECS, makeEDNSSubnetOptsString(opt));
+ pwQ.addOpt(512, 0, 0, ednsOptions);
+ pwQ.commit();
+
+ ComboAddress remote("192.0.2.1");
+ struct timespec queryTime;
+ gettime(&queryTime);
+ DNSQuestion dq(&qname, QType::AAAA, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnetOut, dnssecOK, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_REQUIRE(subnetOut);
+ BOOST_CHECK_EQUAL(subnetOut->toString(), opt.source.toString());
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, qname, qtype, QClass::IN, 0);
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->id = qid;
+ pwR.startRecord(qname, qtype, 100, QClass::IN, DNSResourceRecord::ANSWER);
+ ComboAddress v6("::1");
+ pwR.xfrCAWithoutPort(6, v6);
+ pwR.commit();
+ pwR.addOpt(512, 0, 0, ednsOptions);
+ pwR.commit();
+
+ PC.insert(key, subnetOut, *(getFlagsFromDNSHeader(pwR.getHeader())), dnssecOK, qname, qtype, QClass::IN, response, receivedOverUDP, RCode::NoError, boost::none);
+ BOOST_CHECK_EQUAL(PC.getSize(), 1U);
+
+ found = PC.get(dq, 0, &key, subnetOut, dnssecOK, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, true);
+ BOOST_REQUIRE(subnetOut);
+ BOOST_CHECK_EQUAL(subnetOut->toString(), opt.source.toString());
+ }
+
+ /* now lookup for the same query with a different ECS value,
+ we should get the same key (collision) but no match */
+ {
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, qname, qtype, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = qid;
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t ednsOptions;
+ EDNSSubnetOpts opt;
+ opt.source = Netmask("10.0.167.48/32");
+ ednsOptions.emplace_back(EDNSOptionCode::ECS, makeEDNSSubnetOptsString(opt));
+ pwQ.addOpt(512, 0, 0, ednsOptions);
+ pwQ.commit();
+
+ ComboAddress remote("192.0.2.1");
+ struct timespec queryTime;
+ gettime(&queryTime);
+ DNSQuestion dq(&qname, QType::AAAA, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &secondKey, subnetOut, dnssecOK, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+ BOOST_CHECK_EQUAL(secondKey, key);
+ BOOST_REQUIRE(subnetOut);
+ BOOST_CHECK_EQUAL(subnetOut->toString(), opt.source.toString());
+ BOOST_CHECK_EQUAL(PC.getLookupCollisions(), 1U);
+ }
+
+#if 0
+ /* to be able to compute a new collision if the packet cache hashing code is updated */
+ {
+ DNSDistPacketCache pc(10000);
+ GenericDNSPacketWriter<PacketBuffer>::optvect_t ednsOptions;
+ EDNSSubnetOpts opt;
+ std::map<uint32_t, Netmask> colMap;
+ size_t collisions = 0;
+ size_t total = 0;
+ //qname = DNSName("collision-with-ecs-parsing.cache.tests.powerdns.com.");
+
+ for (size_t idxA = 0; idxA < 256; idxA++) {
+ for (size_t idxB = 0; idxB < 256; idxB++) {
+ for (size_t idxC = 0; idxC < 256; idxC++) {
+ PacketBuffer secondQuery;
+ GenericDNSPacketWriter<PacketBuffer> pwFQ(secondQuery, qname, QType::AAAA, QClass::IN, 0);
+ pwFQ.getHeader()->rd = 1;
+ pwFQ.getHeader()->qr = false;
+ pwFQ.getHeader()->id = 0x42;
+ opt.source = Netmask("10." + std::to_string(idxA) + "." + std::to_string(idxB) + "." + std::to_string(idxC) + "/32");
+ ednsOptions.clear();
+ ednsOptions.emplace_back(EDNSOptionCode::ECS, makeEDNSSubnetOptsString(opt));
+ pwFQ.addOpt(512, 0, 0, ednsOptions);
+ pwFQ.commit();
+ secondKey = pc.getKey(qname.toDNSString(), qname.wirelength(), secondQuery, false);
+ auto pair = colMap.emplace(secondKey, opt.source);
+ total++;
+ if (!pair.second) {
+ collisions++;
+ cerr<<"Collision between "<<colMap[secondKey].toString()<<" and "<<opt.source.toString()<<" for key "<<secondKey<<endl;
+ goto done;
+ }
+ }
+ }
+ }
+ done:
+ cerr<<"collisions: "<<collisions<<endl;
+ cerr<<"total: "<<total<<endl;
+ }
+#endif
+}
+
+BOOST_AUTO_TEST_CASE(test_PCDNSSECCollision) {
+ const size_t maxEntries = 150000;
+ DNSDistPacketCache PC(maxEntries, 86400, 1, 60, 3600, 60, false, 1, true, true);
+ BOOST_CHECK_EQUAL(PC.getSize(), 0U);
+
+ DNSName qname("www.powerdns.com.");
+ uint16_t qtype = QType::AAAA;
+ uint16_t qid = 0x42;
+ uint32_t key;
+ boost::optional<Netmask> subnetOut;
+
+ /* lookup for a query with DNSSEC OK,
+ insert a corresponding response with DO set,
+ check that it doesn't match without DO, but does with it */
+ {
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, qname, qtype, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = qid;
+ pwQ.addOpt(512, 0, EDNS_HEADER_FLAG_DO);
+ pwQ.commit();
+
+ ComboAddress remote("192.0.2.1");
+ struct timespec queryTime;
+ gettime(&queryTime);
+ DNSQuestion dq(&qname, QType::AAAA, QClass::IN, &remote, &remote, query, dnsdist::Protocol::DoUDP, &queryTime);
+ bool found = PC.get(dq, 0, &key, subnetOut, true, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+
+ PacketBuffer response;
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, qname, qtype, QClass::IN, 0);
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->id = qid;
+ pwR.startRecord(qname, qtype, 100, QClass::IN, DNSResourceRecord::ANSWER);
+ ComboAddress v6("::1");
+ pwR.xfrCAWithoutPort(6, v6);
+ pwR.commit();
+ pwR.addOpt(512, 0, EDNS_HEADER_FLAG_DO);
+ pwR.commit();
+
+ PC.insert(key, subnetOut, *(getFlagsFromDNSHeader(pwR.getHeader())), /* DNSSEC OK is set */ true, qname, qtype, QClass::IN, response, receivedOverUDP, RCode::NoError, boost::none);
+ BOOST_CHECK_EQUAL(PC.getSize(), 1U);
+
+ found = PC.get(dq, 0, &key, subnetOut, false, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, false);
+
+ found = PC.get(dq, 0, &key, subnetOut, true, receivedOverUDP);
+ BOOST_CHECK_EQUAL(found, true);
+ }
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-dnsdistrings_cc.cc b/test-dnsdistrings_cc.cc
new file mode 100644
index 0000000..db665bb
--- /dev/null
+++ b/test-dnsdistrings_cc.cc
@@ -0,0 +1,290 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <thread>
+#include <boost/test/unit_test.hpp>
+
+#include "dnsdist-rings.hh"
+#include "gettime.hh"
+
+BOOST_AUTO_TEST_SUITE(dnsdistrings_cc)
+
+static void test_ring(size_t maxEntries, size_t numberOfShards, size_t nbLockTries)
+{
+ Rings rings(maxEntries, numberOfShards, nbLockTries);
+ size_t entriesPerShard = maxEntries / numberOfShards;
+
+ BOOST_CHECK_EQUAL(rings.getNumberOfShards(), numberOfShards);
+ BOOST_CHECK_EQUAL(rings.getNumberOfQueryEntries(), 0U);
+ BOOST_CHECK_EQUAL(rings.getNumberOfResponseEntries(), 0U);
+ BOOST_CHECK_EQUAL(rings.d_shards.size(), rings.getNumberOfShards());
+ for (const auto& shard : rings.d_shards) {
+ BOOST_CHECK(shard != nullptr);
+ }
+
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor1("192.0.2.1");
+ ComboAddress requestor2("192.0.2.2");
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+ struct timespec now;
+ gettime(&now);
+
+ /* fill the query ring */
+ for (size_t idx = 0; idx < maxEntries; idx++) {
+ rings.insertQuery(now, requestor1, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(rings.getNumberOfQueryEntries(), maxEntries);
+ BOOST_CHECK_EQUAL(rings.getNumberOfResponseEntries(), 0U);
+ for (const auto& shard : rings.d_shards) {
+ auto ring = shard->queryRing.lock();
+ BOOST_CHECK_EQUAL(ring->size(), entriesPerShard);
+ for (const auto& entry : *ring) {
+ BOOST_CHECK_EQUAL(entry.name, qname);
+ BOOST_CHECK_EQUAL(entry.qtype, qtype);
+ BOOST_CHECK_EQUAL(entry.size, size);
+ BOOST_CHECK_EQUAL(entry.when.tv_sec, now.tv_sec);
+ BOOST_CHECK_EQUAL(entry.requestor.toStringWithPort(), requestor1.toStringWithPort());
+ }
+ }
+
+ /* push enough queries to get rid of the existing ones */
+ for (size_t idx = 0; idx < maxEntries; idx++) {
+ rings.insertQuery(now, requestor2, qname, qtype, size, dh, protocol);
+ }
+ BOOST_CHECK_EQUAL(rings.getNumberOfQueryEntries(), maxEntries);
+ BOOST_CHECK_EQUAL(rings.getNumberOfResponseEntries(), 0U);
+ for (const auto& shard : rings.d_shards) {
+ auto ring = shard->queryRing.lock();
+ BOOST_CHECK_EQUAL(ring->size(), entriesPerShard);
+ for (const auto& entry : *ring) {
+ BOOST_CHECK_EQUAL(entry.name, qname);
+ BOOST_CHECK_EQUAL(entry.qtype, qtype);
+ BOOST_CHECK_EQUAL(entry.size, size);
+ BOOST_CHECK_EQUAL(entry.when.tv_sec, now.tv_sec);
+ BOOST_CHECK_EQUAL(entry.requestor.toStringWithPort(), requestor2.toStringWithPort());
+ }
+ }
+
+ ComboAddress server("192.0.2.42");
+ unsigned int latency = 100;
+
+ /* fill the response ring */
+ for (size_t idx = 0; idx < maxEntries; idx++) {
+ rings.insertResponse(now, requestor1, qname, qtype, latency, size, dh, server, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(rings.getNumberOfQueryEntries(), maxEntries);
+ BOOST_CHECK_EQUAL(rings.getNumberOfResponseEntries(), maxEntries);
+ for (const auto& shard : rings.d_shards) {
+ auto ring = shard->respRing.lock();
+ BOOST_CHECK_EQUAL(ring->size(), entriesPerShard);
+ for (const auto& entry : *ring) {
+ BOOST_CHECK_EQUAL(entry.name, qname);
+ BOOST_CHECK_EQUAL(entry.qtype, qtype);
+ BOOST_CHECK_EQUAL(entry.size, size);
+ BOOST_CHECK_EQUAL(entry.when.tv_sec, now.tv_sec);
+ BOOST_CHECK_EQUAL(entry.requestor.toStringWithPort(), requestor1.toStringWithPort());
+ BOOST_CHECK_EQUAL(entry.usec, latency);
+ BOOST_CHECK_EQUAL(entry.ds.toStringWithPort(), server.toStringWithPort());
+ }
+ }
+
+ /* push enough responses to get rid of the existing ones */
+ for (size_t idx = 0; idx < maxEntries; idx++) {
+ rings.insertResponse(now, requestor2, qname, qtype, latency, size, dh, server, outgoingProtocol);
+ }
+ BOOST_CHECK_EQUAL(rings.getNumberOfQueryEntries(), maxEntries);
+ BOOST_CHECK_EQUAL(rings.getNumberOfResponseEntries(), maxEntries);
+ for (const auto& shard : rings.d_shards) {
+ auto ring = shard->respRing.lock();
+ BOOST_CHECK_EQUAL(ring->size(), entriesPerShard);
+ for (const auto& entry : *ring) {
+ BOOST_CHECK_EQUAL(entry.name, qname);
+ BOOST_CHECK_EQUAL(entry.qtype, qtype);
+ BOOST_CHECK_EQUAL(entry.size, size);
+ BOOST_CHECK_EQUAL(entry.when.tv_sec, now.tv_sec);
+ BOOST_CHECK_EQUAL(entry.requestor.toStringWithPort(), requestor2.toStringWithPort());
+ BOOST_CHECK_EQUAL(entry.usec, latency);
+ BOOST_CHECK_EQUAL(entry.ds.toStringWithPort(), server.toStringWithPort());
+ }
+ }
+}
+
+
+BOOST_AUTO_TEST_CASE(test_Rings_Simple) {
+
+ /* 5 entries over 1 shard */
+ test_ring(5, 1, 0);
+ /* 500 entries over 10 shards */
+ test_ring(500, 10, 0);
+ /* 5000 entries over 100 shards, max 5 try-lock attempts */
+ test_ring(500, 100, 5);
+}
+
+static void ringReaderThread(Rings& rings, std::atomic<bool>& done, size_t numberOfEntries, uint16_t qtype)
+{
+ size_t iterationsDone = 0;
+
+ while (done == false) {
+ size_t numberOfQueries = 0;
+ size_t numberOfResponses = 0;
+
+ for (const auto& shard : rings.d_shards) {
+ {
+ auto rl = shard->queryRing.lock();
+ for(const auto& c : *rl) {
+ numberOfQueries++;
+ // BOOST_CHECK* is slow as hell..
+ if(c.qtype != qtype) {
+ cerr<<"Invalid query QType!"<<endl;
+ return;
+ }
+ }
+ }
+ {
+ auto rl = shard->respRing.lock();
+ for(const auto& c : *rl) {
+ if(c.qtype != qtype) {
+ cerr<<"Invalid response QType!"<<endl;
+ return;
+ }
+ numberOfResponses++;
+ }
+ }
+ }
+
+ BOOST_CHECK_LE(numberOfQueries, numberOfEntries);
+ BOOST_CHECK_LE(numberOfResponses, numberOfEntries);
+ iterationsDone++;
+ usleep(10000);
+ }
+
+ BOOST_CHECK_GT(iterationsDone, 1U);
+#if 0
+ cerr<<"Done "<<iterationsDone<<" reading iterations"<<endl;
+#endif
+}
+
+static void ringWriterThread(Rings& rings, size_t numberOfEntries, const Rings::Query& query, const Rings::Response& response)
+{
+ for (size_t idx = 0; idx < numberOfEntries; idx++) {
+ rings.insertQuery(query.when, query.requestor, query.name, query.qtype, query.size, query.dh, query.protocol);
+ rings.insertResponse(response.when, response.requestor, response.name, response.qtype, response.usec, response.size, response.dh, response.ds, response.protocol);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_Rings_Threaded) {
+ size_t numberOfEntries = 1000000;
+ size_t numberOfShards = 50;
+ size_t lockAttempts = 5;
+ size_t numberOfWriterThreads = 4;
+ size_t entriesPerShard = numberOfEntries / numberOfShards;
+
+ struct timespec now;
+ gettime(&now);
+ dnsheader dh;
+ memset(&dh, 0, sizeof(dh));
+ dh.id = htons(4242);
+ dh.qr = 0;
+ dh.tc = 0;
+ dh.rd = 0;
+ dh.rcode = 0;
+ dh.qdcount = htons(1);
+ DNSName qname("rings.powerdns.com.");
+ ComboAddress requestor("192.0.2.1");
+ ComboAddress server("192.0.2.42");
+ unsigned int latency = 100;
+ uint16_t qtype = QType::AAAA;
+ uint16_t size = 42;
+ dnsdist::Protocol protocol = dnsdist::Protocol::DoUDP;
+ dnsdist::Protocol outgoingProtocol = dnsdist::Protocol::DoUDP;
+
+ Rings rings(numberOfEntries, numberOfShards, lockAttempts, true);
+ Rings::Query query({requestor, qname, now, dh, size, qtype, protocol});
+ Rings::Response response({requestor, server, qname, now, dh, latency, size, qtype, outgoingProtocol});
+
+ std::atomic<bool> done(false);
+ std::vector<std::thread> writerThreads;
+ std::thread readerThread(ringReaderThread, std::ref(rings), std::ref(done), numberOfEntries, qtype);
+
+ /* we need to overcommit a bit to account for the fact that due to contention,
+ we might not perfectly distribute the entries over the shards,
+ so some of them might get full while other still have some place left */
+ size_t insertionsPerThread = (1.2 * numberOfEntries) / numberOfWriterThreads;
+ for (size_t idx = 0; idx < numberOfWriterThreads; idx++) {
+ writerThreads.push_back(std::thread(ringWriterThread, std::ref(rings), insertionsPerThread, query, response));
+ }
+
+ /* wait for the writers to be finished */
+ for (auto& t : writerThreads) {
+ t.join();
+ }
+
+ /* we can stop the reader thread now */
+ done = true;
+ readerThread.join();
+
+ BOOST_CHECK_EQUAL(rings.getNumberOfShards(), numberOfShards);
+ BOOST_CHECK_EQUAL(rings.d_shards.size(), rings.getNumberOfShards());
+ BOOST_CHECK_LE(rings.getNumberOfQueryEntries(), numberOfEntries);
+ BOOST_CHECK_GT(rings.getNumberOfQueryEntries(), numberOfEntries * 0.75);
+ BOOST_WARN_GT(rings.getNumberOfQueryEntries(), numberOfEntries * 0.99);
+ BOOST_CHECK_LE(rings.getNumberOfResponseEntries(), numberOfEntries);
+ BOOST_CHECK_GT(rings.getNumberOfResponseEntries(), numberOfEntries * 0.75);
+ BOOST_WARN_GT(rings.getNumberOfResponseEntries(), numberOfEntries * 0.99);
+
+ size_t totalQueries = 0;
+ size_t totalResponses = 0;
+ for (const auto& shard : rings.d_shards) {
+ {
+ auto ring = shard->queryRing.lock();
+ BOOST_CHECK_LE(ring->size(), entriesPerShard);
+ // verify that the shard is not empty
+ BOOST_CHECK_GT(ring->size(), (entriesPerShard * 0.5) + 1);
+ // this would be optimal
+ BOOST_WARN_GT(ring->size(), entriesPerShard * 0.95);
+ totalQueries += ring->size();
+ for (const auto& entry : *ring) {
+ BOOST_CHECK_EQUAL(entry.name, qname);
+ BOOST_CHECK_EQUAL(entry.qtype, qtype);
+ BOOST_CHECK_EQUAL(entry.size, size);
+ BOOST_CHECK_EQUAL(entry.when.tv_sec, now.tv_sec);
+ BOOST_CHECK_EQUAL(entry.requestor.toStringWithPort(), requestor.toStringWithPort());
+ }
+ }
+ {
+ auto ring = shard->respRing.lock();
+ BOOST_CHECK_LE(ring->size(), entriesPerShard);
+ // verify that the shard is not empty
+ BOOST_CHECK_GT(ring->size(), (entriesPerShard * 0.5) + 1);
+ // this would be optimal
+ BOOST_WARN_GT(ring->size(), entriesPerShard * 0.95);
+ totalResponses += ring->size();
+ for (const auto& entry : *ring) {
+ BOOST_CHECK_EQUAL(entry.name, qname);
+ BOOST_CHECK_EQUAL(entry.qtype, qtype);
+ BOOST_CHECK_EQUAL(entry.size, size);
+ BOOST_CHECK_EQUAL(entry.when.tv_sec, now.tv_sec);
+ BOOST_CHECK_EQUAL(entry.requestor.toStringWithPort(), requestor.toStringWithPort());
+ BOOST_CHECK_EQUAL(entry.usec, latency);
+ BOOST_CHECK_EQUAL(entry.ds.toStringWithPort(), server.toStringWithPort());
+ }
+ }
+ }
+ BOOST_CHECK_EQUAL(rings.getNumberOfQueryEntries(), totalQueries);
+ BOOST_CHECK_EQUAL(rings.getNumberOfResponseEntries(), totalResponses);
+#if 0
+ cerr<<"Done "<<(insertionsPerThread*numberOfWriterThreads)<<" insertions"<<endl;
+ cerr<<"Got "<<rings.d_deferredQueryInserts<<" deferred query insertions"<<endl;
+ cerr<<"Got "<<rings.d_blockingQueryInserts<<" blocking query insertions"<<endl;
+ cerr<<"Got "<<rings.d_deferredResponseInserts<<" deferred response insertions"<<endl;
+ cerr<<"Got "<<rings.d_blockingResponseInserts<<" blocking response insertions"<<endl;
+#endif
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-dnsdistrules_cc.cc b/test-dnsdistrules_cc.cc
new file mode 100644
index 0000000..b44374f
--- /dev/null
+++ b/test-dnsdistrules_cc.cc
@@ -0,0 +1,149 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <thread>
+#include <boost/test/unit_test.hpp>
+
+#include "dnsdist-rules.hh"
+
+static DNSQuestion getDQ(const DNSName* providedName = nullptr)
+{
+ static const DNSName qname("powerdns.com.");
+ static const ComboAddress lc("127.0.0.1:53");
+ static const ComboAddress rem("192.0.2.1:42");
+ static struct timespec queryRealTime;
+ static PacketBuffer packet(sizeof(dnsheader));
+
+ uint16_t qtype = QType::A;
+ uint16_t qclass = QClass::IN;
+ auto proto = dnsdist::Protocol::DoUDP;
+ gettime(&queryRealTime, true);
+
+ DNSQuestion dq(providedName ? providedName : &qname, qtype, qclass, &lc, &rem, packet, proto, &queryRealTime);
+ return dq;
+}
+
+BOOST_AUTO_TEST_SUITE(dnsdistluarules_cc)
+
+BOOST_AUTO_TEST_CASE(test_MaxQPSIPRule) {
+ size_t maxQPS = 10;
+ size_t maxBurst = maxQPS;
+ unsigned int expiration = 300;
+ unsigned int cleanupDelay = 60;
+ unsigned int scanFraction = 10;
+ MaxQPSIPRule rule(maxQPS, maxBurst, 32, 64, expiration, cleanupDelay, scanFraction);
+
+ DNSName qname("powerdns.com.");
+ uint16_t qtype = QType::A;
+ uint16_t qclass = QClass::IN;
+ ComboAddress lc("127.0.0.1:53");
+ ComboAddress rem("192.0.2.1:42");
+ PacketBuffer packet(sizeof(dnsheader));
+ auto proto = dnsdist::Protocol::DoUDP;
+ struct timespec queryRealTime;
+ gettime(&queryRealTime, true);
+ struct timespec expiredTime;
+ /* the internal QPS limiter does not use the real time */
+ gettime(&expiredTime);
+
+ DNSQuestion dq(&qname, qtype, qclass, &lc, &rem, packet, proto, &queryRealTime);
+
+ for (size_t idx = 0; idx < maxQPS; idx++) {
+ /* let's use different source ports, it shouldn't matter */
+ rem = ComboAddress("192.0.2.1:" + std::to_string(idx));
+ BOOST_CHECK_EQUAL(rule.matches(&dq), false);
+ BOOST_CHECK_EQUAL(rule.getEntriesCount(), 1U);
+ }
+
+ /* maxQPS + 1, we should be blocked */
+ BOOST_CHECK_EQUAL(rule.matches(&dq), true);
+ BOOST_CHECK_EQUAL(rule.getEntriesCount(), 1U);
+
+ /* remove all entries that have not been updated since 'now' + 1,
+ so all of them */
+ expiredTime.tv_sec += 1;
+ rule.cleanup(expiredTime);
+
+ /* we should have been cleaned up */
+ BOOST_CHECK_EQUAL(rule.getEntriesCount(), 0U);
+
+ struct timespec beginInsertionTime;
+ gettime(&beginInsertionTime);
+ /* we should not be blocked anymore */
+ BOOST_CHECK_EQUAL(rule.matches(&dq), false);
+ /* and we be back */
+ BOOST_CHECK_EQUAL(rule.getEntriesCount(), 1U);
+
+
+ /* Let's insert a lot of different sources now */
+ for (size_t idxByte3 = 0; idxByte3 < 256; idxByte3++) {
+ for (size_t idxByte4 = 0; idxByte4 < 256; idxByte4++) {
+ rem = ComboAddress("10.0." + std::to_string(idxByte3) + "." + std::to_string(idxByte4));
+ BOOST_CHECK_EQUAL(rule.matches(&dq), false);
+ }
+ }
+ struct timespec endInsertionTime;
+ gettime(&endInsertionTime);
+
+ /* don't forget the existing entry */
+ size_t total = 1 + 256 * 256;
+ BOOST_CHECK_EQUAL(rule.getEntriesCount(), total);
+
+ /* make sure all entries are still valid */
+ struct timespec notExpiredTime = beginInsertionTime;
+ notExpiredTime.tv_sec -= 1;
+
+ size_t scanned = 0;
+ auto removed = rule.cleanup(notExpiredTime, &scanned);
+ BOOST_CHECK_EQUAL(removed, 0U);
+ /* the first entry should still have been valid, we should not have scanned more */
+ BOOST_CHECK_EQUAL(scanned, 1U);
+ BOOST_CHECK_EQUAL(rule.getEntriesCount(), total);
+
+ /* make sure all entries are _not_ valid anymore */
+ expiredTime = endInsertionTime;
+ expiredTime.tv_sec += 1;
+
+ removed = rule.cleanup(expiredTime, &scanned);
+ BOOST_CHECK_EQUAL(removed, (total / scanFraction) + 1);
+ /* we should not have scanned more than scanFraction */
+ BOOST_CHECK_EQUAL(scanned, removed);
+ BOOST_CHECK_EQUAL(rule.getEntriesCount(), total - removed);
+
+ rule.clear();
+ BOOST_CHECK_EQUAL(rule.getEntriesCount(), 0U);
+ removed = rule.cleanup(expiredTime, &scanned);
+ BOOST_CHECK_EQUAL(removed, 0U);
+ BOOST_CHECK_EQUAL(scanned, 0U);
+}
+
+BOOST_AUTO_TEST_CASE(test_poolOutstandingRule) {
+ auto dq = getDQ();
+
+ ServerPool sp{};
+ auto ds1 = std::make_shared<DownstreamState>(ComboAddress("192.0.2.1:53"));
+ auto ds2 = std::make_shared<DownstreamState>(ComboAddress("192.0.2.2:53"));
+
+ /* increase the outstanding count of both */
+ ds1->outstanding = 400;
+ ds2->outstanding = 30;
+
+ sp.addServer(ds1);
+ sp.addServer(ds2);
+
+ BOOST_CHECK_EQUAL(sp.poolLoad(), 400U + 30U);
+
+ auto localPool = g_pools.getCopy();
+ addServerToPool(localPool, "test", ds1);
+ addServerToPool(localPool, "test", ds2);
+ g_pools.setState(localPool);
+
+ PoolOutstandingRule pOR1("test", 10);
+ BOOST_CHECK_EQUAL(pOR1.matches(&dq), true);
+
+ PoolOutstandingRule pOR2("test", 1000);
+ BOOST_CHECK_EQUAL(pOR2.matches(&dq), false);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-dnsdistsvc_cc.cc b/test-dnsdistsvc_cc.cc
new file mode 100644
index 0000000..c15d07a
--- /dev/null
+++ b/test-dnsdistsvc_cc.cc
@@ -0,0 +1,96 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "dnsdist-svc.hh"
+#include "svc-records.hh"
+#include "dnsparser.hh"
+
+BOOST_AUTO_TEST_SUITE(dnsdistsvc_cc)
+
+BOOST_AUTO_TEST_CASE(test_Basic)
+{
+ DNSName target("powerdns.com.");
+
+ {
+ std::vector<uint8_t> payload;
+ const uint16_t priority = 1;
+ BOOST_CHECK(generateSVCPayload(payload, priority, target, {SvcParam::SvcParamKey::port}, {"dot"}, false, 853, std::string(), {ComboAddress("192.0.2.1")}, {ComboAddress("2001:db8::1")}, {}));
+ /* 2 octet field for SvcPriority as an integer in network byte order */
+ /* uncompressed, fully-qualified TargetName */
+ /* list of SvcParams as:
+ - 2 octet field containing the SvcParamKey as an integer in network byte order
+ - 2 octet field containing the length of the SvcParamValue as an integer between 0 and 65535 in network byte order (but constrained by the RDATA and DNS message sizes)
+ - an octet string of this length whose contents are in a format determined by the SvcParamKey
+ SvcParamKeys SHALL appear in increasing numeric order
+ */
+ size_t expectedSize = (/* priority */ 2) + target.wirelength() + (/* mandatory */ 2 + 2 + 2) + (/* alpns with 1-byte length field for each value */ 2 + 2 + 4) + (/* no-alpn-default is false */ 0) + (/* port */ 2 + 2 + 2) + (/* ech */ 0) + (/* v4 hints */ 2 + 2 + 9) + (/* v6 hints */ 2 + 2 + 11);
+ BOOST_CHECK_EQUAL(payload.size(), expectedSize);
+
+ std::set<SvcParam> params;
+ PacketReader pr(std::string_view(reinterpret_cast<const char*>(payload.data()), payload.size()), 0);
+ BOOST_CHECK_EQUAL(pr.get16BitInt(), priority);
+
+ /* we can't use getName() directly because it assumes that there has to be a dnsheader before the name */
+ DNSName parsedTarget(reinterpret_cast<const char*>(payload.data()), payload.size(), pr.getPosition(), false /* uncompress */, nullptr /* qtype */, nullptr /* qclass */, nullptr /* consumed */, 0);
+ pr.skip(parsedTarget.wirelength());
+ BOOST_CHECK_EQUAL(target.toString(), parsedTarget.toString());
+
+ pr.xfrSvcParamKeyVals(params);
+ BOOST_REQUIRE_EQUAL(params.size(), 5U);
+ auto param = params.begin();
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::mandatory);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::alpn);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::port);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::ipv4hint);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::ipv6hint);
+ }
+
+ {
+ std::vector<uint8_t> payload;
+ const uint16_t priority = 2;
+ const std::string ech("whatever");
+ const std::string dohParam("/dns-query{?dns}");
+
+ BOOST_CHECK(generateSVCPayload(payload, priority, target, {SvcParam::SvcParamKey::port}, {"h2"}, true, 443, ech, {ComboAddress("192.0.2.2")}, {ComboAddress("2001:db8::2")}, {std::pair<uint16_t, std::string>(42, dohParam)}));
+
+ size_t expectedSize = (/* priority */ 2) + target.wirelength() + (/* mandatory */ 2 + 2 + 2) + (/* alpns */ 2 + 2 + 3) + (/* no-alpn-default is true */ 2 + 2) + (/* port */ 2 + 2 + 2) + (/* ech */ 2 + 2 + ech.size()) + (/* v4 hints */ 2 + 2 + 9) + (/* v6 hints */ 2 + 2 + 11) + (/* doh parameter */ 2 + 2 + dohParam.size());
+ BOOST_CHECK_EQUAL(payload.size(), expectedSize);
+
+ std::set<SvcParam> params;
+ PacketReader pr(std::string_view(reinterpret_cast<const char*>(payload.data()), payload.size()), 0);
+ BOOST_CHECK_EQUAL(pr.get16BitInt(), priority);
+
+ /* we can't use getName() directly because it assumes that there has to be a dnsheader before the name */
+ DNSName parsedTarget(reinterpret_cast<const char*>(payload.data()), payload.size(), pr.getPosition(), false /* uncompress */, nullptr /* qtype */, nullptr /* qclass */, nullptr /* consumed */, 0);
+ pr.skip(parsedTarget.wirelength());
+ BOOST_CHECK_EQUAL(target.toString(), parsedTarget.toString());
+
+ pr.xfrSvcParamKeyVals(params);
+ BOOST_REQUIRE_EQUAL(params.size(), 8U);
+ auto param = params.begin();
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::mandatory);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::alpn);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::no_default_alpn);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::port);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::ipv4hint);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::ech);
+ ++param;
+ BOOST_CHECK(param->getKey() == SvcParam::SvcParamKey::ipv6hint);
+ ++param;
+ BOOST_CHECK_EQUAL(static_cast<uint16_t>(param->getKey()), 42U);
+ }
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-dnsdisttcp_cc.cc b/test-dnsdisttcp_cc.cc
new file mode 100644
index 0000000..09cb402
--- /dev/null
+++ b/test-dnsdisttcp_cc.cc
@@ -0,0 +1,4068 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <boost/test/unit_test.hpp>
+
+#include "dnswriter.hh"
+#include "dnsdist.hh"
+#include "dnsdist-proxy-protocol.hh"
+#include "dnsdist-rings.hh"
+#include "dnsdist-tcp-downstream.hh"
+#include "dnsdist-tcp-upstream.hh"
+
+struct DNSDistStats g_stats;
+GlobalStateHolder<NetmaskGroup> g_ACL;
+GlobalStateHolder<vector<DNSDistRuleAction> > g_ruleactions;
+GlobalStateHolder<vector<DNSDistResponseRuleAction> > g_respruleactions;
+GlobalStateHolder<vector<DNSDistResponseRuleAction> > g_cachehitrespruleactions;
+GlobalStateHolder<vector<DNSDistResponseRuleAction> > g_selfansweredrespruleactions;
+GlobalStateHolder<servers_t> g_dstates;
+
+QueryCount g_qcount;
+
+const bool TCPIOHandler::s_disableConnectForUnitTests = true;
+
+bool checkDNSCryptQuery(const ClientState& cs, PacketBuffer& query, std::unique_ptr<DNSCryptQuery>& dnsCryptQuery, time_t now, bool tcp)
+{
+ return false;
+}
+
+bool checkQueryHeaders(const struct dnsheader* dh)
+{
+ return true;
+}
+
+uint64_t uptimeOfProcess(const std::string& str)
+{
+ return 0;
+}
+
+void handleResponseSent(const IDState& ids, double udiff, const ComboAddress& client, const ComboAddress& backend, unsigned int size, const dnsheader& cleartextDH, dnsdist::Protocol protocol)
+{
+}
+
+static std::function<ProcessQueryResult(DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend)> s_processQuery;
+
+ProcessQueryResult processQuery(DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend)
+{
+ if (s_processQuery) {
+ return s_processQuery(dq, cs, holders, selectedBackend);
+ }
+
+ return ProcessQueryResult::Drop;
+}
+
+static std::function<bool(const PacketBuffer& response, const DNSName& qname, const uint16_t qtype, const uint16_t qclass, const ComboAddress& remote, unsigned int& qnameWireLength)> s_responseContentMatches;
+
+bool responseContentMatches(const PacketBuffer& response, const DNSName& qname, const uint16_t qtype, const uint16_t qclass, const ComboAddress& remote, unsigned int& qnameWireLength)
+{
+ if (s_responseContentMatches) {
+ return s_responseContentMatches(response, qname, qtype, qclass, remote, qnameWireLength);
+ }
+
+ return true;
+}
+
+static std::function<bool(PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted)> s_processResponse;
+
+bool processResponse(PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted, bool receivedOverUDP)
+{
+ if (s_processResponse) {
+ return s_processResponse(response, localRespRuleActions, dr, muted);
+ }
+
+ return false;
+}
+
+BOOST_AUTO_TEST_SUITE(test_dnsdisttcp_cc)
+
+struct ExpectedStep
+{
+public:
+ enum class ExpectedRequest { handshakeClient, readFromClient, writeToClient, closeClient, connectToBackend, readFromBackend, writeToBackend, closeBackend };
+
+ ExpectedStep(ExpectedRequest r, IOState n, size_t b = 0, std::function<void(int descriptor)> fn = nullptr): cb(fn), request(r), nextState(n), bytes(b)
+ {
+ }
+
+ std::function<void(int descriptor)> cb{nullptr};
+ ExpectedRequest request;
+ IOState nextState;
+ size_t bytes{0};
+};
+
+static std::deque<ExpectedStep> s_steps;
+
+static PacketBuffer s_readBuffer;
+static PacketBuffer s_writeBuffer;
+static PacketBuffer s_backendReadBuffer;
+static PacketBuffer s_backendWriteBuffer;
+
+std::ostream& operator<<(std::ostream &os, const ExpectedStep::ExpectedRequest d);
+
+std::ostream& operator<<(std::ostream &os, const ExpectedStep::ExpectedRequest d)
+{
+ static const std::vector<std::string> requests = { "handshake with client", "read from client", "write to client", "close connection to client", "connect to the backend", "read from the backend", "write to the backend", "close connection to backend" };
+ os<<requests.at(static_cast<size_t>(d));
+ return os;
+}
+
+class MockupTLSConnection : public TLSConnection
+{
+public:
+ MockupTLSConnection(int descriptor, bool client = false): d_descriptor(descriptor), d_client(client)
+ {
+ }
+
+ ~MockupTLSConnection() { }
+
+ IOState tryHandshake() override
+ {
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, ExpectedStep::ExpectedRequest::handshakeClient);
+
+ return step.nextState;
+ }
+
+ IOState tryWrite(const PacketBuffer& buffer, size_t& pos, size_t toWrite) override
+ {
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, !d_client ? ExpectedStep::ExpectedRequest::writeToClient : ExpectedStep::ExpectedRequest::writeToBackend);
+
+ if (step.bytes == 0) {
+ if (step.nextState == IOState::NeedWrite) {
+ return step.nextState;
+ }
+ throw std::runtime_error("Remote host closed the connection");
+ }
+
+ toWrite -= pos;
+ BOOST_REQUIRE_GE(buffer.size(), pos + toWrite);
+
+ if (step.bytes < toWrite) {
+ toWrite = step.bytes;
+ }
+
+ auto& externalBuffer = d_client ? s_backendWriteBuffer : s_writeBuffer;
+ externalBuffer.insert(externalBuffer.end(), buffer.begin() + pos, buffer.begin() + pos + toWrite);
+ pos += toWrite;
+
+ return step.nextState;
+ }
+
+ IOState tryRead(PacketBuffer& buffer, size_t& pos, size_t toRead, bool allowIncomplete=false) override
+ {
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, !d_client ? ExpectedStep::ExpectedRequest::readFromClient : ExpectedStep::ExpectedRequest::readFromBackend);
+
+ if (step.bytes == 0) {
+ if (step.nextState == IOState::NeedRead) {
+ return step.nextState;
+ }
+ throw std::runtime_error("Remote host closed the connection");
+ }
+
+ auto& externalBuffer = d_client ? s_backendReadBuffer : s_readBuffer;
+ toRead -= pos;
+
+ if (step.bytes < toRead) {
+ toRead = step.bytes;
+ }
+
+ BOOST_REQUIRE_GE(buffer.size(), toRead);
+ BOOST_REQUIRE_GE(externalBuffer.size(), toRead);
+
+ std::copy(externalBuffer.begin(), externalBuffer.begin() + toRead, buffer.begin() + pos);
+ pos += toRead;
+ externalBuffer.erase(externalBuffer.begin(), externalBuffer.begin() + toRead);
+
+ return step.nextState;
+ }
+
+ IOState tryConnect(bool fastOpen, const ComboAddress& remote) override
+ {
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, ExpectedStep::ExpectedRequest::connectToBackend);
+
+ return step.nextState;
+ }
+
+ void close() override
+ {
+ auto step = getStep();
+ BOOST_REQUIRE_EQUAL(step.request, !d_client ? ExpectedStep::ExpectedRequest::closeClient : ExpectedStep::ExpectedRequest::closeBackend);
+ }
+
+ bool hasBufferedData() const override
+ {
+ return false;
+ }
+
+ bool isUsable() const override
+ {
+ return true;
+ }
+
+ std::string getServerNameIndication() const override
+ {
+ return "";
+ }
+
+ std::vector<uint8_t> getNextProtocol() const override
+ {
+ return std::vector<uint8_t>();
+ }
+
+ LibsslTLSVersion getTLSVersion() const override
+ {
+ return LibsslTLSVersion::TLS13;
+ }
+
+ bool hasSessionBeenResumed() const override
+ {
+ return false;
+ }
+
+ std::vector<std::unique_ptr<TLSSession>> getSessions() override
+ {
+ return {};
+ }
+
+ void setSession(std::unique_ptr<TLSSession>& session) override
+ {
+ }
+
+ /* unused in that context, don't bother */
+ void doHandshake() override
+ {
+ }
+
+ void connect(bool fastOpen, const ComboAddress& remote, const struct timeval& timeout) override
+ {
+ }
+
+ size_t read(void* buffer, size_t bufferSize, const struct timeval&readTimeout, const struct timeval& totalTimeout={0,0}, bool allowIncomplete=false) override
+ {
+ return 0;
+ }
+
+ size_t write(const void* buffer, size_t bufferSize, const struct timeval& writeTimeout) override
+ {
+ return 0;
+ }
+private:
+ ExpectedStep getStep() const
+ {
+ BOOST_REQUIRE(!s_steps.empty());
+ auto step = s_steps.front();
+ s_steps.pop_front();
+
+ if (step.cb) {
+ step.cb(d_descriptor);
+ }
+
+ return step;
+ }
+
+ const int d_descriptor;
+ bool d_client{false};
+};
+
+class MockupTLSCtx : public TLSCtx
+{
+public:
+ ~MockupTLSCtx()
+ {
+ }
+
+ std::unique_ptr<TLSConnection> getConnection(int socket, const struct timeval& timeout, time_t now) override
+ {
+ return std::make_unique<MockupTLSConnection>(socket);
+ }
+
+ std::unique_ptr<TLSConnection> getClientConnection(const std::string& host, int socket, const struct timeval& timeout) override
+ {
+ return std::make_unique<MockupTLSConnection>(socket, true);
+ }
+
+ void rotateTicketsKey(time_t now) override
+ {
+ }
+
+ size_t getTicketsKeysCount() override
+ {
+ return 0;
+ }
+
+ std::string getName() const override
+ {
+ return "Mockup TLS";
+ }
+};
+
+class MockupFDMultiplexer : public FDMultiplexer
+{
+public:
+ MockupFDMultiplexer()
+ {
+ }
+
+ ~MockupFDMultiplexer()
+ {
+ }
+
+ int run(struct timeval* tv, int timeout=500) override
+ {
+ int ret = 0;
+
+ gettimeofday(tv, nullptr); // MANDATORY
+
+ /* 'ready' might be altered by a callback while we are iterating */
+ const auto readyFDs = ready;
+ for (const auto fd : readyFDs) {
+ {
+ const auto& it = d_readCallbacks.find(fd);
+
+ if (it != d_readCallbacks.end()) {
+ it->d_callback(it->d_fd, it->d_parameter);
+ continue; // so we don't refind ourselves as writable!
+ }
+ }
+
+ {
+ const auto& it = d_writeCallbacks.find(fd);
+
+ if (it != d_writeCallbacks.end()) {
+ it->d_callback(it->d_fd, it->d_parameter);
+ }
+ }
+ }
+
+ return ret;
+ }
+
+ void getAvailableFDs(std::vector<int>& fds, int timeout) override
+ {
+ }
+
+ void addFD(int fd, FDMultiplexer::EventKind kind) override
+ {
+ }
+
+ void removeFD(int fd, FDMultiplexer::EventKind) override
+ {
+ }
+
+ string getName() const override
+ {
+ return "mockup";
+ }
+
+ void setReady(int fd)
+ {
+ ready.insert(fd);
+ }
+
+ void setNotReady(int fd)
+ {
+ ready.erase(fd);
+ }
+
+private:
+ std::set<int> ready;
+};
+
+static bool isIPv6Supported()
+{
+ try {
+ ComboAddress addr("[2001:db8:53::1]:53");
+ auto socket = std::make_unique<Socket>(addr.sin4.sin_family, SOCK_STREAM, 0);
+ socket->setNonBlocking();
+ int res = SConnectWithTimeout(socket->getHandle(), addr, timeval{0, 0});
+ if (res == 0 || res == EINPROGRESS) {
+ return true;
+ }
+ return false;
+ }
+ catch (const std::exception& e) {
+ return false;
+ }
+}
+
+static ComboAddress getBackendAddress(const std::string& lastDigit, uint16_t port)
+{
+ static const bool useV6 = isIPv6Supported();
+
+ if (useV6) {
+ return ComboAddress("2001:db8:53::" + lastDigit, port);
+ }
+
+ return ComboAddress("192.0.2." + lastDigit, port);
+}
+
+static void appendPayloadEditingID(PacketBuffer& buffer, const PacketBuffer& payload, uint16_t newID)
+{
+ PacketBuffer newPayload(payload);
+ dnsheader dh;
+ memcpy(&dh, &newPayload.at(sizeof(uint16_t)), sizeof(dh));
+ dh.id = htons(newID);
+ memcpy(&newPayload.at(sizeof(uint16_t)), &dh, sizeof(dh));
+ buffer.insert(buffer.end(), newPayload.begin(), newPayload.end());
+}
+
+static void prependPayloadEditingID(PacketBuffer& buffer, const PacketBuffer& payload, uint16_t newID)
+{
+ PacketBuffer newPayload(payload);
+ dnsheader dh;
+ memcpy(&dh, &newPayload.at(sizeof(uint16_t)), sizeof(dh));
+ dh.id = htons(newID);
+ memcpy(&newPayload.at(sizeof(uint16_t)), &dh, sizeof(dh));
+ buffer.insert(buffer.begin(), newPayload.begin(), newPayload.end());
+}
+
+static void testInit(const std::string& name, TCPClientThreadData& threadData)
+{
+#ifdef DEBUGLOG_ENABLED
+ cerr<<name<<endl;
+#else
+ (void) name;
+#endif
+
+ s_steps.clear();
+ s_readBuffer.clear();
+ s_writeBuffer.clear();
+ s_backendReadBuffer.clear();
+ s_backendWriteBuffer.clear();
+
+ g_proxyProtocolACL.clear();
+ g_verbose = false;
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+
+ threadData.mplexer = std::make_unique<MockupFDMultiplexer>();
+}
+
+#define TEST_INIT(str) testInit(str, threadData)
+
+BOOST_AUTO_TEST_CASE(test_IncomingConnection_SelfAnswered)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ TCPClientThreadData threadData;
+ threadData.mplexer = std::make_unique<MockupFDMultiplexer>();
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, DNSName("powerdns.com."), QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ uint16_t querySize = static_cast<uint16_t>(query.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+ query.insert(query.begin(), sizeBytes, sizeBytes + 2);
+
+ {
+ /* drop right away */
+ TEST_INIT("=> drop right away");
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ return ProcessQueryResult::Drop;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ }
+
+ {
+ /* self-generated REFUSED, client closes connection right away */
+ TEST_INIT("=> self-gen");
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 65537 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ // Would be nicer to actually turn it into a response
+ return ProcessQueryResult::SendAnswer;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), query.size());
+ BOOST_CHECK(s_writeBuffer == query);
+ }
+
+ {
+ TEST_INIT("=> shorts");
+ /* need write then read during handshake,
+ short read on the size, then on the query itself,
+ self-generated REFUSED, short write on the response,
+ client closes connection right away */
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::NeedWrite },
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::NeedRead },
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 1 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 1 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, query.size() - 3 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 1 },
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, query.size() - 1},
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 1 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ // Would be nicer to actually turn it into a response
+ return ProcessQueryResult::SendAnswer;
+ };
+
+ /* mark the incoming FD as always ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0) {
+ threadData.mplexer->run(&now);
+ }
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), query.size());
+ BOOST_CHECK(s_writeBuffer == query);
+ }
+
+ {
+ TEST_INIT("=> exception while handling the query");
+ /* Exception raised while handling the query */
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ throw std::runtime_error("Something unexpected happened");
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ }
+
+ {
+#if 1
+ TEST_INIT("=> 10k self-generated pipelined on the same connection");
+
+ /* 10k self-generated REFUSED pipelined on the same connection */
+ size_t count = 10000;
+
+ s_steps = { { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done } };
+
+ for (size_t idx = 0; idx < count; idx++) {
+ s_readBuffer.insert(s_readBuffer.end(), query.begin(), query.end());
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 });
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 });
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() + 2 });
+ };
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 });
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::closeClient, IOState::Done });
+
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ // Would be nicer to actually turn it into a response
+ return ProcessQueryResult::SendAnswer;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), query.size() * count);
+#endif
+ }
+
+ {
+ TEST_INIT("=> timeout while reading the query");
+ /* timeout while reading the query */
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, query.size() - 2 - 2 },
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ /* should not be reached */
+ BOOST_CHECK(false);
+ return ProcessQueryResult::SendAnswer;
+ };
+
+ /* mark the incoming FD as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(-1);
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(threadData.mplexer->run(&now), 0);
+ struct timeval later = now;
+ later.tv_sec += g_tcpRecvTimeout + 1;
+ auto expiredReadConns = threadData.mplexer->getTimeouts(later, false);
+ for (const auto& cbData : expiredReadConns) {
+ BOOST_CHECK_EQUAL(cbData.first, state->d_handler.getDescriptor());
+ if (cbData.second.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(cbData.second);
+ BOOST_CHECK_EQUAL(cbData.first, cbState->d_handler.getDescriptor());
+ cbState->handleTimeout(cbState, false);
+ }
+ }
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ }
+
+ {
+ TEST_INIT("=> timeout while writing the response");
+ /* timeout while writing the response */
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, 1 },
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ return ProcessQueryResult::SendAnswer;
+ };
+
+ /* mark the incoming FD as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(-1);
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(threadData.mplexer->run(&now), 0);
+ struct timeval later = now;
+ later.tv_sec += g_tcpRecvTimeout + 1;
+ auto expiredWriteConns = threadData.mplexer->getTimeouts(later, true);
+ for (const auto& cbData : expiredWriteConns) {
+ BOOST_CHECK_EQUAL(cbData.first, state->d_handler.getDescriptor());
+ if (cbData.second.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(cbData.second);
+ BOOST_CHECK_EQUAL(cbData.first, cbState->d_handler.getDescriptor());
+ cbState->handleTimeout(cbState, false);
+ }
+ }
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 1U);
+ }
+
+ {
+ TEST_INIT("=> Client closes the connection while writing the response (self-answered)");
+
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ return ProcessQueryResult::SendAnswer;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_IncomingConnectionWithProxyProtocol_SelfAnswered)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ TCPClientThreadData threadData;
+ threadData.mplexer = std::make_unique<MockupFDMultiplexer>();
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, DNSName("powerdns.com."), QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+
+ uint16_t querySize = static_cast<uint16_t>(query.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+ query.insert(query.begin(), sizeBytes, sizeBytes + 2);
+
+ {
+ TEST_INIT("=> reading PP");
+
+ g_proxyProtocolACL.addMask("0.0.0.0/0");
+ g_proxyProtocolACL.addMask("::0/0");
+
+ auto proxyPayload = makeProxyHeader(true, ComboAddress("192.0.2.1"), ComboAddress("192.0.2.2"), {});
+ BOOST_REQUIRE_GT(proxyPayload.size(), s_proxyProtocolMinimumHeaderSize);
+ s_readBuffer = query;
+ // preprend the proxy protocol payload
+ s_readBuffer.insert(s_readBuffer.begin(), proxyPayload.begin(), proxyPayload.end());
+ // append a second query
+ s_readBuffer.insert(s_readBuffer.end(), query.begin(), query.end());
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, s_proxyProtocolMinimumHeaderSize },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, proxyPayload.size() - s_proxyProtocolMinimumHeaderSize },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 65537 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 65537 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ return ProcessQueryResult::SendAnswer;
+ };
+
+ /* mark the incoming FD as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(-1);
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(threadData.mplexer->run(&now), 0);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), query.size() * 2U);
+ }
+
+ {
+ TEST_INIT("=> Invalid PP");
+
+ g_proxyProtocolACL.addMask("0.0.0.0/0");
+ g_proxyProtocolACL.addMask("::0/0");
+ auto proxyPayload = std::vector<uint8_t>(s_proxyProtocolMinimumHeaderSize);
+ std::fill(proxyPayload.begin(), proxyPayload.end(), 0);
+
+ s_readBuffer = query;
+ // preprend the proxy protocol payload
+ s_readBuffer.insert(s_readBuffer.begin(), proxyPayload.begin(), proxyPayload.end());
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, s_proxyProtocolMinimumHeaderSize },
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ return ProcessQueryResult::SendAnswer;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ }
+
+ {
+ TEST_INIT("=> timeout while reading PP");
+
+ g_proxyProtocolACL.addMask("0.0.0.0/0");
+ g_proxyProtocolACL.addMask("::0/0");
+ auto proxyPayload = makeProxyHeader(true, ComboAddress("192.0.2.1"), ComboAddress("192.0.2.2"), {});
+ BOOST_REQUIRE_GT(proxyPayload.size(), s_proxyProtocolMinimumHeaderSize);
+ s_readBuffer = query;
+ // preprend the proxy protocol payload
+ s_readBuffer.insert(s_readBuffer.begin(), proxyPayload.begin(), proxyPayload.end());
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, s_proxyProtocolMinimumHeaderSize },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, proxyPayload.size() - s_proxyProtocolMinimumHeaderSize - 1},
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ return ProcessQueryResult::SendAnswer;
+ };
+
+ /* mark the incoming FD as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(-1);
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(threadData.mplexer->run(&now), 0);
+ struct timeval later = now;
+ later.tv_sec += g_tcpRecvTimeout + 1;
+ auto expiredReadConns = threadData.mplexer->getTimeouts(later, false);
+ for (const auto& cbData : expiredReadConns) {
+ BOOST_CHECK_EQUAL(cbData.first, state->d_handler.getDescriptor());
+ if (cbData.second.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(cbData.second);
+ BOOST_CHECK_EQUAL(cbData.first, cbState->d_handler.getDescriptor());
+ cbState->handleTimeout(cbState, false);
+ }
+ }
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_IncomingConnection_BackendNoOOOR)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ TCPClientThreadData threadData;
+ threadData.mplexer = std::make_unique<MockupFDMultiplexer>();
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ PacketBuffer query;
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, DNSName("powerdns.com."), QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = 0;
+
+ auto shortQuery = query;
+ shortQuery.resize(sizeof(dnsheader) - 1);
+ uint16_t shortQuerySize = static_cast<uint16_t>(shortQuery.size());
+ const uint8_t shortSizeBytes[] = { static_cast<uint8_t>(shortQuerySize / 256), static_cast<uint8_t>(shortQuerySize % 256) };
+ shortQuery.insert(shortQuery.begin(), shortSizeBytes, shortSizeBytes + 2);
+
+ uint16_t querySize = static_cast<uint16_t>(query.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+ query.insert(query.begin(), sizeBytes, sizeBytes + 2);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+
+ {
+ /* pass to backend, backend answers right away, client closes the connection */
+ TEST_INIT("=> Query to backend, backend answers right away");
+ s_readBuffer = query;
+
+ s_backendReadBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), query.size());
+ BOOST_CHECK(s_writeBuffer == query);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size());
+ BOOST_CHECK(s_backendWriteBuffer == query);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* pass to backend, backend answers right away, exception while handling the response */
+ TEST_INIT("=> Exception while handling the response sent by the backend");
+ s_readBuffer = query;
+
+ s_backendReadBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ throw std::runtime_error("Unexpected error while processing the response");
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size());
+ BOOST_CHECK(s_backendWriteBuffer == query);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* pass to backend, backend answers right away, processResponse() fails */
+ TEST_INIT("=> Response processing fails ");
+ s_readBuffer = query;
+
+ s_backendReadBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return false;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size());
+ BOOST_CHECK(s_backendWriteBuffer == query);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* pass to backend, backend answers right away, ID matching fails */
+ TEST_INIT("=> ID matching fails ");
+ s_readBuffer = query;
+
+ auto responsePacket = query;
+ /* mess with the transaction ID */
+ responsePacket.at(3) ^= 42;
+
+ s_backendReadBuffer = responsePacket;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size());
+ BOOST_CHECK(s_backendWriteBuffer == query);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> Short (too short) query");
+ s_readBuffer = shortQuery;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+ s_processQuery = [](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ return ProcessQueryResult::SendAnswer;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> Short (too short) response from backend");
+ s_readBuffer = query;
+
+ s_backendReadBuffer = shortQuery;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing backend connection */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size());
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* connect in progress, short write to the backend, short read from the backend, client */
+ TEST_INIT("=> Short read and write to backend");
+ s_readBuffer = query;
+ // append a second query
+ appendPayloadEditingID(s_readBuffer, query, 1);
+
+ s_backendReadBuffer = query;
+ // append a second query
+ appendPayloadEditingID(s_backendReadBuffer, query, 1);
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* connect to backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::NeedWrite, 0, [&threadData](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ }
+ },
+ /* send query */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 1 },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() - 1 },
+ /* read response */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 1 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 1 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, query.size() - 3 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 1 },
+ /* write response to client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, query.size() - 1 },
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 1 },
+ /* read second query */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* write second query to backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ /* read second response */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ /* write second response */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() },
+ /* read from client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* close connection to client */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* close connection to the backend, eventually */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ /* set the incoming descriptor as ready! */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0) {
+ threadData.mplexer->run(&now);
+ }
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), query.size() * 2U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size() * 2U);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* connection refused by the backend */
+ TEST_INIT("=> Connection refused by the backend ");
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend (5 tries by default) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+ throw NetworkError("Connection refused by the backend");
+ }
+ },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+ throw NetworkError("Connection refused by the backend");
+ }
+ },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+ throw NetworkError("Connection refused by the backend");
+ }
+ },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+ throw NetworkError("Connection refused by the backend");
+ }
+ },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+ throw NetworkError("Connection refused by the backend");
+ }
+ },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* timeout from the backend (write) */
+ TEST_INIT("=> Timeout from the backend (write) ");
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend (retrying 5 times) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ struct timeval later = now;
+ later.tv_sec += backend->tcpSendTimeout + 1;
+ auto expiredWriteConns = threadData.mplexer->getTimeouts(later, true);
+ BOOST_CHECK_EQUAL(expiredWriteConns.size(), 1U);
+ for (const auto& cbData : expiredWriteConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<TCPConnectionToBackend>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<TCPConnectionToBackend>>(cbData.second);
+ cbState->handleTimeout(later, true);
+ }
+ }
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* timeout from the backend (read) */
+ TEST_INIT("=> Timeout from the backend (read) ");
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ struct timeval later = now;
+ later.tv_sec += backend->tcpRecvTimeout + 1;
+ auto expiredConns = threadData.mplexer->getTimeouts(later, false);
+ BOOST_CHECK_EQUAL(expiredConns.size(), 1U);
+ for (const auto& cbData : expiredConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<TCPConnectionToBackend>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<TCPConnectionToBackend>>(cbData.second);
+ cbState->handleTimeout(later, false);
+ }
+ }
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size());
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* connection closed from the backend (write) */
+ TEST_INIT("=> Connection closed from the backend (write) ");
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend, connection closed on first write (5 attempts) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* connection closed from the backend (write) 4 times then succeeds */
+ TEST_INIT("=> Connection closed from the backend (write) 4 times then succeeds");
+ s_readBuffer = query;
+ s_backendReadBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend, connection closed on first write (5 attempts) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ /* reading the response */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ /* send the response to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() },
+ /* client closes the connection */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* then eventually the backend one */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), query.size());
+ BOOST_CHECK(s_writeBuffer == query);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size());
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> connection closed by the backend on write, then refused");
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend, connection closed on first write */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* and now reconnection fails (1) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+ throw NetworkError("Connection refused by the backend");
+ }
+ },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* 2 */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+ throw NetworkError("Connection refused by the backend");
+ }
+ },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* 3 */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+ throw NetworkError("Connection refused by the backend");
+ }
+ },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* 4 */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int descriptor) {
+ throw NetworkError("Connection refused by the backend");
+ }
+ },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* connection closed from the backend (read) */
+ TEST_INIT("=> Connection closed from the backend (read) ");
+ s_readBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend, connection closed on read, 5 attempts, last one succeeds */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size() * backend->d_retries);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ /* connection closed from the backend (read) 4 times then succeeds */
+ TEST_INIT("=> Connection closed from the backend (read) 4 times then succeeds ");
+ s_readBuffer = query;
+ s_backendReadBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend, connection closed on read, 5 attempts, last one succeeds */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* this time it works */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ /* sending the response to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() },
+ /* client closes the connection */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* the eventually the backend one */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), query.size());
+ BOOST_CHECK(s_writeBuffer == query);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size() * backend->d_retries);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> Connection closed by the client when trying to send the response received from the backend");
+ s_readBuffer = query;
+ s_backendReadBuffer = query;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ /* sending the response to the client, the connection has been closed */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* and eventually the backend one */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), query.size());
+ BOOST_CHECK(s_backendWriteBuffer == query);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+#if 1
+ /* 101 queries on the same connection, check that the maximum number of queries kicks in */
+ TEST_INIT("=> 101 queries on the same connection");
+
+ g_maxTCPQueriesPerConn = 100;
+
+ size_t count = 101;
+
+ s_readBuffer = query;
+
+ for (size_t idx = 0; idx < count; idx++) {
+ appendPayloadEditingID(s_readBuffer, query, idx);
+ appendPayloadEditingID(s_backendReadBuffer, query, idx);
+ }
+
+ s_steps = { { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() + 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 },
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() + 2 }
+ };
+
+ for (size_t idx = 0; idx < count - 1; idx++) {
+ /* read a new query */
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 });
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, query.size() - 2 });
+ /* pass it to the backend */
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, query.size() + 2 });
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 });
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, query.size() - 2 });
+ /* send the response */
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, query.size() + 2 });
+ };
+ /* close the connection with the client */
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::closeClient, IOState::Done });
+ /* eventually with the backend as well */
+ s_steps.push_back({ ExpectedStep::ExpectedRequest::closeBackend, IOState::Done });
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), query.size() * count);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+
+ g_maxTCPQueriesPerConn = 0;
+#endif
+ }
+
+}
+
+BOOST_AUTO_TEST_CASE(test_IncomingConnectionOOOR_BackendOOOR)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ /* enable out-of-order on the front side */
+ localCS.d_maxInFlightQueriesPerConn = 65536;
+
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ ConnectionInfo connInfo(&localCS);
+ connInfo.remote = getBackendAddress("84", 4242);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ /* enable out-of-order on the backend side as well */
+ backend->d_maxInFlightQueriesPerConn = 65536;
+ /* shorter than the client one */
+ backend->tcpRecvTimeout = 1;
+
+ TCPClientThreadData threadData;
+ threadData.mplexer = std::make_unique<MockupFDMultiplexer>();
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ std::vector<PacketBuffer> queries(5);
+ std::vector<PacketBuffer> responses(5);
+
+ size_t counter = 0;
+ size_t totalQueriesSize = 0;
+ for (auto& query : queries) {
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, DNSName("powerdns" + std::to_string(counter) + ".com."), QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = htons(counter);
+ uint16_t querySize = static_cast<uint16_t>(query.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+ query.insert(query.begin(), sizeBytes, sizeBytes + 2);
+ totalQueriesSize += query.size();
+ ++counter;
+ }
+
+ counter = 0;
+ size_t totalResponsesSize = 0;
+ for (auto& response : responses) {
+ DNSName name("powerdns" + std::to_string(counter) + ".com.");
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = htons(counter);
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(response.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ response.insert(response.begin(), sizeBytes, sizeBytes + 2);
+ totalResponsesSize += response.size();
+ ++counter;
+ }
+
+ {
+ TEST_INIT("=> 5 OOOR queries to the backend, backend responds in reverse order");
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ uint16_t backendCounter = 0;
+ for (const auto& query : queries) {
+ s_readBuffer.insert(s_readBuffer.end(), query.begin(), query.end());
+ appendPayloadEditingID(expectedBackendWriteBuffer, query, backendCounter++);
+ }
+
+ backendCounter = 0;
+ for (const auto& response : responses) {
+ /* reverse order */
+ prependPayloadEditingID(s_backendReadBuffer, response, backendCounter++);
+ expectedWriteBuffer.insert(expectedWriteBuffer.begin(), response.begin(), response.end());
+ }
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (2) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (3) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (4) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (5) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2 },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+ /* no response ready yet, but the backend becomes ready */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+
+ /* no more queries from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+
+ /* reading a response from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size() },
+
+ /* reading a response from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size() },
+
+ /* reading a response from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size() },
+
+ /* reading a response from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size() },
+
+ /* reading a response from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() },
+ /* sending it to the client, the client descriptor becomes ready */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+ /* set the incoming descriptor (client connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+
+ /* client is closing the connection */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), totalResponsesSize);
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), totalQueriesSize);
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> 3 queries sent to the backend, 1 self-answered, 1 new query sent to the backend which responds to the first query right away, then to the last one, then the connection to the backend times out");
+
+ // increase the client timeout for that test, we want the backend to timeout first
+ g_tcpRecvTimeout = 5;
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ for (const auto& query : queries) {
+ s_readBuffer.insert(s_readBuffer.end(), query.begin(), query.end());
+ }
+
+ uint16_t backendCounter = 0;
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(0), backendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(1), backendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(2), backendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(4), backendCounter++);
+
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(0), 0);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(4), 3);
+
+ /* self-answered */
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(3).begin(), responses.at(3).end());
+ /* from backend */
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(0).begin(), responses.at(0).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(4).begin(), responses.at(4).end());
+
+ bool timeout = false;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (2) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (3) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (4) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+ /* sending the response right away (self-answered) */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size() },
+ /* reading a query from the client (5) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2 },
+ /* sending query to the backend (5) */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+ /* reading a response from the backend (1) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+ /* set the backend descriptor as ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* sending it to the client (1) */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+ /* set the client descriptor as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* reading from the client (not ready) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+ /* reading a response from the backend (5) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() },
+ /* sending it to the client (5) */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size() },
+
+ /* try to read from the backend but there is no answer ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData, &timeout](int desc) {
+ /* set the backend descriptor as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ timeout = true;
+ } },
+
+ /* A timeout occurs */
+
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend,&responses](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ static size_t count = 0;
+ if (count++ == 3) {
+ /* self answered */
+ dq.getMutableData() = responses.at(3);
+ /* remove the length */
+ dq.getMutableData().erase(dq.getMutableData().begin(), dq.getMutableData().begin() + 2);
+
+ return ProcessQueryResult::SendAnswer;
+ }
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += backend->tcpRecvTimeout + 1;
+ auto expiredConns = threadData.mplexer->getTimeouts(later, false);
+ BOOST_CHECK_EQUAL(expiredConns.size(), 1U);
+ for (const auto& cbData : expiredConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<TCPConnectionToBackend>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<TCPConnectionToBackend>>(cbData.second);
+ cbState->handleTimeout(later, false);
+ }
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+
+ // restore the client timeout
+ g_tcpRecvTimeout = 2;
+ }
+
+ {
+ TEST_INIT("=> 1 query sent to the backend, short read from the backend, 1 new query arrives in the meantime, the first answer is sent to the client, then the second query is handled, a new one arrives but the connection to the backend dies on us, short write on a new connection, the last query arrives and both are answered");
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ for (const auto& query : queries) {
+ s_readBuffer.insert(s_readBuffer.end(), query.begin(), query.end());
+ }
+ for (const auto& response : responses) {
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), response.begin(), response.end());
+ }
+
+ uint16_t backendCounter = 0;
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(0), backendCounter);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(0), backendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(1), backendCounter);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(1), backendCounter++);
+
+ // new connection
+ backendCounter = 0;
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(2), backendCounter);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(2), backendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(3), backendCounter);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(3), backendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(4), backendCounter);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(4), backendCounter++);
+
+ bool timeout = false;
+ int backendDesc;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* read response size and the beginning of the response (1) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 1, [&threadData](int desc) {
+ /* set the backend descriptor as ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* reading a query from the client (2) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* trying to read an additional query, if any */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* set the client descriptor as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* reading the remaining bytes of response (1) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 3 },
+ /* sending response (1) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size() },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* the response (2) is already there */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+ /* sending response (2) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size(), [&threadData](int desc) {
+ /* set the client descriptor as ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* reading a query from the client (3) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query (3) to the backend, short write */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 1, [&threadData,&backendDesc](int desc) {
+ /* set the backend descriptor as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ backendDesc = desc;
+ /* but client is ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+ } },
+ /* reading a query from the client (4) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+ /* reading a query from the client (5) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2, [&threadData,&backendDesc](int desc) {
+ /* set the backend descriptor as ready now */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDesc);
+ } },
+ /* nothing else to read from the client for now */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* set the client descriptor as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* finishing sending the query (3) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() - 1 },
+ /* sending the query (4) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size() },
+ /* sending the query (5) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+ /* reading a response from the backend (3) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
+ /* sending it to the client (3) */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size() },
+ /* reading a response from the backend (4) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
+ /* sending it to the client (4) but short write */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, responses.at(3).size() - 1, [&threadData](int desc) {
+ /* set the client descriptor as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* reading a response from the backend (5) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2, [&threadData](int desc) {
+ /* set the client descriptor as ready to resume sending */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+ } },
+ /* resume sending it to the client (4) */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, 1 },
+ /* sending it to the client (5) */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size() },
+
+ /* nothing to read from the client, then timeout later */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData,&timeout](int desc) {
+ /* set the client descriptor as NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ timeout = true;
+ } },
+
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += g_tcpRecvTimeout + 1;
+ auto expiredConns = threadData.mplexer->getTimeouts(later, false);
+ BOOST_CHECK_EQUAL(expiredConns.size(), 1U);
+ for (const auto& cbData : expiredConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(cbData.second);
+ cbState->handleTimeout(cbState, false);
+ }
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> 1 query to the backend, second query from the client is dropped, backend times out");
+ // useful to tests that we check that the client connection is alive in notifyAllQueriesFailed()
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(1).begin(), queries.at(1).end());
+
+ // only the first query is passed to the backend
+ expectedBackendWriteBuffer.insert(expectedBackendWriteBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+
+ bool timeout = false;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a second query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* query is dropped, closing the connection to the client */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0, [&timeout](int desc) {
+ timeout = true;
+ } },
+ /* closing a connection to the backend after a timeout */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ counter = 0;
+ s_processQuery = [backend,&counter](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ if (counter == 0) {
+ ++counter;
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ }
+ return ProcessQueryResult::Drop;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += backend->tcpRecvTimeout + 1;
+ auto expiredConns = threadData.mplexer->getTimeouts(later, false);
+ BOOST_CHECK_EQUAL(expiredConns.size(), 1U);
+ for (const auto& cbData : expiredConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<TCPConnectionToBackend>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<TCPConnectionToBackend>>(cbData.second);
+ cbState->handleTimeout(later, false);
+ }
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> 1 query to the backend, second query from the client is dropped, backend sends the answer");
+ // useful to tests that we check that the client connection is alive in handleResponse()
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(1).begin(), queries.at(1).end());
+
+ // only the first query is passed to the backend
+ expectedBackendWriteBuffer.insert(expectedBackendWriteBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+
+ s_backendReadBuffer.insert(s_backendReadBuffer.end(), responses.at(0).begin(), responses.at(0).end());
+
+ int backendDescriptor = -1;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptor](int desc) {
+ backendDescriptor = desc;
+ } },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a second query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* query is dropped, closing the connection to the client */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0, [&threadData,&backendDescriptor](int desc) {
+ /* the backend descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptor);
+ } },
+ /* reading the response to the first query from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ counter = 0;
+ s_processQuery = [backend,&counter](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ if (counter == 0) {
+ ++counter;
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ }
+ return ProcessQueryResult::Drop;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while ((threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> 2 queries to the backend, client times out, responses arrive and are delivered, we start reading from the client again");
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(1).begin(), queries.at(1).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(4).begin(), queries.at(4).end());
+
+ uint16_t backendCounter = 0;
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(0), backendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(1), backendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(4), backendCounter++);
+
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(1), 1);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(0), 0);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(4), 2);
+
+ appendPayloadEditingID(expectedWriteBuffer, responses.at(1), 1);
+ appendPayloadEditingID(expectedWriteBuffer, responses.at(0), 0);
+ appendPayloadEditingID(expectedWriteBuffer, responses.at(4), 4);
+
+ /* make sure that the backend's timeout is longer than the client's */
+ backend->tcpRecvTimeout = 30;
+
+ bool timeout = false;
+ int backendDescriptor = -1;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query (1) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a second query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&timeout,&backendDescriptor](int desc) {
+ backendDescriptor = desc;
+ timeout = true;
+ } },
+ /* nothing from the client either */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+ /* the client times out, and we will set the backend descriptor to ready at that point */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+ /* sending response (2) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size() },
+ /* reading the response (1) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+ /* sending response (1) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+ /* setting the client descriptor ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* try to read from the client again, get query (3) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2 },
+ /* sending query (3) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* setting the backend descriptor NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* try to read from the client again, nothing yet */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData,&backendDescriptor](int desc) {
+ /* the client descriptor becomes NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ /* the backend one is ready, though */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backendDescriptor);
+ } },
+ /* reading the response (3) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
+ /* sending response (3) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size(), [&timeout](int desc) {
+ timeout = true;
+ } },
+ /* client times out again, this time we close the connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += g_tcpRecvTimeout + 1;
+ auto expiredConns = threadData.mplexer->getTimeouts(later, false);
+ BOOST_CHECK_EQUAL(expiredConns.size(), 1U);
+ for (const auto& cbData : expiredConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(cbData.second);
+ cbState->handleTimeout(cbState, false);
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptor);
+ }
+ }
+ timeout = false;
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ later = now;
+ later.tv_sec += g_tcpRecvTimeout + 1;
+ expiredConns = threadData.mplexer->getTimeouts(later, false);
+ BOOST_CHECK_EQUAL(expiredConns.size(), 1U);
+ for (const auto& cbData : expiredConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(cbData.second);
+ cbState->handleTimeout(cbState, false);
+ }
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> 3 queries to the backend, the first 2 responses arrive and are queued (client write blocks), and the backend closes the connection before sending the last one");
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(1).begin(), queries.at(1).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(2).begin(), queries.at(2).end());
+
+ expectedBackendWriteBuffer.insert(expectedBackendWriteBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+ expectedBackendWriteBuffer.insert(expectedBackendWriteBuffer.end(), queries.at(1).begin(), queries.at(1).end());
+ expectedBackendWriteBuffer.insert(expectedBackendWriteBuffer.end(), queries.at(2).begin(), queries.at(2).end());
+
+ s_backendReadBuffer.insert(s_backendReadBuffer.end(), responses.at(1).begin(), responses.at(1).end());
+ s_backendReadBuffer.insert(s_backendReadBuffer.end(), responses.at(0).begin(), responses.at(0).end());
+
+ expectedWriteBuffer = s_backendReadBuffer;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query (1) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a second query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a third query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+ /* sending query (3) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+ /* no response ready yet but the backend descriptor becomes ready */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* the backend descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* nothing from the client either */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* the client descriptor is NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* read the response (2) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+ /* trying to send response (2) to the client but blocking */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::NeedWrite, 0 },
+ /* reading the response (1) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+ /* trying to read from the backend again, connection closes on us */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ /* so we close the connection */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* try opening a new connection to the backend, it fails (5) times */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [](int desc) {
+ throw NetworkError("Connection refused by the backend");
+ } },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* try opening a new connection to the backend, it fails (5) times */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done,0, [](int desc) {
+ throw NetworkError("Connection refused by the backend");
+ } },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* try opening a new connection to the backend, it fails (5) times */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done,0, [](int desc) {
+ throw NetworkError("Connection refused by the backend");
+ } },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* try opening a new connection to the backend, it fails (5) times */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done,0, [](int desc) {
+ throw NetworkError("Connection refused by the backend");
+ } },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* try opening a new connection to the backend, it fails (5) times */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done,0, [](int desc) {
+ throw NetworkError("Connection refused by the backend");
+ } },
+ /* closing a connection to the backend, client becomes ready */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0, [&threadData](int desc) {
+ /* the client descriptor is ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+ } },
+ /* sending response (2) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size() },
+ /* sending response (1) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size() },
+ /* closing the client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> AXFR");
+
+ PacketBuffer axfrQuery;
+ PacketBuffer secondQuery;
+ std::vector<PacketBuffer> axfrResponses(3);
+ PacketBuffer secondResponse;
+
+ GenericDNSPacketWriter<PacketBuffer> pwAXFRQuery(axfrQuery, DNSName("powerdns.com."), QType::AXFR, QClass::IN, 0);
+ pwAXFRQuery.getHeader()->rd = 0;
+ pwAXFRQuery.getHeader()->id = 42;
+ uint16_t axfrQuerySize = static_cast<uint16_t>(axfrQuery.size());
+ const uint8_t axfrQuerySizeBytes[] = { static_cast<uint8_t>(axfrQuerySize / 256), static_cast<uint8_t>(axfrQuerySize % 256) };
+ axfrQuery.insert(axfrQuery.begin(), axfrQuerySizeBytes, axfrQuerySizeBytes + 2);
+
+ const DNSName name("powerdns.com.");
+ {
+ /* first message */
+ auto& response = axfrResponses.at(0);
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = 42;
+
+ /* insert SOA */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(1 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+
+ /* A record */
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(response.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ response.insert(response.begin(), sizeBytes, sizeBytes + 2);
+ }
+ {
+ /* second message */
+ auto& response = axfrResponses.at(1);
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = 42;
+
+ /* A record */
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(response.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ response.insert(response.begin(), sizeBytes, sizeBytes + 2);
+ }
+ {
+ /* third message */
+ auto& response = axfrResponses.at(2);
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = 42;
+
+ /* A record */
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ /* final SOA */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(1 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(response.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ response.insert(response.begin(), sizeBytes, sizeBytes + 2);
+ }
+
+ {
+ GenericDNSPacketWriter<PacketBuffer> pwSecondQuery(secondQuery, DNSName("powerdns.com."), QType::A, QClass::IN, 0);
+ pwSecondQuery.getHeader()->rd = 1;
+ pwSecondQuery.getHeader()->id = 84;
+ uint16_t secondQuerySize = static_cast<uint16_t>(secondQuery.size());
+ const uint8_t secondQuerySizeBytes[] = { static_cast<uint8_t>(secondQuerySize / 256), static_cast<uint8_t>(secondQuerySize % 256) };
+ secondQuery.insert(secondQuery.begin(), secondQuerySizeBytes, secondQuerySizeBytes + 2);
+ }
+
+ {
+ GenericDNSPacketWriter<PacketBuffer> pwSecondResponse(secondResponse, DNSName("powerdns.com."), QType::A, QClass::IN, 0);
+ pwSecondResponse.getHeader()->qr = 1;
+ pwSecondResponse.getHeader()->rd = 1;
+ pwSecondResponse.getHeader()->ra = 1;
+ pwSecondResponse.getHeader()->id = 84;
+ pwSecondResponse.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwSecondResponse.xfr32BitInt(0x01020304);
+ pwSecondResponse.commit();
+ uint16_t responseSize = static_cast<uint16_t>(secondResponse.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ secondResponse.insert(secondResponse.begin(), sizeBytes, sizeBytes + 2);
+ }
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ s_readBuffer = axfrQuery;
+ s_readBuffer.insert(s_readBuffer.end(), secondQuery.begin(), secondQuery.end());
+
+ uint16_t backendCounter = 0;
+ appendPayloadEditingID(expectedBackendWriteBuffer, axfrQuery, backendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, secondQuery, backendCounter++);
+
+ for (const auto& response : axfrResponses) {
+ appendPayloadEditingID(s_backendReadBuffer, response, 0);
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), response.begin(), response.end());
+ }
+ appendPayloadEditingID(s_backendReadBuffer, secondResponse, 1);
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), secondResponse.begin(), secondResponse.end());
+
+ bool timeout = false;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, axfrQuery.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query (1) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, axfrQuery.size() },
+ /* no response ready yet, but setting the backend descriptor readable */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* the backend descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* no more query from the client for now */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 , [&threadData](int desc) {
+ /* the client descriptor becomes NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(-1);
+ } },
+ /* read the response (1) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(0).size() - 2 },
+ /* sending response (1) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(0).size() },
+ /* reading the response (2) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(1).size() - 2 },
+ /* sending response (2) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(1).size() },
+ /* reading the response (3) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(2).size() - 2 },
+ /* sending response (3) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(2).size(), [&threadData](int desc) {
+ /* the client descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+ } },
+ /* trying to read from the client, getting a second query */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, secondQuery.size() - 2 },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, secondQuery.size() },
+ /* reading the response (4) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, secondResponse.size() - 2 },
+ /* sending response (4) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, secondResponse.size() },
+ /* trying to read from the client, getting EOF */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing the client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing the backend connection */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> Interrupted AXFR");
+
+ PacketBuffer axfrQuery;
+ PacketBuffer secondQuery;
+ std::vector<PacketBuffer> axfrResponses(3);
+ PacketBuffer secondResponse;
+
+ auto proxyPayload = makeProxyHeader(true, getBackendAddress("84", 4242), local, {});
+ BOOST_REQUIRE_GT(proxyPayload.size(), s_proxyProtocolMinimumHeaderSize);
+
+ auto proxyEnabledBackend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ proxyEnabledBackend->d_tlsCtx = tlsCtx;
+ proxyEnabledBackend->useProxyProtocol = true;
+
+ GenericDNSPacketWriter<PacketBuffer> pwAXFRQuery(axfrQuery, DNSName("powerdns.com."), QType::AXFR, QClass::IN, 0);
+ pwAXFRQuery.getHeader()->rd = 0;
+ pwAXFRQuery.getHeader()->id = 42;
+ uint16_t axfrQuerySize = static_cast<uint16_t>(axfrQuery.size());
+ const uint8_t axfrQuerySizeBytes[] = { static_cast<uint8_t>(axfrQuerySize / 256), static_cast<uint8_t>(axfrQuerySize % 256) };
+ axfrQuery.insert(axfrQuery.begin(), axfrQuerySizeBytes, axfrQuerySizeBytes + 2);
+
+ const DNSName name("powerdns.com.");
+ {
+ /* first message */
+ auto& response = axfrResponses.at(0);
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = 42;
+
+ /* insert SOA */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(1 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+
+ /* A record */
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(response.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ response.insert(response.begin(), sizeBytes, sizeBytes + 2);
+ }
+ {
+ /* second message */
+ auto& response = axfrResponses.at(1);
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = 42;
+
+ /* A record */
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(response.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ response.insert(response.begin(), sizeBytes, sizeBytes + 2);
+ }
+ {
+ /* third message */
+ auto& response = axfrResponses.at(2);
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = 42;
+
+ /* A record */
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ /* final SOA */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(1 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(response.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ response.insert(response.begin(), sizeBytes, sizeBytes + 2);
+ }
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ s_readBuffer = axfrQuery;
+
+ uint16_t backendCounter = 0;
+ expectedBackendWriteBuffer.insert(expectedBackendWriteBuffer.end(), proxyPayload.begin(), proxyPayload.end());
+ appendPayloadEditingID(expectedBackendWriteBuffer, axfrQuery, backendCounter++);
+
+ for (const auto& response : axfrResponses) {
+ appendPayloadEditingID(s_backendReadBuffer, response, 0);
+ }
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), axfrResponses.at(0).begin(), axfrResponses.at(0).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), axfrResponses.at(1).begin(), axfrResponses.at(1).end());
+
+ bool timeout = false;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, axfrQuery.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query (1) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + axfrQuery.size() },
+ /* no response ready yet, but setting the backend descriptor readable */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* the backend descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* no more query from the client for now */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 , [&threadData](int desc) {
+ /* the client descriptor becomes NOT ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(-1);
+ } },
+ /* read the response (1) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(0).size() - 2 },
+ /* sending response (1) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(0).size() },
+ /* reading the response (2) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, axfrResponses.at(1).size() - 2 },
+ /* sending response (2) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, axfrResponses.at(1).size() },
+ /* reading the response (3) from the backend, get EOF!! */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ /* closing the backend connection */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* closing the client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing the backend connection */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [proxyEnabledBackend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = proxyEnabledBackend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> IXFR");
+
+ PacketBuffer firstQuery;
+ PacketBuffer ixfrQuery;
+ PacketBuffer secondQuery;
+ PacketBuffer firstResponse;
+ std::vector<PacketBuffer> ixfrResponses(1);
+ PacketBuffer secondResponse;
+
+ {
+ GenericDNSPacketWriter<PacketBuffer> pwFirstQuery(firstQuery, DNSName("powerdns.com."), QType::SOA, QClass::IN, 0);
+ pwFirstQuery.getHeader()->rd = 1;
+ pwFirstQuery.getHeader()->id = 84;
+ uint16_t firstQuerySize = static_cast<uint16_t>(firstQuery.size());
+ const uint8_t firstQuerySizeBytes[] = { static_cast<uint8_t>(firstQuerySize / 256), static_cast<uint8_t>(firstQuerySize % 256) };
+ firstQuery.insert(firstQuery.begin(), firstQuerySizeBytes, firstQuerySizeBytes + 2);
+ }
+
+ {
+ GenericDNSPacketWriter<PacketBuffer> pwFirstResponse(firstResponse, DNSName("powerdns.com."), QType::SOA, QClass::IN, 0);
+ pwFirstResponse.getHeader()->qr = 1;
+ pwFirstResponse.getHeader()->rd = 1;
+ pwFirstResponse.getHeader()->ra = 1;
+ pwFirstResponse.getHeader()->id = 84;
+ pwFirstResponse.startRecord(DNSName("powerdns.com."), QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwFirstResponse.xfrName(g_rootdnsname, true);
+ pwFirstResponse.xfrName(g_rootdnsname, true);
+ pwFirstResponse.xfr32BitInt(3 /* serial */);
+ pwFirstResponse.xfr32BitInt(0);
+ pwFirstResponse.xfr32BitInt(0);
+ pwFirstResponse.xfr32BitInt(0);
+ pwFirstResponse.xfr32BitInt(0);
+ pwFirstResponse.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(firstResponse.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ firstResponse.insert(firstResponse.begin(), sizeBytes, sizeBytes + 2);
+ }
+
+ {
+ GenericDNSPacketWriter<PacketBuffer> pwIXFRQuery(ixfrQuery, DNSName("powerdns.com."), QType::IXFR, QClass::IN, 0);
+ pwIXFRQuery.getHeader()->rd = 0;
+ pwIXFRQuery.getHeader()->id = 42;
+ uint16_t ixfrQuerySize = static_cast<uint16_t>(ixfrQuery.size());
+ const uint8_t ixfrQuerySizeBytes[] = { static_cast<uint8_t>(ixfrQuerySize / 256), static_cast<uint8_t>(ixfrQuerySize % 256) };
+ ixfrQuery.insert(ixfrQuery.begin(), ixfrQuerySizeBytes, ixfrQuerySizeBytes + 2);
+ }
+
+ const DNSName name("powerdns.com.");
+ {
+ /* first message */
+ auto& response = ixfrResponses.at(0);
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->id = 42;
+
+ /* insert final SOA */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(3 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+
+ /* insert first SOA */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(1 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+
+ /* removals */
+ /* A record */
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ /* additions */
+ /* insert second SOA */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(2 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+ /* A record */
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020305);
+ pwR.commit();
+ /* done with 1 -> 2 */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(2 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+
+ /* no removal */
+
+ /* additions */
+ /* insert second SOA */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(3 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+
+ /* actually no addition either */
+ /* done */
+ pwR.startRecord(name, QType::SOA, 3600, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfrName(g_rootdnsname, true);
+ pwR.xfr32BitInt(3 /* serial */);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.xfr32BitInt(0);
+ pwR.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(response.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ response.insert(response.begin(), sizeBytes, sizeBytes + 2);
+ }
+
+ {
+ GenericDNSPacketWriter<PacketBuffer> pwSecondQuery(secondQuery, DNSName("powerdns.com."), QType::A, QClass::IN, 0);
+ pwSecondQuery.getHeader()->rd = 1;
+ pwSecondQuery.getHeader()->id = 84;
+ uint16_t secondQuerySize = static_cast<uint16_t>(secondQuery.size());
+ const uint8_t secondQuerySizeBytes[] = { static_cast<uint8_t>(secondQuerySize / 256), static_cast<uint8_t>(secondQuerySize % 256) };
+ secondQuery.insert(secondQuery.begin(), secondQuerySizeBytes, secondQuerySizeBytes + 2);
+ }
+
+ {
+ GenericDNSPacketWriter<PacketBuffer> pwSecondResponse(secondResponse, DNSName("powerdns.com."), QType::A, QClass::IN, 0);
+ pwSecondResponse.getHeader()->qr = 1;
+ pwSecondResponse.getHeader()->rd = 1;
+ pwSecondResponse.getHeader()->ra = 1;
+ pwSecondResponse.getHeader()->id = 84;
+ pwSecondResponse.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwSecondResponse.xfr32BitInt(0x01020304);
+ pwSecondResponse.commit();
+ uint16_t responseSize = static_cast<uint16_t>(secondResponse.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ secondResponse.insert(secondResponse.begin(), sizeBytes, sizeBytes + 2);
+ }
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ s_readBuffer = firstQuery;
+ s_readBuffer.insert(s_readBuffer.end(), ixfrQuery.begin(), ixfrQuery.end());
+ s_readBuffer.insert(s_readBuffer.end(), secondQuery.begin(), secondQuery.end());
+
+ appendPayloadEditingID(expectedBackendWriteBuffer, firstQuery, 0);
+ appendPayloadEditingID(expectedBackendWriteBuffer, ixfrQuery, 1);
+ appendPayloadEditingID(expectedBackendWriteBuffer, secondQuery, 2);
+
+ appendPayloadEditingID(s_backendReadBuffer, firstResponse, 0);
+ expectedWriteBuffer.insert(expectedWriteBuffer.begin(), firstResponse.begin(), firstResponse.end());
+ for (const auto& response : ixfrResponses) {
+ appendPayloadEditingID(s_backendReadBuffer, response, 1);
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), response.begin(), response.end());
+ }
+ appendPayloadEditingID(s_backendReadBuffer, secondResponse, 2);
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), secondResponse.begin(), secondResponse.end());
+
+ bool timeout = false;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, firstQuery.size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query (1) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, firstQuery.size() },
+ /* no response ready yet, but setting the backend descriptor readable */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* the backend descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* try to read a second query from the client, none yet */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+ /* read the response (1) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, firstResponse.size() - 2 },
+ /* sending response (1) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, firstResponse.size(), [&threadData](int desc) {
+ /* client descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+ } },
+ /* reading a query from the client (2) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, ixfrQuery.size() - 2 },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, ixfrQuery.size() },
+ /* read the response (ixfr 1) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, ixfrResponses.at(0).size() - 2 },
+ /* sending response (ixfr 1) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, ixfrResponses.at(0).size(), [&threadData](int desc) {
+ /* the client descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+ } },
+ /* trying to read from the client, getting a second query */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, secondQuery.size() - 2 },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, secondQuery.size() },
+ /* reading the response (4) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, secondResponse.size() - 2 },
+ /* sending response (4) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, secondResponse.size() },
+ /* trying to read from the client, getting EOF */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing the client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing the backend connection */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+
+ {
+ TEST_INIT("=> Outgoing proxy protocol, 3 queries to the backend, first response is sent, connection closed while reading the second one");
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ auto proxyPayload = makeProxyHeader(true, getBackendAddress("84", 4242), local, {});
+ BOOST_REQUIRE_GT(proxyPayload.size(), s_proxyProtocolMinimumHeaderSize);
+
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(1).begin(), queries.at(1).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(2).begin(), queries.at(2).end());
+
+ auto proxyEnabledBackend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ proxyEnabledBackend->d_tlsCtx = tlsCtx;
+ /* enable out-of-order on the backend side as well */
+ proxyEnabledBackend->d_maxInFlightQueriesPerConn = 65536;
+ proxyEnabledBackend->useProxyProtocol = true;
+
+ expectedBackendWriteBuffer.insert(expectedBackendWriteBuffer.end(), proxyPayload.begin(), proxyPayload.end());
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(0), 0);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(1), 1);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(2), 2);
+ expectedBackendWriteBuffer.insert(expectedBackendWriteBuffer.end(), proxyPayload.begin(), proxyPayload.end());
+ /* we are using an unordered_map, so all bets are off here :-/ */
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(2), 0);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(1), 1);
+
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(0), 0);
+ /* after the reconnection */
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(1), 1);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(2), 0);
+
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(0).begin(), responses.at(0).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(1).begin(), responses.at(1).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(2).begin(), responses.at(2).end());
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query (1) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + queries.at(0).size() },
+ /* got the response */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() },
+ /* sending the response (1) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size() },
+ /* reading a second query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* backend is not ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a third query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+ /* sending query (3) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+ /* backend is not ready yet, but the descriptor becomes ready */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* the backend descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ }},
+ /* nothing from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* backend closes the connection on us */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 0 },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ /* opening a new connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + queries.at(1).size() },
+ /* sending query (3) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+ /* got the response for 2 */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() },
+ /* sending the response (2) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size() },
+ /* got the response for 3 */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() },
+ /* sending the response (3) to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size(), [&threadData](int desc) {
+ /* the client descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* client closes the connection */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing the client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+ /* closing the backend connection */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0 },
+ };
+
+ s_processQuery = [proxyEnabledBackend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = proxyEnabledBackend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(proxyEnabledBackend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ /* we should have nothing to clear since the connection cannot be reused due to the Proxy Protocol payload */
+ BOOST_CHECK_EQUAL(IncomingTCPConnectionState::clearAllDownstreamConnections(), 0U);
+ }
+
+ {
+ TEST_INIT("=> Outgoing proxy protocol, 3 queries to the backend, the client closes while sending the first response");
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ auto proxyPayload = makeProxyHeader(true, getBackendAddress("84", 4242), local, {});
+ BOOST_REQUIRE_GT(proxyPayload.size(), s_proxyProtocolMinimumHeaderSize);
+
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(1).begin(), queries.at(1).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(2).begin(), queries.at(2).end());
+
+ auto proxyEnabledBackend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ proxyEnabledBackend->d_tlsCtx = tlsCtx;
+ /* enable out-of-order on the backend side as well */
+ proxyEnabledBackend->d_maxInFlightQueriesPerConn = 65536;
+ proxyEnabledBackend->useProxyProtocol = true;
+
+ expectedBackendWriteBuffer.insert(expectedBackendWriteBuffer.end(), proxyPayload.begin(), proxyPayload.end());
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(0), 0);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(1), 1);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(2), 2);
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query (1) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, proxyPayload.size() + queries.at(0).size() },
+ /* we try to read the response, not ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a second query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* backend is not ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a third query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+ /* sending query (3) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+ /* backend is not ready yet, but the descriptor becomes ready */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* the backend descriptor becomes ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ }},
+ /* client closes the connection */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing the backend connection */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0 },
+ /* closing the client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+ };
+
+ s_processQuery = [proxyEnabledBackend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = proxyEnabledBackend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(proxyEnabledBackend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ /* we should have nothing to clear since the connection cannot be reused due to the Proxy Protocol payload */
+ BOOST_CHECK_EQUAL(IncomingTCPConnectionState::clearAllDownstreamConnections(), 0U);
+ }
+
+ {
+ TEST_INIT("=> I/O error with the backend with queries not sent to the backend yet");
+
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(1).begin(), queries.at(1).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(2).begin(), queries.at(2).end());
+
+ /* make sure that the backend's timeout is shorter than the client's */
+ backend->tcpConnectTimeout = 1;
+ g_tcpRecvTimeout = 5;
+
+ bool timeout = false;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* backend is not ready yet */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::NeedWrite, 0 },
+ /* reading a second query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* reading a third query from the client */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2, [&timeout](int desc) {
+ timeout = true;
+ } },
+ /* trying to read more from the client but nothing to read */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+ /* closing the client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done, 0 },
+ /* closing the backend connection */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done, 0 },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += backend->tcpConnectTimeout + 1;
+ auto expiredConns = threadData.mplexer->getTimeouts(later, true);
+ BOOST_CHECK_EQUAL(expiredConns.size(), 1U);
+ for (const auto& cbData : expiredConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<TCPConnectionToBackend>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<TCPConnectionToBackend>>(cbData.second);
+ cbState->handleTimeout(later, true);
+ }
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), 0U);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* restore */
+ backend->tcpSendTimeout = 30;
+ g_tcpRecvTimeout = 2;
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ /* we have one connection to clear, no proxy protocol */
+ BOOST_CHECK_EQUAL(IncomingTCPConnectionState::clearAllDownstreamConnections(), 1U);
+ }
+
+ {
+ TEST_INIT("=> 5 OOOR queries, backend only accepts two at a time");
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ for (const auto& query : queries) {
+ s_readBuffer.insert(s_readBuffer.end(), query.begin(), query.end());
+ }
+
+ /* queries 0, 1 and 4 are sent to the first backend, 2 and 3 to the second */
+ uint16_t firstBackendCounter = 0;
+ uint16_t secondBackendCounter = 0;
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(0), firstBackendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(1), firstBackendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(2), secondBackendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(3), secondBackendCounter++);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(4), firstBackendCounter++);
+
+ firstBackendCounter = 0;
+ secondBackendCounter = 0;
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(0), firstBackendCounter++);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(1), firstBackendCounter++);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(2), secondBackendCounter++);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(4), firstBackendCounter++);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(3), secondBackendCounter++);
+
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(0).begin(), responses.at(0).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(1).begin(), responses.at(1).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(2).begin(), responses.at(2).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(4).begin(), responses.at(4).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(3).begin(), responses.at(3).end());
+
+ auto backend1 = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend1->d_tlsCtx = tlsCtx;
+ /* only two queries in flight! */
+ backend1->d_maxInFlightQueriesPerConn = 2;
+
+ int backend1Desc = -1;
+ int backend2Desc = -1;
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend (1) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backend1Desc](int desc) {
+ backend1Desc = desc;
+ } },
+ /* sending query (1) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (2) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (3) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+ /* opening a connection to the SECOND backend (2) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backend2Desc](int desc) {
+ backend2Desc = desc;
+ } },
+ /* sending query (3) to backend 2 */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (4) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+ /* sending query to the second backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* nothing more to read from the client at that moment */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0, [&threadData, &backend1Desc](int desc) {
+ /* but the first backend becomes readable */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backend1Desc);
+ } },
+ /* reading response (1) from the first backend (1) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+ /* client becomes readable */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* reading a query from the client (5) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2, [&threadData](int desc) {
+ /* client is not ready anymore */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* sending query (5) to the first backend (1) */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+ /* no response ready yet, but the first backend becomes ready */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ /* set the outgoing descriptor (backend connection) as ready */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* trying to read from client, nothing yet */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+ /* reading response (2) from the first backend (1) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size(), [&threadData,&backend1Desc,&backend2Desc](int desc) {
+ /* client is NOT readable, backend1 is not readable, backend 2 becomes readable */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend1Desc);
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backend2Desc);
+ } },
+ /* reading response (3) from the second backend (2) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size(), [&threadData,&backend1Desc,&backend2Desc](int desc) {
+ /* backend 2 is no longer readable, backend 1 becomes readable */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend2Desc);
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backend1Desc);
+ } },
+ /* reading response (5) from the first backend (1) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size(), [&threadData,&backend1Desc,&backend2Desc](int desc) {
+ /* backend 1 is no longer readable, backend 2 becomes readable */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend1Desc);
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backend2Desc);
+ } },
+ /* reading response (4) from the second backend (2) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size(), [&threadData,&backend2Desc](int desc) {
+ /* backend 2 is no longer readable */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(backend2Desc);
+ /* client becomes readable */
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+ } },
+ /* client closes the connection */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing a connection to the backends */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend1](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend1;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), totalResponsesSize);
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), totalQueriesSize);
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend1->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ BOOST_CHECK_EQUAL(IncomingTCPConnectionState::clearAllDownstreamConnections(), 2U);
+ }
+
+ {
+ TEST_INIT("=> 2 OOOR queries to the backend with duplicated IDs");
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+ s_readBuffer.insert(s_readBuffer.end(), queries.at(0).begin(), queries.at(0).end());
+
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(0), 0);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(0), 1);
+
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(0), 0);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(0), 1);
+
+ appendPayloadEditingID(expectedWriteBuffer, responses.at(0), 0);
+ appendPayloadEditingID(expectedWriteBuffer, responses.at(0), 0);
+
+ bool timeout = false;
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (2) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* sending query to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* no response ready yet, but mark the descriptor as ready */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(desc);
+ } },
+ /* nothing more from the client either */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 },
+
+ /* reading response (1) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size()},
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size()},
+ /* reading response (2) from the backend */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size(), [&threadData](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* sending it to the client. we don't have anything else to send to the client, no new query from it either, until we time out */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&timeout](int desc) {
+ timeout = true;
+ } },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing a connection to the backend */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (!timeout && (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0)) {
+ threadData.mplexer->run(&now);
+ }
+
+ struct timeval later = now;
+ later.tv_sec += g_tcpRecvTimeout + 1;
+ auto expiredConns = threadData.mplexer->getTimeouts(later);
+ BOOST_CHECK_EQUAL(expiredConns.size(), 1U);
+ for (const auto& cbData : expiredConns) {
+ if (cbData.second.type() == typeid(std::shared_ptr<IncomingTCPConnectionState>)) {
+ auto cbState = boost::any_cast<std::shared_ptr<IncomingTCPConnectionState>>(cbData.second);
+ cbState->handleTimeout(cbState, false);
+ }
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), expectedWriteBuffer.size());
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), expectedBackendWriteBuffer.size());
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ IncomingTCPConnectionState::clearAllDownstreamConnections();
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_IncomingConnectionOOOR_BackendNotOOOR)
+{
+ auto local = getBackendAddress("1", 80);
+ ClientState localCS(local, true, false, false, "", {});
+ /* enable out-of-order on the front side */
+ localCS.d_maxInFlightQueriesPerConn = 65536;
+
+ auto tlsCtx = std::make_shared<MockupTLSCtx>();
+ localCS.tlsFrontend = std::make_shared<TLSFrontend>(tlsCtx);
+
+ auto backend = std::make_shared<DownstreamState>(getBackendAddress("42", 53));
+ backend->d_tlsCtx = tlsCtx;
+ /* shorter than the client one */
+ backend->tcpRecvTimeout = 1;
+
+ TCPClientThreadData threadData;
+ threadData.mplexer = std::make_unique<MockupFDMultiplexer>();
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+
+ std::vector<PacketBuffer> queries(5);
+ std::vector<PacketBuffer> responses(5);
+
+ size_t counter = 0;
+ size_t totalQueriesSize = 0;
+ for (auto& query : queries) {
+ GenericDNSPacketWriter<PacketBuffer> pwQ(query, DNSName("powerdns" + std::to_string(counter) + ".com."), QType::A, QClass::IN, 0);
+ pwQ.getHeader()->rd = 1;
+ pwQ.getHeader()->id = counter;
+ uint16_t querySize = static_cast<uint16_t>(query.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(querySize / 256), static_cast<uint8_t>(querySize % 256) };
+ query.insert(query.begin(), sizeBytes, sizeBytes + 2);
+ totalQueriesSize += query.size();
+ ++counter;
+ }
+
+ counter = 0;
+ size_t totalResponsesSize = 0;
+ for (auto& response : responses) {
+ DNSName name("powerdns" + std::to_string(counter) + ".com.");
+ GenericDNSPacketWriter<PacketBuffer> pwR(response, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.getHeader()->rd = 1;
+ pwR.getHeader()->ra = 1;
+ pwR.getHeader()->id = counter;
+ pwR.startRecord(name, QType::A, 7200, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfr32BitInt(0x01020304);
+ pwR.commit();
+
+ uint16_t responseSize = static_cast<uint16_t>(response.size());
+ const uint8_t sizeBytes[] = { static_cast<uint8_t>(responseSize / 256), static_cast<uint8_t>(responseSize % 256) };
+ response.insert(response.begin(), sizeBytes, sizeBytes + 2);
+ totalResponsesSize += response.size();
+ ++counter;
+ }
+
+ {
+ TEST_INIT("=> 5 OOOR queries, we will need to open 5 backend connections");
+ PacketBuffer expectedWriteBuffer;
+ PacketBuffer expectedBackendWriteBuffer;
+
+ for (const auto& query : queries) {
+ s_readBuffer.insert(s_readBuffer.end(), query.begin(), query.end());
+ }
+
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(0), 0);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(1), 0);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(2), 0);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(3), 0);
+ appendPayloadEditingID(expectedBackendWriteBuffer, queries.at(4), 0);
+
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(0), 0);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(2), 0);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(1), 0);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(4), 0);
+ appendPayloadEditingID(s_backendReadBuffer, responses.at(3), 0);
+
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(0).begin(), responses.at(0).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(2).begin(), responses.at(2).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(1).begin(), responses.at(1).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(4).begin(), responses.at(4).end());
+ expectedWriteBuffer.insert(expectedWriteBuffer.end(), responses.at(3).begin(), responses.at(3).end());
+
+ std::vector<int> backendDescriptors = { -1, -1, -1, -1, -1 };
+
+ s_steps = {
+ { ExpectedStep::ExpectedRequest::handshakeClient, IOState::Done },
+ /* reading a query from the client (1) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(0).size() - 2 },
+ /* opening a connection to the backend (1) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+ backendDescriptors.at(0) = desc;
+ } },
+ /* sending query (1) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(0).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (2) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(1).size() - 2 },
+ /* opening a connection to the backend (2) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+ backendDescriptors.at(1) = desc;
+ } },
+ /* sending query (2) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(1).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (3) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(2).size() - 2 },
+ /* opening a connection to the backend (3) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+ backendDescriptors.at(2) = desc;
+ } },
+ /* sending query (3) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(2).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (4) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(3).size() - 2 },
+ /* opening a connection to the backend (4) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+ backendDescriptors.at(3) = desc;
+ } },
+ /* sending query (3) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(3).size() },
+ /* no response ready yet */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0 },
+ /* reading a query from the client (5) */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, queries.at(4).size() - 2 },
+ /* opening a connection to the backend (5) */
+ { ExpectedStep::ExpectedRequest::connectToBackend, IOState::Done, 0, [&backendDescriptors](int desc) {
+ backendDescriptors.at(4) = desc;
+ } },
+ /* sending query (5) to the backend */
+ { ExpectedStep::ExpectedRequest::writeToBackend, IOState::Done, queries.at(4).size() },
+ /* no response ready yet, client stops being readable, first backend has a response */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::NeedRead, 0, [&threadData,&backendDescriptors](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(0));
+ } },
+ /* trying to read from the client but nothing yet */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::NeedRead, 0 , [&threadData](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setNotReady(desc);
+ } },
+ /* reading response (1) from the first backend (1) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(0).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(0).size(), [&threadData,&backendDescriptors](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(2));
+ } },
+ /* reading response (3) from the third backend (3) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(2).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(2).size(), [&threadData,&backendDescriptors](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(1));
+ } },
+ /* reading response (2) from the second backend (2) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(1).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(1).size(), [&threadData,&backendDescriptors](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(4));
+ } },
+ /* reading response (5) from the fifth backend (5) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(4).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(4).size(), [&threadData,&backendDescriptors](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(backendDescriptors.at(3));
+ } },
+ /* reading response (4) from the fourth backend (4) */
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, 2 },
+ { ExpectedStep::ExpectedRequest::readFromBackend, IOState::Done, responses.at(3).size() - 2 },
+ /* sending it to the client */
+ { ExpectedStep::ExpectedRequest::writeToClient, IOState::Done, responses.at(3).size(), [&threadData](int desc) {
+ dynamic_cast<MockupFDMultiplexer*>(threadData.mplexer.get())->setReady(-1);
+ } },
+ /* client closes the connection */
+ { ExpectedStep::ExpectedRequest::readFromClient, IOState::Done, 0 },
+ /* closing client connection */
+ { ExpectedStep::ExpectedRequest::closeClient, IOState::Done },
+ /* closing a connection to the backends */
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ { ExpectedStep::ExpectedRequest::closeBackend, IOState::Done },
+ };
+
+ s_processQuery = [backend](DNSQuestion& dq, ClientState& cs, LocalHolders& holders, std::shared_ptr<DownstreamState>& selectedBackend) -> ProcessQueryResult {
+ selectedBackend = backend;
+ return ProcessQueryResult::PassToBackend;
+ };
+ s_processResponse = [](PacketBuffer& response, LocalStateHolder<vector<DNSDistResponseRuleAction> >& localRespRuleActions, DNSResponse& dr, bool muted) -> bool {
+ return true;
+ };
+
+ auto state = std::make_shared<IncomingTCPConnectionState>(ConnectionInfo(&localCS, getBackendAddress("84", 4242)), threadData, now);
+ IncomingTCPConnectionState::handleIO(state, now);
+ while (threadData.mplexer->getWatchedFDCount(false) != 0 || threadData.mplexer->getWatchedFDCount(true) != 0) {
+ threadData.mplexer->run(&now);
+ }
+
+ BOOST_CHECK_EQUAL(s_writeBuffer.size(), totalResponsesSize);
+ BOOST_CHECK(s_writeBuffer == expectedWriteBuffer);
+ BOOST_CHECK_EQUAL(s_backendWriteBuffer.size(), totalQueriesSize);
+ BOOST_CHECK(s_backendWriteBuffer == expectedBackendWriteBuffer);
+ BOOST_CHECK_EQUAL(backend->outstanding.load(), 0U);
+
+ /* we need to clear them now, otherwise we end up with dangling pointers to the steps via the TLS context, etc */
+ BOOST_CHECK_EQUAL(IncomingTCPConnectionState::clearAllDownstreamConnections(), 5U);
+ }
+}
+
+BOOST_AUTO_TEST_SUITE_END();
diff --git a/test-dnsparser_cc.cc b/test-dnsparser_cc.cc
new file mode 100644
index 0000000..e71bf19
--- /dev/null
+++ b/test-dnsparser_cc.cc
@@ -0,0 +1,486 @@
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <boost/test/unit_test.hpp>
+
+#include "dnsparser.hh"
+
+BOOST_AUTO_TEST_SUITE(test_dnsparser_cc)
+
+BOOST_AUTO_TEST_CASE(test_editDNSPacketTTL) {
+
+ auto generatePacket = [](uint32_t ttl) {
+ DNSName name("powerdns.com.");
+ ComboAddress v4("1.2.3.4");
+ ComboAddress v6("2001:db8::1");
+
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+
+ /* record we want to see altered */
+ pwR.startRecord(name, QType::A, ttl, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ /* same record but different TTL (yeah, don't do that but it's just a test) */
+ pwR.startRecord(name, QType::A, 100, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ /* different type */
+ pwR.startRecord(name, QType::AAAA, 42, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP6(std::string(reinterpret_cast<const char*>(v6.sin6.sin6_addr.s6_addr), 16));
+ pwR.commit();
+
+ /* different class */
+ pwR.startRecord(name, QType::A, 42, QClass::CHAOS, DNSResourceRecord::ANSWER);
+ pwR.commit();
+
+ /* different section */
+ pwR.startRecord(name, QType::A, 42, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ return packet;
+ };
+
+ auto firstPacket = generatePacket(42);
+ auto expectedAlteredPacket = generatePacket(84);
+
+ size_t called = 0;
+ editDNSPacketTTL(reinterpret_cast<char*>(firstPacket.data()), firstPacket.size(), [&called](uint8_t section, uint16_t class_, uint16_t type, uint32_t ttl) {
+
+ called++;
+
+ /* only updates the TTL of IN/A, in answer, with an existing ttl of 42 */
+ if (section == 1 && class_ == QClass::IN && type == QType::A && ttl == 42) {
+ return 84;
+ }
+ return 0;
+ });
+
+ /* check that we have been for all records */
+ BOOST_CHECK_EQUAL(called, 5U);
+
+ BOOST_REQUIRE_EQUAL(firstPacket.size(), expectedAlteredPacket.size());
+ for (size_t idx = 0; idx < firstPacket.size(); idx++) {
+ BOOST_CHECK_EQUAL(firstPacket.at(idx), expectedAlteredPacket.at(idx));
+ }
+ BOOST_CHECK(firstPacket == expectedAlteredPacket);
+
+ /* now call it with a truncated packet, missing the last TTL and rdata,
+ we should only be called 4 times but everything else should be fine. */
+ called = 0;
+ editDNSPacketTTL(reinterpret_cast<char*>(firstPacket.data()), firstPacket.size() - sizeof(uint32_t) - /* rdata length */ sizeof (uint16_t) - /* IPv4 payload in rdata */ 4, [&called](uint8_t section, uint16_t class_, uint16_t type, uint32_t ttl) {
+
+ called++;
+
+ /* only updates the TTL of IN/A, in answer, with an existing ttl of 42 */
+ if (section == 1 && class_ == QClass::IN && type == QType::A && ttl == 42) {
+ return 84;
+ }
+ return 0;
+ });
+
+ /* check that we have been for all records */
+ BOOST_CHECK_EQUAL(called, 4U);
+ BOOST_CHECK(firstPacket == expectedAlteredPacket);
+}
+
+BOOST_AUTO_TEST_CASE(test_ageDNSPacket) {
+
+ auto generatePacket = [](uint32_t ttl) {
+ DNSName name("powerdns.com.");
+ ComboAddress v4("1.2.3.4");
+ ComboAddress v6("2001:db8::1");
+
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+
+ /* record we want to see altered */
+ pwR.startRecord(name, QType::A, ttl, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.addOpt(4096, 0, 0);
+ pwR.commit();
+
+ return packet;
+ };
+
+ auto firstPacket = generatePacket(3600);
+ auto expectedAlteredPacket = generatePacket(1800);
+
+ ageDNSPacket(reinterpret_cast<char*>(firstPacket.data()), firstPacket.size(), 1800);
+
+ BOOST_REQUIRE_EQUAL(firstPacket.size(), expectedAlteredPacket.size());
+ for (size_t idx = 0; idx < firstPacket.size(); idx++) {
+ BOOST_CHECK_EQUAL(firstPacket.at(idx), expectedAlteredPacket.at(idx));
+ }
+ BOOST_CHECK(firstPacket == expectedAlteredPacket);
+
+ /* now call it with a truncated packet, missing the last TTL and rdata,
+ the packet should not be altered. */
+ ageDNSPacket(reinterpret_cast<char*>(firstPacket.data()), firstPacket.size() - sizeof(uint32_t) - /* rdata length */ sizeof (uint16_t) - /* IPv4 payload in rdata */ 4 - /* size of OPT record */ 11, 900);
+
+ BOOST_CHECK(firstPacket == expectedAlteredPacket);
+
+ /* now remove more than the remaining TTL. We expect ageDNSPacket
+ to cap this at zero and not cause an unsigned underflow into
+ the 2^32-1 neighbourhood */
+ ageDNSPacket(reinterpret_cast<char*>(firstPacket.data()), firstPacket.size(), 1801);
+
+ uint32_t ttl = 0;
+
+ expectedAlteredPacket = generatePacket(ttl);
+ BOOST_REQUIRE_EQUAL(firstPacket.size(), expectedAlteredPacket.size());
+ for (size_t idx = 0; idx < firstPacket.size(); idx++) {
+ BOOST_CHECK_EQUAL(firstPacket.at(idx), expectedAlteredPacket.at(idx));
+ }
+ BOOST_CHECK(firstPacket == expectedAlteredPacket);
+}
+
+BOOST_AUTO_TEST_CASE(test_getDNSPacketMinTTL) {
+
+ const DNSName name("powerdns.com.");
+ const ComboAddress v4("1.2.3.4");
+ const ComboAddress v6("2001:db8::1");
+
+ {
+ /* no records */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size(), nullptr);
+ BOOST_CHECK_EQUAL(result, std::numeric_limits<uint32_t>::max());
+ }
+
+ {
+ /* only one record, not an OPT one */
+ uint32_t ttl = 42;
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, ttl, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size(), nullptr);
+ BOOST_CHECK_EQUAL(result, ttl);
+ }
+
+ {
+ /* only one record, an OPT one */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.addOpt(4096, 0, 0);
+ pwR.commit();
+
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size(), nullptr);
+ BOOST_CHECK_EQUAL(result, std::numeric_limits<uint32_t>::max());
+ }
+
+ {
+ /* records with different TTLs, should return the lower */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 257, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 255, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 256, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size(), nullptr);
+ BOOST_CHECK_EQUAL(result, 255U);
+ }
+
+ {
+ /* SOA record in answer, seenAuthSOA should not be set */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::SOA, 257, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 255, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 256, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ bool seenAuthSOA = false;
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size(), &seenAuthSOA);
+ BOOST_CHECK_EQUAL(result, 255U);
+ BOOST_CHECK_EQUAL(seenAuthSOA, false);
+ }
+
+ {
+ /* one SOA record in auth, seenAuthSOA should be set */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 255, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::SOA, 257, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 256, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ bool seenAuthSOA = false;
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size(), &seenAuthSOA);
+ BOOST_CHECK_EQUAL(result, 255U);
+ BOOST_CHECK_EQUAL(seenAuthSOA, true);
+ }
+
+ {
+ /* one SOA record of the wrong qclass in auth, seenAuthSOA should not be set */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 257, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::SOA, 255, QClass::CHAOS, DNSResourceRecord::AUTHORITY);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 256, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ bool seenAuthSOA = false;
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size(), &seenAuthSOA);
+ BOOST_CHECK_EQUAL(result, 255U);
+ BOOST_CHECK_EQUAL(seenAuthSOA, false);
+ }
+
+ {
+ /* one A record in auth, seenAuthSOA should not be set */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 257, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ bool seenAuthSOA = false;
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size(), &seenAuthSOA);
+ BOOST_CHECK_EQUAL(result, 257U);
+ BOOST_CHECK_EQUAL(seenAuthSOA, false);
+ }
+
+ {
+ /* one SOA record in additional, seenAuthSOA should not be set */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::SOA, 255, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.commit();
+
+ bool seenAuthSOA = false;
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size(), &seenAuthSOA);
+ BOOST_CHECK_EQUAL(result, 255U);
+ BOOST_CHECK_EQUAL(seenAuthSOA, false);
+ }
+
+ {
+ /* truncated packet, no exception should be raised */
+ /* one SOA record in auth, seenAuthSOA should be set */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 255, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::SOA, 257, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 254, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ bool seenAuthSOA = false;
+ auto result = getDNSPacketMinTTL(reinterpret_cast<char*>(packet.data()), packet.size() - sizeof(uint32_t) - /* rdata length */ sizeof (uint16_t) - /* IPv4 payload in rdata */ 4, &seenAuthSOA);
+ BOOST_CHECK_EQUAL(result, 255U);
+ BOOST_CHECK_EQUAL(seenAuthSOA, true);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_getDNSPacketLength) {
+
+ const DNSName name("powerdns.com.");
+ const ComboAddress v4("1.2.3.4");
+ const ComboAddress v6("2001:db8::1");
+
+ {
+ /* no records */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ auto result = getDNSPacketLength(reinterpret_cast<char*>(packet.data()), packet.size());
+ BOOST_CHECK_EQUAL(result, packet.size());
+ }
+
+ {
+ /* several records */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 255, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::SOA, 257, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 256, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.addOpt(4096, 0, 0);
+ pwR.commit();
+
+ auto result = getDNSPacketLength(reinterpret_cast<char*>(packet.data()), packet.size());
+ BOOST_CHECK_EQUAL(result, packet.size());
+ }
+
+ {
+ /* trailing data */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 255, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::SOA, 257, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 256, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.addOpt(4096, 0, 0);
+ pwR.commit();
+
+ auto realSize = packet.size();
+ packet.resize(realSize + 512);
+ auto result = getDNSPacketLength(reinterpret_cast<char*>(packet.data()), packet.size());
+ BOOST_CHECK_EQUAL(result, realSize);
+ }
+
+ {
+ /* truncated packet, should return the full size */
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 255, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::SOA, 257, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 256, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.addOpt(4096, 0, 0);
+ pwR.commit();
+
+ size_t fakeSize = packet.size()-1;
+ auto result = getDNSPacketLength(reinterpret_cast<char*>(packet.data()), fakeSize);
+ BOOST_CHECK_EQUAL(result, fakeSize);
+ }
+
+}
+
+BOOST_AUTO_TEST_CASE(test_getRecordsOfTypeCount) {
+ const DNSName name("powerdns.com.");
+ const ComboAddress v4("1.2.3.4");
+ const ComboAddress v6("2001:db8::1");
+
+ {
+ vector<uint8_t> packet;
+ DNSPacketWriter pwR(packet, name, QType::A, QClass::IN, 0);
+ pwR.getHeader()->qr = 1;
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 255, QClass::IN, DNSResourceRecord::ANSWER);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::SOA, 257, QClass::IN, DNSResourceRecord::AUTHORITY);
+ pwR.commit();
+
+ pwR.startRecord(name, QType::A, 256, QClass::IN, DNSResourceRecord::ADDITIONAL);
+ pwR.xfrIP(v4.sin4.sin_addr.s_addr);
+ pwR.commit();
+
+ pwR.addOpt(4096, 0, 0);
+ pwR.commit();
+
+ BOOST_CHECK_EQUAL(getRecordsOfTypeCount(reinterpret_cast<char*>(packet.data()), packet.size(), 0, QType::A), 1);
+ BOOST_CHECK_EQUAL(getRecordsOfTypeCount(reinterpret_cast<char*>(packet.data()), packet.size(), 0, QType::SOA), 0);
+ BOOST_CHECK_EQUAL(getRecordsOfTypeCount(reinterpret_cast<char*>(packet.data()), packet.size(), 1, QType::A), 1);
+ BOOST_CHECK_EQUAL(getRecordsOfTypeCount(reinterpret_cast<char*>(packet.data()), packet.size(), 1, QType::SOA), 0);
+ BOOST_CHECK_EQUAL(getRecordsOfTypeCount(reinterpret_cast<char*>(packet.data()), packet.size(), 2, QType::A), 0);
+ BOOST_CHECK_EQUAL(getRecordsOfTypeCount(reinterpret_cast<char*>(packet.data()), packet.size(), 2, QType::SOA), 1);
+ BOOST_CHECK_EQUAL(getRecordsOfTypeCount(reinterpret_cast<char*>(packet.data()), packet.size(), 3, QType::A), 1);
+ BOOST_CHECK_EQUAL(getRecordsOfTypeCount(reinterpret_cast<char*>(packet.data()), packet.size(), 3, QType::SOA), 0);
+
+ BOOST_CHECK_EQUAL(getRecordsOfTypeCount(reinterpret_cast<char*>(packet.data()), packet.size(), 4, QType::SOA), 0);
+}
+
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-driver b/test-driver
new file mode 100755
index 0000000..b8521a4
--- /dev/null
+++ b/test-driver
@@ -0,0 +1,148 @@
+#! /bin/sh
+# test-driver - basic testsuite driver script.
+
+scriptversion=2018-03-07.03; # UTC
+
+# Copyright (C) 2011-2018 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 2, 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 <https://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+# Make unconditional expansion of undefined variables an error. This
+# helps a lot in preventing typo-related bugs.
+set -u
+
+usage_error ()
+{
+ echo "$0: $*" >&2
+ print_usage >&2
+ exit 2
+}
+
+print_usage ()
+{
+ cat <<END
+Usage:
+ test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
+ [--expect-failure={yes|no}] [--color-tests={yes|no}]
+ [--enable-hard-errors={yes|no}] [--]
+ TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+END
+}
+
+test_name= # Used for reporting.
+log_file= # Where to save the output of the test script.
+trs_file= # Where to save the metadata of the test run.
+expect_failure=no
+color_tests=no
+enable_hard_errors=yes
+while test $# -gt 0; do
+ case $1 in
+ --help) print_usage; exit $?;;
+ --version) echo "test-driver $scriptversion"; exit $?;;
+ --test-name) test_name=$2; shift;;
+ --log-file) log_file=$2; shift;;
+ --trs-file) trs_file=$2; shift;;
+ --color-tests) color_tests=$2; shift;;
+ --expect-failure) expect_failure=$2; shift;;
+ --enable-hard-errors) enable_hard_errors=$2; shift;;
+ --) shift; break;;
+ -*) usage_error "invalid option: '$1'";;
+ *) break;;
+ esac
+ shift
+done
+
+missing_opts=
+test x"$test_name" = x && missing_opts="$missing_opts --test-name"
+test x"$log_file" = x && missing_opts="$missing_opts --log-file"
+test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
+if test x"$missing_opts" != x; then
+ usage_error "the following mandatory options are missing:$missing_opts"
+fi
+
+if test $# -eq 0; then
+ usage_error "missing argument"
+fi
+
+if test $color_tests = yes; then
+ # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
+ red='' # Red.
+ grn='' # Green.
+ lgn='' # Light green.
+ blu='' # Blue.
+ mgn='' # Magenta.
+ std='' # No color.
+else
+ red= grn= lgn= blu= mgn= std=
+fi
+
+do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
+trap "st=129; $do_exit" 1
+trap "st=130; $do_exit" 2
+trap "st=141; $do_exit" 13
+trap "st=143; $do_exit" 15
+
+# Test script is run here.
+"$@" >$log_file 2>&1
+estatus=$?
+
+if test $enable_hard_errors = no && test $estatus -eq 99; then
+ tweaked_estatus=1
+else
+ tweaked_estatus=$estatus
+fi
+
+case $tweaked_estatus:$expect_failure in
+ 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
+ 0:*) col=$grn res=PASS recheck=no gcopy=no;;
+ 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
+ 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
+ *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
+ *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
+esac
+
+# Report the test outcome and exit status in the logs, so that one can
+# know whether the test passed or failed simply by looking at the '.log'
+# file, without the need of also peaking into the corresponding '.trs'
+# file (automake bug#11814).
+echo "$res $test_name (exit status: $estatus)" >>$log_file
+
+# Report outcome to console.
+echo "${col}${res}${std}: $test_name"
+
+# Register the test result, and other relevant metadata.
+echo ":test-result: $res" > $trs_file
+echo ":global-test-result: $res" >> $trs_file
+echo ":recheck: $recheck" >> $trs_file
+echo ":copy-in-global-log: $gcopy" >> $trs_file
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC0"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/test-iputils_hh.cc b/test-iputils_hh.cc
new file mode 100644
index 0000000..36e6577
--- /dev/null
+++ b/test-iputils_hh.cc
@@ -0,0 +1,855 @@
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <boost/test/unit_test.hpp>
+#include <bitset>
+#include "iputils.hh"
+
+using namespace boost;
+
+BOOST_AUTO_TEST_SUITE(test_iputils_hh)
+
+BOOST_AUTO_TEST_CASE(test_ComboAddress) {
+ ComboAddress local("127.0.0.1", 53);
+ BOOST_CHECK(local==local);
+ BOOST_CHECK_EQUAL(local.sin4.sin_family, AF_INET);
+ BOOST_CHECK_EQUAL(local.sin4.sin_port, htons(53));
+ BOOST_CHECK_EQUAL(local.sin4.sin_addr.s_addr, htonl(0x7f000001UL));
+
+ ComboAddress remote("130.161.33.15", 53);
+ BOOST_CHECK(!(local == remote));
+ BOOST_CHECK_EQUAL(remote.sin4.sin_port, htons(53));
+
+ ComboAddress withport("213.244.168.210:53");
+ BOOST_CHECK_EQUAL(withport.sin4.sin_port, htons(53));
+
+ ComboAddress withportO("213.244.168.210:53", 5300);
+ BOOST_CHECK_EQUAL(withportO.sin4.sin_port, htons(53));
+
+ withport = ComboAddress("[::]:53");
+ BOOST_CHECK_EQUAL(withport.sin4.sin_port, htons(53));
+
+ withport = ComboAddress("[::]:5300", 53);
+ BOOST_CHECK_EQUAL(withport.sin4.sin_port, htons(5300));
+
+ ComboAddress defaultport("213.244.168.210");
+ BOOST_CHECK_EQUAL(defaultport.sin4.sin_port, htons(0));
+
+ defaultport = ComboAddress("[::1]");
+ BOOST_CHECK_EQUAL(defaultport.sin4.sin_port, htons(0));
+
+ defaultport = ComboAddress("::1");
+ BOOST_CHECK_EQUAL(defaultport.sin4.sin_port, htons(0));
+
+ // Verify that 2 'empty' ComboAddresses are equal, used in syncres.hh to
+ // signal auth-zones
+ ComboAddress a = ComboAddress();
+ ComboAddress b = ComboAddress();
+ BOOST_CHECK(a == b);
+
+ // Verify that 2 ComboAddresses are not the same
+ ComboAddress c = ComboAddress("127.0.0.1:53");
+ ComboAddress d = ComboAddress("127.0.0.1:52");
+ ComboAddress e = ComboAddress("127.0.0.2:53");
+
+ BOOST_CHECK(a != c);
+ BOOST_CHECK(c != d);
+ BOOST_CHECK(c != e);
+ BOOST_CHECK(d != e);
+ BOOST_CHECK(!(a != b));
+
+ // Verify that we don't allow invalid port numbers
+ BOOST_CHECK_THROW(ComboAddress("127.0.0.1:70000"), PDNSException); // Port no. too high
+ BOOST_CHECK_THROW(ComboAddress("127.0.0.1:-6"), PDNSException); // Port no. too low
+ BOOST_CHECK_THROW(ComboAddress("[::1]:70000"), PDNSException); // Port no. too high
+ BOOST_CHECK_THROW(ComboAddress("[::1]:-6"), PDNSException); // Port no. too low
+}
+
+BOOST_AUTO_TEST_CASE(test_ComboAddressCompare) {
+ ComboAddress a, b;
+ a.reset();
+ b.reset();
+ BOOST_CHECK(!(a<b));
+ BOOST_CHECK(!(a>b));
+}
+
+BOOST_AUTO_TEST_CASE(test_ComboAddressTruncate) {
+ ComboAddress ca4("130.161.252.29");
+ ca4.truncate(24);
+ BOOST_CHECK_EQUAL(ca4.toString(), "130.161.252.0");
+ ca4.truncate(16);
+ BOOST_CHECK_EQUAL(ca4.toString(), "130.161.0.0");
+
+
+
+ ca4 = ComboAddress("130.161.252.29");
+ ComboAddress orig(ca4);
+ for(int n=32; n; --n) {
+ ca4.truncate(n);
+
+ uint32_t p;
+ memcpy(&p, (char*)&ca4.sin4.sin_addr.s_addr, 4);
+ std::bitset<32> result(htonl(p));
+
+ memcpy(&p, (char*)&orig.sin4.sin_addr.s_addr, 4);
+ std::bitset<32> manual(htonl(p));
+
+ auto tokill=32-n;
+ for(int i =0; i< tokill; ++i)
+ manual.set(i, 0);
+
+ BOOST_CHECK_EQUAL(result, manual);
+ }
+
+ ca4 = ComboAddress("130.161.252.29");
+ ca4.truncate(31);
+ BOOST_CHECK_EQUAL(ca4.toString(), "130.161.252.28");
+
+ ca4.truncate(30);
+ BOOST_CHECK_EQUAL(ca4.toString(), "130.161.252.28");
+
+ ca4.truncate(29);
+ BOOST_CHECK_EQUAL(ca4.toString(), "130.161.252.24");
+
+ ca4.truncate(23);
+ BOOST_CHECK_EQUAL(ca4.toString(), "130.161.252.0");
+
+ ca4.truncate(22);
+ BOOST_CHECK_EQUAL(ca4.toString(), "130.161.252.0");
+
+ ca4.truncate(21);
+ BOOST_CHECK_EQUAL(ca4.toString(), "130.161.248.0");
+
+ ComboAddress ca6("2001:888:2000:1d::2");
+ ca6.truncate(120);
+ BOOST_CHECK_EQUAL(ca6.toString(), "2001:888:2000:1d::");
+ ca6.truncate(64);
+ BOOST_CHECK_EQUAL(ca6.toString(), "2001:888:2000:1d::");
+ ca6.truncate(72); // 0102 304 0506 78
+ BOOST_CHECK_EQUAL(ca6.toString(), "2001:888:2000:1d::");
+ ca6.truncate(56);
+ BOOST_CHECK_EQUAL(ca6.toString(), "2001:888:2000::");
+ ca6.truncate(48);
+ BOOST_CHECK_EQUAL(ca6.toString(), "2001:888:2000::");
+ ca6.truncate(32);
+ BOOST_CHECK_EQUAL(ca6.toString(), "2001:888::");
+ ca6.truncate(16);
+ BOOST_CHECK_EQUAL(ca6.toString(), "2001::");
+ ca6.truncate(8);
+ BOOST_CHECK_EQUAL(ca6.toString(), "2000::");
+
+
+ orig=ca6=ComboAddress("2001:888:2000:1d::2");
+ for(int n=128; n; --n) {
+ ca6.truncate(n);
+
+ std::bitset<128> result, manual;
+ for(int i=0; i < 16; ++i) {
+ result<<=8;
+ result|= std::bitset<128>(*((unsigned char*)&ca6.sin6.sin6_addr.s6_addr + i));
+
+ manual<<=8;
+ manual|= std::bitset<128>(*((unsigned char*)&orig.sin6.sin6_addr.s6_addr + i));
+ }
+
+ auto tokill=128-n;
+ for(int i =0; i< tokill; ++i)
+ manual.set(i, 0);
+
+ BOOST_CHECK_EQUAL(result, manual);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_Mapping)
+{
+ ComboAddress lh("::1");
+ BOOST_CHECK_EQUAL(lh.toString(), "::1");
+}
+
+BOOST_AUTO_TEST_CASE(test_Netmask) {
+ ComboAddress local("127.0.0.1", 53);
+ ComboAddress remote("130.161.252.29", 53);
+
+ Netmask nm("127.0.0.1/24");
+ BOOST_CHECK(nm.getBits() == 24);
+ BOOST_CHECK(nm.match(local));
+ BOOST_CHECK(!nm.match(remote));
+ BOOST_CHECK(nm.isIPv4());
+ BOOST_CHECK(!nm.isIPv6());
+
+ Netmask nm6("fe80::92fb:a6ff:fe4a:51da/64");
+ BOOST_CHECK(nm6.getBits() == 64);
+ BOOST_CHECK(nm6.match("fe80::92fb:a6ff:fe4a:51db"));
+ BOOST_CHECK(!nm6.match("fe81::92fb:a6ff:fe4a:51db"));
+ BOOST_CHECK(!nm6.isIPv4());
+ BOOST_CHECK(nm6.isIPv6());
+
+ Netmask nmp("130.161.252.29/32");
+ BOOST_CHECK(nmp.match(remote));
+
+ Netmask nmp6("fe80::92fb:a6ff:fe4a:51da/128");
+ BOOST_CHECK(nmp6.match("fe80::92fb:a6ff:fe4a:51da"));
+ BOOST_CHECK(!nmp6.match("fe81::92fb:a6ff:fe4a:51db"));
+
+ Netmask all("0.0.0.0/0");
+ BOOST_CHECK(all.match(local) && all.match(remote));
+
+ Netmask all6("::/0");
+ BOOST_CHECK(all6.match("::1") && all6.match("fe80::92fb:a6ff:fe4a:51da"));
+
+
+ Netmask fromCombo1(ComboAddress("192.0.2.1:53"), 32);
+ Netmask fromCombo2(ComboAddress("192.0.2.1:54"), 32);
+ BOOST_CHECK(fromCombo1 == fromCombo2);
+ BOOST_CHECK(fromCombo1.match("192.0.2.1"));
+ BOOST_CHECK(fromCombo1.match(ComboAddress("192.0.2.1:80")));
+ BOOST_CHECK(fromCombo1.getNetwork() == ComboAddress("192.0.2.1"));
+ BOOST_CHECK(fromCombo1.getMaskedNetwork() == ComboAddress("192.0.2.1"));
+
+ Netmask nm25("192.0.2.255/25");
+ BOOST_CHECK(nm25.getBits() == 25);
+ BOOST_CHECK(nm25.getNetwork() == ComboAddress("192.0.2.128"));
+ BOOST_CHECK(nm25.getMaskedNetwork() == ComboAddress("192.0.2.128"));
+
+ /* Make sure that more specific Netmasks are lesser than less specific ones,
+ as this is very useful when matching. */
+ Netmask specific32("192.0.0.0/32");
+ Netmask specific24("192.0.0.0/24");
+ Netmask specific16("192.0.0.0/16");
+ BOOST_CHECK(specific32 < specific24);
+ BOOST_CHECK(specific24 > specific32);
+ BOOST_CHECK(specific24 < specific16);
+ BOOST_CHECK(specific16 > specific24);
+
+ Netmask sameMask1("192.0.0.0/16");
+ Netmask sameMask2("192.0.0.1/16");
+ BOOST_CHECK(!(sameMask1 < sameMask2));
+ BOOST_CHECK(!(sameMask2 > sameMask1));
+ BOOST_CHECK(sameMask1 == sameMask2);
+
+ Netmask nm1921("192.1.255.255/16");
+ Netmask nm1922("192.2.255.255/16");
+ BOOST_CHECK(!(nm1921 == nm1922));
+ BOOST_CHECK(nm1921 < nm1922);
+ BOOST_CHECK(nm1922 > nm1921);
+
+ /* An empty Netmask should be larger than
+ every others. */
+ Netmask empty = Netmask();
+ Netmask full("255.255.255.255/32");
+ BOOST_CHECK(empty > all);
+ BOOST_CHECK(all < empty);
+ BOOST_CHECK(empty > full);
+ BOOST_CHECK(full < empty);
+}
+
+static std::string NMGOutputToSorted(const std::string& str)
+{
+ std::vector<std::string> vect;
+ stringtok(vect, str, ", ");
+ std::sort(vect.begin(), vect.end());
+ std::string result;
+ for (const auto& entry : vect) {
+ if (!result.empty()) {
+ result += " ";
+ }
+ result += entry;
+ }
+
+ return result;
+}
+
+BOOST_AUTO_TEST_CASE(test_NetmaskGroup) {
+
+ {
+ NetmaskGroup ng;
+ BOOST_CHECK_EQUAL(ng.empty(), true);
+ BOOST_CHECK_EQUAL(ng.size(), 0U);
+ ng.addMask("10.0.1.0");
+ BOOST_CHECK_EQUAL(ng.empty(), false);
+ BOOST_CHECK_EQUAL(ng.size(), 1U);
+ BOOST_CHECK(ng.match(ComboAddress("10.0.1.0")));
+ ng.toMasks("127.0.0.0/8, 10.0.0.0/24");
+ BOOST_CHECK_EQUAL(ng.size(), 3U);
+ BOOST_CHECK(ng.match(ComboAddress("127.0.0.1")));
+ BOOST_CHECK(ng.match(ComboAddress("10.0.0.3")));
+ BOOST_CHECK(ng.match(ComboAddress("10.0.1.0")));
+ BOOST_CHECK(!ng.match(ComboAddress("128.1.2.3")));
+ BOOST_CHECK(!ng.match(ComboAddress("10.0.1.1")));
+ BOOST_CHECK(!ng.match(ComboAddress("::1")));
+ ng.addMask("::1");
+ BOOST_CHECK_EQUAL(ng.size(), 4U);
+ BOOST_CHECK(ng.match(ComboAddress("::1")));
+ BOOST_CHECK(!ng.match(ComboAddress("::2")));
+ ng.addMask("fe80::/16");
+ BOOST_CHECK_EQUAL(ng.size(), 5U);
+ BOOST_CHECK(ng.match(ComboAddress("fe80::1")));
+ BOOST_CHECK(!ng.match(ComboAddress("fe81::1")));
+ BOOST_CHECK_EQUAL(NMGOutputToSorted(ng.toString()), NMGOutputToSorted("10.0.1.0/32, 127.0.0.0/8, 10.0.0.0/24, ::1/128, fe80::/16"));
+
+ /* negative entries using the explicit flag */
+ ng.addMask("172.16.0.0/16", true);
+ BOOST_CHECK_EQUAL(ng.size(), 6U);
+ BOOST_CHECK(ng.match(ComboAddress("172.16.1.1")));
+ BOOST_CHECK(ng.match(ComboAddress("172.16.4.50")));
+ ng.addMask("172.16.4.0/24", false);
+ BOOST_CHECK_EQUAL(ng.size(), 7U);
+ BOOST_CHECK(ng.match(ComboAddress("172.16.1.1")));
+ BOOST_CHECK(!ng.match(ComboAddress("172.16.4.50")));
+ ng.addMask("fe80::/24", false);
+ BOOST_CHECK_EQUAL(ng.size(), 8U);
+ BOOST_CHECK(!ng.match(ComboAddress("fe80::1")));
+ BOOST_CHECK(!ng.match(ComboAddress("fe81::1")));
+ /* not in fe80::/24 but in fe80::/16, should match */
+ BOOST_CHECK(ng.match(ComboAddress("fe80:0100::1")));
+
+ /* negative entries using '!' */
+ BOOST_CHECK(ng.match(ComboAddress("172.16.10.80")));
+ ng.addMask("!172.16.10.0/24");
+ BOOST_CHECK_EQUAL(ng.size(), 9U);
+ BOOST_CHECK(!ng.match(ComboAddress("172.16.10.80")));
+ ng.addMask("2001:db8::/32");
+ BOOST_CHECK_EQUAL(ng.size(), 10U);
+ ng.addMask("!2001:db8::/64");
+ BOOST_CHECK_EQUAL(ng.size(), 11U);
+ BOOST_CHECK(!ng.match(ComboAddress("2001:db8::1")));
+ /* not in 2001:db8::/64 but in 2001:db8::/32, should match */
+ BOOST_CHECK(ng.match(ComboAddress("2001:db8:1::1")));
+
+ BOOST_CHECK_EQUAL(NMGOutputToSorted(ng.toString()), NMGOutputToSorted("10.0.1.0/32, 127.0.0.0/8, 10.0.0.0/24, ::1/128, fe80::/16, 172.16.0.0/16, !172.16.4.0/24, !fe80::/24, !172.16.10.0/24, 2001:db8::/32, !2001:db8::/64"));
+ }
+
+ {
+ /* this time using Netmask objects instead of strings */
+ NetmaskGroup ng;
+ BOOST_CHECK_EQUAL(ng.empty(), true);
+ BOOST_CHECK_EQUAL(ng.size(), 0U);
+ ng.addMask(Netmask("10.0.1.0"));
+ BOOST_CHECK_EQUAL(ng.empty(), false);
+ BOOST_CHECK_EQUAL(ng.size(), 1U);
+ BOOST_CHECK(ng.match(ComboAddress("10.0.1.0")));
+ ng.addMask(Netmask("127.0.0.0/8"));
+ BOOST_CHECK_EQUAL(ng.size(), 2U);
+ ng.addMask(Netmask("10.0.0.0/24"));
+ BOOST_CHECK_EQUAL(ng.size(), 3U);
+ BOOST_CHECK(ng.match(ComboAddress("127.0.0.1")));
+ BOOST_CHECK(ng.match(ComboAddress("10.0.0.3")));
+ BOOST_CHECK(ng.match(ComboAddress("10.0.1.0")));
+ BOOST_CHECK(!ng.match(ComboAddress("128.1.2.3")));
+ BOOST_CHECK(!ng.match(ComboAddress("10.0.1.1")));
+ BOOST_CHECK(!ng.match(ComboAddress("::1")));
+ ng.addMask(Netmask("::1"));
+ BOOST_CHECK_EQUAL(ng.size(), 4U);
+ BOOST_CHECK(ng.match(ComboAddress("::1")));
+ BOOST_CHECK(!ng.match(ComboAddress("::2")));
+ ng.addMask(Netmask("fe80::/16"));
+ BOOST_CHECK_EQUAL(ng.size(), 5U);
+ BOOST_CHECK(ng.match(ComboAddress("fe80::1")));
+ BOOST_CHECK(!ng.match(ComboAddress("fe81::1")));
+ BOOST_CHECK_EQUAL(NMGOutputToSorted(ng.toString()), NMGOutputToSorted("10.0.1.0/32, 127.0.0.0/8, 10.0.0.0/24, ::1/128, fe80::/16"));
+
+ /* negative entries using the explicit flag */
+ ng.addMask(Netmask("172.16.0.0/16"), true);
+ BOOST_CHECK_EQUAL(ng.size(), 6U);
+ BOOST_CHECK(ng.match(ComboAddress("172.16.1.1")));
+ BOOST_CHECK(ng.match(ComboAddress("172.16.4.50")));
+ ng.addMask(Netmask("172.16.4.0/24"), false);
+ BOOST_CHECK_EQUAL(ng.size(), 7U);
+ BOOST_CHECK(ng.match(ComboAddress("172.16.1.1")));
+ BOOST_CHECK(!ng.match(ComboAddress("172.16.4.50")));
+ ng.addMask("fe80::/24", false);
+ BOOST_CHECK_EQUAL(ng.size(), 8U);
+ BOOST_CHECK(!ng.match(ComboAddress("fe80::1")));
+ BOOST_CHECK(!ng.match(ComboAddress("fe81::1")));
+ /* not in fe80::/24 but in fe80::/16, should match */
+ BOOST_CHECK(ng.match(ComboAddress("fe80:0100::1")));
+
+ BOOST_CHECK_EQUAL(NMGOutputToSorted(ng.toString()), NMGOutputToSorted("10.0.1.0/32, 127.0.0.0/8, 10.0.0.0/24, ::1/128, fe80::/16, 172.16.0.0/16, !172.16.4.0/24, !fe80::/24"));
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_NetmaskTree) {
+ NetmaskTree<int> nmt;
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ nmt.insert(Netmask("130.161.252.0/24")).second=0;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+ nmt.insert(Netmask("130.161.0.0/16")).second=1;
+ BOOST_CHECK_EQUAL(nmt.size(), 2U);
+ nmt.insert(Netmask("130.0.0.0/8")).second=2;
+ BOOST_CHECK_EQUAL(nmt.size(), 3U);
+
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("213.244.168.210")), (void*)0);
+ auto found=nmt.lookup(ComboAddress("130.161.252.29"));
+ BOOST_CHECK(found);
+ BOOST_CHECK_EQUAL(found->second, 0);
+ found=nmt.lookup(ComboAddress("130.161.180.1"));
+ BOOST_CHECK(found);
+ BOOST_CHECK_EQUAL(found->second, 1);
+
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("130.255.255.255"))->second, 2);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("130.161.252.255"))->second, 0);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("130.161.253.255"))->second, 1);
+
+ found=nmt.lookup(ComboAddress("130.145.180.1"));
+ BOOST_CHECK(found);
+ BOOST_CHECK_EQUAL(found->second, 2);
+
+ nmt.insert(Netmask("0.0.0.0/0")).second=3;
+ BOOST_CHECK_EQUAL(nmt.size(), 4U);
+ nmt.insert(Netmask("0.0.0.0/7")).second=4;
+ BOOST_CHECK_EQUAL(nmt.size(), 5U);
+ nmt.insert(Netmask("0.0.0.0/15")).second=5;
+ BOOST_CHECK_EQUAL(nmt.size(), 6U);
+ BOOST_CHECK_EQUAL(nmt.lookup(Netmask("0.0.0.0/0"))->second, 3);
+ BOOST_CHECK_EQUAL(nmt.lookup(Netmask("0.0.0.0/7"))->second, 4);
+ BOOST_CHECK_EQUAL(nmt.lookup(Netmask("0.0.0.0/15"))->second, 5);
+
+ nmt.clear();
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ BOOST_CHECK(!nmt.lookup(ComboAddress("130.161.180.1")));
+
+ nmt.insert(Netmask("::1")).second=1;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+ nmt.insert(Netmask("::/0")).second=0;
+ BOOST_CHECK_EQUAL(nmt.size(), 2U);
+ nmt.insert(Netmask("fe80::/16")).second=2;
+ BOOST_CHECK_EQUAL(nmt.size(), 3U);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("130.161.253.255")), (void*)0);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("::2"))->second, 0);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("::ffff"))->second, 0);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("::1"))->second, 1);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("fe80::1"))->second, 2);
+}
+
+BOOST_AUTO_TEST_CASE(test_single) {
+ NetmaskTree<bool> nmt;
+ BOOST_CHECK_EQUAL(nmt.empty(), true);
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ nmt.insert(Netmask("127.0.0.0/8")).second=1;
+ BOOST_CHECK_EQUAL(nmt.empty(), false);
+ BOOST_CHECK_EQUAL(nmt.size(), 1U);
+ BOOST_CHECK_EQUAL(nmt.lookup(ComboAddress("127.0.0.1"))->second, 1);
+}
+
+BOOST_AUTO_TEST_CASE(test_scale) {
+ string start="192.168.";
+ NetmaskTree<int> works;
+ BOOST_CHECK_EQUAL(works.size(), 0U);
+ for(size_t i=0; i < 256; ++i) {
+ for(size_t j=0; j < 256; ++j) {
+ works.insert(Netmask(start+std::to_string(i)+"."+std::to_string(j))).second=i*j;
+ BOOST_CHECK_EQUAL(works.size(), i*256 + j + 1);
+ }
+ }
+
+ for(int i=0; i < 256; ++i) {
+ for(int j=0; j < 256; ++j) {
+ BOOST_CHECK_EQUAL(works.lookup(ComboAddress(start+std::to_string(i)+"."+std::to_string(j)))->second, i*j);
+ }
+ }
+
+ start="130.161.";
+ for(int i=0; i < 256; ++i) {
+ for(int j=0; j < 256; ++j) {
+ BOOST_CHECK_EQUAL(works.lookup(ComboAddress(start+std::to_string(i)+"."+std::to_string(j))), (void*)0);
+ }
+ }
+
+ start="2000:123:";
+ for(size_t i=0; i < 256; ++i) {
+ for(size_t j=0; j < 256; ++j) {
+ works.insert(Netmask(start+std::to_string(i)+":"+std::to_string(j)+"::/64")).second=i*j;
+ BOOST_CHECK_EQUAL(works.size(), (256*256) + i*256 + j + 1);
+ }
+ }
+
+ for(int i=0; i < 256; ++i) {
+ for(int j=0; j < 256; ++j) {
+ BOOST_CHECK_EQUAL(works.lookup(ComboAddress(start+std::to_string(i)+":"+std::to_string(j)+"::"+std::to_string(i)+":"+std::to_string(j)))->second, i*j);
+ }
+ }
+
+ start="2001:123:";
+ for(int i=0; i < 256; ++i) {
+ for(int j=0; j < 256; ++j) {
+ BOOST_CHECK_EQUAL(works.lookup(ComboAddress(start+std::to_string(i)+":"+std::to_string(j)+"::"+std::to_string(i)+":"+std::to_string(j))), (void*)0);
+ }
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_removal) {
+ std::string prefix = "192.";
+ NetmaskTree<int> nmt;
+ BOOST_CHECK(nmt.empty());
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+
+ size_t count = 0;
+ for(unsigned int i = 0; i < 256; ++i) {
+ for(unsigned int j = 16; j <= 32; ++j) {
+ nmt.insert(Netmask(prefix + std::to_string(i) +".127.255/"+std::to_string(j))).second = j;
+ count++;
+ BOOST_CHECK_EQUAL(nmt.size(), count);
+ }
+ }
+
+ for(unsigned int i = 0; i < 256; ++i) {
+ ComboAddress key(prefix + std::to_string(i) + ".127.255");
+ const auto result = nmt.lookup(key);
+ BOOST_CHECK_EQUAL(result->first.getBits(), 32);
+ BOOST_CHECK_EQUAL(result->first.getMaskedNetwork().toString(), key.toString());
+ BOOST_CHECK_EQUAL(result->second, 32);
+ }
+
+ for(int i = 0; i < 256; ++i) {
+ for(int j = 32; j >= 16; --j) {
+ ComboAddress key(prefix + std::to_string(i) + ".127.255");
+ nmt.erase(Netmask(key, j));
+ count--;
+ BOOST_CHECK_EQUAL(nmt.size(), count);
+ const auto result = nmt.lookup(key);
+
+ if (j > 16) {
+ BOOST_REQUIRE(result != nullptr);
+ BOOST_CHECK_EQUAL(result->first.getBits(), j-1);
+ BOOST_CHECK_EQUAL(result->first.getMaskedNetwork().toString(), Netmask(key, j-1).getMaskedNetwork().toString());
+ BOOST_CHECK_EQUAL(result->second, j - 1);
+ }
+ else {
+ BOOST_CHECK(result == nullptr);
+ }
+ }
+ }
+
+ BOOST_CHECK_EQUAL(nmt.size(), 0U);
+ BOOST_CHECK(nmt.empty());
+}
+
+BOOST_AUTO_TEST_CASE(test_iterator) {
+ NetmaskTree<int> masks_set1;
+ std::set<Netmask> masks_set2;
+
+ // create sets. the std::set entries are normalized to match internal behavior
+ // of NetmaskTree
+ for(int i=0; i < 256; ++i) {
+ std::stringstream ss;
+ Netmask mask;
+
+ ss << i << "." << i << "." << i << "." << i;
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << (255-i) << "." << (i/2) << "." << (i/3) << "." << (i/5);
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << (i/5) << "." << (i/3) << "." << (i/2) << "." << (255-i);
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << (i/2) << "." << (i/4) << "." << (255-i) << ".0/" << (i%24);
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << std::hex << "2001:" << i << i << ":" << i << i << "::/64";
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << std::hex << "2001:" << (i/5) << (i/3) << ":" << (i/2) << (255-i) << "::/64";
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << std::hex << "2001:" << (255-i) << (i/2) << ":" << (i/3) << (i/5) << "::/64";
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << std::hex << "20" << i/2 << ":" << i/3 << i/7 << "::" << i << (i > 0 ? i-1 : i + 1);
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << std::hex << "20" << i << ":" << i << i << "::/" << std::dec << (i%48);
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+ }
+ for(int i=0; i <= 32; ++i) {
+ std::stringstream ss;
+ Netmask mask;
+
+ ss << "85.85.85.85/" << i;
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << "170.170.170.170/" << i;
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+ }
+ for(int i=0; i <= 128; ++i) {
+ std::stringstream ss;
+ Netmask mask;
+
+ ss << "5555:5555:5555:5555:5555:5555:5555:5555/" << i;
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+
+ ss.str("");
+ ss << "aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa/" << i;
+ mask = Netmask(ss.str());
+ masks_set1.insert(mask).second=i;
+ masks_set2.insert(mask.getNormalized());
+ }
+
+
+ // check set equality using iterators
+ BOOST_CHECK_EQUAL(masks_set1.size(), masks_set2.size());
+ BOOST_CHECK_EQUAL((size_t)std::distance(masks_set1.begin(), masks_set1.end()),
+ (size_t)std::distance(masks_set2.begin(), masks_set2.end()));
+ for (auto entry: masks_set1) {
+ Netmask mask = entry.first.getNormalized();
+
+ BOOST_CHECK(masks_set2.find(mask) != masks_set2.end());
+ }
+ for (const Netmask& mask: masks_set2) {
+ BOOST_CHECK(masks_set1.lookup(mask) != nullptr);
+ }
+
+ // create a copy of the NetmaskTree (check copy by assignment)
+ NetmaskTree<int> masks_set1_cp1 = masks_set1;
+
+ // taint the old version
+ masks_set1.insert("1.2.3.4");
+ masks_set1.erase("1.1.1.1");
+
+ // check set equality using iterators
+ BOOST_CHECK_EQUAL(masks_set1_cp1.size(), masks_set2.size());
+ BOOST_CHECK_EQUAL((size_t)std::distance(masks_set1_cp1.begin(), masks_set1_cp1.end()),
+ (size_t)std::distance(masks_set2.begin(), masks_set2.end()));
+ for (auto entry: masks_set1_cp1) {
+ Netmask mask = entry.first.getNormalized();
+
+ BOOST_CHECK(masks_set2.find(mask) != masks_set2.end());
+ }
+ for (const Netmask& mask: masks_set2) {
+ BOOST_CHECK(masks_set1_cp1.lookup(mask) != nullptr);
+ }
+
+ // create a copy of the NetmaskTree (check copy constructor)
+ NetmaskTree<int> masks_set1_cp2(masks_set1_cp1);
+
+ // taint the old version
+ masks_set1_cp1.insert("2.3.4.5");
+ masks_set1_cp1.erase("2.2.2.2");
+
+ // check set equality using iterators
+ BOOST_CHECK_EQUAL(masks_set1_cp2.size(), masks_set2.size());
+ BOOST_CHECK_EQUAL((size_t)std::distance(masks_set1_cp2.begin(), masks_set1_cp2.end()),
+ (size_t)std::distance(masks_set2.begin(), masks_set2.end()));
+ for (auto entry: masks_set1_cp2) {
+ Netmask mask = entry.first.getNormalized();
+
+ BOOST_CHECK(masks_set2.find(mask) != masks_set2.end());
+ }
+ for (const Netmask& mask: masks_set2) {
+ BOOST_CHECK(masks_set1_cp2.lookup(mask) != nullptr);
+ }
+
+ // swap contents of the NetmaskTree
+ NetmaskTree<int> masks_set1_cp3;
+ masks_set1_cp3.swap(masks_set1_cp2);
+
+ // taint the old version
+ masks_set1_cp2.insert("3.4.5.6");
+ masks_set1_cp2.erase("3.3.3.3");
+
+ // check set equality using iterators
+ BOOST_CHECK_EQUAL(masks_set1_cp3.size(), masks_set2.size());
+ BOOST_CHECK_EQUAL((size_t)std::distance(masks_set1_cp3.begin(), masks_set1_cp3.end()),
+ (size_t)std::distance(masks_set2.begin(), masks_set2.end()));
+ for (auto entry: masks_set1_cp3) {
+ Netmask mask = entry.first.getNormalized();
+
+ BOOST_CHECK(masks_set2.find(mask) != masks_set2.end());
+ }
+ for (const Netmask& mask: masks_set2) {
+ BOOST_CHECK(masks_set1_cp3.lookup(mask) != nullptr);
+ }
+
+ // copy contents to an std::set
+ std::set<NetmaskTree<int>::node_type> masks_set1_cp4(masks_set1_cp3.begin(), masks_set1_cp3.end());
+
+ // check set equality
+ BOOST_CHECK_EQUAL(masks_set1_cp4.size(), masks_set2.size());
+ for (auto entry: masks_set1_cp4) {
+ Netmask mask = entry.first.getNormalized();
+
+ BOOST_CHECK(masks_set2.find(mask) != masks_set2.end());
+ }
+ for (const Netmask& mask: masks_set2) {
+ Netmask maskl = mask.getNormalized();
+ bool found = false;
+ for (auto entry: masks_set1_cp4) {
+ Netmask maskr = entry.first.getNormalized();
+
+ if (maskl == maskr)
+ found = true;
+ }
+ BOOST_CHECK(found);
+ }
+
+ // create a copy of the NetmaskTree
+ NetmaskTree<int> masks_set1_cp5(masks_set1_cp3);
+
+ // erase select values
+ {
+ Netmask mask;
+
+ mask = Netmask("16.16.16.16");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("223.16.10.6");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("12.21.32.191");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("64.32.127.0/8");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("2001:ffff:ffff::/64");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("2001:192a:407f::/64");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("2001:bf20:15c::/64");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("2010:a4::201f");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("2010:1010::/16");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("85.85.85.85");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("170.170.170.170");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("5555:5555:5555:5555:5555:5555:5555:5555");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+
+ mask = Netmask("aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa");
+ masks_set1_cp5.erase(mask);
+ masks_set2.erase(mask.getNormalized());
+ }
+
+ // check set equality using iterators
+ BOOST_CHECK_EQUAL(masks_set1_cp5.size(), masks_set2.size());
+ BOOST_CHECK_EQUAL((size_t)std::distance(masks_set1_cp5.begin(), masks_set1_cp5.end()),
+ (size_t)std::distance(masks_set2.begin(), masks_set2.end()));
+ for (auto entry: masks_set1_cp5) {
+ Netmask mask = entry.first.getNormalized();
+
+ BOOST_CHECK(masks_set2.find(mask) != masks_set2.end());
+ }
+ for (const Netmask& mask: masks_set2) {
+ BOOST_CHECK(masks_set1_cp5.lookup(mask) != nullptr);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_ComboAddress_caContainerToString) {
+ ComboAddress ca1("192.0.2.1:53");
+ ComboAddress ca2("192.0.2.2:5300");
+ ComboAddress ca3("[2001:db8:53::3]:53");
+ ComboAddress ca4("[2001:db8:53::4]:5300");
+
+ set<ComboAddress> caSet({ca1, ca2, ca3, ca4});
+ vector<ComboAddress> caVector({ca1, ca2, ca3, ca4});
+
+ string caSetStr = ComboAddress::caContainerToString(caSet, false);
+ string caVectorStr = ComboAddress::caContainerToString(caVector, false);
+ BOOST_CHECK_EQUAL(caSetStr, "192.0.2.1,192.0.2.2,2001:db8:53::3,2001:db8:53::4");
+ BOOST_CHECK_EQUAL(caVectorStr, "192.0.2.1,192.0.2.2,2001:db8:53::3,2001:db8:53::4");
+
+ caSetStr = ComboAddress::caContainerToString(caSet, true);
+ caVectorStr = ComboAddress::caContainerToString(caVector, true);
+ BOOST_CHECK_EQUAL(caSetStr, "192.0.2.1,192.0.2.2:5300,2001:db8:53::3,[2001:db8:53::4]:5300");
+ BOOST_CHECK_EQUAL(caVectorStr, "192.0.2.1,192.0.2.2:5300,2001:db8:53::3,[2001:db8:53::4]:5300");
+
+ caSetStr = ComboAddress::caContainerToString(caSet, true, 0);
+ caVectorStr = ComboAddress::caContainerToString(caVector, true, 0);
+ BOOST_CHECK_EQUAL(caSetStr, "192.0.2.1:53,192.0.2.2:5300,[2001:db8:53::3]:53,[2001:db8:53::4]:5300");
+ BOOST_CHECK_EQUAL(caVectorStr, "192.0.2.1:53,192.0.2.2:5300,[2001:db8:53::3]:53,[2001:db8:53::4]:5300");
+}
+
+BOOST_AUTO_TEST_CASE(test_parseIPAndPort)
+{
+ struct {
+ std::string str;
+ uint16_t port;
+ std::string result;
+ bool ex;
+ } tests[] = {
+ { "", 0, "", true },
+ { "1.2.3.a", 53, "", true },
+ { "1::g3", 99, "", true },
+ { "1.2.3.4", 0, "1.2.3.4:0", false },
+ { "1.2.3.4", 999, "1.2.3.4:999", false },
+ { "1::", 999, "[1::]:999", false },
+ { "1::33:99", 0, "[1::33:99]", false },
+ { "[1::33]:99", 0, "[1::33]:99", false },
+ { "1:33::99", 0, "1:33::99", false },
+ { "[1:33::]:99", 0, "[1:33::]:99", false },
+ { "2003:1234::f561", 53, "[2003:1234::f561]:53", false },
+ { "2003:1234::f561:53", 54, "[2003:1234::f561:53]:54", false },
+ };
+
+ for (const auto& t : tests) {
+ if (t.ex) {
+ BOOST_CHECK_THROW(parseIPAndPort(t.str, t.port), PDNSException);
+ } else {
+ ComboAddress a = parseIPAndPort(t.str, t.port);
+ BOOST_CHECK_EQUAL(a.toStringWithPort(), ComboAddress(t.result).toStringWithPort());
+ }
+ }
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-luawrapper.cc b/test-luawrapper.cc
new file mode 100644
index 0000000..1004790
--- /dev/null
+++ b/test-luawrapper.cc
@@ -0,0 +1,33 @@
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <boost/test/unit_test.hpp>
+#include "ext/luawrapper/include/LuaContext.hpp"
+
+BOOST_AUTO_TEST_SUITE(test_lua_lightuserdata)
+
+BOOST_AUTO_TEST_CASE(test_registerFunction)
+{
+ // This test comes from luawrapper/tests/custom_types.cc, TEST(CustomTypes, MemberFunctions).
+ // In some versions of luajit, as shipped by Debian Buster and others, Lua lightuserdata
+ // objects can only hold 47 bits of the address of a pointer. If the kernel puts our heap
+ // above that 47 bit limit, this test crashes. Many arm64 Linux kernels are known to put
+ // the heap in that problematic area.
+ struct Object
+ {
+ void increment() { ++value; }
+ int value;
+ };
+
+ LuaContext context;
+ context.registerFunction("increment", &Object::increment);
+
+ context.writeVariable("obj", Object{10});
+ context.executeCode("obj:increment()");
+
+ BOOST_CHECK_EQUAL(11, context.readVariable<Object>("obj").value);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-mplexer.cc b/test-mplexer.cc
new file mode 100644
index 0000000..7fe483d
--- /dev/null
+++ b/test-mplexer.cc
@@ -0,0 +1,401 @@
+
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+
+#include <thread>
+#include <boost/test/unit_test.hpp>
+
+#include "mplexer.hh"
+#include "misc.hh"
+
+BOOST_AUTO_TEST_SUITE(mplexer)
+
+BOOST_AUTO_TEST_CASE(test_getMultiplexerSilent)
+{
+ auto mplexer = std::unique_ptr<FDMultiplexer>(FDMultiplexer::getMultiplexerSilent());
+ BOOST_REQUIRE(mplexer != nullptr);
+
+ struct timeval now = {0, 0};
+ int ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 0);
+ BOOST_CHECK(now.tv_sec != 0);
+}
+
+BOOST_AUTO_TEST_CASE(test_MPlexer)
+{
+ for (const auto& entry : FDMultiplexer::getMultiplexerMap()) {
+ auto mplexer = std::unique_ptr<FDMultiplexer>(entry.second());
+ BOOST_REQUIRE(mplexer != nullptr);
+ //cerr<<"Testing multiplexer "<<mplexer->getName()<<endl;
+
+ struct timeval now = {0, 0};
+ int ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 0);
+ BOOST_CHECK(now.tv_sec != 0);
+
+ std::vector<int> readyFDs;
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_CHECK_EQUAL(readyFDs.size(), 0U);
+
+ auto timeouts = mplexer->getTimeouts(now);
+ BOOST_CHECK_EQUAL(timeouts.size(), 0U);
+
+ int pipes[2];
+ int res = pipe(pipes);
+ BOOST_REQUIRE_EQUAL(res, 0);
+ BOOST_REQUIRE_EQUAL(setNonBlocking(pipes[0]), true);
+ BOOST_REQUIRE_EQUAL(setNonBlocking(pipes[1]), true);
+
+ /* let's declare a TTD that expired 5s ago */
+ struct timeval ttd = now;
+ ttd.tv_sec -= 5;
+
+ bool writeCBCalled = false;
+ auto writeCB = [](int fd, FDMultiplexer::funcparam_t& param) {
+ auto calledPtr = boost::any_cast<bool*>(param);
+ BOOST_REQUIRE(calledPtr != nullptr);
+ *calledPtr = true;
+ };
+ mplexer->addWriteFD(pipes[1],
+ writeCB,
+ &writeCBCalled,
+ &ttd);
+ /* we can't add it twice */
+ BOOST_CHECK_THROW(mplexer->addWriteFD(pipes[1],
+ writeCB,
+ &writeCBCalled,
+ &ttd),
+ FDMultiplexerException);
+
+ readyFDs.clear();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_REQUIRE_EQUAL(readyFDs.size(), 1U);
+ BOOST_CHECK_EQUAL(readyFDs.at(0), pipes[1]);
+
+ ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 1);
+ BOOST_CHECK_EQUAL(writeCBCalled, true);
+
+ /* no read timeouts */
+ timeouts = mplexer->getTimeouts(now, false);
+ BOOST_CHECK_EQUAL(timeouts.size(), 0U);
+ /* but we should have a write one */
+ timeouts = mplexer->getTimeouts(now, true);
+ BOOST_REQUIRE_EQUAL(timeouts.size(), 1U);
+ BOOST_CHECK_EQUAL(timeouts.at(0).first, pipes[1]);
+
+ /* can't remove from the wrong type of FD */
+ BOOST_CHECK_THROW(mplexer->removeReadFD(pipes[1]), FDMultiplexerException);
+ mplexer->removeWriteFD(pipes[1]);
+ /* can't remove a non-existing FD */
+ BOOST_CHECK_THROW(mplexer->removeWriteFD(pipes[0]), FDMultiplexerException);
+ BOOST_CHECK_THROW(mplexer->removeWriteFD(pipes[1]), FDMultiplexerException);
+
+ readyFDs.clear();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_REQUIRE_EQUAL(readyFDs.size(), 0U);
+
+ ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 0);
+
+ bool readCBCalled = false;
+ auto readCB = [](int fd, FDMultiplexer::funcparam_t& param) {
+ auto calledPtr = boost::any_cast<bool*>(param);
+ BOOST_REQUIRE(calledPtr != nullptr);
+ *calledPtr = true;
+ };
+ mplexer->addReadFD(pipes[0],
+ readCB,
+ &readCBCalled,
+ &ttd);
+
+ /* not ready for reading yet */
+ readyFDs.clear();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_REQUIRE_EQUAL(readyFDs.size(), 0U);
+
+ ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 0);
+ BOOST_CHECK_EQUAL(readCBCalled, false);
+
+ /* let's make the pipe readable */
+ BOOST_REQUIRE_EQUAL(write(pipes[1], "0", 1), 1);
+
+ readyFDs.clear();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_REQUIRE_EQUAL(readyFDs.size(), 1U);
+ BOOST_CHECK_EQUAL(readyFDs.at(0), pipes[0]);
+
+ ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 1);
+ BOOST_CHECK_EQUAL(readCBCalled, true);
+
+ /* add back the write FD */
+ mplexer->addWriteFD(pipes[1],
+ writeCB,
+ &writeCBCalled,
+ &ttd);
+
+ /* both should be available */
+ readCBCalled = false;
+ writeCBCalled = false;
+ readyFDs.clear();
+
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_REQUIRE_GT(readyFDs.size(), 0U);
+ if (readyFDs.size() == 2) {
+ ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 2);
+ }
+ else if (readyFDs.size() == 1) {
+ /* under high pressure (lots of existing pipes on the system, for example,
+ the pipe might only have room for one 'buffer' and will not be writable
+ after our write of 1 byte, we need to read it so that the pipe becomes
+ writable again */
+ /* make sure the pipe is readable, otherwise something is off */
+ BOOST_REQUIRE_EQUAL(readyFDs.at(0), pipes[0]);
+ ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 1);
+ BOOST_CHECK_EQUAL(readCBCalled, true);
+ BOOST_CHECK_EQUAL(writeCBCalled, false);
+ char buffer[1];
+ ssize_t got = read(pipes[0], &buffer[0], sizeof(buffer));
+ BOOST_CHECK_EQUAL(got, 1U);
+
+ /* ok, the pipe should be writable now, but not readable */
+ readyFDs.clear();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_CHECK_EQUAL(readyFDs.size(), 1U);
+ BOOST_REQUIRE_EQUAL(readyFDs.at(0), pipes[1]);
+
+ ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 1);
+ }
+
+ BOOST_CHECK_EQUAL(readCBCalled, true);
+ BOOST_CHECK_EQUAL(writeCBCalled, true);
+
+ /* both the read and write FD should be reported */
+ timeouts = mplexer->getTimeouts(now, false);
+ BOOST_REQUIRE_EQUAL(timeouts.size(), 1U);
+ BOOST_CHECK_EQUAL(timeouts.at(0).first, pipes[0]);
+ timeouts = mplexer->getTimeouts(now, true);
+ BOOST_REQUIRE_EQUAL(timeouts.size(), 1U);
+ BOOST_CHECK_EQUAL(timeouts.at(0).first, pipes[1]);
+
+ struct timeval past = ttd;
+ /* so five seconds before the actual TTD */
+ past.tv_sec -= 5;
+
+ /* no read timeouts */
+ timeouts = mplexer->getTimeouts(past, false);
+ BOOST_CHECK_EQUAL(timeouts.size(), 0U);
+ /* and we should not have a write one either */
+ timeouts = mplexer->getTimeouts(past, true);
+ BOOST_CHECK_EQUAL(timeouts.size(), 0U);
+
+ /* update the timeouts to now, they should not be reported anymore */
+ mplexer->setReadTTD(pipes[0], now, 0);
+ mplexer->setWriteTTD(pipes[1], now, 0);
+ timeouts = mplexer->getTimeouts(now, false);
+ BOOST_REQUIRE_EQUAL(timeouts.size(), 0U);
+ timeouts = mplexer->getTimeouts(now, true);
+ BOOST_REQUIRE_EQUAL(timeouts.size(), 0U);
+
+ /* put it back into the past */
+ mplexer->setReadTTD(pipes[0], now, -5);
+ mplexer->setWriteTTD(pipes[1], now, -5);
+ timeouts = mplexer->getTimeouts(now, false);
+ BOOST_REQUIRE_EQUAL(timeouts.size(), 1U);
+ BOOST_CHECK_EQUAL(timeouts.at(0).first, pipes[0]);
+ timeouts = mplexer->getTimeouts(now, true);
+ BOOST_REQUIRE_EQUAL(timeouts.size(), 1U);
+ BOOST_CHECK_EQUAL(timeouts.at(0).first, pipes[1]);
+
+ mplexer->removeReadFD(pipes[0]);
+ mplexer->removeWriteFD(pipes[1]);
+
+ /* clean up */
+ close(pipes[0]);
+ close(pipes[1]);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_MPlexer_ReadAndWrite)
+{
+ for (const auto& entry : FDMultiplexer::getMultiplexerMap()) {
+ auto mplexer = std::unique_ptr<FDMultiplexer>(entry.second());
+ BOOST_REQUIRE(mplexer != nullptr);
+ //cerr<<"Testing multiplexer "<<mplexer->getName()<<" for read AND write"<<endl;
+
+ int sockets[2];
+ int res = socketpair(AF_UNIX, SOCK_STREAM, 0, sockets);
+ BOOST_REQUIRE_EQUAL(res, 0);
+ BOOST_REQUIRE_EQUAL(setNonBlocking(sockets[0]), true);
+ BOOST_REQUIRE_EQUAL(setNonBlocking(sockets[1]), true);
+
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ std::vector<int> readyFDs;
+ struct timeval ttd = now;
+ ttd.tv_sec += 5;
+
+ bool readCBCalled = false;
+ bool writeCBCalled = false;
+ auto readCB = [](int fd, FDMultiplexer::funcparam_t& param) {
+ auto calledPtr = boost::any_cast<bool*>(param);
+ BOOST_REQUIRE(calledPtr != nullptr);
+ *calledPtr = true;
+ };
+ auto writeCB = [](int fd, FDMultiplexer::funcparam_t& param) {
+ auto calledPtr = boost::any_cast<bool*>(param);
+ BOOST_REQUIRE(calledPtr != nullptr);
+ *calledPtr = true;
+ };
+ mplexer->addReadFD(sockets[0],
+ readCB,
+ &readCBCalled,
+ &ttd);
+ mplexer->addWriteFD(sockets[0],
+ writeCB,
+ &writeCBCalled,
+ &ttd);
+
+ /* not ready for reading yet, but should be writable */
+ readyFDs.clear();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_REQUIRE_EQUAL(readyFDs.size(), 1U);
+ BOOST_CHECK_EQUAL(readyFDs.at(0), sockets[0]);
+
+ /* let's make the socket readable */
+ BOOST_REQUIRE_EQUAL(write(sockets[1], "0", 1), 1);
+
+ readyFDs.clear();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_REQUIRE_EQUAL(readyFDs.size(), 1U);
+ BOOST_CHECK_EQUAL(readyFDs.at(0), sockets[0]);
+
+ auto ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 2);
+ BOOST_CHECK_EQUAL(readCBCalled, true);
+ BOOST_CHECK_EQUAL(writeCBCalled, true);
+
+ /* check that the write cb remains when we remove the read one */
+ mplexer->removeReadFD(sockets[0]);
+
+ readCBCalled = false;
+ writeCBCalled = false;
+ readyFDs.clear();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ BOOST_REQUIRE_EQUAL(readyFDs.size(), 1U);
+ BOOST_CHECK_EQUAL(readyFDs.at(0), sockets[0]);
+ ready = mplexer->run(&now, 100);
+ BOOST_CHECK_EQUAL(ready, 1);
+ BOOST_CHECK_EQUAL(readCBCalled, false);
+ BOOST_CHECK_EQUAL(writeCBCalled, true);
+
+ mplexer->removeWriteFD(sockets[0]);
+
+ /* clean up */
+ close(sockets[0]);
+ close(sockets[1]);
+ }
+}
+
+#if 0
+BOOST_AUTO_TEST_CASE(test_MPlexer_Bench)
+{
+ const size_t count = 10000;
+ struct socket_pair
+ {
+ int sockets[2];
+ };
+
+ std::vector<socket_pair> pairs(count);
+ auto readCB = [](int fd, FDMultiplexer::funcparam_t& param) {
+ auto calledPtr = boost::any_cast<bool*>(param);
+ *calledPtr = true;
+ };
+ auto writeCB = [](int fd, FDMultiplexer::funcparam_t& param) {
+ auto calledPtr = boost::any_cast<bool*>(param);
+ *calledPtr = true;
+ };
+ bool readCBCalled = false;
+ bool writeCBCalled = false;
+ struct timeval now;
+ gettimeofday(&now, nullptr);
+ struct timeval ttd = now;
+ ttd.tv_sec += 3600;
+ DTime dt;
+ std::vector<int> readyFDs;
+ readyFDs.reserve(count * 2);
+
+ for (const auto& entry : FDMultiplexer::getMultiplexerMap()) {
+ auto mplexer = std::unique_ptr<FDMultiplexer>(entry.second());
+ BOOST_REQUIRE(mplexer != nullptr);
+ cerr<<"Testing multiplexer "<<mplexer->getName()<<" performances"<<endl;
+
+ for (auto& pair : pairs) {
+ int res = socketpair(AF_UNIX, SOCK_STREAM, 0, pair.sockets);
+ BOOST_REQUIRE_EQUAL(res, 0);
+ BOOST_REQUIRE_EQUAL(setNonBlocking(pair.sockets[0]), true);
+ BOOST_REQUIRE_EQUAL(setNonBlocking(pair.sockets[1]), true);
+ }
+
+ dt.set();
+ for (auto& pair : pairs) {
+ mplexer->addReadFD(pair.sockets[0],
+ readCB,
+ &readCBCalled,
+ &ttd);
+ mplexer->addWriteFD(pair.sockets[0],
+ writeCB,
+ &writeCBCalled,
+ &ttd);
+ }
+ cerr<<"Adding "<<(count*2)<<" events took "<<dt.udiff()<<endl;
+
+ readyFDs.clear();
+ dt.set();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ cerr<<"Checking readiness for "<<(count*2)<<" events ("<<readyFDs.size()<<" ready) took "<<dt.udiff()<<endl;
+
+ dt.set();
+ auto ready = mplexer->run(&now, 100);
+ cerr<<"Calling run() for "<<(count*2)<<" events ("<<ready<<" ready) took "<<dt.udiff()<<endl;
+
+ dt.set();
+ for (auto& pair : pairs) {
+ //mplexer->removeReadFD(pair.sockets[0]);
+ mplexer->removeWriteFD(pair.sockets[0]);
+ }
+ cerr<<"Removing "<<(count)<<" events took "<<dt.udiff()<<endl;
+
+ // mark one fd readable
+ (void) write(pairs.at(pairs.size()-1).sockets[1], &ttd, sizeof(ttd));
+
+ readyFDs.clear();
+ dt.set();
+ mplexer->getAvailableFDs(readyFDs, 0);
+ cerr<<"Checking readiness for "<<(count)<<" events ("<<readyFDs.size()<<" ready) took "<<dt.udiff()<<endl;
+
+ dt.set();
+ ready = mplexer->run(&now, 100);
+ cerr<<"Calling run() for "<<(count)<<" events ("<<ready<<" ready) took "<<dt.udiff()<<endl;
+
+ dt.set();
+ for (auto& pair : pairs) {
+ mplexer->removeReadFD(pair.sockets[0]);
+ }
+ cerr<<"Removing "<<(count)<<" events took "<<dt.udiff()<<endl;
+
+ for (auto& pair : pairs) {
+ /* clean up */
+ close(pair.sockets[0]);
+ close(pair.sockets[1]);
+ }
+ }
+}
+#endif
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/test-proxy_protocol_cc.cc b/test-proxy_protocol_cc.cc
new file mode 100644
index 0000000..e61f978
--- /dev/null
+++ b/test-proxy_protocol_cc.cc
@@ -0,0 +1,227 @@
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_NO_MAIN
+#include <boost/test/unit_test.hpp>
+
+#include "iputils.hh"
+#include "proxy-protocol.hh"
+
+using namespace boost;
+using std::string;
+
+
+BOOST_AUTO_TEST_SUITE(test_proxy_protocol_cc)
+
+#define BINARY(s) (std::string(s, sizeof(s) - 1))
+
+#define PROXYMAGIC "\x0D\x0A\x0D\x0A\x00\x0D\x0A\x51\x55\x49\x54\x0A"
+#define PROXYMAGICLEN sizeof(PROXYMAGIC)-1
+
+static string proxymagic(PROXYMAGIC, PROXYMAGICLEN);
+
+BOOST_AUTO_TEST_CASE(test_roundtrip) {
+ std::vector<ProxyProtocolValue> values;
+ string proxyheader;
+
+ bool ptcp = true;
+ ComboAddress src("65.66.67.68:18762"); // 18762 = 0x494a = "IJ"
+ ComboAddress dest("69.70.71.72:19276"); // 19276 = 0x4b4c = "KL"
+ proxyheader = makeProxyHeader(ptcp, src, dest, values);
+
+ BOOST_CHECK_EQUAL(proxyheader, BINARY(
+ PROXYMAGIC
+ "\x21" // version | command
+ "\x11" // ipv4=0x10 | TCP=0x1
+ "\x00\x0c" // 4 bytes IPv4 * 2 + 2 port numbers = 8 + 2 * 2 =12 = 0xc
+ "ABCD" // 65.66.67.68
+ "EFGH" // 69.70.71.72
+ "IJ" // src port
+ "KL" // dst port
+ ));
+
+ bool proxy;
+ bool ptcp2;
+ ComboAddress src2, dest2;
+
+ BOOST_CHECK_EQUAL(parseProxyHeader(proxyheader, proxy, src2, dest2, ptcp2, values), 28);
+
+ BOOST_CHECK_EQUAL(proxy, true);
+ BOOST_CHECK_EQUAL(ptcp2, true);
+ BOOST_CHECK(src2 == src);
+ BOOST_CHECK(dest2 == dest);
+}
+
+BOOST_AUTO_TEST_CASE(test_local_proxy_header) {
+ auto payload = makeLocalProxyHeader();
+
+ BOOST_CHECK_EQUAL(payload, BINARY(
+ PROXYMAGIC
+ "\x20" // version | command
+ "\x00" // protocol family and address are set to 0
+ "\x00\x00" // no content
+ ));
+
+ bool proxy;
+ bool tcp = false;
+ ComboAddress src, dest;
+ std::vector<ProxyProtocolValue> values;
+
+ BOOST_CHECK_EQUAL(parseProxyHeader(payload, proxy, src, dest, tcp, values), 16);
+
+ BOOST_CHECK_EQUAL(proxy, false);
+ BOOST_CHECK_EQUAL(tcp, false);
+ BOOST_CHECK_EQUAL(values.size(), 0U);
+}
+
+BOOST_AUTO_TEST_CASE(test_tlv_values_content_len_signedness) {
+ std::string largeValue;
+ /* this value will make the content length parsing fail in case of signedness mistake */
+ largeValue.resize(65128, 'A');
+ const std::vector<ProxyProtocolValue> values = { { "foo", 0 }, { largeValue, 255 }};
+
+ const bool tcp = false;
+ const ComboAddress src("[2001:db8::1]:0");
+ const ComboAddress dest("[::1]:65535");
+ const auto payload = makeProxyHeader(tcp, src, dest, values);
+
+ bool proxy;
+ bool tcp2;
+ ComboAddress src2;
+ ComboAddress dest2;
+ std::vector<ProxyProtocolValue> parsedValues;
+
+ BOOST_CHECK_EQUAL(parseProxyHeader(payload, proxy, src2, dest2, tcp2, parsedValues), 16 + 36 + 6 + 65131);
+ BOOST_CHECK_EQUAL(proxy, true);
+ BOOST_CHECK_EQUAL(tcp2, tcp);
+ BOOST_CHECK(src2 == src);
+ BOOST_CHECK(dest2 == dest);
+ BOOST_REQUIRE_EQUAL(parsedValues.size(), values.size());
+ for (size_t idx = 0; idx < values.size(); idx++) {
+ BOOST_CHECK_EQUAL(parsedValues.at(idx).type, values.at(idx).type);
+ BOOST_CHECK_EQUAL(parsedValues.at(idx).content, values.at(idx).content);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_tlv_values_length_signedness) {
+ std::string largeValue;
+ /* this value will make the TLV length parsing fail in case of signedness mistake */
+ largeValue.resize(65000, 'A');
+ const std::vector<ProxyProtocolValue> values = { { "foo", 0 }, { largeValue, 255 }};
+
+ const bool tcp = false;
+ const ComboAddress src("[2001:db8::1]:0");
+ const ComboAddress dest("[::1]:65535");
+ const auto payload = makeProxyHeader(tcp, src, dest, values);
+
+ bool proxy;
+ bool tcp2;
+ ComboAddress src2;
+ ComboAddress dest2;
+ std::vector<ProxyProtocolValue> parsedValues;
+
+ BOOST_CHECK_EQUAL(parseProxyHeader(payload, proxy, src2, dest2, tcp2, parsedValues), 16 + 36 + 6 + 65003);
+ BOOST_CHECK_EQUAL(proxy, true);
+ BOOST_CHECK_EQUAL(tcp2, tcp);
+ BOOST_CHECK(src2 == src);
+ BOOST_CHECK(dest2 == dest);
+ BOOST_REQUIRE_EQUAL(parsedValues.size(), values.size());
+ for (size_t idx = 0; idx < values.size(); idx++) {
+ BOOST_CHECK_EQUAL(parsedValues.at(idx).type, values.at(idx).type);
+ BOOST_CHECK_EQUAL(parsedValues.at(idx).content, values.at(idx).content);
+ }
+}
+
+BOOST_AUTO_TEST_CASE(test_parsing_invalid_headers) {
+ const std::vector<ProxyProtocolValue> noValues;
+
+ const bool tcp = false;
+ const ComboAddress src("[2001:db8::1]:0");
+ const ComboAddress dest("[::1]:65535");
+ const auto payload = makeProxyHeader(tcp, src, dest, noValues);
+
+ bool proxy;
+ bool tcp2;
+ ComboAddress src2;
+ ComboAddress dest2;
+ std::vector<ProxyProtocolValue> values;
+
+ {
+ /* just checking that everything works */
+ BOOST_CHECK_EQUAL(parseProxyHeader(payload, proxy, src2, dest2, tcp2, values), 52);
+ BOOST_CHECK_EQUAL(proxy, true);
+ BOOST_CHECK_EQUAL(tcp2, tcp);
+ BOOST_CHECK(src2 == src);
+ BOOST_CHECK(dest2 == dest);
+ BOOST_CHECK_EQUAL(values.size(), 0U);
+ }
+
+ {
+ /* too short (not even full header) */
+ std::string truncated = payload;
+ truncated.resize(15);
+ BOOST_CHECK_EQUAL(parseProxyHeader(truncated, proxy, src2, dest2, tcp2, values), -1);
+ }
+
+ {
+ /* too short (missing address part) */
+ std::string truncated = payload;
+ truncated.resize(/* full header */ 16 + /* two IPv6s + port */ 36 - /* truncation */ 1);
+ BOOST_CHECK_EQUAL(parseProxyHeader(truncated, proxy, src2, dest2, tcp2, values), -1);
+ }
+
+ {
+ /* too short (missing TLV) */
+ values = { { "foo", 0 }, { "bar", 255 }} ;
+ const auto payloadWithValues = makeProxyHeader(tcp, src, dest, values);
+
+ std::string truncated = payloadWithValues;
+ truncated.resize(/* full header */ 16 + /* two IPv6s + port */ 36 + /* TLV 1 */ 6 + /* TLV 2 */ 6 - /* truncation */ 2);
+ BOOST_CHECK_EQUAL(parseProxyHeader(truncated, proxy, src2, dest2, tcp2, values), -2);
+ }
+
+ {
+ /* invalid magic */
+ std::string invalid = payload;
+ invalid.at(4) = 42;
+ BOOST_CHECK_EQUAL(parseProxyHeader(invalid, proxy, src2, dest2, tcp2, values), 0);
+ }
+
+ {
+ /* invalid version */
+ std::string invalid = payload;
+ invalid.at(12) = 0x10 | 0x01;
+ BOOST_CHECK_EQUAL(parseProxyHeader(invalid, proxy, src2, dest2, tcp2, values), 0);
+ }
+
+ {
+ /* invalid command */
+ std::string invalid = payload;
+ invalid.at(12) = 0x20 | 0x02;
+ BOOST_CHECK_EQUAL(parseProxyHeader(invalid, proxy, src2, dest2, tcp2, values), 0);
+ }
+
+ {
+ /* invalid family */
+ std::string invalid = payload;
+ invalid.at(13) = (0x04 << 4) | 0x01 /* STREAM */;
+ BOOST_CHECK_EQUAL(parseProxyHeader(invalid, proxy, src2, dest2, tcp2, values), 0);
+ }
+
+ {
+ /* invalid address */
+ std::string invalid = payload;
+ invalid.at(13) = (0x02 /* AF_INET */ << 4) | 0x03;
+ BOOST_CHECK_EQUAL(parseProxyHeader(invalid, proxy, src2, dest2, tcp2, values), 0);
+ }
+
+ {
+ /* TLV advertised len gets out of bounds */
+ values = { { "foo", 0 }, { "bar", 255 }} ;
+ const auto payloadWithValues = makeProxyHeader(tcp, src, dest, values);
+ std::string invalid = payloadWithValues;
+ /* full header (16) + two IPv6s + port (36) + TLV (6) TLV 2 (6) */
+ invalid.at(59) += 1;
+ BOOST_CHECK_EQUAL(parseProxyHeader(invalid, proxy, src2, dest2, tcp2, values), 0);
+ }
+}
+
+BOOST_AUTO_TEST_SUITE_END()
diff --git a/testrunner.cc b/testrunner.cc
new file mode 100644
index 0000000..b6a6852
--- /dev/null
+++ b/testrunner.cc
@@ -0,0 +1,31 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#define BOOST_TEST_DYN_LINK
+#define BOOST_TEST_MAIN
+#define BOOST_TEST_MODULE unit
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include <boost/test/unit_test.hpp>
+
+
diff --git a/threadname.cc b/threadname.cc
new file mode 100644
index 0000000..249248a
--- /dev/null
+++ b/threadname.cc
@@ -0,0 +1,69 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#include <string.h>
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <pthread.h>
+
+#if HAVE_PTHREAD_NP_H
+#include <pthread_np.h>
+#endif
+
+#ifdef DNSDIST
+#include "dolog.hh"
+#else
+#include "logger.hh"
+#endif
+
+#include "threadname.hh"
+
+void setThreadName(const std::string& threadName) {
+ int retval = 0;
+
+#ifdef HAVE_PTHREAD_SETNAME_NP_2
+ retval = pthread_setname_np(pthread_self(), threadName.c_str());
+#endif
+#ifdef HAVE_PTHREAD_SET_NAME_NP_2
+ retval = pthread_set_name_np(pthread_self(), threadName.c_str());
+#endif
+#ifdef HAVE_PTHREAD_SET_NAME_NP_2_VOID
+ pthread_set_name_np(pthread_self(), threadName.c_str());
+#endif
+#ifdef HAVE_PTHREAD_SETNAME_NP_1
+ retval = pthread_setname_np(threadName.c_str());
+#endif
+#ifdef HAVE_PTHREAD_SETNAME_NP_3
+ retval = pthread_setname_np(pthread_self(), threadName.c_str(), nullptr);
+#endif
+
+ if (retval != 0) {
+#ifdef DNSDIST
+ warnlog("Could not set thread name %s for thread: %s", threadName, strerror(retval));
+#else
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for thread: "<<strerror(retval)<<endl;
+#endif
+ }
+}
+
diff --git a/threadname.hh b/threadname.hh
new file mode 100644
index 0000000..685116c
--- /dev/null
+++ b/threadname.hh
@@ -0,0 +1,25 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+#include <string>
+
+void setThreadName(const std::string& threadName);
diff --git a/uuid-utils.cc b/uuid-utils.cc
new file mode 100644
index 0000000..c59e0a0
--- /dev/null
+++ b/uuid-utils.cc
@@ -0,0 +1,52 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "uuid-utils.hh"
+
+// see https://github.com/boostorg/random/issues/49
+#if BOOST_VERSION == 106900
+#ifndef BOOST_PENDING_INTEGER_LOG2_HPP
+#define BOOST_PENDING_INTEGER_LOG2_HPP
+#include <boost/integer/integer_log2.hpp>
+#endif /* BOOST_PENDING_INTEGER_LOG2_HPP */
+#endif /* BOOST_VERSION */
+
+#include <boost/uuid/uuid_generators.hpp>
+
+// The default of:
+// boost::uuids::random_generator
+// is safe for crypto operations since 1.67.0, but much slower.
+thread_local boost::uuids::basic_random_generator<boost::random::mt19937> t_uuidGenerator;
+
+boost::uuids::uuid getUniqueID()
+{
+ // not safe for crypto, but it could be with Boost >= 1.67.0 by using boost::uuids::random_generator,
+ // which is slower
+ return t_uuidGenerator();
+}
+
+boost::uuids::uuid getUniqueID(const std::string& str)
+{
+ boost::uuids::string_generator gen;
+ return gen(str);
+}
+
diff --git a/uuid-utils.hh b/uuid-utils.hh
new file mode 100644
index 0000000..c1f78d7
--- /dev/null
+++ b/uuid-utils.hh
@@ -0,0 +1,29 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_io.hpp>
+
+/* Not safe for crypto, see the definition for more information */
+boost::uuids::uuid getUniqueID();
+boost::uuids::uuid getUniqueID(const std::string& str);
diff --git a/xpf.cc b/xpf.cc
new file mode 100644
index 0000000..2db6aaf
--- /dev/null
+++ b/xpf.cc
@@ -0,0 +1,118 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "xpf.hh"
+
+std::string generateXPFPayload(bool tcp, const ComboAddress& source, const ComboAddress& destination)
+{
+ if (source.sin4.sin_family != destination.sin4.sin_family) {
+ throw std::runtime_error("The XPF destination and source addresses must be of the same family");
+ }
+
+ std::string ret;
+ const uint8_t version = source.isIPv4() ? 4 : 6;
+ const uint8_t protocol = tcp ? 6 : 17;
+ const size_t addrSize = source.isIPv4() ? sizeof(source.sin4.sin_addr.s_addr) : sizeof(source.sin6.sin6_addr.s6_addr);
+ const uint16_t sourcePort = source.sin4.sin_port;
+ const uint16_t destinationPort = destination.sin4.sin_port;
+
+ ret.reserve(sizeof(version) + sizeof(protocol) + (addrSize * 2) + sizeof(sourcePort) + sizeof(destinationPort));
+
+ ret.append(reinterpret_cast<const char*>(&version), sizeof(version));
+ ret.append(reinterpret_cast<const char*>(&protocol), sizeof(protocol));
+
+ // We already established source and destination sin_family equivalence
+ if (source.isIPv4()) {
+ assert(addrSize == sizeof(source.sin4.sin_addr.s_addr));
+ ret.append(reinterpret_cast<const char*>(&source.sin4.sin_addr.s_addr), addrSize);
+ assert(addrSize == sizeof(destination.sin4.sin_addr.s_addr));
+ ret.append(reinterpret_cast<const char*>(&destination.sin4.sin_addr.s_addr), addrSize);
+ }
+ else {
+ assert(addrSize == sizeof(source.sin6.sin6_addr.s6_addr));
+ ret.append(reinterpret_cast<const char*>(&source.sin6.sin6_addr.s6_addr), addrSize);
+ assert(addrSize == sizeof(destination.sin6.sin6_addr.s6_addr));
+ ret.append(reinterpret_cast<const char*>(&destination.sin6.sin6_addr.s6_addr), addrSize);
+ }
+
+ ret.append(reinterpret_cast<const char*>(&sourcePort), sizeof(sourcePort));
+ ret.append(reinterpret_cast<const char*>(&destinationPort), sizeof(destinationPort));
+
+ return ret;
+}
+
+bool parseXPFPayload(const char* payload, size_t len, ComboAddress& source, ComboAddress* destination)
+{
+ static const size_t addr4Size = sizeof(source.sin4.sin_addr.s_addr);
+ static const size_t addr6Size = sizeof(source.sin6.sin6_addr.s6_addr);
+ uint8_t version;
+ uint8_t protocol;
+ uint16_t sourcePort;
+ uint16_t destinationPort;
+
+ if (len != (sizeof(version) + sizeof(protocol) + (addr4Size * 2) + sizeof(sourcePort) + sizeof(destinationPort)) &&
+ len != (sizeof(version) + sizeof(protocol) + (addr6Size * 2) + sizeof(sourcePort) + sizeof(destinationPort))) {
+ return false;
+ }
+
+ size_t pos = 0;
+
+ memcpy(&version, payload + pos, sizeof(version));
+ pos += sizeof(version);
+
+ if (version != 4 && version != 6) {
+ return false;
+ }
+
+ memcpy(&protocol, payload + pos, sizeof(protocol));
+ pos += sizeof(protocol);
+
+ if (protocol != 6 && protocol != 17) {
+ return false;
+ }
+
+ const size_t addrSize = version == 4 ? sizeof(source.sin4.sin_addr.s_addr) : sizeof(source.sin6.sin6_addr.s6_addr);
+ if (len - pos != ((addrSize * 2) + sizeof(sourcePort) + sizeof(destinationPort))) {
+ return false;
+ }
+
+ source = makeComboAddressFromRaw(version, payload + pos, addrSize);
+ pos += addrSize;
+ if (destination != nullptr) {
+ *destination = makeComboAddressFromRaw(version, payload + pos, addrSize);
+ }
+ pos += addrSize;
+
+ memcpy(&sourcePort, payload + pos, sizeof(sourcePort));
+ pos += sizeof(sourcePort);
+ source.sin4.sin_port = sourcePort;
+
+ memcpy(&destinationPort, payload + pos, sizeof(destinationPort));
+ pos += sizeof(destinationPort);
+ (void) pos;
+
+ if (destination != nullptr) {
+ destination->sin4.sin_port = destinationPort;
+ }
+
+ return true;
+}
diff --git a/xpf.hh b/xpf.hh
new file mode 100644
index 0000000..4e8f466
--- /dev/null
+++ b/xpf.hh
@@ -0,0 +1,29 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#pragma once
+
+#include <iputils.hh>
+
+std::string generateXPFPayload(bool tcp, const ComboAddress& source, const ComboAddress& destination);
+bool parseXPFPayload(const char* payload, size_t len, ComboAddress& source, ComboAddress* destination);
+